Lecture: Automatic Control 2 Prof. Alberto Bemporad University of Trento Academic year 2010-2011 Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 1 / 17
Lecture: Systems reduction The complexity of the control law often depends on the order of the system (for example in state-space methods like dynamic compensation) For control design purposes, can we approximate the model with another model of reduced order that preserves the original transfer function as much as possible? We already know that uncontrollable and unobservable modes do not affect the transfer function. They can be eliminated by operating a canonical decomposition Can we try to eliminate other modes that are weakly uncontrollable and/or weakly observable, and get a numerically well-conditioned lower-order state-space realization? and balanced transformations answer the above questions Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 2 / 17
Lecture: Unbalanced realizations and scaling Consider the linear system x1 (k + 1) = x 2 (k + 1) 1 2 0 x1 (k) 10 6 0 2 + x 3 2 (k) 10 6 u(k) y(k) = 10 6 10 6 x 1 (k) x 2 (k) The state x 1 is weakly reachable, but very observable The state x 2 is very reachable, but weakly observable Let s rescale the system by operating the change of coordinates 10 6 0 z = 0 10 6 x The system expressed in new coordinates is numerically balanced z1 (k + 1) 1 0 z1 (k) = 2 1 z 2 (k + 1) 0 2 + u(k) z 3 2 (k) 1 y(k) = 1 1 z 1 (k) z 2 (k) Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 3 / 17
Lecture: Grammians Consider the discrete-time linear system x(k + 1) = Ax(k) + Bu(k) y(k) = Cx(k) + Du(k) Since now on we assume that matrix A is asymptotically stable The controllability Grammian for discrete-time systems is the matrix W c A j BB (A ) j MATLAB Wc = gram(sys, c ) j=0 The observability Grammian for discrete-time systems is the matrix W o (A ) j C CA j MATLAB Wc = gram(sys, o ) j=0 Similar definitions exist for continuous-time systems For discrete-time systems the controllability Grammian is related to the cost of minimum energy control: min j=0 u2 (j) = x(0) W 1 c x(0). The observability Grammian to the output energy of the free response: j=0 y2 (j) = x(0) W o x(0). The Grammians solve the Lyapunov equations W c = AW c A + BB and W o = A W o A + C C, respectively Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 4 / 17
Lecture: Balanced state-space realizations Definition A state-space realization is called balanced if the Grammians W c and W o are equal and diagonal W c = W o = Σ, Σ =. σ 1 0... 0 0 σ 2... 0....... 0... 0 σ n A procedure to derive the transformation matrix T such that the equivalent state-space form à = T 1 AT, B = T 1 B, C = CT, D = D is balanced is described in [1] the procedure is implemented in the MATLAB function balreal MATLAB [sysb,σ,t 1,T] = balreal(sys) where σ = [σ 2 1... σ2 n ] [1] A.J. Laub, M.T. Heath, C.C. Paige, R.C. Ward, Computation of System Balancing Transformations and Other Applications of Simultaneous Diagonalization Algorithms, IEEE Trans. Automatic Control, vol. 32, pp. 115-122, 1987 Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 5 / 17
Wednesday, May 26, 2010 Lecture: Once the system is in balanced form we can easily reduce the order of the model by eliminating the states associated with small σ i s Σ1 0 W c = W o = 0 Σ 2 Σ 2 Σ 1 z(k + 1) = Ã11 Ã 12 B z(k) + 1 u(k) Ã 21 Ã 22 B 2 y(k) = C 1 C 2 z(k) z 1 (k + 1) = Ã 11 z 1 (k) + B 1 u(k) y(k) = C 1 z 1 (k) A similar idea applies to continuous-time systems MATLAB rsys = modred(sys,elim, del ) elim = indices of the states to be eliminated Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 6 / 17
Lecture: Example Transfer function: G(s) = s 3 +11s 2 +36s+26 s 4 +14.6s 3 +74.96s 2 +153.7s+99.65 State-space realization in canonical reachability form: 0 1 0 0 00 0 0 1 0 A = 0 0 0 1, B =, C = [ 26 36 11 1 ], D = 0 99.65 153.7 74.96 14.6 W c = Controllability and observability Grammians: 0.0000 0.0000 0.0001 0.0000 0.0000 0.0001 0.0000 0.0006 0.0001 0.0000 0.0006 0.0000 0.0000 0.0006 0.0000 0.0408 0 1 W o = 84.6757 122.1890 37.4774 3.3919 122.1890 179.5744 55.2945 5.0110 37.4774 55.2945 17.0406 1.5448 3.3919 5.0110 1.5448 0.1401 After balancing, we get W c = W o = 0.1394 0 0 0 0 0.0095 0 0 0 0 0.0006 0 0 0 0 0.0000 MATLAB» sys=ss(a,b,c,d);» [sysb,sigma,tinv,t] = balreal(sys);» Wc=diag(sigma);» Wo=Wc Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 7 / 17
Lecture: Example After applying the transformation matrix T we get 3.601 0.8212 0.6163 0.05831 1.002 0.8212 0.593 1.027 0.09033 0.1064 Ã = 0.6163 1.027 5.914 1.127, B = 0.08612 0.05831 0.09033 1.127 4.492 0.008112 C = [ 1.002 0.1064 0.08612 0.008112 ], D = 0 Let s eliminate states z 3, z 4 and get a model of reduced order 2 The transfer function of the reduced-order model is 0.9926s + 0.7297 G b (s) = s 2 + 4.194s + 2.81 Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 8 / 17
Lecture: Example (cont d) Let s compare the frequency responses of G and G b : they are almost indistinguishable! Bode diagram of G and G b 10 Phase (deg) Magnitude (db) 15 20 25 30 35 40 45 0 45 G G b In general, the smaller are the removed singular values σ i with respected to the ones we keep, the more similar are the responses of the original and reduced-order models 90 10 1 10 0 10 1 10 2 Frequency (rad/sec) Note that after balancing the states completely loose their physical meaning The original state x can be recovered (approximately) from the reduced state z 1 using the transformation matrix T = T 11 T 12 T 21 T 22 x = T 11 T 21 z1 x is treated here as an output of the reduced-order model The reduced state z 1 can be estimated by a state observer (the pair à 1, C 1 is observable by construction) Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 9 / 17
Lecture: Matched DC gain method for model reduction Consider again the complete model x 1 (k + 1) = A 11 x 1 (k) + A 12 x 2 (k) + B 1 u(k) x 2 (k + 1) = A 21 x 1 (k) + A 22 x 2 (k) + B 2 u(k) y(k) = C 1 x 1 (k) + C 2 x 2 (k) Assume the dynamics of x 2 are infinitely fast : x 2 (k + 1) x 2 (k) We can eliminate the states contained in x 2 by substituting therefore obtaining x 2 (k) = (I A 22 ) 1 (A 21 x 1 (k) + B 2 u(k)) x 1 (k + 1) = (A 11 + A 12 (I A 22 ) 1 A 21 )x 1 (k) + (B 1 + A 12 (I A 22 ) 1 B 2 )u(k) y(k) = (C 1 + C 2 (I A 22 ) 1 A 21 )x 1 (k) + C 2 (I A 22 ) 1 B 2 u(k) A similar idea can be applied in continuous-time, by setting ẋ 2 (t) 0 x 2 (t) = A 1 22 (A 21x 1 (t) + B 2 u(t)) Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 10 / 17
Lecture: Matched DC gain method for model reduction Property The matched DC-gain method preserves the DC gain of the original full-order model Proof: Simply observe that for both the original and the reduced-order model in steady-state x 1, x 2 depend on u in the same way MATLAB rsys=modred(sys,elim, mdc ) elim is the vector of state indices to eliminate Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 11 / 17
Lecture: Example (cont d) Consider again the state-space realization A = 0 1 0 0 0 0 1 0 0 0 0 1 99.65 153.7 74.96 14.6, B = 00 0 1, C = [ 26 36 11 1 ], D = 0 Let s eliminate the states x 3 and x 4 using the matched DC-gain method We get a 2 nd order model whose transfer function is G m (s) = 0.1467s2 + 0.4803s + 0.3469 s 2 + 2.05s + 1.329 Bode diagram of G and G r 10 15 Magnitude (db) Phase (deg) 20 25 30 35 40 0 45 G G r Emphasis here is on matching at low frequencies (DC gain in particular!) DC gains: G(0) = G m (0) = 0.2609 90 10 1 10 0 10 1 10 2 Frequency (rad/sec) Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 12 / 17
Lecture: Example (cont d) Step responses of G, G r, G m 0.35 G G r 0.3 G m Amplitude 0.25 0.2 0.15 0.1 Original DC gain: G(0) = 0.2609 DC gain of G m (s): G m (0) = 0.2609 DC gain of G b (s): G b (0) = 0.2597 0.05 0 0 1 2 3 4 5 6 Time (sec) The matched DC-gain method is only good to capture the DC gain exactly via balanced transformation provides best match Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 13 / 17
Lecture: Comments on model reduction How good is the reduced-order model should be judged on the performance of the original system in closed-loop with a controller based on the reduced model A good reduced-order model provides very good closed-loop performance and a low-order dynamic control law at the same time Let s see an example... Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 14 / 17
Lecture: Example (cont d) Consider the LQR performance index min y 2 (k) + ρu 2 (k) k=0 LQR controller based on complete model (A, B, C, D): 1 u(t) = Kx(t) + Hr(t), H = C( A BK) 1 B + D LQR controller based on reduced model (A 1, B 1, C 1, D 1 ): z1 z 2 = T 1 x u(t) = K b z 1 (t) + H b r(t), H b = 1 C( A BK b [I 0]T 1 ) 1 B+D LQR controller based on the model reduced by the matched DC gain method: x 1 = 1 0 0 0 0 1 0 0 x u(t) = K m x 1 (t) + H m r(t), H m = 1 C( A BK m [I 0]) 1 B+D Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 15 / 17
Lecture: Example (cont d) Closed loop step response of G with different LQR controllers 1.4 1.2 K u = Kx K b = [ 29.5403 43.0578 13.2412 1.2001 ] x Amplitude 1 0.8 0.6 0.4 0.2 u = K b 0 T 1 x = [ 29.5145 43.0825 13.2468 1.1999 ] x u = K m I 0 x = [ 17.5373 21.4324 0 0 ] x 0 0 0.5 1 1.5 2 2.5 3 3.5 Time (sec) Note the similarity between controllers K and K b 0 T 1 Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 16 / 17
Lecture: English-Italian Vocabulary model reduction Grammian riduzione dell ordine del modello gramiano Translation is obvious otherwise. Prof. Alberto Bemporad (University of Trento) Automatic Control 2 Academic year 2010-2011 17 / 17