Topic #17 16.31 Feedback Control State-Space Systems • Closed-loop control using estimators and regulators. • Dynamics output feedback • “Back to reality” Copyright 2001 by Jonathan How. All Rights reserved 1 16.31 17—1 Fall 2001 Combined Estimators and Regulators • Can now evaluate the stability and/or performance of a controller when we design K assuming that u = −Kx, but we implement u = −K x̂ • Assume that we have designed a closed-loop estimator with gain L ˙ x̂(t) = Ax̂(t) + Bu(t) + L(y − ŷ) ŷ(t) = C x̂(t) • Then we have that the closed-loop system dynamics are given by: ẋ(t) ˙ x̂(t) y(t) ŷ(t) u = = = = = Ax(t) + Bu(t) Ax̂(t) + Bu(t) + L(y − ŷ) Cx(t) C x̂(t) −K x̂ • Which can be compactly written as: ∙ ¸ ∙ ¸∙ ¸ ẋ A −BK x = LC A − BK − LC x̂ x̂˙ ⇒ ẋcl = Acl xcl • This does not look too good at this point — not even obvious that the closed-system is stable. λi (Acl ) =?? 16.31 17—2 Fall 2001 • Can fix this problem by introducing a new variable x̃ = x − x̂ and then converting the closed-loop system dynamics using the similarity transformation T ∙ ¸ ∙ ¸∙ ¸ x I 0 x = = T xcl x̃cl , x̃ I −I x̂ — Note that T = T −1 • Now rewrite the system dynamics in terms of the state x̃cl Acl ⇒ T Acl T −1 , Ācl — Note that similarity transformations preserve the eigenvalues, so we are guaranteed that λi(Acl ) ≡ λi(Ācl ) • Work through the math: ∙ ¸∙ ¸∙ ¸ I 0 A −BK I 0 Ācl = I −I LC A − BK − LC I −I ∙ ¸∙ ¸ A −BK I 0 = A − LC −A + LC I −I ¸ ∙ A − BK BK = 0 A − LC • Because Ācl is block upper triangular, we know that the closed-loop poles of the system are given by det(sI − Ācl ) , det(sI − (A − BK)) · det(sI − (A − LC)) = 0 Fall 2001 16.31 17—3 • Observation: The closed-loop poles for this system consist of the union of the regulator poles and estimator poles. • So we can just design the estimator/regulator separately and combine them at the end. — Called the Separation Principle. — Just keep in mind that the pole locations you are picking for these two sub-problems will also be the closed-loop pole locations. • Note: the separation principle means that there will be no ambiguity or uncertainty about the stability and/or performance of the closed-loop system. — The closed-loop poles will be exactly where you put them!! — And we have not even said what compensator does this amazing accomplishment!!! 16.31 17—4 Fall 2001 The Compensator • Dynamic Output Feedback Compensator is the combination of the regulator and estimator using u = −K x̂ ˙ x̂(t) = Ax̂(t) + Bu(t) + L(y − ŷ) = Ax̂(t) − BK x̂ + L(y − C x̂) ˙ ⇒ x̂(t) = (A − BK − LC)x̂(t) + Ly u = −K x̂ • Rewrite with new state xc ≡ x̂ ẋc = Acxc + Bcy u = −Ccxc where the compensator dynamics are given by: Ac , A − BK − LC , Bc , L , Cc , K — Note that the compensator maps sensor measurements to actuator commands, as expected. • Closed-loop system stable if regulator/estimator poles placed in the LHP, but compensator dynamics do not need to be stable. λi(A − BK − LC) =?? 16.31 17—5 Fall 2001 • For consistency in the implementation with the classical approaches, define the compensator transfer function so that u = −Gc(s)y — From the state-space model of the compensator: U (s) , −Gc(s) Y (s) = −Cc (sI − Ac )−1Bc = −K(sI − (A − BK − LC))−1L ⇒ Gc(s) = Cc(sI − Ac)−1Bc • Note that it is often very easy to provide classical interpretations (such as lead/lag) for the compensator Gc(s). • One way to implement this compensator with a reference command r(t) is to change the feedback to be on e(t) = r(t) − y(t) rather than just −y(t) r e — 6 - Gc(s) u G(s) y - ⇒ u = Gc(s)e = Gc(s)(r − y) — So we still have u = −Gc (s)y if r = 0. — Intuitively appealing because it is the same approach used for the classical control, but it turns out not to be the best approach. More on this later. 16.31 17—6 Fall 2001 Mechanics • Basics: e = r − y, Gc(s) : y = Gu u = Gce, ẋc = Acxc + Bce , G(s) : ẋ = Ax + Bu • Loop dynamics L = Gc(s)G(s) ⇒ u = Ccxc , y = Cx y = L(s)e ẋ = Ax +BCc xc ẋc = +Ac xc +Bce L(s) ∙ ẋ ẋc ¸ ∙ ¸∙ ¸ ∙ ¸ A BCc x 0 = + e xc Bc 0 Ac ∙ ¸ £ ¤ x y = C 0 xc • To “close the loop”, note that e = r − y, then ∙ ¸∙ ¸ ∙ ¸µ ∙ ¸¶ ∙ ¸ £ ¤ x A BCc x 0 ẋ = + r− C 0 xc xc Bc 0 Ac ẋc ∙ ¸∙ ¸ ∙ ¸ A BCc x 0 = + r xc Bc −BcC Ac ∙ ¸ £ ¤ x y = C 0 xc — Acl is not exactly the same as on page 17-1 because we have rearranged where the negative sign enters into the problem. Same result though. 16.31 17—7 Fall 2001 Simple Example • Let G(s) = 1/s2 with state-space model given by: ∙ ¸ ∙ ¸ £ ¤ 0 1 0 A= , B= , C= 1 0 , D=0 0 0 1 • Design the regulator to place the poles at s = −4 ± 4j £ ¤ λi (A − BK) = −4 ± 4j ⇒ K = 32 8 — Time constant of regulator poles τc = 1/ζωn ≈ 1/4 = 0.25 sec • Put estimator poles so that the time constant is faster τe ≈ 1/10 — Use real poles, so Φe(s) = (s + 10)2 ¸−1 ∙ ¸ 0 C L = Φe (A) 1 CA Ã∙ ∙ ¸ ∙ ¸! ∙ ¸−1 ∙ ¸ ¸2 0 0 1 100 0 1 0 0 1 + 20 + = 1 0 0 0 100 0 1 0 0 ∙ ¸∙ ¸ ∙ ¸ 100 20 0 20 = = 100 0 100 1 ∙ 16.31 17—8 Fall 2001 • Compensator: Ac = A ∙ − BK ¸ −∙LC¸ ∙ ¸ ¤ ¤ 0 1 0 £ 20 £ = − 32 8 − 1 0 0 0 1 100 ∙ ¸ −20 1 = −132 −8 Bc = L = ∙ £ 20 100 ¸ Cc = K = 32 8 ¤ • Compensator transfer function: Gc(s) = Cc(sI − Ac)−1Bc , = 1440 U E s + 2.222 s2 + 28s + 292 • Note that the compensator has a low frequency real zero and two higher frequency poles. — Thus it looks like a “lead” compensator. 16.31 17—9 Fall 2001 2 10 Plant G Compensator Gc 1 Mag 10 0 10 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 50 Plant G Compensator Gc Phase (deg) 0 −50 −100 −150 −200 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 Figure 1: Plant is pretty simple and the compensator looks like a lead 2—10 rads/sec. 2 10 Loop L 1 Mag 10 0 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 −120 −140 Phase (deg) −160 −180 −200 −220 −240 −260 −280 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 Figure 2: Loop transfer function L(s) shows the slope change near ωc = 5 rad/sec. Note that we have a large PM and GM. 16.31 17—10 Fall 2001 15 10 Imag Axis 5 0 −5 −10 −15 −15 −10 −5 Real Axis 0 5 Figure 3: Freeze the compensator poles and zeros and look at the root locus of closed-loop poles versus an additional loop gain α (nominally α = 1.) 2 10 Plant G closed−loop Gcl 1 Mag 10 0 10 −1 10 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 Figure 4: Closed-loop transfer function. 3 10 16.31 17—11 Fall 2001 Figure 5: Example #1: G(s) = 1 8·14·20 (s+8)(s+14)(s+20) 2 10 10 Plant G Compensator Gc Plant G closed−loop Gcl 0 Mag 10 1 10 −1 10 −2 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 Mag 10 0 10 50 Plant G Compensator Gc Phase (deg) 0 −1 −50 10 −100 −150 −200 −1 10 −2 0 10 1 10 Freq (rad/sec) 2 10 3 10 10 −1 0 10 1 10 2 10 Freq (rad/sec) 10 3 10 Bode Diagrams 1 10 Loop L Gm=10.978 dB (at 40.456 rad/sec), Pm=69.724 deg. (at 15.063 rad/sec) 50 0 10 Mag 0 −1 10 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 0 Phase (deg) −50 Phase (deg); Magnitude (dB) −50 −100 −150 0 −50 −100 −150 −100 −200 −150 −250 −300 −200 −350 −250 −400 0 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 1 2 10 10 3 10 Frequency (rad/sec) 3 10 16.31 17—12 Fall 2001 Figure 6: Example #1: G(s) = 8·14·20 (s+8)(s+14)(s+20) 50 40 30 20 Imag Axis 10 0 −10 −20 −30 −40 −50 −80 −70 −60 −50 −40 −30 Real Axis −20 −10 0 10 20 25 20 15 10 Imag Axis 5 0 −5 −10 −15 −20 −25 −50 −45 −40 −35 −30 −25 Real Axis −20 −15 −10 −5 0 3 — closed-loop poles, 5 — open-loop poles, 2 — Compensator poles, ◦ — Compensator zeros Fall 2001 16.31 17—13 • Two compensator zeros at -21.54±6.63j draw the two lower frequency plant poles further into the LHP. • Compensator poles are at much higher frequency. • Looks like a lead compensator. 16.31 17—14 Fall 2001 Figure 7: Example #2: G(s) = 1 2 10 10 0.94 s2 −0.0297 Plant G Compensator Gc Plant G closed−loop Gcl 0 Mag 10 1 10 −1 10 −2 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 Mag 10 0 10 50 Plant G Compensator Gc Phase (deg) 0 −1 −50 10 −100 −150 −200 −1 10 −2 0 10 1 10 Freq (rad/sec) 2 10 3 10 10 −1 0 10 1 10 10 Freq (rad/sec) 2 3 10 10 Bode Diagrams 1 10 Loop L Gm=11.784 dB (at 7.4093 rad/sec), Pm=36.595 deg. (at 2.7612 rad/sec) 50 0 Mag 10 0 −1 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 0 Phase (deg) −50 Phase (deg); Magnitude (dB) 10 −50 −100 −100 −150 −100 −200 −150 −200 −250 −250 −300 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 −1 10 0 10 3 10 Frequency (rad/sec) 1 10 2 10 16.31 17—15 Fall 2001 Figure 8: Example #2: G(s) = 6 0.94 s2 −0.0297 4 Imag Axis 2 0 −2 −4 −6 −8 −6 −4 −2 0 2 Real Axis 2 1.5 1 Imag Axis 0.5 0 −0.5 −1 −1.5 −2 −2 −1.5 −1 −0.5 0 Real Axis 0.5 1 1.5 2 3 — closed-loop poles, 5 — open-loop poles, 2 — Compensator poles, ◦ — Compensator zeros Fall 2001 16.31 17—16 • Compensator zero at -1.21 draws the two lower frequency plant poles further into the LHP. • Compensator poles are at much higher frequency. • Looks like a lead compensator. 16.31 17—17 Fall 2001 Figure 9: Example #3: G(s) = 1 8·14·20 (s−8)(s−14)(s−20) 2 10 10 Plant G Compensator Gc Plant G closed−loop Gcl 0 Mag 10 1 10 −1 10 −2 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 Mag 10 0 10 50 Plant G Compensator Gc Phase (deg) 0 −1 −50 10 −100 −150 −200 −1 10 −2 0 10 1 10 Freq (rad/sec) 2 10 3 10 10 −1 0 10 1 10 2 10 Freq (rad/sec) 10 3 10 Bode Diagrams 1 10 Loop L Gm=−0.90042 dB (at 24.221 rad/sec), Pm=6.6704 deg. (at 35.813 rad/sec) 50 0 Mag 10 0 −1 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 0 Phase (deg) −50 Phase (deg); Magnitude (dB) 10 −50 −100 −150 −200 −100 −250 −150 −300 −200 −250 −350 0 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 1 2 10 10 3 10 Frequency (rad/sec) 3 10 16.31 17—18 Fall 2001 Figure 10: Example #3: G(s) = 8·14·20 (s−8)(s−14)(s−20) 100 80 60 40 Imag Axis 20 0 −20 −40 −60 −80 −100 −140 −120 −100 −80 −60 −40 Real Axis −20 0 20 40 60 25 20 15 10 Imag Axis 5 0 −5 −10 −15 −20 −25 −25 −20 −15 −10 −5 0 Real Axis 5 10 15 20 25 3 — closed-loop poles, 5 — open-loop poles, 2 — Compensator poles, ◦ — Compensator zeros Fall 2001 16.31 17—19 • Compensator zeros at 3.72±8.03j draw the two higher frequency plant poles further into the LHP. Lowest frequency one heads into the LHP on its own. • Compensator poles are at much higher frequency. • Note sure what this looks like. 16.31 17—20 Fall 2001 Figure 11: Example #4: G(s) = 1 (s−1) (s+1)(s−3) 2 10 10 Plant G Compensator Gc Plant G closed−loop Gcl 0 Mag 10 1 10 −1 10 −2 −1 10 0 10 1 10 Freq (rad/sec) 2 3 10 10 Mag 10 0 10 50 Plant G Compensator Gc Phase (deg) 0 −1 −50 10 −100 −150 −200 −1 10 −2 0 10 1 10 Freq (rad/sec) 2 10 3 10 10 −1 0 10 1 10 10 Freq (rad/sec) 2 3 10 10 Bode Diagrams 1 10 Loop L Gm=−3.3976 dB (at 4.5695 rad/sec), Pm=−22.448 deg. (at 1.4064 rad/sec) 20 0 10 Mag 0 −20 −1 −2 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 3 10 0 Phase (deg) −50 Phase (deg); Magnitude (dB) 10 −40 −60 −80 220 210 200 190 −100 180 −150 170 −200 160 150 −250 140 −1 10 −1 10 0 10 1 10 Freq (rad/sec) 2 10 0 10 1 10 3 10 Frequency (rad/sec) 2 10 3 10 16.31 17—21 Fall 2001 Figure 12: Example #4: G(s) = (s−1) (s+1)(s−3) 40 30 20 Imag Axis 10 0 −10 −20 −30 −40 −40 −30 −20 −10 Real Axis 0 10 20 10 8 6 4 Imag Axis 2 0 −2 −4 −6 −8 −10 −10 −8 −6 −4 −2 0 Real Axis 2 4 6 8 10 3 — closed-loop poles, 5 — open-loop poles, 2 — Compensator poles, ◦ — Compensator zeros Fall 2001 16.31 17—22 • Compensator zero at -1 cancels the plant pole. Note the very unstable compensator pole at s = 9!! — Needed to get the RHP plant pole to branch off the real line and head into the LHP. • Other compensator pole is at much higher frequency. • Note sure what this looks like. • Separation principle gives a very powerful and simple way to develop a dynamic output feedback controller • Note that the designer now focuses on selecting the appropriate regulator and estimator pole locations. Once those are set, the closed-loop response is specified. — Can almost consider the compensator to be a by-product. • These examples show that the design process is extremely simple.