EE5103 - 21 - 22 - Part I
EE5103 - 21 - 22 - Part I
Part I
Xiang Cheng
Dept. of Electrical and Computer Engineering
National University of Singapore
Contents
1
2.7 Transfer Function from Continuous Time to Discrete Systems 53
2.8 Poles and Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.9 Notes and References . . . . . . . . . . . . . . . . . . . . . . . 59
2
4.5.2 Two-Degree-of-Freedom Controller . . . . . . . . . . . 113
4.5.3 Putting It All Together . . . . . . . . . . . . . . . . . 115
3
Chapter 1
Questions of control have been of great interest since ancient times, and are
assuming major importance in modern society. By the “control of a system”
we mean the ability to influence its behavior so as to achieve a desired goal.
Control mechanisms are ubiquitous in living organisms, and the design of
self-regulating systems by human beings also has a long history. These sys-
tems range from water clocks in antiquity to aqueducts in early Rome, from
Watt’s steam engine governor in 1769 which ushered in the Industrial Revo-
lution in England, to the sophisticated automobiles, robots, and unmanned
aircraft in the modern times.
The main purpose of this module is to teach you the most fundamental
concepts and tools in designing a control system for real world problems.
Both computer control theory and applications will be discussed. For the
first half of this module, our focus will be only upon the control theory, and
I will leave the practical applications and design issues to the later stage.
Therefore, the first question I would like to raise is: what is control theory
all about?
4
1.1.1 Systems
Intuitively, we can consider a system to be a set of interacting components
subject to various inputs and producing various outputs. In fact system is
such a general concept that there is no universally accepted definition. Ev-
eryone has his/her own view of what a system should look like. It is like the
concept of set in mathematics, everyone knows what a set is, but we cannot
define a set! Likewise, we cannot define a system precisely!
The student may object, “I do not like this imprecision, I should like to have
everything defined exactly; in fact, it says in some books that any science
is an exact subject, in which everything is defined precisely.” But the truth
is, if you insist upon a precise definition of system, you will never get it!
For example, philosophers are always saying, “Well, just take a chair for ex-
ample.” The moment they say that, you know that they do not know what
they are talking about any more. What is a chair? Well, a chair is a certain
thing over there ... certain? how certain? The atoms are evaporating from
it from time to time – not many atoms, but a few — dirt falls on it and gets
dissolved in the paint; so to define a chair precisely, to say exactly which
atoms are paint that belongs to the chair is impossible.
5
Let’s return to the concept of “system”. Some people would insist that
system must contain certain internal components, while others may argue
that any object in the world can be considered as a system. Can we say that
a single electron is a system? That is definitely debatable! How about your
mind? do you consider it as a system? Well, we don’t have to quarrel over
the definition of the system, which we will happily leave to the philosophers.
We can attack a problem without knowing the precise definition! Let’s just
look at the various types of systems around us:
This brief list, however, is sufficient to emphasize the fact that one of the
most profound concepts in current culture is that of a “system”.
Frequently, Fig1.1 is much too crude and one prefers the following diagram
to indicate the fact that a system usually has a variety of inputs and outputs:
6
Figure 1.1: The simplest block diagram of a system
But wait a minute, we have not discussed the meaning of input. What is
input?
Input: the attributes which can be varied by the controller. (Car driving
example: brake, gas paddle, steering wheel)
Hey, you may wonder: can we consider noise, or disturbance (which cannot
be varied by the man-made controller easily) as input? Yes and No. It all
depends upon your point of view. If you adopt a very broad view of the
input as any factors that can affect the behavior of the system, then the
answer is yes. But if you limit it to the things that can be manipulated,
then all those uncontrollable factors such as noise have to be distinguished
from a normal input. Once again, don’t try to find a precise definition of
“input”, as you may get into trouble again. But you never bother about it,
as in reality, the meaning of the input is usually self evident for any specific
control system.
What is output?
Output: the attributes of a system which are of interest to you, and are
observed carefully, but not varied directly. (Car driving example: position
and velocity of the car)
7
But there is no clear cut between input and output, it all depends upon
which aspect of the system you are looking at! In multi-stage production
process, or chemical separation process, we may employ a block diagram as
shown in Fig.1.3. Fig 1.3 indicates that the inputs u1 , u2 to subsystems S1
produce outputs y1 , y2 , that are themselves inputs to subsystem S2 , and so
on until the final output.
It is better to think of inputs and outputs in terms of cause and effect. For
a certain system, inputs are the signals to drive the dynamics of the system
and the outputs are the effects of the inputs. However, we cannot define
precisely what inputs and outputs are!
Fig1.4 brings clearly to the fore that there are internal subsystems which we
can neither directly examine nor influence. The associated question of iden-
tification and control of S3 are quite challenging. And it depends upon how
much you know about the internal system. In particular, it depends upon
whether any mathematical models are available for the various subsystems.
8
1.1.3 Mathematical Systems
It cannot be too strongly emphasized that real systems possess many differ-
ent conceptual and mathematical realizations. Each mathematical descrip-
tion serves its own purpose and possesses certain advantages and disadvan-
tages. There is no such universal mathematical model that can serve every
purpose.
Different models serve different purposes. Once the mathematical die has
been cast, equations assume a life of their own and can easily end by be-
coming master rather than servant. But as an engineer, you must always
check the physical meanings of the various variables you are studying.
9
• Ecological systems: pests and drought; green house effect.
What we can conclude from this sorry recital is that systems do indeed re-
quire care. They do not operate in a completely satisfactory manner by
themselves. That’s why control theory can play very important role in the
real world. On the other hand, as we shall see, the cost of supervision must
be kept clearly in mind. This cost may be spelled out in terms of resources,
money, manpower, time, or complexity.
Fortunately, for engineers, we don’t have to make this hard decision. Your
boss makes the call! (but what if you become the boss in the future?) It
is our primary concern to improve the behavior of any specific engineering
system.
So in the next section, we are going to discuss how to improve the perfor-
mance of a system.
In some cases, such as, say fixing an old car, a new system may be the ideal
solution. In other cases, say the human body or an economical system, re-
placement is not a feasible procedure. We shall think in terms of the more
feasible program of altering the design of the system or in terms of modifying
the inputs, or both. In reality, there are always multiple solutions to fix the
10
problems. The choice of the solutions would depend upon your requirement
and your resource. For instance, if an old car keeps giving you headaches,
how are you going to fix that? If you are a rich man, then the solution is
simple, just buy a new one. If you are a poor student, probably you will
send it to a garage and have the engine or other parts replaced. But before
we go into further details, let’s try to give a rough definition of control.
Control: influence the behavior of the system to achieve a desired goal.
Control theory mostly concerns about the third way: how to change the
inputs such that the outputs behave in a desired fashion.
Usually the goal of automatic control for industrial systems is maintaining
one or more outputs around some desired constant or time-varying values.
11
Figure 1.6: A closed-loop system
Once again we have to emphasize that control theory is about applying the
idea of feedback to build a self-regulating system. Since the systems can be
represented in terms of differential or difference equations, it is sometimes
misleading to think that the control theory is about solving or analyzing the
differential equations, which is totally wrong.
In the next, we are going to study a simple example to show why feedback
is playing the central role in controller design.
12
Figure 1.7: A single-link rotational joint
m — mass
l — length of rod
g — acceleration due to gravity
u(t) — external torque at time t — input
θ(t) — counterclockwise angle of the pendulum at time t — output
Once the system is chosen, the first step is building a mathematical model.
But how to build a model? It depends upon how much knowledge you have.
There are basically three ways:
• Grey Box
White-box is always the first option you should consider for modeling if
possible. We assume the friction is negligible, and all of the mass is con-
centrated at the end. From Newton’s second law, the change rate of the
angular momentum is proportional to the external torque, we have
To avoid keeping track of constants, let’s assume that the units of time and
distance have been chosen such that
ml2 = mgl = 1
13
1.2.2 Mathematical analysis of the model
What are the equilibrium positions when there is no torque?
The equilibrium positions are the positions where θ̈ = 0, and θ̇ = 0.
Equilibrium positions:
1. θ̇ = 0, θ = 0 : Stable position
2. θ̇ = 0, θ = π : Unstable position
Stable:
If you change the initial condition a little bit, the dynamics of the system
will change a little bit, but not too much.
Unstable:
If the initial conditions are just a bit different, the dynamic behaviors of the
system are dramatically different.
Asymptotic stable:
Not only stable but also the response of the system will converge to the
equilibrium point.
Before we design the controller, we have to be clear about the objective we
try to achieve.
Control objective:
Apply torque u(t) to stabilize the inverted pendulum such that the pendu-
lum will maintain the upright position (θ = π).
Now please try to put a pen or pencil in your finger tip, and keep it upright.
Can you do that? Is it simple? Then try it again, but this time with your
eyes closed! Can you do that? Why can’t you do it? Because there is little
feedback information when your eyes are closed! By now I hope you would
appreciate the importance of the feedback principle. Now let’s see if we can
make a machine to imitate what we can do.
14
Since equation (1.2) is just a second-order differential equation, why don’t
we try to solve it directly? Would it be wonderful that we can work out the
solution to this ODE? If the solution is available to us, perhaps it can help
us in designing the control system.
θ̈(t) = 0.
And we have
Now the nonlinear system becomes a well-behaved second order linear sys-
tem. Remember you still have freedom to use uf f (t). Simply choose a
15
constant uf f (t) = π. This trick used the idea of converting a nonlinear
system into linear ones, which actually is the most widely used technique to
study nonlinear systems. Of course, we don’t have time to study all those
tricks for nonlinear systems, we will limit our interests to linear systems in
our module.
If only small deviations are of interest, we can linearize the system around
the equilibrium point.
For small θ − π,
Linearization principal:
Design based on linearizations works locally for the original nonlinear sys-
tem. Local means that satisfactory behavior only can be expected for those
initial conditions that are close to the point about which linearization was
made. The bad news is that the design may not work if the deviations from
the operating points are large.
16
Figure 1.8: Superposition Principle
u = a1 φ1 + a2 φ2 + ....
where the coefficients aλ , λ = 1, 2, ... , are constants representing the “weights”
of the component time functions φ1 , φ2 ... in u. Now, if the system is linear,
then the response of the system to input u, A(u), can be expressed as an
infinite series
2. calculating A(φλ ), λ = 1, 2, .
This basic procedure appears in various guises in many of the methods used
to analyze the behavior of linear systems. In general, the set of component
17
time functions φλ is a continuum rather than a countable set, and the sum-
mations are expressed as integrals in which λ plays the role of variable of
integration.
Remark: It is important to think of the integration as approximation by
summation for understanding many of the concepts and properties of the
system.
Example of application of superposition principle:
Choose component functions as est , where s = σ+jω is the complex variable.
Try the response function as H(s)est , and plug it into the pendulum Eqn.
(1.3), we have
s2 H(s)est − H(s)est = est (1.4)
we obtain
1
H(s) = . (1.5)
s2
−1
Hence H(s)est is indeed the response to est , which can be easily determined.
Consider the special case of unit step input, where s = 0, the response is
H(0). Therefore, the static (or steady state) gain is simply H(0).
Question: Can we decompose u(t) by est ?
Yes! The input u(t) can be decomposed by est
Z a+j∞
1
u(t) = F (s)est ds (1.6)
2πj a−j∞
But what is F (s)?
F (s) is the Laplace transform of u(t)!
Z ∞
L[u(t)] = F (s) = u(t)e−st dt (1.7)
0
Did you ever wonder why Laplace transform is such a wonderful tool for
analyzing linear system? It is rooted in the superposition principle!
There are many nice properties of Laplace transform, among which two of
them are the most often used.
18
1. L[f (n) (t)] = sn L[f (t)] − sn−1 f (0) − sn−2 f 0 (0) − ... − f (n−1) (0)
Remark : if the initial conditions are zero, we simply replace the
differential operator d/dt with s:
d
⇔s
dt
If f 1 and f 2 are one sided, ie. vanish for all t < 0, then
Zt
f1 (t) ∗ f2 (t) = f1 (τ )f2 (t − τ )dτ
0
L[y(t)] = Y (s)
L[u(t)] = U (s)
Then
L[ÿ(t)] = s2 Y (s) − sy(0) − y 0 (0) (1.8)
Substitute them into Eqn. (1.3), we have
But hold on, you may argue that this solution Y (s) does not look like any
other familiar solutions in time domain. In order to get the time-domain
19
solution, you may just transform it back by partial fraction expansion and
look them up in the Laplace transform table.
1 1 1 1 1
L−1 [H(s)] = L−1 [ ] = L−1 [ ( − )] = (et − e−t )
s2
−1 2 s−1 s+1 2
−1 −1 s −1 1 1 1 1
L [sH(s)] = L [ 2 ]=L [ ( + )] = (et + e−t )
s −1 2 s−1 s+1 2
Z t
1 t−τ
L−1 [H(s)U (s)] = h(t) ∗ u(t) = (e − e−(t−τ ) )u(τ )dτ
2
0
20
this, transfer function also has other meanings.
What’s the relation between impulse response and transfer function? Im-
pulse function is a mathematical description of a signal which takes a huge
value for a very short period and then vanish elsewhere. For instance, im-
pulse function can be used to describe the force resulting from a hammer
hitting the table.
Now let the input be the impulse, u(t) = δ(t), then U (s) = 1, and Y (s) =
U (s)H(s) = H(s)
Hence the transfer function is the Laplace transform of the impulse response.
In other words, transfer function is the impulse response in the frequency
domain.
In general, consider
dn y dn−1 y dm u dm−1 u
an + a n−1 + ... + a 0 y = bm + bm−1 + ... + b0 u
dtn dtn−1 dtm dtm−1
(an sn + an−1 sn−1 + ... + a0 )Y (s) = (bm sm + bm−1 sm−1 + ... + b0 )U (s)
Y (s) = H(s)U (s)
Stability criterion:
If all poles have negative real parts then the system is stable!
Why?
If λ is the pole, then eλt is one component of the impulse response (verified
by partial fraction expansion of the transfer function). So if all the poles
have the negative real parts, the impulse response will decrease to zero! But
what does impulse response have to do with stability?
21
Stability concerns the behavior of the system without external input when
the initial condition is perturbed from the equilibrium point, say zero. What
is the catch here?
If an impulse input is applied to a system in equilibrium position, this im-
pulse will certainly excite the states of the system from zero conditions (equi-
librium positions) into some non-zero values (non-equilibrium positions),
and then all the inputs are zero immediately after t = 0. Therefore, impulse
response can describe the behavior of the system with deviations from the
equilibrium points. Then the stability will depend upon whether the devia-
tions will be magnified or attenuated. If all the poles contain negative real
parts, then the impulse response will converge to zero since each component
eλt goes to zero. Hence the system is stable.
Control Goal
Our objective is to bring y and y 0 to zero, for any small nonzero initial con-
ditions, and preferably to do so as fast as possible, with few oscillations, and
without ever letting the angle and velocity become too large. Although this
is a highly simplified system, this kind of “servo” problem illustrates what
22
is done in engineering practice. One typically wants to achieve a desired
value for certain variables, such as the correct idling speed in an automo-
bile’s electronic ignition system or the position of the read/write head in a
disk drive controller.
But why do we require that the initial values are small? Because the lin-
earized model only works locally for nonlinear systems!
u(t) = 3e−2t
or
3
U (s) =
s+2
Then
1 3
Y (s) = (s − 2) + 2
s2 − 1 (s − 1)(s + 2)
(s − 2)(s + 2) + 3
=
(s2 − 1)(s + 2) (1.14)
1
= ⇒ e−2t
s+2
It is certainly true that y(t) and its derivative approach zero, actually rather
quickly. It looks like the control problem is solved satisfactorily. However,
23
there is one serious problem with this control method. If we made any mis-
takes in estimating the initial velocity, the control result will be disastrous.
For instance, if the differential equation is again solved with the same control
input, but now using instead the initial conditions:
y(0) = 1, y 0 (0) = −2 + ε
dy
+y =0
dt
24
s−1
and from H2 (s) = (s+1)(s−1) , we have
d2 y
−y =0
dt2
Obviously one solution will converge to zero, and the other solution will
blow up to infinity!
I hope at this moment you are certain that the unstable poles cannot be
simply canceled out by zeros. And we can conclude that the open loop
control can not achieve the goal very well. What we need is a controller
such that the system returns to equilibrium position rapidly regardless of
the nature of the small perturbations, or the time at which it occurs.
One way to accomplish this is to take u(t) not to depend upon the time t,
but rather upon the state of the system, y and y 0 . Thus, we write
u = g(y, y 0 ) (1.16)
This is exactly a feedback controller: the control inputs depend upon the
output, not upon time! This also how you keep your pen upright in your
palm. You watch the pen (measure and compare) and move your hand
accordingly (control). Again, we can see control theory is not about how to
solve the differential equations, but on how to apply the idea of feedback.
Kp s21−1 Kp
Hcl (s) = Kp
=
1+ s2 − 1 + Kp
s2 −1
Where are the poles? p
s = ± 1 − Kp (1.18)
25
Figure 1.12: Proportional Control
(Kp + Kd s) s21−1 Kp + Kd s
Hcl (s) = = (1.19)
1+
(Kp +Kd s) s2 + Kd s + Kp − 1
s2 −1
Then is it possible to choose the gains Kp and Kd such that the overall
system is asymptotically stable?
It is evident that as long as Kp > 1 and Kd > 0, the closed loop will be
stable. Further more, the poles of the closed loop can be placed at any
desired position by choosing proper gains.
We conclude from the above discussion that through a suitable choice of the
gains Kp and Kd it is possible to attain the desired behavior, at least for
26
Figure 1.13: Proportional and Derivative Control
the linearized model. That this same design will still work for the original
nonlinear model is due to what is perhaps the most important fact in control
theory – and for the matter in much of mathematics – namely that first or-
der approximations are sufficient to characterize local behavior. Informally,
we have the following linearization principle:
Design based on linearizations works locally for the original nonlinear sys-
tem.
In the next section, we will see how to solve the control problem using a
different approach.
27
Figure 1.14: State at time t
state at time t0 (present) separates the future from the past by providing
all the information about the past of the system that is relevant to the de-
termination of the response of the system to any input starting from t0 . In
other words, the future of the system can be completely determined by the
knowledge of current state combining with the present and future inputs.
To find the right state variable, basically we have to answer the following
question: What information is really needed for predicting the future as-
suming we have the complete information about the past and the present of
the system combining with the inputs information?
1.3.1 Examples
Pendulum problem
ÿ(t) − y(t) = u(t) (1.20)
At present time t0 , what do we have to specify in order to determine y(t)
in the future? Obviously the knowledge of the initial condition y(0), y 0 (0)
would suffice. So the state variable of the pendulum at any time t can be
defined as
x(t) = [y(t), y 0 (t)] (1.21)
Order: The dimension of the state. In the pendulum case, it is second
order system.
28
time-delay in continuous time system.
Question: what is the state for the pendulum with delayed input as shown
below?
ÿ(t) − y(t) = u(t − d)
1.3.2 Properties
By definition of state we have following map:
There are many properties associate with the concept of state, and the most
important is the
Separation property
The present state separates the past from the future, and the future only
depends upon the present state. In other words, all the past information
relevant for determining the future of the system is compacted into the cur-
rent state.
More specifically, for any input consisting of a segment u[t0 ,t1 ] followed by a
segment u[t1 ,t] , the response of the system to the whole segment u[t0 ,t] start-
ing from initial state x(t0 ) consists of the response segment Y (x(t0 ); u[t0 ,t1 ] )
followed by the response segment Y (x(t1 ); u[t1 ,t] ), where x(t1 ) is the state
of the system at time t1 . x(t1 ) in a sense separates the past response
Y (x(t0 ); u[t0 ,t1 ] ) from the future response Y (x(t1 ); u[t1 ,t] ) at time t1 . And
x(t) = x(x(t0 ); u[t0 ,t] ) = x(x(t1 ); u[t1 ,t] ) = x(x(x(t0 ); u[t0 ,t1 ] ); u[t1 ,t] ) (1.24)
29
Decomposition property of linear system
or in matrix form
ẋ = Ax + bu
(1.26)
y = cx
where " #
0
0 1
A= , b= , c= 1 0
1 0 1
Note: the original second order differential equation has been transformed
into a first order differential equation of state vectors.
30
by Laplace transform as follows.
sX(s) − x(0) = AX(s) + bU (s)
1 bU (s)
X(s) = x(0) +
s−A s−A
Zt
At
x(t) = e x(0) + eA(t−τ ) bu(τ )dτ
0
(1.27)
Zt
y = cx = ceAt x(0) + c eA(t−τ ) bu(τ )dτ
0
Now if x is a vector, can we still write the solution in such forms?
Fortunately, even if x is a vector, the solution still takes above form, where
tk
eAt = I + At + ... + Ak + ... (1.28)
k!
31
What’s the corresponding transfer function?
Setting X(0) = 0,
We have
Y (s) = H(s)U (s)
And
CB(s)b
H(s) = C(sI − A)−1 b = (1.29)
d(s)
u = g(x) (1.30)
Now the question becomes an algebraic one: given pair (A, b), can we choose
proper k such that the eigenvalues of (A − bk) can match any set of n eigen-
values?
We will examine this question in greater detail later in this module. Let’s
just take a look at the pendulum example.
32
where
k= k1 k2
Remark: the previous PD (proportional and derivative) controller is the
same as this, just with a different notation.
Plug this control input into the equation, we have
ẋ = Ax + bu = (A − bk)x (1.35)
where
0 1
A − bk =
1 − k1 −k2
The characteristic equation of the closed loop systems
where ζ and ωn are the desired damping ratio and natural frequency of the
closed loop system.
Just let
k2 = 2ζωn
(1.38)
k1 − 1 = ωn2
33
• What is the transfer function for discrete-time system?
34
Chapter 2
2.1 Introduction
What is Computer Control? Literally, the answer is simple. The controller
is implemented by a computer and the input is calculated by the controller!
Practically all control systems that are implemented today are based on com-
puter control. It is therefore important to understand computer-controlled
systems well. Such systems can be viewed as approximations of analog-
control systems, but this is a poor approach because the full potential of
computer control is not used. At best the results are only as good as
those obtained with analog control. It is much better to master computer-
controlled systems, so that the full potential of computer control can be
used. There are also phenomena that occur in computer-controlled sys-
tems that have no correspondence in analog systems. It is important for
an engineer to understand this. The main goal of this module is to provide
a solid background for understanding, analyzing, and designing computer-
controlled systems.
35
Figure 2.1: Schematic diagram of a computer-controlled system.
Between the sampling instants, the input would be a constant due to zero-
order hold. Now an interesting question is: is the controller open-loop,
or feedback control between the sampling instants? Since the input is a
constant regardless of what happens in the output during this period, the
system runs open loop in the time interval between the sampling instants.
36
Figure 2.2: A system for controlling the position of the arm of a disk drive.
We will give examples that illustrate the differences and the similarities of
analog and computer-controlled systems. It will be shown that essential new
phenomena that require theoretical attention do indeed occur.
Let J be the moment of inertia of the arm assembly. The dynamics re-
lating the position y of the arm to the voltage u of the drive amplifier is
approximately described by the Newton’s law,
J ÿ(t) = u(t)
37
the corresponding transfer function is
k
G(s) = (2.1)
Js2
where k is a constant. The purpose of the control system is to control the
position of the arm so that the head follows a given track and that it can be
rapidly moved to a different track. It is easy to find the benefits of improved
control. Better trackkeeping allows narrower tracks and higher packing den-
sity. A faster control system reduces the search time. In this example we
will focus on the search problem, which is a typical servo problem. Let uc ,
be the command signal and denote Laplace transforms with capital letters.
A simple servo controller can be described by
bK s+b
U (s) = Uc (s) − K Y (s) (2.2)
a s+a
Here we ignore the details on the procedure of how to design above analog
controller due to time limitation. If the controller parameters are chosen as
a = 2ω0
b = ω0 /2
Jω02
K=2
k
a closed system with the characteristic polynomial
Now the question is how to convert this analog controller to computer con-
trol system? To obtain an algorithm for a computer-controlled system, the
control law given by (2.2) is first written as
bK a−b b
U (s) = Uc (s) − KY (s) + K Y (s) = K( Uc (s) − Y (s) + X(s))
a s+a a
This control law can be written as
b
u(t) = K( uc (t) − y(t) + x(t)) (2.3)
a
38
Figure 2.3: Simulation of the disk arm servo with analog (dashed) and
computer control (solid). The sampling period is h = 0.2/ω0 .
where
dx
= −ax + (a − b)y
dt
How to calculate x(t)? The derivative dx/dt may be simply approximated
with a difference. This gives
x(t + h) − x(t)
= −ax(t) + (a − b)y(t)
h
The following approximation of the continuous algorithm (2.3) is then ob-
tained:
b
u(tk ) = K( uc (tk ) − y(tk ) + x(tk ))
a
x(tk + h) = x(tk ) + h((a − b)y(tk ) − ax(tk ))
Arm position y is read from an analog input. Its desired value is assumed
to be given digitally. The algorithm has one state, variable x, which is up-
dated at each sampling instant. The control law is computed and the value
is converted to an analog signal. The program is executed periodically with
period h by a scheduling program, as illustrated in Fig. 2.2.
39
Figure 2.4: Simulation of the disk arm servo with computer control having
sampling rates (a)h = 0.5/ω0 and (b)h = 1.08/ω0 . For comparison, the
signals for analog control are shown with dashed lines.
system is constant between the sampling instants. Also notice that the
difference between the outputs of the systems is very small. The computer-
controlled system has slightly higher overshoot and the settling time to 5%
is a little longer, 5.7/ω0 instead of 5.5/ω0 . The difference between the sys-
tems decreases when the sampling period decreases. When the sampling
period increases the computer-controlled system will, however, deteriorate.
This is illustrated in Fig. 2.4, which shows the behavior of the system for
the sampling periods h = 0.5/ω0 and h = 1.08/ω0 . The response is quite
reasonable for short sampling periods, but the system becomes unstable for
long sampling periods.
40
Figure 2.5: Simulation of the disk arm servo with deadbeat control (solid).
The sampling period is h = 1.4/ω0 . The analog controller from Example 1.2
is also shown (dashed).
41
Figure 2.6: Block diagram of a continuous-time system connected to A − D
and D − A converters.
42
state at the sampling time tk , the state at some future time t is obtained by
solving (2.4). The state at time t, where tk ≤ t ≤ tk+1 , is thus given by
Z t
0
x(t) = e A(t−tk )
x(tk ) + eA(t−s ) Bu(s0 )ds0
tk
Z t
0
= eA(t−tk ) x(tk ) + eA(t−s ) ds0 Bu(tk )
tk (2.5)
Z t−tk
= eA(t−tk ) x(tk ) + eAs dsBu(tk )
0
= Φ(t, tk )x(tk ) + Γ(t, tk )u(tk )
The second equality follows because u is constant between the sampling
instants. The state vector at time t is thus a linear function of x(tk ) and
u(tk ). The system equation of the sampled system at the sampling instants
is then
For periodic sampling with period h, we have tk = kh and the model of (2.6)
simplifies to the time-invariant system
43
where
Φ = eAh
Z h (2.8)
Γ= eAs dsB
0
For simplicity the sampling period is used as the time unit, i.e., h = 1.
The solution consists of two parts: One depends on the initial condition,
and the other is a weighted sum of the input signals.
44
2.4 Input-Output Models
A dynamic system can be described using either internal models or external
models. Internal models – for instance, the state-space models – describe
all internal couplings among the system variables. The external models give
only the relationship between the input and the output of the system. For
instance the ARMA (Auto-Regressive Moving Average) model,
n−1
X
y(k + 1) = ai y(k − i) + bi u(k − i) (2.11)
i=0
qf (k) = f (k + 1) (2.12)
q −1 f (k) = f (k − 1) (2.13)
y(k+na )+a1 y(k+na −1)+· · ·+ana y(k) = b0 u(k+nb )+· · ·+bnb u(k) (2.14)
and
B(z) = b0 z nb + b1 z nb −1 + ... + bnb (2.17)
45
the difference equation can be written as
where
A∗ (z −1 ) = A(z)/z na = 1 + a1 z −1 + · · · + ana z −na (2.21)
∗ −1 nb −1 −nb
B (z ) = B(z)/z = b0 + b1 z + · · · + bnb z (2.22)
46
Table 2.1 Zero-order hold sampling of a continuous-time system, G(s). The
table gives the zero-order-hold equivalent of the continuous-time system,
G(s), preceded by a zero-order hold. The sampled system is described by
its pulse-transfer operator. The pulse-transfer operator is given in terms of
the coefficients of
b1 q n−1 + b2 q n−2 + ... + bn
H(q) =
q n + a1 q n−1 + ... + an
47
Table 2.1 continued
48
Table 2.2 Table of Laplace and Z Transforms
49
where z is a complex variable. It is interesting to note that the z-transform
bears a form similar to Laplace transform, in which the integration is re-
placed by summation now. The z-transform of f is denoted by Zf or F (z).
Z −−−q
just as the correspondence in the continuous-time case:
s − − − d/dt
2. Inversion.
1
F (z)z k−1 dz
H
f (k) = 2πj
50
3. Linearity.
Z{αf + βg} = αZf + βZg
4. Time shift.
Z{q −n f } = z −n F
n−1
X
Z{q n f } = z n (F − F1 ) where F1 (z) = f (j)z −j
j=0
5. Initial-value theorem.
f (0) = lim F (z)
z→∞
6. Final-value theorem.
If (1 − z −1 )F (z) does not have any poles on or outside the unit circle,
then
lim f (k) = lim (1 − z −1 )F (z)
k→∞ z→1
7. Convolution.
k
P
Z{f ∗ g} = Z f (n)g(k − n) = (Zf )(Zg)
n=0
and
Y (z) = C(zI − Φ)−1 zx(0) + (C(zI − Φ)−1 Γ + D)U (z)
51
Figure 2.7: Steady state response of system H(z) to input ak
The time sequence y(k) can now be obtained using the partial fraction ex-
pansion and looking up the z-transform table as shown in table 2.2.
It can be easily verified that H(a)ak is the steady state response of the
system H(z) subject to input ak as shown in Figure 2.7.
In the special case of unit step input (a = 1), the response is simply
H(1), which is the steady state gain, or, the static gain. Note that in
the continuous-time case, the static gain is given by H(0), which is different
from that of the discrete-time system.
52
Figure 2.8: Block Diagram of Frequency Response for Continuous System.
We can say almost exactly the same respecting the frequency response of
a stable, linear time-invariant discrete system. If the system has a transfer
function H(z), then its frequency response is H(ejωT ), where T is the sam-
pling period. If a sinusoid, ejωT k , is applied to the system, H(z), then in
the steady state, the response can be represented as H(ejωT )ejωT k as shown
in Fig. 2.9.
The frequency response can be easily derived using the knowledge that the
steady state response of the system, H(z), to the input signal, ak , is H(a)ak .
Therefore, consider the special case of sinusoid input ejωT k , where a = ejωT ,
the response is simply
We are going to use this knowledge when we deal with disturbances later in
this module.
53
which can easily expressed as combination of two step input signals as
u(t) = U (t) − U (t − h)
G(s)
L−1 ( )
s
We need to get the step response in z-domain by z-transform as
G(s)
Z[L−1 ( )]
s
Therefore, the formula to convert continuous-time TF to discrete-time TF
is
G(s) G(s) G(s)
H(z) = Z[L−1 ( )]−z −1 Z[L−1 ( )] = (1−z −1 )Z[L−1 ( )] (2.26)
s s s
The table 2.1 lists the transformation formulae for the commonly used trans-
fer functions.
The zeros are related to how the inputs and outputs are coupled to the
states. Zeros can also be characterized by their signal blocking properties.
A zero z = a means that the transmission of the input signal u(k) = ak is
blocked by the system. In other words, the system does not respond to the
input signal ak at all if a is one of the zeros of the system.
54
Poles
As discussed in the first lecture, the stability concerns the behavior of the
system under initial deviations from the equilibrium point (zero states), and
can be examined from the impulse response. For the discrete-time system,
the unit impulse signal is δ(k), where δ(0) = 1, and δ(k) = 0, for k ≥ 1.
The corresponding z-transform is 1, hence the unit impulse response of the
system is Y (z) = H(z)U (z) = H(z). A pole z = a = ρejθ corresponds to a
component of the impulse response of the system associated with the time
function ak = ρk ejθk . Obviously, if the magnitude of the pole, |a| = ρ > 1,
this component will blow up, and the system is unstable. Otherwise, the
system will be stable.
Remark: Please note the difference between the stability criterion of the
discrete-time and continuous-time systems. In the continuous-time system,
since the corresponding component function is eat = eσt ejωt corresponding
to the pole of a = σ + ωj, the stability is determined by the real part of the
pole, σ. While in the discrete-time, the stability is decided by the magnitude
of the poles as shown above.
In the following we will study how the poles of the continuous-time systems
are transferred into poles of the discrete-time system under zero-order held.
Consider a continuous-time system described by the nth-order state-space
model
dx
= Ax + Bu
dt (2.27)
y = Cx
The poles of the system are the eigenvalues of A, which we denote by
λi (A), i = 1, ... n. The zero-order-hold sampling of (2.27) gives the discrete-
time system
x(k + 1) = Φx(k) + Γu(k)
y(k) = Cx(k)
55
Figure 2.10: The conformal map z = exp(sh).
Eq (2.28) gives the mapping from the continuous-time poles to the discrete-
time poles. Fig. 2.10 illustrates a mapping of the complex s-plane into the
z-plane, under the map
z = esh
For instance, the left half of the s-plane is mapped into the unit disc of
the z-plane. The map is not bijective (one to one) — several points in the
s-plane are mapped into the same point in the z-plane (see Fig. 2.10).
Remark: please note that the map z = esh describes the relationship be-
tween the poles of the continuous-time system and its sampled system. It is
NOT the map between the transfer function of the continuous-time system
and its counter-part in the discrete-time!
56
Example 2.4
Consider the continuous-time system
ω02
(2.29)
s2 + 2ζω0 s + ω02
The poles of the corresponding discrete-time system are given by the char-
acteristic equation by looking up Table 2.1.
z 2 + a1 z + a2 = 0
where p
a1 = −2e−ζω0 h cos( 1 − ζ 2 ω0 h)
a2 = e−2ζω0 h
It can be easily verified that the poles of the continuous-time system is
p
s = −ζω0 ± j 1 − ζ 2 ω0
and the poles of the discrete-time system can be found by applying the map
z = esh , √
2
z = e−ζω0 h±j 1−ζ ω0 h
Zeros
Can we also find a straightforward map between the zeros of the continuous-
time and discrete-time systems? The answer is unfortunately NO. It is not
possible to give a simple formula for the mapping of zeros. The following ex-
ample shows that a continuous time system without any zeros may introduce
zeros to the corresponding discrete-time system by sampling.
57
Table 2.4 Numerator polynomials, Zd , when sampling the continuous-time
system s1d with sampling period h → 0.
We will show later in this course that the condition of stable inverse plays
a vital role in designing perfect tracking system.
Further, a continuous-time system with unstable inverse will not always be-
come a discrete-time system with unstable inverse, as shown in the following
example.
58
2.9 Notes and References
Most of the materials covered in Chapters 2 to 5, are extracted from the
main text book of this module:
59
Chapter 3
3.1 Introduction
Chapter Two has shown how continuous-time systems are transformed into
discrete-time systems when sampled. Z-transform has also been introduced
to deal with the discrete-time system, which can easily transform the differ-
ence equations into algebraic equations. And transfer function can be readily
derived using z-transform. In this lecture we will continue to develop the
key tools for analyzing discrete-time systems. Stability is introduced first
in Sec 3.2. The concepts of controllability, observability and realizability,
which are useful for understanding discrete-time systems, are discussed in
Sec 3.3. Simple feedback loops and their properties are treated in Sec 3.4.
3.2 Stability
The stability of the systems concerns about the fundamental question: what
would happen if there is a small disturbance to the system?
The concept of stability is of primary importance for control system design.
The reason is very simple. For any control system design, stability has
to be guaranteed first before its practical implementation. Disaster would
follow if the system is unstable as any small deviations from the set point
or equilibrium position will lead to divergence.
60
3.2.1 Definitions
In the previous lectures, we have touched upon the concept of stability sev-
eral times without giving any precise definition. Now it is time to give a
mathematical definition for stability.
There are many types of stability defined in the literature. It is usually de-
fined with respect to changes in the initial conditions. Consider the discrete-
time state-space equation (possibly nonlinear and time-varying)
Let xo (k) and x(k) be solutions of (3.1) when the initial conditions are xo (0)
and x(0), respectively. Further, let denote k.k a vector norm.
61
3.2.2 Stability of Linear Discrete-Time Systems
Consider the linear system
xo (k + 1) = Φxo (k)
(3.2)
xo (0) = ao
To investigate the stability of the solution of (3.2), xo (k), the initial value
is perturbed. Hence
x(k + 1) = Φx(k)
x(0) = a
The deviation of the solutions, x̃ = x − xo , satisfies the equation
x̃(k + 1) = Φx̃(k)
(3.3)
x̃(0) = a − ao
x̃(k) = Φk x̃(0)
If one of the eigenvalues |λi | > 1, then the term λki will blow up, and the
system is unstable.
What would happen if some of the eigenvalues lie on the unit disc, i.e.
|λi | = 1? Things will be more complicated and it depends upon whether
62
the corresponding eigenvalue is simple or multiple. If the eigenvalue is sim-
ple, then the corresponding component solution is λki with a magnitude of
one. In this case, the system is still stable (verify it by yourself!) , but
not asymptotic stable as it does not converge to zero. If the eigenvalue is
multiple (repeated m times) , there exist components like kλki ,...,k m−1 λki ,
which will increase to infinity.
All the above discussions might be summarized into the following theorem.
Since BIBO stability is not defined with respect to any particular refer-
ence solution, it is not a local concept. From the definition it follows that
asymptotic stability is the strongest concept. The following theorem is a
result.
63
Theorem 3.2 Relation between Stability Concepts
Asymptotic stability implies stability and BIBO stability for linear systems.
When the word stable is used without further qualification in this module,
it normally means asymptotic stability.
It is noted that for nonlinear systems, asymptotic stability might not imply
BIBO stability. For instance, consider the following example,
0.5x(k)
x(k + 1) =
(1 − u(k))
Obviously the system is asymptotic stable when the input is zero. But it is
unstable if input u(k)=0.8. Therefore the system is not BIBO stable.
It is easy to give examples showing that stability does not imply BIBO
stability even for linear systems, and vice versa.
There are also simple examples that the system is BIBO stable, but not
stable. A good example is a ball rolling in the surface shown in Fig. 3.2.
64
Figure 3.1: Input and output of the system in Example 3.1 when ω = 1,
h = 0.5, and the initial state is zero.
65
Figure 3.2: A system is BIBO stable, but not stable.
Obviously, the ball is unstable around the point A and B, but overall, it is
BIBO stable.
Since above example is a nonlinear system, you may still wonder whether
BIBO stability might imply stability for linear system. Consider the follow-
ing example
0.5 0 1
x(k + 1) = x(k) + u(k)
1 2 1
y(k) = 1 0 x(k)
It can be easily verified that the system is unstable since it has a pole at 2.
But it is BIBO stable since the observation of the output y(k) cannot reveal
the dynamics of the second state variable x2 (k). Such kind of system is
unobservable (the information of the state cannot be recovered by observing
the inputs and outputs), which will be discussed in details later in this
module.
66
• Methods based on properties of characteristic polynomials
• Lyapunov’s method
Explicit calculation of the eigenvalues of a matrix cannot be done conve-
niently by hand for systems of order higher than 2. In some cases it is easy
to calculate the characteristic equation
where
ak−1
i = aki − αk akk−i
αk = akk /ak0
The first and second rows are the coefficients in Eq (3.4) in forward and
reverse order, respectively. The third row is obtained by multiplying the
second row by αn = an /a0 and subtracting this from the first row. The last
element in the third row is thus zero. The fourth row is the third row in
reverse order. The scheme is then repeated until there are 2n + 1 rows. The
last row consists of only one element. The following theorem results.
67
Example 3.2 Stability of a second-order system
Let the characteristic equation be
A(a) = z 2 + a1 z + a2 = 0 (3.5)
Jury’s scheme is
All the roots of Eq (3.5) are inside the unit circle if
1 − a22 > 0
1 − a2
(1 + a2 )2 − a21 > 0
1 + a2
This gives the conditions
a2 < 1
a2 > −1 + a1
a2 > −1 − a1
The stability area for the second-order equation is a triangle shown in Fig.
3.3.
68
Figure 3.3: The stability area for the second-order Eq (3.5) of the coefficients
a1 and a2 .
3.3.1 Controllability
Definition 3.4 Controllability
The system is controllable if it is possible to find a control sequence such
that an arbitrary state can be reached from any initial state in finite time.
For nonlinear system, it is difficult to check whether the system is control-
69
lable or not. But for linear system, we have a neat result.
Assume that the initial state x(0) is given. The state at time n, where n is
the order of the system, is given by
x(n) = Φn x(0) + Φn−1 Γu(0) + ... + Γu(n − 1)
(3.7)
= Φn x(0) + Wc U
where
Φn−1 Γ
Wc = Γ ΦΓ · · ·
T
U= u(n − 1) · · · u(0)
Now the question regarding controllability is following: starting from arbi-
trary initial state x(0) is it possible to find control sequence U such that any
70
final state x(n) can be reached?
But what would happen if Wc is not of full rank? Can we apply more inputs
to drive the state into the target state? If we try it in one more step by
applying input u(n), then we have
where
Φn Γ
W = Γ ΦΓ · · ·
T
U= u(n) · · · u(0)
If the rank of W is of full rank, then it is possible to find out the control
sequence. Unfortunately, the rank of W will be the same as that of Wc ! This
fact can be shown by the following famous Cayley-Hamilton theorem.
Cayley-Hamilton theorem
Given any n × n matrix A, and its characteristic equation
det[zI − A] = z n + a1 z n−1 + . . . + an
Then
An + a1 An−1 + . . . + an I = 0
In other words, An is a linear combination of An−1 , An−2 , . . . , A, I.
Applying Cayley-Hamilton theorem to our problem, it follows that Φn Γ
is a linear combination of Φn−1 Γ, Φn−2 Γ, . . . , Γ. Hence the rank of W cannot
be increased by applying more inputs!
The following theorem follows from the preceding definition and calculations.
71
3.3.2 Controllable Canonical Form
Assume that Φ has the characteristic equation
But how to find out the transformation T , such that it can transform any
controllable system into its canonical form?
72
In the new coordinates,
W̃C = Γ̃ Φ̃Γ̃ · · · Φ̃n−1 Γ̃
T Γ T ΦT −1 T Γ · · · T Φn−1 T −1 T Γ
= (3.12)
= T Wc
It is easier to make the output follow a given trajectory. Assume that the
desired trajectory is given by uc (k).
A naive approach would be the following. The control signal u then should
satisfy
B(q)
y(k) = u(k) = uc (k)
A(q)
or
A(q)
u(k) = uc (k) (3.13)
B(q)
Assume that there are d steps of delay in the system. The generation of u(k)
is then causal only if the desired trajectory is known d steps ahead. The
control signal then can be generated in real time. The control signal thus
is obtained by sending the desired output trajectory through the inverse
system A/B. The signal u is bounded if uc is bounded and if the system
has a stable inverse, i.e., B(z) is stable. Now you should realize that the
condition of stable inverse is important in tracking. But does y(k) really
track the command signal uc (k)? We have to check out the transfer function
73
Figure 3.4: Trajectory Following
from the command signal to the output. It can be shown from the open loop
transfer function and the inverse controller (3.13), that
A(q)
y(k) = uc (k)
A(q)
Overall, if the system and its inverse are stable, it is possible to use very
simple open-loop control to follow any desired trajectory.
3.3.4 Observability
The concept of observability is regarding whether the state information can
be extracted from the observations of the inputs and output. This is an
important issue since only the inputs and outputs are measurable in many
practical situations. The system in (3.6) is observable if there is a finite
k such that knowledge of the inputs u(0), ... , u(k − 1) and the outputs
y(0), ... , y(k − 1) is sufficient to determine the initial state of the system.
Once the initial state information is obtained, the states at every step can
then be calculated.
Consider the system in (3.6). The effect of the known input signal always
can be determined, and there is no loss of generality to assume that u(k) = 0.
Assume that y(0), y(l), ... , y(n − 1) are given. This gives the following set
74
of equations:
y(0) = Cx(0)
y(1) = Cx(1) = CΦx(0)
..
.
y(n − 1) = CΦn−1 x(0)
Using vector notation gives
C y(0)
CΦ y(1)
x(0) = (3.14)
.. ..
. .
CΦn−1 y(n − 1)
The state x(0) can be obtained from (3.14) if and only if the observability
matrix
C
CΦ
Wo = (3.15)
..
.
CΦn−1
is of full rank. The state x(0) is unobservable if x(0) is in the null space
of Wo . If two states are unobservable, then any linear combination is also
unobservable; that is, the unobservable states form a linear subspace.
75
Example 3.3 A system with unobservable states
Consider the system
1.1 −0.3
x(k + 1) = x(k)
1 0
y(k) = (1 − 0.5)x(k)
The observability matrix is
C 1 −0.5
Wo = =
CΦ 0.6 −0.3
The rank of Wo is 1, and the unobservable states belong to the null space
of Wo , that is, [0.5 1]. Fig. 3.5 shows the output for four different initial
states. All initial states that lie on a line parallel to [0.5 1] give the same
output (see Fig. 3.5 (b) and (d)). Therefore, the initial state cannot be
determined uniquely by observing the inputs and outputs.
76
3.3.6 Loss of Controllabilty and Observability Through Sam-
pling
Sampling of a continuous-time system gives a discrete-time system with sys-
tem matrices that depend on the sampling period. How will that influence
the controllability and observability of the sampled system? To get control-
lable discrete-time system, it is necessary that the continuous-time system
also be controllable, because the allowable control signals for the sampled
system-piecewise — constant signals — are a subset of the allowable control
signals for the continuous-time system.
and
det Wo = sin ωh
Both controllability and observability are lost for ωh = nπ, although the
corresponding continuous-time system is both controllable and observable.
The example shows one obvious way to lose observability and/or controlla-
bility. If the sampling period is half the period time (or a multiple thereof)
of the natural frequency of the system, then this frequency will not be seen
in the output. This happens only for isolated values of the sampling pe-
riod. A change in sampling period will make the system observable and/or
controllable again.
77
3.3.7 Realizability
The concepts of controllability and observability are defined only for state-
space model of the system. An interesting question would arise: how to
determine whether the system is controllable or observable if only the input-
output model, i.e. transfer function, is available? In order to address this
question, another important concept in control theory has to be introduced
— the realizability.
Given a sequence of observations of inputs and outputs, what possible sys-
tems could give rise to it? In other words, if we start with an input-output
model which describes how the inputs affect the outputs, how does one de-
duce the underlying state-space model that is responsible for this behavior?
Let’s first start with the simplest case — the first order system. Assume the
input-output model is
x(k) = y(k)
This procedure is trivial. However, it has one important trick: one can
always choose the output y(k) as the state variable! Let’s follow this idea
to deal with the second-order system
x1 (k) = y(k)
x1 (k+1) = −a1 x1 (k)−a2 y(k−1)+b1 u(k)+b2 u(k−1) = −a1 x1 (k)+b1 u(k)−a2 y(k−1)+b2 u(k−1)
Note that above equation contains terms in the past step k-1, −a2 y(k − 1) +
b2 u(k − 1), which are not supposed to appear in the right hand of the stan-
dard form of the state-space model like equation (3.6), which only consists of
present state x(k), and input u(k). How to deal with the past terms? This
78
is the most important step! Once you understand this trick, then realization
problem would be trivial to you.
This trick is very simple: you just introduce another state variable which
summarizes all the past information!
Let
x2 (k) = −a2 y(k − 1) + b2 u(k − 1)
then we have
x1 (k + 1) = −a1 x1 (k) + b1 u(k) + x2 (k) = −a1 x1 (k) + x2 (k) + b1 u(k)
x2 (k + 1) = −a2 y(k) + b2 u(k) = −a2 x1 (k) + b2 u(k)
Now let’s try above procedure for the third order system
y(k +1) = −a1 y(k)−a2 y(k −1)−a3 y(k −2)+b1 u(k)+b2 u(k −1)+b3 u(k −2)
First step: let
x1 (k) = y(k)
and obtain the first equation
x1 (k+1) = −a1 x1 (k)+b1 u(k)−a2 y(k−1)−a3 y(k−2)+b2 u(k−1)+b3 u(k−2)
Second step: introduce one state variable to summarize the past information
x2 (k) = −a2 y(k − 1) − a3 y(k − 2) + b2 u(k − 1) + b3 u(k − 2)
then we have obtained two equations
x1 (k + 1) = −a1 x1 (k) + b1 u(k) + x2 (k) = −a1 x1 (k) + x2 (k) + b1 u(k)
x2 (k + 1) = −a2 x1 (k) + b2 u(k) − a3 y(k − 1) + b3 u(k − 1)
How to deal with the past information in the second equation? I hope ev-
eryone here in the class would give me the right answer: introduce another
state variable!
79
where the state variables are defined as combinations of the present and past
outputs and inputs:
x1 (k) = y(k)
x2 (k) = −a2 y(k − 1) − a3 y(k − 2) + b2 u(k − 1) + b3 u(k − 2)
x3 (k) = −a3 y(k − 1) + b3 u(k − 1)
Note that the state variables are completely determined by the observations
of the inputs and outputs. Therefore, the system must be observable. If you
still have any doubt regarding this, let’s put the above state-space model in
the matrix form
−a1 1 0 b1
x(k + 1) = −a2 0 1 x(k) + b2 u(k)
−a3 0 0 b3 (3.17)
y(k) = 1 0 0 x(k)
Is there anything special about this form? Does it look familiar to you?
This is the observable canonical form!
Now it is time to state the following realizability result for realizability.
The following example shows that the controllability and observability some-
times cannot be decided by checking the input-output model only.
80
Example 3.5 Realization of uncontrollable and/or unobservable
system
Consider the following input-output model
z+1 z+1
H(z) = = 2 (3.19)
(z + 1)(z + 2) z + 3z + 2
If the system is observable, applying above realizability theorem results in
following state-space model
−3 1 1
x(k + 1) = x(k) + u(k)
−2 0 1 (3.20)
y(k) = 1 0 x(k)
and the corresponding state variables are defined as
x1 (k) = y(k)
x2 (k) = −2y(k − 1) + u(k − 1)
Notice that the above realization is under the assumption that the system
is observable. You may wonder whether this system can be realized using
the following state-space model in controllable canonical form
−3 −2 1
z(k + 1) = z(k) + u(k)
1 0 0 (3.21)
y(k) = 1 1 z(k)
You may also wonder whether this system is observable or not. Check it
out by calculating Wo ! It is unobservable! But is it really the realization of
(3.19)?
In the following, we will try to show that the above controllable canonical
form (3.21) is NOT the realization of the input-output model (3.19). It
follows immediately from equation (3.21) by adding the two state equations
that
z1 (k + 1) + z2 (k + 1) = −2(z1 (k) + z2 (k)) + u(k)
81
Since y(k) = z1 (k) + z2 (k), it follows that
The answer is we don’t know based upon the transfer function only. The
first order system is called minimal-realization of the system, in which the
order of the state-space model is equal to the order of the input-output
model. There are other infinite possible realizations of the system which
are of higher-order. But those higher order realizations are all unobservable
since the additional state variables cannot be determined by the observation
of the outputs.
82
• Stabilize the system if the open-loop is unstable.
Load disturbances
Load disturbances influence the process variables. They may represent dis-
turbance forces in a mechanical system – for example, wind gusts on a
stabilized antenna, waves on a ship, load on a motor. In process control,
load disturbances may be quality variations in a feed flow or variations in
demanded flow. In thermal systems, the load disturbances may be varia-
tions in surrounding temperature. Load disturbances typically vary slowly.
They may also be periodic – for example, waves in ship-control systems.
Measurement errors
Measurement errors enter in the sensors. There may be a steady-state error
in some sensors due to errors in calibration. However, measurement errors
typically have high-frequency components. There may also be dynamic er-
rors because of sensor dynamics. There may also be complicated dynamic
interaction between sensors and the process. Typical examples are gyro-
scopic measurements and measurement of liquid level in nuclear reactors.
The character of the measurement errors often depends on the filtering in
the instruments. It is often a good idea to look at the instrument and modify
the filtering so that it fits the particular problem.
Parameter variations
Linear theory is used throughout this module. The load disturbance and the
measurement noise then appear additively. Real systems are, however, often
83
nonlinear. This means that disturbances can enter in a more complicated
way. Because the linear models are obtained by linearizing the nonlinear
models, some disturbances then also appear as variations in the parameters
of the linear model.
The pulse and the impulse are also important for theoretical reasons because
the response of a linear continuous-time system is completely specified by
its impulse response and a linear discrete-time system by its pulse response.
The step
The step signal is another prototype for a disturbance (see Fig. 3.6). It is
typically used to represent a load disturbance or an offset in a measurement.
The ramp
The ramp is a signal that is zero for negative time and increases linearly for
positive time (see Fig. 3.6). It is used to represent drifting measurement
errors and disturbances that suddenly start to drift away. In practice, the
disturbances are often bounded; however, the ramp is a useful idealization.
The sinusoid
The sine wave is the prototype for a periodic disturbance. Choice of the
frequency makes it possible to represent low-frequency load disturbances, as
well as high-frequency measurement noise.
84
3.4.3 Generation of disturbances
It is convenient to view disturbances as being generated by dynamic systems
(see Fig. 3.7). It is assumed that the input to the dynamic system is a unit
pulse δk that is,
uc (k) = Hr (q)δk (3.22)
In order to generate a step, use Hr (q) = q/(q − 1); to generate a ramp,
use Hr (q) = q/(q − 1)2 , and a sinusoid from a harmonic oscillator. From
an input-output viewpoint, disturbances may be described as impulse re-
sponses. Disturbances also may be regarded as the responses of dynamic
systems with zero inputs but nonzero initial conditions. In both cases
the major characteristics of the disturbances are described by the dynamic
systems that generate them. The approach, of course, can be applied to
continuous-time, as well as discrete-time systems.
85
3.4.5 Simulation
Simulation is a good way to investigate the behavior of dynamic systems
– for example, the intersample behavior of computer-controlled systems.
Computer simulation is a very good tool, but it should be remembered that
simulation and analysis have to be used together. When making simulations,
it is not always possible to investigate all combinations that are unfavorable,
for instance, from the point of view of stability, observability, or reachability.
These cases can be found through analysis.
In the beginning of the 1960s, several digital simulation packages were de-
veloped. These packages were basically a digital implementation of analog
simulation. The programming was done using block diagrams and fixed-
operation modules. Later programs were developed in which the models
were given directly as equations. It is important to have good user-machine
communication for simulations; the user should be able to change parame-
ters and modify the model easily. Most simulation programs are interactive,
which means that the user interacts with the computer and decides the next
step based on the results obtained so far. One way to implement interac-
tion is to let the computer ask questions and the user select from prede-
fined answers. This is called menu-driven interaction. Another possibility
is command-driven interaction, which is like a high-level problem-solving
language in which the user can choose freely from all commands available
in the system. This is also a more flexible way of communicating with the
computer, and it is very efficient for the experienced user, whereas a menu-
driven program is easier to use for an inexperienced user. In a simulation
package, it is also important to have a flexible way of presenting the results,
which are often curves. Finally, to be able to solve the type of problems of
interest in this module, it is important to be able to mix continuous- and
discrete-time systems.
86
SIMULINKr
The closed-loop system is unstable for all values of the gain K. The root
locus (the graphic plot of the poles against different gains) is shown in Fig.
3.8.
87
Because u is constant over the sampling intervals,
or
1
ẏ(k) = u(k) (3.26)
q−1
Equations (3.23), (3.25), and (3.26) give the closed-loop system
0.5K(q + 1)
y(k) = uc (k) (3.27)
(q − 1)(q − 1 + Td K) + 0.5K(q + 1)
The system is of second order, and there are two free parameters, K and Td ,
that can be used to select the closed-loop poles. The closed-loop system is
stable if K > 0, Td > 0.5, and Td K < 2. The root locus with respect to K
of the characteristic equation of (3.27) is shown in Fig. 3.10 when Td = 1.5.
Let the reference signal be a step. Fig. 3.11 shows the continuous-time
output for four different values of K. The behavior of the closed-loop system
varies from an oscillatory to a well-damped response. When K = 1, the poles
are in the origin and the output is equal to the reference value after two
samples. This is called deadbeat control and will be discussed further later
in this module. When K > 1, the output and the control signal oscillate
because of the discrete-time pole on the negative real axis. Remember that
in addition to complex poles, negative poles can also generate oscillation for
discrete-time system, as discussed in section 2.6. The poles are inside the
unit circle if K < 4/3. When K > 4/3, the system becomes unstable.
88
Figure 3.5: The output of the system in Example 3.3 for the initial states
(a) [0.5 1], (b) [1.5 0.5], (c) [2.5 0], and (d) [1 − 0.5] .
89
Figure 3.6: Idealized models of simple disturbances.
90
Figure 3.7: Generation of the reference value using a dynamic system with
a pulse input.
91
Figure 3.8: The root locus of (3.24) when K > 0.
92
Figure 3.9: Discrete-time controller with feedback from position and velocity
of the double integrator.
93
Figure 3.10: The root locus of the characteristic equation of the system in
(3.27) with respect to the parameter K when Td = 1.5.
94
Figure 3.11: The continuous-time output of the system in Fig. 3.8 when
Td = 1.5 and (a) K = 0.5, (b) K = 0.75, (c) K = 1, and (d) K = 1.25.
95
Chapter 4
Pole-Placement Problem —
State-Space Approach
In the previous lectures, we have discussed some key tools and concepts for
analyzing discrete-time systems. Now it is time to apply these tools to com-
puter control system design, which is supposed to be the core of this course.
What is the ultimate goal of the control system? To make the output of
the system follow some desired trajectory! But how to specify the desired
output? There are normally two ways. The first one is just to specify the
desired output arbitrarily without any constraint of the behavior. You can
imagine that it might be extremely hard to make the system behave in any
way you want in practical problems. We will discuss this type of problem
later under certain conditions.
Usually, we have to be more modest and try to make the desired output
more attainable. One way of doing this is to generate the desired output
through a well defined reference model to meet various system requirements.
And then the next step is to design the controller such that the behavior of
the overall system approaches that of the reference model. In other words,
we will try to make the transfer function of the closed loop system as close
to the reference model as possible. This approach is called model reference
control. In practice, perfect matching of these two transfer functions is often
impossible. Which task is more important then, matching the zeros or the
poles? As discussed in the previous lectures, since stability is of fundamen-
tal importance for control system design, which is decided by the location
of the poles, everyone would agree what we should try to match the poles
first. This is so called the pole placement problem: design the controller to
place the poles of the closed loop at the desired positions that are given by
96
the reference model.
ẋ = Ax + bu
(4.1)
y = cx
where
Φ = eAh
Zh
Γ= eAs bds
0
Similarly, we will try the simplest one first. Let the state feedback controller
be
u(k) = −Lx(k) (4.3)
and the desired characteristic polynomial (C.P.), i.e., the denominator of
the reference model, Hm (z) = B m (z)
Am (z) , is
Question: Can we choose L such that the poles of the closed loop system
match desired poles given by above characteristic polynomial?
97
Example: Double-integrator:
ÿ(t) = u(t) (4.5)
Discretize it into
h2
1 h 2
x(k + 1) = x(k) + u(k)
0 1 h (4.6)
y(k) = 1 0 x(k)
Let
u(k) = −Lx(k) = −l1 x1 (k) − l2 x2 (k) (4.7)
and the closed-loop system becomes
2 2
1 − l12h h − l22h
x(k + 1) = x(k) (4.8)
−l1 h 1 − l2 h
l1 h2 l1 h2
z2 + ( + l2 h − 2)z + ( − l2 h + 1)
2 2
Assume that the desired polynomial is
Am (z) = z 2 + p1 z + p2 (4.9)
Question:
Is this true for any linear system?
The answer to this question turns out to be directly connected with another
fundamental concept in control theory: Controllability
98
Now let’s take a look at another example.
where
−a1 −a2 1
Φ= ,Γ =
1 0 0
What’s the C.P. of this system?
z + a1 +a2
det{zI − Φ} = det = z 2 + a1 z + a2 (4.12)
−1 z
where
l1 l2
ΓL =
0 0
and
−a1 − l1 −a2 − l2
Φ − ΓL =
1 0
whose C.P. is
z 2 + (a1 + l1 )z + (a2 + l2 )
If the desired C.P. is
z 2 + p1 z + p2
99
We simply choose the control gains L as
l1 = p1 − a1
l2 = p2 − a2
and hence
u(k) = −Lx(k) = − p1 − a1 p2 − a2 x(k)
Note that the control parameters are the difference between the coefficients
of the C.P. of the system and the desired polynomial. The pole-placement
problem can be easily solved for such special kind of system. And the above
result can be extended to general case as follows.
where
−a1 −a2 · · · −an
1 0 ··· 0
Φ̃ =
.. .. .. ..
. . . .
0 ··· 1 0
1
0
Γ̃ = .
..
0
and a1 , a2 , ... , an are the coefficients of the C.P.
z n + a1 z n−1 + · · · + an
Am (z) = z n + p1 z n−1 + · · · + pn
then
u(k) = −L̃z(k) = − p1 − a1 p2 − a2 · · · p n − an z(k) (4.15)
100
If the system is controllable, then it is similar to its corresponding con-
trollable form. Or in other words, it can be transformed into controllable
companion form by
z = Tx
x(k + 1) = Φx(k) + Γu(k)
z(k + 1) = T x(k + 1) = T Φx(k) + T Γu(k) = T ΦT −1 z(k) + T Γu(k) = Φ̃z(k) + Γ̃u(k)
where
Φ̃ = T ΦT −1
and
Γ̃ = T Γ
and the state-feedback controller is then
u(k) = − p1 − a1 p2 − a2 · · · pn − an z(k)
= − p1 − a1 p2 − a2 · · · p n − an T x(k)
Question: what is T ?
Overall, we have
L = p1 − a1 p2 − a2 · · · pn − an W̃c Wc−1
L = 0 · · · 0 1 Wc−1 Am (Φ)
(4.17)
101
Example: double-integrator
h2
1 h 2
x(k + 1) = x(k) + u(k)
0 1 h
the controllability matrix
h2 3h2
Wc = 2 2
h h
is nonsingular. Therefore, it is controllable. We will use Ackermann’s
formula to calculate the feedback gains L.
− h12 1.5
−1 h
Wc = 1 −0.5
h2 h
2 1 + p1 + p2 2h + p1 h
Am (Φ) = Φ + p1 Φ + p2 I =
0 1 + p1 + p2
Then applying Ackermann’s formula gives
1 + p1 + p2 3 + p1 − p2
h i
L = 0 1 Wc−1 Am (Φ) =
h2 2h
which is the same result as what we obtained before.
Example:
a 1 1
x(k + 1) = x(k) + u(k)
0 b 0
Let
u(k) = −l1 x1 (k) − l2 x2 (k)
then
a − l1 1 − l2
x(k + 1) = x(k)
0 b
102
The C.P. is
(z − a + l1 )(z − b)
Hence, the pole z = a can be changed, but the pole z = b can not be
changed!
Am (z) = z n (4.18)
By Cayley-Hamilton theorem
Φnc = (Φ − ΓL)n = 0
immediately we have
Example: Double-integrator
Let
p1 = p2 = 0
L = h12 2h3
h2 1 3h
h i
ΓL = 2 1 3 = 2 4
h2 2h 1 3
h h 2
1 h
(Φ − ΓL) = 2 4
− h1 − 12
(Φ − ΓL)2 = 0
and
x(2) = (Φ − ΓL)2 x(0) = 0
103
4.1.2 Summary
The state-feedback controller
u(k) = −Lx(k)
can place the poles of the system at any desired location if the system is
controllable. Note that the state vector x(k) is involved in the calculation
of control input u(k) at every instant k. But in many practical problems,
only the output y(k) is available, how to solve this problem?
4.2 Observer
Consider the system
x(k + 1) = Φx(k) + Γu(k)
y(k) = cx(k)
where x(k) is not accessible. Since the state feedback controller, u(k) =
−Lx(k), needs the state information to calculate the input, it is necessary
to estimate the state. This state estimator is usually called observer. Let’s
first try the simplest state estimator you might have in mind.
Our main concern is: would the state estimation error decrease to zero? If
yes, then this will be a good observer.
Let the estimation error be
e(k) = x(k) − x̂(k)
104
it easily follows that
e(k + 1) = Φ(e(k))
Therefore, the estimation error will blow up if the system is unstable. It
might work if the system is stable.
What is missing in the naive observer? The output y! It did not use any
information of the output! Let’s see next if we can improve the performance
of the observer by feeding back the output estimation error, y(k) − ŷ(k).
4.2.2 Observer
Construct an observer by feeding back the output estimation error,
x̂(k + 1) = Φx̂(k) + Γu(k) + K(y(k) − ŷ(k))
(4.19)
ŷ(k) = cx̂(k)
Then
x(k + 1) − x̂(k + 1) = Φ(x(k) − x̂(k)) − K(y(k) − ŷ(k))
Let the estimation error be defined by
e(k) = x(k) − x̂(k)
then
e(k + 1) = Φe(k) − Kce(k) = (Φ − Kc)e(k)
Question: Can we chose K such that Φ − Kc has any desired C.P., Ao (z)?
Recall that we have already solved a very similar problem: Given pair {Φ, Γ},
find L, such that {Φ − ΓL} has any desired C.P. And the solution is given
by the Ackermann’s formula:
L = 0 · · · 0 1 Wc−1 Am (Φ)
105
The corresponding Wc in the Ackermann’s formula is then
T
c
cΦ
Wc = cT ΦT cT · · · (Φn−1 )T cT = = WoT
.. (4.21)
.
cΦn−1
Example: Double-Integrator
h2
1 h 2
x(k + 1) = x(k) + u(k)
0 1 h
y(k) = 1 0 x(k)
c= 1 0
1 h
Φ=
0 1
c 1 0
Wo = =
cΦ 1 h
−1 1 h 0 1 0
Wo = =
h −1 1 − h1 h1
2 1 + λ1 + λ2 2h + λ1 h
Ao (Φ) = Φ + λ1 Φ + λ2 =
0 1 + λ1 + λ2
−1 0 2 + λ1
K = Ao (Φ)(Wo ) = 1+λ1 +λ2
1 h
106
4.3 Output-Feedback Controller
Summarizing the previous results, we can now give the complete solution to
pole-placement problem when only outputs are available. Consider system
Am (z) = z n + p1 z n−1 + · · · + pn
L = 0 · · · 0 1 Wc−1 Am (Φ)
(4.24)
e(k + 1) = (Φ − Kc)e(k)
Choose K such that (Φ − Kc) has desired C.P.
Ao (z) = z n + λ1 z n−1 + · · · + λn
K can be calculated by
T
K = Ao (Φ)(Wo )−1
0 ··· 1 (4.26)
107
(
x(k + 1) = Φx(k) − ΓLx(k) + ΓL(x(k) − x̂(k)) = (Φ − ΓL)x(k) + ΓLe(k)
e(k + 1) = (Φ − Kc)e(k)
If both (Φ − ΓL) and (Φ − Kc) is stable, the overall system is stable, and
e(k) → 0, x(k) → 0
Example: Double-integrator
h2
1 h 2
x(k + 1) = x(k) + u(k)
0 1 h
y(k) = 1 0 x(k)
Step 1:
u(k) = −Lx(k)
1+p1 +p2 3+p1 −p2
L= h2 2h
Step 2:
h2
1 h
x̂(k + 1) = x̂(k) + 2 u(k) + K(y(k) − ŷ(k))
0 1 h
ŷ(k) = 1 0 x̂(k)
where
2 + λ1
K= 1+λ1 +λ2
h
Step 3: Output feedback controller:
u(k) = −Lx̂(k)
when each impulse disturbance occurs, the states will be driven away from
equilibrium position, and the feedback controller would drive them back to
108
equilibrium position as shown in Fig. 4.6.
In general if there are disturbances acting upon the system, the controller
has to cancel out the effects of the disturbances. This is called disturbance
rejection problem.
Let’s consider a system where disturbance ω(k) affects the system as follows.
What would happen simply ignoring the disturbance term? Let the con-
troller still be the state feedback controller
u(k) = −Lx(k)
then
x(k + 1) = (Φ − ΓL)x(k) + Φxω ω(k)
Obviously, the response will be heavily affected by the disturbance. Hence
the disturbance cannot be ignored.
What’s the state of the system? We’d better consider the disturbance ω(k)
as part of the state instead of the input, since we cannot change the ω(k)
itself.
then
x(k + 1) Φ Φxω Γ
z(k + 1) = = z(k) + u(k)
ω(k + 1) 0 Φω 0 (4.30)
y(k) = c 0 z(k)
109
shown below.
Step 1: Assume the disturbances and state variables are measurable, design
the controller to stabilize the system and cancel out the disturbances. Let
The we can choose L such that (Φ − ΓL) has desired poles as before.
Step 2: If the disturbances are not accessible, which is usually the case in
practice, then build an observer to estimate the disturbances, as well as the
states.
Φ Φxω Γ
ẑ(k + 1) = ẑ(k) + u(k) + K(y(k) − ŷ(k))
0 Φω 0 (4.32)
ŷ(k) = c 0 ẑ(k)
Is the system observable? It is indeed observable in many cases.
Then K can be chosen such that the C.P. of
Φ Φxω
−K c 0
0 Φω
match any desired one. Then we can make sure that the estimation error
of the augmented state vector z(k) converge to zero. It can be made to be
110
zero after finite number of steps if dead-beat observer is used.
Step 3: Replace the disturbance variable and state variables by their cor-
responding estimates in the controller designed in Step 1. i.e.
Example: Double-Integrator
A constant but unknown disturbance ω(k) acting on the input as follows,
h2
1 h 2
x(k + 1) = x(k) + (u(k) + ω(k))
0 1 h
y(k) = 1 0 x(k)
ω(k + 1) = ω(k)
Step 1: If both x(k) and ω(k) are known, design a state-feedback controller
then 2 h2
1 h h2
x(k + 1) x(k) 2
= 0 1 h + h u(k)
ω(k + 1) ω(k)
0 0 1 0
x(k)
y(k) = 1 0 0
ω(k)
The observability matrix for the augmented system is
c 1 0 0
Wo = cΦ = 1 h h2
2
cΦ2 1 2h 2h2
111
estimated.
112
A block diagram of the system is shown in the Fig. 4.8. Eliminating u and
introducing the estimation error e we find that the closed-loop system can
be described by
The closed-loop system obtained with this naive control law has the same
zeros as the plant and its poles are the eigenvalues of the matrix (Φ − ΓL),
which can be placed at any positions by properly choosing L is the system
is controllable.
Bm (z)
Let the transfer function of the reference model be Hm (z) = , then the
Am (z)
tracking problem is to design the controller such that the transfer function of
the closed loop Hcl (z) match the reference model Hm (z) as close as possible.
113
controller Hf b , is designed to obtain a closed-loop system that is insensitive
to process disturbances, measurement noise, and process uncertainties. The
feed-forward compensator Hf f is then designed to obtain the desired servo
properties. Obviously, the naive controller discussed before is just the sim-
ple case of two-degree-of-freedom controller with Hf f = Lc . If instead, we
choose
Bm (z)
Hf f = Lc = (4.37)
B(z)
Then we have the closed loop transfer function from the command signal uc
to the output,
However, this is only true if all the zeros of B(z) are stable or all the unstable
zeros of B(z) are also the zeros for Bm (z)! This is due to the fact that the
closed-loop transfer function from the command signal uc to the input signal
is
U (z) A(z)Bm (z)
= (4.39)
Uc (z) B(z)Am (z)
which requires that B(z) has to be stable. Otherwise, the input signal may
blow up!
114
4.5.3 Putting It All Together
By combining the solutions to the regulation and servo problems we have a
powerful controller, which is described by
115
Figure 4.1: Model reference control system
116
Figure 4.2: State feedback controller
117
Figure 4.4: output feedback controller by combining state feedback with
observer.
118
Figure 4.6: Response of the system to impulse disturbance
119
Figure 4.7: output feedback controller with estimated disturbance and
states.
120
Figure 4.8: Naive approach for tracking problem
121
Figure 4.9: Two-degree-of-freedom Controller
122
Figure 4.10: The state-space approach to control system design
123
Chapter 5
Pole-Placement —
Polynomial Approach
124
observer using output feedback
e(k + 1) = (Φ − Kc)e(k)
Choose K such that (Φ − Kc) has desired C.P. K can be calculated by
Ackermann’s formula.
Again, what if the system is unobservable? It implies that some poles for the
observer cannot be changed by output feedback. But if these unobservable
poles are all stable, then the estimation error can be made to converge to
zero asymptotically. We call such kind of system detectable.
When a system is detectable but unobservable, the state variables can still
be estimated. But unobservability implies that the state variables cannot
be determined uniquely by the observation of the outputs, do we have a
contradiction here?
No. Convergence of estimation error to zero does not imply that the state
variables can be determined exactly. For instance, consider two convergent
series, {sin(t)/t} and {1/t}. Both of them converge to zero, but they are
not equal to each other.
Disturbance Rejection
The standard way of dealing with disturbance is adding them into the state
vector, and building an observer to estimate the whole augmented state vec-
tor.
125
Should we still use u(k) = −Lx̂(k), or try the combination.
x1 (k)
..
.
xl (k)
u(k) = −L
x̂l+1 (k)
..
.
x̂n (k)
Rule of Thumb: always use the more accurate information.
But before we address this problem, let’s discuss the relationship between
the state-space model and the input-output model.
126
Finally, we have
Transfer function:
B(z)
c(zI − Φ)−1 Γ =
A(z)
Difference Equation:
A(q)y(k) = B(q)u(k)
A(q)y(k) = B(q)u(k)
B(z)
Y (z) = U (z)
A(z)
Let
A(z) = z n + a1 z n−1 + · · · + an
B(z) = b1 z n−1 + · · · + bn
How many state-space models can be derived? There are infinite number of
realizations. For instance, the most famous one is
the Controllable Companion/Canonical Form: {Φc , Γc , cc }
−a1 −a2 · · · −an 1
1 0 · · · 0 0
Φc = . .. , Γc = .
.. .. .. ..
. . .
0 ··· 1 0 0
cc = b1 · · · bn
Or
127
The Observable Companion/Canonical form: {Φo , Γo , co }, which is
simply the dual system of the controllable companion form {ΦTc , ΓTc , cTc }
−a1 1 · · · 0
.. b1
−a2 0 · · · . .
Φo = ΦTc = .. . .
, Γo = cTc =
..
. .. .. 1
bn
−an · · · 0 0
co = ΓTc =
1 ··· 0
Are these two representations similar to each other? Not always!
If the system is both controllable and observable, then these two companion
forms are similar to each other.
The poles of the system is decided by the roots of A(z). If the poles of
A(q) are not at ideal places, then we may want to place the poles at proper
positions. — The same objective as before.
128
Figure 5.1: Pure Error-Feedback Controller
The closed loop transfer function from the command signal uc (k) to the
output y(k) can be easily obtained as
B(z)S(z)
Y (z) = Uc (z) (5.3)
A(z)R(z) + B(z)S(z)
Suppose we can design the R(z) and S(z) such that A(z)R(z) + B(z)S(z)
129
matches the desired C.P., then there is no room left for us to match the ze-
ros since there is no freedom to manipulate the numerator in above transfer
function.
Therefore, error feedback controller is sufficient only for stabilization of the
process. In order to match the zeros of the reference model, we have to
increase the degree of freedom in the controller, just as we did for the state-
space approach.
Question: Can we solve R(z) and S(z) from above polynomial equation?
Yes, under certain conditions.
B(z)T (z)
Y (z) = Uc (z)
Acl (z)
In the state-space approach, there are two desired polynomials, one for the
state-feedback controller Ac , and one for the output-feedback observer, Ao ,
and the C.P. for the overall system is
So
B(z)T (z)
Y (z) = Uc (z) (5.8)
Ac (z)Ao (z)
How to choose T (z)?
T (z) can be chosen to satisfy other design requirements.
130
Figure 5.2: Two-Degree-of-Freedom Controller
If perfect match of the reference model is not required, one simple way to
choose T (z) is
T (z) = to Ao (z) (5.9)
Such that
to B(z)
Y (z) = Uc (z) (5.10)
Ac (z)
Note that the dynamics of the closed-loop system is low-order now by can-
celing out the stable poles and zeros.
131
to is chosen to obtain the desired static gain of the system. Note that the
static gain of the closed loop is tAo B(1)
c (1)
. For example, to have unit static gain,
we simply let
Ac (1)
to = (5.11)
B(1)
But you may not be satisfied with above choice of T (z) as the zeros of the
closed loop do not match the zeros of the reference model. If you want to
achieve perfect match, it is possible under certain conditions which will be
discussed later in this class.
Keep in mind that there are always multiple ways to control a system, once
the poles are properly assigned, T (z) can be chosen to satisfy other design
specifications.
Rules to follow:
2. The controller has to be causal: The input cannot depend upon the
future values of the output.
Example:
R = z + 1, S = z 2 + 1
then we have
Ru = −Sy ⇒
u(k + 1) + u(k) = −y(k + 2) − y(k)
What is the problem with such design? Such kind of controllers can not be
implemented, although mathematically it is fine.
Causality condition:
DegR ≥ DegS (5.12)
132
Let’s try the simplest controller, the proportional control,
R = 1 S = s0
So
h2
AR + BS = (z − 1)2 + s0 (z + 1)
2
If the desired C.P. is
Acl = z 2 + p1 z + p2
Can we match the desired C.P.?
Two equations with one parameter:—-mission impossible!
R = z + r1
S = s0 z + s1
Then
h2
AR + BS = (z − 1)2 (z + r1 ) + (z + 1)(s0 z + s1 )
2
h2 h2 h2
= z 3 + (r1 + s0 − 2)z 2 + (1 − 2r1 + (s0 + s1 ))z + r1 + s1
2 2 2
If the desired C.P. is
Acl = z 3 + p1 z 2 + p2 z + p3
h2
r1 + s0 − 2 = p1
2
h2
1 − 2r1 + (s0 + s1 ) = p2
2
h2
r1 + s1 = p3
2
We have
3 + p1 + p2 − p3
r1 =
4
5 + 3p1 + p2 − p3
s0 = (5.13)
2h2
3 + p1 − p2 − 3p3
s1 = −
2h2
133
Next question is then how to choose T (z)?
Since the third order polynomial always has a real root, we can choose this
as Ao (z), Let
T (z) = to Ao (z)
where
Ac (1)
to =
B(1)
Remark: The controller must have sufficient degree of freedom. In this
example, first order dynamical controller is used instead of the proportional
controller. Increasing the order of the controller by one will give an increase
of two parameters. But the degree of the desired C.P. is increased by one,
and hence the total number of equations for solving the design parameters
is increased by one. For instance, if a second order controller is used in the
double integrator example, then there may be infinite number of solutions
to achieve the same goal.
Given polynomials A(z) and B(z) whose maximum degree is n, and a third
polynomial Acl (z), under what conditions does the solution exist for
Diophantine equation
First of all, let’s see under what conditions the solution may not exist?
Hint: In the state space approach, if the system is uncontrollable, then the
problem cannot be solved. Translating that into the input-output model,
we may state that:
If A(z) and B(z) have a common factor (z − c), then Acl (z) must contain
the same factor (z − c), otherwise, the solution does not exist.
And we know, if A(z) and B(z) have a common factor, then this pole cannot
be changed by linear state-feedback controller, and the minimal realization
of the system is uncontrollable.
134
Do we need other conditions to guarantee the existence of solution?
Hint: if A(z) and B(z) have no common factors, then the minimal real-
ization of the system is both controllable and observable. Therefore, the
solution exists at least for the minimal realization of the system. So our
intuition tells us that we don’t need extra conditions.
Let’s see if our intuition is true. Let’s examine the simple case of second
order system.
A(z) = a0 z 2 + a1 z + a2
B(z) = b0 z 2 + b1 z + b2
Acl (z) = p0 z 3 + p1 z 2 + p2 z + p3
Design a first order controller
R(z) = r0 z + r1
S(z) = s0 z + s1
From
AR + BS = Acl
and compare the coefficients, we have
z3 : p0 a0 r0 + b0 s0
z2 : p1 a1 r0 + a0 r1 + b1 s0 + b0 s1
z: p2 a2 r0 + a1 r1 + b2 s0 + b1 s1
1: p3 a2 r1 + b2 s1
Sylvester matrix
Sylvester Theorem:
135
Two polynomials A(z) and B(z) have maximum order of n. They are rel-
atively prime, i.e. they have no common factors, if and only if the corre-
sponding Sylvester matrix Me is nonsingular, where Me is defined to be the
following 2n × 2n matrix:
a0 0 ··· 0 b0 0 ··· 0
.. .. .. ..
a1 a0 . . b1 b0 . .
.. .. .. ..
. a1 . 0 . b1 . 0
.. .. .. .. .. ..
. . . a0 . . . b0
Me = (5.15)
.. .. .. ..
an . . a1 bn . . b1
.. .. .. .. .. ..
0 . . . 0 . . .
.. .. .. .. .. .. .. ..
. . . . . . . .
0 ··· 0 an 0 ··· 0 bn
| {z }
<−−−−−−n−−−−−−><−−−−−−n−−−−−−>
where
A(z) = a0 z n + a1 z n−1 + · · · + an
(5.16)
B(z) = b0 z n + b1 z n−1 + · · · + bn
The proof is not included here due to time constraint. I hope you can figure
it out after the lecture.
A(z)y(k) = B(z)u(k)
Let
Deg A = n, Deg B ≤ n
(5.17)
Deg Acl = 2n − 1
Design a controller of degree n − 1,
Deg R = n − 1
Deg S = n − 1
136
Then if the minimal realization of the system is both controllable and ob-
servable (i.e., A and B have no common factors), R and S can be uniquely
determined from the Diophantine equation
A(z)R(z) + B(z)S(z) = Acl (z)
by
p0
r0
.. p1
.
..
.
rn−1
= Ms−1
(5.18)
s0 ..
.
..
..
.
.
sn−1 p2n−1
You may notice that the controllable and observable condition assures the
existence of inverse of the Sylvester matrix, Ms−1 , in above solution. But
what about the condition of the degree of the desired polynomial, Acl (z)?
Why is it required to be 2n-1? Or in other words, the first coefficient, p0
cannot be zero? What would happen if we let p0 = 0?
137
and we can obtain
r0 = 1
3 + p1 + p2 − p3
r1 =
4
5 + 3p1 + p2 − p3
s0 =
2h2
3 + p1 − p2 − 3p3
s1 = −
2h2
which is the same answer as those obtained by direct calculation.
As mentioned before, the degree of the desired polynomial, 2n-1=3, is im-
portant. Let’s see what would happen if the degree of Acl is 2, and hence in
the form of
Acl = z 2 + p2 z + p3 = 0z 3 + z 2 + p2 z + p3
A simple check of the equation (5.19), by replacing 1 with 0, and p1 = 1 in
the right hand would lead to
r0 = 0
and the degree of R(z) will be lower than that of S(z), which cannot be
implemented in reality (violation of causality condition) as discussed before.
That’s why if the degree of the denominator in the reference model, Am (z)
is lower than 2n-1, we have to increase its order by multiplying with Ao (z)
rather than setting higher order terms to be zero. This extra term of Ao (z)
can be canceled out later by properly choosing T (z), and the goal of match-
ing Am (z) can still be achieved.
138
5.4.1 Pole-Zero Cancelation
Consider the system described by
A(q)y(k) = B(q)u(k)
Then we have
B(z)T (z)
Y (z) = Uc (z)
Acl
where
Acl (z) = A(z)R(z) + B(z)S(z)
The idea is to reduce the order of the closed-loop system as low as possible.
To achieve this, we may properly choose T (z) to cancel out Ao (z). Besides
this, is there any other way to further reduce the degree?
Another way is to cancel out the stable zeros in B(z)! To achieve this, Acl (z)
must have the stable zeros as the factors.
If A(z) has stable poles, to simplify the controller, we may even leave those
stable poles of A(z) alone, which means Acl (z) have those stable poles as
factors too.
139
becomes
A+ A− R + B + B − S = A+ B + Ācl (5.24)
Obviously
R = B + R̄
(5.25)
S = A+ S̄
And we have another Diophantine equation of lower order polynomials which
is easier to solve.
k(z − b)
H(z) =
(z − 1)(z − a)
Deg R = 1, Deg S = 1
Deg Acl = 2n − 1 = 3
140
But the desired closed-loop is of second order. One possible way to reduce
the order of the system is to cancel out the stable zero z − b,
Then let
R=z−b
And
Acl = (z − b)(z 2 + p1 z + p2 )
From the Diophantine equation we have
AR + BS = A(z − b) + k(z − b)S = Acl = (z − b)(z 2 + p1 z + p2 )
we have
A + kS = z 2 + p1 z + p2
(z − 1)(z − a) + k(s0 z + s1 ) = z 2 + (ks0 − a − 1)z + a + ks1 = z 2 + p1 z + p2
Therefore
ks0 − a − 1 = p1
a + ks1 = p2
and
a + 1 + p1
s0 =
k
p2 − a
s1 =
k
Then the transfer function for the closed loop is
k(z − b)T kT
2
= 2
(z − b)(z + p1 z + p2 ) (z + p1 z + p2 )
We still have the freedom to choose proper T .
Compare the above form to the desired transfer function Hm , we simply let
kT = z(1 + p1 + p2 )
or
z(1 + p1 + p2 )
T = = t0 z
k
and the resulting controller is then
R(q)u(k) = T (q)uc (k) − S(q)y(k)
(z − b)u = t0 zuc − (s0 z + s1 )y
or
u(k) = bu(k − 1) + t0 uc (k) − s0 y(k) − s1 y(k − 1)
141
5.4.2 Disturbance Rejection Problem
Consider a system described by
B(z)
Y (z) = (U (z) + D(z))
A(z)
where d(k), i.e. D(z), is the load disturbance. Let the two-degree-of-freedom
controller be designed as
T (z) S(z)
U (z) = Uc (z) − Y (z)
R(z) R(z)
The closed-loop transfer function from the disturbance to the output, Dcl (z),
can be derived as
Y (z) R(z)B(z)
Dcl (z) = = (5.27)
D(z) A(z)R(z) + B(z)S(z)
The block diagram is shown in Fig. 5.3.
Let’s first consider the case when the disturbance is an unknown constant.
To eliminate the effect of the constant disturbance, we should design the con-
troller such that the static gain of the closed-loop transfer function, Dcl (z),
relating the disturbance to the output, is zero. Since the static gain is simply
R(1)B(1)
Dcl (1) =
A(1)R(1) + B(1)S(1)
all we need to do is letting R(z) have (z − 1) as a factor,
Then
R(1) = 0 (5.29)
This design is essentially putting the integrator in the controller.
Example:
y(k + 1) = 3y(k) + u(k) + d(k)
where d(k) is a constant disturbance. In order to cancel out the disturbance
R must contain the factor (z − 1).
A(z) = z − 3
B(z) = 1
142
Figure 5.3: Two-Degree-of-Freedom Controller with load disturbance.
R(z) = z − 1
S(z) = s0 z + s1
143
we have
s0 − 4 = p1
s1 + 3 = p2
and
s0 = 4 + p1
s1 = p2 − 3
The closed loop transfer function is then
T (z)
z2 + p1 z + p2
Other disturbances
What if the disturbance is not a constant?
If the disturbance d(k) is deterministic rather than purely random, then it
is still possible to reject the effect of the disturbance. If the frequency of the
disturbance, ωd , can be estimated, then we can use the frequency response
of the transfer function, Dcl (z), to design the controller.
From the expression of Dcl (z), if we can design R(z) such that
R(ejωd h ) = 0
then the frequency response due to this sinusoid will be zero at steady state.
In order to achieve this, let’s construct a polynomial as follows
Then let R(z) contain above polynomial as a factor, the frequency response
due to the sinusoid disturbance will be zero. If there are multiple frequencies
in the disturbance, we just add more factors into R(z). It is as simple as
that.
144
5.4.3 Tracking Problem — Command Signal Following
If the desired transfer function is
Bm (z)
Am (z)
We can have
B(z)T (z)
Y (z) = Uc (z)
Acl (z)
Question: is it possible to make
• If the zeros of B(z) are all stable, then we can make Acl contains B
such that B will be canceled out, and then let T = Bm .
where
T (q)
uf f (k) = uc (k)
R(q)
145
and
S(q)
uf b (k) = − y(k)
R(q)
Note that the transfer functions for generating the two inputs share the
same denominator R(q). In order to gain extra freedom, it is also possible
to relax this constraint, and let
where the feedforward transfer function Hf f (q) gives you additional freedom.
146
In order to match the reference model, design the feedback controller S(z)/R(z)
such that
AR + BS = Am
and choose the feedforward controller,
Bm
Hf f (z) =
RB
we will have
Y (z) Bm
=
Uc (z) Am
So the transfer function indeed matches the reference model perfectly. But
how about the input signal? We have to make sure the input signals are all
bounded. For this purpose, we have to check the transfer function from the
command signal to the input,
U (z) ABm
=
Uc (z) BAm
Still, B(z) is required to be stable to keep the input signal bounded. This
shows that the stable inverse condition is essential for perfect tracking, which
cannot be simply got rid of by adding more design freedoms.
147
6. For the simplest case, the order of the controller is limited to n − 1.
However, the order of the controller can be increased in order to meet
other design requirements.
148
Chapter 6
Predictive Control —
Solution to Tracking
Problem
6.1 Introduction
In any control system design problem one can distinguish five important con-
siderations: stability, transient response, tracking performance, constraints,
and robustness.
1. Stability. This is concerned with stability of the system, including
boundedness of inputs, outputs, and states. This is clearly a prime
consideration in any control system.
2. Transient response. Roughly this is concerned with how fast the sys-
tem responds. For linear systems, it can be specified in the time do-
main in terms of rise time, settling time, percent overshoot, and so
on, and in the frequency domain in terms of bandwidth, damping,
resonance, and so on.
3. Tracking performance. This is concerned with the ability of the system
to reproduce desired output values. A special case is when the desired
outputs are constant, in which case we often use the term output
regulation, in lieu of tracking.
4. Constraints. It turns out that in the linear case if the system model is
known exactly and there is no noise, then arbitrarily good performance
can be achieved by use of a sufficiently complex controller. However
149
one must bear in mind that there are usually physical constraints that
must be adhered to, such as limits in the magnitude of the allowable
control effort, limits in the rate of change of control signals, limits on
internal variables such as temperatures and pressures, and limits on
controller complexity. These factors ultimately place an upper limit
on the achievable performance.
5. Robustness. This is concerned with the degradation of the performance
of the system depending on certain contingencies, such as unmodeled
dynamics, including disturbances, parameter variations, component
failure, and so on.
In this module, we primarily treat sampled data control systems so that our
inputs and outputs are sequences of numbers. Typically, the actual process
will be continuous in nature. Suitable data models can then be obtained by
the techniques discussed in previous lectures. It must be borne in mind that
a design based on discrete-time models refers only to the sampled values of
the input and output. Usually, the corresponding continuous response will
also be satisfactory, but in certain cases it may be important to check that
the response between samples is acceptable.
150
6.2 Minimum Prediction Error Controllers
We can think of a model as providing a way of predicting the future out-
puts of a system based on past outputs and on past and present inputs. It
therefore seems reasonable to turn this around and ask what control action
at the present instant of time would bring the future output to a desired
value. This will be especially simple if the future outputs are a linear func-
tion of the present control, since then the determination of the control effort
involves the solution of a set of linear equations.
We consider first the case of linear dynamical system. We have seen in previ-
ous lectures that the input-output properties of these systems (for arbitrary
initial states) can be described by either state-space model or transfer func-
tion.
151
Obviously, the simple solution of tracking problem is to replace y(k + 1),
the future output at the next step, in model (6.4) with r(k + 1), the desired
output at the next step,
1
u(k) = [r(k+1)+a1 y(k)+· · ·+an y(k−n+1)−b1 u(k−1)+· · ·−bn1 u(k−n1 )]
b0
(6.8)
If control law (6.8) is used, it follows immediately by comparing (6.4) and
(6.7) that
y(k + 1) = r(k + 1)
It appears that the above controller design can be directly extended to the
case of d > 1, by writing the model (6.1) in the form of
Unfortunately, this type of controller violates the law of causality since the
future inputs y(k + d − 1) is not available at time k!
152
Then the output of the system at time t+d can be expressed in the following
predictor form:
where
α(q −1 ) = G(q −1 )
(6.12)
β(q −1 ) = F (q −1 )B 0 (q −1 )
and F (q −1 ) and G(q −1 ) are the unique polynomials satisfying
1 = F (q −1 )A(q −1 ) + q −d G(q −1 )
F (q −1 ) = 1 + f1 q −1 + · · · + f d−1 q −d+1 (6.13)
G(q −1 ) = g0 + g1 q −1 + · · · + g n−1 q −n+1
Proof
Multiplying (6.10) by F (q −1 ) gives
or
y(k + d) = α(q −1 )y(k) + β(q −1 )u(k)
where
α(q −1 ) = G(q −1 )
β(q −1 ) = F (q −1 )B 0 (q −1 )
How to solve equation (6.13)? Does this equation look familiar to you? If
you compare it with the equation (5.14), you may realize that it is also a
Diophantine equation, and you know how to solve it.
There is also another natural way to convert the original input-output model
into predictor form as shown in the following example.
153
Example 6.1
Consider the system
as mentioned before, since y(k+1) appears in the right hand, it is not in the
proper form of predictor, in which all the terms in the right hand have to
be from the present or the past.
So how to deal with the “future term”, y(k+1)?
A simple answer is just expressing y(k+1) in terms of information in the
past!
y(k + 1) = y(k) + u(k − 1)
Then plug it into the original equation, we have
You just repeat above procedure! First express y(k+2)in terms of y(k+1),
y(k), u(k) etc. Then express y(k+1) in terms of y(k), y(k-1), u(k),u(k-1), etc.
From this example, you can see how easy it is to convert the equation into
predictor form! Personally, I would rely on this natural way to do the job
instead of solving the Diophantine equation.
154
B(q −1 )u(k) = A(q −1 )r(k); k >d+n (6.16)
The resulting closed-loop system has bounded inputs and outputs provided
that the system has a stable inverse, i.e., the zeros of the polynomial lie
inside the closed unit disk.
Example 6.2
Consider a simple system with disturbance described by the following state-
space equations:
y(k) = r(k)
u(k) − u(k − 1) = r(k + 1) − r(k)
Note that although the zero is not strictly inside the unit disk, the inputs
will still be bounded, which implies that the uncontrollable pole (z=1 in this
example) can lie on the unit disk.
155
As noted in Section 6.1, excessive control effort may be called for to bring
y(k + d) to r(k + d) in one step. We therefore consider a slight generalization
of the cost function (6.17) to the form (6.18) given below, which aims to
achieve a compromise between bringing y(k + d) to r(k + d) and the amount
of effort expended.
1 λ
J2 (k + d) = [y(k + d) − r(k + d)]2 + u(k)2 (6.18)
2 2
We shall call the control law minimizing (6.18) at each time instant a
weighted one-step-ahead controller. The term “one-step-ahead” is still used
because we aim to minimize (6.18) on a one-step basis rather than in an
average sense over an extended time horizon.
where
β 0 (q −1 ) = q(β(q −1 ) − β0 ) = β1 + β2 q −1 + · · ·
The control law is (6.20). This equation can also be written using the
predictor representation (6.11) as
156
It follows that
λ
[B 0 (q −1 ) + A(q −1 )]u(k) = A(q −1 )r(k + d) (6.23)
β0
Similarly, multiplying (6.22) by B 0 (q −1 ) gives
λ
[B 0 (q −1 ) + A(q −1 )]y(k + d) = B 0 (q −1 )r(k + d) (6.24)
β0
Obviously, the resulting closed-loop system has bounded inputs and outputs
provided that the zeros of the polynomial [B 0 (z −1 ) + λ A(z −1 )] lie inside
β0
the unit disk.
Example 6.3
Consider a system in the form of (6.10) with d = 1 and
A(q −1 ) = 1 − 2q −1
B(q −1 ) = 1 + 3q −1
This system does not satisfy the condition of stable inverse, and thus u(k)
will not be bounded for a one-step-ahead control law. The weighted one-
step-ahead controller gives a closed-loop system whose modes are the zeros
of
1 + 3z −1 + λ(1 − 2z −1 ) = 0
And the pole of the closed loop system is z = 2λ − 3 . Therefore the system
λ+1
2
is asymptotically stable for 3 < λ < 4.
157
well. This is particularly straightforward in the case of bilinear systems. For
example, in the first-order case, the bilinear model has the simple form
r(k + 1) − ay(k)
u(k) =
b + ny(k)
The one-step-ahead control principle is very simple and may not be as gen-
eral as other control laws, such as those based on pole assignment or linear
optimal control. However, as we have seen above, the one-step-ahead control
principle does have the advantage of being able to utilize the true nonlinear
dynamical model of the process. Thus it may be better able to capture the
intrinsic features of the control problem than a control law based on a linear
approximation. And the strongest point of this type of controller is that it
can track arbitrary desired output r(k), whereas other controllers may not
be able to accomplish.
158
1. The system is linear.
3. The dynamic equations governing the system do not change with time.
In other words, the system is time-invariant.
Regarding the first assumption, it is not a big issue in many of the practical
problems, where we are only interested in controlling small deviations from
certain operating point. If the deviation is big, and the linearization does
not work any more, you may have to resort to nonlinear control technology,
which still has a lot of open questions. The biggest challenge of nonlinear
system is that we don’t have superposition principle to guide us any more!
The most often used trick in solving the nonlinear control problem is to
choose the control input properly such that the closed loop system is linear
just as I showed you in the introduction of this module. If you are inter-
ested in exploring more in this topic, you can study our module: EE6105
Non-linear Dynamics and Control.
If the model is unknown, or partially known, the first option is to use model-
free controller such as the classical PID control. If PID controller does not
work well, then you may have to estimate the model parameters and use
the adaptive control scheme to solve the problem, which is covered by our
modules: EE5104/EE6104 Adaptive control systems.
159
with time-varying system. We will try to offer this module to you in the
future.
160