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. 1 Fall 2001 16.31 17—1 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)=A?x(t)+Bu(t)+L(y ? ?y) ?y(t)=C?x(t) Then we have that the closed-loop system dynamics are given by: ˙x(t)=Ax(t)+Bu(t) ˙ ?x(t)=A?x(t)+Bu(t)+L(y ? ?y) y(t)=Cx(t) ?y(t)=C?x(t) u = ?K?x Which can be compactly written as: ? ˙x ˙ ?x ? = ? A ?BK LC A?BK?LC ?? x ?x ? ? ˙x cl = A cl x cl This does not look too good at this point — not even obvious that the closed-system is stable. λ i (A cl )=?? Fall 2001 16.31 17—2 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 cl , ? x ?x ? = ? I 0 I ?I ?? x ?x ? = Tx cl — Note that T = T ?1 Now rewrite the system dynamics in terms of the state ?x cl A cl ? TA cl T ?1 , ˉ A cl — Note that similarity transformations preserve the eigenvalues, so we are guaranteed that λ i (A cl ) ≡ λ i ( ˉ A cl ) Work through the math: ˉ A cl = ? I 0 I ?I ?? A ?BK LC A?BK?LC ?? I 0 I ?I ? = ? A ?BK A?LC ?A + LC ?? I 0 I ?I ? = ? A?BK BK 0 A?LC ? Because ˉ A cl is block upper triangular, we know that the closed-loop poles of the system are given by det(sI ? ˉ A cl ) , det(sI ?(A?BK))·det(sI ?(A?LC)) = 0 Fall 2001 16.31 17—3 Observation: The closed-loop poles for this system con- sistoftheunion oftheregulator poles andestimator poles. So we can just design the estimator/regulatorseparatelyand com- bine them at the end. — Called the Separation Principle. — Just keepin 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 ambi- guity 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!!! Fall 2001 16.31 17—4 The Compensator Dynamic Output Feedback Compensator is the combina- tion of the regulator and estimator using u = ?K?x ˙ ?x(t)=A?x(t)+Bu(t)+L(y ? ?y) = A?x(t)?BK?x + L(y ?C?x) ? ˙ ?x(t)=(A?BK?LC)?x(t)+Ly u = ?K?x Rewrite with new state x c ≡ ?x ˙x c = A c x c + B c y u = ?C c x c where the compensator dynamics are given by: A c , A?BK?LC , B c , L, C c , K — Note that the compensator maps sensor measurements to ac- tuator 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)=?? Fall 2001 16.31 17—5 For consistency in the implementation with the classical approaches, define the compensator transfer function so that u = ?G c (s)y — From the state-space model of the compensator: U(s) Y (s) , ?G c (s) = ?C c (sI ?A c ) ?1 B c = ?K(sI ?(A?BK?LC)) ?1 L ? G c (s)=C c (sI?A c ) ?1 B c Note that it is often very easy to provide classical interpretations (such as lead/lag) for the compensator G c (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) G c (s) G(s) - - 6 — re yu ? u = G c (s)e = G c (s)(r?y) — So we still have u = ?G c (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. Fall 2001 16.31 17—6 Mechanics Basics: e = r?y, u = G c e, y = Gu G c (s): ˙x c = A c x c + B c e, u= C c x c G(s): ˙x = Ax + Bu , y = Cx Loop dynamics L = G c (s)G(s) ? y = L(s)e ˙x = Ax +BC c x c ˙x c =+A c x c +B c e L(s) ? ˙x ˙x c ? = ? ABC c 0 A c ?? x x c ? + ? 0 B c ? e y = £ C 0 ¤ ? x x c ? To “close the loop”, note that e = r?y,then ? ˙x ˙x c ? = ? ABC c 0 A c ?? x x c ? + ? 0 B c ?μ r? £ C 0 ¤ ? x x c ?? = ? ABC c ?B c CA c ?? x x c ? + ? 0 B c ? r y = £ C 0 ¤ ? x x c ? — A cl is not exactly the same as on page 17-1 because we have re- arranged where the negative sign enters into the problem. Same result though. Fall 2001 16.31 17—7 Simple Example Let G(s)=1/s 2 with state-space model given by: A = ? 01 00 ? ,B= ? 0 1 ? ,C= £ 10 ¤ ,D=0 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 — Userealpoles,soΦ e (s)=(s + 10) 2 L = Φ e (A) ? C CA ? ?1 ? 0 1 ? = ? ? 01 00 ? 2 +20 ? 01 00 ? + ? 100 0 0 100 ? ! ? 10 01 ? ?1 ? 0 1 ? = ? 100 20 0 100 ?? 0 1 ? = ? 20 100 ? Fall 2001 16.31 17—8 Compensator: A c = A?BK?LC = ? 01 00 ? ? ? 0 1 ? £ 32 8 ¤ ? ? 20 100 ? £ 10 ¤ = ? ?20 1 ?132 ?8 ? B c = L = ? 20 100 ? C c = K = £ 32 8 ¤ Compensator transfer function: G c (s)=C c (sI ?A c ) ?1 B c , U E = 1440 s +2.222 s 2 +28s + 292 Note that the compensator has a low frequency real zero and two higher frequency poles. — Thus it looks like a “lead” compensator. Fall 2001 16.31 17—9 10 ?1 10 0 10 1 10 2 10 3 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 ?200 ?150 ?100 ?50 0 50 Freq (rad/sec) Phase (deg) Plant G Compensator Gc Figure 1: Plant is pretty simple and the compensator looks like a lead 2—10 rads/sec. 10 ?1 10 0 10 1 10 2 10 3 10 0 10 1 10 2 Freq (rad/sec) Mag Loop L 10 ?1 10 0 10 1 10 2 10 3 ?280 ?260 ?240 ?220 ?200 ?180 ?160 ?140 ?120 Freq (rad/sec) Phase (deg) 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. Fall 2001 16.31 17—10 ?15 ?10 ?5 0 5 ?15 ?10 ?5 0 5 10 15 Real Axis Imag Axis 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.) 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G closed?loop Gcl Figure 4: Closed-loop transfer function. Fall 2001 16.31 17—11 Figure 5: Example #1: G(s)= 8·14·20 (s+8)(s+14)(s+20) 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 ?200 ?150 ?100 ?50 0 50 Freq (rad/sec) Phase (deg) Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G closed?loop Gcl 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Loop L 10 ?1 10 0 10 1 10 2 10 3 ?250 ?200 ?150 ?100 ?50 0 Freq (rad/sec) Phase (deg) Frequency (rad/sec) Phase (deg); Magnitude (dB) Bode Diagrams ?150 ?100 ?50 0 50 Gm=10.978 dB (at 40.456 rad/sec), Pm=69.724 deg. (at 15.063 rad/sec) 10 0 10 1 10 2 10 3 ?400 ?350 ?300 ?250 ?200 ?150 ?100 ?50 0 Fall 2001 16.31 17—12 Figure 6: Example #1: G(s)= 8·14·20 (s+8)(s+14)(s+20) ?80 ?70 ?60 ?50 ?40 ?30 ?20 ?10 0 10 20 ?50 ?40 ?30 ?20 ?10 0 10 20 30 40 50 Real Axis Imag Axis ?50 ?45 ?40 ?35 ?30 ?25 ?20 ?15 ?10 ?5 0 ?25 ?20 ?15 ?10 ?5 0 5 10 15 20 25 Real Axis Imag Axis 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 fre- quency plant poles further into the LHP. Compensator poles are at much higher frequency. Looks like a lead compensator. Fall 2001 16.31 17—14 Figure 7: Example #2: G(s)= 0.94 s 2 ?0.0297 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 ?200 ?150 ?100 ?50 0 50 Freq (rad/sec) Phase (deg) Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G closed?loop Gcl 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Loop L 10 ?1 10 0 10 1 10 2 10 3 ?250 ?200 ?150 ?100 ?50 0 Freq (rad/sec) Phase (deg) Frequency (rad/sec) Phase (deg); Magnitude (dB) Bode Diagrams ?100 ?50 0 50 Gm=11.784 dB (at 7.4093 rad/sec), Pm=36.595 deg. (at 2.7612 rad/sec) 10 ?2 10 ?1 10 0 10 1 10 2 ?300 ?250 ?200 ?150 ?100 Fall 2001 16.31 17—15 Figure 8: Example #2: G(s)= 0.94 s 2 ?0.0297 ?8 ?6 ?4 ?2 0 2 ?6 ?4 ?2 0 2 4 6 Real Axis Imag Axis ?2 ?1.5 ?1 ?0.5 0 0.5 1 1.5 2 ?2 ?1.5 ?1 ?0.5 0 0.5 1 1.5 2 Real Axis Imag Axis 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. Fall 2001 16.31 17—17 Figure 9: Example #3: G(s)= 8·14·20 (s?8)(s?14)(s?20) 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 ?200 ?150 ?100 ?50 0 50 Freq (rad/sec) Phase (deg) Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G closed?loop Gcl 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Loop L 10 ?1 10 0 10 1 10 2 10 3 ?250 ?200 ?150 ?100 ?50 0 Freq (rad/sec) Phase (deg) Frequency (rad/sec) Phase (deg); Magnitude (dB) Bode Diagrams ?100 ?50 0 50 Gm=?0.90042 dB (at 24.221 rad/sec), Pm=6.6704 deg. (at 35.813 rad/sec) 10 0 10 1 10 2 10 3 ?350 ?300 ?250 ?200 ?150 Fall 2001 16.31 17—18 Figure 10: Example #3: G(s)= 8·14·20 (s?8)(s?14)(s?20) ?140 ?120 ?100 ?80 ?60 ?40 ?20 0 20 40 60 ?100 ?80 ?60 ?40 ?20 0 20 40 60 80 100 Real Axis Imag Axis ?25 ?20 ?15 ?10 ?5 0 5 10 15 20 25 ?25 ?20 ?15 ?10 ?5 0 5 10 15 20 25 Real Axis Imag Axis 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. Fall 2001 16.31 17—20 Figure 11: Example #4: G(s)= (s?1) (s+1)(s?3) 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 ?200 ?150 ?100 ?50 0 50 Freq (rad/sec) Phase (deg) Plant G Compensator Gc 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 10 2 Freq (rad/sec) Mag Plant G closed?loop Gcl 10 ?1 10 0 10 1 10 2 10 3 10 ?2 10 ?1 10 0 10 1 Freq (rad/sec) Mag Loop L 10 ?1 10 0 10 1 10 2 10 3 ?250 ?200 ?150 ?100 ?50 0 Freq (rad/sec) Phase (deg) Frequency (rad/sec) Phase (deg); Magnitude (dB) Bode Diagrams ?80 ?60 ?40 ?20 0 20 Gm=?3.3976 dB (at 4.5695 rad/sec), Pm=?22.448 deg. (at 1.4064 rad/sec) 10 ?1 10 0 10 1 10 2 10 3 140 150 160 170 180 190 200 210 220 Fall 2001 16.31 17—21 Figure 12: Example #4: G(s)= (s?1) (s+1)(s?3) ?40 ?30 ?20 ?10 0 10 20 ?40 ?30 ?20 ?10 0 10 20 30 40 Real Axis Imag Axis ?10 ?8 ?6 ?4 ?2 0 2 4 6 8 10 ?10 ?8 ?6 ?4 ?2 0 2 4 6 8 10 Real Axis Imag Axis 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 un- stable compensator pole at s =9!! — Needed to get the RHP plant pole to branch o? thereallineand 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. — Canalmostconsiderthecompensatortobeaby-product. These examples show that the design process is extremely simple.