LQG Control System Design Guide
LQG Control System Design Guide
Bo Bernhardsson, K. J. Åström
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks, how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
Process model
ẋ = Ax + Bu + v
y = C x + Du + w
Optimization criterion
Z T T
x
Q 11 Q 12
x
min E dt
0 u Q 21 Q 22 u
ẋ = Ax + v
y = Cx + e
e white noise, E e( t) eT ( t − τ ) = R 2δ (τ )
State covariance
E x( t) xT ( t) = R( t), Ṙ = A R + R AT + R 1
Kalman filter, x̂˙ = A x̂ + L ( y − C x̂)
Ṗ = A P + P AT + R 1 − PC T R− 1
2 C P, L = PC T R−
2
1
Process
Kalman Filter
In the late 50s and early 60s computers where starting to be used to find
“optimal” controllers.
Wiener-Kolmogorov
Kalman-Bucy
Used for space program, aircraft design - Good models often available
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks,how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
Y = G(s)U
y = ⋆u
ẋ = Ax + Bu
y = C x + ( Du)
X X Z∞
qGq22 = pGi j ( jω )p2 dω /2π =
i j −∞
Z∞
= trace {G∗ ( jω )G( jω )} dω /2π
−∞
u y
Z
T
E (tr yy ) = tr S y(ω ) dω /2π =
Z
= tr G∗ ( jω ) S u (ω )G( jω ) dω /2π
= qGq22
X X Z∞
qGq22 = p ji ( t)p2 dt
i j −∞
ui = δi(t) y=g
G : , i (t)
m Z∞
X
qGq22 = p :,i p2 ( t)dt
i=1 0
A P + P AT + BBT = 0
and S solves
S A + AT S + C T C = 0
3) Residue calculus
X 1 I
qGq22 = Gi j (−s)T Gi j (s) ds
2πi
i, j
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks,how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
u G
y
u = Control inputs
y = Measured outputs
Fixed commands
Unknown commands
w = Exogenous inputs =
Disturbances
Noise . . .
Tracking errors
Control inputs
z = Regulated outputs =
Measured outputs
States . . .
Closed Loop
u = K (s) y
z = G11 + G12 K ( I − G22 K )−1 G21 w = Tzw w
The H2 problem:
min qTzw q2
K (s)
is obtained.
ẋ = Ax + B1 w + B2 u
z = C1 x + D 12 u
y = C 2 x + D 21 w + D 22 u
Under some technical conditions the optimal controller is
u = −K b
x
xḃ = A xb + B2 u + L( y − C 2 b
x − D 22 u)
K = ( D T12 D 12 )−1 ( D T12 C1 + B2T S )
L = ( B1 D T21 + PC 2T )( D 21 D T21 )−1
where P ≥ 0 and S ≥ 0 satisfy
0 = S A + AT S + C 1T C 1 − K T D T12 D 12 K
0 = A P + P AT + B1 B1T − L D 21 D T21 L T
A − B2 K , A − LC 2 stable
Bo Bernhardsson, K. J. Åström Control System Design - LQG
The Optimal Controller
u = − K (s I − A + B2 K + LC 2 − L D 22 K )−1 Ly
1) [ A, B2 ] stabilizable
2) [C 2 , A] detectable
Weight matrices
T
Q 11 Q 12
C1
T T
= C1 D 12
Q 12 Q 22 D 12
R 11 R 12
B1 T T
T = B1 D 21
R 12 R 22 D 21
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks,how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
+----------------------------+
u | |
| +------+ |
+--->| | x_e +----+ |
| KEST |------>| -K |---+-----> u
y -------->| | +----+
+------+
1 + 0.5s
G(s) =
s2
s + 11.02
C (s) = 3628
(s + 2)(s + 78.28)
To construct an LQG controller we write the system on state space form
0 0
1
ẋ = x+ u + Gw
1 0 0
y = 0.5 1 x + Hw + v
A = [0 0 ; 1 0];
B = [1 ; 0];
C = [0.5 1];
D = 0;
sys = ss(A,B,C,D);
Q=diag([0 1]);
R=1e-5;
[k,s,e]=lqr(A,B,Q,R);
G=B;
H=0;
QN = 1;
RN = 1e-5;
syse = ss(A,[B G],C,[D H]);
[kest,l,p]=kalman(syse,QN,RN);
rlqg = lqgreg(kest,k);
PC = -rlqg*sys;
20 50
0 40
-20 30
-40 20
-60 10
-80 0
-100 -10
-2 -1 0 1 2 3
10-2 10-1 100 101 102 103 10 10 10 10 10 10
20 50
0 40
−20 30
−40 20
−60 10
−80 0
−100 −2 −1 0 1 2 3
−10 −2 −1 0 1 2 3
10 10 10 10 10 10 10 10 10 10 10 10
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks,how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
M T (−s) M (s) =
( I + K (−s I − AT )−1 B)T D T12 D 12 ( I + K (s I − A)−1 B)
If no crossterms:
If C 1T C 1 = Q 1 , C 1T D 12 = 0 and D T
12 D 12 = Q 2
q 2 p1 + K (s I − A)−1 Bp2 ≥ q 2
therefore
p1 + K (s I − A)−1 Bp ≥ 1
Ms ≤ 1
Ms ≤ 1
With
S i ( jω ) = (1 + K (s I − A)−1 B)−1
1/2 −1/2
σ̄ ( Q 2 S i ( jω ) Q 2 )≤1
If Q 2 diagonal this gives nice MIMO gain/phase margins, see LQG course.
K ( jω I − A)−1 B ∼ K B/ω = Q− 1 T
2 B S B/ω
K ( jω I − A + BL)−1 B ∼ K B/ω = Q− 1 T
2 B S B/ω
Intution for the future: If the open loop system has roll-off larger than 1,
then if one forces the LQG loop gain to approach the LQ loop gain, the
LQG controller will have large high-frequency gain
Since the LQG controller combines two robust parts: LQ control and
Kalman filtering, it was for a long time hoped that robustness margins for
the LQG controller would eventually be found
ẋ1 1 1 x1 0 1
=
+ u +
v
ẋ2 0 1 x2 1 1
x1 √
y = 1 0 + σw
x2
min E [( x1 + x2 )2 + ρu2 ]
A = [1 1; 0 1];
B2 = [0 ; 1];
B1 = [1; 1];
C2 = [1 0];
C1 = [1 1];
G = B1;
H = 0*C2*B1;
sys=ss(A,B2,C2,0);
syse=ss(A,[B2 G],C2,[0 H]);
rho=1;sigma=1;
[K,S,E] = lqr(A,B2,C1’*C1,rho);
[Kest,L,P] = kalman(syse,1,sigma);
rlqg = -lqgreg(Kest,K);
loopgain = sys*rlqg;
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0
Infinitly small gain and phase margins when ρ and σ become small
B(s)
G(s) = C (s I − A)−1 B =:
A(s)
P (s)
I + H (s) := I + K (s I − A)−1 B =:
A(s)
oldboxes;robotdata
[b,a]=tfdata(sys2);b=b{1};a=a{1};
locus=symlocc(b,a,1e-6,1e10,0.003);
plot(locus(:,2:end),’b’,’Linewidth’,2)
Eigenvalues of closed loop tend to stable zeros of B(−s) B(s) and the
rest tend to ∞ as stable roots of
s2d = const · ρ
Z∞ X 1
min p y( t) − 1p2 dt = 2 Re
0 zj
Rez j >0
Example
min u2 , ẋ = x + u
A(s) = s − 1 unstable.
Optimal controller u = −2x gives
ẋ = − x
P (s) = s + 1
ẋ = Ax + B(u + w), u = −K x
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks,how to tune the knobs
What do the “technical conditions” mean?
How to get integral action etc
Loop Transfer Recovery (LTR)
More Examples
Q1 = diag(α1 , . . . , αn )
Q2 = diag(β 1 , . . . , β m )
Note that multiplying all elements of Q by the same factor does not change
the controller. Similar for the R matrices.
( ẋi + αxi )2
Gives cross-terms
1
G(s) =
(s + 1)(s2 + 1)
s =
0.7071 0.7071 0.4082
0 + 0.7071i 0 - 0.7071i -0.4082
0 0 0.8165
d =
0 + 1.0000i 0 0
0 0 - 1.0000i 0
0 0 -1.0000
1
2
1
,
Q 1 = q i qTi , q1 =
q2 =
0
0 −1
2
1.5
0.5
−0.5
−1
−1.5
−2
−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0
−3 Open loop
x 10
2
1.8
1.6
Power spectral density
1.4
1.2
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25
Frequency rad/s
−3 Design 1 Design 1
x 10 10
2
1.8 9
1.6 8
Power Spectral Density
1.4 7
Controller gain
1.2 6
1 5
0.8 4
0.6 3
0.4 2
0.2 1
0 0
0 5 10 15 20 25 0 5 10 15 20 25
Frequency rad/s Frequency rad/s
−3 Design 2 Design 2
x 10 10
2
1.8 9
1.6 8
Power Spectral Density
1.4 7
Controller Gain
1.2 6
1 5
0.8 4
0.6 3
0.4 2
0.2 1
0 0
0 5 10 15 20 25 0 5 10 15 20 25
Frequency rad/s Frequency rad/s
4.5
2.5
1.5
0.5
0
0 5 10 15 20 25
Frequency rad/s
0
0.5
−1 0
−2 −0.5
−3 −1
−4 −1.5
−5 −2
−1 0 1 2 3 4 −2 −1 0 1 2 3
Introduction
The H2 -norm
Formula for the optimal LQG controller
Software, Examples
Properties of the LQ and LQG controller
Design tricks, how to tune the knobs
Next lecture