Professional Documents
Culture Documents
Bart De Moor
Koen Eneman
YI Cheng
ESAT–SCD–SISTA, K.U.Leuven
Kasteelpark Arenberg 10, 3001 Leuven, Belgium
Tel: 32-(0)16-32 17 09 Fax: 32-(0)16-32 19 70
& %
&
– Basics of MPC. %
• M. Green and D.J.N. Limebeer, Linear Robust Control, Prentice Hall, 1995.
• K. Zhou, J.C. Doyle and K. Glover, Robust and Optimal Control, Prentice
Hall, 1995
• Automatica
• Journal A
• ...
& %
• ...
& %
• ...
& %
& %
& %
Applications
Literally: everywhere, all sectors, all industries, economy,
process industry, mechatronic design, . . . .
& %
Introduction
& %
Data acquisition
-sensors
-sampling rates
-filter selection
-data storage
Modeling
a priori -physical
information
-black box
-system identification
constraints
-parameter estimation
-model validation
Controller implementation
constraints
(hardware)
“closing the loop”
yes no
OK! spec’s met?
& %
-20
0 100 200 300 400 500 600 700 800
Furnace Mandrel
Melted Glass
Output 1
0.1
Diameter
0.05
-0.05
-0.1
0 100 200 300 400 500 600 700 800
Output 2
0.04
Thickness
0.02
Glass Tube 0
-0.02
0 100 200 300 400 500 600 700 800
Input 1
0.04
Drawing Speed
0.02
-0.02
-0.04
0 100 200 300 400 500 600 700 800
& %
disturbances
inputs outputs
Plant
a priori
information
identification
algorithms
simulated
Mathematical Model predicted
disturbance model outputs
disturbance model
& %
& %
& %
Setpoint
Diameter
Filt 1 PIID 1 Static Diameter
- Plant
Filt 2 PIID 2 Decoupling Thickness
Setpoint
-
Thickness
two feedforward filters
a static feedforward controller
Controller =
a static decoupling controller
two PIID controllers
& %
LQG
Controller design
Hardware constraints
PIID/Static decoupling
Multi-objective optimization
Hardware
implementation
& %
300
200
200
100
100
0 0
-0.2 -0.1 0 0.1 0.2 -0.02 -0.01 0 0.01 0.02
300
200
200
100
100
0 0
-0.2 -0.1 0 0.1 0.2 -0.02 -0.01 0 0.01 0.02
& %
Velocity vector β
x,u
α θ,q y,v
φ,p
Rudder δr
input
Elevator δe
ψ,r output
Aileron
z,w
& %
Modeling:
A lateral perturbation model in horizontal flight for a nom-
inal forward speed of 774 ft/s at 40.000 ft can be de-
rived based on physical laws. A 4th order, linear, single-
input/single-output system was obtained :
ẋ = Ax + Bu,
y = Cx + Du,
where
−0.0558 −0.9968 0.0802 0.0415
0.5980 −0.1150 −0.0318 0
A=
,
−3.0500 0.3880 −0.4650 0
0 0.0805 1.0000 0
0.0073
−0.4750 h i
0.1530 , C = 0 1 0 0 , D = 0,
B=
0
h iT
and x = β r p φ , u = δr , y = r.
& %
rc e Rudder δr r
Aircraft
servo
−
Im
stable unstable
Re
30 0
& %
0.01
No feedback
0.005
−0.005
& %
Rfsc
secondary pulley set
Cksc sc
Im psc Nwheel
f1sc sc
vm Ccsc Output
secondary
cylinder belt
cl
Nengine
p Gsc qrsc
r
Gsv
r3
sv
qr3
secondary Cksv sv
Im Gsv
r1 primary pulley set
channel
valve sv
sv
Cc1
vm sv q1sv
Cc2
psv Ccch
Gsv 1 Input
sv
Rfsv r2 qr2
Nengine sv
q
oil pump
Ck = spring constant
Im = inertia
R = friction resistor
Gr = hydraulic impedance
p = pressure
q = oil flow
vm = velocity of a mass
f = force
& %
Modeling:
A 6th order single-input/single-output nonlinear system
was obtained by physical (hydraulic and mechanical) mod-
eling.
Controller design:
The control problem is basically a tracking problem:
e psv
1 psc
psc
ref K P
−
Step responses
45
40
35
Pressure (bar)
30
20
no feedback control
15
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time:sec.
& %
uncertainty
Cf f process ∆
noise w time delay dist. d
ref. e e u
Cpre Ccon1 -Ts G
e
-
Plant
sensor
Ccon2 S
y
sensor noise
v
& %
& %
This course:
Linear
Lumped parameters discrete time
systems in
Time-invariant continuous time
Causal
& %
Example:
F = kx
k
m
F = mg (Newton)
d2 x
m 2 = mg − kx.
dt
• Empirical modeling or identification consists of devel-
oping models from observed or collected data.
Experiments:
− System identification, e.g.: glass oven
− Parameter estimation
& %
General format :
(valid for any nonlinear causal system)
ẋ = Ax + Bu
y = Cx + Du
ẋ R x
u B C y
Discrete-time system:
yk = Cxk + Duk
xk+1 xk
uk B z −1
C yk
A: n × n system matrix
B: n × m input matrix
C: p × n output matrix
&
D: p × m direct transmission matrix %
p1 p3 p2
D D
β r r β
J K K J
θ1 θ2
i1 i2
+ +
Kt e1 Kt e2
− −
dω1
capstan 1: J = T r − βω1 + Kti1,
dt
speed of x1: ṗ1 = rω1,
di1
motor 1: L = −Ri1 − Keω1 + e1,
dt
dω2
capstan 2: J = −T r − βω + Kti2,
dt
speed of x1: ṗ2 = rω2,
di2
motor 2: L = −Ri2 − Keω2 + e2,
dt
K D
Tension of tape: T = (p2 − p1) + (ṗ2 − ṗ1),
2 2
p1 + p2
Position of the head: p3 = .
2
& %
ẋ = Ax + Bu,
y = Cx + Du,
where
p 0 2 0 0 0 0
1
ω1 −0.1 −0.35 0.1 0.1 0.75 0
p 0 0 0 2 0 0
2
x = , A=
ω2
0.1
0.1 −0.1 −0.35 0 0.75
i
1
0 −0.03 0 0 −1 0
i2 0 0 0 −0.03 0 −1
00
0 0
" #
0 0 0.5 0 0.5 0 0 0
B= , C = ,
0
0 −0.2 −0.2 0.2 0.2 0 0
1 0
01
" # " # " #
0 0 p3 e1
D= , y= , u= .
0 0 T e2
& %
Continuous-time system:
( Laplace
state-space ẋ = Ax + Bu x(0)=0 Y (s)
−→ G(s) = = D + C(sI − A)−1B
equations y = Cx + Du U (s)
| {z }
transfer matrix
in practice : D = 0
⇓
∞
Laplace X
G(t) = Ce B At
←→ G(s) = CAi−1Bs−i
| {z }
i=1
impulse response matrix | {z }
transfer matrix
Discrete-time system:
( z − transf
state-space xk+1 = Axk + Buk x0 =0 Y (z)
←→ G(z) = = D + C(zI − A)−1B
equations yk = Cxk + Duk U (z)
| {z }
transfer matrix
( ⇓
∞
D : k = 0 z − transf X
G(k) = k−1
←→ G(z) = CAi−1Bz −i + D
CA B : k ≥ 1 i=1
| {z } | {z }
impulse response matrix transfer matrix
and obtain
dx d∆x
= = f (x, u) = f (xe + ∆x, ue + ∆u)
dt dt
and
& %
so,
" # " #
− cX
V
2
− cX
V
1
0 h i
A= cX2 cX1 ,B = 1
,C = 1 0 ,D = 0
−V −V V
& %
50
0
Phase (deg); Magnitude (dB)
−50
−250
−300
−350
−400
−3 −2 −1 0
10 10 10 10
& %
Frequency (rad/sec)
0.102
0.1
0.098
0.096
0 100 200 300 400 500 600 700 800 900 1000
time (s)
y(t)
0.2505
0.25
0.2495
0.249
0 100 200 300 400 500 600 700 800 900 1000
time (s)
& %
& %
0.245
mole/l
0.24
0.235
0 100 200 300 400 500 600 700 800 900 1000
y(t) : detail 1
0.2364
0.2362
mole/l
0.236
0.2358
0.2356
900 905 910 915 920 925 930 935 940 945 950
y(t) : detail 2
0.23574
0.23573
mole/l
0.23572
900 905 910 915 920 925 930 935 940 945 950
& %
time(s)
D/A A/D
clock
digital
controller
computer
• analog-to-digital converter :
clock
−1
−2
−3
−4
0 10 20 30 40 50 60 70 80 90 100
time
∗ introduces a delay
∗ frequency spectrum deformation
– first-order hold
– n-th order polynomial (more general case) : fit a n-
th order polynomial through the n+1 most recent
samples and extrapolate to the next time instance
& %
ẋ(t) = e(t)
⇔
sX(s) = E(s)
can be approximated using
• the forward rectangular rule or Euler’s method
xk+1 − xk
= ek with xk = x(kTs)
Ts e(t)
⇔
z−1
X(z) = E(z)
Ts
k-1 k k+1 t
• the backward rectangular rule
xk+1 − xk
= ek+1 e(t)
Ts
⇔
z−1
X(z) = E(z)
zTs k-1 k k+1 t
& %
xk+1 − xk ek+1 + ek
= e(t)
Ts 2
⇔
2 z−1
X(z) = E(z)
Ts z + 1 k-1 k k+1 t
Re Re Re
ẋ = Ax + Bu sX = AX + BU
⇔
y = Cx + Du Y = CX + DU
z−1
following Euler’s method s is replaced by Ts , so
z−1
X = AX + BU
Ts
or
zX = (I + ATs)X + BTsU
the output equation Y = CX + DU remains. A similar
calculation can be done for the backward rectangular rule
and the bilinear transformation resulting in the following
table :
Euler backward rect. bilinear transf.
Ad I + ATs (I − ATs )−1 (I − AT2 s )−1(I + AT2 s )
Bd BTs (I − ATs )−1BTs (I − AT2 s )−1BTs
Cd C C(I − ATs)−1 C(I − AT2 s )−1
Dd D D + C(I − ATs )−1BTs D + C(I − AT2 s )−1 BT2 s
& %
ẋ = Ax + Bu
⇒ Z t
x(t) = eAtx(0) + eA(t−τ )Bu(τ )dτ
|0 {z }
convolution integral
& %
0
frequency amplitude spectrum
−50
0
10
−100
__ : continuous system __ : continuous system
−1
10 −2 −1 −2 −1
10 10 10 10
frequency (Hz) frequency (Hz)
& %
fs ≥ 2BWcl
fs > 20BWcl
fs > 2fr
& %
& %
b1
b2
y
bn−1
x1 x2 xn−1 xn bn
u R R R R
−a1
−a2
−an−1
−an
& %
R x1
r1
−s1
R x2
r2
u y
−s2
R xn
rn
−sn
& %
x = T x̄, det(T ) 6= 0,
ẋ = Ax + Bu X −1 x = z ż = Λz + X −1Bu
=⇒
y = Cx + Du y = CXz + Du
& %
Controllability matrix:
h i
C = B AB · · · An−1B
Then
xk+1 = Ak+1x0 + Ak Bu0 + · · · + Buk
such that
uk
h i
uk−1
k+1 k
xk+1 − A x0 = B AB · · · A B .
.
u0
& %
for k ≥ n − 1 (Cayley-Hamilton
Theorem).
uk
uk−1
.. if rank(C) = n.
There exists always a vector
u0
Remarks: Controllability matrices for a continuous time
system and a discrete time system are of the same form.
& %
Observability matrix:
C
CA
O=
..
CAn−1
rank(O) = n ⇔ (A, C) observable
Explanation:
Consider an autonomous system
xk+1 = Axk
yk = Cxk
Then we find easily
yk = CAk x0
& %
& %
AT q = qλ
BT q = 0
In other words, (A, B) is controllable if and only if there is
no left eigenvector q of A that is orthogonal to B.
If there is a λ and q satisfying the PBH test, then we
say that the mode corresponding to eigenvalue λ is uncon-
trollable (uncontrollable mode), otherwise it is controllable
(controllable mode).
How to understand (for SISO) ? Put A in the modal canon-
ical form:
∗ ∗ 0
A = λi , B = 0 , ⇒ q = 1
∗ ∗ 0
Uncontrollable mode: ẋi = λixi.
& %
Ap = pλ
Cp = 0
If there is a λ and p satisfy the PBH test, then we say that
the mode corresponding to eigenvalue λ is unobservable
(unobservable mode), otherwise it is observable (observable
mode).
& %
Stability:
A system with system matrix A is unstable if A has an
eigenvalue λ with real(λ) ≥ 0 for a continuous time system
and |λ| ≥ 1 for a discrete time system.
Stabilizability:
(A, B) is stabilizable if all unstable modes are controllable.
Detectability:
(A, C) is detectable if all unstable modes are observable.
& %
& %
Kalman decomposition
Given a state space system [A, B, C, D]. Then we can
always find an invertible similarity transformation T such
that the transformed matrices have the structure
r1 r2 r3 r4
r1 Aco 0 A13 0
r2
A21 Aco A23 A24
T AT −1 =
r3
0 0 Aco 0
r4 0 0 A43 Aco
m
r1 Bco
r1 r2 r3 r4
r2 Bco
−1
TB = , CT = p Cco 0 Cco 0
r3 0
r4 0
where
r1 = rank (OC), r2 = rank (C) − r1,
r3 = rank (O) − r1, r4 = n − r1 − r2 − r3.
& %
[ Aco , 0, 0, D ]
& %
u y
CO
C Ō
C̄O
C̄ Ō
& %
T ⇓ ⇑ T −1
h i
A2 B2 C2 D
with
T = C1C2T (C2C2T )−1
& %
Poles
Characteristic polynomial of matrix A:
α(ξ) = det(ξI − A)
= αn ξ n + αn−1ξ n−1 + · · · + α1ξ + α0
Characteristic equation:
α(ξ) = 0
& %
s(b1c1 + b2c2) + β(b2c1 − b1c2) − α(b1c1 + b2c2)
= L−1
s2 − 2αs + α2 + β 2
= (Am cos(βt) + Bm sin(βt))eαt = Cmeαt cos(βt + γ)
α + jβ
β
θ ζ = sin θ
ωn
r
α
stability degree
α − jβ
& %
Ameαt cos(βt + γ)
)
Am: amplitude
determined by B and C.
γ: phase
& %
Gd(k) = CdAk−1
d Bd , k≥1
Cmbk−1 cos(ω(k − 1) + γ)
& %
β
⇒ ω = atan
α
−Bm
⇒ γ = atan
Am
& %
& %
(ζI − A)w − Bv = 0, Cw + Dv = 0
⇓
Aw + Bv = wζ, v = −D−1Cw
⇓
(A − BD−1C)w = wζ
ζ = eigenvalue of A − BD−1C,
w = corresponding eigenvector !
y(t) = 0.
Let
Πni=1(1 − ζsi )
G(s) = s ,
Πn+r
i=1 (1 − λi
)
where r = relative degree of G(s). Let y(t) be the step
response.
y(0) and its first r − 1 derivative are 0;
Fact : y (r) is the first non-zero derivative;
y(∞) = G(0).
The system has undershoot ⇔ the steady state value
y(∞) has a sign opposite to y (r)(0), i.e.
y (r)(0)y(∞) < 0.
& %
Controllability/observability
& %
& %
& %
& %
c2d
c2dm
canon
expm
tf2ss
ss2tf
(d)impulse
(d)step
minreal
tzero
ctrb
obsv
ctrbf
obsvf
(d)lsim
ss
ssdata
& %
Motivation
& %
plant
u x y
ẋ = Ax + Bu C
x̂ x̂˙ = Ax̂ + Bu r
−K
+L(y − r − C x̂) −
control-law estimator
compensator
& %
ẋ = Ax + Bu,
y = Cx + Du.
& %
& %
0.01
0.005
Amplitude
−0.005
−0.01
0 50 100 150
Time (secs)
& %
Control law
& %
Plant
u x y
ẋ = Ax + Bu C
u = −Kx
Control-law
& %
Closed-loop system:
& %
equals
(s − s1)(s − s2 ) . . . (s − sn).
& %
& %
then
& %
Property:
For SI systems, control law K is unique!
& %
and
& %
& %
& %
A − BK ∼ Λ.
X −1(A − BK)X = Λ,
or
AX − XΛ = BKX.
& %
K = GX −1.
Design procedure:
& %
& %
Desired poles:
& %
0.01
0.005
Amplitude
−0.005
−0.01
0 50 100 150
Time (secs)
Much better!
& %
AX − XΛc = BG,
where
−0.451 0.937
−0.937 −0.451
−0.947 0.581
Λc = .
−0.581 −0.947
−1.16
−1.16
& %
w Process
u x y
ẋ = Ax + Bu C
−K
& %
Input1/Output1 Input1/Output2
3 0.1
2 0
1 −0.1
0 −0.2
−1 −0.3
0 5 10 15 20 0 5 10 15 20
Input2/Output1 Input2/Output2
3 0.3
2 0.2
1 0.1
0 0
−1 −0.1
0 5 10 15 20 0 5 10 15 20
& %
Proof :
If ζ is a zero of (A, B, C, D), then (when ζ is not a pole),
there are u and v such that
" #" # " #" #
A B u I 0 u
= ζ
C D v 0 0 v
Now let ū = u, v̄ = Ku + v, then
" #" # " #" #
A − BK B ū I 0 ū
= ζ
C − DK D v̄ 0 0 v̄
⇒ ζ is a zero of (A − BK, B, C − DK, D).
& %
& %
& %
Step responses for the ITAE prototypes Step responses for the Bessel prototypes
1.2 1.2
1 1
0.2 0.2
0 0
0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
ẋ = Ax + Bu,
y = Cx + Du,
where
p1 0 2 0 0 0
ω1 −0.1 −0.35 0.1 0.1 0.75
x = p2 , A =
0 0 0 2 0,
ω2 0.1 0.1 −0.1 −0.35 0
i1 0 −0.03 0 0 −1
" #
h iT 0.5 0 0.5 0 0
B= 0 0 0 0 1 , C= ,
−0.2 −0.2 0.2 0.2 0
" # " #
0 p3
D= , y= , u = e1.
0 T
& %
Control law:
u = −Kx + 7.0212r,
where r is the reference input such that y follows r (in
steady state y = r).
& %
u = −Kx + 6.3284r.
& %
Step responses
1.2
ITAE
1
0.8
Tape postion p3
Dominant 2nd−order
Bessel
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time: msec.
Step responses
0.05
Bessel
Dominant 2nd−order
−0.05
Tape tension
−0.1
ITAE
−0.15
−0.2
0 1 2 3 4 5 6 7 8 9 10
Time: msec.
& %
poly
real
polyvalm
acker
lyap
place
& %
Motivation
& %
H0 = D, Hk = CAk−1B, k = 1, 2, · · · , N − 1.
JN = w T w + xT0 ON
T
ON x0 + uT HN
T
HN u
−2w T ON x0 − 2w T HN u + 2xT0 ON
T
HN u
& %
& %
0.8
0.6
0.4
0.2
amplitude
−0.2
−0.4
−0.6
−0.8
−1
0 2 4 6 8 10 12 14 16 18 20
discrete time
500
−500
amplitude
−1000
−1500
−2000
−2500
0 2 4 6 8 10 12 14 16 18 20
discrete time
100
80
60
40
20
amplitude
−20
−40
−60
−80
−100
0 2 4 6 8 10 12 14 16 18 20
discrete time
0.8
0.6
0.4
0.2
amplitude
−0.2
−0.4
−0.6
−0.8
−1
0 2 4 6 8 10 12 14 16 18 20
& %
discrete time
xk+1 = xk + uk
&
xk = (1 − κ)k x0 %
lim κopt = 1
ρ→0
& %
& %
lk = AT lk+1 + Qxk
Assume
& %
& %
Sk = 1 + 0.1354Sk+1[1 + 0.3996Sk+1]−1
& %
Kk = [1 + 0.6321Sk+10.6321]−10.6321Sk+10.3679
Sk Kk
0.2
0.18
1
0.16
0.14
0.8
0.12
0.6 0.1
0.08
0.4
0.06
0.04
0.2
0.02
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
k k
& %
K = (R + B T SB)−1B T SA,
uk = −Kxk .
& %
AT lk+1 = lk − Qxk
& %
& %
& %
1
(A + BCD)−1 = A−1 − A−1B(C −1 + DA−1B)−1DA−1
ẋ = Ax + Bu, u = −K(t)x
& %
−Ṗ = P A + AT P − P BR−1B T P + Q, P (T ) = QT
P A + AT P − P BR−1B T P + Q = 0.
& %
AT X + XA − XBB T X + C T C = 0
& %
yk = Cxk + Duk .
So
& %
AT P + P A − P BR−1B T P + C T QC = 0
has a solution :
1.06 −0.19 −2.32 0.10 0.04 0.49
−0.19 3.12 0.13 −0.04 0.02 −0.34
−2.32 0.13 5.55 −0.20 −0.08 −1.22
P =
0.10 −0.04 −0.20 0.06 0.03 −0.17
0.04 0.02 −0.08 0.03 0.02 −0.10
0.49 −0.34 −1.22 −0.17 −0.10 1.23
and the feedback control gain
h i
K = R−1 B T P = 1.06 −0.19 −2.32 0.10 0.04 0.49 .
& %
AT P + P A − P BR−1 B T P + C T QC = 0.
& %
& %
AT P + P A − P BR−1B T P + C T QC = 0
has a solution:
3.52 4.83 2.84 3.41 1.26 0.86
4.83 9.74 3.41 5.74 3.31 1.68
2.84 3.41 3.52 4.83 0.86 1.26
P =
3.41 5.74 4.83 9.74 1.68 3.31
1.26 3.31 0.86 1.68 1.39 0.53
0.86 1.68 1.26 3.31 0.53 1.39
so the state feedback gain:
" #
1.26 3.31 0.86 1.68 1.39 0.53
K = R−1B T P = .
0.86 1.68 1.26 3.31 0.53 1.39
The closed loop poles are:
& %
Input1/Output1 Input1/Output2
0.05
0.2 0
−0.05
0.1
−0.1
0 −0.15
−0.2
0 5 10 15 20 0 5 10 15 20
Input2/Output1 Input2/Output2
0.2
0.2 0.15
0.1
0.1
0.05
0 0
−0.05
0 5 10 15 20 0 5 10 15 20
Dashed line: Q = 2I
Solid line: Q = 9I
The larger Q, the faster and smaller the transient.
(What is the price for a larger Q?)
& %
input1/control1 Input1/control2
1.5 0.6
1 0.4
0.5 0.2
0 0
−0.5 −0.2
0 5 10 15 20 0 5 10 15 20
Input2/control1 Input2/control2
0.6 1.5
0.4 1
0.2 0.5
0 0
−0.2 −0.5
0 5 10 15 20 0 5 10 15 20
Dashed line: Q = 2I
Solid line: Q = 9I
The larger Q, the larger the control output u.
& %
are
dare
dlqr
dlqry
lqr
lqry
quadprog
rlocus
& %
Motivation
• Control law design with state feedback needs all the
state variables.
• Not all state variables are available since the cost of
the required sensors may be prohibitive, or it may be
physically impossible to measure all the state variables.
& %
& %
& %
u x y
ẋ = Ax + Bu C
x̂˙ = Ax̂ + Bu x̂
Estimator
& %
Estimator:
Insert the feedback signal of the difference between the mea-
sured and estimated outputs (y−C x̂) to correct the model:
& %
ỹ +
−
x̂
x̂˙ = Ax̂ + Bu + Lỹ C
ŷ
Estimator
Properties:
& %
s = s1 , s2, . . . , sn
Direct method
Determine L by comparing coefficients of the two polyno-
mials on both sides of the following equation :
& %
Control Estimation
A AT
B CT
K LT
C OT
& %
AT X − XΛ = C T G
α1 β1
−β1 α1
Λ=
. . . ,
λ1
...
which has eigenvalues: α1 ± jβ1, . . . , λ1, . . . . which are
the desired poles of the estimator.
−1 T
&
• Obtain the static feedback gain L = (GX ) . %
ẋ = Ax + Bu + B1w,
y = Cx + v
ẋ = −x + u
y = x+v
1 − state evolution
0.4
0.2
−0.2
& %
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time (s)
& %
& %
AT X − XΛe = C T G
& %
& %
obsv
poly
real
polyvalm
acker
lyap
place
& %
Formulation
We want to control the following discrete-time system by
state feedback
xk+1 = Axk + B2uk + B1wk
yk = C2xk + D2uk + vk
& %
b = Aθ + e.
E(e) = 0 : zero-mean
E(eeT ) = W
& %
& %
E(x̃k+1) = (A − Lk C2)E(x̃k ).
Pk+1 = E((x̃k+1)(x̃k+1)T )
= (A − Lk C2)Pk (A − Lk C2)T + B1QB1T + Lk RLTk
& %
& %
Both for the finite horizon and the infinite horizon case,
the Kalman filter equations are similar to the equations we
obtained for LQR design.
& %
Conversion table
LQR ↔ Kalman filter design
& %
Consider a system:
ẋ = Ax + B2u + B1w,
y = C 2 x + D2 u + v
& %
L = P (t)C2T R−1
Infinite-horizon case :
This leads to the continuous Algebraic Riccati equation :
L = P C2T R−1
& %
ẋ = Ax + Bu + B1w,
y = Cx + Du + v.
& %
They are slower than those from pole placement, but the
Kalman filter is less (actually least) sensitive to the noises.
& %
ẋ = Ax + Bu + B1w,
y = Cx + Du + v.
Again these poles are slower, but less sensitive to the noise
than those used in the pole placement design example from
a previous chapter.
& %
are
dkalman
dlqe
kalman
lqe
& %
Compensator Design
Compensator Structure
w v
Process
u ẋ = Ax + B2 u x y
y = C2 x + v
+B1w
Compensator
& %
B1 A vk
uk B2 + + C2 + yk
z −1
D2
C1
D1 } zk
& %
xk+1 = Ax
" k + B#2uk + B1wk ,
C1 xk
zk = ,
D1 u k
yk = C2xk + D2uk + vk .
Estimator :
Control law :
uk = −K x̂k .
Compensator :
& %
we obtain
" # " #" # " #" #
xk+1 A − B2 K B2 K xk B1 0 wk
= + ,
x̃k+1 A − LC2
0 x̃k B1 −L vk
" # " #
h i x h i w
k k
yk = C2 − D2K D2K + 0 I .
x̃k vk
& %
& %
& %
is minimized.
& %
& %
xk+1 = Ax
" k + B#1wk + B2uk ,
C1 xk
zk = .
D1 u k
where K = (D1T D1 + B2T SB2)−1B2T SA, in which S is
a solution for the Riccati equation :
−1 T
T T T
S = A S − SB2(D1 D1 + B2 SB2) B2 S A+C1T C1.
&
with R = cov(v) and Q = cov(w). %
& %
Compensator :
⇒
The poles of the compensator are not necessary in the unit
circle, the compensator might be unstable.
& %
system modeling
LQG
pole placement
compensator design
& %
ẋ = Ax
" + Bu #+ Bw,
q 1/2Cx
z = ,
u
y = Cx + v.
& %
& %
10
r(rad/sec) 8
−2
−4
0 5 10 15 20 25 30 35 40 45 50
Time (secs)
& %
& %
10
r(rad/sec) 6
−2
−4
−6
−8
0 5 10 15 20 25 30 35 40 45 50
Time (secs)
& %
& %
5
r(rad/sec)
−1
−2
−3
0 5 10 15 20 25 30 35 40 45 50
Time (secs)
This response is even better than the one from pole place-
ment and with a better noise attenuation.
& %
ẋ = Ax
" + Bu +# Bw,
Q1/2Cx
z = ,
u
y = Cx + v.
& %
& %
0.8
0.6
0.4 T
0.2
Amplitude
−0.2
−0.4
p3
−0.6
−0.8
−1
0 1 2 3 4 5 6 7 8 9 10
Time (secs)
& %
Let
" #
4 0
Q = 2I2, Rw = 0.001I4, Rv = .
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
" #
0.55 1.78 0.45 1.14 0.86 0.46
K=
0.45 1.14 0.55 1.78 0.46 0.86
and the optimal estimator gain
5.56e − 02 −1.67e + 00
7.74e − 04 −5.71e − 01
5.56e − 02 1.67e + 00
L= .
7.74e − 04 5.71e − 01
4.32e − 05 −6.02e − 01
4.32e − 05 6.02e − 01
& %
0.8
0.6
Amplitude
0.4
p3
0.2
0
T
−0.2
0 10 20 30 40 50 60 70 80 90 100
Time (secs)
& %
initial
kalman
lqg
lqgreg
lqr
reg
& %
Motivation
A controller obtained by combining a control law with an
estimator is essentially a regulator design : the charac-
teristic equations of the controller and the estimator are
basically chosen for good disturbance rejection. However,
it does not lead to tracking, which is evidenced by a good
transient response of the combined system to command
changes. A good tracking performance is obtained by
properly introducing the reference input into the system.
This is equivalent to design proper zeros from the reference
input to the output.
& %
Proof :
1. Verify that the closed-loop system from rk to yk is given
by
" # " #" # " #
xk+1 A −BK xk B N̄
= + rk ,
x̂k+1 LC A − BK − LC x̂k B N̄
" #
h i x
k
yk = C −DK + DN̄ rk .
x̂k
Note that:
• rk is an exogenous signal, the reference introduction will
NOT affect the poles of the closed-loop system.
" #−1
A−I B
• must exist, and thus for MIMO
C D
number of references = number of outputs
Continuous-time :
Try to verify that in this case
" # " #−1 " #
Nx A B 0
=
Nu C D I
& %
r + u y r + u y
Nu Plant N̄ -
Plant
-
K Estimator K Estimator
x̂
Nx - + x̂
& %
x̂
−K Estimator
& %
x̃k+1 = (A − LC)x̃k + B N̄ rk − M rk .
& %
Zeros :
The equations for a transmission zero are (see page 82)
ζI − A BK −B N̄
det −LC ζI − A + BK + LC −M = 0
C −DK DN̄
⇔
ζI − A BK −B N̄ u
−LC ζI − A + BK + LC −M v = 0
C −DK DN̄ w
| {z }
6=0
⇔
& %
& %
M = B N̄
u y
Process
r +
N̄
+
x̂
−K Estimator
& %
Properties :
• The compensator is in the feedback path. The refer-
ence signal rk goes directly into both the plant and the
estimator.
• Because of the pole-zero cancelation which causes “un-
controllability” of the estimator modes, the poles of the
transfer function from rk to yk consist only of the state
feedback controller poles (the roots of det(sI − A +
BK) = 0).
• The nonlinearity in the input (saturation) cancels out in
the estimator since in this case the state estimator error
equation is independent of u (x̃k+1 = (A − LC)x̃k )
& %
⇒ N̄ = 0, M = −L
u y
Process
+
r
−
−e
x̂
−K Estimator
& %
Properties :
• The compensator is in the feedforward path. The ref-
erence signal r enters the estimator directly only. The
closed-loop poles corresponding to the response from rk
to yk are the control poles AND the estimator poles (the
roots of det(sI − A + BK) det(sI − A + LC) = 0).
• In general for a step response there will be a steady-state
error and there will exist a static coupling between the
input-output pairs.
• Used when only the output error ek is available.
& %
& %
Az = A − BK − LC, Cz = K,
N̄ is determined such that the DC gain from rk to yk is
unity.
For instance, in the case of a SISO system in continuous
time, for which D = 0
1
N̄ = −
C(A − BK)−1B[1 − K(A − LC)−1(B − M̄ )]
and finally M = M̄ N̄ .
& %
& %
u = −Kx + "
(Nu + KNx )r #
0.8666 −1.6514
= −Kx + r.
1.2779 2.1706
Let L be the matrix from the pole placement estimator
design example on page 172. Then the closed-loop system
from r to y is
" # " #" # " #
ẋ A −BK x B N̄
˙x̂ = LC A − BK − LC + r,
x̂ B N̄
" #
h i x
y = C 0 .
x̂
& %
0.5
0
T
−0.5
0 2 4 6 8 10 12 14 16 18 20
Time (secs)
Step input to reference 2
1.5
1
T
Amplitude
0.5
0
p3
−0.5
0 2 4 6 8 10 12 14 16 18 20
Time (secs)
⇒ steady-state decoupling.
& %
Motivation:
The choice of N̄ will result in a step response with a zero
steady-state error (see page 218). But the result is not
robust because any change in the parameters will cause the
error to be nonzero. Integral control is needed to obtain
robust tracking of step inputs.
& %
& %
− 1 + u
r z−1 −K1 Process y
+ +
x
−K0
Note that pole placement or LQR might not work since the
augmented system is NOT always stabilizable and in this
case integral control can not be used.
& %
& %
ek = yk − rk .
& %
Then
ek+2 + α1ek+1 + α2ek = Cξk + Dµk ,
and the state equation for ξk becomes
where
ek 0 I 0 0
zk = ek+1 , Ae = −α2I −α1I C , Be = D .
ξk 0 0 A B
& %
& %
by disturbance estimation
Motivation
& %
where
wk 0 I 0 0
z = wk+1 , Ad = −α2I −α1I 0 , Bd = 0 ,
xk B 0 A B
h i
C d = D 0 C , Dd = D.
& %
The output uk :
uk = −K x̂k + N̄ rk
|{z} − ŵk
|{z} .
introduce reference cancel disturbance
Final closed-loop system:
& %
Sensitivity - Robustness
Why robustness?
• The plant characteristics may be variable or time-
varying. System modeling techniques identify the plant
within a certain model class and with a certain amount
of inaccuracy. So there always exists a plant uncer-
tainty, which can not be described exactly by the math-
ematical models.
• Control systems need to be made robust against this
plant variability and uncertainty.
Why frequency response analysis?
• There is a clear connection between frequency response
plots and experimentally obtained data.
• Easy to learn for trained engineers familiar with classi-
cal frequency response methods.
& %
Definition
Sensitivity of a quantity α to changes in a quantity β:
∆ ∂α β ∂α/∂β
Sβα = · = .
∂β α α/β
⇒
A measure of the relative change in α due to a relative
change in β.
r yc
k(s) gt (s)
& %
gt(s)k(s)
h(s) = .
1 − gt(s)k(s)
The sensitivity of h(s) to changes in gt(s):
∂h(s) gt(s) 1
Sgh(s) = =
∂gt(s) h(s) 1 − gt(s)k(s)
Plant variations will have a small or a large effect on the
closed-loop transfer function according to the size of the
sensitivity function (1 − gt(s)k(s))−1.
⇒
The robustness of the closed-loop system to plant variations
is improved by making the sensitivity function small, said
otherwise, by making the “loop gain” gt(s)k(s) large.
& %
equivalent
controller
r yo
K(s) Gt (s)
r yc
K(s) Gt (s)
G(s)
Since
yc = Gt(s)K(s)(I − Gt(s)K(s))−1 r,
yo = Gt(s)K(s)(I − G(s)K(s))−1 r.
& %
For matrices :
if y = Su
⇓
||y|| ≤ σmax(S)||u||
& %
σ̄(S(jω)) < 1, ∀ω
Complementary sensitivity:
∆
T (s) = G(s)K(s)S(s) = G(s)K(s)(I − G(s)K(s))−1
Note that S + T = I. The complementary sensitivity will
be used later.
& %
Nyquist stability
y d
K(s)
& %
R
r
x
& %
Sub-multiplicativity
For all gains, the gain of a cascade is not larger than the
product of the gains
||H1H2||gn ≤ ||H2||gn||H1||gn.
& %
w + H1 z
+ +
H2
Assume the problem is well-posed i.e. det(I − H1H2) 6= 0.
Then the transfer matrix from w to z is
Gzw = (I − H1H2)−1H1
& %
so that
||H1||gn||H2||gn < 1
we find
||H1||gn
||z|| ≤ ||w||.
1 − ||H1||gn||H2||gn
& %
∆a(s)
G(s)
K(s)
& %
⇒
• Given the gain of the perturbation:
∆
γa = max σ̄(∆a(jω)),
ω
& %
∆m(s)
G(s)
K(s)
& %
& %
∆f (s)
G(s)
K(s)
& %
& %
∆(s)
Gc (s)
& %
⇒
• Essentially the small gain condition states that if a feed-
back loop consists of stable systems and the loop-gain
product is less than unity, then the feedback loop is in-
ternally stable. Otherwise there always exists a ∆(s)
such that the closed-loop system is unstable.
• Given the gain of the perturbation
∆
γ = max σ̄(∆(jω)),
ω
& %
∆a(s)
∆m(s) ∆f (s)
& %
σ̄(K(jω)(I − K(jω)G(jω))−1)
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0 −2 −1 0 1 2
10 10 10 10 10
ω : rad/sec.
& %
0.8
0.6
σ̄(T )
0.4
0.2
0 −2
10
−1
10
ω : rad/sec.
0
10
1
10
2
10
This plot shows that the peak value of the maximum sin-
gular value of the complementary sensitivity is less than
1. Thus once the gain of the multiplicative error, γm =
maxω (∆m(jω)), is less than 1, the closed-loop system will
not be destabilized by this error.
& %
1.2
1.15
1.1
σ̄(S)
1.05
0.95
0.9
0.85 −2
10
−1
10
ω : rad/sec.
0
10
1
10
2
10
& %
& %
Chapter 1 : Introduction 13
3 Motivating Examples 15
Glass oven 15
Boeing 747 aircraft control 22
CVT control 26
General control configuration 29
Systems and models 30
&
Matlab functions 157
%
&
Table of Contents 269
%