Lecture "Fundamentals of control systems - Chapter 9: Design of discrete control systems" presentation of content: Introduction, discrete lead - lag compensator and PID controller, design discrete systems in the Z domain,.... Invite you to reference.
Lecture Notes Fundamentals of Control Systems Instructor: Assoc Prof Dr Huynh Thai Hoang Department of Automatic Control Faculty of Electrical & Electronics Engineering Ho Chi Minh City University of Technology Email: hthoang@hcmut.edu.vn huynhthaihoang@yahoo.com Homepage: www4.hcmut.edu.vn/~hthoang/ www4 hcmut edu vn/ hthoang/ December 2013 © H T Hoang - www4.hcmut.edu.vn/~hthoang/ Chapter DESIGN OF DISCRETE CONTROL SYSTEMS December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Content Introduction Discrete lead – lag compensator and PID controller Design discrete systems in the Z domain Controllability and observability of discrete systems Design D i state t t feedback f db k controller t ll using i pole l placement Design state estimator December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Discrete lead lag compensators and PID controllers December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Control schemes Serial compensator R(z) + T GC(z) ZOH G(z) Y(z) H( ) H(z) State feedback control r(k) + u(k) x (k 1) Ad x (k ) Bd u (k ) x(t) Cd y(k) K December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Transfer function of discrete difference term u(k) e(k) D Differential term: dde(t ) u (t ) dt e( kT ) e[( k 1)T ] Discrete difference: u ( kT ) T E ( z ) z 1 E ( z ) U ( z) T Transfer function of the discrete difference term: z 1 GD ( z ) T z December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Transfer function of discrete integral term e(t) I t Integral l u(t) t Continuous integral:u(t ) e( )d Di Discrete t integral: i t l u ( kT ) = u[( k - 1)T ] + U ( z ) z 1U ( z ) kT ( k 1)T kT 0 ( k 1)T u (kT ) e( )d e( )d e( )d kT T e ( t ) d t = u [( k 1) T ] + (e[( k - 1)T ] + e(kT ) ò ( k -1) T T 1 z E( z) E( z) TF of discrete integral term: GI ( z ) T z z 1 December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ Transfer function of discrete PID controller C ti Continuous PID controller: t ll K GPID ( s ) K P K D s s Discrete PID controller: KIT z KD z GPID ( z ) K P z 1 T z P or D z KD z GPID ( z ) K P K I T z 1 T z P December 2013 I I D © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Digital PID controller r(k) (k) + e(k) PID u(k) D/A G(s) y(k) A/D KIT z KD z U ( z) G PID ( z ) KP E( z) z 1 T z u( k ) u( k 1) K P [e( k ) e( k 1)] ) KIT KD [e( k ) e( k 1)] [e( k ) 2e( k 1) e( k 2)] T December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ Digital PID control programming float PID_control(float PID control(float setpoint, setpoint float measure) { ek_2 = ek_1; ek_1 = ek; ek = setpoint – measure; uk_1 = uk; uk = uk_1 uk + Kp Kp*(ek (ek-ek_1) ek 1) + Ki Ki*T/2*(ek+ek T/2 (ek+ek_1) 1) +… + Kd/T*(ek – 2ek_1+ek_2); If uk > umax, uk = umax; If uk < umin, uk = umin; return(uk) } Note: Kp, Ki, Kd, uk, uk_1, ek, ek_1, ek_2 must be declared as global variables;; uk_1,, ek_1 and ek_e must be initialized g to be zero; umax and umin are constants December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 10 Discrete pole placement design – Example (cont’) Balancing the coefficients of the closed loop characteristic equation and the desired characteristic equation, we have: (0.005k1 0.095k2 1.905) 1.03 (0.0045k1 0.095k2 0.905) 0.448 k1 44.0 k2 6.895 Conclusion: K 4 4.0 6.895 z (0.005k1 0.095k 1.905) z (0.0045k1 0.095k 0.905) z 1.03 z 0.448 December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 51 Discrete pole placement design – Example (cont’) Calculate system response and performances: State space equation of the closed-loop system: x(k 1) Ad Bd K x(k ) Bd r (k ) c(k ) Cd x(k ) Student continuous to calculate the response and performance by themselves following the method presented in the chapter December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 52 D i off discrete Design di t state t t estimators ti t December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 53 The concept of state estimation To be able to implement state feedback control system, it is required to measure all the states of the system system However, in some application, we can only measure the output, but cannot measure the states of the system The problem is to estimate the states of the system from the output measurement measurement State estimator ((or state observer)) December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 54 Observability x( k 1) Ad x( k ) Bd u ( k ) Consider the system: y ( k ) Cd x( k ) The system is complete state observable if given the control law u(k) and the output signal y(k) in a finite time interval k0 k kf , it is possible to determine the initial states x(k0) Qualitatively, the system is state observable if all state t t variable i bl x(k) (k) influences i fl th the output t t y(k) (k) December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 55 Observability condition System x( k 1) Ad x( k ) Bd u ( k ) y ( k ) Cd x( k ) It is require to estimate the state xˆ (k ( k ) from mathematical model of the system and the input-output data Cd C A d Observability matrix: O Cd Ad2 Cd Adn 11 The necessary y and sufficient condition for the observability: y rank (O ) n December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 56 Observability – Example x(k 1) Ad x(k ) Bd u (k ) Given the system y ( k ) C d x( k ) 0.231 0.967 0.148 Cd 1 3 Bd where: Ad 0.264 0.297 0.522 Analyze the observability of the system Solution: Observability matrix: Cd O C A d d Because det(O ) 1.484 O 077 714 rank (O ) The system is observable December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 57 State estimator u(k) x(k) x(k 1) Ad x(k ) Bd u(k ) Cd + L Bd xˆ (k 1) + + + z 1 y(k) xˆ (k (k ) Cd yˆ (k ) Ad xˆ ( k 1) Ad xˆ ( k ) Bd u ( k ) L( y ( k ) yˆ ( k )) State estimator: yˆ ( k ) Cd xˆ ( k ) where: L [l1 December 2013 l2 ln ] T © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 58 Design of state estimators Requirements: The state estimator must be stable, estimation error should approach to zero Dynamic response of the state estimator should be fast enough in comparison with that of the control loop It is required to chose L satisfying: All the roots of the equation det( zI Ad LC d ) l locates t inside i id th the unit it circle i l iin th the z-plane l The roots of det( zI Ad LCd ) are further from the unit ccircle u c e than a the e roots oo s o of det(( zI Ad Bd K ) Depending on the design of L, we have different state estimator: Luenberger g state observer Kalman filter December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 59 Procedure for designing the Luenberger state observer St Step 1: Write W it the th characteristic h t i ti equ off the th state t t observer b det[ zI Ad LCd ] (1) Step 1: Write the desired characteristic equation: n (z p ) i 1 i (2) pi , (i 1, n ) are the desired poles of the state estimator Step St 3: Balance B l th the coefficients ffi i t off the th characteristic h t i ti equations (1) and (2), we can find the gain L December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 60 Design of state estimators – Example Problem: Given a system described by the state equation: x( k 1) Ad x( k ) Bd u( k ) y ( k ) Cd x( k ) 0.967 0.148 Ad 297 522 0.231 Bd 264 Cd 1 3 Assuming that the states of the system cannot be directly measured Design the Luenberger state estimator so that the poles of the state estimator lying at 0.13 13 and 0.36 36 December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 61 Design of state estimators – Example (cont’) Solution The characteristic equation of the Luenberger state estimator: det[ zI Ad LCd ] 1 0 0.967 0.148 l1 det z 1 0.297 0.522 l 1 3 2 z 0.967 l1 det 0.297 l 0.148 3l1 0 z 0.522 3l2 z (l1 3l2 1.489) z ( 1.413l1 2.753l2 0.549) (1) The desired characteristic equation: ( z 0.13)( z 0.36) December 2013 z 0.49 z 0.0468 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ (2) 62 Design of state estimators – Example (cont’) Balancing the coefficients of the equations (1) and (2): l1 3l2 1.489 0.49 1.413l1 2.753l2 0.549 0.0468 Solve the above set of equations equations, we have: l1 2.653 l2 1.544 Conclusion December 2013 L 2.653 1.544 T © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 63 Simulation of discrete state estimator December 2013 © H T Hồng - www4.hcmut.edu.vn/~hthoang/ 64 State estimation simulation result December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 65 ... zC 0 .99 Step 3: Calculate the pole of the lag compensator: pC 1 (1 zC ) 1 0. 099 (1 0 .99 ) pC 0 .99 9 z 0 ,99 GC ( z ) KC s 0 ,99 9 Step 4: Determine the gain of the... )G ( z ) z z* K C ( z 0 .99 ) (0.21z 0.18) 1 ( z 0 .99 9) ( z 1)( z 0.607) z 0. 699 j 0.547 K C 1.007 December 2013 © H T Hoàng - ÐHBK TPHCM 29 Design discrete lag compensator... Then: KV 9. 9 * KV 100 0, 099 December 2013 © H T Hoàng - www4.hcmut.edu.vn/~hthoang/ 28 Design discrete lag compensator using RL – Example (cont’) Step 2: Chose the zero of the lag