Professional Documents
Culture Documents
II
DeKUT
Lecture Notes
By
February 2024
Table of contents
II Modern Control 1
References 77
Part II
(Modern Control)
Chapter 3a
where u1 and u2 is defined as the control inputs and y1 and y2 is defined as the measurements
or outputs
We now define the outputs and if necessary the derivatives of the outputs as states.
Hence, define the states
x1 = y1 , x2 = y˙1 , x3 = y2
1
2
This gives the following set of 1st order differential equations for the states
x˙1 = x2 (1.3)
x˙2 = −k2 x − 1 − k1 x2 + u1 + k3 u2 (1.4)
x˙3 = −k5 x2 − k4 x3 + k6 u1 (1.5)
y 1 = x1 (1.6)
y 2 = x3 (1.7)
ẋ = Ax + Bu (1.10)
y = Cx + Du (1.11)
where u is the control vector, x is the state vector, y is the measurements vector and
x0 = x(t0 ) is the initial value of the state vector, which usually is assumed to be known.
The characteristic equation was defined to be the denominator polynomial of the sys-
tem’s transfer function (or transfer matrix) equated to zero. Hence, we should first obtain
an expression for the transfer matrix in terms of the state-space coefficient matrices, A, B,
C, D.
Recall that the transfer matrix is obtained by taking the Laplace transform of the gov-
erning differential equations, for zero initial conditions. Taking the Laplace transform of
both sides of the matrix state-equation, assuming zero initial conditions (i.e.x(0) = 0) yields
the following result:
Note that the single-input, single-output system of Example above, the transfer function
has a denominator polynomial s2 − 2s + 5, which is also the characteristic polynomial of the
system . The denominator polynomial is equal to |(sI − A)| (Eq. (3.107)). Thus, the poles of
the transfer function are the roots of the characteristic equation, |(sI − A)| = 0. This is
also true for the multivariable system
Example: 2
[s
Sel1111tion
I O l
(s] - A) = 0 S, + 1 - L
-1 2 s 3
[2 2 -(s. + ])
(sI- -A )-I = s ? 5s 2 1 .s 2 +4s 4 s,+l l
s +4s+5
+ + 10s + 6 2
5+1 -2(s + L) (s+1)
Toe transfer fu.R.Clion �s give-n by,
- (s
s + 4s + 4
+l
[OJ
s + I )l l
2
T(s)
t!.(s) [J -2(s ie 1)
2
(s + o- 1 L
,
s(s -1)
s +Ss' + 10s 6
=-----
1
5
Using linear algebra, the characteristic equation of a general, linear time-invariant system
is obtained from the following eigenvalue problem for the system:
Avk = λk vk (1.18)
where λk is the k th eigenvalue of the matrix A, and vk is the eigenvector associated with
the eigenvalue, λk The same equation can written as
For the nontrivial solution of Eq. 1.19 (i.e.v 6= 0), the following must be true:
Equation 1.20 is another way of writing the characteristic equation, whose the roots are
the eigenvalues of A. Hence, the poles of the transfer matrix are the same as the eigenvalues of
the matrix A. Since A contains information about the characteristic equation of a system, it
influences all the properties s uch as s tability, performance and robustness of the s ystem. For
this reason, A is c alled the s ystem’s s tate-dynamics matrix.
Transition matrix:
The free (homogeneous) response of a system can be used to find the state transition
matrix. The homogenous state equation is given as
Thus
(sI − A)X(s) = X(0) (1.23)
or
X(s) = (sI − A)−1 X(0) (1.24)
Taking Inverse Laplace transform
but
I A A2
(sI − A)−1 = + 2 + 3 + ... (1.26)
s s s
6
Hence
A2 t2 A3 t3
`−1 [(sI − A)−1 ] = I + At + + + . . . = eAt (1.27)
2!‘ 3!‘
Thus
x(t) = eAt x(0) (1.28)
or
(sI − A)X(s) = X(0)+BU (s) (1.31)
or
X(s) = (sI − A)−1 X(0) + (sI − A)−1 BU (s) (1.32)
but
(sI − A)−1 = `[eAt ] (1.33)
Thus
X(s) = `[eAt ]X(0) + `[eAt ]BU (s) (1.34)
Using convolution for the forced component
Z t
A(t)
x(t) = e x(0) + eA(t−τ ) Bu(τ )dτ (1.35)
0
This assumed initial time as zero. If the initial time is given as t0 instead of 0 the solution
is modified to Z t
x(t) = eA(t−t0 ) x(t0 ) + eA(t−τ ) Bu(τ )dτ (1.36)
t0
The solution consists of two parts. The first part represents the autonomous response
(homogenous solution) driven only by initial values diferent from zero. The second term
represents the inhomogenous solution driven by the control variable, u(t).
The output equation can also be solved in time domain by substituting the state solution
into the output equation
7
Example:
8
The elements of eAt are linear combinations of eλk t , where λk for k = 1, 2, . . . n are the
distinct eigenvalues of the s ystem . Such elements can be expressed as e akt multiplied by
oscillatory terms, s in b k t and cos b k t where ak and b k are real and i maginary parts of the kth
eigenvalue, λk = ak + ibk .
If the real parts, ak , of all the eigenvalues are negative (−) , the initial responses of all
the state-variables will decay to zero as time t becomes large due to the presence of exp ak t
as the factor in all the elements of eAt. Hence, a system with all eigenvalues having negative
real parts is asymptotically stable. This is the first stability criterion(Asymptotic Stability).
By the s ame token, i f any eigenvalue λk , has a positive real part, ak then the correspond-
ing f actor e At will diverge to i nfinity as time, t, becomes l arge, s ignifying an unstable system .
This is the second stability criterion.
If a zero eigenvalue is repeated twice, it leads to the presence of terms such as ct, where c
is a constant, in the elements of eAt . More generally, if an eigenvalue, λk , which is repeated
twice has zero real part (i.e. λk = ibk , then eAt will have terms such as tsin(bk t) and tcos(bk t)
- and their combinations - in its elements. If an eigenvalue with zero real part is repeated
thrice, then eAt will have combinations of t2 sin(bk t), t2 cos(bk t), tsin(bk t), and / tcos(bk t) in
its elements. Similarly, for eigenvalues with zero real parts repeated larger number of times,
there will be higher powers of t present as coefficients of the oscillatory terms in the elements
of eAt . Hence, if any eigenvalue,λk having zero real part is repeated two or more times, the
presence of powers of t as coefficients of the oscillatory terms, sin(bk t) and cos(bk t), causes
9
elements of eAt? to blow-up as time, t, increases, thereby indicating an unstable system.
This is the third stability criterion.
Note that individual initial responses to a specific initial condition may not be sufficient to
tell us whether a system is stable. Hence the need for BIBO stability
3.1.3 Controllability
The question of how we can (and if it is possible to) find a suitable control input u(t) that
will take the system from an initial state x(t0 ) to any desired final state x(t1 ) in a finite
(often very small) time, is answered by the theory of state controllability.
Definition 1.2 (State Controllability)
A system is said to be controllable if a control vector u(t) exists that will transfer the system
from any initial state x(t0 ) to some final state x(t) in a finite time interval.
A system described by a state space model ẋ = Ax + Bu with initial state x(t0 ) given is
controllable if for an arbitrarily finite time t1 > t0 exist a control function u(t) defined over
the time interval t0 ≤ t ≤ t1 , such that the final state, x(t1 ), can be arbitrarily specified.
There exist a few algebraic definitions which can be used for the analysis of state con-
trollability. Such a theorem is defined via the so called controllability matrix.
Applying the defination of complete state controllability we have
Z t1
x(t1 ) = 0 = eA(t1 )
x(0) + eA(t1 −τ ) Bu(τ )dτ (1.37)
0
or Z t1
x(0) = − e−Aτ Bu(τ )dτ (1.38)
0
From Sylvesters method to transition matrix solution
n−1
X
e−Aτ = αk (τ )Ak (1.39)
k=0
Let Z t1
αk (τ )u(τ )dτ = βk (1.41)
0
Thus
n−1
X
x(0) = − Ak Bβk (1.42)
k=0
10
or
β0
h i β1
x(0) = − B AB . . . An−1 B . (1.43)
..
βn−1
If the system is completely state controllable, the the above equation must be satisfied.
c [B AB A2B . . . An−1 B] are linearly independent or the
This requires that the vector
h i
2
rank of the n × n matrix B AB A B . . . A n−1 B be n or full rank
Theorem 1.11.1 (Controllability matrix)
A system described by a state space model ẋ = Ax + Bu is state controllable if the control-
lability matrix
Cn = [ B AB A2 B . . . An−1 B ] (1.44)
has full rank, i.e.,
rank(Cn) = n (1.45)
Note that for single input systems, i.e., r = 1, then Cn which implies that Cn should be
6 0 in order for the system to be state controllable.
invertible and that det(Cn) =
or
x˙4 = −a4 x4
x˙5 = −a5 x5 +u (1.49)
x˙6 = −a6 x6 +u
From the state equations in Eqs. 1.48 or Eqs. 1.49, we see that state variable x4 is not
controlled by the control u. Thus, the system is said to be uncontrollable. In summary, a
system with distinct eigenvalues and a diagonal system matrix is controllable if the input
coupling matrix B does not have any rows that are zero.
3.1.4 Observability
Definition 1.3 (State Observability)
A s ystem i s s aid to be observable i f at time t0, the s ystem s tate x(t0) can be exactly deter-
mined f rom observation of the output y(t) and inputs u(t), over a finite time i nterval.
Simply stated, observability is the ability to deduce the state variables from a knowledge
of the input, u (t) , and the output, y(t) .
Observability by Inspection
We can also explore observability from the output equation of a diagonalized system. The
output equation for the diagonalized system of Figure 12.15(a) is
h i
y = Cx = 1 1 1 x (1.51)
On the other hand, the output equation for the unobservable system of s
h i
y = Cx = 0 1 1 x (1.52)
Notice that the first column of Eq. (1.52) is zero. For systems represented in parallel form
with distinct eigenvalues, if any column of the output coupling matrix is zero, the diagonal
system is not observable.
1
From
s 0 0 1 s −1
sI − A = − =
0 s −2 −3 2 s+3
For the specified initial state, the zero-input response component of the
state and output are
−t
−e
xzi (t) = e x0 =
At
yzi (t) = CeAt x0 = Cxzi (t) = 0 t ≥ 0
e−t
h(t) = e−2t t ≥0
11
Controllability analysis
We see that ż2 (t) does not depend on the input u(t), so this state variable
is not controllable.
This yields
P = B AB A2 B
0 1 −3
= 1 −3 7
−3 7 −15
|P | = | B AB A2 B |
0 1 −3
= 1 −3 7
−3 7 −15
= [0 + (−21) + (−21)] − [(−27) + 0 + (−15)]
13
= −42 − (−42)
=0
and thus rank P < 3. This indicates that the state equation is not control-
lable. The upper left 2 × 2 submatrix
0 1
1 −3
ẋ1 (t) 1 5 x1 (t) −2
= + u(t)
ẋ2 (t) 8 4 x2 (t) 2
x (t)
y(t) = [ 2 2 ] 1 + [0]u(t)
x2 (t)
for which the associated (A, B) pair is the same as in Example 4.1. The
observability matrix Q is found as follows:
C = [2 2]
CA = [ 18 18 ]
so
2 2
Q=
18 18
Clearly |Q| = 0 so the state equation is not observable. Because rank
Q < 2 but Q is not the 2 × 2 zero matrix, we have rankQ = 1 and
nullityQ = 1.
To see why this state equation is not observable, we again use the state
coordinate transformation given by:
z1 (t) x1 (t) 1 0 x1 (t)
= =
z2 (t) x1 (t) + x2 (t) 1 1 x2 (t)
Here both the state variable z2 (t) and the output y(t) are decoupled from
z1 (t). Thus, z1 (0) cannot be determined from measurements of the zero-
input response yzi (t) = 2e9t z2 (0). This is why the given state equation is
not observable.
Also, note that x0 = [1, −1]T satisfies Qx0 = [0, 0]T and we conclude
from the proof of Theorem 4.2 that x0 is a nonzero unobservable state.
ẋ1 (t) 0 0 −6 x1 (t)
ẋ2 (t) = 1 0 −11 x2 (t)
ẋ3 (t) 0 1 −6 x3 (t)
x1 (t)
y(t) = [ 0 1 −3 ] x2 (t)
x3 (t)
C = [ 0 1 −3 ]
00 −6
CA = [ 0 1 −3 ] 10 −11 = [ 1 −3 7 ]
01 −6
0 0 −6
CA2 = (CA)A = [ 1 −3 7 ] 1 0 −11 = [ −3 7 −15 ]
0 1 −6
yielding
C 0 0 −6
Q = CA = 1 −3 7
CA2 −3 7 −15
C
|Q| = CA
CA2
17
0 1 −3
= 1 −3 7
−3 7 −15
= [0 + (−21) + (−21)] − [(−27) + 0 + (−15)]
= −42 − (−42)
=0
and thus rank Q < 3. This indicates that the state equation is not observ-
able, so there exist nonzero unobservable states for this state equation.
The upper left 2 × 2 submatrix
0 1
1 −3
Qx0 = 0
QR x0 = 0
is
2
x0 = 3
1
x1 (t)
x (t)
y1 (t) 0 1 0 0 0 2
= x (t)
y2 (t) 0 0 0 0 1 3
x4 (t)
x5 (t)
0 1 0 0 0
0
0 0 0 1
1
C 0 0 0 0
CA
0 0 0 1 0
0 0 0 0 0
Q= 2 =
CA 0 0 1 0 0
CA3
0 0 0 0 0
CA4
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Q has full-column rank 5 because of the pattern of ones and zeros. There-
fore, the state equation is observable. Furthermore, rows 1, 2, 3, 4, and 6
form a linearly independent set of 1 × 5 row vectors. Since the remaining
rows are each 1 × 5 zero vectors, there is only one way to select five
linearly independent rows from Q.
ẋ1 (t) 0 1 0 0 0 x1 (t)
ẋ2 (t) 1 0 0 0 −1 x2 (t)
ẋ3 (t) = 0 −1 0 0 0 x3 (t)
ẋ (t) 0 0 1 0 −1 x4 (t)
4
ẋ5 (t) 0 1 0 1 0 x5 (t)
x1 (t)
x (t)
y1 (t) 0 1 0 0 1 2
= x (t)
y2 (t) 0 −1 0 0 1 3
x4 (t)
x5 (t)
20
differing from the preceding example only in the second and fifth columns
of both A and C. These modifications lead to the observability matrix
0 1 0 0 1
0 −1
0 0 1
1
C 1 0 1 −1
CA
−1 1 0 1 1
1 0 1 −1 −2
Q=
CA = 1
2
0 1 1 −2
CA3
0 −2 −1 −2 1
4
CA 0 −2 1 −2 −1
−2 2 −2 1 4
−2 −2 −2 −1 4
This observability matrix also has rank equal to 5, indicating that the state
equation is observable. In contrast to the preceding example, however,
there are many ways to select five linearly independent rows from this
observability matrix, as the reader may verify with the aid of MATLAB.
Lecture 4
State Feedback
Designing controllers in state space.
8.1 State Feedback
We assume that the process to be controlled is given in state space form, i.e.
ẋ = Ax + Bu
(8.1)
y = Cx
For simplicity we assume that the process lacks a direct term, i.e. that the ma-
trix D = 0. This is a realistic assumption since processes with a direct term are
uncommon.
The transfer function of the process is given by
r P u y
kr Process
x
−K
u = kr r − k1 x1 − k2 x2 − · · · − kn xn = kr r − K x (8.2)
where the vectors K and x are given by
x1
x2
K = k1 k2 kn
x=
···
.
.
.
xn
68
8.1 State Feedback
In state feedback the control signal is hence a linear combination of the state
variables and the setpoint.
The Closed-Loop System If we combine the control law (8.2) with the process
model (8.1) the state-space description of the closed-loop system is obtained.
ẋ = ( A − B K ) x + Bkr r
(8.3)
y = Cx
Here, the setpoint r is our new input. The corresponding transfer function is given
by
Y (s) = C (s I − ( A − B K ))−1 Bkr R(s)
where the characteristic polynomial has become
det(s I − ( A − B K ))
The state feedback has changed the matrix A of the open-loop system (8.1) into
A − B K, which is the corresponding matrix for the closed-loop system (8.3). Since K
can be chosen arbitrarily, we have a certain freedom in determining the eigenvalues
of this matrix.
The controller parameter kr is apparently unaffected by the pole placement of
the closed-loop system. To begin with we shall choose kr such that the static gain of
the closed loop system becomes unity in order to achieve y = r in stationarity.
However, we may introduce introduce integral action to achieve this goal.
We will now illustrate the synthesis method by an example.
100
G P (s) =
s(s + 10)
where the current is the input and the shaft angle is the output. The transfer
function can be divided into two parts according to Figure 8.2, where we have also
marked the angular speed. If we introduce the angle and the angular speed as states,
the process can be described in state-space form as
u 100 x1 1 y = x2
s + 10 s
Figure 8.2 Block diagram of the motor in Example 8.1. The state x1 corresponds to the angular
speed, while the state x2 represents the angle.
69
Lecture 8. State Feedback
r P u 100 x1 1 y = x2
kr
s + 10 s
− k1
− k2
Now we establish feedback connections from the angle and the angular speed
according to Figure 8.3. The control law
u = kr r − k1 x1 − k2 x2 = kr r − K x
s + 10 + 100k1 100k2
det(s I − ( A − B K )) =
−1 s
s2 + 2ζωs + ω 2
2ζω − 10 ω2
k1 = k2 =
100 100
70
8.2 Controllability
The measurement signal y for different ω The measurement signal y for different ζ
1.2 1.2
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
The control signal u for different ω The control signal u for different ζ
10 5
8 4
6 3
4 2
2 1
0 0
−2 −1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Figure 8.4 State feedback control of the motor in Example 8.1. The figures to the left show
the controller corresponding to ζ = 0.7 and ω = 10, 20, 30, where the fastest control action
is achieved by the highest frequency. The figures to the right show the control performance for
ω = 20 and ζ = 0.5, 0.7, 0.9, where the most damped control action corresponds to the largest
relative damping.
The second state-space equation implies that x1 = 0 in stationarity. That this must
be the case is obvious, since x1 represents the angular speed. By inserting x1 = 0
into the first equation and exploiting that y = x2 we observe that y = r if
kr = k2
We have now completed our synthesis. Figure 8.4 shows step responses corre-
sponding to different choices of the design parameters ζ and ω . The figure shows
that the design parameter ω is an efficient way to specify the speed of a system and
that the relative damping ζ is a good measure of the damping of the system.
8.2 Controllability
In the previous example we could place the poles of the closed-loop system arbitrarily
by means of the state feedback. An interesting question is whether this is always
possible. We begin the investigation by an example.
Example 8.2—Controllability
Assume that the process we are about to control is described by the following
equations
−1 0 1
ẋ = Ax + Bu =
x+
u
0 −2 0
y = C x + Du
71
Lecture 8. State Feedback
Since the A matrix is diagonal, one can directly observe its eigenvalues and thereby
the poles of the process, which lie in −1 and −2. State feedback yields the matrix
−1 − k1 − k2
A − BK =
0 −2
det(s I − ( A − B K )) = (s + 1 + k1 )(s + 2)
Here we see that we cannot place the poles arbitrarily. By means of k1 we can
move the pole which initially lays in −1. However, there is no way for us to move the
pole in −2. We also see that the parameter k2 does not appear in the characteristic
polynomial. Hence we do not benefit from measuring x2 and involve the measurement
in the feedback.
The cause of our problem is clearly visible in the state-space description. Its
second equation is given by
ẋ2 = −2x2
and is unaffected by the control signal u. Consequently, this state is not controllable.
where n is the degree of the system. One can show that a system is controllable if
and only if the controllability matrix Ws consists of n linearly independent columns.
In the non-controllable case the columns of Ws tell which, if any, of the states are
controllable. This is illustrated in the examples below.
We investigate the controllability of the two systems studied in examples previ-
ously in this lecture.
Example 8.3—Controllability
In Example 8.1 an electric motor described by the equations
−10 0 100
ẋ =
x+
u
1 0 0
y = 0 1 x
72
8.2 Controllability
The columns of this matrix are linearly independent. One way to determine whether
the columns of a quadratic matrix are linearly independent is to investigate if the
determinant is non-zero. Since the columns of Ws are linearly independent, the
process is controllable. We observed this already in Example 8.1, since the poles
could be arbitrarily placed.
Let us now investigate the controllability of the system in Example 8.2. There
the A and B matrices were given by
−1 0 1
A=
B=
0 −2 0
The columns of this matrix are linearly dependent and det Ws = 0. The system in
Example 8.2 is thus not controllable. The columns of Ws also show that x1 is a
controllable state, while x2 is not controllable.
A Controllability Example
Controllability is an abstract concept. Processes are often constructed so that con-
trollability is achieved for the states which one wishes to control. Despite this, the
concept of controllability is still important and it is good to develop an intuitive
understanding of it. We will return to this later in the course.
In order to increase the understanding of the controllability concept, we will now
investigate a few physical processes regarding their controllability. The processes to
be investigated are shown in Figure 8.5 and are made up by interconnected water
tanks and the corresponding flows.
By writing down the mass balance equations for the individual tanks, we obtain
a dynamical model. If the level in a tank is denoted x it holds that
ẋ = qin − qout
where qin is the inflow and qout the outflow from the tank. All tanks are equipped
with a hole in their bottom which makes the inflow approximately proportional to
the level in the corresponding tank. The inflow of a tank is made up by either of the
outflow from a higher tank or an auxiliary flow u, which is our control signal.
Process A First consider process A in Figure 8.5. In this case the controlled flow
enters the upper tank. The following mass balances are obtained
ẋ1 = u − ax1
ẋ2 = ax1 − ax2
where x1 and x2 denote the levels in the upper and lower tank, respectively. The
first equation tells us that the inflow of the upper tank is given by u whereas the
outflow is proportional to the level in the tank. From the second equation we obtain
that the inflow of the lower tank equals the outflow of the upper tank and that the
outflow of the lower tank is proportional to the level in the tank. The dynamics of
process A are thus described by
−a 0 1
ẋ = Ax + Bu =
x+
u
a −a 0
73
Lecture 8. State Feedback
1 1
u u
2 2 1 2
A B C
Figure 8.5 Several connections of water tanks leading to different cases regarding controlla-
bility.
The columns of this matrix are linearly independent, and the determinant is
det Ws = a ,= 0. Hence, the system is controllable. The columns of the controllability
matrix are shown graphically in Figur 8.6, where it’s obvious that they are linearly
independent. This means that we can control both levels to take on arbitrary values,
in accordance with the definition of controllability. Observe that the definition does
not require that we should be able to maintain arbitrary constant levels. From
studying the equations one realizes that this is only possible for levels which satisfy
u = ax1 = ax2
In stationarity we thus have the same level in both tanks. Finally we must consider
the validity of the equations. In reality it holds that the levels cannot take on
negative values, neither can the control signal be negative given that there is no
pump which could suck water from the tank. As a consequence we have x1 ≥ 0,
x2 ≥ 0 and u ≥ 0.
Process B Now consider process B, shown in Figure 8.5. In this case the controlled
flow enters the lower tank. This infers that we can no longer control the level in the
upper tank. Let us now confirm this intuitively drawn conclusion by applying the
above introduced analysis method.
The following balance equations constitute a model of process B
ẋ1 = − ax1
ẋ2 = u + ax1 − ax2
x2 x2 x2
x1 x1 x1
Figure 8.6 The columns of the controllability matrix in the three examples.
74
8.2 Controllability
The columns of the matrix are linearly dependent, the determinant is given by
det Ws = 0 and the system is hence not controllable. The columns of Ws further
show that the level in the lower tank is controllable, as opposed to the upper tank
level. This is also obvious from Figur 8.6.
Process C In process C, shown in Figure 8.5, the flow enters both tanks, such
that half of the flow enters tank 1 whereas the other half enters tank 2.
The following balance equations hold for tank C
The columns of the matrix are linearly dependent, the determinant is det Ws = 0 and
the system is hence not controllable. The construction is such that if the levels are
initially equal, they will remain equal. This can also be observed from the columns
of Ws , and the illustration in Figur 8.6.
75
The roots of the equation 1.57 are the open loop poles or eigenvalues. For the closed loop 14
system described above, the characteristic equation is
The roots of equation 1.58 are the closed loop poles or eigenvalues
u = −Kx (1.59)
Thus the control u(t) will drive the system from a set of initial conditions x(0) to a set of
zero states at time tl , i.e. x(tl ) = 0.
There are several methods that can be used for pole placement.
(a) Direct comparison method: If the desired locations of the closed-loop poles (eigen-
values) are
s = µ1 s = µ2 . . . s = µn (1.60)
then from equation 1.58
14
Solution:
So far we have assumed that all process states have been directly measurable.
Normally this is not the case. However, if one can estimate the state vector by
studying the control and measurement signals, one could close the loop over the
estimates rather than the real states.
In Example 8.1 we utilized state feedback from two states in order to control an
electric motor. The measurement signal was the angle of the motor shaft and the
other state was given by the angular speed of the shaft. If the angular speed cannot
be directly measured, it can be estimated by e.g. deriving the angle measurement.
Before describing how to estimate the state vector, we will ask ourselves the
principal question whether it is generally possible to estimate the state vector merely
by studying u and y. The answer is that it is possible if the system is observable.
Observability is defined in the following way:
77
Lecture 9. Kalman Filtering
Here n is the degree of the system. One can show that the system is observable if
and only if the observability matrix Wo has n linearly independent rows. If x0 is a
non-observable state, it fulfills the equation
Wo x0 = 0
Example 9.1—Observability
A process is described by the following equations:
−1 0
ẋ =
x
0 −1
y = 1 −1 x
We can e.g. imagine that the equations describe the process in Figure 9.2, where the
states are given by the tank levels. The measurement signal is the difference between
the tank levels. The system lacks input and we study only the state evolution after
various initial states.
We shall now investigate the observability of the process. The observability
matrix is
C 1 −1
Wo = =
CA −1 1
The rows of this matrix are not linearly independent, the determinant is det Wo = 0
and the system is not observable. From the equation
Wo x0 = 0
x1 x2
1 − 2
+ P
78
9.2 Observability
x2
b d x1
a b
2 2
1.5 1.5
1 1
0.5 0.5
0 0
0 1 2 3 4 5 0 1 2 3 4 5
c d
2 2
1.5 1.5
1 1
0.5 0.5
0 0
0 1 2 3 4 5 0 1 2 3 4 5
Figure 9.4 The measurement y corresponding to the initial states in Figure 9.3.
79
We shall examine a class of feedback controllers constructed in two stages:
1. building an observer : a dynamic system that is driven by the inputs and the outputs of the
plant, and produces an estimate of its state variables;
2. using the estimated state instead of the actual state in a state feedback scheme.
The resulting controller is termed an observer-based controller or a model-based controller. A
diagram of the structure of such a controller is given in Figure 1.4.
A full-order state observer estimates all of the system state variables. If, however, some of the
state variables are measured, it may only be necessary to estimate a few of them. This is
referred to as a reduced-order state observer.
An observer comprises a real-time simulation of the system or plant, driven by the same input as
the plant, and by a correction term derived from the difference between the actual output of the
plant and the predicted output derived from the observer.
The term 'model-based" for controllers based on an observer refers to the fact that the observer
uses a model of the plant as its core.
All observers use some form of mathematical model to produce an estimate x̂ of the actual state
vector x. Figure 1.4 shows a simple arrangement of a full-order state observer.
If the system is observable it is possible to estimate the state vector by studying the
input u and the output y. We shall deduce the state observer in two steps. As a first step
we shall see what happens if we try to estimate x by simply simulating the process.
x̂˙ = Ax̂ + Bu
x̃ = x − x̂
x̃˙ = ẋ − x̂˙ = Ax + Bu − A x̂ − Bu = A x̃
Whether the estimation error approaches zero depends on the matrix A. If A has all
its eigenvalues in the left half plane, i.e. if the process is asymptotically stable, the
estimation error will converge to zero. The convergence rate depends on where in
the left half plane the eigenvalues lie. Estimating the state vector by simulating the
process might thus work in some cases. For the estimation we use the control signal
u, while we ignore the information available through the measurement y. State
estimation by derivation of y has a corresponding shortcoming.
80
45
In Figure 8.8, since the observer dynamics will never exactly equal the system dynamics,
this open-loop arrangement means that x and x̂ will gradually diverge. If however, an output
vector ŷ is estimated and subtracted from the actual output vector y, the difference can be used,
in a closed-loop sense, to modify the dynamics of the observer so that the output error (y − ŷ)
is minimized. This arrangement, some- times called a Luenberger observer (1964), is shown in
Figure 8.9.
State observer
The state observer estimates the state vector in the following way:
Compared to the simple simulation method, we have now introduced a correction term. Here
the difference between the real measurement signal y and the estimated measurement signal ŷ
affects the estimation.
46
By merging the two equations in Equation (9.3) the state observer can be written in the form
ẋ = (A − KeC)x̂ + Bu + Ke y(9.4)
From this form it is obvious how the state observer is driven by the two signals u and y.
The estimation error x̃ decreases according to
In this example we shall balance an inverted pendulum. We leave the control part to the next
lecture and put our focus on process state estimation. The pendulum to
be controlled is shown in Figure 9.5.
We assume that we can measure the angle ϕ which consequently becomes our measurement
signal, i.e. y = ϕ. The control objective is to balance the pendulum so that y = ϕ = 0. The setpoint
will thus be r = 0. The control signal u is proportional to the force affecting the cart. For simplicity
we assume that u = z̈.
There are two forces affecting the pendulum. The gravitational force strives to increase the
angle ϕ and thus causing the pendulum to fall down. The control signal can give the pendulum an
acceleration in the opposite direction and thus re-erect the pendulum.
A momentum equation with suitable choice of states, linearization and parameters yields the
following process model of the pendulum:
ϕ̈ = ϕ − u
A second-order system requires at least two states for its state-space representation. We choose
the angle ϕ and its derivative ϕ̇ to represent these states.
x1 = ϕ
x2 = ϕ̇
This yields the following state-space description of the process:
! !
0 1 0
ẋ = x+ u = Ax + Bu
1 0 −1
y= 1 0 x = Cx
A state observer estimating the state vector is given by Equation (9.4) and our task is to
determine the vector L so that the matrix A − LC obtains the desired eigenvalues. We have
! ! !
0 1 ke1 −ke1 1
A − KeC = − 1 0 =
1 0 ke2 1 − ke2 0
The eigenvalues are given by the characteristic polynomial
s + ke1 −1
det(sI − (A − KeC)) = = s2 + ke1 s − 1 + ke2
−1 + ke2 s
We can now place the two poles arbitrarily by choosing ke1 and ke2 adequately. E.g. assume
that we desire to place the poles in s = −4 ± 4i. This yields the desired characteristic polynomial
(s + 4 − 4i)(s + 4 + 4i) = s2 + 8s + 32
48
By comparing the two polynomials, we arrive at the following state observer parameters:
ke1 = 8 ke2 = 33
Figure 9.6 shows the result of a simulation experiment with the state observer The initial state
is given by ϕ(0) = −0.6 and ϕ̇(0) = 0.4 Since the process is unstable, it has to be controlled. This
control is treated in the next lecture.
The solid curves in Figure 9.6 show the actual states. The angle is initially ϕ(0) = −0.6. After
an initial overshoot to ϕ ≈ 0.4 it stabilizes at ϕ = 0 after approximately 3 s.
The dashed curves show the estimates and are thus the ones of highest interest for us. They
both start out in zero. After approximately 1.5 s they have converged well to the actual states.
The example shows that the state observer can be used to estimate the state vector. One thus
realizes that it should be possible to use the estimated state for the
Fig. 3.4 Figure 9.6 Actual and estimated angle and angular speed of the pendulum in Example 9.2.
feedback, rather than the actual ones. It is, however, important that the Kalman filter is
sufficiently fast, since the transient behavior shown in Figure 9.6 will be repeated every time the
49
process is disturbed, which would happen e.g. if someone pokes at the pendulum. The relationship
between the Kalman filter and the state feedback will be further investigated in the next lecture.
Finally it is worthwhile noting that the Kalman filter is not merely interesting in the context
of state feedback control. The method to estimate variables which are not directly measurable
by exploiting the process dynamics and the availability of certain measurement signals is used in
a large number of other applications. Examples include technical systems as well as biological,
medical and economical ones.
Fig. 3.5 Figure 10.1 Output feedback. The controller is confined within the dashed rectangle. term.
ẋ = Ax + Bu
y = Cx
The controller now becomes a combination of the Kalman filter and the state feedback
!
x
xe =
x̃
The state-space equations can now be written
! ! ! ! !
ẋ A − BK BK x Bkr x
= + r = Ae + Be r
x̃˙ 0 A − LC x̃ 0 x̃
! !
x x
y= C 0 = Ce (10.1)
x̃ x̃
Thanks to the introduction of x and x̃ as system states, the Ae , Be and Ce matrices now contain
a number of zeros. We will benefit from this substantially now that we will investigate the
closed-loop system.
Due to the block triangularity of Ae , its characteristic polynomial is given by
This is an appealing result. It shows that the characteristic polynomial is a product of the
characteristic polynomial from the nominal state feedback and that of the Kalman filter. Conse-
quently it is possible to separate the control problem into two parts, as we have already attempted
in the previous lectures. The state feedback can first be determined and its poles placed as if all
states were actually measurable. When later a Kalman filter is introduced in order to obtain state
estimates and realize output feedback, this will not affect the pole placement of the feedback.
Let us compute the transfer function from r to y. It is given by
!
E
Ge (s) = Ce (sI − Ae )−1 Be = C 0
F
where
! !−1 !
E sI − (A − BK) −BK Bkr
=
F 0 sI − (A − KeC) 0
By multiplying both sides with (sI − Ae ) we get
51
! ! !
Bkr sI − (A − BK) −BK E
=
0 0 sI − (A − KeC) F
!
(sI − (A − BK))E − BKF
=
(sI − (A − KeC))F
The latter part of the equation yields F = 0. Consequently, we arrive at
This is a remarkable result. The transfer function is identical to the one which we obtained
when we closed the loop from the real states. The dynamics of the Kalman filter are hidden in
the transfer function. The characteristic polynomial of the Ae matrix is of order 2n, whereas the
transfer function is merely of order n.
In the pendulum example from the previous lecture we saw how the estimated state converged
to the actual state after a few seconds long transient. Following this transient there is inherently no
difference between feedback from the estimated and actual states, as long as no disturbances forces
the state estimate away from the actual state. This explains why the dynamics of the Kalman filter
are not visible in the transfer function.
A transfer function of order n can always be described in state space using n states, which
are all both controllable and observable. One could also introduce more than n states, but the
additional states cannot be both observable and controllable. It is e.g. possible to introduce a state
which has no significant relation to the process. This state will obviously be neither controllable
nor observable.
Correspondingly a transfer function of degree n obtained from a state space model of degree
> n shows us that there are states which lack controllability or observability. In our case the
Kalman filter state is not controllable. This can be seen by constructing the controllability matrix
of the system in Equation (10.1).
!
Bkr (A − BK)Bkr · · ·
Ws = Be Ae Be · · · An−1
e Be =
0 0 ···
Since the last n elements in the columns are zero, there are n linearly independent columns and
the non-controllable states correspond to those of the Kalman filter. The fact that the states of the
Kalman filter are not controllable can be seen directly from the state space Equation (10.1).
x̃˙ = (A − KeC)x̃
We can apparently not affect the estimates by means of the closed-loop system input, i.e. by
the setpoint r.
52
Summary
We have now introduced a method to determine a controller-state feedback combined with Kalman
filtering. The analysis has shown that the design process can be separated into two parts.
The first part was to estimate the state vector by means of the Kalman filter. The properties
of the Kalman filter are determined by the gain vector L. The choice of this vector, i.e. the pole
placement of the Kalman filter, is as always a balance between performance and robustness against
model errors, process variations and disturbances.
Let the system in Figure 1.4 be defined by
ẋ = Ax + Bu (8.125)
y = Cx (8.126)
ė = (A − Ke C) e (8.128)
and, from equation (8.127), the equation for the full-order state observer is
x̂˙ = (A − Ke C) x̂ + Bu + Ke y (8.129)
Thus from equation (8.128) the dynamic behaviour of the error vector depends upon the
eigenvalues of (A − Kc C). As with any measurement system, these eigenvalues
should allow the observer transient response to be more rapid than the system itself (typically
a factor of 5), unless a filtering effect is required.
The problem of observer design is essentially the same as the regulator pole placement problem,
and similar techniques may be used.
(a) Direct comparison method: If the desired locations of the closed-loop poles (eigenvalues)
of the observer are
s = µ1 , s = µ2 , . . . , s = µn
then
|sI − A + Ke C| = (s − µ1 ) (s − µ2 ) . . . (s − µn )
= sn + αn−1 sn−1 + · · · + α1 s + α0 (8.130)
53
Ackermann’s formula: As with regulator design, this is only applicable to systems where u(t)
and y(t) are scalar quantities. It may be used to calculate the observer gain matrix as follows
h iT
Ke = φ (A)N−1 0 0 ... 0 1
or alternatively
−1
C 0
CA 0
Ke = φ (A)
..
..
(8.134)
. .
CAn−1 1
where φ (A) is defined in equation (8.104).
Example:
A system is described by
" # " #" # " #
ẋ1 0 1 x1 0
= + u
ẋ2 −2 −3 x2 1
" #
h i x
1
y= 1 0
x2
Design a full-order observer that has an undamped natural frequency of 10 rad/sand a damping
ratio of 0.5 .
Solution:
The obsevability matrix is
" #
1 0
N = CT : AT CT = (8.135)
0 1
N is of rank 2 and therefore non-singular, hence the system is completely observable and the
calculation of an appropriate observer gain matrix Ke realizable.
Open-loop eigenvalues:
|sI − A| = s2 + 3s + 2 = s2 + a1 s + a0 (8.136)
Hence
a0 = 2, a1 = 3
s2 + 3s + 2 = 0
(s + 1)(s + 2) = 0
s = −1, s = −2 (8.137)
s2 + 2ζ ωn s + ωn2 = 0
s2 + 10s + 100 = s2 + α1 s + α0 = 0 (8.138)
Hence
α0 = 100, α1 = 10
and the desired closed-loop eigenvalues are the roots of equation (8.138)
|I − A + Ke C| = s2 + α1 s + α0 (22)
" # " # " #
s 0 0 1 kel h i
− + 1 0 = s2 + 10s + 100
0 s −2 −3 ke2
" # " #
s −1 kel 0
+ = s2 + 10s + 100
2 s+3 ke2 0
s + kel −1
= s2 + 10s + 100
2 + ke2 s + 3
s2 + (3 + ke1 ) s + (3kel + 2 + ke2 ) = s2 + 10s + 100
• "His invention of dynamic programming in 1953 was a major breakthrough in the theory of
multistage decision processes..."
• "A breakthrough which set the stage for the application of functional equation techniques in
a wide spectrum of fields..."
• “...extending far beyond the problem-areas which provided the initial mo-tivation for his
ideas."
- Example: travel from A to B with least cost (robot navigation or aircraft path)
2. Discrete-Time Systems
The plant is described by| the general nonlinear discrete-time dynamical equation
xk+1 = f (k, xk , uk ) , k = i, . . . , N − 1
with initial condition xi given. The vector xk has n components and the vector uk has m components.
Suppose we associate with this plant the performance index
N−1
Ji (xi ) = φ (N, xN ) + ∑ L (k, xk , uk )
k=i
where [i, N] is the time interval of interest. We want to use Bellman’s principle of optimality to
find the sequence uk that minimizes the performance index.
Suppose we have computed the optimal cost
∗
Jk+1 (xk+1 )
for time k + 1 to the terminal time N for all possible states xk+1 , and that we have also found
the optimal control sequences from time k + 1 to N for all possible states xk+1 . The optimal cost
results when the optimal control sequences u∗ k+1 , u∗ k+2 , . . . , u∗ N−1 is applied to the plant with a
state of xk+1 . Note that the optimal control sequence depends on xk+1 . If we apply any arbitrary
control uk at time k and then use the known optimal control sequence from k + 1 on, the resulting
cost will be
∗
Jk (xk ) = L (k, xk , uk ) + Jk+1 (xk+1 )
where xk is the state at time k, and xk+1 is given by the state equation. According to Bellman, the
optimal cost from time k is equal to
Jk∗ (xk ) = min L (k, xk , uk ) + Jk+1
∗
(xk+1 )
uk
and the optimal control u∗k at time k is the uk that achieves this minimum.
3. Discrete LQR via Dynamic Programming
The plant is described by the linear discrete-time dynamical equation
xk+1 = Ak xk + Bk uk ,
4.1 Dynamic Programming 59
with initial condition xi given and final state xN free. We want to find the sequence uk on the
interval [i, N] that minimizes the performance index:
1 1 N−1
Ji = xNT SN xN + ∑ xkT Qk xk + uTk Rk uk , SN ≥ 0, Q ≥ 0, R > 0
2 2 k=i
1 T 1 1
JN−1 = xN−1 QN−1 xN−1 + uTN−1 RN−1 uN−1 + xNT SN xN
2 2 2
1 T 1 1
JN−1 = xN−1 QN−1 xN−1 + uTN−1 RN−1 uN−1 + (AN−1 xN−1 + BN−1 uN−1 )T SN (AN−1 xN−1 + BN−1 uN−1 )
2 2 2
∂ JN−1
0= = RN−1 uN−1 + BTN−1 SN (AN−1 xN−1 + BN−1 uN−1 )
∂ uN−1
which gives
−1
uN−1 = − BTN−1 SN BN−1 + RN−1 BTN−1 SN AN−1 xN−1
Defining
−1
KN−1 = BTN−1 SN BN−1 + RN−1 BTN−1 SN AN−1
we can rewrite
u∗N−1 = −KN−1 xN−1
The optimal cost to go from k = N −1 is found substituting the optimal control in the expression
for JN−1 ,
∗ 1 T h T T
i
JN−1 = xN−1 (AN−1 − BN−1 KN−1 ) SN (AN−1 − BN−1 KN−1 ) + KN−1 RN−1 KN−1 + QN−1 xN−1
2
if we define
For k = N
1
JN = xNT SN xN
2
For k = N − 1
1 T 1 1
JN−1 = xN−1 QN−1 xN−1 + uTN−1 RN−1 uN−1 + xNT SN xN
2 2 2
For k = N − 2
1 T 1 1 T
JN−2 = xN−2 QN−2 xN−2 + uTN−2 RN−2 uN−2 + xN−1 SN−1 xN−1
2 2 2
The structure of the problem is the same. To obtain u∗N−2 We just need to replace N − 1 by
N − 2. If we continued to decrement k and apply the optimality principle, the result for each
k = N − 1, . . . , 1, 0 is
−1
uk = −Kk xk , Kk = BTk Sk+1 Bk + Rk BTk Sk+1 Ak
Sk = (Ak − Bk Kk )T Sk+1 (Ak − Bk Kk ) + KkT Rk Kk + Qk
1
Jk∗ = xkT Sk xk
2
Kalman Gain Sequence Joseph Stabilized Ricatti Difference Equation (RDE) Optimal Cost
5
Algorithm:
Example:
∗
J0 = F (x(k), u(k)) + Jk+1 (x(k + 1))
1=N −1
1 X
= (x(2) − 20)2 + (2x2 (k) + 4u2 (k))
2 k=0
Using principle of optimality, find control sequence u(0) and u(1), Assume no constraints on
u(k)
6
Solution:
7