Lecture 7 Linear Quadratic Regulator LQR) Design I Dr. Radhakant Padhi Asst. Proessor Dept. o Aerospace Engineering Indian Institute o Science - Bangalore
LQR Design: Problem Objective o drive the state X o a linear rather linearized) system X = AX + BU to the origin by minimizing the ollowing quadratic perormance index cost unction) ) J = X ) S X + X QX + U RU dt where S, Q 0 psd), R> 0 pd) t t 0
LQR Design: Guideline or Selection o Weighting Matrices S 0 psd), Q 0 psd), R> 0 pd) hese are usually chosen as diagonal matrices, with s q i i = = maximum expected/acceptable value o / maximum expected/acceptable value o / x ) i x ) i r i = maximum expected/a cceptable value o / u ) i 3
LQR Design: Some Facts to Remember { } he pair A, B needs to be controllable and the pair A, Q needs to be detectable { } S 0 psd), Q 0 psd), R > 0 pd) these are usually chosen as diagonal matrices) By deault, it is assumed that t Constrained problems state and control inequality constraints) are not considered here. hose will be considered later. 4
LQR Design: Problem Statement Perormance Index to minimize): X ) Path Constraint: t ) J = X S X + ) X QX + U RU dt t 0 ϕ, ) L X U X = AX + BU Boundary Conditions: X t 0 = X :Speciied ) :Fixed, 0 X t ) :Free 5
LQR Design: Necessary Conditions o Optimality erminal penalty: Hamiltonian: State Equation: ) ϕ X ) = X S X H = X QX + U RU + AX + BU X = AX + BU ) λ ) Costate Equation: ) H / X QX A λ ) λ = = + Optimal Control Eq.: Boundary Condition: / ) = 0 = H U U R B λ ϕ/ X ) λ = = S X 6
LQR Design: Derivation o Riccati Equation Guess: Justiication: λ t = P t X t ) ) ) From unctional analysis theory o normed linear space, lies in the "dual space" o ) X t ) o all continuous linear unctionals o X t. λ t), which is the space consisting Reerence: Optimization by Vector Space Methods D. G. Luenberger, John Wiley & Sons, 969. 7
LQR Design: Derivation o Riccati Equation Guess λ t) = P t) X t) λ = PX + PX = PX + P AX + BU ) = PX + P AX BR B λ ) = PX + P AX BR B PX ) QX + A PX = P + PA PBR B P X ) ) P + PA+ A P PBR B P+ Q X = ) 0 8
LQR Design: Derivation o Riccati Equation Riccati equation P PA A P PBR B P Q + + + = 0 Boundary condition ) = is ree) P t X S X X P t ) = S 9
LQR Design: Solution Procedure Use the boundary condition P t ) = S and integrate the Riccati Equation backwards rom t to t 0 Store the solution history or the Riccati matrix Compute the optimal control online ) U = R B P X = K X 0
LQR Design: Ininite ime Regulator Problem heorem By Kalman) As t, or constant Q and R matrices, P 0 t Algebraic Riccati Equation ARE) Note: PA A P PBR B P Q + + = ARE is still a nonlinear equation or the Riccati matrix. It is not straightorward to solve. However, eicient numerical methods are now available. A positive deinite solution or the Riccati matrix is needed to obtain a stabilizing controller. 0
Example : Stabilization o Inverted Pendulum Dr. Radhakant Padhi Asst. Proessor Dept. o Aerospace Engineering Indian Institute o Science - Bangalore
A Motivating Example: Stabilization o Inverted Pendulum System dynamics: θ = ω θ u, ω = g/ L n n Linearized about vertical equilibrium point) u θ L mg System dynamics state space orm): Deine: x = θ, x = θ x 0 x 0 u x = ωn 0 + x X A X B Perormance Index to minimize): J = θ u dt + c 0 0 Q=, R= 0 0 c 3
A Motivating Example: Stabilization o Inverted Pendulum ARE: PA A P PBR B P Q + + = 0 p p P = p p 3 Let a symmetric matrix) pω 0 0 0 n p pωn p3ω n c p c pp 3 + + p 0 0 = 0 0 3ωn p p p c pp3 c p3 Equations: pωn c p + = 0 p = ω n ± ωn c p + pω c p p = 0 repeated) 3 n 3 p c p = 0 p =± p c 3 3 + c 4 u θ L mg 4
A Motivating Example: Stabilization o Inverted Pendulum However, p is a diagonal term, which needs to be real and positive. 3 Hence, p needs to be positive. hereore p = ω + ω + c, p = p c c Moreover, 4 n n 3 p + pω c p p = 0 3 n 3 p = c p p pω 3 3 n not needed in this problem) u θ L mg Gain Matrix: K = R B P= c p c p 3 Control: θ 3θ) u K X c p p = = + 5
A Motivating Example: Stabilization o Inverted Pendulum Analysis Open-Loop System: λ λi A = = λ ωn = 0 ω λ λ =± ω n n right hal pole: unstable system) u θ L mg Closed-Loop System: Deine: 0 ACL = A BK = ωn c p c p 3 Closed-Loop Poles: λi A = 0 CL ω = ω + c p p 4 n = + c ωn ω ) = p = + c c 3 ωn ω ) / 6
A Motivating Example: Stabilization o Inverted Pendulum Analysis Closed-Loop Poles: n ) / λ + ω + ω λ+ ω = 0 λ, = ω + ω ± ω ω ) 4 Note: ω = ωn + c > ωn n ) j n) / / u θ L mg Both o the closed-loop poles are strictly in the let-hal plane. Hence, the closed-loop is guaranteed to be asymptotically stable. 7
Example : Finite-time emperature Control Dr. Radhakant Padhi Asst. Proessor Dept. o Aerospace Engineering Indian Institute o Science - Bangalore
Example: Finite ime emperature Control Problem System dynamics : θ = a θ θ + bu ) where ab, : Constants θ : emperature θ u n n 0 : Ambient temperature Constant = 0 C) : Heat input 9
Problem ormulations Case : Case : Cost Function: J = t u dt 0 Cost Function: ) J = s θ 30 + u dt 0 s > 0 : Weightage t θ t ) = θ = 30 Hard constraint) 0 C t ) i.e. θ 30 Sot Constraint) 0 C 0
Solution: Solution: x θ θa), θ 0) = θa ) θ θ ) x = ax+ bu, x 0 = = 0 Η= + + Η λ = = aλ x Η = 0 u = λb u ) u λ ax bu a a Necessary conditions x = ax+ bu λ = aλ u = bλ
Solution: Case Hard constraint) u at t ) at t) = e = e λ λ λ = be at t) at x = ax b λ e λ t) aking laplace transorm: sx s) x 0) ) at ax s b λ e = s a 0
Solution: Case Hard constraint) ) at X s = b λ e a s a s+ a = a at = b λ e Hence ) at ) at at xt b λ e e e Unknown θ θ ) However, xt ) = = 0 s a a 0 C 3
Solution: Case Hard constraint) at e ) at e ) ) at at at xt ) = 0= bλ e e e b λ 0 = a 0a λ = b a xt ) = b at 0 a 0 e e at ) at at e e e = b e ) a e e at ) ) at at at 4
Solution: Case Hard constraint) Note : xt ) = 0 at at e e ) at at e e ) = 0 i.e. he boundary condition is "exactly met".) Controller : ut ) = be at at t) 0a 0ae = at at at ) ) b e b e e 5
Solution: Case Sot constraint) θ 0 0 30 C x 0 C. Hence the cost unction is t ) J = s x 0 + u dt 0 λ 0) λ = s x x = + 0 s However, we have b xt e e e a at ) ) at at λ = 6
Solution: Case Sot constraint) b ) at λ At, ) t = t x t = λ e = + 0 a s b at.. ) ie λ + e = 0 s a ie.. λ Hence 0sa = at ) a+ s b e ) ) λ = e λ = e 0sa at t at t at ) a+ s b e 7
Solution: Case Sot constraint) ut ) = bλ = be = be ) 0sa at t at ) a+ s b e 0sabe at at t) at sb at at ae + e e ) 8
Correlation between hard and sot constraint results As s, at 0abe = b ae + e e s at 0ae = = ut ) at at HC.. be lim u) t lim SC s s.. at at at e ) ) ie.. he "sot constraint" problem behaves like the "hard constraint" problem when s. 9
30