EE45/55: Digital Control Chapter 7: State Spae Representations
State Variables Definition 7.: The system state is a minimal set of { variables x ( t ), i =, 2,, n needed together with the i input ut, and tin the interval t, t f to uniquely determine e e the behaviour of the system in the interval ev t, t f ; where n is the order of the system The set of state variables for the state vetor is written: x [ ] T x 2 xt = x, x2,, x n = x n } )
State Variables The state-spae spae is the n-dimensional vetor spae where the x ( t) from x( t) represent the oordinate axes i For a seond-order system, the state spae is two- dimensional and known as the state - plane; for the speial ase where the state-variables are proportional to the derivatives of fthe output, t the state t plane is alled the phase plane and the state variables are alled phase variables Curves in state spae are known as the state trajetories, and a plot of the trajetories in the plane is the state portrait (or phase portrait for the phase plane)
Example 7.: Motion of a Pt. Mass Consider the motion of a point mass m driven by a fore u: u my = u y = m where y is the displaement of the point mass; defining the system states as the phase variables: x ( t) y( t) x ( t) = y ( t) = x ( t) 2 x( t) yt x ( t) = yt = 2 2 u m
Example 7.: Motion of a Pt. Mass If the state vetor is given by: () T x t xt () = [ x ] (), t x2() t = x 2() t then the system dynamis in state-variable form is: x2() t x x x = = = u x 2 + x u Ax+ Bu 2 m m x [ ] y = Cx+ Du x 2
Questions?
The General State Spae Forms The general form of a linear state-spaespae equation is: xt = Axt + But yt () = C xt () + D ut () where xt is a n real state vetor, ut is a m real input vetor, y () t is a p real output vetor, and the matries are defined as: A is a n n real state matrix, B is a n m real input matrix, C is a p n real output matrix, D is a p m real feedforward matrix
The General State Spae Forms The general form of a nonlinear state-spae spae equation is: xt = f xt, ut yt = g xt, ut where f () i and g() i are real n and p vetors of funtions that guarantee the existene and uniqueness of a solution to the system dyanmis The nonlinear system an be approximated at an equilibrium point x, u using a linear model, as speified previously, using the onept of a system's Jaobians, as defined on the next slide
System Jaobians System Jaobians are defined for equilibrium point x, u as: A C f f f f x x u u ( x ), u n x, u x, u m ( x, u ) =, B = f n f n fn f n x x ( x, u) n u u ( x, u) ( x, u) m ( x, u) g g g g x x u u ( x, u ) n ( x, u) ( x, u) m ( x, u ) =, D = g p g p gp g p x x ( x, u) n u u ( x, u) ( x, u) m ( x, u)
Linearization Example Given the nonlinear mass-spring-damper system: 2 my + by + k sin( y) = u b 2 k u y = y sin( y) + m m m The system state an be defined as: x2 y x y x = = x = = b 2 k u y x 2 y x sin( x ) 2 + m m m f = f 2 Equilibrium points our where x =, whih implies 2 yy, = x =, x = sin u k The system Jaobians an now alulated as shown:
Linearization Example If u = x = sin = x = f f x x ( x, u 2 ) ( x, u ) f f os( ) 2 2 m m x x ( x, u) 2 ( x, u) A = = k = k f u ( x, u) B = = f 2 m u ( x, u )
If Linearization Example y = x = g () i is onsidered the system output, then: g g C [ ] = = x x ( x, u ) 2 ( x, u ) g D = = [ ] u ( x, u ) Therefore, the linearized model at ( x, u ) =, is: x = x k x + u 2 m m y x = + x [ ] [ ] 2 u
Questions?
Soln. of Linear State Equations If the state equaton with ICs are given as: xt () = A xt () + B ut (), xt Then the Laplae transform yields: Solving for sx () s x( t ) = A X () s + B U () s X( s) yields: n [ ] [ U() s] = Φ () s [ x( t ) + BU() s] X() s = si A x( t ) + B A n state - transition resolvent matrix Φ s = [ si ] where the has the inverse Φ ( t t ) = L si A n = e = k = ( ) ( τ ) ( ) { [ ] } A A t t t known as the matrix exponential resulting in the state equation: t A t t A t e e ( τ ) τ Φ ( t ) + Φ ( τ ) B u ( τ ) d τ = + = Φ + Φ xt xt Bu d t xt t zero input response t zero state response t t k k! t k
Example of State Equation Soln. T Given the system with unit step input and x() = [,] : x x = + u x2 x y = [ ] + [ ] u x 2 The state transition matrix Φ ( t) = si A an be omputed as shown: L L {[ ] } n t s s s( s + ) e L t s + e Φ () t = = = s +
Transfer Funtion Matrix As shown, the state equation with zero ICs an be written in the s-domain: = = [ ] ( s) X() s si A BU() s Φ BU() s n Sub. into the s-domain expression of the output equation yields: Y() s= C Φ () s BU() s + DU() s Y () s = = U() s = Φ () t H () s C Φ B + D h () () t C Φ B + D δ () t = () s Transfer Funtion (TF) At Ce B + Dδ () t Impulse Response (IR)
Transfer Funtion Matrix Given the prior example, we an ompue the system TF and IR as: H () s h Y () s s s ( s+ ) = = [ ] [ ] U() s + = s s+ s + t e () t = [ ] [ ] δ () t e t + = e t Do these results agree with prior state soln., see Matlab verifiation? >> A=[,;, ];B=[;];C=[,];D=[]; >> H_s=tf(ss(A,B,C,D)) Transfer funtion: s^2 + s >> zpk(h_s) zero/pole/gain: s (s+)
Questions?
Disrete State Equations We an develop disrete state eqns. of sample data system diretly form the assoiated ontinuous state eqns. assuming that a sample and zero-order hold is plaed prior to the plant G ( s) p = Y () s U() s Given this, we an assume that t = kt and t = kt + T in the solution of the ontinuous state eqn. developed previously, to obtain: kt + T ( + ) =Φ + ( τ) τ Φ + kt xkt T T xkt kt T Bd ukt
Disrete State Equations Based on this, the resulting disrete e state espae eeq eqn..beomes: es: x k+ = A x( k) + B u( k) To obtain this let y k = C x ( k ) + D u ( k ) d d d kt τ = σ in the prior eqn. T where A =Φ ( T ), B = Φ ( T σ ) d σ B, C = C and D = D d d d d As noted previously, Φ () t an be found by series expansion: A T A T Φ = + + + + 2! 3! 2 2 3 3 T In AT, thus Bd T T B I T A A B 2! 3! 2 3 2 d = n + + + d is given as
Example Disrete State Eqn. Given the sampled data system with T =. and G ( s) =, find the disrete state spae representation p s s + t As shown previously, e Φ ; therefore, t = t e T T t T e T T + e Φ ( τ ) d τ = t = T e e.952 Thus, A d =Φ ( T ) = and T =..95 T..484 484.484 484 Bd = Φ( τ) dτ B = =.952.952 T =.
Soln. to the Disrete State Eqn. Given a disrete state eqn. of the form: xk+ = Axk + Buk the soln. an be found by reursion as: d k k k i d () d d zero input i= response zero state response xk A x A Bui = + k wh ere Φ k = A is the disrete state transiton matrix wh d d Note, the reursion is easily performed on a omputer d
Disrete Transfer Funtion Matrix The disrete state equation with zero ICs an be written in the z-domain: = = [ ] ( z) X( z) zi A B U( z) Φ B U( z) n d d d Sub. into the s-domain expression of the output equation yields: Y( z) = C Φ ( z) B U( z) + D U( z) d d d d Y ( z ) H( z) = = C Φ ( z) B + D U( z) hk = C Φ ( kb ) + D δ ( k ) d d d d d d d d Ak d = Ce B + Dδ ( k) d d d d Transfer Funtion (TF) Impulse Response (IR)
Disrete Transfer Funtion Matrix z.952 Φ = = d n d z.95 Note: ( z) [ zi A ] =.952952 ( z ) ( z )( z.95) ( z.95) k ( k) δ( k).52δ( k) +.2 ( k).73.95 Φ ( k) = d k.5 5.95
Disrete Transfer Funtion Matrix Given the prior example, we an ompute the system TF and IR as:.952 Y( z) z z z.95.484 H ( z ) = = [ ] U( z) +.952 z.95 [ ] [ ].952.484.484( z +. 9675) z z z.952 (.95) ( z )( z.95 ) = = hk = k ( k ).52.2.73.95.484484 [ ] δ k δ k + k k.5.95.952 + [] δ ( k ) k =.2 ( k).54.95 +.52 δ ( k)
Disrete Transfer Funtion Matrix Do these results agree with the soln. based on the methods of Chapter 3? See Matlab verifiation... >>Ad=[,.952;,.95];Bd=[.484;.952]; Cd=[,];Dd=[]; >> T=.;GZAS_z=tf(ss(Ad,Bd,Cd,Dd,T)) Transfer funtion:.484 z +.4683 z^2.95 z +.95 >> zpk(gzas) Zero/pole/gain:.48374 (z+.9672) (z ) (z.948) >> Gp_s=tf(,onv([ ],[ ])) Transfer funtion: s^2 + s >> zpk(gp_s) Zero/pole/gain: s(s+) >> GZAS2_z=2d(Gp_s,T,'zoh') Transfer funtion:.4837 z +.4679 z^2.95 z +.948 >> zpk(gzas2_z) Zero/pole/gain:.48374 (z+.9672) (z ) (z.948)
Disrete Transfer Funtion Matrix Do these results agree with the soln. based on the methods of Chapter 3? See Matlab verifiation... >> z=tf('z',t) Transfer funtion: z Sampling time:. >> [num_gzas_zoz,den_gzas_zoz]= tfdata(minreal(gzas_z/z,e 4)); >>[R,P,K] = residue(num_gzas_zoz{},den_gzas_zoz{}) R =.2.54.52 P =..95 K = [] >> A=[,;, ];B=[;];C=[,];D=[]; >> Gp_s=tf(ss(A,B,C,D)) Transfer funtion: s^2 + s >> 2d(ss(A,B,C,D),T,'zoh') a = x x2 x.956 x2.948 b = u x.4837 x2.956 956 = x x2 y d = u y
Questions?
Similarity Transforms State representations are not unique, e.g., assume that for a disrete time system that state eqns. are given by: x k+ = A x( k) + B u( k) xd xd y k C x k D u k = + xd and there a new state wk exists suh that xk = Pwk where P is an invertible n n matrix P exists Sub. w into the above state representation yields: wk + = P A Pwk + P B uk xd y k = C Pw( k) + D u( k) xd A = P A P, B = P B, C = C P, D = D wd xd wd xd wd xd wd xd xd xd xd
Similarity Transforms It is shown in Chapter 8 that system stability is determined by the roots of the harateristi eqn. of the A matrix, defined by zi A =, and alled system eigenvalues n whih are analogous to the poles d d of H( z) = C Φ ( z) B + D It an be shown that zi A = zi A, and also n xd n wd [ ] [ ] d d d d H ( z ) = C zi A B + D = C zi A B + D xd n xd xd xd wd n wd wd wd whih implies that system stability and TF remain unhanged under the similarity transform xk = Pwk
In lass Assignment Show that the system:.8 xk ( + ) = xk + uk.9 [ ] yk = xk has equivalent eigenvalues and TF under the similarity transform xk = Pwk where P =
Matlab Verifiation >> Axd=[.8 ;.9];Bxd=[;];Cxd=[ ];Dxd=[];P=[ ; ]; >> Awd=inv(P)*Axd*P Awd =.35.55.45.35 >> Bwd=inv(P)*Bxd Bxd Bwd =.5.5 >> Cwd=Cxd*P Cwd = >> Dwd=Dxd Dxd Dwd = >> eig(axd) ans =.8.9 >> eig(awd) ans =.9.8 >> Hx_z=tf(ss(Axd,Bxd,Cxd,Dxd, )) Transfer funtion: z^2.7 z +.72 Sampling time: unspeified >> zpk(hx_z) Zero/pole/gain: (z.9) (z.8) >> Hw_z=tf(ss(Awd,Bwd,Cwd,Dwd, )) Transfer funtion: z^2.7 z +.72 >> zpk(hw_z) Zero/pole/gain: (z.9) (z.8)
Questions?