Chapter 5 On-Line Computer Control – The z Transform
Analysis of Discrete-Time Systems 1. The sampling process 2. z-transform 3. Properties of z-transforms 4. Analysis of open-loop and closed-loop discrete time systems 5. Design of discrete-time controllers
Continuous signal and its discrete-time representation with different sampling rates 3 t (sec) y*y* t (sec) 1 y t (sec) 1 y*y* yy*y* Continuous signal Disontinuous signal tt t = nTt y*y* tt t y*y* t y*y* From the response of a real sampler to the response of an ideal impulse sample (a) (b) (c) (a)(b) (c) T = 1 sec T = 3 sec
The Sampling Process 1. At sampling times, strength of impulse is equal to value of input signal. 2. Between sampling times, it is zero. Impulse Sampler y (t)y*y* or Laplacing
The Hold Process : From Discrete to Continuous Time Zero – Order Hold : m * (t)m (t) Continuous output discrete impulses Hold Device t m * (t) T m (t) 1 Transfer Function : Response of an impulse input : (t)
First Order Hold Response to an impulse input T 2T Transfer function:
First Order versus Zero Order Hold Comparison of reconstruction with zero-order and first-order holds, for slowly varying signals. Comparison of reconstruction with zero-order and first-order holds, for rapidly changing signals. 02T4T6T8T10Tt m * (nT) 02T4T6T8T10Tt m (t) 02T4T6T8T 10T t m (t) 0 1T3T5T7T t m (t) 0 1T3T5T7T t m (t) 0 1T3T5T7T t m * (nT) (a) (b) (c)
Z-Transforms y(t) y z (t) Remarks 1. z-transform depends only on the discrete values y(0), y(ז),y(ז)..etc. If two continuous functions have the same sampled values, then z-transform will be the same. 2. It is assumed that the summation exists and is finit. 3. We can also view t in the form Z[ y (s) ] = ŷ(z) Sample
Z-Transforms of Basic Functions 1. Unit Step Function 2. Exponential Function
Z-Transforms of Basic Functions - Continued 3. Ramp Function 4. Trigonometric Functions
Z-Transforms of Basic Functions - Continued 5. Translation
Z-transform for Numerical Derivative z -1 is like a back shift operator
Properties of z-Transforms 1. Linearity 2. Final Value Theorem
Numerical Integration in z-transform Using Trapezoidal Rule or solving
1.Partial fraction expansion λ 1, λ 2,… λ n are low-order polynomials in z -1 compute c 1,c 2,…c n. Invert each part separately, we able Inversion of z-transforms
y(nT) = -1/2 + 1/2 e 11n y:0,1,4,13,0,… 2.Inversion by Long-Division 1z -1 +4z z z -1 +3z- 2 z -1 z -1 -4z -2 +3z -3 4z -2 +3z -3 4z z z -4 13z z -4 y(0) = 0 y(T) = 1 y(2T) = 4 y(3T) = 13 From Tables of z-transforms
z-transforms of various functions Function Lalpace transform z-transform in time domain unit impluse 1 unit step 1/s ramp: f(t) = at a/s 2 f(t) = t n n!/s n+1 f(t) = e -at 1/s+a f(t) =te -at 1/(s+a) 2
z-transforms of various functions Function Lalpace transform z-transform in time domain f(t) = sinωt f(t) = cosωt f(t) = 1-e -at f(t) = e -at sinωt f(t) = e -at cosωt
Discrete-Time Response of systems In computer control: measurements are taken periodically and control actions implemented periodically, This results in a discrete input/discrete output dynamic system. Discrete System enen cncn
Example of Discrete Systems Let a discrete time approximation is Taking z-transform
Z-transform for a given continuous system with transfer function G(s) and a ZOH
Example: Pure Integrator with Hold c*(s)y*(s) Step response Hence of which impulse a ramp response
Example : First order lag system
Step Response for 1st order lag system y(t) time * * * * * ******* Note: Compare with discrete approximation to First-order system From tables, for
Generalization or D (z)=Transfer function relating e and c Analogous to Laplace transfer Discrete time input/output model Remark : Note that D(z) is the z-transform of the response of the system to an impulse input
Z-transform of a continuous process with Sample and Hold Hold H (s) Process Gp (s) discrete input c*(s) continuous variables y (s)y*(s) discrete output we seek a relationship (Z-transfer function) between c and y. Consider a impulse input c*(z)=1 c*(s)=1 HGp(z) called the pulse transfer function (since it represents the z-transform of the pulse response of Gp (s) ) Then
Properties of pulse Transfer Function 1. 2.An impulse input is converted into a pulse input by the first order hold element. Hence HG(z) is the pulse response of G(s) sampled at z internals of T. 3.The pulse transfer function of two systems in series can be combined if there is a sample and hold in between. G 1 (z)G 2 (z) c1c1 T c3c3 c2c2
Closed-Loop System D (z)H (s)Gp (s) set point Hold Process disturbance ysp (z) + - T m (s) T y(2) y1(s) sampled output or 1. Roots of the Characteristic equation 1+HGp(z)D(z)=0 Determine stability of the closed-loop system 2. Note similarity to continuous system.
Example: closed-loop response of a first-order system For proportional control where
For a unit step change in set point and
The response is very similar to continuous control. The steady state value of y(t) is Hence the offset is
Stability of Discrete Systems A system is consider to be stable if output remains bounded for bounded Inputs. Consider a discrete system with transfer function Where P 1,P 2,…,P n are n roots of:
Im Unstable roots real Unit circle STABLE REGION
Example: Stability of closed-loop
Example: Stability of closed- loop - Continued
Digital Feedback - Control
1. No initialization is necessary. [ C s is not needed ] Bumpless transfer from manual / automatic 2. Automatic ‘reset-windup’ protection. 3. Protection in case of computer failure 1. Since different modes are indistinguishable, on-line tuning methods will not work. 2. Difficult to put constraints on integral and / or derivative term. 1. Ziegler – Nichols 2. Cohen – Coon settings 3. Time - integral performance criteria Disadvantages: Tuning Digital Controllers: Advantages of velocity Form
Y(t) actual time ideal
Derivation of Deadbeat Controller- Continued
Deadbeat
0~10 sec
Deadbeat control for (1/(s+1) 3 ) Sampling time: 2
Ringing and Pole-placement Ringing refers to excessive value movement caused by a widely oscillating controller output. Caused by negative poles in D(z). Hence avoid poles near -1. Change controller design such that poles are on the side or near zero on negative side
SYS = TF(1,[ ]) Transfer function: s^3 + 3 s^2 + 3 s + 1 >> sysd=c2d(SYS,2) Transfer function: z^ z z^ z^ z Sampling time: >> p1=[1 -1];p2=[ ] p2 = >> c=conv(p1,p2) c =
Canceling the ringing pole at z= ans = >> p1=[1 0];p2=[ ];p3=[ ]; >> c=conv(p1,p2) c = >> c=conv(c,p3) c = Warning: Using a default value of 1 for maximum step size. The simulation step size will be limited to be less than this value. >>
Smoothing the Control Action p=[ ]; r=roots(p) r = Delete the unstable pole z= p1=[ ]; p2=[ ]; c=conv(p1,p2) c =
Reconstruct the Control Loop
The treatment of unstable poles sysd=c2d(SYS,1) Transfer function: z^ z z^ z^ z >> p2=[ ] p2 = >> p1=[1 -1] p1 = 1 -1 >> c=conv(p1,p2) c =
The treatment of unstable poles >> roots(c) ans = >> p1=[1 0];p2=[ ];p3=[ ]; >> c=conv(p1,p2) c = >> c=conv(c,p3) c =
3.Dahlin’s Method Require that the closed–loop system behave like a first-order system with dead-time. 1.Choose , such that D(z) is realizable 2.Lot of algebra Solving for D we want for
Dahlin’s Method
0~10sec 0~50 sec
Dahlin’s Method for for (1/(s+1) 3 ) Sampling time: 2
Regulatory Control Consider a process described by y n = a 1 y n-1 + a 2 y n-2 + … + b 1 m n-1 + … + b k m n-k In regulatory control, we want to keep y close to zero in presence of disturbances. Ideally choose m n such that y n ≡ y sp y sp = a 1 y n + a 2 y n-2 + … + b k y n-k+1 + b 1 m n + b 2 m n-1 + b k m n-k+1 Orm n = -1/b 1 [ y sp – a 1 y n – a y n-1 - a k y n-k+1 – b 2 m n-1 + … - b k m n-k+1 ] Remark 1. Problems can arise in practice if model parameters are not known 2. The above choice is equivalent to minimizing 3. If dead-time is present control will be unrealizable