Tracking and Disturbance Rejection • Reference tracking by full-information and output-feedback • A substantial generalization: The regulation problem • The regulator equation • Disturbance estimators • Regulation by full-information and output-feedback • Extension to general signal models • The general regulator theory • Detailed discussion of motor example Related Reading [KK]: 7.4 [AM]: 3 (examples), 6.4 1/79 Tracking So far we have concentrated on (asymptotically) steering the state of a system to an equilibrium, possibly in an optimal fashion according to an integral quadratic cost criterion. In practice it is often required to steer some output of the system to a specific location as desired by a “user”. Examples: • Pilot: Moving the joystick forward in order to let aircraft tilt forward to the specified angle. • Car driver: Pushing the gas-pedal to a certain position such that the car drives with a desired speed. • Manufacturing: Letting a welding robot follow a path on a car body. Abstract Task: Design a controller such that a specified system output z follows an external reference signal r as well as possible. 2/79 The Classical Tracking Configuration Consider the following system H, also called to-be-controlled plant: u H z Suppose that z should follow the external reference signal r. Idea: • Compute the error signal e = r − z. If e = 0 no action is required. • If e 6= 0 then generate a control signal u to drive e back to zero. • This should be achieved with an error feedback controller u = Ke. The error signal e is the information available to the controller. The controlled system can clearly be depicted as r + − e K u H z 3/79 Example: Water Heater With input voltage u, water temperature T and surrounding temperature S as well as the thermal capacitance C > 0 of water and the thermal resistance R > 0 of the wall, a simple model is C Ṫ + R1 (T − S) = αu. For some nominal temperature value S0 of S (such as 20 degrees Celsius) set x = T − S0 and d = S − S0 . This leads to the system ẋ = −ax + bu + bd d. with positive constants a, b, bd . We intend to control x which motivates to introduce the following output: z = cx with c = 1. Let us emphasize the following interpretations: • u is the control input variable manipulated by the controller. • d is a disturbance input that cannot be influenced by control. • z is the to-be-controlled signal/output/variable. 4/79 Example: Water Heater Let us consider the situation that d = 0. We then get ẋ = −ax + bu, z = cx. The simplest error feedback controller is defined by a constant gain: u = k(r − z). The controlled system clearly is ẋ = −(a + bkc)x + bkr, z = cx. Obvious facts: • k stabilize the system iff k > −a/(bc). • If r = r0 is a constant reference value, the output converges to cbk z0 = r0 . a + bkc We have z0 = r0 iff cbk/(a + bkc) = 1. This cannot be achieved! 5/79 Example: Water Heater Remedy 1: High-gain feedback If we let k grow large, the steady-state error a |r0 | can be rendered small. |r0 − z0 | = a + bkc We cannot obtain exact asymptotic tracking. But still we achieve + stabilization and approximate tracking + both properties are robust: essentially independent of values of a, b, c However, this comes along with disadvantages: − large errors lead to large control actions − small tracking errors require high-gain − high-gains could destabilize more complicated systems Good design framework: H∞ -synthesis (Robust Control) 6/79 High-Gain Feedback: C = 1, R = 10, α = 1 temperature temperature Step responses from reference r to z and u: 0.8 0.6 0.4 0.2 0 k=1 k=2 k=5 k = 10 k = 20 0 0.5 1 1.5 time 2 2.5 3 10 8 6 4 2 0 0.1 0.2 0.3 0.4 0.5 0.6 time 0.7 0.8 0.9 1 7/79 Example: Water Heater Ingenious remedy 2: Incorporate integral action Proportional integral (PI) controller with gains kp and ki : Z t u(t) = kp e(t) + ki e(τ ) dτ with e(t) = r(t) − z(t). 0 A state-space description is ẋK = 0xK + 1(r − z), u = ki xK + kp (r − z), xK (0) = 0. The controlled system reads as ẋ −a − bkp c bki x bkp = + r ẋK −c 0 xK 1 x z = c 0 xK If kp and ki render the controlled system asymptotically stable then the PI controller achieves exact tracking. 8/79 PI Control: C = 1, R = 10, α = 1 temperature Step responses from reference r to z and u for ki = 1: 1 0.5 0 temperature k=1 k=2 k=5 k = 10 k = 20 0 0.5 1 1.5 time 2 2.5 3 10 8 6 4 2 0 0.1 0.2 0.3 0.4 0.5 0.6 time 0.7 0.8 0.9 1 9/79 Example: Water Heater Remedy 3: Assume that both z and r are available for control We stress that, in practice, this might or might not be possible! A two-degrees of freedom controller with a static feedback gain kp and a static feedforward-gain kf is defined as u = kp (r − z) + kf r. Design strategy: • Choose kp such that u = kp (r − z) stabilizes the system. • Adjust kf such that the steady-state gain of the system is 1. Questions: • Under which conditions on the system is this strategy applicable? • How can we generalize to multivariable systems of higher order? 10/79 Example: Water Heater With u = kp (r − z) + kf r the controlled system clearly is ẋ = −(a + bkp c)x + bkp kf r, z = cx. Design: • Choose and kp 6= 0 such that −(a + bkp c) < 0. • Then the steady state-response of z for the controlled system and with constant r is given by cbkp z= kf r. a + bkp c Since cb 6= 0 we can take kf for which the steady-state gain is 1. The choice of kf depends on the system parameters. If the controller is implemented on a system with different values of a, b, c, then kf will most probably not be the correct feed-forward gain to achieve tracking. 11/79 2-DOF Design: C = 1, R = 10, α = 1 temperature temperature Step responses from reference r to z and u for ki = 1: 1 0.8 0.6 0.4 0.2 0 k=1 k=2 k=5 k = 10 k = 20 0 0.5 1 1.5 time 2 2.5 3 10 8 6 4 2 0 0.1 0.2 0.3 0.4 0.5 0.6 time 0.7 0.8 0.9 1 12/79 The Tracking Problem Let us hence consider a system ẋ = Ax + Bu y = Cx + Du z = Cz x + Dz u with a measurement output y which is available for control, and some to-be-controlled output z which should track the reference. Note that z can - but must not - be a copy of y (C = Cz and D = Dz )! Goal: Design a controller which stabilizes the system and for which z asymptotically tracks all constant reference signals r: lim [r − z(t)] = 0. t→∞ In order to be able to stabilize the system we assume from now on that (A, B) is stabilizable and (A, C) is detectable. 13/79 Block Diagram and Controller Structure The uncontrolled system can be depicted as u z H y We need to specify a controller structure with which the goal should be achieved. We opt for a general two-degrees of freedom controller r uK K yK The controlled system is obtained with u = yK and uK = y as r K u z H y 14/79 Tracking by Full-Information Feedback We start with the assumption y = x (which amounts to C = I, D = 0). A linear static full-information controller is described by x u = −F x + Gr = F G r with to-be-chosen gain matrices F and G. How should they be designed? The controlled system is described as ẋ = (A − BF )x + BGr, z = (Cz − Dz F )x + Dz Gr. Since the system should be stabilized, we choose F such that A − BF is Hurwitz. Then the steady-state response for constant r is z = [Dz − (Cz − Dz F )(A − BF )−1 B]Gr. For asymptotic tracking we would like to guarantee that z = r for all possible constant reference inputs r. This requires to take G with [Dz − (Cz − Dz F )(A − BF )−1 B]G = I. (?) 15/79 Motor Example Let us consider the normalized model of a DC-motor ([F] p.20) with the applied voltage and the shaft-angle as its input and output: 0 1 0 φ ẋ = x+ u, y = z = 1 0 x, x = . 0 −1 1 ω With a state-feedback gain F satisfying eig(A − BF ) = {−2 ± i}, the feedforward gain is G = 5. Simulated responses (φ(0) = −1, ω(0) = 0): Control action 10 0 −10 0 2 4 6 Reference (red) and output 8 10 8 10 2 0 −2 0 2 4 6 16/79 Tracking by Output-Feedback If x is not measurable (y 6= x), we can choose L such that A − LC is Hurwitz and design the observer x̂˙ = Ax̂ + Bu + L(y − ŷ), ŷ = C x̂ + Du in order to asymptotically reconstruct the state. Then the separation principle motivates to control the system - with the gains F and G designed for full-information feedback - as u = −F x̂ + Gr. The constructed output-feedback controller (based on the measured signals r and y) stabilizes the system and achieves tracking. We conclude that the separation principle holds: We can combine a full-information controller with an observer to obtain an output-feedback controller that achieves the desired task. 17/79 Proof The dynamics of the estimation error x̃ = x − x̂ are described by x̃˙ = ẋ − x̂˙ = Ax + Bu − Ax̂ − Bu − L(y − ŷ) = (A − LC)x̃. Since u = −F x+F x̃+Gr, the controlled system admits the description ẋ A − BF BF x BG = + r, 0 A − LC x̃ 0 x̃˙ x z = Cz − Dz F Dz F + Dz Gr. x̃ Since A − BF and A − LC are Hurwitz, the closed-loop system is asymptotically stable. Then note that the reference input does not drive the estimation error dynamics! Therefore the steady-state value of the output z is, as for full-information feedback, still simply given by [Dz − (Cz − Dz F )(A − BF )−1 B]Gr. Due to the choice of G this indeed equals r. 18/79 Motor Example Placing the error dynamics eigenvalues at −8 ± 4i leads to the following response for output-feedback control: Control action (fi: blue, of: green) 20 0 −20 0 2 4 6 8 Reference (red) and output (fi: blue, of: green) 10 2 0 −2 0 2 4 6 8 10 19/79 Employed Implementations Full-information control: r + G u − ẋ = Ax + Bu z = Cz x + D z u y=x z x F Output-Feedback Control: r + G − u ẋ = Ax + Bu z = Cz x + D z u y = Cx + Du z y x̂˙ = (A−LC)x̂+(B −LD)u+Ly v = F x̂ 20/79 My Matlab Code A=[0 1;0 -1];B=[0;1];Ch=[1 0];Dh=0;C=Ch;;D=Dh;x0=[-1;0]; p=[-2+i;-2-i];F=place(A,B,p);G=1/(Dh-(Ch-Dh*F)*inv(A-B*F)*B); L=place(A’,C’,4*p)’; %observer: inputs u,y ob=ss(A-L*C,[B-L*D L],F,0);xc0=[0;0]; %system for simulation: inputs r,u outputs u,z,r,u,y z=[0 0];sy=ss(A,[z’ B],[z;Ch;[z;z];C],[0 1;0 Dh;eye(2);0 D]); %controller: inputs r u y co=[G -ob];cl=lft(sy,co); %nice command for closing loops! t=linspace(0,10,1e3)’;r=square(t);[y,to]=lsim(cl,r,t,[x0;xc0]); figure(1);np=2;subplot(np,1,1);plot(to,y(:,1));grid on; title(’Control action’) subplot(np,1,2);plot(to,y(:,2),t,r,’r’);grid on; title(’Reference (red) and output’); 21/79 Some Reflections We obtained a recipe for designing tracking controllers. However, we have not yet gotten any insights under which conditions the procedure is successful at all. Questions to be discussed in the upcoming regulator theory: • What are the precise conditions for the existence of G? Is it depending on the choice of F whether we can construct G? • Is it possible to design tracking controllers even if r is not measurable? For example, one can often only measure the tracking error y = z −r. • In addition to tracking, can we also reject disturbances? • Can one track other than constant signals? Interesting practical cases are ramps or sinusoidal signals of a specified frequency. 22/79 Solvability Condition Note that equation (?) can be re-written with Π = −(A − BF )−1 BG as (Cz − Dz F )Π + Dz G = I. Hence (A − BF )Π + BG = 0 and (Cz − Dz F )Π + Dz G = I which is easily re-arranged to AΠ + B(G − F Π) = 0 and Cz Π + Dz (G − F Π) − I = 0. With Γ = G − F Π we finally arrive at the so-called regulator equation A B Π 0 + = 0. Cz Dz Γ −I The existence of a solution to this equation is the precise condition for the existence of a tracking controller! We already proved necessity. If Π and Γ are solutions and F renders A−BF Hurwitz, set G = Γ+F Π and reverse the arguments to obtain (?) (which proves sufficiency). 23/79 Example: Water Heater The tracking controller on slide 12 was designed without taking a possible deviation of d from zero into account. Let’s see what happens if the room temperature is not equal to S0 such that d 6= 0. The controlled system then reads as ẋ = −(a + bkp c)x + bkp kf r + bd d, z = cx. If a + bkp c > 0, the steady-state response for constant r, d is z=r+ cbd d. a + bkp c Clearly a nonzero disturbance d spoils the tracking behavior. Questions: • Can we design a controller that achieves tracking irrespective of d? • If not, does it help if buying a sensor in order to measure d? 24/79 A Leap Forward: The Regulation Problem Let us now substantially generalize the discussed scenario. Consider ẋ = Ax + Bu + Bd d y = Cx + Du + Dd d e = Ce x + De u + Ded d. This so-called generalized plant has some control input u and a measurement output y. Moreover it is affected by a generalized disturbance d and specifies a performance output e. Regulation Problem: Design a feedback controller ẋK = AK xK + BK y, u = CK xK which stabilizes the controlled system and which achieves regulation for constant generalized disturbances d: lim e(t) = 0. t→∞ We also say that d is asymptotically rejected from e or suppressed at e. 25/79 Block Diagram and Controller Structure The uncontrolled system can be depicted as d e P u y The intention is to design a feedback controller yK K uK The controlled system is obtained with u = yK and uK = y as d e P u y K 26/79 Special Problem 1: Reference Tracking The reference tracking problem as on slide 13 for the system ẋ = Ax + Bu, ỹ = C̃x + D̃u, z = Cz x + Dz u (System) is subsumed to the regulation problem for the generalized plant ẋ = Ax + Bu + 0d 0 C̃ D̃ y = x+ u+ d I 0 0 e = Cz x + Dz u + (−I)d. Here d admits the interpretation as a reference signal. Observe that • d does not directly affect the plant’s state. • The measurement output is a stacking of C̃x + D̃u and d. It could as well consist of other linear combinations of these signals. • The performance output e is the tracking error Cz x+Dz u−d. Clearly Cz x + Dz u asymptotically tracks d iff e(t) → 0 for t → ∞. 27/79 Special Problem 2: Disturbance Rejection The input d is called generalized disturbance since it can consist of known components (such as reference signals) and “real” disturbances that are caused by unknown sources (such as measurement noise). Then Bd , Dd , Ded determine how the disturbance affects the state, the measurement output and the performance output. Some terminology: • Bd d is often called the “process disturbance”. • Dd d is the so-called “measurement noise”. • Ded d is a “load disturbance”. Different choices of these matrices offer a high modeling flexibility. For example, if only modeling “measurement noise” one would choose Bd = 0, Ded = 0 and take the components of Dd 6= 0 as weights to describe how much each component of y is affected by the noise d. 28/79 SP 3: Reference Tracking with Measurement Noise If linear, the controller on slide 14 can be written as r r yK = K = Kff Kfb = Kff r + Kfb uK . uK uK The controlled system (uK = ỹ and u = yK ) can be depicted as r Kff + u z System ỹ Kfb If ỹ is corrupted by measurement noise we get r Kff + u z System ỹ Kfb + dỹ 29/79 Reference Tracking and Disturbance Rejection The generalized plant for the configuration on slide 29 with (System) is clearly given by ẋ = Ax + Bu, I 0 dỹ C̃ D̃ y = x+ u+ 0 I r 0 0 dỹ e = Cz x + Dz u + 0 −I r The measurement output consists of C̃x + D̃u + Idỹ and r, while the generalized disturbance has the components dỹ and r. In conclusion, if we can solve the regulation problem on slide 25, we actually provide a solution to a whole variety of in itself relevant more special control problems (as in the examples). Seemingly different design problems are handled in a unified framework. 30/79 Summary on Setup • d is called generalized disturbance since it can include both userspecified as well as unknown externals signals that are not influenced by control. • y encompasses those signals that are available to the controller for processing. y can contain components of d in case that these are available for control. • The generalized plant P on slide 26 encodes information about the to-be-controlled system and its relation to the desired controller and system-controller interconnection structure. • Although K on 26 is (formally) a feedback controller, it can consist of both feedback- and feed-forward components. • Slide 26 depicts a generic abstract design framework that covers a lot of (and many more than mentioned) interconnection structures. 31/79 Main Result: Nominal Regulation It’s a beautiful coincidence that, despite this substantially higher level of generality, the previous solution approach extends without much effort. Theorem 1 Let (A, B) be stabilizable and the regulator equation A B Π Bd + =0 (R0) Ce De Γ Ded have a solution. Then there exist static gains F , G such that the fullinformation controller u = −F x+Gd solves the regulation problem. Solvability of the regulator equation is also a necessary condition! The gains are designed as follows: • Choose any F such that A − BF is Hurwitz. • If Γ and Π are solutions of the regulator equations then set G := Γ + F Π. 32/79 Alternative Proof for Full-Information Feedback The controlled system is ẋ = (A − BF )x + BGd + Bd d, e = (Ce − De F )x + De Gd + Ded d. Asymptotic stability: If d = 0 then lim x(t) = 0 for any x(0). t→∞ To show regulation let us perform the transformation ξ = x − Πd. Due to d˙ = 0 and x = ξ + Πd the closed-loop system admits the description ξ˙ = (A − BF )ξ + [(A − BF )Π + BG + Bd ] d = (A − BF )ξ, | {z } AΠ+BΓ+Bd =0 e = (Ce − De F )ξ + [(Ce − De F )Π + De G + De d] d = (Ce − De F )ξ. | {z } Ce Π+De Γ+Ded =0 Regulation: lim e(t) = 0 for any constant disturbance d and x(0). t→∞ 33/79 Motor Example Let the motor on slide 16 be affected by a torque disturbance: 0 1 0 0 ẋ = x+ u+ d, y = e = 1 0 x. 0 −1 1 1 A full information controller u = −F x + Gd acts as follows: Disturbance 4 2 0 0 2 4 6 8 10 8 10 8 10 Control 5 0 −5 0 2 4 6 Regulated Output 0.2 0 −0.2 0 2 4 6 However this controller cannot be implemented - only y is measurable. 34/79 Main Result: Nominal Regulation Theorem 2 Let (A, B) be stabilizable and (A, C) be detectable. Moreover suppose that A Bd has full column rank (D) C Dd and that the regulator equation (R0) is solvable. Then the regulation problem by output-feedback has a solution. Stabilizability of (A, B) and detectability of (A, C) are required for constructing stabilizing controllers. The role of (D) will become clear in the constructive proof with an algorithm for controller design. Note that the to-be-solved regulator equations are identical for fullinformation and output-feedback control. For special configurations the hypothesis are often seen to be always satisfied or they admit nice system theoretic interpretations. 35/79 Disturbance Estimators Since we are only allowed to use y for control, we try to exploit the separation principle for designing an output-feedback regulator. This requires to design an observer that asymptotically reconstructs both the system state x and the disturbance signal d from y. For this purpose we include the model for the considered class of disturbances d˙ = 0 in the system dynamics. If neglecting e we get the extended system ẋ x B A Bd + u, = d 0 0 0 d˙ | {z } | {z } AE BE x + Du. y = C Dd | {z } d CE The desired observer exists if this extended system is detectable. Lemma 3 (AE , CE ) is detectable if (A, C) is and if (D) holds. 36/79 Proof By the Hautus-test we need to check whether A − λI Bd 0 −λI has full column rank if Re(λ) ≥ 0. C Dd Since (A, C) is detectable, the matrix has full column rank for all λ 6= 0 with Re(λ) ≥ 0. For λ = 0 it is required A 0 C that Bd 0 has full column rank, Dd which is assured by (D). Note that detectability of (AE , CE ) also implies that (A, C) is detectable and that (D) holds. 37/79 Motor Example Let us design a state- and disturbance estimator for the model on slide 34. The detectability hypothesis is satisfied. A pole-placing observer for the extended system with eigenvalues {−5, −6, −7} leads to State φ (blue) and estimate (red) 50 0 −50 0 5 0 −5 0 5 0 −5 0 5 10 15 State ω (blue) and estimate (red) 20 5 10 15 Disturbance (blue) and estimate (red) 20 5 10 15 20 38/79 Output Feedback Control As motivated on slide 36 we design a regulator as follows: Check whether A Bd • (A, B) is stabilizable and , C Dd is detectable; 0 0 A B Π Bd • the regulator equation + = 0 is solvable. Ce De Γ Ded If the answers are yes then choose A Bd • F , L such that A − BF , −L C Dd are Hurwitz; 0 0 • G = Γ + F Π where Π, Γ satisfy the regulator equation. Then the following controller solves the regulation problem: ! x̂˙ x̂ A Bd B + u + L(y − ŷ), ˙ˆ = 0 0 ˆ 0 d d x̂ x̂ u = −F G , ŷ = C Dd + Du. dˆ dˆ 39/79 Proof: Output Feedback Control If we merge d˙ = 0 with the system dynamics we get the extended system ẋ x A Bd B u, = + ˙ d 0 0 0 d | {z } | {z } | {z } AE BE xE x y = C Dd + Du, | {z } d CE x e = Ce Ded + De u. | {z } d CeE The constructed observer-based controller can then be written as x̂˙ E = AE x̂E + BE u + L(y − ŷ), ŷ = CE x̂E + Du, u = −FE x̂E where we made use of the abbreviations x̂ x̂E = and FE = dˆ F −G . It is now routine to compute the closed-loop dynamics. 40/79 Proof: Output Feedback Control With the states xE and x̃E = xE − x̂E they are described by xE ẋE AE −BE FE BE FE xE = , e = CeE −De FE De FE . 0 AE −LCE x̃E x̃E x̃˙ E Note that ẋE = ... and e = ... read more explicitly as ẋ = (A − BF )x + (Bd + BG)d + BFE x̃E , d˙ = 0, (sub) e = (Ce − De F )x + (Ded + De G)d + De FE x̃E . We can hence extract the closed-loop interconnection of the original system and our controller by just canceling d˙ = 0. This leads to ẋ A − BF BFE x Bd + BG = + d, 0 AE − LCE x̃E 0 x̃˙ E x e = Ce − De F De FE + (Ded + De G)d. x̃E Let’s now check that the controller does the job. 41/79 Proof: Output Feedback Control Asymptotic stability: Suppose d = 0. Since A − BF and AE − LCE are Hurwitz, we infer for arbitrary x(0) and x̃E (0) that lim x(t) = 0 and lim x̃E (t) = 0. t→∞ t→∞ Regulation: Suppose that d is an arbitrary constant disturbance signal. Since x̃˙ E = (AE − LCE )x̃E we then still infer that lim x̃E (t) = 0. t→∞ Hence the controller acts as a state and disturbance estimator in closedloop (which is practically relevant for diagnosis purposes)! Finally note that e in (sub) is e1 + e2 where e1 is the output for x̃E = 0 and e2 is ż = (A − BF )z + BFE x̃E , e2 = (Ce − De F )z + De FE x̃E , z(0) = 0. Due to the full-information arguments, e1 (t) → 0 for t → ∞. Since z(t) → 0 (Lemma 4) and thus e2 (t) → 0 we infer e(t) → 0 for t → ∞. 42/79 Proof: Output Feedback Control Lemma 4 Let A be Hurwitz and suppose that limt→∞ v(t) = 0. Then all solutions of ẋ = Ax + v satisfy limt→∞ x(t) = 0. 43/79 Motor Example Let us design an output-feedback controller for the motor example on slide 38 that rejects the torque disturbance from e = φ. All hypothesis are satisfied. A regulating controller leads to the following results: Disturbance 4 2 0 0 5 10 Control 15 20 5 10 Regulated Output 15 20 5 10 15 20 5 0 −5 0 0.5 0 −0.5 0 44/79 Motor Example Suppose that, in addition to disturbance rejection, φ should as well track a reference signal. This can be subsumed to our problem and, still, all hypothesis are satisfied. We obtain the following simulation results: Disturbance and Reference (red) 5 0 −5 0 5 10 15 20 25 5 10 15 Tracked Output 20 25 5 10 20 25 Control 10 0 −10 0 2 0 −2 0 15 45/79 My Matlab Code A=[0 1;0 -1];B=[0;1];Bd=[0 0;1 0]; Ch=[1 0];Dh=0;Dhd=[0 -1]; C=[1 0;0 0];D=[0;0];Dd=[0 0;0 1]; X=-inv([A B;Ch Dh])*[Bd;Dhd];Pi=X(1:2,:);Ga=X(3:end,:); p=[-2+i;-2-i];F=place(A,B,p);G=Ga+F*Pi; Ae=[A Bd;zeros(2,4)];Be=[B;zeros(2,1)];Ce=[C Dd];Fe=[F -G]; L=place(Ae’,Ce’,[-10 -11 -12 -13])’; z=[0 0];sys=ss(A,[Bd B],[Ch;z;C],[z Dh;z 1;Dd D]); co=ss(Ae-L*Ce-Be*Fe+L*D*Fe,L,Fe,0); cl=lft(sys,-co) t=linspace(0,25,1e3)’; d=1*(t>0&t<4)+2*(t>4&t<8)+4*(t>8&t<12)+0*(t>12); r=square(t/1.5);[y,to]=lsim(cl,[d r],t); 46/79 Signal Models So far the generalized disturbance signal was assumed to be constant. This signal set is equal to the solution set of the the differential equation d˙ = 0. This system can thus be viewed as a signal model or signal generator. We are thus lead to immediate generalizations. For example, sinusoidal signals of frequency ω are generated by d˙ = Sd with S = 0 ω −ω 0 St since e = cos(ωt) sin(ωt) − sin(ωt) cos(ωt) . Even more generally, we can work with block-diagonal matrices 0 1 0 ω1 0 ωs S = diag , ,..., 0 0 −ω1 0 −ωs 0 in order to model constants, ramps and sinusoids of frequencies ω1 , ..., ωs . 47/79 Extension of Design Procedure In our development we can replace d˙ = 0 all throughout by d˙ = Sd. One can design stabilizing controllers that achieve regulation for all signals d(t) = eSt d0 with arbitrary unknown d0 ∈ Rdim(S) under the following hypothesis: 1. Persistent disturbances: S has no eigenvalues in C− . 2. Existence of stabilizing state-feedback gain: (A, B) is stabilizable. 3. Solvability of regulator equation: There exist Π and Γ with A B Π Π Bd − S+ = 0. Ce De Γ 0 Ded (R) 4. Existence of a state and disturbance estimator: A Bd (AE , CE ) := , C Dd is detectable. 0 S 48/79 Extension of Design Procedure Under the given hypothesis a regulator is designed as follows: Choose A Bd • F , L such that A − BF , −L C Dd are Hurwitz; 0 S • G = Γ + F Π where Π, Γ satisfy the regulator equation (R). Then the controller ! x̂˙ A Bd ˙ = 0 S dˆ x̂ u = −F G , dˆ x̂ dˆ + ŷ = B 0 C Dd u + L(y − ŷ), x̂ dˆ + Du stabilizes the system and achieves regulation limt→∞ e(t) = 0 for all generalized disturbances satisfying d˙ = Sd. The proof requires hardly any modification of what has been shown. 49/79 Remarks • 1. In view of Lemma 4 it makes sense to consider only non-decaying disturbances - the others are regulated by all stabilizing controllers. This justifies the assumption eig(S) ⊂ C0 ∪ C+ . • 2. and 3. have been discussed earlier. • 4. is too strong. It suffices that (A, C) is detectable and that (Ce Ded ) vanishes on the undetectable subspace of the extended system. • In the practically important situation y = e one can fully dispense with 4. without any additional conditions. In the design procedure, L needs to be chosen such that AE − LCe is maximally stable: The unstable subspace of AE − LCE is equal to the undetectable subspace of (AE , CE ). Such an L can be easily found after transforming the system into observability normal form. 50/79 Motor Example Suppose that the disturbance is still constant but that the reference is α cos(t) + β sin(t) with arbitrary unknown α, β ∈ R. This motivates to choose the signal generator 0 0 0 0 0 1 S = 0 0 1 since eSt = 0 cos(t) sin(t) . 0 −1 0 0 − sin(t) cos(t) Disturbances are all solutions of d˙ = Sd. Then d1 (t) is the constant torque disturbance and d2 (t) is the reference signal. Since d3 (t) is irrelevant, we are lead to the following generalized plant used for design: 0 0 0 0 0 1 d, u+ ẋ = x+ 1 1 0 0 0 −1 1 0 0 0 0 y = x+ d, 0 0 0 1 0 e = 1 0 x + 0 −1 0 d. 51/79 Motor Example Clearly (A, B) = 0 1 0 −1 0 1 0 0 −1 1 (AE , CE ) = 0 0 0 0 0 0 0 0 0 0 , is controllable and 1 0 0 0 0 1 0 0 0 0 0 0 , 0 0 0 1 0 is observable. 0 1 −1 0 The regulator equation is 0 1 0 0 0 0 0 0 0 0 −1 1 Π − Π 0 0 1 + 1 0 0 = 0 Γ 0 1 0 0 0 −1 0 0 −1 0 and has the solution Π Γ 0 1 0 = 0 0 1 . −1 −1 1 Hence we are sure that we can design a regulator! 52/79 Motor Example We take F and L with eig(A − BF ) = {−2 ± i} and eig(AE − LCE ) = {−5, −6, −7, −8, −9}. (These have not been chosen very carefully!) We obtain the controller 0 10 00 0 19.95 −1.43 ! 1 122.53 −17.65 0 −1 1 0 0 x̂ x̂˙ 0 0 0 0 0 0 = + u + 313.9 −61.83 (y − ŷ), ˙ ˆ ˆ d d 0 0 0 0 1 0 −0.15 14.05 0 −1.09 47.38 0 0 0 −1 0 x̂ x̂ 1 0 0 0 0 u = − 5 3 1 −4 −4 , ŷ = . ˆ 0 0 0 1 0 d dˆ For simulations this controller is interconnected with the system 0 1 0 0 ẋ = x+ u+ d1 , 0 −1 1 1 1 0 0 y = x+ d2 , z = 1 0 x. 0 0 1 53/79 How Did I Solve the Regulator Equation? %solve regulator equation with Kronecker algebra M=[A B;Ch Dh]; n=size(A,1);n1=size(M,1)-n;n2=size(M,2)-n; As=kron(eye(3),M); As=As-kron(S’,[eye(n) zeros(n,n2);zeros(n1,n) zeros(n1,n2)]); bs=-vec([Bd;Dhd]); x=As\bs; X=reshape(x,3,3); Pi=X(1:2,:); Ga=X(3,:); %check whether indeed satisfied: M*[Pi;Ga]-[Pi;zeros(1,3)]*S+[Bd;Dhd] 54/79 Motor Example We arrive at the following nice simulation results: Disturbance (blue) and Reference (red) 5 0 −5 0 5 10 15 20 25 5 10 15 Tracking Output 20 25 5 10 20 25 Control 20 0 −20 0 5 0 −5 0 15 55/79 Motor Example If only the tracking error is measurable (y = φ − r) we obtain: 5 Disturbance (blue) and Reference (red) 0 −5 0 5 10 15 20 25 40 20 0 0 5 10 15 Tracking Output 20 25 5 10 20 25 5 Control 0 −5 0 15 56/79 Discussion The following observations can be made in case that y = e: • The constructed controller incorporates a model of the generalized disturbances. Under specific hypothesis it can be shown that this is a necessary property for a controller to achieve regulation. This fact is often called the internal-model principle. • If the disturbances are directly measured, a regulator typically places zeros of the controlled system at the to-be-suppressed frequencies by “rightly balancing the measurements”. This can be sensitive to modeling errors (non-robustness). • If d is not directly measured, the controller typically has poles at the to-be-suppressed frequencies which creates zeros of the closed-loop system at those frequencies. Usually, such designs are more robust. For constant disturbances the controller has integral action! • There exists a systematic way to design robust regulators. 57/79 Recap: The Stable Subspace of a Matrix For A ∈ Rn×n factorize the characteristic polynomial χA as χA = αβ with α and β having only zeros in C− and C0 ∪ C+ respectively. Then E− (A) := ker(α(A)) and E0+ (A) := ker(β(A)) are the generalized eigenspaces of A w.r.t. C− and C0 ∪C+ respectively. E− (A) (E0+ (A)) is the largest among all subspaces V ⊂ Rn such that AV ⊂ V and eig(A|V ) ⊂ C− (eig(A|V ) ⊂ C0 ∪ C+ ). E− (A) is also called the stable subspace of A. If T1 is a basis matrix of E− (A) and T2 is chosen such that T = (T1 T2 ) is invertible, we infer A11 A12 −1 T AT = with eig(A11 ) ⊂ C− , eig(A22 ) ⊂ C0 ∪ C+ . 0 A22 Recall that such an (even orthogonal) similarity transformation T can be computed effectively with the (real ordered) Schur decomposition. 58/79 Block-Diagonalization Now let eig(A11 ) ⊂ C− and eig(A22 ) ⊂ C0 ∪ C+ . Then we infer A11 A12 I x1 n E− = Im = ∈ R | x2 = 0 . 0 A22 0 x2 Moreover, the Sylvester equation A11 X − XA22 + A12 = 0 has a unique solution X. It is then easy to see that A11 A12 X x1 n E0+ =R = ∈ R | x1 − Xx2 = 0 . 0 A22 I x2 Furthermore, the similarity transformation I X T = 0 I block-diagonalizes the block-triangular matrix as follows: A11 A12 A11 A11 X − XA22 + A12 A11 0 −1 T T = = . 0 A22 0 A22 0 A22 59/79 A Key Characterization of Output Stability With eig(A11 ) ⊂ C− and eig(A22 ) ⊂ C0 ∪ C+ consider the system A11 A12 ẋ = x, y = C1 C2 x. 0 A22 With X satisfying A11 X − XA22 + A12 , transform the system into A11 0 ż = z, y = C1 C1 X + C2 z. 0 A22 In view of the assumed spectral properties, we infer limt→∞ C1 eA11 t = 0. Moreover, limt→∞ (C1 X + C2 )eA22 t = 0 iff C1 X + C2 = 0. Therefore lim y(t) = 0 holds for all trajectories iff C1 X + C2 = 0. t→∞ This can be expressed in a coordinate-free fashion as follows. Lemma 5 All trajectories of the system ẋ = Ax, y = Cx satisfy limt→∞ y(t) = 0 iff E0+ (A) ⊂ N (C). 60/79 The Undetectable Subspace Definition 6 The undetectable subspace of (A, C) is the largest A-invariant subspace contained in N (C) such that the restriction of A to this subspace has all its eigenvalues in C0 ∪ C+ . A geometric characterization can be given as follows. Lemma 7 Let U be the unobservable subspace of (A, C) and E0+ be the generalized eigenspace of A with respect to C0 ∪ C+ . The undetectable subspace of (A, C) then equals U ∩ E0+ . 61/79 Rendering the Undetectable Subspace Explicit By Theorem IV-8 (observability normal form) and slide 59, ẋ = Ax+Bu, y = Cx + Du can be transformed by a state-coordinate change into ż1 A11 0 0 z1 B1 ż2 = A21 A22 0 z2 + B2 u ż3 A31 0 A33 z3 B3 z1 y = C1 0 0 z2 + Du z3 such that (A11 , C1 ) is observable, A22 is Hurwitz, eig(A33 ) ⊂ C0 ∪ C+ . Lemma 8 For (A, C) as above the undetectable subspace is 0 z1 R 0 = z2 | z1 = 0, z2 = 0 . z I 3 62/79 Proof It is trivial to see that the given subspace has the three properties as required in the definition. The following technique of proof that it is largest should be remembered since it can be very useful for much more complicated questions in geometric control. Suppose that V is any subspace with all three properties and let V be a basis matrix of V. Then there exists some M with eig(M ) ⊂ C0 ∪ C+ and A11 0 0 V1 V1 V1 A21 A22 0 V2 = V2 M, C1 0 0 V2 = 0. A31 0 A33 V3 V3 V3 Since A11 V1 = V1 M and C1 V1 = 0, we infer V1 = 0 by observability of (A, C). Hence we get A22 V2 = V2 M . Since eig(A22 ) ∩ eig(M ) = ∅ we infer from A22 V2 − V2 M = 0 that V2 = 0 (Sylvester equation). Hence 0 0 R(V ) = R 0 ⊂ R 0 . V3 I 63/79 Uncontrolled Generalized Plant Consider the generalized plant with signal generator A Bd B x ẋ e = Ce Ded De d , d˙ = Sd. y u C Dd D The extended generalized plant is ẋ A d˙ 0 = e Ce C y Bd S Ded Dd (P) B x 0 d . De u D Assumptions: (A, B) is stabilizable and (A, C) is detectable. The signal generator S satisfies eig(S) ⊂ C0 ∪ C+ . Our goal is to obtain necessary conditions for solvability of the regulation problem with a general controller ẋK = AK xK + BK u, y = CK xK . 64/79 Controlled Generalized Plant If we interconnect the generalized plant with the controller ẋK AK BK xK = , u CK 0 y we obtain the controlled system with signal generator A B ξ ξ˙ , d˙ = Sd = C D d e (C) (CL) and the extended controlled system ξ˙ A B d˙ = 0 S ξ . d C D e Here we use the abbreviations A BCK Bd x A B ξ= , = BK C AK + BK DCK BK Dd . xK C D Ce De CK Ded 65/79 Proof After permutation we have ẋ A B Bd x y = C D Dd u . e Ce De Ded d Merging with u = CK xK leads ẋ A y= C e Ce to BCK Bd x DCK Dd xK . De CK Ded d Merging the controller differential equation with y = ... shows x K ẋK = AK + BK DCK BK C BK Dd x . d Just combining the two leads to ẋ A BCK Bd x ẋK = BK C AK + BK DCK BK Dd xK . e Ce De CK Ded d 66/79 Precise Problem Formulation Regulation Problem: For the generalized plant (P) determine a controller (C) such that the controlled generalized plant (CL) has the following properties: • If d(t) = 0 for all t ≥ 0 then all state-trajectories of (CL) satisfy lim x(t) = 0 and lim xK (t) = 0. t→∞ t→∞ Equivalently, A is Hurwitz. • For all trajectories of (CL) the output satisfies lim e(t) = 0. t→∞ We have provided an extensive motivation for this abstract mathematical problem formulated for some generalized plant. You should appreciate by now that this generic problem formulation and solution covers a whole diversity of concrete questions as appearing in practice. 67/79 Modification of Signal Generator Suppose that (AE , CE ) := A Bd 0 S , C Dd is not detectable. We can then identify the following necessary condition for the solvability of the regulation problem. Lemma 9 If the regulation problem admits a solution then the undetectable subspace of (AE , CE ) is contained in N (Ce Ded ). If this necessary condition has been verified to be true, we clarify in the proof that it is possible, without loosing any generality, to reduce the signal generator such that the detectability property for the resulting extended system is valid. In this sense it causes no generality to proceed under the hypothesis that (AE , CE ) is detectable. 68/79 Proof of Lemma 9 X1 If the undetectable subspace of (AE , CE ) is non-trivial, let X = X2 0 + be a basis matrix. Then there exists M with eig(M ) ⊂ C ∪ C and AX1 + Bd X2 = X1 M, SX2 = X2 M, CX1 + Dd X2 = 0 (1) Claim: X2 has full column rank. If not, then x ∈ N (X2 ) implies AX1 x = X1 M x, 0 = X2 M x, CX1 x = 0 and thus M x ∈ N (X2 ); hence N (X2 ) 6= {0} is M -invariant; then there exists some x ∈ N (X2 ) \ {0} with M x = λx. We get AX1 x = λX1 x and CX1 x = 0. Since Re(λ) ≥ 0 and (A, C) is detectable, we infer X1 x = 0 and thus x = 0, a contradiction. By a coordinate change ofthestates of the signal generator, we can as0 sume w.l.o.g. that X2 = . Introduce the corresponding partitions I Bd Bd1 Bd2 S11 S12 S= and Ded = Ded1 Ded2 . S21 S22 Dd Dd1 Dd2 69/79 Proof of Lemma 9 Then (1) is equivalent to AX1 + Bd2 = X1 M, S = S11 0 S21 M , CX1 + Dd2 = 0. Let us now assume that the system controlled with (AK , BK , CK ) solves the regulator problem. The extended controlled system then reads as ẋ A BCK Bd1 Bd2 x ẋK BK C AK + BK DCK BK Dd1 BK Dd2 xK d˙1 = 0 0 S11 0 d1 . d˙2 0 0 S21 M d2 C D C D D e e e K ed1 ed2 After the state-coordinate change x̃ = x − X1 d2 we get x̃˙ A BCK Bd1 0 ẋK BK C AK + BK DCK BK Dd1 0 d˙1 = 0 0 S 0 11 d˙2 0 0 S21 M C D C D D + C e X1 e e e K ed1 ed2 x̃ xK d1 . d2 70/79 Proof of Lemma 9 For all trajectories of this system we have e(t) → 0 for t → ∞. This implies, in particular, (Ded2 + Ce X1 )eM t → 0 for t → ∞. Since eig(M ) ⊂ C0 ∪ C+ , we conclude Ded2 + Ce X1 = 0. This means X1 Ce Ded X = Ce Ded1 Ded2 0 = Ce X1 + Ded2 = 0 I which we had to prove. If this condition holds, (AK , BK , CK ) solves the regulation problem for the original system iff it does so for the following modified extended generalized plant with a reduced signal generator: A Bd1 B x̃˙ x̃ d˙ 0 S11 0 1= e Ce Ded1 De d1 u C Dd1 D y By construction this system is detectable from y. 71/79 Main Result Consider the generalized plant P with signal generator A Bd B x ẋ e = Ce Ded De d , d˙ = Sd. y u C Dd D Theorem 10 Let (A, B) be stabilizable and A Bd , C Dd be detectable 0 S and suppose that eig(S) ⊂ C0 ∪ C+ . Then the regulator problem has a solution iff the regulator equation (R) is solvable. We have seen how to prove “if”. The main intention of this last part is to prove “only if”. 72/79 Proof of Theorem 10 Let us assume that the system controlled with (AK , BK , CK ) solves the regulation problem. The extended controlled system then reads as A B ξ˙ d˙ = 0 S ξ d C D e with A being Hurwitz. Hence AX − X S + B = 0 has a unique solution X . The coordinate change ξ˜ = ξ − X d leads to ˙ A 0 ξ˜ ˜ d˙ = 0 ξ . S d C CX + D e If regulation is achieved we infer CX + D = 0 and thus A X B X− S+ = 0. C 0 D 73/79 Proof of Theorem 10 Let us nowrecall the structure of A, B, C and partition the rows of X X = accordingly. We get the equations Y A BCK X Bd BK C AK + BK DCK X − Y S + BK Dd = 0 Y Ce De CK 0 Ded and thus AX + BCK Y X Bd AK Y + BK (CX + DCK Y ) − Y S + BK Dd = 0 Ce X + De CK Y 0 Ded Therefore, Π = X and Γ = CK Y satisfy AΠ + BΓ X Bd − S+ =0 Ce Π + De Γ 0 Ded which just is (R). 74/79 Internal Model Principle Consider the generalized plant with signal generator A Bd B x ẋ e = C Dd D d , d˙ = Sd y C Dd D u for which the regulated output e equals the measurement output y. Theorem 11 Let the hypotheses of Theorem 10 be satisfied. If the controller (C) solves the regulation problem, it can be transformed by a state-coordinate change into ˙x̃K = S C̃K x̃K + D̃K y, u = Γ ĈK x̃K . 0 ÃK B̃K In this sense AK necessarily contains the model S of the signals to be regulated. This also implies dim(AK ) ≥ dim(S) which leads to a lower bound on the required state-dimension of any regulator. 75/79 Proof of Theorem 11 We follow the proof of the previous theorem which lead to AX + BCK Y X Bd AK Y + BK (CX + DCK Y ) − Y S + BK Dd = 0 CX + DCK Y 0 Dd and hence AX + BCK Y − XS + Bd = 0, AK Y = Y S, CX + DCK Y + Dd = 0. Claim: Y has full column rank. If not we have SN (Y ) ⊂ N (Y ). Hence we find an S-eigenvector x ∈ N (Y ) to the eigenvalue λ with Re(λ) ≥ 0. We get (A − λI)Xx + Bd x = 0, (S − λI)x = 0 and CXx + Dd x = 0. By the detectability hypothesis we infer x = 0, a contradiction. I By a controller’s state-coordinate change we get Y = . Hence 0 S C̃K D̃K AK = , BK = , CK = CK Y ĈK = Γ ĈK . 0 ÃK B̃K 76/79 Internal Model Principle The controller in Theorem 11 can be written as a series interconnection ξ1 ˙2 Ã B̃ ξ K K S I 0 ξ2 ξ˙1 u1 , . = u1 = C̃K D̃K y Γ 0 I u u2 u2 ĈK 0 Hence the controlled system can be depicted as d e u P y S I 0 Γ 0 I ÃK B̃K C̃K D̃K ĈK 0 77/79 Internal Model Principle: A design Recipe This leads to a general design recipe even for the generalized plant (P) under the hypotheses of Theorem 10: • Solve the regulator equation (R) to obtain Γ. • Precompensate P to obtain d u e P y S I 0 Γ 0 I • Design a stabilizing controller for the precompensated plant. Then the resulting controller for (P) solves the regulation problem. 78/79 Covered in Lecture 7 • Synthesis for performance Tracking and disturbance rejection, one- and two-degrees of freedom controller design • Disturbance models constant disturbances, sinusoidal disturbances • Internal model principle state-feedback design, the regulator equation, disturbance estimators, output feedback design • General regulator theory as developed by Francis and Wonham 79/79