Cos Lecture Notes 2016
Cos Lecture Notes 2016
Control Systems
M.Sc. in Mechatronics
Lecture Notes.
September 2016
Contents
CONTENTS
Chapter 1
1.1 Introduction
In this course, mostly focused on what is called Modern Control Theory, we will
use State-space representation, which allow to represent more different kinds of
systems than Transfer Functions.
where the unit of k is the year, and y(k) represents the amount of money on
the bank account at year k.
In the present situation, the dynamical behavior of the system depends only on
the initial condition y(0).
Adding an input to this system corresponds to an influx of money. Therefore
the new model with an input can be represented with the following:
where y(0) is the initial position of mass and ẏ(0) is the initial velocity of mass.
In many situations, a drug for a part of the body will be injected from another
part (think aspirine for the blood injested into the stomach through the mouth
for example). Hence the drug will propagate from place to place until it reaches
the right concentration in the “target organ”.
To model this, the compartment model diagram is used (see figure 1.3),
where V1 and V2 are the constant volume of each compartment, and c1 , c2 are
the time-varying drug concentrations in each compartment. A drug of con-
centration c0 is injected in compartment 1 at a volume flow rate u(t) (control
input). Constant parameters q0 and q are outflow rates resulting in a decrease
of concentration over time.
¨ The differential equations representing this systems is given below.
(
V1 c˙1 = q (c2 (t) − c1 (t)) − q0 c1 (t) + c0 u(t)
(1.4)
V2 c˙2 = q (c1 (t) − c2 (t)))
with
y(t) = c2 (t) (1.5)
since what we interested in is to monitor c2 (t).
Other systems are inherently nonlinear in their nature. In this case, Laplace
transforms do not apply, and their dynamical properties are generally studied
based on their differential equation representation.
Example: Pendulum
Consider the following simple model of a pendulum without friction and subject
to a gravity field
ml2 θ̈(t) + mgl sin θ(t) = 0 (1.6)
where the measurement and the initial conditions are given by
and the parameters m, l and g represent the mass of the pendulum “tip”, the
length of the pendulum and the gravity constant, respectively.
Adding rotational damping to the system gives
u(t) = τ (t)
where p is a constant.
To finish with this set of relatively simple examples, let us mention the field
of mobile robotics, which is rich with systems which are nonlinear and have
several inputs and outputs.
where x1 (t), x2 (t) represent the position of the robot in the plane, and θ(t) the
orientation of the robot. The robot is steered by the longitudinal velocity u1 (t)
and the rotational velocity u2 (t).
u1 (t), u2 (t)
The so-called car-like robot is obtained by only slightly modifying the equa-
tions of the 2-wheeled robot.
where δ(t) represents the steering angle of the front wheels of the car, and L is
the constant length between the rear axis and the front axis.
• Summator
• Gain
• Integrator
• Differentiator
• Multiplier
First note that the initial condition is not present and therefore not ac-
counted for. This is not difficult to solve, and can be done by simply adding a
constant input to signal y(t).
However, the problem is that this solution is typically quite sensitive to noise or
discretization errors, mostly due to the effect that differentiation has on high-
frequency signals (ie it amplifies them).
10
The above solution is now quite robust to noise thanks to the smoothing
properties of the integrator.
or, using another notation to incorporate the initial condition into the inte-
grator
11
Exercises
Make a block diagram for each system described in section (1.2).
With this block, we can now go back to our bank account example, which is
represented by
12
In the above system the state vector is the vector of dimension 2 defined by
x (t)
x(t) := 1 (1.16)
x2 (t)
So that the state space is R2 . Let us now draw a simple 2-dimensional graphical
representation of the evolution of this state at time t = 0, 1, 2, 3. For initial
conditions set as above (ie x(0) = [1, 0]T ), this evolution can be seen in figure
1.18a:
13
F (t + 2) = F (t + 1) + F (t) (1.17)
F (1) = 1, F (0) = 0
The first observation one can make is that since system (1.17) is of order 2, then
it is not a state-space representation.
Let us now consider the variable F (n). Could this be a valid state vector? If that
were the case, then this would mean that knowning F (0) would be sufficient to
obtain F for any future n, which is not the case since we also need F (1)! Hence
dynamic variable F (n) is not a state vector.
x ∈ R, A ∈ Rn×n , u ∈ Rm , B ∈ Rn×m
14
and put this component form into a vectorial/matrix form to obtain the state-
space representation:
q
− V1 − Vq01 q
c0
c˙1 (t) V1 c1 (t)
= q q + V1 u(t) (1.23)
c˙2 (t) V2 − V2 c 2 (t) 0
Coming back to the general representations, equations (1.18) and (1.19)
are often called dynamic equations in a state-space representation context. In
order to represetn outputs of interest, for example parts of the state that are
measured by sensors, it is common to add to the dynamic equation a so-called
output equation so that we obtain:
(
ẋ(t) = Ax(t) + Bu(t), x(0) = x0
(1.24)
y(t) = Cx(t) + Du(t)
where
y ∈ Rp , C ∈ Rp×n , D ∈ Rp×m
15
f : Rn → Rn (1.28)
So that for f : R3 → R3 :
−px1 (t) + px2 (t) f1 (x1 , x2 , x3 )
f (x(t)) = −x1 (t)x3 (t) − x2 (t) = f2 (x1 , x2 , x3 ) (1.31)
x1 (t)x2 (t) − x3 (t) f3 (x1 , x2 , x3 )
When inputs are included in the representation, vector field f also depends
on u(t) and we have
ẋ(t) = f (x(t), u(t)) (1.32)
and similarly for discrete time systems. An output equation, also nonlinear, can
be added:
y(t) = h (x(t), u(t)) (1.33)
where h is another vector field.
16
x1 = u2 (1.35)
becomes (
ẋ1 = A1 x1 + B1 u1
(1.37)
ẋ2 = A2 x2 + B2 x1
This can be written in the following State-Space form
ẋ1 A1 0 x1
= + B1 u1 (1.38)
ẋ2 B2 A2 x2
17
18
1.6. BRIDGES
1.6 Bridges
Mathematical bridges or transformations between systems that are described
mathematically can be very useful, not only for finding interesting theoretical
results, but also for more practical-related matters.
The first one which we will see afterwards concerns the actual implentation
of our continuous-time systems on a digital computers, ie how to discretize a
system by a simple program written in C or pure Matlab (ie no Simulink).
from which we can now obtain the following discrete-time state-space represen-
tation
x1 (t + 1) = x1 (t) + Ts [−px1 (t) + px2 (t)]
x2 (t + 1) = x2 (t) + Ts [−x1 (t)x3 (t) − x2 (t)] (1.46)
x3 (t + 1) = x3 (t) + Ts [x1 (t)x2 (t) − x3 (t)]
It is quite important to note that choosing the sampling period obviously depend
on the system dynamics. A fast system will generally need a small Ts while a
slow one will do with a larger sampling period.
19
1.6. BRIDGES
y (n) (t) + an−1 y (n−1) (t) + ... + a1 ẏ(t) + a0 y(t) = bu(t) (1.47)
y n (t) = −a0 y(t) − a1 ẏ(t) − ... − an−1 y (n−1) (t) + b.u(t) (1.50)
20
1.6. BRIDGES
ÿ + a1 ẏ + a0 y = bu (1.58)
21
1.6. BRIDGES
ẋ2 = u − a1 x2 − a0 x1 (1.62)
and
y = b0 b1 b2 ··· bn−1 x(t) (1.67)
for the output equation. Note that, if this state-space representation is very
similar to the one we obtained without derivatives in the input, the definition of
the state is generally more complicated than the simple x(t) = [y(t), ẏ(t), · · · ]T .
22
1.6. BRIDGES
Discrete-Time Systems
The reasoning is almost the same for discrete-time systems. Indeed, in this case,
consider instead the difference equation of order n
y(t + n) + an−1 y(t + n − 1) + ... + a1 y(t + 1) + a0 y(t) = bu(t) (1.68)
Define then the state vector as
y(t)
y(t + 1)
x(t) :=
y(t + 2)
..
.
y(t + (n − 1))
and calculate the state vector at time t + 1, ie
y(t + 1) x2 (t)
y(t + 2) x3 (t)
x(t + 1) = y(t + 3) = x4 (t) (1.69)
.. ..
. .
y(t + n) −a0 x1 (t) − a1 x2 (t)... − an−1 xn (t)
so that we have
0 1 0 0 ... 0
0
0 0 1 0 ... 0
0
0 0 0 1 ... 0
.
x(t + 1) = .. .. .. .. .. x(t) + .. u(t) (1.70)
..
. . . . . .
0
0 0 0 0 ... 1
b
−a0 −a1 −a2 −a3 ... −an−1
with the output equation
y= 1 0 ... 0 x(t) (1.71)
23
1.6. BRIDGES
Nonlinear Systems
Generally, not all nonlinear ODEs can be converted to state-space representa-
tions, and this is a topic of current research.
For example, the nonlinear system
ÿ = y u̇2 (1.76)
24
Chapter 2
Controllability and
Open-Loop control
2.1 Introduction
In the previous chapter, we spent some time modeling and simulating systems
towards control systems applications. In this chapter, we will focus on comput-
ing a control signal u(t) so that x(t) or y(t) will follow a pre-defined pattern.
Note first that by saying that, we are not talking at all about feedback. Indeed,
as useful as it is, feedback is not the only way to control a system.
Open-loop or feedfoward control is another very important concept, which we
will see in the present chapter.
The main advantage of this technique is that no sensor is needed in the case
of pure open-loop control. And no sensor can mean a cheaper product!
However, in some cases, the considered system is such that no matter what
action is taken, the desired behavior cannot be realized. This concept is related
to the notion of controllability, which helps to determine whether or not such
cases will appear.
25
One can obviously obtain the equation corresponding to this block diagram:
(
ẋ1 = −3x1
(2.1)
ẋ2 = −2x2 + x2 + u
Coming back to the block diagram in figure 2.2, following the arrows represent-
ing the flow of information in the system, we can see that u(t) will be able to
change x2 (t) but does not have any influence on the component x1 (t) of the
state. Therefore the system is not controllable.
26
we can now see that, in this new example, u(t) influences the whole state
(directly or not), thus indicating that the system is in fact controllable.
We are now ready to state a more formal definition, in line with the few
ideas we have seen so far.
Formal Definition
The system represented by: ẋ = Ax + Bu is controllable if, for x(0) = 0 and for
any point xT of the state-space, there exists a finite time T > 0 and a control
input u(t), t ∈ [0, T ], such that x(T ) = xT .
27
d −At
e x(t) = e−At Bu(t) (2.3)
dt
which is then integrated to give
τ =t
Z t
e−At x(τ ) τ =0
= e−At Bu(τ )dτ
0
⇓
Z t
−At
e x(t) − x(t) = e−At Bu(τ )dτ
0
⇓
Z t
x(t) = eAt x0 + eA(t−τ ) Bu(τ )dτ (2.4)
0
Impulse response
The impulse response, is, simply put, the response of the system in the case the
control input is an impulse, ie we have
More precisely, what we would like to determine are the conditions on ma-
trices A and B from x0 = 0 such that we can reach any target xT just by using
the control input u(t)? The problem might not be as simple as it could appear.
Indeed, x(t) is of dimension n while u(t) is only of dimension l (ie only one input
in the present case).
The main idea for solving this problem consists in constructing the signal
u(t) on [0, T ] so that it is made of a sum of several basic elements whose com-
bination allows the system state to span the whole state-space.
28
To do so, let us define n basic signal elements. First, define the first basic
control element as an impulse, whose response is the impulse response (see
previous section), ie we write
then we have the following response, which is just the sum of the individual
responses:
Since the αi coefficients are parameters which we are free to choose, then we
can steer the system to any point provided that the vectors B, AB, A2 B,
... , An−1 B are linearly independent.
Said differently, we have to check that the matrix composed of these vectors,
called controllability matrix and expressed
is nonsingular.
A standard way to check whether a square matrix is nonsingular is to check that
its determinant is different from 0. Hence the system is controllable provided
det(Wc ) 6= 0.
Main result
The system ẋ = Ax + Bu is controllable if, and only if the controllability matrix
Wc as given by equation (2.13) is invertible!
29
30
31
y = x1 (2.19)
What we would like is for the output variable y(t), or equivalently x1 (t) to
follow a pre-defined/desired trajectory yd (t)/x1d (t). What is the corresponding
control input u(t) = ud (t)?
To answer this question, let us first assume that our desired trajectory yd (t)
is a polynomial in the time variable. Then, if the output y(t) follows this desired
trajectory, we also have that
But thanks to the special structure of the CCF, we can also say that
x3 (t) = ẋ2 (t) = ẍ1 (t) = ẍ1d (t) = ÿd (t) is a polynomial (2.22)
Then, using expressions (2.20) to (2.24) and taking the last line in our CCf
expression (2.18), we can isolate our desired control signal to have
1h (n−1) (n)
i
u(t) = ud (t) = a0 yd (t) + a1 ẏd (t) + ... + an−1 yd (t) + yd (t) (2.25)
b
32
or, equivalently,
1h (n−1) (n)
i
ud (t) = a0 x1d (t) + a1 ẋ1d (t) + ... + an−1 x1d (t) + x1d (t) (2.26)
b
and because a sum of polynomials is also a polynomials, then this means that
expression (2.25) and (2.26) are also polynomial in time!
At this point, let us take a step back and discuss the consequences of these
few derivattions. If yd (t) is a polynomial trajectory going from one point to
another (i.e. from yd (0) to yd (T ) in a time T , then by taking the successive
derivatives of yd (t) = x1d up the order n, we can compute an open-loop control
signal ud (t) that will steer the system variable y(t) = x1 (t) from yd (0) to yd (T )
(i−1)
and similarly for the other state components since we will have xi (0) = yd (0)
(i−1)
and xi (T ) = yd (T ). Hence we can conclude that, since we can decide on
the desired trajectory yd (t), it is possible to compute ud (t) so that we steer the
state of system (2.18) from any initial state x0 to any desired target state xT .
Example: Mass-Spring-Damper
Taking now our well-known mass-spring damper system:
ẋ1 (t) 0 1 x1 (t) 0
= + u(t) (2.27)
ẋ2 (t) −k/m −d/m x2 (t) 1/m
and assume, as we have seen, that we want its output y(t) = x1 (t) to follow the
desired polynomial trajectory yd (t).
Then, if x1 (t) follows yd (t), then x1 (t) = yd (t). Similarly, we have then
33
yd (t) = α0 + α1 t + α2 t2 + α3 t3 + . . . (2.32)
which is a bit more involved but not that much. Indeed, we know α0 and α1
since we have just calculated them. The only unknowns are α2 and α3 and two
equations, so that should not be a problem. First isolate the unknowns
(
x1T − (x10 + x20 T ) = α2 T 2 + α3 T 3
(2.36)
x2T − x20 = 2α2 T + 3α3 T 2
Inverting then the T -dependent matrix, we finally have the α2 -α3 coefficients
2 −1
T3
α2 T x1T − (x10 + x20 T )
= (2.38)
α3 2T 3T 2 x2T − x20
34
Example: Mass-Spring-Damper
We have previously seen that a feedforward controller for the mass-spring-
damper system can be written as
and since the considered system is of order 2 then the polynomial desired tra-
jectory can be written as
yd (t) = α0 + α1 t + α2 t2 + α3 t3 (2.40)
The above feedforward controller is indeed a function of time only and a poly-
nomial.
State-coordinate transformation
In the last chapter, we have seen that, for a particular system, there are several
ways to define the state vector, leading to a different state-space representation.
What we would like to do here is to find an explicit relation between the 2
state-space representations and their associated state-vectors
Let us first start with our usual linear time-invariant state-space representation
(
ẋ = Ax + Bu
(2.44)
y = Cx
and consider another state-vector z(t) defined differently from x(t). What we
know for now about z(t) is that it is a linear invertible combination of x(t),
written as
z(t) = T x(t), with T ∈ Rn×n (2.45)
35
and then (
ż = T AT −1 z + T Bu
(2.48)
y = CT −1 z
so that we have the following state-space representation in the z-space:
(
ż = Ãz + B̃u
(2.49)
y = C̃z
where
à = T AT −1 , B̃ = T B, C̃ = CT −1 (2.50)
ÿ + 3ẏ = 2y + u, (2.51)
and
3 1 0 1
B̃ = T B = = (2.55)
1 0 1 0
so that we have the new state-space representation
0 2 1
ż = z+ u (2.56)
1 −3 0
36
This simple reasoning means that if we have T1 , then the rest of the rows of
the coordinate transform T can be deduced directly from this first row T1 and
the matrix A!
Next question is of course how to obtain this first row vector T1 . To answer
that question, let us turn to the second expression of (2.58), B̃ = T B. Use the
structure of T and B̃ to write
T1 B T1 B
T2 B T1 AB
2
B̃ = T3 B = T1 A B (2.62)
.. ..
. .
Tn B T1 An−1 B
37
where note that, because the right handside term of (2.62) is a vector, the terms
T1 Ai B are scalars.
Transposing expression (2.62) gives
B̃ T = 0 ... 0 1 = T1 B T1 AB T1 A2 B ... T1 An−1 B
(2.63)
which is nothing but
B̃ T = T1 Wc (2.64)
ie T1 multiplied by the controllability matrix!
Hence, provided Wc is nonsingular and therefore invertible, T1 is given by
T1 = B̃ T Wc−1 (2.65)
At this point, several important remarks can be made. First, if the original
system is not controllable, it means that Wc is singular and not invertible.
Hence T1 cannot be obtained. Hence the “if such a transform exists” statement
at the beginning of the discussion. This can be also explained by the fact that a
non-controllable system should be able to be put under a CCF, which we have
seen to be always controllable.
T
Secondly, note that having set B̃ as 0 ... 0 1 is not the only possibility,
T
ie we could have decided that B̃ = 0 ... 0 3 for example, as long as B̃
has the required CCF shape. In this case, however, we would have obtained a
different state-space representation.
38
It is then easy to check that we obtain, after transform, the following CCF
0 1 0
ż = z+ u (2.72)
2 −3 1
Once both the coordinate transform T and the CCF in the z-space are
obtained, we can apply the open-loop control technique we have learnt in this
chapter.
This is summarized in the following “algorithm”.
39
z = Tx (2.74)
or
z1
z1 T1 x
z2 ż1 T1 Ax
z3 z̈1 T1 A2 x
= = (2.75)
.. .. ..
. . .
(n−1)
zn z1 T1 An−1 x
since recall that the state-space representation in the z-space is a CCF.
Hence the starting relation
z1 = T 1 x (2.76)
seems quite central to find the whole transform T . If now express relation (2.76)
in plain words, we will just say that scalar variable z1 is a linear function
of the state x.
Conversely, we then also have that
40
or, in plain words, the input u is a linear function of z1 and its deriva-
tives up to order n.
Important remark
As we will see, it is not always easy to pick the right candidate for the flat
output F . Indeed, for some choices of F , it is difficult or not possible to express
x as a function of F and its derivatives.
In this case, one can only pick another candidate for the flat output. If the
system is controllable however, it is guaranteed that there is one such variable.
For linear systems, finding F can be systematically obtained by the method we
saw in the previous section.
To see how to check that a system is controllable using the above definition
and the flat output concept, let us consider (again) our previous example.
To begin with, we choose a flat output candidate (ie we do not know just yet if
that is the right candidate). Let us be as simple as possible and pick
F = x1
Then we would like to express the whole state as a (linear) function of the flat
output and its derivative. We already have x1 , so that we only have left to
determine x2 .
To do so, rewrite system (2.80) in component form by replacing x1 with F so
that we have (
Ḟ = 2x2 + u
(2.81)
ẋ2 = F − 3x2
41
Now we need to express x1 in terms of its derivatives. Let us see: using the new
flat output candidate, we have
(
ẋ1 = 2F + u
(2.83)
Ḟ = x1 − 3F
In the above set of equations, the second line turns out to be quite useful.
Indeed, x2 can be easily isolated, so that, combined with (2.82), we get
(
x1 = 3F + Ḟ
(2.84)
x2 = F
Hence the control input u is also a (linear) function of the flat output
F and its derivatives (up to order 2)!
To conclude, these two statements, given by (2.84) and (2.86) allow us to con-
clude that the system (2.80) is controllable.
42
Let us now see how the above can be applied on a simple example.
First, note that by choosing the flat output candidate F = x1 (ie we have
φ(x) = x1 ), we get the simple expression
(
x1 = F F
⇒ ψx (F, Ḟ ) = (2.91)
x2 = Ḟ Ḟ
ie the control input is a function of F and its derivatives. From (2.91) and
(2.92), we can conclude that the system is controllable.
43
For systems with multiple inputs, the flat output is now a vector F whose
dimension is the same as the dimension of the control input vector u. Indeed,
if we have p inputs, this means
u1 F1
u2 F2
u= . ⇒F = . (2.93)
.. ..
up Fp
but the rest of the procedure for checking controllability is exactly the same.
Let us see that through our examples in mobile robotics.
Since we have 2 control inputs (u1 and u2 ), then we will need a flat output with
2 components. Let us choose the flat output candidate
F1 = x and F2 = y (2.95)
Hence the state is a nonlinear function of F and its derivative. Now for the
control inputs. For u1 , add the squared first line to the squared second line of
(2.94) to obtain (after replacement with the flat output components)
44
which gives q
u1 = ± Ḟ12 + Ḟ22 (2.99)
For u2 , taking the third line of (2.94) and using (2.97), we have
!!
d Ḟ2
u2 = arctan (2.100)
dt Ḟ1
to finally obtain q
± Ḟ12 + Ḟ22
u = ψu (F, Ḟ , F̈ ) =
F̈2 Ḟ1 −F̈1 Ḟ2
(2.102)
Ḟ12 +Ḟ22
so that, combining (2.97) and (2.102), we can conclude that the system is con-
trollable.
Generally, open-loop control can be very useful for plants evolving in con-
trolled environments where the model of the system, as well as its parameters
are quite well-known and constant or varying in a predictable way (think of an
industrial robot for example). However, open-loop control might be less useful
when models are very changing and very uncertain, with highly unpredictable
disturbances (think of a ship in a storm). In this case, feedback will be more
prevalent.
45
Chapter 3
Stability and
State-Feedback
3.1 Introduction
During our computer experiments, we saw that, despite our carefully-planed
trajectories and the corresponding open-loop controller calculating the desired
input ud (t), the obtained result could be not exactly the same as the desired
behavior, ie it turned out that y(t) was not following exactly yd (t).
Obviously, this behaviour is not what we usually require from many systems.
Indeed, what we would like is a final behavior which is consistently the same,
and this despite a change in initial conditions. This entails the notion of sta-
bility, which, roughly speaking, means to be robust to changes. There quite a
few ways to define stability for dynamical systems. In the present case, we will
consider stability with respect to changes in initial conditions.
Intuitively, stability with respect to initial conditions, which we will call here
simple stability, can be represented graphically by the figure 3.1a
where the horizontal axis is the time, and the vertical one is the amplitude of
a considered variable, say output y(t). In this case, stable will mean that taking
different possible signals y(t) intialized differently, they will all eventually reach
46
3.1. INTRODUCTION
and this no matter what the initial condition of the system is! Hence this system
is obviously stable.
Many systems are not naturally stable (think of the upstraight position of a
pendulum for example). In this case, one can render or make this system stable
by using information on the state to send corrections on the control input so
that the system in closed loop is stable. The controller that does that is called
feedback stabilizer or feedback controller (see figure 3.2).
Let us now consider another scalar system, albeit an unstable one, and see
how it can be stabilized by feedback.
47
that is the final behavior is hightly dependent on the initial condition, implying
that the system is not stable.
The basic idea behind stabilization by feedback consists in choosing a control
expression u (also called control law ) as a function of the state x so that the
global system, also called system in closed-loop, is stable.
Let
u(t) = −2x(t) (3.7)
Then, replace signal u(t) in (3.4) with control law (3.7), which gives
so that the system in closed-loop is stable. Hence the simple linear controller
(3.7) with proportional gain 2 was able to stabilize system (3.4).
An important result from classical control theory states that system (3.9)
is stable if and only if each root of the denominator a(s) (called char-
acteristic polynomial ) has a strictly negative real part.
Remark that this result is meant for an input-output notion of stability, and
therefore that initial conditions are not explicitly considered. In addition, in the
way this result is stated, it requires the presence of an input signal, which, as
we have seen is not always the case (think of a state-space representation with
the matrix B = 0).
48
Similarly to the scalar cases we have seen in section 3.1, we want to have
a simple criterion allowing us to conclude on the stability of system (3.10) by
considering only matrix A.
A simple but neat way to obtain such a criterion consists first in applying
the Laplace transform on system (3.10) so that we get
where x(s) is the Laplace transform of x(t) and I is the identity matrix.
Now we know from section 3.2.1 that transfer function (3.13) is stable (for
all inputs and therefore for the impulse of amplitude x0 ) if and only if each
root of the denominator of (3.13), ie characteristic polynomial det(sI − A) has
its real part strictly negative, or, using other words, if each solution λ of the
equation det(λI − A) = 0 has a strictly negative real part.
The above means that, in order to assess the stability of system ẋ = Ax, one
can directly compute the eigenvalues of matrix A without having to compute
the corresponding transfer function.
This finally leads to the following result.
49
From equation (3.15), we can see that we have a double eigenvalue λ = −1,
whose real part is strictly negative. Hence the system (3.14) is stable.
Take now another system:
−1 −1
ẋ = x (3.16)
1 −1
The eigenvalues of matrix A are given this time by λ1 = −1 + i and λ2 =
−1 − i. Both eigenvalues have a strictly negative real part, the system again is
stable.
50
or
ẋ(t) = (A + BK)x(t) (3.21)
Clearly the closed-loop dynamics (3.21) is stable if each eigenvalue of A + BK
has a strictly negative real part.
Hence, in this case, the role of the control engineer is to pick values of matrix
K such that its closed-loop dynamics is stable!
and assume that we would like to stabilize this system by state-feedback (first
one can also check that this system is not stable when u = 0, which it is not).
Since dim(x) = 3 and dim(u) = 2, we have that K ∈ R2×3 .
Let us rewrite (3.22) in component-form as follows
ẋ1 = 2x1 + u1
ẋ2 = x1 − x2 + 2x3 + 2u2 (3.23)
ẋ3 = 2x2 − x3
51
A possible control law (but there are many other possibilities) could be u1 =
−3x1 and u2 = −x3 . This would give the closed-loop dynamics
ẋ1 = −x1
ẋ2 = x1 − x2 (3.24)
ẋ3 = 2x2 − x3
or
−1 0 0
ẋ = 1 −1 0 x (3.25)
0 2 −1
which is a cascade of 3 stable subsystems, giving an overall stable system (one
can also check the eigenvalues of closed-loop system (3.25)). Hence the system
was stabilize by state-feedback with the gain matrix K written as
−3 0 0
K= (3.26)
0 0 −1
52
y(s) 1
= . (3.30)
u(s) (s − 2)(s − 3)
which we will call desired characteristic polynomial, and where p1 and p0 are its
polynomial coefficients.
In turn, this would give the closed-loop matrix A′ = A + BK written as
0 1 0 1
A′ = = (3.33)
−p0 −p1 −2 −3
Thus, equating the two right handside terms of expression (3.34), we obtain an
expression linking the gains of the feedback controller with the parameters of
the system, as well as the coefficients of the desired characteristic polynomial:
( (
−a0 + k1 = −p0 k1 = −p0 + a0
⇒ (3.36)
−a1 + k2 = −p1 k2 = −p1 + a1
53
After this example, the n-dimensional case is not more difficult. Indeed,
considering now the n-dimensional CCF
0 1 0 ... 0 0
.. . .. . .. .
.. .
..
. 0
... .. x + . u
ẋ = .. .. .. (3.38)
. . . 0
0 0 ... 0 1 0
−a0 −a1 . . . . . . −an−1 1
whose characteristic polynomial is
Thus, wanting the system in closed-loop to have the desired characteristic poly-
nomial
p(s) = sn + pn−1 sn−1 + . . . + p2 s2 + p1 s + p0 (3.43)
means that we need to set the state-feedback controller gains to
of the CCF,
• using the n desired poles of the system in closed-loop, compute the desired
characteristic polynomial
54
of the CCF,
• using the n desired poles of the system in closed-loop, compute the desired
characteristic polynomial
u = K̃T x (3.47)
55
From the above definition, note, importantly, that while it is possible that
the origin of the state-space is an equilibrium, it does not have to be so (see for
example the illustration in figure 3.3). Second, and we will see on an example,
the definition implies that there can be several points, not just one.
0 = f (x∗ ) (3.49)
56
Example: Pendulum
Recall that we have
x2 (t)
ẋ(t) = (3.50)
− gl sin x1 (t)
A first simple way to find the equilibrium points of this system is through using
a simple physical reasoning. The system is in equilibrium means that it does not
move anymore :-). Hence we have that the second component of x∗ , ie angular
velocity x∗2 is zero. This corresponds to 2 equilibrium positions (modulo 2π),
pendulum up and pendulum down. Thus we can easily conjecture 2 equilibrium
points: ∗ ∗
x 0 x π
x∗ = 1∗ = and x∗ = 1∗ = (3.51)
x2 0 x2 0
Let us now confirm that mathematically. Indeed, having equation (3.49) means
that we need to solve
x∗2 π
g = (3.52)
− l sin x∗1 0
which indeed leads exactly to the 2 equilibrium points obtained in (3.51).
At this point, it is worth mentioning that the dynamic behavior around (but
not on) each equilibrium point can be very different whether the pendulum is up
or down. This is indeed the case and we will discuss that when we look at stabil-
ity considerations. For now, let us continue our discussion on equilibrium points.
The systems we have considered now did not have any input signal... Let us
first see what happens when a torque input is added to our pendulum example.
57
a specific constant torque can maintain the pendulum in a particular fixed an-
gle/position, then the input signal plays an important role in the definition of
equilibrium points.
Let us see that mathematically. Setting the fector field to zero leads to expres-
sion
x∗2 0
g = (3.55)
− l sin x∗1 + ml1 2 u∗ 0
where u∗ stands for the control input associated to the equilibrium x∗ , ie the
value of the control input for which we have an equilibrium. Rewriting the
second line of this expression gives
g 1 ∗
0 = − sin x∗1 + u (3.56)
l ml2
where we see that we can choose any value of x∗1 as long as we find the corre-
sponding u∗ !
For example, assume that we would like to maintain the pendulum on position
x∗1 = π4 . Then we have the associated control input
π
u∗ = mgl sin (3.57)
4
Hence, for system (3.54), we have the set of equilibrium points given by
∗
x
x∗ = 1 (3.58)
0
and its associated control input
u∗ = mgl sin x∗1 (3.59)
Hence, for systems with a control input, the set of equilibrium points can
have to be considered in conjunction with their associated control input u∗ .
58
∂f
f (x∗ + δx(t)) ≈ f (x∗ ) + (x) .δx(t) (3.63)
∂x x=x∗
∂f2 ∂f ∂f
∂x1 (x) ∂x22 (x) . . . ∂xn2 (x)
∂f
(x) = .
.. .. (3.65)
∂x .. . ... .
∂fn ∂fn ∂fn
∂x1 (x) ∂x2 (x) . . . ∂xn (x)
d ∗ ∂f
(x + δx(t)) ≈ f (x∗ ) + (x) .δx(t) (3.66)
dt ∂x x=x∗
d ∗
Then, since x∗ is an equilibrium point, we have dt x = 0 and f (x∗ ) = 0, which
finally gives us the dynamics
d ∂f
(δx(t)) = (x) δx(t) (3.67)
dt ∂x x=x∗
59
x∗ = [π, 0]T . Hence, for both equilibrium points, we have the linear dynamics
of the small variations
δ ẋ = Aδx (3.72)
but with different matrix A! Indeed, for equilibrium x∗ = [0, 0]T we have
0 1
A= (3.73)
− gl 0
The previous reasoning can easily be extended to systems with inputs rep-
resented by
ẋ(t) = f (x(t), u(t)) (3.75)
In this case, we want to obtain a linear approximation of the system around x∗
and its associated input u∗ . Hence we write
d ∗
(x + δx(t)) = f (x∗ + δx(t), u∗ + δu(t)) (3.76)
dt
so that the first-order approximation of f (x, u) is now
where δu(t) := u(t) − u∗ . From there, and similarly to what we have done for
systems without inputs, we end up with the following linear approximation
" # " #
d ∂f ∂f
δx(t) = (x, u) δx(t) + (x, u) δu(t) (3.78)
dt ∂x x=x∗ ,u=u∗ ∂u x=x∗ ,u=u∗
with
" # " #
∂f ∂f
A= (x, u) and B= (x, u) (3.80)
∂x x=x∗ ,u=u∗ ∂u x=x∗ ,u=u∗
60
0 1
π/4 ∂f
x∗ = ⇒ (x) = √
2g (3.86)
0 ∂x x=x ,u=u
∗ ∗ − 2l 0
0 1
0
δ ẋ = √ δx + 1 δu (3.87)
− 2l2g 0 ml2
61
Similarly, the variable δx used for feedback in (3.89) still represents small de-
viations around x∗ , not the state x(t) as measured from the nonlinear system
itself. As a consequence, what enters our feedback controller (3.89) is
Hence, combining (3.89), (3.90) and (3.91), a way to implement our linear state-
feedback stabilizer of a nonlinear system would be given by the following ex-
pression
u(t) = K(x(t) − x∗ ) + u∗ (3.92)
This linear controller and its nonlinear plant are represented together in a block
diagram below (see figure 3.4).
62
0 = A′ x∗ = (A + BK)x∗ (3.93)
63
The difference with the previous section is that, contrary to the nonlinear system
case, the variations around (x∗ , u∗ ) do not to be local or “small” since we are
not using an approximation. The system is linear and the error variable ∆x(t)
(and ∆u(t) as well) can be as big as we want. Hence the notation ∆x used here
as opposed to δx for the nonlinear case.
First, we need to make sure it is actually possible at all for the system to
follow this trajectory, especially when there is no disturbance or difference in
initial conditions. Hence, we will call feasible trajectory for the system ẋ =
Ax + Bu a desired trajectory xd (t) if an open-loop control signal ud (t) can be
found such that xd (t) is a solution for the system with ud (t) as input. That is
we have xd (t) and ud (t) verifying
ẋd (t) = Axd (t) + Bud (t) (3.101)
Note that this expression can be seen as an extension of the equilibrium relation
(3.94) we just saw in section 3.5.1. Indeed, if xd (t) is constant, then expression
(3.101) reduces to 0 = Axd + Bud , which is nothing else than (3.94).
Alternatively, one can also draw links with open-loop control using flatness the-
ory: in the linear case, the desired control input ud (t) as a function of desired
flat variable Fd (t) and its derivatives is just another way to write expression
(3.94) here above.
Once the feasible trajectory xd (t) and its associated ud (t) are defined, we
can introduce, similarly again to the previous section the “delta” variables given
by
∆x(t) := x(t) − xd (t) and ∆u(t) := u(t) − ud (t) (3.102)
which again leads to the error dynamics around (xd (t), ud (t))
∆ẋ = A∆x + B∆u (3.103)
64
ẋ = ax + bu (3.105)
where a and b are the constant parameters of the system. Applying the state-
feedback controller u = kx, we will get the closed-loop dynamics
ẋ = (a + bk) x (3.106)
ẋ = (a + bk) x + d (3.108)
65
where it is important to notice that the constant disturbance term has disap-
peared since d˙ = 0. Converting this second-order system into a state-space
representation by defining the state coordinates [x1 , x2 ]T := [x, ẋ]T , we get
d x1 0 1 x1
= (3.113)
dt x2 bkI a + bk x2
We know that the whole state [x1 (t), x2 (t)]T and hence x1 (t) = x(t), will con-
verge to 0 provided each eigenvalue of the matrix
0 1
AI (3.115)
bkI a + bk
has a strictly negative real part. The result is quite important, because it means
that provided that k and kI are chosen properly, ie so that the dynamics (3.113)
are stable, controller (3.110) can stabilize our scalar system around the origin,
and this despite the presence of an additive constant disturbance!
66
Let us now introduce the state-feedback law with integral term on x1 (t)
Z t
u(t) = Kx(t) + kI x1 (τ )dτ
0
Z t
= kn xn (t) + ... + k2 x2 (t) + k1 x1 (t) + kI x1 (τ )dτ (3.117)
0
where the order of the terms ki xi (t) are inverted just for convenience (see also
in figure 3.7 a block diagram of the proposed controller in connection with a
plant).
...
Rt
ẋn = (kn − an−1 ) xn + ... (k2 − a1 ) x2 + (k1 − a0 ) x1 + kI 0 x1 (τ )dτ + d
(3.118)
67
ẋ = Ax + B(u + d) (3.122)
ż = T AT −1 z + T B(u + d) (3.123)
Note, importantly, that, since we use z1 (t) in the integral term, we will have
then Z t
u(t) = K̃T x(t) + k̃I T1 x(τ )dτ (3.125)
0
when we come back to the x-coordinates to implement the controller. Hence, in
this case, this means that we might need to integrate the whole state, not just
x1 (t).
68
ẋ = ax + bu (3.126)
and assume this time that we want to stabilize it around an equilibrium point not
at the origin, ie we have x∗ 6= 0. For convenience, let us rewrite this equilibrium
point as r := x∗ (often called “reference”). As an alternative to what we saw in
section 3.5, ie a combined open-loop/state-feedback control strategy, consider
instead the following dynamic state-feedback controller (with integral term)
Z t
u(t) = kx(t) + kI (x(τ ) − r)) dτ (3.127)
0
Let us now look at the equilibrium points of system (3.129) or (3.130). Setting
the derivative of the state components to 0, we get
) (
0 = x∗2 x∗1 = r
∗ ∗
⇒ (3.131)
0 = (a + bk)x2 + bkI (x1 − r) x∗2 = 0
which means that we are free to choose any r we want! The important im-
plication of this is that, provided of course that k and kI are chosen so that
the system is stabilized, using integral controller means that the system will be
stabilized around the desired reference r = x∗ .
This particular technique is quite interesting because, contrary to the method
that we have seen in section 3.5.1 for stabilizing around an equilibrium point
x∗ , it does not require the computation of u∗ . It is implicitely computed by the
dynamic controller (3.127).
The above discussion can be generalized to higher-order systems using the
derivations used in the previous subsections.
ẋ = ax + bu + d.t (3.132)
69
where kp , ki and kd are the proportional, integral and derivative gains, respec-
tively. Variable e(t), called the error, is defined by e(t) = r(t) − y(t), where r(t)
is the so-called reference signal.
In order to compare a PID controller with linear state-feedback techniques,
let us first assume, for simplicity, that the reference signal is such that r(t) = 0
(i.e. we want to stabilize the system output around the origin). In this case,
controller (3.134) simplifies into
Z t
u(t) = −kp y(t) − ki y(τ )dτ − kd ẏ(t) (3.135)
0
Furthermore, we will also assume that the plant is a second-order system rep-
70
Note the striking resemblance between the above expression and equation (3.135).
Indeed, we have exactly kp = −k1 , kd = −k2 and ki = −kI , ie besides the sign
difference, k1 plays the same role as the proportional gain kp , k2 the same as
derivative gain kd and kI the same as ki .
A quite similar analysis can be carried out for second-order systems stabilized
around a non-zero reference input signal. However, for higher-order systems, a
state-feedback controller will have more gains, allowing to control more complex
dynamics (roughly corresponding to adding higher derivative terms in the PID
control frameworkd), while the PID controller will basically remain the same.
However, PID control turns out to be quite effective and sufficiently performant
while remaining quite simple in many cases, hence its popularity.
71
Start with the simple second order system (think of a MSD system with a
mass of m = 1, for example) described by
(
ẋ1 = x2
(3.139)
ẋ2 = −a0 x1 − a1 x2 + u
In this pole placement method, we have seen that, after feedback, the system
would have the (desired) characteristic polynomial p(s) = s2 + p1 s + p0 , which
corresponds to the state-space representation
(
ẋ1 = x2
(3.140)
ẋ2 = −p0 x1 − p1 x2
If we separate the system coefficients from the desired ones, this last expression
can be rewritten as
u = a 0 x 1 + a 1 x 2 − p0 x 1 − p 1 x 2 (3.143)
Putting now control law (3.143) back into system (3.139), we get
(
ẋ1 = x2
(3.144)
ẋ2 = −a0 x1 − a1 x2 + ({a0 x1 + a0 x2 } + [−p0 x1 − p1 x2 ])
where, in the second line of closed-loop system (3.144), the terms in parentheses
are the terms clearly coming from controller expression (3.143). Note that we
have separated the terms of this control expression into two parts: a part in
braces and a part in brackets.
As can be seen in the second line of (3.144), the part in braces is exactly the
opposite of the system dynamics themselves. In control terminology, we say
hence that this part of the control law cancels the system dynamics.
As for the part in brackets, it is simply there to obtain the new stable dynamics
one the old system dynamics have been eliminated by the terms in braces. These
terms in the brackets are usually called stabilizing terms. They correspond to
72
Thus, the separation of these different kinds of term leads to consider two
combined controllers: one in charge of cancelling the dynamics of the original
plant or system, and one for stabilizing the newly-obtained dynamics, ie after
cancellation. To see this, restart from scratch with system (3.139), whose dy-
namics we want to erase totally so that, after using our first feedback law, we
would have the new dynamics
(
ẋ1 = x2
(3.145)
ẋ2 = v
73
Since this system is of second-order, we would like to define a controller that will
cancel the system dynamics of the second line of (3.151) and obtain a system
identical to (3.145). To do so, remark it implies that we want
g 1
v = − sin(x1 ) + u (3.152)
l ml2
which means that, after isolating u, we have our “cancelling” controller
Note that this controller is nonlinear. Because it allows to obtain linear system
(3.145), it is therefore called linearizing controller of feedback linearizing con-
troller, ie a controller that renders a system linear by feedback. Then, we just
have to define a stabilizing controller identical to the one we have in (3.147).
To summarize, putting (3.153) and (3.147) together in a global controller, we
get the state-feedback control law
which is nonlinear.
74
Chapter 4
4.1 Introduction
Whether it was for stabilization, with or without integrator, tracking a trajec-
tory, we always assumed, when applying linear state-feedback that the state
vector x(t) was entirely accessible for measuremetns, and we were able to mea-
sure the whole state.
In practice, this might sometimes be the case, if one has enough sensors to
measure the whole state, but not always. In some situations, having enough
sensors might be too costly, or just plainly impractical. When the state is not
available, what one would like to have is an estimate of x(t).
This estimate, which we will note here x̂(t), is then used for state-feedback,
but not only: estimating the state of a system is useful for other applications as
well: monitoring and fault-diagnosis. As we will see, state estimation can also
be related to filtering.
What we will see in this are a few techniques to compute an estimate of the
state x(t) using only the available measurements y(t) as well as the knowledge
of the system’s state-space representation.
75
the control input signal u(t)) to compute/give an estimate of the state x(t).
When the answer to this question is a resounding yes, the system is said to be
observable.
Similarly to what we did in chapter 2 when we introduced the controllability
concept, the notion of observability can first be tackled using a block-diagram
perspective. Let us consider this with the simple following example.
Drawing the block diagram of system (4.1)-(4.2), we obtain (see figure below)
76
This time, notice that not all state components have an effect on the mea-
surement y(t). Indeed, x1 (t) will be totally invisible to y(t). The system is
therefore not observable. Note that a simple physical explanation of that is
that since we measure only the velocity of the vehicle, it is therefore not possi-
ble to know the whole state at time t because we do not know where the vehicle
started from.
77
Considering for an instant equation (4.6), we see that y(t) known since we
measure it, A, B, C and D are also known because we assume we know the
state-space representation of the considered system. Control signal u(t) is also
assumed to be known, which means that the integral term of (4.6) is known, as
well as Du(t). In (4.6), the only unknown term is x0 .
and can be seen as a new output signal. Note that we would have had the same
expression as (4.8) had we had no input signal at all, except that ȳ(t) would
have been replaced by y(t). Hence the inputs do not play a role in the possibility
or not of recovering the state, ie it does not change anything to the observability
property of a linear system. Thus, and without loss of generality, we will in the
rest of this section assume that we have a state-space representation of the form
(
ẋ(t) = Ax(t), x(0) = x0
(4.9)
y(t) = Cx(t)
Note that this perperty applied only for linear systems. For nonlinear sys-
tems, things get generally more tricky, and there are input signals that can
change the observability property and make the system obsevable/unobservable.
Think of the nonlinear measurement equation y = x.u for example. If u = 0,
then it is going difficult to estimate the state at all.
78
79
is invertible.
and since
det(Wo ) = 0 (4.18)
the system is not observable, confirming thus our analysis using both basic
thinking and block diagram interpretation.
80
The reasoning behind this idea, is that since both the plant and the observer
have the same models, then if apply to them the same input, them they will
have the same dynamical behavior. Hence the state of the observer, ie the state
estimate x̂, should have the same evolution as the state x(t). Now if the state
x(t) of the plant is not accessible/measurable, the state estimate x̂(t) certainly
is since the model is build on a computer, which makes every single variable
accessible!
To make these few points a bit more rigorous, let us recall the expression of
the plant given by
(
ẋ = Ax + Bu, x(0) = x0
(4.19)
y = Cx
and since our observer is (for now) a mere copy of the plant, we have
(
x̂˙ = Ax̂ + Bu, x̂(0) = x̂0
(4.20)
ŷ = C x̂
Note that, since x(t) is unknown, there is no reason (unless we are really, really
lucky) that both initial conditions are equal. Hence we have x0 6= x̂0 . Saying
that the observer is doing a good job means that, ideally, there would be no
difference whatsoever between the state and its estimate. Let us therefore define
this difference as
x̃(t) := x̂(t) − x(t) (4.21)
81
and call it estimation error. Clearly, initially, the estimation error is given by
The important question is how this estimation error evolves over time. To
answer this, let us compute the so-called estimation error dynamics. They are
simply obtained by computing the time-derivative of x̃(t):
Thus, if the estimation error dynamics (4.24) is stable, then x̃(t) will eventually
converge to 0 as t → ∞, which means that x̂(t) will converge to the true state
x(t)!
Since A is the matrix linked to the model of the plant, then this result means
that the observer will work just great and its estimate will converge to the actual
state of the plant as long as this plant is stable.
However, the downside of this technique would also mean that if the original
plant is not stable, then neither will the error dynamics be, so that the estimate
and the state will gradually drift apart from each other. There is a solution to
this issue. We will keep the powerful idea of copying the plant dynamics, but
will also add a little extra to make sure the observer does the right thing.
Note that if x̂(t) = x(t) in (4.25), then ŷ(t) = y(t) which means that
L(y − ŷ) = 0. This is an important implication, since, in this case, the ob-
server has the same dynamics as the plant.
However, when x̂(t) 6= x(t), the feedback term L(y − ŷ) corrects the state-
estimate x̂(t) so that it improves over time and gradually converge to x(t).
82
As we will see, for observer design, one can proceed quite analogously, using
another form called Observability Canonical Form (OCF). Indeed, for the n-th
order differential equation
y (n) (t) + an−1 y (n−1) (t) + ... + a1 ẏ(t) + a0 y(t) = bu(t) (4.28)
83
where note that the coefficients ai are the same as those of the controllability
canonical form. We also have the output equation
y = xn (4.30)
and
y = 0 ··· 0 1 x (4.32)
Before proceeding further, let us actually check that state-space representation
(4.31)-(4.32) indeed corresponds to system (4.28) for the simple special case
n = 2.
x1 = ẏ + a1 y (4.36)
whose time-derivative is
ẋ1 = ÿ + a1 ẏ (4.37)
Putting expression (4.37) in equation with the first line of (4.33), we finally get
ÿ + a1 ẏ + a0 y + bu (4.38)
84
can be re-written as
0 −a0 l 0 −a0 − l1
x̃˙ = − 1 0 1 x̃ =
x̃ (4.42)
1 −a1 l2 1 −a1 − l2
We would like now to tune the values li so that the estimation error dynamics
x̃˙ = (A − LC)x̃ has the desired characteristic polynomial
s 2 + p 1 s + p0 (4.43)
The above reasoning can be generalized to the tuning of any system repre-
sented by an observability canonical form of dimension n.
85
where Ã, B̃, and C̃ are the matrices of an observability canonical form. Equiv-
alently, by using the inverse of the change of coordinates defined as V := T −1 ,
we get
−1
à = V AV ⇒ V à = AV
B̃ = V −1 B (4.49)
C̃ = CV
86
which gives
V2 , V3 , · · · , Vn , −a0 V1 − a1 V2 − · · · − an−1 Vn = AV1 , AV2 , · · · , AVn (4.52)
This last equality means that, if we take term by term, V2 = AV1 , V3 = AV2 , ...
until the last column vector is obtained with Vn = AVn−1 . Hence, because of
these recursive terms, the whole matrix V can be obtained as soon as we have
the first column vector V1 .
Transposing then (4.53) and using the special form of C̃, we get
0 CV1
.. CAV1
C̃ T = . = .. (4.54)
0 .
n−1
1 CA V1
which can finally be re-written as
C̃ T = Wo V1 (4.55)
where Wo is the observability matrix of the original state-space representation.
Once we get V then it is easy to get à and B̃ (and of course T ), and then
compute L̃, the feedback gain of the observer in the z-coordinates, using the pole
placement method.
To get the observer feedback gain L in the x-space, transform the observer
based on the OCF given by
(
ẑ˙ = Ãẑ + B̃u + L̃(y − ŷ)
(4.57)
ŷ = C̃ ẑ
which gives (
x̂˙ = T −1 ÃT x̂ + T −1 B̃u + T −1 L̃(y − ŷ)
(4.59)
ŷ = C̃T x̂
87
Hence the feedback gain of the observer expressed in the x coordinates is given
by L = V L̃.
Hence the system is observable. From there, we compute the first column vector
V1 :
−1 T 1 0 0 0
V1 = Wo C̃ = = (4.63)
−1 1 1 1
and V2 :
1 1 0 1
V2 = AV1 = = (4.64)
0 −1 1 −1
so that we have
0 1 1 1
V = and T = (4.65)
1 −1 1 0
Using this change of coordinates, we then have the matrices corresponding to
an observability canonical form
1 1 1 1 0 1 0 1
à = T AV = = , (4.66)
1 0 0 −1 1 −1 1 0
1 1 1 1
B̃ = T B = = (4.67)
1 0 0 1
and
0 1
C̃ = CV = 1 0 = 0 1 (4.68)
1 −1
Note, interestingly, that because of matrices à and B̃, the system
0 1 1
ż = z+ u (4.69)
1 0 1
88
is not controllable (feel free to check that yourself). Then, using the pole place-
ment technique of section 4.4 with the desired poles of the estimation error
dynamics set to (−1, −1), we get the observer gain
2
L̃ = (4.70)
2
89
with
u(t) = K x̂(t) (4.73)
In doing so, note that we are hence combining both a state-feedback controller
and an observer to end up with a controller referred to as output feedback con-
troller, since it only uses the output for feedback as seen in the block diagram
of figure 4.6.
Figure 4.6: Output feedback controller combining linear state feedback con-
troller and observer
90
which gave us
u(t) = K (x(t) − xd (t)) + ud (t) (4.76)
Now, as seen previously, replace x(t) with its estimate x̂(t) so that we have
Note as can be seen in the block diagram below (see figure 4.7), this last con-
troller consists of 3 main subparts: a feedforward controller, an observer and a
linear state-feedback controller.
Figure 4.7: Block diagram of a tracking controller using only the output as
measurement
K = −place(A, B, P ) (4.78)
91
where P was a vector containing the desired poles of the system in closed-loop.
This function computes the values of K such that
with Pobs the vector containing the desired poles of the estimation error dynam-
ics. Hence we also have to solve an algebraic equation. To do that using the
place function from Matlab, we first transpose A − LC to get
(A − LC)T = AT − C T LT (4.82)
Hence, since transposition does not change eigenvalues, we can rewrite (4.81) as
Comparing (4.83) with (4.79), we see now that the unknown LT is at the same
spot in the equation that needs to be solved as K is in (4.79). Hence, using the
place function, we can write
T
L = place(AT , C T , P ) (4.84)
There are different ways to tune L, and we saw a few of them (deduction
from physics and basic knowledge of control, pole placement/eigenvalue assig-
ment and even the place Matlab command).
92
for which the observer structure is also a copy of the plant with corrections from
the measurements:
(
˙
x̂(t) = A(t)x̂(t) + B(t)u(t) + L(t) (y(t) − ŷ(t))
(4.86)
ŷ(t) = C(t)x̂(t)
Once the copy of the plant is combined with the feedback term L(t) (y(t) − ŷ(t)),
the remaining question is obviously how to tune the gain vector L(t).
To do so, Kalman used a combination of two equations. The first one (or the
second one, depending on the order in which these equations are presented)
gives the observer gain vector and reads
L(t) = P (t)C T (t)R−1 (t) (4.87)
where, in the deterministic case, R(t) is a positive definite matrix of design
parameters (possible time-varying). The n × n matrix P (t) is then obtained as
a solution of a matrix differential equation expressed as
Ṗ (t) = A(t)P (t) + P (t)AT (t) − P (t)C T (t)R−1 (t)C(t)P (t) + Q(t) (4.88)
where P (t) has the initial condition P (0) = P T (0) > 0, and where Q(t) is an-
other positive definite matrix of design parameters. Expression (4.88) is called
the Riccati equation and is quite famous in control systems. Together with the
gain expression (4.87), they result in a choice of L(t) that will, among other
things, make sure that the observer estimate x̂(t) converges to the actual state
x(t).
Equations (4.86), (4.87) and (4.88) are known as the Kalman filter.
One of the fundamental results related to the Kalman filter is that its esti-
mate x̂(t) is the best estimate one can obtain under the assumption of Gaussian
noise affecting both the state equation and the output equation. The Kalman
filter is said to be an optimal estimator.
93
and
∂h
C(t) = (x(t)) (4.93)
∂x x(t)=x̂(t)
The Extended Kalman Filter found its way in many applications where the sys-
tem is nonlinear, from induction machines to underwater navigation. However,
despite its usefulness, it is also known to be not always easy to tune, and does
not have a global optimal property, compared to its linear ancestor.
94