Modern Control Systems (MCS) Lecture-21-22 Introduction to Digital Control Systems Dr. Imtiaz Hussain Assistant Professor email: imtiaz.hussain@faculty.muet.edu.pk URL :http://imtiazhussainkalwar.weebly.com/ 1 Lecture Outline • Introduction • Difference Equations • Review of Z-Transform • Inverse Z-transform • Relations between s-plane and z-plane • Solution of difference Equations 2 Recommended Book • M.S. Fadali, “Digital Control Engineering – Analysis and Design”, Elsevier, 2009. ISBN: 13: 978-0-12-374498-2 Professor of Electrical Engineering Area of Specialization: Control Systems 3 Introduction • Digital control offers distinct advantages over analog control that explain its popularity. • Accuracy: Digital signals are more accurate than their analogue counterparts. • Implementation Errors: Implementation errors are negligible. • Flexibility: Modification of a digital controller is possible without complete replacement. • Speed: Digital computers may yield superior performance at very fast speeds • Cost: Digital controllers are more economical than analogue controllers. 4 Structure of a Digital Control System 5 Examples of Digital control Systems Closed-Loop Drug Delivery System 6 Examples of Digital control Systems Aircraft Turbojet Engine 7 Difference Equation vs Differential Equation • A difference equation expresses the change in some variable as a result of a finite change in another variable. • A differential equation expresses the change in some variable as a result of an infinitesimal change in another variable. 8 Differential Equation • Following figure shows a mass-spring-damper-system. Where y is position, F is applied force D is damping constant and K is spring constant. πΉ π‘ = ππ¦ π‘ + π· π¦ π‘ + πΎπ¦(π‘) • Rearranging above equation in following form 1 π· πΎ π¦ π‘ = πΉ π‘ − π¦ π‘ π¦(π‘) π π π 9 Differential Equation 1 π· πΎ π¦ π‘ = πΉ π‘ − π¦ π‘ π¦(π‘) π π π • Rearranging above equation in following form πΉ(π‘) 1 π ο₯ π¦ ππ‘ − π¦ ππ‘ π¦ π· π − πΎ π 10 Difference Equation 1 π· πΎ π¦(π + 2) = πΉ(π) − π¦(π + 1) π¦(π) π π π πΉ(π) 1 π ο₯ π¦(π + 2) 1 π§ − π¦(π + 1) 1 π§ π¦(π) π· π − πΎ π 11 Difference Equations • Difference equations arise in problems where the independent variable, usually time, is assumed to have a discrete set of possible values. π¦ π + π + ππ−1 π¦ π + π − 1 + β― + π1 π¦ π + 1 + π0 π¦ π = ππ π’ π + π + ππ−1 π’ π + π − 1 + β― + π1 π’ π + 1 + π0 π’ π • Where coefficients ππ−1 , ππ−2 ,… and ππ , ππ−1 ,… are constant. • π’(π) is forcing function 12 Difference Equations • Example-1: For each of the following difference equations, determine the order of the equation. Is the equation (a) linear, (b) time invariant, or (c) homogeneous? 1. π¦ π + 2 + 0.8π¦ π + 1 + 0.07π¦ π = π’ π 2. π¦ π + 4 + sin(0.4π)π¦ π + 1 + 0.3π¦ π = 0 3. π¦ π + 1 = −0.1π¦ 2 π 13 Z-Transform • Difference equations can be solved using classical methods analogous to those available for differential equations. • Alternatively, z-transforms provide a convenient approach for solving LTI equations. • The z-transform is an important tool in the analysis and design of discrete-time systems. • It simplifies the solution of discrete-time problems by converting LTI difference equations to algebraic equations and convolution to multiplication. • Thus, it plays a role similar to that served by Laplace transforms in continuous-time problems. 14 Z-Transform • Given the causal sequence {u0, u1, u2, …, uk}, its ztransform is defined as π π§ = π’π + π’1 π§ −1 + π’2 π§ −2 + π’π π§ −π ∞ π’π π§ −π π π§ = π=0 • The variable z −1 in the above equation can be regarded as a time delay operator. 15 Z-Transform • Example-2: Obtain the z-transform of the sequence ο»u ο½ ο₯ k k ο½0 ο½ ο»1, 1, 3, 2, 0, 4, 0, 0, 0,...ο½ 16 Relation between Laplace Transform and Z-Transform • Given the impulse train representation of a discrete-time signal π’∗ π‘ = π’π πΏ π‘ + π’1 πΏ π‘ − π + π’2 πΏ π‘ − 2π + β― + π’π πΏ π‘ − ππ π’(π‘) π’∗ (π‘) ∞ π’∗ π‘ = π’π πΏ π‘ − ππ π’(π‘) π=0 π(π ) π’∗ (π‘) π ∗ (π ) • The Laplace Transform of above equation is π ∗ π = π’π + π’1 π −π π + π’2 π −2π π + β― + π’π π −ππ π ∞ π∗ π = • Let z be defined by π’π π −ππ π π=0 π§ = π π π 17 Conformal Mapping between s-plane to z-plane π§ = π π π • Where π = π + ππ. Then π§ in polar coordinates is given by π§ = π (π+ππ)π π§ = π ππ π πππ • Therefore, π§ = π ππ ∠π§ = ππ 18 Conformal Mapping between s-plane to z-plane • We will discuss following cases to map given points on s-plane to z-plane. – Case-1: Real pole in s-plane (π = π) – Case-2: Imaginary Pole in s-plane (π = ππ) – Case-3: Complex Poles (π = π + ππ) π − πππππ π§ − πππππ 19 Conformal Mapping between s-plane to z-plane • Case-1: Real pole in s-plane (π = π) • We know π§ = π ππ ∠π§ = ππ • Therefore π§ = π ππ ∠π§ = 0 20 Conformal Mapping between s-plane to z-plane Case-1: Real pole in s-plane (π = π) π§ = π ππ ∠π§ = ππ When π = 0 π§ = π 0π = 1 ∠π§ = 0π = 0 π =0 1 π − πππππ π§ − πππππ 21 Conformal Mapping between s-plane to z-plane Case-1: Real pole in s-plane (π = π) π§ = π ππ ∠π§ = ππ When π = −∞ π§ = π −∞π = 0 ∠π§ = 0 0 −∞ π − πππππ π§ − πππππ 22 Conformal Mapping between s-plane to z-plane Case-1: Real pole in s-plane (π = π) π§ = π ππ ∠π§ = ππ Consider π = −π π§ = π −ππ ∠π§ = 0 0 −π π − πππππ 1 π§ − πππππ 23 Conformal Mapping between s-plane to z-plane • Case-2: Imaginary pole in s-plane (π = ±ππ) • We know π§ = π ππ ∠π§ = ππ • Therefore π§ =1 ∠π§ = ±ππ 24 Conformal Mapping between s-plane to z-plane Case-2: Imaginary pole in s-plane (π = ±ππ) π§ = π ππ ∠π§ = ππ Consider π = ππ π§ = π 0π = 1 ∠π§ = ππ 1 π = ππ ππ −1 1 −1 π − πππππ π§ − πππππ 25 Conformal Mapping between s-plane to z-plane Case-2: Imaginary pole in s-plane (π = ±ππ) π§ = π ππ ∠π§ = ππ When π = −ππ π§ = π 0π = 1 ∠π§ = −ππ 1 −1 −ππ 1 π = −ππ −1 π − πππππ π§ − πππππ 26 Conformal Mapping between s-plane to z-plane Case-2: Imaginary pole in s-plane (π = ±ππ) π§ = π ππ ∠π§ = ππ π When π = ±π π π§ = π 0π = 1 ∠π§ = ±π ππ» = π π π π 1 π −1 −π π − πππππ π π 1 −1 π§ − πππππ 27 Conformal Mapping between s-plane to z-plane • Anything in the Alias/Overlay region in the S-Plane will be overlaid on the Z-Plane along with the contents of the strip π between ±π . π 28 Conformal Mapping between s-plane to z-plane • In order to avoid aliasing, there must be nothing in this region, i.e. there must be no signals present with radian frequencies higher than w ο½ p/T, or cyclic frequencies higher than f = 1/2T. • Stated another way, the sampling frequency must be at least twice the highest frequency present (Nyquist rate). 29 Conformal Mapping between s-plane to z-plane Case-3: Complex pole in s-plane (π = π ± ππ) π§ = π ππ ∠π§ = ππ π§ = π ππ ∠π§ = ±ππ 1 −1 1 −1 π − πππππ π§ − πππππ 30 Mapping regions of the s-plane onto the z-plane 31 Mapping regions of the s-plane onto the z-plane 32 Mapping regions of the s-plane onto the z-plane 33 34 35 Example-3 • Map following s-plane poles onto z-plane assume (T=1). Also comment on the nature of step response each case. 1. 2. 3. 4. 5. π = −3 π = ±4π π = ±ππ π = ±2ππ π = −10 ± 5π 36 z-Transforms of Standard Discrete-Time Signals • The following identities are used repeatedly to derive several important results. π π=0 π+1 1 − π ππ = , 1−π ∞ ππ π=0 1 = , 1−π π≠1 π ≠1 37 z-Transforms of Standard Discrete-Time Signals • Unit Impulse 1, πΏ π = 0, π=0 π≠0 • Z-transform of the signal πΏ π§ =1 38 z-Transforms of Standard Discrete-Time Signals • Sampled Step π≥0 π<0 1, π’ π = 0, • or π’ π = 1, 1, 1,1, … π≥0 • Z-transform of the signal π π π§ = 1 + π§ −1 + π§ −2 + π§ −3 + β― + π§ −π = π§ −π π=0 π π§ = 1 1−π§ −1 = π§ π§−1 π§ <1 39 z-Transforms of Standard Discrete-Time Signals • Sampled Ramp π, π π = 0, π≥0 π<0 π π …… 0 • Z-transform of the signal π§ π π§ = π§−1 1 2 3 π 2 40 z-Transforms of Standard Discrete-Time Signals • Sampled Parabolic Signal ππ , π’ π = 0, π≥0 π<0 • Then π π π§ = 1 + ππ§ −1 + π2 π§ −2 + π3 π§ −3 + β― + ππ π§ −π = (ππ§)−π π=0 π π§ = 1 1−ππ§ −1 = π§ π§−π π§ <1 41 Inverse Z-transform 1. Long Division: We first use long division to obtain as many terms as desired of the ztransform expansion. 2. Partial Fraction: This method is almost identical to that used in inverting Laplace transforms. However, because most z-functions have the term z in their numerator, it is often convenient to expand F(z)/z rather than F(z). 42 Inverse Z-transform • Example-4: Obtain the inverse z-transform of the function π§+1 πΉ π§ = 2 π§ + 0.2π§ + 0.1 • Solution • 1. Long Division 43 Inverse Z-transform π§+1 πΉ π§ = 2 π§ + 0.2π§ + 0.1 • 1. Long Division • Thus πΉ π§ = 0 + π§ −1 + 0.8π§ −2 − 0.26π§ −3 + β― • Inverse z-transform π π = 0, 1, 0.8, −0.26, … 44 Inverse Z-transform • Example-5: Obtain the inverse z-transform of the function π§+1 πΉ π§ = 2 π§ + 0.3π§ + 0.02 • Solution • 2. Partial Fractions πΉ π§ π§+1 = π§ π§(π§ 2 + 0.3π§ + 0.02) πΉ π§ π§+1 = π§ π§(π§ 2 + 0.1π§ + 0.2π§ + 0.02) 45 Inverse Z-transform πΉ π§ π§+1 = π§ π§(π§ + 0.1)(π§ + 0.2) πΉ π§ π΄ π΅ πΆ = + + π§ π§ π§ + 0.1 π§ + 0.2 F ( z) 1 1 Aο½ z ο½ F (0) ο½ ο½ ο½ 50 z z ο½0 0.1ο΄ 0.2 0.02 B ο½ ( z ο« 0.1) F ( z) 1 z ο«1 ο 0.1 ο« 1 ο½ ( z ο« 0.1) ο½ ο½ ο90 z z ο½ ο0.1 z ( z ο« 0.1)( z ο« 0.2) z ο½ ο0.1 (ο0.1)(ο0.1 ο« 0.2) F ( z) 1 z ο«1 ο 0.2 ο« 1 C ο½ ( z ο« 0.2) ο½ ( z ο« 0.2) ο½ ο½ 40 z z ο½ ο0.2 z ( z ο« 0.1)( z ο« 0.2) z ο½ ο0.2 (ο0.2)(ο0.2 ο« 0.1) 46 Inverse Z-transform πΉ π§ 50 90 40 = − + π§ π§ π§ + 0.1 π§ + 0.2 90π§ 40π§ πΉ π§ = 50 − + π§ + 0.1 π§ + 0.2 • Taking inverse z-transform (using z-transform table) π π = 50πΏ π − 90 −0.1 π + 40 −0.2 π 47 Inverse Z-transform • Example-6: Obtain the inverse z-transform of the function π§ πΉ π§ = (π§ + 0.1)(π§ + 0.2)(π§ + 0.3) • Solution • 2. Partial Fractions 48 Z-transform solution of Difference Equations • By a process analogous to Laplace transform solution of differential equations, one can easily solve linear difference equations. 1. The equations are first transformed to the z-domain (i.e., both the right- and left-hand side of the equation are ztransformed) . 2. Then the variable of interest is solved. 3. Finally inverse z-transformed is computed. 49 Z-transform solution of Difference Equations • Example-7: Solve the linear difference equation 3 1 π₯ π + 2 − π₯ π + 1 + π₯ π = 1(π) 2 2 • With initial conditions π₯ 0 = 1, π₯ 1 = 5 2 Solution • 1. Taking z-transform of given equation π§2π π§ − π§2π₯ 3 1 π§ 0 − π§π₯ 1 − π§π π§ + π π§ = 2 2 π§−1 • 2. Solve for X(z) [π§ 2 − 3 1 π§ 5 3 2 π§ + ]π π§ = + π§ + ( − )π§ 2 2 π§−1 2 2 50 Z-transform solution of Difference Equations • Then 3 1 π§ 5 3 2 [π§ − π§ + ]π π§ = + π§ + ( − )π§ 2 2 π§−1 2 2 2 π§[1 + (π§ + 1)(π§ − 1)] π§3 π π§ = = (π§ − 1)(π§ − 1)(π§ − 0.5) π§ − 1 2 (π§ − 0.5) • 3. Inverse z-transform π π§ π§2 π΄ = = π§ π§ − 1 2 (π§ − 0.5) π§−1 2π§ π(π§) = π§−1 2+ π΅ πΆ + π§ − 1 π§ − 0.5 π§ 2 + π§ − 0.5 π₯(π) = 2π + (0.5)π 51 To download this lecture visit http://imtiazhussainkalwar.weebly.com/ END OF LECTURES-21-22 52