'
&
$
%
Chapter 7
Compensator Design
Compensator Structure
Compensator = Control Law + Estimator
−K˙x = Ax+ B2u
+L(y − C2x)
x = Ax+B2u
+B1wy = C2x+ v
x
w v
u
Control law Estimator
y
Process
Compensator
x
ESAT–SCD–SISTA CACSD pag. 190
'
&
$
%
Standard Plant Formulation
In control theory the following general system description,
called standard plant, is often used
+ + +
}
uk
vk
yk
wk
zk
B1
B2
C1
C2
D1
D2
z−1
A
xk+1 = Axk +B1wk +B2uk
yk = C2xk +D2uk + vk
zk =
[
C1xk
D1uk
]
where xk is the state vector, zk is the regulated output
vector, yk is the measurement vector, uk is the control in-
put, wk and vk are process noise and measurement noise
respectively.
ESAT–SCD–SISTA CACSD pag. 191
'
&
$
%
Clearly there are 2 types of inputs :
• the actuator or control input uk : inputs manipulated
by the compensator
• the exogeneous input wk : all other input signals
and 2 types of outputs :
• measured output yk : inputs to the compensator
• regulated output zk : all outputs that are of interest for
control. These outputs may be virtual and not mea-
sured. They typically define the state feedback cost
function
JN =N∑
k=0
zTk zk =N∑
k=0
(xTkCT1 C1xk + uTkD
T1D1uk)
so, using the LQR formalism, by definition of zk,
Q = CT1 C1 and R = DT
1D1.
ESAT–SCD–SISTA CACSD pag. 192
'
&
$
%
State-space Description
Plant :
xk+1 = Axk +B2uk + B1wk,
zk =
[
C1xk
D1uk
]
,
yk = C2xk +D2uk + vk.
Estimator :
xk+1 = Axk + L(yk − C2xk −D2uk) + B2uk.
Control law :
uk = −Kxk.
Compensator :
xk+1 = (A−B2K − LC2 + LD2K)xk + Lyk,
uk = −Kxk.
ESAT–SCD–SISTA CACSD pag. 193
'
&
$
%
Closed-Loop System
A state-space model for plant + compensator is
[
xk+1
xk+1
]
=
[
A −B2K
LC2 A− B2K − LC2
][
xk
xk
]
+
[
B1 0
0 L
][
wk
vk
]
,
yk =[
C2 −D2K][
xk
xk
]
+[
0 I][
wk
vk
]
.
Using the error system (estimator) dynamics
xk+1 = (A− LC2)xk +B1wk − Lvk,
we obtain
[
xk+1
xk+1
]
=
[
A−B2K B2K
0 A− LC2
][
xk
xk
]
+
[
B1 0
B1 −L
][
wk
vk
]
,
yk =[
C2 −D2K D2K][
xk
xk
]
+[
0 I][
wk
vk
]
.
ESAT–SCD–SISTA CACSD pag. 194
'
&
$
%
Separation Principle:Pole Placement
The characteristic equation of the closed-loop system
det
[
sI − A +B2K −B2K
0 sI − A + LC2
]
= 0
The poles of the closed-loop system can be obtained from
det(sI − A + BK) det(sI − A + LC) = αc(s)αe(s) = 0
⇒ Separation Principle (for Pole Placement):
The set of poles of the
closed-loop system consists
of the union of the control
poles and estimator poles.
ESAT–SCD–SISTA CACSD pag. 195
'
&
$
%
Design procedure :
• Choose the desired poles for the state feedback control
loop. Determine the control law K via pole placement.
• Choose the desired poles for the estimator. Determine
the estimator feedback gain L via pole placement.
• Combine the estimator and the control law to get the
final compensator.
ESAT–SCD–SISTA CACSD pag. 196
'
&
$
%
Linear Quadratic Gaussian Control
Measurement feedback controlLet w and v be Gaussian zero mean white noises.
Our aim is to find an output feedback controller u = Ky
such that
limT→∞
{1
T
∫ T
0
zTzdt
}
or limK→∞
{
1
K
K∑
k=0
zTk zk
}
is minimized.
This problem is called the Linear Quadratic Gaussian
(LQG) control problem.
The difference between LQG and LQR is that LQR uses
state feedback and hence K is just a constant matrix while
LQG uses measurement or output feedback and hence K
is a dynamic system.
ESAT–SCD–SISTA CACSD pag. 197
'
&
$
%
Stochastic Separation Principle
It can be proven that the solution
to the LQG optimal control prob-
lem consists in using the optimal
state estimator (Kalman filter) to-
gether with the same feedback as
would have been applied had the
states been measured (LQR). This
principle relies on the assumption
of linearity, the Gaussian charac-
ter of the noise and the use of a
quadratic optimization criterion.
ESAT–SCD–SISTA CACSD pag. 198
'
&
$
%
Design procedure (summary) :
• LQR design: find an optimal state feedback control law
uk = −Kxk for the system
xk+1 = Axk +B1wk +B2uk,
zk =
[
C1xk
D1uk
]
.
where K = (DT1D1 + BT
2 SB2)−1BT
2 SA, in which S is
a solution for the Riccati equation :
S = AT[S − SB2(D
T1D1 +BT
2 SB2)−1BT
2 S]A+CT
1 C1.
• Kalman filter design : find an optimal estimator
xk+1 = Axk + L(yk − C2xk −D2uk) +B2uk
for the system
xk+1 = Axk +B1wk +B2uk,
yk = C2xk +D2uk + vk,
where L = APCT2 (R + C2PC
T2 )−1, in which P is a
solution for the Riccati equation :
P = B1QBT1 +APAT−APCT
2 (R+C2PCT2 )−1C2PA
T .
with R = cov(v) and Q = cov(w).
ESAT–SCD–SISTA CACSD pag. 199
'
&
$
%
• Combination of the LQR control law and the Kalman
filter : the final controller K is given as follows :
xk+1 = (A−B2K − LC2 + LD2K)xk + Lyk,
uk = −Kxk.
Design strategy for LQG :
Trade-off between speed of time responses and
attenuation of noises by choosing the covariance
matrices of w and v.
Similarly,
Trade-off between the energy of the states and energy
of the control effort by choosing the weighting matrices
CT1 C1 and DT
1D1.
ESAT–SCD–SISTA CACSD pag. 200
'
&
$
%
Compensator Dynamics
Compensator :
xk+1 = (A−B2K − LC2 + LD2K)xk + Lyk,
uk = −Kxk.
Characteristic equation of the compensator :
det(zI − A +B2K + LC2 − LD2K) = 0
⇒The poles of the compensator are not necessary in the unit
circle, the compensator might be unstable.
Transfer function of the compensator :
K(z) = −K(zI − A +B2K + LC2 − LD2K)−1L.
ESAT–SCD–SISTA CACSD pag. 201
'
&
$
%
Summary of State Space Control
Design
LQG
compensator design
system modeling
LQR Kalman filter pole placementpole placement
pole placement
control law design estimator design
ESAT–SCD–SISTA CACSD pag. 202
'
&
$
%
Examples of Compensator Design
Example Boeing 747 Aircraft control - Compensator de-
sign
The complete model of the aircraft is
x = Ax +Bu +Bw,
z =
[
q1/2Cx
u
]
,
y = Cx + v.
where q is the weighting factor and w and v are zero
mean white noises with covariance Rw and Rv respectively.
(A,B,C,D) is the nominal aircraft model (D = 0).
ESAT–SCD–SISTA CACSD pag. 203
'
&
$
%
First, we design a compensator via pole placement. From
results of pole placement design examples in chapter 3 and
chapter 5, we know that the state feedback gain
K =[
1.06 −0.19 −2.32 0.10 0.04 0.49]
places the poles of the control loop at
−0.0051, −0.468, −1.106, −9.89, −0.279± 0.628i
and the estimator gain
L =
2.5047e + 01
−2.0517e + 03
−5.1935e + 03
−2.4851e + 04
−4.0914e + 04
−1.5728e + 04
places the estimator poles at
−0.0255, −2.34 ,−5.53, −49.45, −1.395± 3.14i.
The compensator then is
˙x = (A−BK − LC)x + Ly,
u = −Kx.
ESAT–SCD–SISTA CACSD pag. 204
'
&
$
%
The poles of the compensator are then at
−51.35, −4.074± 10.12i, −0.8372± 0.6711i, −0.027.
So the compensator itself is stable, which is preferred since
otherwise an accident resulting in a breakdown of the
control loop will cause the control output to go to infinity.
The transfer function of the compensator K(s) is
K(s) = −K(sI − A +BK + LC)−1L
= 102 −8.42s5 − 92.3s4 − 72.1s3 + 74.9s2 + 113s + 2.55
s6 + 61.2s5 + 640s4 + 7086s3 + 11029s2 + 7316s+ 194.
ESAT–SCD–SISTA CACSD pag. 205
'
&
$
%
The initial condition response with β0 = 1◦ :
0 5 10 15 20 25 30 35 40 45 50−4
−2
0
2
4
6
8
10
12x 10
−3
Time (secs)
r(ra
d/s
ec)
The response is almost the same as with state feedback
control but with a slightly larger peak value and with the
slowly decaying error (see the plot on page 97) filtered out
here.
ESAT–SCD–SISTA CACSD pag. 206
'
&
$
%
Now consider LQG design. Let q = 9.527, Rw = 0.7 and
Rv = 1. From the results of LQR and Kalman filter design
examples in chapter 4 and 6, we obtained a state feedback
gain K
K =[
1.06 −0.19 −2.32 0.10 0.04 0.49]
and an estimator gain
L =
−1.5465e− 02
4.9686e− 02
2.2539e− 01
−7.3199e− 01
−3.0200e− 01
−8.2157e− 15
.
The poles of the compensator with the K and L above are
at:
−9.845, −1.405, −0.2616± 0.5571i, −0.4756, −0.0049.
Again the compensator is stable.
ESAT–SCD–SISTA CACSD pag. 207
'
&
$
%
The initial condition response with β0 = 1◦ :
0 5 10 15 20 25 30 35 40 45 50−8
−6
−4
−2
0
2
4
6
8
10
12x 10
−3
Time (secs)
r(ra
d/s
ec)
This initial condition response shows that the Kalman filter
is too slow compared with the state feedback control loop.
ESAT–SCD–SISTA CACSD pag. 208
'
&
$
%
The reason for this result is that the measurement noise v
is large compared with the process noise w, so that the
Kalman filter has to reduce the measurement noise in-
fluence using a small estimator L, which slows down the
Kalman filter. Now increase the process noise covariance
to Rw = 700. The Kalman filter gain is now
L =
−8.0289e + 00
−3.3434e− 01
8.2913e + 00
−4.8082e + 00
−3.4682e + 00
3.5982e− 11
The poles of the compensator are at
−9.845, −1.405, −0.2616± 0.5571i, −0.4756, −0.0049.
ESAT–SCD–SISTA CACSD pag. 209
'
&
$
%
It’s not clear whether or not the Kalman filter is speeding
up from these poles location. But the following initial
condition response shows that the result is much better.
The initial condition response with β0 = 1◦ :
0 5 10 15 20 25 30 35 40 45 50−3
−2
−1
0
1
2
3
4
5
6
7x 10
−3
Time (secs)
r(ra
d/s
ec)
This response is even better than the one from pole place-
ment and with a better noise attenuation.
ESAT–SCD–SISTA CACSD pag. 210
'
&
$
%
Example Tape drive control - LQG design
The complete model of the tape drive is
x = Ax +Bu +Bw,
z =
[
Q1/2Cx
u
]
,
y = Cx + v.
where Q is a weighting matrix, w and v are zero mean
white noises with covariance Rw and Rv respectively.
Pole placement design:
From the results of the pole placement design examples for
control law and estimator design in chapter 3 and 5, we
know that the state feedback gain K
K =
[
0.55 1.58 0.32 0.56 0.67 0.05
0.60 0.60 0.68 3.24 −0.21 1.74
]
places the poles of the control loop at
−0.451± 0.937i, −0.947± 0.581i, −1.16, −1.16
ESAT–SCD–SISTA CACSD pag. 211
'
&
$
%
and the estimator gain
L =
5.3833e + 01 −4.2084e + 01
2.0377e + 02 −1.5615e + 02
3.9038e + 01 −7.9226e + 00
4.0009e + 02 −3.0809e + 02
6.5103e + 02 −5.8228e + 02
1.7691e + 03 −1.5000e + 03
places the estimator poles at
−2.255± 4.685i, −4.735± 2.905i, −5.800, −5.800.
The compensator then is
˙x = (A−BK − LC)x + Ly,
u = −Kx.
ESAT–SCD–SISTA CACSD pag. 212
'
&
$
%
The compensator has poles at
−1.696± 8.531, −12.09, −5.847, −3.335± 0.2469i.
The initial condition response with x1(0) = x3(0) = 1 looks
like
0 1 2 3 4 5 6 7 8 9 10−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Time (secs)
Am
plitu
de
p3
T
ESAT–SCD–SISTA CACSD pag. 213
'
&
$
%
Now consider LQG design.
Let
Q = 2I2, Rw = 0.001I4, Rv =
[
4 0
0 0.0001
]
.
From the results of the LQR and Kalman filter design ex-
amples in chapter 4 and 6, we obtain the optimal state
feedback gain K
K =
[
0.55 1.78 0.45 1.14 0.86 0.46
0.45 1.14 0.55 1.78 0.46 0.86
]
and the optimal estimator gain
L =
5.56e− 02 −1.67e + 00
7.74e− 04 −5.71e− 01
5.56e− 02 1.67e + 00
7.74e− 04 5.71e− 01
4.32e− 05 −6.02e− 01
4.32e− 05 6.02e− 01
.
ESAT–SCD–SISTA CACSD pag. 214
'
&
$
%
The poles of the compensator with the K and L above are
at
−0.7204± 1.093i, −0.6294± 0.90502i, −1.308, −1.365.
These poles are obviously slower than those for pole
placement estimator design. As a consequence, the time
response is slower.
The initial condition response with x1(0) = x3(0) = 1 :
0 10 20 30 40 50 60 70 80 90 100−0.2
0
0.2
0.4
0.6
0.8
1
Time (secs)
Am
plitu
de
p3
T
ESAT–SCD–SISTA CACSD pag. 215
'
&
$
%
Matlab Functions
initial
kalman
lqg
lqgreg
lqr
reg
ESAT–SCD–SISTA CACSD pag. 216