ECE452/552: Multivariable Control Systems I. 3 1 STATE-SPACE DYNAMIC SYSTEMS (DISCRETE-TIME) 3.1: The transform Computer control requires analog-to-digital (A2D) and digital-toanalog (D2A) conversion. Everything shown in the dashed box below represents the internals of acomputerorembeddedsysteminadigitalcontrolscenario. r.t/ e.t/ A2D Q eœk D. / uœk D2A zoh u.t/ G.s/ w.t/ y.t/ v.t/ The A2D comprises a sampler and quantizer; the D2A performs a zero-order-hold operation. The controller is designed in discrete time, where the transform is used as a design tool rather than the Laplace transform. DEFINITION: The transform is defined for a signal x.kt/ to be X. / D x./ C x.t/ 1 C x.2t/ 2 C x.3t/ 3 C 1X D x.kt/ k kd! 1X or; X. /D xœk k : kd
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 2 As with the Laplace-transform variable s, the -transform variable is a complex number. Iassumethatyouhavestudiedthe transform before, and so include only a short review in these notes. EXAMPLE: Define the digital impulse (pulse) function to be ıœk D ( 1; k D I ; otherwise: 4 2 2 4 6 8 Note: This is very different from an analog impulse (e.g., ıœ is defined), but plays a similar role. so; let xœk D ıœk 1X X. / D xœk k kd D xœ C xœ1 1 C xœ2 2 C D xœ D 1: This sum converges regardless of the value of, sorocd fj j >g. Selected important properties of the transform Some select properties of the transform may be useful. LINEARITY: The transform is linear. If xœk X. / and vœk V. /,then axœk C bvœk ax. / C bv. /:
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 3 RIGHT SHIFT IN TIME (DELAY): When shifting a signal in time, xœk 1 1 X. / C xœ 1 xœk 2 2 X. / C xœ 2 C 1 xœ 1 : xœk q q X. / C xœ q C 1 xœ q C 1 CC qc1 xœ 1 : CONVOLUTION: Discrete-time convolution is analogous to continuoustime convolution:.x v/œk D or; D kx xœi vœk i k id kx vœi xœk i : k : Then, assuming that xœk and vœk are zero for negative k, id.x v/œk X. /V. /: INITIAL-VALUE THEOREM: If xœk X. /, xœ D lim!1 X. /: FINAL-VALUE THEOREM: If a finite final value exists (all poles of X. / strictly inside the unit circle except perhaps for a single pole on the unit circle at D 1), lim k!1 xœk D lim. 1/X. /:!1 The table on the next page lists transforms for commonly encountered sampled time-domain signals:
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 4 Example table showing transform of sampled time-domain signals: Time function Laplace transform -Transform e.t/ E.s/ E. / 1.t/ t1.t/ 1 s t 2 2 1.t/ 1 s 3 t k 1 1.t/ e at 1.t/ te at 1.t/ t k e at 1.t/ 1 1 s 2 T. 1/ 2.k 1/Š s k 1 sca 1.sCa/ 2.k 1/Š.sCa/ k 1 e at a s.sca/ t 1 e at a a s 2.sCa/ T 2. C1/ 2. 1/ 3 k 1 @k 1 lim a!. 1/. 1/ k @k e at h i @a k 1 e at T e at. e at / h 2 i @a k e at.1 e at /. 1/. e at / Œ.aT 1Ce at / C.a e at ate at / a. 1/ 2. e at / at a2 1.1 C at/e ate at s.sca/ 2 1 e at. e at / 2 e at e bt sin.at/ cos.at/ e at sin.bt/ e at cos.bt/ b a.sca/.scb/ 1 e at cos.bt/ C a b sin.bt/ a 2 Cb 2 sœ.sca/ 2 Cb 2.e at e bt /. e at /. e bt / a sin.at / s 2 Ca 2 2 2 cos.at /C1 s. cos.at // s 2 Ca 2 2 2 cos.at /C1 b e at sin.bt /.sca/ 2 Cb 2 2 2 e at cos.bt /Ce 2aT sca 2 e at cos.bt /.sca/ 2 Cb 2 2 2 e at cos.bt /Ce 2aT.A CB/. 1/. 2 2 e at cos.bt /Ce 2aT / A D 1 e at cos.bt / C a sin.bt / b 1 ab C e at a.a b/ C e bt b.b a/ 1 s.sca/.scb/ B D e 2aT C e at a sin.bt / cos.bt / b.a CB/. e at /. e bt /. 1/ A D b.1 e at / a.1 e bt / ab.b a/ B D ae at.1 e bt / be bt.1 e at / ab.b a/
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 5 3.2: Working with the transform The following shows some correspondence between the -plane and some discrete-time unit-pulse-response signals. Unit step: hœk D 1Œk. H. / D 1 ; j j >1. 4 2 2 4 6 8 Exponential (geometric): hœk D a k 1Œk ; jaj <1. H. / D a ; j j > jaj. 4 2 2 4 6 8 General cosinusoid: hœk D a k cosœ!k 1Œk ; jaj <1.. a cos!/ H. / D 2 2a.cos!/ C a 2 for j j > jaj. The radius to the two poles is a; theangletothepolesis!. 4 2 2 4 6 8 The zero (not at the origin) has the same real part as the two poles. If! D, H. / D a :::geometric! If! D ; a D 1, H. / D 1 :::step! Pole radius a is the geometric factor, determines settling time. 1. jaj D; finite-duration response. e.g., ıœk N N. 2. jaj >1; growing signal that will not decay. 3. jaj D1; signal with constant amplitude; either step or cosine. 4. jaj <1; decaying signal. Small a =fastdecay(seebelow).
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 6 a.9.8.6.4 duration N 43 21 9 5 Pole angle! determines number of samples per oscillation. That is, if we require cosœ!k D cosœ!.k C N/,then N D 2 ˇ D 36 ˇ :! ˇrad! N D 3 ˇdeg Solid: cst. damping ratio. Dashed: constant natural frequency! n. N D 2 I. / N D 4 N D 5 N D 8 N D 1 N D 2 Plot to right shows discrete-time unit-pulse responses versus pole locations. R. / Discrete Impulse Responses versus Pole Locations
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 7 Correspondence with continuous-time signals Let g.t/ D e at cos.bt/1.t/. Suppose Then, a D :3567=T b D =4 T 9 = ; T D sampling period: gœk D g.kt / D e :3567 k k cos 1Œk 4 k D :7 k cos 1Œk : 4 (This is the cosinusoid example used in the earlier example). G.s/ has poles at s1;2 D a C jb and a jb. G. / has poles at radius e at angle! D bt or at e at jbt. So, 1;2 D e s 1T and e s 2T. In general, poles convert between the s-plane and -plane via D e st. EXAMPLE: Some corresponding pole locations: j T j T s-plane -plane
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 8 j!-axis maps to unit circle. Constant damping ratio maps to strange spiral. When considering system response to a step input for controls purposes, the following diagrams may be helpful: Good Good Good Damping Frequency! n Settling time Higher-order systems: Pole moving toward D 1, systemslowsdown. Zero moving toward D 1, overshoot. Pole and zero moving close to each other cancel.
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 9 3.3: Discrete-time state-space form Discrete-time systems can also be represented in state-space form. xœk C 1 D A d xœk C B d uœk yœk D C d xœk C D d uœk : The subscript d isusedheretoemphasizethat,ingeneral,the A, B, C and D matrices are different for discrete-time and continuous-time systems, even if the underlying plant is the same. Iwillusuallydropthe d andexpectyoutointerpretthesystemfrom its context. Formulating from transfer functions Discrete-time dynamics are represented as difference equations. e.g., yœkc3 Ca 1 yœkc2 Ca 2 yœkc1 Ca 3 yœk D b 1 uœkc2 Cb 2 uœkc1 Cb 3 uœk yœk Ca 1 yœk 1 Ca 2 yœk 2 Ca 3 yœk 3 D b 1 uœk 1 Cb 2 uœk 2 Cb 3 uœk 3 : This particular example has transfer function G. / D b 1 2 C b 2 C b 3 3 C a 1 2 C a 2 C a 3 D Y. / U. / : This transfer function may be converted to state-space in a very similar way to continuous-time systems. First, consider the poles: G p. / D 1 D V. / 3 C a 1 2 C a 2 C a 3 U. / vœk C 3 C a 1 vœk C 2 C a 2 vœk C 1 C a 3 vœk D uœk :
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 1 Choose current and advanced versions of vœk as state. h i T xœk D vœk C 2 vœk C 1 vœk : Then xœk C 1 D D 2 6 4 2 6 4 We now add zeros. vœk C 3 vœk C 2 vœk C 1 3 7 5 a 1 a 2 a 3 1 1 3 2 3 vœk C 2 7 6 5 4 vœk C 1 vœk 7 5 C G. / D b 1 2 C b 2 C b 3 3 C a 1 2 C a 2 C a 3 D Y. / U. / : 2 6 4 1 3 7 5 uœk : Break up transfer function into two parts. V. / contains all of the U. / poles of Y. / U. /.Then, Y. / D b 1 2 C b 2 C b 3 V. /: Or, Then xœk C 1 D yœk D yœk D b 1 vœk C 2 C b 2 vœk C 1 C b 3 vœk : 2 6 4 h a 1 a 2 a 3 1 3 2 3 vœk C 2 7 6 5 4 1 i h b 1 b 2 b 3 xœk C vœk C 1 vœk i uœk : 7 5 C 2 6 4 1 3 7 5 uœk
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 11 Many discrete-time transfer functions are not strictly proper. Solve by polynomial long division, and setting D equal to the quotient. In MATLAB, [A,B,C,D]=tf2ss(num,den) converts a transfer function form to state-space form (same syntax as for cts.-time, but num and den must have same order, maybe zero padded). As with continuous-time systems, we have a lot of freedom when making state-space models (i.e., inchoosingcomponentsofxœk ). Canonical forms In discrete-time we have the same canonical forms: Controller, observer, controllability, observability, modal, and Jordan. They are derived in the same way, as demonstrated above for the controller form. Ablockdiagramforcontrollerformis: b 1 b2 yœk uœk x 1c x 2c x 3c 1 1 1 b 3 a 1 a2 a 3 Time (dynamic) response Homogeneous part First, consider the scalar case xœk C 1 D axœk ; xœ :
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 12 Take -transform. X. / D. a/ 1 xœ : Inverse -transform. xœk D a k xœ. Similarly, the full solution (vector case) is Aside: Nilpotent systems xœk D A k xœ : A is nilpotent if some power of n exists such that A n D : A does not just decay to zero, it is exactly zero! This might be a desirable control design! (Why?) You might imagine that all the eigenvalues of A must be zero for this to work. Forced solution The full solution is: xœk D A k xœ C Xk 1 j D A k 1 j BuŒj : ƒ convolution This can be proved by induction from the equation xœk C 1 D AxŒk C BuŒk ; xœ Clearly, if yœk D CxŒk C DuŒk ; yœk D CA k xœ C ƒ initial resp: Xk 1 j D CA k 1 j BuŒk ƒ convolution C DuŒk : ƒ feedthrough
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 13 3.4: More on discrete-time state-space models State-space to transfer function Start with the state equations -transform or and So, xœk C 1 D AxŒk C BuŒk yœk D CxŒk C DuŒk : X. / xœ D AX. / C BU. / Y. / D CX. / C DU. /. I A/X. / D BU. / C xœ X. / D. I A/ 1 BU. / C. I A/ 1 xœ Y. / D ŒC. I A/ 1 B C D ƒ transfer function of system Y. / U. / D C. I A/ 1 B C D Same form as for continuous-time systems. Poles of system are roots of detœ I A D. U. / C C. I A/ ƒ 1 xœ : response to initial conditions Transformation State-space representations are not unique. Selection of state x are quite arbitrary.
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 14 Analyze the transformation of xœk C 1 D AxŒk C BuŒk yœk D CxŒk C DuŒk Let xœk D TwŒk,whereT is an invertible (similarity) transformation matrix. wœk C 1 D T 1 AT ƒ AN yœk D Same as for continuous-time. wœk C ƒ T 1 B uœk NB ƒ CT wœk C ƒ D uœk NC ND so; wœk C 1 D N AwŒk C NBuŒk yœk D NCwŒk C NDuŒk : Converting plant dynamics to discrete time Combine the dynamics of the zero-order hold and the plant. uœk ZOH u.t/ A; B; C; D y.t/ The continuous-time dynamics of the plant are: Px.t/ D Ax.t/ C Bu.t/ y.t/ D Cx.t/C Du.t/: Evaluate x.t/ at discrete times. Recall x.t/ D xœk C 1 D x..k C 1/T / D Z t e A.t / Bu./d Z.kC1/T e A..kC1/T / Bu./d
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 15 With malice aforethought, break up the integral into two pieces. The first piece will become A d times x.kt/. Thesecondpartwillbecome B d times u.kt /. D D Z kt Z kt D e AT x.kt/ C e A..kC1/T / Bu./d C e AT e A.kT / Bu./d C Z.kC1/T kt Z.kC1/T kt Z.kC1/T kt e A..kC1/T / Bu./d: e A..kC1/T / Bu./d e A..kC1/T / Bu./d In the remaining integral, note that u./ is constant from kt to.k C 1/T; and equal to u.kt /; let D.k C 1/T I D.k C 1/T I d D d. Z T x..k C 1/T / D e AT x.kt/ C e A B d u.kt / Z T or; xœkc 1 D e AT xœk C e A B d uœk : So, we have a discrete-time state-space representation from the continuous-time representation. where A d D e AT ;B d D Similarly, xœk C 1 D A d xœk C B d uœk Z T That is, C d D C ; D d D D. e A B d. yœk D CxŒk C DuŒk : Calculating A d, B d, C d and D d Cd and D d require no calculation since C d D C and D d D D.
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 16 Ad is calculated via the matrix exponential A d D e AT.Thisisdifferent from taking the exponential of each element in AT. If MATLAB is handy, you can type in Ad=expm(A *T) If MATLAB is not handy, then you need to work a little harder. Recall from the previous set of notes that e At D L 1 Œ.sI A/ 1.So, e AT D L 1 Œ.sI A/ 1 ˇˇtDT ; which is probably the easiest way to work it out by hand. Or, e AT D I C AT C A2 T 2 C A3 T 3 C 2Š 3Š which is a convergent series so may be approximated with only afew terms. Now we focus on computing Bd.Recallthat if A 1 exists. B d D Z T Z T e A B d D I C A C A 22 2 C ::: B d D IT C A T 2 3 2Š C A2T 3Š C ::: B D A 1.e AT I/B D A 1.A d I/B; So, calculating Bd is easy once we have already calculated A d. Also, in MATLAB, [Ad,Bd]=c2d(A,B,T)
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 17 3.5: Linear time-varying and nonlinear discrete-time systems Linear time-varying discrete-time systems Alineartime-varyingsystemcanbewrittenas xœk C 1 D AŒk xœk C BŒk uœk yœk D CŒk xœk C DŒk uœk : Analysis is somewhat easier than for the continuous-time counterpart. Consider first the homogeneous case xœk C 1 D AŒk xœk ; xœk D x ; k : The solution to this is xœk D ˆŒk; k x where ˆŒk; k D 8 < I; k D k : AŒk 1 AŒk 2 AŒk ; k > k : We see that the state-transition matrix can be computed readily, and does not involve any difficult integrals. Some properties of the state-transition matrix include: ˆŒk C 1; k D AŒk ˆŒk; k ˆŒk ;k D I ˆŒk; s ˆŒs; D ˆŒk; : The solution to the nonhomogeneous case can be shown to be xœk D ˆŒk; k x C Xk 1 Dk ˆŒk; C 1 BŒ uœ
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 18 yœk D CŒk ˆŒk;k x C Xk 1 Nonlinear discrete-time systems Dk CŒk ˆŒk; C 1 BŒ uœ C DŒk uœk : The approach to working with nonlinear discrete-time systems is similar to that used for nonlinear continuous-time systems. We can linearize around an equilibrium point or around a solution trajectory. We define a nonlinear state-space form as xœk C 1 D f.xœk ;uœk / Linearizing around an equilibrium point yœk D g.xœk ; uœk /: We can linearize around an equilibrium point if there exists an equilibrium constant solution uœk D u eq ; xœk D x eq ; yœk D y eq : Then, let the actual input signal and initial state be written as uœk D u eq C ıuœk ; xœk D x eq C ıx eq Œk for small ıuœk. Then, we can write actual state and output as xœk D x eq C ıxœk ; yœk D y eq C ıyœk : Following the same process used in the prior chapter, the linearized perturbation system is
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 19 ıxœk C 1 D AıxŒk C BıuŒk ıyœk D CıxŒk C DıuŒk ; where the linearized state-space matrices are df.x eq ;u eq / df.x eq ;u eq / A D I B D dx du dg.x eq ;u eq / dg.x eq ;u eq / C D I D D dx du and the overall state and output can be computed as xœk D x eq C ıxœk and yœk D y eq C ıyœk : Linearizing around a solution trajectory Alternately, suppose it is known that u sol Œk ; x sol Œk ; y sol Œk form a time-varying solution to the nonlinear dynamics of the system. This means that x sol Œk C 1 D f.x sol Œk ; u sol Œk / y sol Œk D g.x sol Œk ; u sol Œk /: Then, let general input, state, and output be uœk D u sol Œk C ıuœk xœk D x sol Œk C ıxœk yœk D y sol Œk C ıyœk : Proceeding as before, we find the perturbation system
ECE452/552, STATE-SPACE DYNAMIC SYSTEMS DISCRETE-TIME 3 2 df.x sol ;u sol / df.x sol ;u sol / ıxœk C 1 ıxœk C ıuœk dxœk duœk ƒ ƒ AŒk BŒk dg.x sol ;u sol / dg.x sol ;u sol / ıyœk ıxœk C ıuœk : dxœk duœk ƒ ƒ CŒk DŒk The overall state and output can be computed as xœk D x sol C ıxœk and yœk D y sol C ıyœk : Notice that even if the nonlinear system is time-invariant, the linearized system will be time-varying, in general. Where to from here? We have now seen how to model both continuous-time and discrete-time systems in state-space form. There are many commonalities between the two, which we will take advantage of in the remainder of the course. The main difference is in interpreting the result. For example, Eigenvalues of the continuous-time A matrix correspond to s-plane locations, and should be in the left-half s-plane for stability; Eigenvalues of the discrete-time A matrix correspond to -plane locations, and should be in the unit circle for stability. In fact, stability is a very important concept, which must be evaluated and ensured before we talk more about control. This will be our next topic.