Professional Documents
Culture Documents
Linear Quadratic Regulator (LQR) Lec# 14 PDF
Linear Quadratic Regulator (LQR) Lec# 14 PDF
Lecture # 14
Linear Quadratic Regulator (LQR)
– p. 1/2
Consider the system
ẋ = Ax + Bu
xT Qx = xT M T M x = z T z
– p. 3/2
Write J as
J = lim J¯(tf )
tf →∞
Z tf
J¯(tf ) = [xT (t)Qx(t) + uT (t)Ru(t)] dt
0
– p. 4/2
Recall that (A, B) is stabilizable if the uncontrollable
eigenvalues of A, if any, have negative real parts
– p. 5/2
Remarks:
1. The need for (A, B) to be stabilizable is clear, for
otherwise there would be no F such that
Re [λ(A + BF )] < 0
2. To see why detectability of (A, M ) is needed, consider
Z ∞
ẋ = x + u, J = u2 (t) dt
0
A = 1, B = 1, M = 0, R = 1
(A, B) is controllable, but (A, M ) is not detectable
F = 0 ⇒ u(t) = 0 ⇒ J = 0
W (A + BF ) + (A + BF )T W + Q + F T RF = 0
– p. 7/2
Theorem: Consider the system ẋ = Ax + Bu and the
performance index
Z ∞
J = [xT (t)Qx(t) + uT (t)Ru(t)] dt
0
u(t) = −R−1 B T P x
0 = P A + AT P + Q − P BR−1 BP
– p. 8/2
Remarks:
– p. 9/2
Example:
ẋ1 = x2 , ẋ2 = u
Z ∞
J = [x21 + ρu2 ] dt, ρ > 0
0
" # " # " #
0 1 0 1 0
A= , B= , Q= , R=ρ
0 0 1 0 0
" #
1 h i h i
Q= 1 0 ⇒ M = 1 0
0
" #
0 1
rank[B, AB] = rank = 2 ⇒ (A, B) is controllable
1 0
– p. 10/2
" # " #
M 1 0
rank = rank =2
MA 0 1
⇒ (A, M ) is observable
0 = P A + AT P + Q − P BR−1 BP
" # 0 = 1 − ρ1 p212
p11 p12
P = ⇒ 0 = p11 − ρ1 p12 p22
p12 p22
0 = 2p12 − ρ1 p222
√ p
p12 = ± ρ, p22 = 2ρ p12
√ √ 3/4 1 √ 1/4
p12 = ρ, p22 = 2ρ , p11 = p12 p22 = 2ρ
ρ
– p. 11/2
" √ #
2ρ1/4 ρ1/2
P = 1/2
√ 3/4
ρ 2ρ
−1/4 1
λ1,2 = ρ √ (−1 ± j)
2
– p. 12/2
Notice how F and the eigenvalues depend on ρ
h √ i
F = − ρ−1/2 2ρ−1/4
−1/4 1
λ1,2 = ρ √ (−1 ± j)
2
What happens as you change ρ?
– p. 13/2
Matlab Calculations:
X = lyap(A,N) solves the Lyapunov equation
AX + XAT + N = 0
W (A + BF ) + (A + BF )T W + Q + F T RF = 0
– p. 14/2
X = are(A,S,Q) solves the Riccati equation
XA + AT X + Q − XSX = 0
S = BR−1 B
P A + AT P + Q − P BR−1 B T P = 0
– p. 15/2
LQR Design
– p. 16/2
Procedure:
1. Choose Q and R such that Q = M T M , with (A, M )
detectable, and R = RT > 0
2. Solve the Riccati equation
P A + AT P + Q − P BR−1 B T P = 0
– p. 17/2
Typical Choice:
q1 r1
q2 r2
Q= ...
, R = ρ
...
qn rm
1 1
qi = , ri = , ρ>0
tsi (ximax )2 (uimax )2
tsi is the desired settling time of xi
ximax is a constraint on |xi |
uimax is a constraint on |ui |
ρ is chosen to tradeoff regulation versus control effort
– p. 18/2
Example:
0 1 0 0
A= 0 0 1 , B = 0
−0.4 −4.2 −2.1 1
R λ
0.01 −9.7364, −0.9039 ± 0.4593j
0.1 −0.6568, −1.9548 ± 1.0158j
1 −0.2599, −1.1433 ± 1.6840j
– p. 19/2
Q = diag(1,1,1)
2 1.5
R=0.01
R=0.1
R=1 1
1.5
0.5
1
1
2
x
x
0
0.5
−0.5
0 −1
0 1 2 3 4 5 0 1 2 3 4 5
1 5
0.5 0
0 −5
−0.5 −10
3
u
x
−1 −15
−1.5 −20
−2 −25
−2.5 −30
0 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1
– p. 20/2
R=0.1
1.5
Q =1
11 1
Q = 10
11
1
0.5
1
x2
0.5
x
0 −0.5
−1
−0.5
0 1 2 3 4 5 0 1 2 3 4 5
1 5
0 0
−5
−1
3
u
x
−10
−2
−15
−3
−20
0 1 2 3 4 5 0 1 2 3 4 5
– p. 21/2
Q =1;R=0.1
11
1.5 Q =10;R=0.1
11 1
Q =10;R=0.4
11
1 0.5
0
1
2
0.5
x
x
−0.5
0
−1
−0.5
0 1 2 3 4 5 0 1 2 3 4 5
1 5
0 0
−5
−1
3
u
x
−10
−2
−15
−3
−20
0 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1
– p. 22/2