Discrete-time Controllers

Similar documents
Discrete-time models and control

Methods for analysis and control of. Lecture 6: Introduction to digital control

Digital implementation of discrete-time controllers

Distributed Real-Time Control Systems

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Automatique. A. Hably 1. Commande d un robot mobile. Automatique. A.Hably. Digital implementation

Chapter 7. Digital Control Systems

LABORATORY OF AUTOMATION SYSTEMS Analytical design of digital controllers

Control System Design

Chapter 13 Digital Control

CONTROL OF DIGITAL SYSTEMS

Control of Single-Input Single-Output Systems

Digital Control Systems

Time Response Analysis (Part II)

DESIGN USING TRANSFORMATION TECHNIQUE CLASSICAL METHOD

1 x(k +1)=(Φ LH) x(k) = T 1 x 2 (k) x1 (0) 1 T x 2(0) T x 1 (0) x 2 (0) x(1) = x(2) = x(3) =

DIGITAL CONTROLLER DESIGN

State Regulator. Advanced Control. design of controllers using pole placement and LQ design rules


STABILITY ANALYSIS TECHNIQUES

EE451/551: Digital Control. Chapter 3: Modeling of Digital Control Systems

Lecture: Sampling. Automatic Control 2. Sampling. Prof. Alberto Bemporad. University of Trento. Academic year

Systems Analysis and Control

Introduction to Digital Control. Week Date Lecture Title

Time Response of Systems

DIGITAL CONTROL OF POWER CONVERTERS. 2 Digital controller design

Solutions to Skill-Assessment Exercises

4F3 - Predictive Control

LABORATORY INSTRUCTION MANUAL CONTROL SYSTEM II LAB EE 693

Ingegneria dell Automazione - Sistemi in Tempo Reale p.1/28

Optimal Polynomial Control for Discrete-Time Systems

ESC794: Special Topics: Model Predictive Control

Dr Ian R. Manchester

ECE317 : Feedback and Control

Department of Electrical and Computer Engineering ECED4601 Digital Control System Lab3 Digital State Space Model

DIGITAL CONTROL OF POWER CONVERTERS. 3 Digital controller design

Problem Set 3: Solution Due on Mon. 7 th Oct. in class. Fall 2013

Recursive, Infinite Impulse Response (IIR) Digital Filters:

Lecture 3 - Design of Digital Filters

Department of Electrical and Computer Engineering. EE461: Digital Control - Lab Manual

EE480.3 Digital Control Systems. Part 2. z-transform

Observer Incorporated Neoclassical Controller Design: A Discrete Perspective

CONTROL DESIGN FOR SET POINT TRACKING

Modelling and Control of Dynamic Systems. Stability of Linear Systems. Sven Laur University of Tartu

Richiami di Controlli Automatici

AN EXTENSION OF GENERALIZED BILINEAR TRANSFORMATION FOR DIGITAL REDESIGN. Received October 2010; revised March 2011

Topic # Feedback Control. State-Space Systems Closed-loop control using estimators and regulators. Dynamics output feedback

Homework 7 - Solutions

Chapter 6 - Solved Problems

Lecture 11. Frequency Response in Discrete Time Control Systems

Chapter 2. Classical Control System Design. Dutch Institute of Systems and Control

EEE582 Homework Problems

Control Systems Lab - SC4070 Control techniques

Lecture 5: Linear Systems. Transfer functions. Frequency Domain Analysis. Basic Control Design.

Control Systems! Copyright 2017 by Robert Stengel. All rights reserved. For educational use only.

Module 6: Deadbeat Response Design Lecture Note 1

Control Design. Lecture 9: State Feedback and Observers. Two Classes of Control Problems. State Feedback: Problem Formulation

Chapter 6 State-Space Design

Chapter 3 Data Acquisition and Manipulation

A FEEDBACK STRUCTURE WITH HIGHER ORDER DERIVATIVES IN REGULATOR. Ryszard Gessing

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Fall 線性系統 Linear Systems. Chapter 08 State Feedback & State Estimators (SISO) Feng-Li Lian. NTU-EE Sep07 Jan08

Classify a transfer function to see which order or ramp it can follow and with which expected error.

Control Systems I. Lecture 7: Feedback and the Root Locus method. Readings: Jacopo Tani. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

CDS Solutions to Final Exam

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Exam in Automatic Control II Reglerteknik II 5hp (1RT495)

ECE317 : Feedback and Control

Dynamic Response. Assoc. Prof. Enver Tatlicioglu. Department of Electrical & Electronics Engineering Izmir Institute of Technology.

EE Experiment 11 The Laplace Transform and Control System Characteristics

Problem Set 5 Solutions 1

Signal sampling techniques for data acquisition in process control Laan, Marten Derk van der

Introduction to Feedback Control

Control Systems I. Lecture 6: Poles and Zeros. Readings: Emilio Frazzoli. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

1 Continuous-time Systems

Chap 4. State-Space Solutions and

Rational Implementation of Distributed Delay Using Extended Bilinear Transformations

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering 2.04A Systems and Controls Spring 2013

6.1 Sketch the z-domain root locus and find the critical gain for the following systems K., the closed-loop characteristic equation is K + z 0.

10/8/2015. Control Design. Pole-placement by state-space methods. Process to be controlled. State controller

INTRODUCTION TO DIGITAL CONTROL

EE480.3 Digital Control Systems. Part 7. Controller Design I. - Pole Assignment Method - State Estimation

EECS C128/ ME C134 Final Thu. May 14, pm. Closed book. One page, 2 sides of formula sheets. No calculators.

Systems Analysis and Control

Exam. 135 minutes, 15 minutes reading time

Analysis of Discrete-Time Systems

Dr. Ian R. Manchester

Lecture 9 Infinite Impulse Response Filters

Discretization of MIMO Systems with Nonuniform Input and Output Fractional Time Delays

Discrete Systems. Step response and pole locations. Mark Cannon. Hilary Term Lecture

Optimal Discretization of Analog Filters via Sampled-Data H Control Theory

Automatic Control 2. Loop shaping. Prof. Alberto Bemporad. University of Trento. Academic year

D(s) G(s) A control system design definition

Fast Step-response Evaluation of Linear Continuous-time Systems With Time Delay in the Feedback Loop

EE402 - Discrete Time Systems Spring Lecture 10

EE451/551: Digital Control. Final Exam Review Fall 2013

Feedback Control of Linear SISO systems. Process Dynamics and Control

Control System Design

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 1354 MODERN CONTROL SYSTEMS

Module 5: Design of Sampled Data Control Systems Lecture Note 8

Transcription:

Schweizerische Gesellschaft für Automatik Association Suisse pour l Automatique Associazione Svizzera di Controllo Automatico Swiss Society for Automatic Control Advanced Control Discrete-time Controllers r + e E(z) discrete-time part G c (z) u U(z) y Y(z) ZOH T continuous-time part G(s) y Scope Keywords Prerequisites Contact Learn how to design discrete-time controllers for linear systems either by approximation of continuous-time controller or by design of discrete-time controllers from discrete-time plant models. Modelling of discrete-time systems, Direct design of discretetime systems, Discrete-time approximation of continuous-time controllers Continuous-time models of LTI systems, Discrete-time models of LTI systems, z Transform Silvano Balemi, silvano.balemi@ieee.org Version. Date April 7, 2

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC 2 Silvano Balemi April 7, 2

Contents Introduction................................ 4 2 Feedback and stability of discrete-time systems............ 4 3 Approximation of continuous-time controllers............. 6 3. Euler approximation of the integration............. 6 3.2 Bilinear trasformation...................... 8 3.3 Bilinear trasformation with prewarping............. 8 3.4 Pole and zero matching...................... 9 4 Design of controllers from discrete-time plant models......... 4. Polynomial-based design of controller.............. 4.2 Controllers from the closed-loop transfer function....... 4.3 Discrete-time state-feedback controller............. 2 A Double integrator system (Franklin, Powell, Workman, pb.3)... 2 B Stability and sampling time (Franklin, Powell, Workman)....... 2 C Discrete-time controller with continuous-time process......... 24 April 7, 2 Silvano Balemi 3

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC Introduction The availability of performant embedded computing devices has widened the application area of digital control, which is all-encompassing, except for very specific niches. In the present document, some basic methods for the design of discretetime controllers is presented. The two main design method classes are based on the approximation of continuous-time controllers, respectively on the design of discretetime controllers from discrete-time plant models. The analysis presented in this document start from the discrete-time model of the plant given in Figure where the discrete-time transfer function G ZOH relates u to y. u u e st y y G(s) T U(z) s T Y(z) G ZOH (z) Figure : System with sampling and zero order hold First, the discrete-time closed-loop system is presented, and then the two design method classes mentioned above presented. 2 Feedback and stability of discrete-time systems As in continuous-time system, the feedback modifies the behaviour and thus the stability of the system. In case of discrete-time systems the sampling time is a key element to consider. Given is a closed-loop system with a discrete-time controller after the block diagram of Figure 2. This system is modelled mathematically as in Figure 3. r + e E(z) discrete-time part G c (z) u U(z) y Y(z) ZOH T continuous-time part G(s) Figure 2: Continuous-time process with digital controller. y The transfer function G(s) is the continuous-time model of the plant. The sampling models the A/D converters. The result of the sampling is a function Y(z), the mathematical description in the frequency domain of the sampled signal y (t). 4 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers The control program is modelled by a transfer function G c(s) (equivalent to G c (z)) which creates a train of impulses u (t) from the train of impulses e (t) representing the control error. Finally, the zero order hold models the D/A converter which creates a continuoustime signal from the series calculated by the control program (see Figure 3). program D/A conv model model r e u G c (z) ZOH T + E(z) U(z) process model G(s) y A/D conv model y T Y(z) Figure 3: Various parts of a discrete-time closed-loop system. With the definition of G zoh already seen before (z transform of the plant with a ZOH) the closed-loop transfer function is obtained: G cl (z) = Y(z) R(z) = G zoh(z) G c (z) +G zoh (z) G c (z) () Example Given is the sampled system with zero order hold and transfer function G(s) = s+ as in Figure 4. The time interval for the sampling must be determined which keeps r T + y u U(z) T e st s G(s) y Figure 4: Closed-loop system with sampling and ZOH y T Y(z) the closed-loop system stable. The closed-loop transfer function is given by where G zoh = Y(z)/U(z). Then G zoh (z) = Z s ( G cl (z) = G zoh(z) +G zoh (z) e st ) = z ( Z s ( s (s+) z s )) s+ April 7, 2 Silvano Balemi 5

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC and the explicit computation of the z transform gives G zoh (z) = z z ( ) z z z = e T z e T z e T This result introduced into the expression of G cl (z) gives G cl (z) = e T z ( e T ) Note that the pole of G cl (z) is ( e T ): it is inside of the unit circle only if < T < ln ( ) 9 3 Approximation of continuous-time controllers In order to obtain the controller it is possible to design a continuous-time controller G c (s) first and then to transform it to a discrete-time controller G c (z) with an approximation, see figure 5. This works particularly well when the sampling time of the system is high with respect to the system dynamics. e E(z) ZOH G c (s) u u T U(z) Figure 5: Discrete-time approximation of continuous-time controllers. In the sequel two methods both approximating the integrator will be presented: the Euler and the Tustin approximation. Moreover, in order to improve the s approximation, the prewarping will be presented. 3. Euler approximation of the integration With the Euler approximation the operator is transformed into the discrete-time s domain. Let s consider the integration of a signal u(t) y(t) = with the equivalent Laplace transform t u(t) dt Y(s) = s U(s) The Euler approximation delivers the recursive equation y(kt) = y((k ) T)+u(kT) T 6 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers at time t = k T. The z transform of this equation gives Y(z) = z Y(z)+T U(z) Y(z) = T z z U(z) Note that the integrator has been transformed to its approximation according to s T z z This approximation is not a surprise: in fact it correspond to the discrete-time transfer function of a continuous-time integrator with transfer function s. The Euler approximation of the derivative is given by the recursive equation whose z transform is y(kt) = y(t) = du dt u(kt) u((k ) T) T Y(z) = z U(z) = z T T z U(z) which confirms the approximation (2). Thus, in a continuous-time transfer function of the controller it is sufficient to replaceswithz usingtheapproximationfromequation(2)inordertofindadiscretetime controller. Example 2 Let s consider a PID controller of the form G c = P + I s +D s found in continuous-time e.g. thanks to some empirical methods like the Ziegler- Nichols approach. The discrete-time approximation of the controller becomes G c (z) = U(z) E(z) The corresponding recursive equation is T z z = P +I +D z T z u k = P (e k e k )+I T e k +u k + D T (e k 2 e k +e k 2 ) or ( u k = u k + P +I T + D ) ( e k P +2 D ) e k + D T T T e k 2 An alternative for obtaining a discrete-time PID controller is given by the separate transformation of the integrator x k which leads to the form x k = x k +I T e k (2) u k = P e k +x k + D T (e k e k ) April 7, 2 Silvano Balemi 7

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC Example 3 Given is the controller G c (s) = s+ The discrete-time approximation of the controller is given by the discrete-time transfer function G c (z) = z + = T z z (+ T) T z while the corresponding recursive form is 3.2 Bilinear trasformation u k = (T e k +u k ) + T The bilinear approximation, also called Tustin approximation, replaces s with z as follows s = 2 T z z + This approximation is less critical than that of Euler when the sampling frequency is close to the system dynamics. The same procedure for obtaining the discrete-time controller can be followed as with the Euler approximation. 3.3 Bilinear trasformation with prewarping The Tustin approximation warps the frequency response of the system. In order to see this consider the approximation of C(z) z=e jωts which is C ( 2 T z ) z + z=e jωts ( ) 2 = C T ejωts e jωts + = C 2 ωts ωts j ej 2 e 2 T e j ωts ωts j 2 +e 2 = C 2 ωts ωts j ( ej 2 e 2 T e j ωts ωts = C j 2 ( )) j 2 +e 2 T tan ωts 2 Compared to C(jω) this means that a given ) frequency ω is moved by the Tustin approximation to the frequency 2 T tan( ωt s 2, thus causing a warp of the frequency axes. In order to counteract this effect, the original frequency can be prewarped, in such a way that after the warp the correct frequencies are obtained. Then the following procedure can be followed:. Findthediscrete-timeequivalenttransferfunctionG ZOH (z)fromthecontinuoustime transfer function G(s). 8 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers 2. Prewarp the frequencies by applying the inverse Tustin approximation z = 2+T s w 2 T s w to the discrete-time transfer function G ZOH (z). This gives a new transfer function G(w) in a pseudo-continuous time-domain denoted by the variable w. 3. Design a controller G c (w) starting from the process model G(w) in the pseudocontinuous time domain the control problem can be dealt with like in the standard continuous-time domain with the use of classical continuous-time analysis and design methods. 4. Once the controller G c (w) has been designed, it is possible to obtain the controller G c (z) by applying the inverse bilinear trasform to G c (w) with the substitution w = 2 T s z z + The four steps above can be performed in MATLAB with the following sequence of commands G(s) c2d(..., zoh ) G ZOH (z) d2c(..., tustin ) G(w) G c (w) c2d(..., tustin ) G c (z) 3.4 Pole and zero matching This method consists in shaping the approximant on the basis of its poles, zeros and gain. The discrete-time poles and zeros are computed as the images the continuoustime poles under the mapping z = e s T. If G(s) has infinite zeros the corrisponding discrete-time poles can be chosen at -. The gain is chosen such as to provide a good approximation around a desired frequency. The following example illustrates this approach. Example 4 Consider a controller with the following continuous-time transfer function: G(s) = + s s whose pole and zero are mapped as follows: So G(z) has the form pole: s = z = e T = zero: s = z = e T G(z) = k z e T z April 7, 2 Silvano Balemi 9

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC The gain k is to be determined in order to equalize the gains of G(s) and G(z) at a desired frequency. In the objective to improve the precision of approximation at high frequencies, the gain should be mached at high frequencies, so + s s = k z e T s z z= giving 2 k = +e T Finally, the discrete-time approximant becomes G(z) = 2 +e T z e T z 4 Design of controllers from discrete-time plant models For simple problems it is often sufficient to find a coarse approximation of a continuoustime controller in order to satisfy the control specifications. An alternative which often delivers better results, in particular when the sampling frequency is of the same order of the dynamics of the system, is the design of a discrete-time controller G c (z) starting from the discrete-time model G ZOH (z) of the process to be controlled. The only problem, which sometime limits its use, is the necessity to use the discrete-time model of the process. 4. Polynomial-based design of controller It is possible to determine the controller from the discrete-time model of the process Let s consider a process of order n with transfer function G(z) = N(z) D(z) = b n z n +b n z n +b n 2 z n 2 +...+b z n +a n z n +a n 2 z n 2 +...+a where N(z) is the numerator polynomial and D(z) is the denominator polynomial of the transfer function. A controller of order m of the form C(z) = N C(z) D C (z) = c m z m +c m z m +c m 2 z m 2 +...+c (3) z m +d m z m +d m 2 z m 2 +...+d gives the transfer function for the closed-loop system G cl (z) = C(z) G(z) +C(z) G(z) = N C (z) N(z) N C (z) N(z)+D C (z) D(z) Thus there are n+m modes (i.e. the zeroes of the polynomial N C (z) N(z)+D C (z) D(z)) and 2 n+ controller parameters. If there are more parameters then poles to place, i.e. if n+m 2 m+ m n all closed-loop system poles can be exactly placed. Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers 4.2 Controllers from the closed-loop transfer function Another final possibility for determining a controller direclty in discrete-time is to start from a desired closed-loop transfer function and to solve the closed-loop transfer function for the controller transfer function according to G c (z) = G ZOH (z) G cl (z) G cl (z) (4) The computation of G c (z) can be implemented in MATLAB with the following code function d=h2d(g,h) %% %% function d=h2d(g,h) %% gg=tf(g); hh=tf(h); gn,gd]=tfdata(gg, v ); hn,hd]=tfdata(hh, v ); n=conv(gd,hn); m,n]=size(hd); m2,n2]=size(hn); den=zeros(size(hd)); l=n-n2; for i=:l den(i)=hd(i); end for i=:n2 den(l+i)=hd(l+i)-hn(i); end d=conv(gn,den); d=tf(n,d,gg.ts); It must be taken care not to cancel from G cl (z) delays present in G ZOH (z) cancel poles of G ZOH (z) (this causes non observability or non controllability of the system: this is especially critical in particular if the cancelled poles are unstable ) The first point introduces non causality of the form u(k) = e(k +p) implying the knowledge of future values of e(k). The corresponding transfer function G c (z) iis not proper, i.e. the degree of the numerator is larger than that of the denominator. The next example shows such a case. April 7, 2 Silvano Balemi

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC Example 5 Given is the discrete-time process G ZOH (z) = (z ) (z.5) With the transfer function of the controlled process the discrete-time controller is G cl (z) = z G c (z) = (z ) (z.5) z ( z ) = z.5 The corresponding difference equation u(k) = e(k +).5 e(k) which means that the error e(k +) should be known in advance. 4.3 Discrete-time state-feedback controller Exactly like for a continuous-time system it is possible to determine a state-feedback matrix K such that the system matrix (Φ(T) Γ(T) K) of the closed-loop system shows the desired eigenvalues, that is the closed-loop systems has the desired dynamics. The state-space representation becomes y { xk+ = Φ x k +Γ u k = Φ x k +Γ ( K x k +r k ) = (Φ Γ K) x k +Γ r k = C x k +D u k = C x k +D ( K x k +r k ) = (C D K) x k +D r k r k u k + Γ D + z + x k C + y k + Φ K Figure 6: State-feedback control. Two possible methods for choosing the modes of the closed-loop systems are:. choiceofthepolesonthez complexplanewiththehelpofthecurvesindicating the frequency ω n and the damping ξ, 2 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers 2. choice of the poles on the s complex plane and subsequent trasformation to the z complex plane with the help of the expression z i = e s i T The condition of controllability which is necessary for the arbitrary choice of the closed-loop poles in continuous-time case is unchanged for discrete-time systems (full rank of the controllability matrix with Φ instead of A and Γ instead of B). The Matlab command place delivers the state-feedback gain starting from the matrices Φ(T), Γ(T) and the desired closed-loop poles. 4.3. Pre-compensation of the static gain A state-feedback controller is able to deliver a desired dynamics of the closed-loop system. Unfortunately it does not provide zero static error. This can be seen by computing the static amplification (DC-gain: see also the Matlab command dcgain) from the reference to the output. This can be found by looking at the output value for a unit input r(t) =. Then lim y z k r= = lim Y(z) R(z)= z k z z z z = lim G ZOH (z) R(z) R(z)= z z z z z z = lim G ZOH (z) z z z = limg ZOH (z) z = lim(c D K) (z I (Φ Γ K)) Γ+D z = (C D K) (I (Φ Γ K)) Γ+D Thus, in order to obtain a unit static gain the reference value is multiplied by the inverse of the DC-gain above, i.e. by K precomp = ((C D K) (I Φ+Γ K) Γ+D) It is obvious that the pre-compensation of the static error works well only if the system is known precisely enough. 4.3.2 Discrete-time state-feedback controller with integral part In order to eliminate possible static errors an integral part T s z can be added which integrates the error between the reference value and the output (see figure 7). April 7, 2 Silvano Balemi 3

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC r k T s x e,k u k x k + K e Γ z C z + + + D Φ + y k + K Figure 7: Discrete-time plant with pre-compensation of static error The state-space representation of the whole system is ] ] ] ] xk+ Φ xk Γ = + u x e,k+ C T s x e,k D T k + s I ] r k y k = C ] xk x e,k ] +D T s ] u k The design of a controller with integral part can thus be reformulated as the design of a state-feedback controller for the pair (Φ ext, Γ ext ) where ] ] Φ Γ Φ ext =, Γ C T ext = (5) s D T s yielding the state-feedback u k = K ext x ext = K K e ] xk x e,k ] = K x k K e x e,k (6) The disadvantage of the introduction of the integral part is the increased order of the controller. Example 6 Given is the process x k+ = ] x k + ] u k y k = ] x +] u k The task consists in designing a controller without the integral part in order to obtain all poles at.5. The characteristic polynomial is z d(z) = zi Φ = k z k 2 = z2 +z ( k 2 )+k 4 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers which must be compared with z 2 z +.25 yielding k =.25 and k 2 =. The equation of the controlled system is x k+ = (Φ Γ K) x k +Γ r k =.25 ] x k + ] r k y = (C D K) x k +D r k = ] xk The static gain of the controlled system is (C D K) (I (Φ Γ K)) Γ+D = 4 The precompensation gain is then K precomp = /4. Example 7 With the same system above, the state-feedback controller with integral gain has to be designed. Then x k+ = y k = k k 2 K e T s ] xk x k + r k The polynomial with all poles at.5 is z 3.5 z 2 +.75 z.25 while the polynomial of the controlled system is z 3 +( +k 2 Ts) z 2 +(k k 2 T s +T s ) z K e k T s With a coefficient comparison the state-feedback vector is k =.25, k 2 =.5, K e =.25 and the controlled system x k+ = y k =.25.5.25 T s ] xk x k + r k The computation of the static gain confirms that this is. April 7, 2 Silvano Balemi 5

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC u k Γ towards the controller D + ˆx k+ ˆx + k ŷ k y k z C + + + + Φ L Figure 8: Discrete-time observer 4.3.3 Discrete-time observer The state-feedback controller requires the availability of the values of all states. If not all states are measured they can be estimated with an observer. Like in the continuous-time case a correction based on the the multiplication of a matrix L with the error between the measured output and the estimated output allows choosing the eigenvalues of the error system matrix Φ(T) L C (see Figure 8). The dymanics of the state estimate error is described by the following equations: (e x ) k+ = (Φ L C) (e x ) k (e y ) k = C (e x ) k The choice of the poles for the discrete-time error system follows the choice of the poles for the discrete-time state-feedback controller with the following two alternatives. choice of the poles on the z complex plane with the help of the curve indicating the frequency ω n and the damping ξ, 2. choice of the poles on the s complex plane and subsequent trasformation to the z complex plane with the help of the expression z i = e s i T The condition of observability which is necessary for an arbitrary choice of the error system poles is identical to the condition for the continuous-time case (full rank of the observability matrix with Φ instead of A). The state-feedback controller with the feedback u k = K ˆx k +r k together with the observer is described by the following state-space representation: ] rk x k+ = (Φ L C Γ K +L D K) ˆx k +Γ L D, L] y k ] (7) rk u k = K ˆx k +, ] 6 Silvano Balemi April 7, 2 y k

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers r U(z)/R(z) controller + observer u process U(z)/Y(z) y Figure 9: State-feedback controller with observer as a linear system The state-feedback controller is thus a linear system with inputs r k and y k and output u k (see Figure 9). April 7, 2 Silvano Balemi 7

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC 8 Silvano Balemi April 7, 2

Bibliography ] G. F. Franklin, J. D. Powell, and M. L. Workman. Digital Control of Dynamic Systems. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 3rd edition, 997. 2] A.V. Oppenheim and R.W. Schafer. Discrete-time signal processing. Prentice- Hall, 2 edition, 998. 3] W. S. Levine, editor. The control handbook. CRC Press, 996. Very broad for every aspects of control, covers many methods, differs from author to author in the theoretical background needed to understand the individual contribution. 4] K.J. Åström and B. Wittenmark, editors. Computer Controlled Systems. Prentice Hall, 3rd edition, 997. 5] R. Longchamp, editor. Commande numérique de Système Dynamiques. Presses Polytechniques, 26. April 7, 2 Silvano Balemi 9

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC Exercises A Double integrator system (Franklin, Powell, Workman, pb.3) Given is the open-loop system with the continuos transfer function G(s) = s 2. Design the state feedback controller with both roots at z = for T =.,. and s. 2. Plot with Matlab the closed-loop magnitude (bode diagram) for the three sample rates and determine the closed-loop bandwidth for each case. 3. Plot with Matlab the step response for the three sample rates and measure the rise times that result. Compare these values with the estimates. t rise =.8 ω b (8) Solution:. For the system with the transfer function Y(s) U(s) = s 2 we can find the state-space representation ẋ = A x+b u = ] x+ y = C x+d u = ] x+] u The corresponding discrete-time state-space representation is x k+ = Φ(T) x k +Γ(T) u k = T ] x k + ] u T T 2 /2 y k = C x k +D u k = ] x K +] u K The characteristic polynomial whit a state feedback K = k, k 2 ] is p(z) = z 2 +z (k T +k 2 T 2 /2 2) k T +k 2 T 2 /2+ 2 Silvano Balemi April 7, 2 ] u k

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers Because the desired characteristic polynomial is p(z) = z 2, the two equations k 2 T 2 /2+k T 2 = k T = yield the coefficients k = 3 2 T, k 2 = T 2 For the indicated sampling times we get the values T s s] k k 2. 5. 5.5 2. The bode plots are shown in figure. Note that the bandwidth practically fills the available spectrum. 3. The bandwidth is determined where the gain is -3dB with respect to the DC gain. The estimates after equation (8) are ω b T=. 56.84 rad/s = t rise T=..5 s, ω b T=. 5.68 rad/s = t rise T=..48 s, ω b T=.57 rad/s = t rise T=.477 s. The step responses are shown in figure. The rise time is given as the time which the signal needs to go from % to 9% of the step response end value. In the considered problem, with both poles at (dead-beat control), it correponds to one sampling time. Thus t rise T=. =. s, t rise T=. =. s, t rise T= =. s. indicating a good correspondence with the estimates(this is the closest discretetime approximation). B Stability and sampling time (Franklin, Powell, Workman) Consider a plant consisting of a diverging exponential, that is x(s) u(s) = a s a Controlled discretely with a ZOH, this yields a difference equation, namely, x(k +) = e at x(k)+(e at ) u(k). April 7, 2 Silvano Balemi 2

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC 5 2 5 2 5 2 Figure : Bode magnitude plots of the closed-loop system for different sampling frequencies.5.5..5.2.5.2.4.6.8.2.4.6.8 2.5 2 3 4 5 6 7 8 9 Figure : Step responses of the closed-loop system for different sampling frequencies 22 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers Assume proportional feedback, u(k) = K x(k)+r(k), and compute the gain K that yields a z-plane root at z = e bt. Assume a = sec, b = 2 sec, and do the problem for T =.,.,2 and 5 sec. Is there an upper limit on the sample period that will stabilize the system? Compute the percent error in K that will result in an unstable system for T = 2 and T = 5 sec. Do you judge that the case when T = 5 sec is practical? Defend your answer. Solution: The difference equation of the controlled system is given by x(k +) = ( e at K(e at ) ) x(k)+ ( e at ) u(k) and the corresponding transfer function is X(z) R(z) = e at z +K(e at ) e at Equating the parametrized characteristic polynomial with the desired one (in our case z e bt ) we obtain the gain K = eat e bt e at There is no upper limit on the sample period that will stabilize the system: in fact the pole is always at e bt by construction (note that the gain may change sign below a certain sampling frequency). Le us now consider the percent error in K which destabilizes the system. This occurs when a change K moves the pole to the unit circle, i.e. when and expressed in relative terms when (K + K)(e at )+e at = K K = K K = e bt e at e bt Then, for the different sampling times, we get the following values: T =. T = T = 2 T = 5 K 2.723.53.53.7 relative change in K -63.28% -33.48% -3.32% -.67% As we can note from the table for T = 5, less than one percent in error of K destabilizes the system: this is inacceptable in practical terms (even if stability is expected by construction for any T). April 7, 2 Silvano Balemi 23

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC Solved exercises C Discrete-time controller with continuous-time process Given is the system in figure 2 r - 2 z 2 D/A s T f + y digital part A/D analog part Figure 2: Continuous-time System with discrete-time controller. Find G ZOH (z). 2. Find the initial value of the output of the controlled system when a unit step is applied to the input. 3. Find the stationary value of the output of the controlled system when a unit step is applied to the input. 4. Suppose you have to write in C the control program: write the code lines (including the calls to the routined for reading from the A/D converters and for writing to the D/A converters). Solution:. For the discrete-time transfer function of the process we have: ( ) z G(s) G ZOH = z Z s s ( ) z = z Z s s(s T f +) ( ) z = z Z s s T f s T f + ( ) z z = z z z z e T/T f ( = z ) z e T/T f = e T/T f z e T/T f 24 Silvano Balemi April 7, 2

SGA-ASSPA-SSAC Advanced Control, Discrete-time Controllers The closed-loop transfer function is G cl = = e T/T f 2 z e T/T f z 2 + e T/T f 2 z e T/T f z 2 2 ( e T/T f ) z 3 z 2 e T/T f z +2 e T/T f 2. The stationary value is lim y z z z k = lim Y(z) = lim G cl (z) k z z z z z = limg cl(z) = z 3. The initial value is 4. We first observe that corresponds to lim y z k = lim k z Y(z) = z lim G cl (z) z = lim G cl(z) = z U(z) E(z) = 2 z 2 u k = u k 2 +2 e k 2 A possible pseudo-code taking care of the variable initializations is ek_=; ek_2=; uk_=; uk_2=; while TRUE { yk=read_yk(); ek=yrefk-yk; uk=uk_2+2*ek_2; write(uk); uk_2=uk_; uk_=uk; ek_2=ek_; ek_=ek; } Note that the sequence of the operations which guarantees a minimum latency between reading of the measurement values and writing of the actuating values would look like the following code ek_=; ek_2=; uk_=; uk_2=; while TRUE { uk=uk_2+2*ek_2; yk=read_yk(); April 7, 2 Silvano Balemi 25

Advanced Control, Discrete-time Controllers SGA-ASSPA-SSAC write(uk); ek=yrefk-yk; uk_2=uk_; uk_=uk; ek_2=ek_; ek_=ek; } 26 Silvano Balemi April 7, 2