0% found this document useful (0 votes)
6 views

CAS 2023 Lecture3 LectureNotes

Uploaded by

Asaad waqar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

CAS 2023 Lecture3 LectureNotes

Uploaded by

Asaad waqar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1.6.

INPUT/OUTPUT REPRESENTATIONS

1.6 Input/Output representations


Early control techniques and what is now called classical control engineering
considers mostly linear time-invariant systems, and in this context, the so-called
Transfer Functions are widely used. Simply put, a Transfer Function (TF) is an
input/output framework which represents how an input u is “transformed” into
output y. A Transfer Function is expressed in the Laplace domain using the
complex variable s (with s 2 C). Let us recall a few results related to Transfer
Functions in this section.

1.6.1 From ODEs to TFs


Obtaining a Transfer Function from a linear ODE is actually quite simple. As
an example, start with the second-order di↵erential equation given by
ÿ(t) + a1 ẏ(t) + a0 y(t) = b1 u̇(t) + b0 u(t) (1.131)
where we assume to have zero initial conditions. Then, recalling that, if y(t) in
the time domain gives Y (s) in the Laplace domain, then the first time-derivative
ẏ(t) gives sY (s) in the Laplace domain, while ÿ(t) gives in turn s2 Y (s) and so
on for higher-order derivatives. Hence, equation (1.131) is transformed into
s2 Y (s) + a1 sY (s) + a0 Y (s) = b1 sU (s) + b0 U (s). (1.132)
After a simple factorization, we get
(s2 + a1 s + a0 )Y (s) = (b1 s + b0 )U (s) (1.133)
so that we have
b 1 s + b0
Y (s) = U (s) = P (s)U (s) (1.134)
s 2 + a1 s + a0
where P (s) is the Transfer Function of system/plant (1.131).
For more general linear systems, we have therefore
Y (s) b m s m + . . . + b 1 s + b0 np (s)
= n = P (s) = (1.135)
U (s) s + . . . + a1 s + a0 dp (s)
where the numerator np (s) = bm sm + . . . + b1 s + b0 is a polynomial whose roots
are called the zeros of Transfer Function P (s), while the roots of polynomial
denominator dp (s) = sn + . . . + a1 s + a0 are called the poles of P (s).

1.6.2 A simple stability criterion


The main advantage of Transfer Functions over linear ODEs is that TFs are al-
gebraic equations instead of di↵erential equations (as in ODEs). And the former
are generally easier to manipulate and solve. Hence, the Laplace domain and
TFs are useful for a wide range of computations and results, including assessing
whether a system is stable or not, as the following simple result shows.

Stability criterion: A system described by Transfer Function P (s) is said


to be stable if and only if the real part of each pole (i.e. each root of denomi-
nator dp (s)) is strictly negative3 .

3 We also typically say “in the left half-plane”, where plane is meant for complex plane.

31
1.6. INPUT/OUTPUT REPRESENTATIONS

Figure 1.20: Two linear systems in cascade

Figure 1.21: Controller and plant in feedback loop with unitary gain

1.6.3 Combining Transfer Functions


Combining two (or more) TFs gives yet another Transfer Function. But let us
see more concretely in the following couple of examples.

Example: cascade of two systems


Consider the systems connected in cascade as illustrated in Figure 1.20, whose
input/output representation is

V (s) = F (s)U (s) (1.136)

for the first (sub)system with TF F (s) (say a filter) and

Y (s) = P (s)V (s) (1.137)

for the second (sub)system, with TF P (s) (say the considered plant). Combining
now (1.136) and (1.137), we get the IO relation

Y (s) = P (s)F (s)U (s) (1.138)

where H(s) = P (s)F (s) is the Transfer Function of the overall system.

Example: feedback controller with unitary gain


Consider now a plant regulated by a controller with unitary feedback as illus-
trated in Figure 1.21, and where variable e(t) is called the error and r(t) is
the reference that we want the output y(t) to follow. Hence error signal e(t) is

32
1.6. INPUT/OUTPUT REPRESENTATIONS

defined as e(t) := r(t) y(t).


Using the results of the previous example and taking E(s) as the Laplace trans-
form of e(t), we have
Y (s) = P (s)C(s)E(s), (1.139)
while the very definition of the error variable e(t) gives

E(s) = R(s) Y (s). (1.140)

Combine now (1.139) and (1.140), we get

Y (s) = P (s)C(s) [R(s) Y (s)] . (1.141)

Isolating then Y (s), we get

[1 + P (s)C(s)] Y (s) = P (s)C(s)R(s), (1.142)

which gives the new Transfer Function

Y (s) P (s)C(s)
H(s) = = . (1.143)
R(s) 1 + P (s)C(s)

In order to check whether H(s) is stable or not, rewrite (1.143) in terms of


numerators and denumerators of both the plant and controller:

np (s)nc (s) np (s)nc (s)


Y (s) dp (s)dc (s) dp (s)dc (s)
H(s) = = = (1.144)
R(s) np (s)nc (s) dp (s)dc (s) + np (s)nc (s)
1+
dp (s)dc (s) dp (s)dc (s)

which simplifies to
np (s)nc (s)
H(s) = . (1.145)
dp (s)dc (s) + np (s)nc (s)
Hence, H(s) is stable if and only if the roots of dp (s)dc (s) + np (s)nc (s) are in
the left half-plane.

1.6.4 Bode plots


A fundamental aspects of linear time-invariant systems, is that they preserve
the nature of sinusoidal signals. Indeed, applying an input signal

u(t) = sin(!t) (1.146)

to the system leads to the output signal

y(t) = A sin(!t + ') (1.147)

where both the amplitude A and the phase ' depend on angular frequency !!
Hence, one can perform a frequency analysis of a linear system by sweeping a
range of sine waves at the input and see how they are amplified or reduced in
amplitude (through A) and shifted in time (through '). In this case, a dynamical
system with input and output is seen here as a filter: what frequencies are
attenuated, what frequencies are amplified, etc.

33
1.6. INPUT/OUTPUT REPRESENTATIONS

Figure 1.22: Bode plots of a “resonant” Mass-Spring-Damper system

The so-called Bode plots are just that: two di↵erent plots where a TF P (s) is
evaluated at s = j!. One is called the magnitude plot and is defined by
A = |P (s = j!)| , ! 2 R+ , (1.148)
while the phase plot can be simply obtained by the expression
' = arg(P (s = j!)) , ! 2 R+ . (1.149)
The phase plot is represented on a semi-log scale, with the log scale being on
the angular frequencies, while the magnitude plot is represented on a log-log
scale, i.e. we compute, instead of (1.148), 20 log10 |P (s = j!)|, and where the
units are decibels.
In Matlab, the Bode plot are obtained readily by the command bode. In figure
1.22 are given the Bode plots of an MSD system for m = 10, d = 0.1 and k = 5.

1.6.5 Zero-frequency gain


The zero-frequency gain, also called Direct Current gain, is simply the value of
the considered Transfer Function P (s) when s = 0 or ! = 0. In control systems,
the zero-frequency gain is an important notion, particularly when the control
objective is to stabilize the system around a constant reference. Indeed, the zero-
frequency gain indicates how a constant level on the input u is amplified/reduced
on the output y.

Example: MSD system


Let us come back to our (in)famous MSD system, whose di↵erential equation is
mÿ(t) + dẏ(t) + ky(t) = u(t) (1.150)

34
1.6. INPUT/OUTPUT REPRESENTATIONS

The corresponding TF can be obtained by starting with

ms2 Y (s) + dsY (s) + kY (s) = U (s), (1.151)

which can be then factorized into

ms2 + ds + k Y (s) = U (s) (1.152)

so that we have the TF


Y (s) 1 1/m
= P (s) = = 2 (1.153)
U (s) ms2 + ds + k s + (d/m)s + k/m

The zero-frequency gain is then P (0) = 1/k.

35
Chapter 2

Feedback control

2.1 Introduction
Roughly speaking, feedback control can be seen as making corrections so that a
system (or its output y(t) or the state x(t)) behaves as you want, i.e follow some
desired behavior (follows a reference r(t) or a desired trajectory yd (t), etc.). Ide-
ally, this should happen even when the system is starting not where you thought
it would be starting from (di↵erent initial conditions), even when “something”
is pushing the system away (disturbances) or when the system turns out to not
be exactly what you thought it would be (system uncertainties).
In this chapter, our primary focus will be on state-space control techniques, after
a very simple discussion on stability. But before doing so, let recall a few basics
on the most famous feedback controller of all time, the Proportional-Integral-
Derivative controller.

2.2 A primer on PID control


Following our short reminder of Transfer Functions in the previous chapter, a
PID controller can be seen as feedback controller with unitary feedback gain
(see Figure 1.21), where the Transfer Function C(s) is given by
C(s) = kp + ki /s + kd s (2.1)
or, expressed in the time domain, we have
Z t
u(t) = kp e(t) + kd ė(t) + ki e(⌧ )d⌧ (2.2)
0
where we recall that e(t) := r(t) y(t) (as illustrated in Figure 2.1).
While there indeed a lot of interesting things that can be said on the PID
controller, let us just recall a few keypoints, starting with the role of each of the
three terms.

Roles of the di↵erent terms:


• P term: the primary role of the P term is to actually stabilize the system,
ie to “attach it somewhere so that it won’t go away”.

36
2.2. A PRIMER ON PID CONTROL

Figure 2.1: The Proportional-Integral-Derivative controller

• I term: this term uses the history of the di↵erence between the output and
the reference signal to infer the (typically) constant part of the control
signal that will make the system output y(t) stabilize right on r(t), as well
as compensating for constant to slowly-varying disturbances acting on the
system.
• D term: finally, the D term helps to smooth things out, roughly speaking
by adding damping in the system, so that the convergence of output y(t)
is not too oscillatory.

2.2.1 Tuning the controller: the Ziegler-Nichols rule


Tuning a PID controller can either be quite straightforward or a bit more del-
icate depending on a given plant, the environment where it evolves (possible
disturbances, noise), as well as any specific desired operating conditions (eg.
energy savings, wear and tear of actuator, etc.). Over the years, many guide-
lines were proposed to help a user to tune a PID controller on a specific plant.
Amont them, the Ziegler-Nichols method is probably the most well-known. How
it works can be summarized through the several few points given below.
• Start by putting all gains to 0.
• Change kp until you can make the output y oscillate. When this happens,
note the value of kp and put it in kc . Note then the period of oscillation
Tc .
• Set the gain of your PID controller to
kp
kp = 0.6kc , ki = , kd = kp 0.125Tc (2.3)
0.5Tc

Note that, even if this method works for a large class of systems, it does not do
so for all systems. Furthermore, as mentioned above, these are just guidelines,
and as such, they can be used to get a first rough tuning of the PID controller.

37
2.2. A PRIMER ON PID CONTROL

Figure 2.2: A modification of the PID controller

It is usually possible, if not recommended, to tune the di↵erent terms further


manually to get better results.

2.2.2 Two implementation tips and tricks


Expression (2.1) (and its time-domain counterpart (2.2)) is, in a sense, the ideal
or canonical way to express the essence of a PID controller. Indeed, the names
of the di↵erent terms translate directly into the corresponding mathematical
expression. However, direct implementation of (2.1) or (2.2) can, in practise,
lead to several issues, some of which might be important depending on the
application. While the literature is full of ways to solve these issues, let us see
for now two “tips and tricks” that are frequently used in PID control.

Derivative term
As we have already discussed when making block diagrams out of di↵erential
equations, computing the derivative of a signal could be an issue because of
added noise. It is especially relevant in the present case for PID control, as the
derivative term implies the derivative of the error signal e(r). The error con-
taining the measurement noise-corrupted output y(t), calculating ė(t) directly
will inject amplified noise into the closed-loop.
A simple way to remedy that is to replace the pure derivative term by a simple
derivative filter, whose role is to remove the high-frequency component of the
noise. Hence, expressed in the Laplace domain, the derivative term being given
as
kd sE(s) (2.4)
is then changed into a pre-filtered version of E(s), i.e. we have

1/Tf
kd s E(s) (2.5)
s + 1/Tf

38
2.2. A PRIMER ON PID CONTROL

with
1/Tf
(2.6)
s + 1/Tf
being a simple low-pass filter.

“Jumps” in the reference signal r(t)


The reference signal r(t) is typically set by the user. In case he/she suddenly
change his mind about which constant reference should be followed by the sys-
tem, we could therefore have a step input signal representing this change. The
problem is that such a jump on signal r(t) creates another jump at the output
of proportional term kp , hence in the contol input u(t) sent to the actuator of
the plant (see path followed by r(t) to u(t) in Figure 2.1), thus “shaking” it
quite abruptly. This might have some bad e↵ect depending on the considered
plant. Even worse, the derivative term kd implies a di↵erentiation of the step
signal, leading to an impulse being applied to the actuator , which is clearly not
suitable for many mechanical systems, for example.
While we could also avoid that using a low-pass filter, as we have seen before,
another trick is simply to pass the reference signal r(t) only to the integrator,
as seen in Figure 2.2. In this case, only the output y(t) is passed to both the
proportional and derivative term. Mathematically, we hence replace (2.2) by
Z t
u(t) = kp ( y(t)) + kd ( ẏ(t)) + ki (r(⌧ ) y(⌧ ))d⌧ . (2.7)
0

It can actually be proven that controller (2.7) is still able to stabilize a system
around a constant reference signal r despite the absence of e(t) in the propor-
tional and derivative terms.

39

You might also like