- CHAPTER 24 Dynamic Response of Discrete-Time Systems In earlier chapters we have seen that the Laplace transform provides a convenient way of analyzing the dynamic behavior of continuous-time systems. The Laplace transform is also applicable to discrete-time systems but is somewhat awkward to use. Thus we consider a related transform for discrete-time systems, the z-transform. The z-transform has the same utility as the Laplace transform in that its use leads to a compact mathematical description of a dynamic system and permits the use of algebraic operations for system analysis. By using z-transforms, transfer functions for discrete-time processes can be defined. This procedure facilitates subsequent analysis of sampled-data control systems, namely systems where a sampled signal appears. In this chapter we introduce z-transforms and pulse transfer functions and show how they can be used to calculate transient responses. 24.1 THE z-TRANSFORM Consider the operation of an ideal, periodic sampler as shown in Fig. 24.1. The sampler converts a continuous signal f(t) into a discrete signal f*(t) at equally spaced intervals of time. Mathematically it is convenient to consider impulse sampling, where f* (t) is the sampled signal formed by a sequence of impulses or Dirac delta functions: f*(t) = ~ f(n6.t) 8(t - ntlt) (24-1) n~O Recall that the unit impulse 8(t) was defined in Chapter 3 as the limit of a rectangular pulse with infinitesimal width. The area under the pulse has a value of unity. Thus, it follows that if we integrate the sampled signal over a very small time period including the nth sampling instant, fnc!.t+ nc!.t- f*(t) dt = f(n6.t) (24-2) In practice, impulse sampling is not attainable because the sampler remains closed for a small but finite amount of time. However, the time of closure is usually small (i.e., microseconds) compared to the sampling period and, consequently, impulse sampling provides a suitable idealization. 559 560 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS 0123456789 Time, n f*(t) o 234 5 6 7 8 9 Figure 24.1 Sampled data impulse represen- Time, n tation of continuous signal f(t). Next, consider the Laplace transform of Eq. 24-1, pes). The value off(n!::..t) is considered to be a constant in each term of the summation and thus is invariant when transformed. Since ~ [oCt)] = 1, it follows from the Real Translation Theorem (3-104) that the Laplace transform of a delayed unit impulse is .s: [oCt - nM] e-nMs. Thus the Laplace transform of (24-1) is given by F*(s) = ~ (24-3) f(nM)e-nMS I/~O By introducing the change of variable, of both f*(t) and f(t), as F(z) z ~ eSt;.!, ~ Z[f*(t)] ~ we define f(n!::..t)z-n F(z), the z-transform (24-4) I/~O To simplify the notation, denote F(z) = f(n!::..t) Z[f*(t)] by fll' Then (24-4) can be written as = ~ f,z-n (24-5) 1/=0 In summary, a z-transform can be derived by taking the Laplace transform of a sampled signal and then making the change of variable, z = eSM. Thus, the z-transform is a special case of the Laplace transform that is especially convenient for sampled-data systems. Although (24-5) is an infinite series, F(z) can be written in closed form if the Laplace transform of f(t) is a rational function [1]. Next we derive the z-transforms of several simple functions. Step Function. To calculate the z-transform of a unit step input S(t), set = 1 for all n 2: O. Note that fo = 1, which implies the sampled value is taken fn at f(O+). It follows from (24-5) that F(z) = 1 + Z-l + Z-l + ... (24-6) 24.1 The z-Transform 561 For Izi > 1 this infinite series converges, yielding 1 = -~-- z z) F( (24-7) Note that Izl > 1 corresponds to es.ll > 1 (or s > 0). This condition on s is the same as that used to derive the Laplace transform table in Chapter 3. For the exponential function Exponential Function. F(z) - ~ 11-0 = ~ f(nM)z-1I 11=0 f(t) = Ce -at, Ce-all.l1z-1I (24-8) Since Eq. 24-8 is a power series in e-a.l1z-1 that converges for le-a.l1z-11< 1 (which implies that s > - a), then C F( z) = (24-9) 1 Some important properties of the z-transform are summarized below. Further information is available in Refs. 1 and 2. Properties of the z-transform. 1. Linearity. The z-transform is a linear transformation, which implies that (24-10) where al and az are constants. This important property can be derived from the definition of the z-transform given in Eq. 24-1. 2. Real Translation Theorem. The z-transform of a function delayed in time by an integer multiple of the sampling period is given by Z[f(t - i~t)] = ri (24-11) F(z) i where is a positive integer, provided thatf(t) = 0 for for positive values of t. The theorem can be easily proved. From (24-4), Z[f(t - i~t)] = ~ f(n~t - t < O. F(z) iilt)Z-1I is defined only (24-12) II~O Now substitute j = n - i Z[f(t - i~t)] ~ j= Since f(jM) -i f(j~t)Z-j-i (24-13) = 0 forj < 0, we can write Z[f(t - i~t)] = Z-i ~ f(jM)rj (24-14) j=O = z-iF(z) (24-15) If the time delay is not an integer multiple of the sampling period, then the modified z-transform described below must be employed. 3. Complex Translation Theorem. This theorem helps deal with z-transforms of functions containing exponential terms, which often arise with linear, continuous-time models. (24-16) 562 DYNAMIC To demonstrate RESPONSE OF DISCRETE-TIME SYSTEMS the validity of (24-16), use (24-4) as the starting Z[e-al{(t)] point: = 2: e-antltf(nb..t)z-n (24-17) = 2: f(nM)(zea::'t)-n (24-18) n~O n~O (24-19) We will illustrate the use of this theorem later in Example 24.2. The initial value of a function from its z-transform: 4. Initial Value Theorem. hm = f( nM) /1->0 can be obtained lim F( z) (24-20) z->oo This result follows directly from Eq. 24-4, with the condition that Izi > 1. 5. Final Value Theorem. The final or large-time value of a function can be found from its z-transform, providing that a finite final value does exist: = lim f(nb..t) hm (1 - z-l)F(z) (24-21) z-)1 n-'?X Note that (24-21) is analogous to the final value theorem for Laplace transforms with stable poles (ct. Eq. 3-94). To prove this theorem, substitute the definition of F(z) into the right side of (24-21): 2: (1 - Z-I) (24-22) f(nb..t)z-n n~O = + {f(0) + [J(M) [J(2b..t) - f(O)] - f(b..t)]Z-2 Z-1 + ... } (24-23) Taking the limit as z --7 1, all of the terms in the infinite series except the last one cancel, yielding = hm (1 - lim f(nb..t) z-> /1->00 1 (24-24) z-I)F(z) 6. Modified z-Transform. The modified z-transform is a special version of the z-transform that was developed to analyze continuous systems containing fractional time delays, namely those that are not an integer multiple of the sampling period. Suppose that a time delay e is expressed as e = (N + (24-25) CT)b..t where 0 < CT < 1 and N is a positive integer. The sampled values of the delayed function are clearly not the same as those of the function with CT = O. Using the real translation theorem, the z-transform of the delayed function f(t - e) is Z[J(t e)] - = 2: f(nb..t - Nb..t - CTM)z-n (24-26) n~O Defining m = 1 - CT Z[J(t and k - = n - N - 1 yields e)] = 2: k~ -N-1 f(kb..t + mb..t)z-hV-l (24-27) 24.1 The z-Transform 563 Since f(nt:.t) = 0 for n < 0, the lower limit can be changed to zero. In addition can be factored out: Z-N-l = 2: f(k!::.t + mt:.t)z-k rN-1 (24-28) k~O Thus, it is convenient to define the modified z-transform by F(z, m) ~ 2: f(k!::.t + mt:.t)z-k Z-N-:-I (24-29)" k~O where m is the modified z-transform variable. The modified z-transforms of some common functions have been tabulated by Ogata [1]. The theorems developed above (initial value, complex translation, etc.) can be extended to modified ztransforms. Unlike the z-transform, the modified z-transform contains information about the values of the function between samples (0 < IT < 1). However, this information is available only if we know the continuous functionf(t). Applications of the modified z-transform have been discussed by Smith [3] and Deshpande and Ash [4]. Having introduced the properties of the z-transform, we now illustrate how they can be used to calculate z-transforms through a series of examples. EXAMPLE 24.1 Derive the z-transform F(z) for the function, f(t) = t. Solution Since f(nt:.t) = nt:.t, F(z) is given by the formula, 2: f(nt:.t)z-n n~O F(z) = = 2: n!::.tz-n = t:.t 2: nrn n~O n~O (24-30) To obtain a closed-form expression for the summation, let 5(z) - 2: nz-n = n=O rl + 2z-2 + 3r3 + 4z-4 + (24-31) Multiplying by z -I gives z-15(z) = + 2z-3 + 3z-4 + 4z-5 + Z-2 (24-32) Subtract (24-32) from (24-31): 1 1 - Z-I - 1 Note that the left side is (1 - z-I)5(z). (24-33) Solving for 5(z) gives 1 5(z) (24-34) = ~rl)2 Hence, the z-transform of f(t) F(z) = tis = !::.t5(z) (24-35) 564 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS EXAMPLE 24.2 Derive the z-transform of cos bt. Then, using the complex find the z-transform of f(t) = e-al cos bt. translation theorem, Solution Applying the definition of the z-transform, = Z(cos F(z) To derive a compact cosine function: formula = v=1. = ~ (cos nM.t)z-n n= = ! series, use Euler's relation (e jnb::'1 + e - jnbM) for the (24-37) This leads to F(z) = - ~ 21('"n~O We can then employ a previous Fz () =- + ~ ejnbMz-n '" e-jnb:o.lz-n relation . + 1- . e- 1)]bMZ-l r+ once more to return to trigonometric (z) = (24-38) result given in (24-8) and (24-9): 21( 1 - e]bMrl 1 F ) n~O - (e jb:o.l + e - jMI) =:21 ( 1 - 2 (ejbM + e-jb:o.l)z-1 Using Euler's (24-36) 0 for the power cas nb!::.t where j bt) 1 - Z -1 cos b!::.t 1 - 2z-1 cas b!::.t + 1 Z-2 ) functions (24-39) r2 Note that for b = 2mr/!::.t, F(z) = 1/(1 - Z-I), which is the same expression as the z-transform of the unit step function. In other words, the sampled cosine has the identical appearance of the sampled unit step function Un = 1 for all n), an example of aliasing (see Fig. 22.5). Hence, the two z-transforms are identical in this special case. To obtain the z-transform of the composite function of f(t) = e-at cas bt, apply the complex translation theorem: Z(e-at cos bt) Equation 24-40 implies that we substitute This step gives = zea':'t every place z appears 1 - z-le-a::'1 Z(e-al EXAMPLE cos bt) 1 - 2z-1e-a::'1 (24-40) F(zea':'t) in (24-39). cas b!::.t cas b!::.t + z-2e-2a:o.{ (24-41) 24.3 Find the modified z-transform of e-al using Eq. 24-29. Show that the case m = 0 (a = 1) corresponds to a pure time delay of one sampling period, that is, 8 = !::.t. 24.1 The z-Transform 565 Solution Using (k + (24-29) as the definition of the modified z-transform m) Ilt and N = 0 for the value of t in e -at yields F(z, m) = and substituting rl L e-a(k+m)j.{z-k (24-42) k~O e-amj.{Z-1 L e-akj.{z-k (24-43)- k~O Using (24-8) and (24-9) with k as the summation index gives e -am::H F(z, = 1- m) Z-I (24-44) e -aM z When m = 0 (CT = 1), the numerator of (24-44) becomes z -I. This term indicates a one unit time delay (N = 0 and CT = lor N = 1 and CT = 0). Therefore it is consistent with Property 2 (the Real Translation Theorem) stated in Eq. 24-11. As these examples illustrate, we can readily construct tables of z-transforms and F(s). Table 24.1 provides a representative list corresponding to functionsf(t) of z-transforms; more extensive tables can be found in Ogata [1] and Deshpande and Ash [4]. EXAMPLE 24.4 Given the transform, 1 F(s) - s(s + a) (a > 0) which might represent the step response of a first-order steady-state value, lim f(nllt). system, determine the final J1~X Solution From Table 24.1, F(z) = ~1 ( 1=-1Z-I Then from the Final Value Theorem, ! ! n~X limf(nllt) = limf(nllt) z~ 1 = a lim n~X a lim z~1 [(1 - [1 - Z-I) Z z- ( 1 - 1z _] 1- e :aj.{ z -I)] ! -e _la~t] = a This result agrees with the continuous-time limit of f(t) as t ~ x obtained from the final value theorem for Laplace transforms. Note that if a ::5 O,f(t) and f(nllt) are unbounded, and application of the Final Value Theorem would provide misleading results. Why? 566 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS Table 24.1 z-Transforms (At = Sampling Period) Time Function f(t) Laplace Transform F(s) 1 s unit step Set), z-transform F(z) 1 r1 1- I:::.tr1 (1 - r1f (n - I)! lim -1 n-I __ sn a~O ( aan-1 an-1 ) 1 s + 1 ab 1 ( - e-bl) + -a - Set) b b + (s e-al 1 b e-al sin a)(s + b) a)(s b ~ a bt C- + b (a - b) (1 - e-aMz-l) !1t e -aMz-I (1 - e-acl1r1f 1 (s + a)2 + b2 b 1- 2r1e-acll 1b2 sin bl:::.t r1e-acll 1- cas b!1t rle-a~1 2rle-acll + e-2acllr2 cas b!1t cas b!1t + e-2aMr2 1 unit impulse INVERSION e~b~lrl) a] 1 + a)2 s + a + a)2 + 1- b) 1 (s - kAt) - _ e-al cas bt 24.2 ) e-acl1z-1 e~aMrl 2. 1__ 1_ + ab Ll - rl e-bl) (s f(t e-aMz-1 1 1 1- a 1 s(s + __a -a_b S(t), 1- 1 b _ a (e-al - ( F(z)rk F(s)e-kMS OF z-TRANSFORMS Once a z-transform has been obtained (by whatever means), we need to be able to obtain the values of its corresponding time-domain function at the sampling instants. This is analogous to inverting Laplace transforms back to the time domain. The inversion of a z-transform F(z) to its corresponding time domain functionf(t) is not unique because the inverse z-transform does not yield a continuous time function. Instead the values of the function are obtained only at the sampling instants. We know that a variety of continuous signals can be reconstructed from f*(t); that is, aliasing prevents the unique identification of the continuous function of time. On the other hand, the transformation from F(z) to f*(t) (or, equivalently, from F(z) to f(nllt)) is unique. Consequently, we define the inverse z-transform operator, denoted by Z-1, as follows: f*(t) = {f(nllt)} = Z-l[F(z)] The inverse z-transform consists of the sampled nth sampling instant as f(n/1t). To illustrate the inversion process, consider (24-45) values f*(t), F(z) represented = rl/(l - P1r1). at the If F(z) 24.2 Inversion of z-Transforms 567 above is expanded as an infinite series, 1 - = ~PIZ + PIZ-I + rl(l PIZZ-z + ... + + ... ) PI"r" (24-46) Comparing this expression to (24-1), note that the inverse z-transform gives an expression for the value of the function at the nth sampling instant (24-47) In most cases the z-transform to be inverted consists of a ratio of polynomials in z -I. To invert such expressions, three methods are available: (a) Partial fraction expansion (b) Long division (c) Contour integration (a) Partial Fraction Expansion This method is analogous to the procedure for expanding a complicated Laplace transform F(s) into simpler functions prior to taking the inverse Laplace transform. Note that the z-transform table contains expressions that are functions of Z-I rather than z. Consequently, each term in the partial fraction expansion should be in this same form. Suppose that F(z) has the following form: = F(z) (24-48) VI(z) Vz(z) where VI (z) = kth-order polynomial in Z-I (excluding a possible time-delay term Z-N, which can be factored) Vz(z) - mth-order polynomial in Z-I (the denominator is normalized so that the coefficient of ZO is unity). Assume that the denominator, Vz(z), can be factored into m distinct real roots (i.e., poles of F(z)), denoted by PI> pz, ... , Pm' Thus, F(z) = (1 - VI(z) - pzZ-I) PIZ-I)(l ... (1 - (24-49) Pmz-I) Then choose a partial fraction expansion of the form: F(z) __ r_l__ 1 - PIZ-1 + __ 1 - r_z__ pZZ-l + ... + __ 1 - r_m Pmz (24-50) Each numerator coefficient r; can be calculated in a manner similar to that used for Laplace transforms (e.g., Heaviside's rule with z = lip;). Taking the inverse z-transform of (24-50) term by term gives f(n!::.t) = Z-I( 1 - rlPIZ _)1 + Z-l( 1 - rz pzz _)I + ... Since the inverse transform of f(nt:..t) = rl/(l rl(Pl)" - PIZ-l) + rz(pz)" is (24-51) rl(PI)", + ... + then rm(PnY (24-52) 568 DYNAMIC RESPONSE OF DISCRETE-TIME If there were only a single term simple case, we can examine how of the sign and magnitude of PI' different values of PI along with case of a first-order z-transform. SYSTEMS in the z-transform, then f(n6.t) = rIPI". For this the sampled representation will vary as a function Figure 24.2 shows the discrete-time responses for possible continuous-time interpretations for the In the special case when all roots are bounded by 0 :S Pi :S 1 and 6.t is known, then we can express the inverse z-transform for (24-46) as = f(n6.t) Relating rle-q,,,:>t + r2e-q2,,:>r + ... + (24-53) rme-qm,,:>r (24-53) to (24-52), note that 111 ql = - 6.tlnpl, q2 = - 6.tlnp2,···, qm = - 6.tlnpm If any Pi < 0, Eq. 24-52 should be used in place of (24-53). If the denominator of F(z) cannot be factored into real roots (i.e., complex roots appear), then the partial fraction expansion must contain a second-order polynomial in the denominator for each pair of complex roots. When inverting such a term, the appropriate quadratic form for damped sines and cosines in Table 24.1 should be used. One other unusual case can arise in using the partial fraction expansion cedure. If the order of the numerator is greater than that of the denominator k > n in Eq. 24-48), then Eq. 24-50 is not strictly applicable. In this case, preferable to use other methods for generating the discrete-time sequence, as the long division method discussed below. EXAMPLE 24.5 Using partial F(z) a fraction - z-I)(l = 0.5z-I/[(1 expansion, find the inverse z-transform - 0.5z-I)] for a sampling period 6.t = 1. pro(i.e., it is such of Solution Expanding F(z) into the sum of two fractions rl 0.5z-1 F (z) = (1 _ z-I)(l - 0.5z-1) r2 = 1 - Z-I + 1 - 0.5z-1 Imaginary z-plane yields bmrr /;b1ill (1) Real trrn-m, Figure 24.2 Time-domain responses for different locations of the root of F(z). (24-54) 24.2 569 Inversion of z-Transforms Using Heaviside's rule (see Section 3.3) for finding rl and rz, multiply (1 - Z-I) and set z = 1: F(z) by 0.5 = -0.5 = 1 rl Next multiply F(z) by (1 - 0.5z-1) rz Substituting and set z = 0.5, that is, 0.5(2) -1 = -= 1 - 2 Z-1 = 2: into (24-54) gives 1 Equation 1- = 1 F( z) (24-55) 0.5z-1 = 1 leads to 1 ql = - b.t In (1) = 0 24-53 with b.t 1 = - M qz = 0.693 In (0.5) so that = 1- f(nb.t) (24-56) e-O.693nM When Eq. 24-52 is used to check this result (M = 1, rl = 1, PI pz = 0.5), the same expression results since e-O.693n = (0.5)". (b) 1,rz- -1, Long Division Long division provides a second method for obtaining an inverse z-transform. In most cases it is considerably easier to use this method to obtain the inverse ztransform than to use partial fraction expansion. However, the result (an infinite series) may not be as useful as an analytical expression. Inversion via long division is an operation unique to discrete-time systems; no analogous method exists for continuous-time systems. From the definition of the z-transform as F(z) = L f(nb.t)z-II (24-57) 11=0 the coefficients in the power series expansion sampling instants: = f(O) + at the (24-58) =-------------+ bzz-z + ... + bkz-k bo + ao + alz-1 + azz-z + ... + amz-m (24-59) Let F( z) be a rational function f(M)z-1 + are the values of f(t) + ... F(z) Fz () of F(z) represented f(2M)z-Z by b1z-1 Dividing the denominator into the numerator Co + 'The order of division is based on dividing ao F(z) = C1Z-1 by long division + czz-z + ... 1 gives (24-60) into the numerator and its remainders; see Example 24.6. 570 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS Referring back to (24-58), we can perform long division and equate the sequences and Un} to obtain {cn} bo ao 0 fjfo = = Cj C2 _ ao ao + bj __ bO~j bo bOa2 _ bjaj ao- (24-61) (24-62) (24-63) bOaj2 Some important properties of sampled-data systems can be obtained from long division of their z-transforms. For example, for a first-order z-transform, = F(z) bo -1 (24-64) - - ajZ the equivalent sampled signal in the time domain can be found by long division, resulting in the infinite series (cf. (24-46)): F(z) = boO + + ajz-j + ... aj2z-2 + aI"rn + ... ) (24-65) Therefore, the sampled data response of this system is given by the sequence {bo, boa), bOaj2,. .. }. This agrees with (24-61) through (24-63), taking into account the negative sign before aj in (24-64). Note that if lajl > 1, the magnitude of the signal grows steadily over time (see Fig. 24.2), but if lajl < 1, the signal will be attenuated over time. This coefficient in a first-order z-transform indicates if a system producing the signal is stable or unstable. EXAMPLE 24.6 Repeat Example 24.5 using long division to generate the first five terms. Solution Dividing the denominator into the numerator, O.5rl + O.75z-1 + O.875z-3 + O.9375r< + O.9687rS + ... 1 - 1.5z-1 + O.5z-2 IO.5z-1 O.5rl - O.75z-1 + O.25r3 O.75z-2 O.75z-2 - O.25z-3 1.125z-3 O.875z-3 O.875r3 + O.375r< - O.375z-< 1.3125r< + 0.4375rS O.9375r< - 0.4375r5 O.9375r< - 1.4062z-S O.9687z-S - 0.4688z-6 + O.4688r6 Note that f(O) is zero in this expression. Long division does yield the same time sequence as does partial fraction expansion, with considerably less effort. However, the result is in the form of an infinite series. 24.3 The Pulse Transfer Function 571 (c) Contour Integration A final method for inverting z-transforms utilizes a contour integral: f-. Jr( F(z)zn-l = f(nflt) 'IT) (24-66) dz r where the contour must be appropriately specified. Although the integral can be evaluated using the residue theorem [1, p. 83], this method is seldom used in practice. 24.3 THE PULSE TRANSFER FUNCTION In analogy with continuous systems, the analysis and design of sampled-data control systems is facilitated by the use of transfer functions based on z-transforms. The pulse transfer function represents a dynamic relationship and is defined as the ratio of the output and input z-transforms, assuming both output and input are initially at steady state, analogous to continuous-time systems. In addition, both the input and output signals are sampled at the same rate and synchronously. Consider the sampled-data system in Fig. 24.3b where X(z) and Y(z) are ztransforms of the sampled input and output signals, x(nM) and y(nflt), respectively. The response of a continuous linear process (Fig. 24.3a) is given by the convolution integral [1, p. 180], yet) = L get - (24-67) T)X*(T) dT where get) is the impulse response of the process (see Chapter 3), T is the dummy variable of integration, and X*(T) is a series of impulses that can be expressed as X*(T) = L x(kflt) OCT - (24-68) kflt) k~O Substituting (24-68) into (24-67) gives x t yet) = 10 get - As shown by Ogata [1], an impulse arbitrary function h( T), J: h(T) OCT - xes) t:o x(kflt) T) kflt) oCt) dT = OCT - kflt) (24-69) dT has the important property that, for an for 0 :S T :S t h(kflt) (24-70) yes) --- x(t) y(t) (a) Continuous input Y*(s) y*(t) (b) Sampled input and output Figure 24.3 Transfer function with (a) continuous input and (b) sampled input. 572 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS Thus, Eq. 24-69 reduces to yet) = ~ (24-71) get - kM)x(kl:1t) k~O In particular, for t = nl:1t y(nM) = ~ g(nl:1t - kl:1t)x(kl:1t) . (24-72) k=O The z-transform of the output signal is defined by = ~ y(nl:1t)z-1l Y(z) (24-73) Il~O Substitution of y(nl:1t) from (24-72) gives = ~ ~ g(nM Y(z) Let i =n - Il~Ok~O (24-74) - kl:1t)x(kl:1t)r" k: Y(z) Since g(il:1t) is zero for i summations separated: = ~ i~ ~ g(il:1t)Z-(i+k)X(kl:1t) (24-75) -k k~O < 0, the lower limit on i can be changed to zero and the (24-76) or Y(z) = (24-77) G(z)X(z) where G(z) is defined as x G(z) (24-78) ~ ~ g(il:1t)Z-i i~O We will refer to G(z) as the pulse transfer function of the system. It relates the discrete-time input and output signals in the same manner as a transfer function in the s-domain relates continuous signals (see Fig. 24.4). Other derivations of (24-77) are available [1]. Note that G(z) can be calculated directly after get), the impulse response function, has been determined (d. Eq. 24-78). EXAMPLE 24.7 Find G(s) the = pulse K/(TS transfer function for a first-order + 1). ~ ~~) Figure 24.4 Pulse transfer function. continuous process, 24.4 Relating Pulse Transfer Functions to Difference Equations 573 Solution The continuous time impulse response is found from get) K _ = ,\:,-I[G(S)] = -T get) (24-79) e-t/, The z-transform is (24-80} This result can also be obtained from Table 24.1. EXAMPLE 24.8 A second-order discrete process has the pulse transfer function = G(z) + -O.3225z-1 (24-81) O.5712z-2 Determine its discrete-time response when forced by a sampled unit step input. Solution For a unit step input, X(z) = 1 + Z-l + 1 Z-2 + Z-3 + ... 1 - Z-l Here we use the closed-form expression to minimize the number of terms. Equation 24-77 is used to develop the expression for the step response Y( z). We could apply the partial fraction expansion method to find y(ntlt), but this would be relatively time-consuming due to the need to factor the denominator and use the Heaviside expansion. Therefore, long division is employed to determine the response. Substitution gives Y(z) _- G(z)X (_z) - 1 -O.3225r1 r. r.""",,, __ + 1 , O.5712z-2 r. """,,'H _, , 1 _1 (_4-8 ? 2) Applying the long division procedure yields Y(z) = -O.3225z-1 O.0665z-2 - + O.6918z-5 + O.8082z-6 + O.8820z-7 + O.9277z-8 + O.2568z-3 + O.5136z-4 + ... (24-83) We note in (24-83) that y(ntlt) is steadily increasing and may be approaching a steady state value. Using the Final Value Theorem. we can calculate the value of y(ntlt), as n -,> x. Returning to (24-82), multiply by (1 - Z-l) and set z = 1. The ultimate (steady-state) value for the response is thus 1. Since at steady state both input and output values are 1, the gain of the pulse transfer function is also 1. This can be verified by evaluating G(Z)IZ~I' 24.4 RELATING PULSE TRANSFER TO DIFFERENCE EQUATIONS FUNCTIONS A pulse transfer function, representing a dynamic relation between an input and an output, has a unique correspondence with a difference equation. To demonstrate 574 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS this, consider aOYIl + a general difference + ... + alYn~1 equation amY,,-m = given by boxn + b1x"_1 + ... + bkXIl~k (24-84) where {aJ and {bJ are sets of constant coefficients and k and m are positive integers. Before taking the z-transform of (24-84), we recall the real translation theorem in Eq.24-11: = Z(YIl-J Taking the z-transform aoY(z) + Collecting alz~1y(z) Z[y(n~t - = i~t)] (24-85) riy(z) of both sides of Eq. 24-84 gives + ... + amz-my(z) boX(z) + b1rl X(z) + ... + bkZ~k X(z) (24-86) terms, we solve for Y(z): Y ()z The pulse transfer = function G(z) -- ----------X + b1z-1 + ... + + ... bo ao alz-1 of the discrete-time Y(z) X(z) bo + bkz-k + amz-m ()z process is therefore + b1rl + ... + bkz-k + alz~1 + ... + amz-m -------ao For most processes bo is zero, indicating that the input does affect the output. However, for proportional controllers and modeled simply by steady-state gains, all coefficients except Also, the leading coefficient in the denominator can be set both numerator and denominator by ao. (24-87) given by (24-88) not instantaneously processes which are ao and bo are zero. to unity by dividing Physical Realizability In Chapter 4 we addressed the notion of physical realizability for continuous-time transfer functions. An analogous condition can be stated for a pulse transfer function, namely a discrete-time model cannot have an output signal that depends upon fut~re inputs. Otherwise the model is not physically realizable. Consider the ratio of polynomials given in Eq. 24-88. The transfer function will be physically realizable as long as ao #- 0, assuming that G(z) has been reduced so that common factors in numerator and denominator have been cancelled. To show this property, examine Eq. 28-84. If ao = 0, the difference equation is This equation requires a future input x" impossible (unrealizable). Another way to division. When the denominator in (24-88) with positive powers of z should occur for EXAMPLE to influence YIl-1, which is physically test physical realizability is to use long is divided into the numerator, no terms a physically realizable system. 24.9 Check the transfer function Y(z) X(z) for physical realizability. 1 + 2z-1 + 5z-1 + 3Z~2 2z-2 (24-90) 24.4 Relating Pulse Transfer Functions to Difference Equations 575 Solution Note that the leading coefficient in the denominator is a power of Z-I, violating physical realizability (ao = 0 in (24-88)). The corresponding difference equation is 5Yn-l + = 2Yn-2 x" + 2X"-1 + 3X"_2 (24-91) An equivalent difference equation is 5y" + 2Yn-l = Xn+l + 2x" + 3X"-1 (24-92) This equation requires knowledge of the future input XI1+1 to generate the current output value Ytl" A similar conclusion can be deduced using long division, which yields positive powers of z. This exercise is left for the reader. The Zero-Order Hold Most sampled-data or computer control systems require a device to convert a digital output signal from the controller to an analog signal, which can then be utilized by a final control element such as a valve to manipulate the process. In many cases the final control element requires a continuous signal as input rather than a digital input to set its position (although in the specific case of a stepping motor, a continuous signal is generated from the digital input). The device usually employed for this purpose in process control is the digital-to-analog converter (DAC) which functions as a zero-order hold (ZO H), although there are other types of holds available (see Chapter 22). The zero-order hold converts the digital signal from the controller into a continuous staircase function. This device ordinarily must appear in conjunction with a continuous process for digital control to be carried out. The process transfer function, when converted to a pulse transfer function, must incorporate the zero-order hold. The digital controller output signal may be thought of as an idealized sequence of impulses through the ZOH and then through the process. We know from Laplace transform theory that if H(s) is the ZOH transfer function and G(s) is the process transfer function (including the final control element), then the overall transfer function is H(s)G(s). Although Table 24.1 gives the corresponding discrete-time form for a first- or second-order transfer function (see Example 24.7 for the first-order case), this table is based on an input that can be represented as a series of impulses. Thus, it cannot be used directly for the type of input that is characteristic of a ZOH (DAC) output, which is a staircase function. However, by taking the hold device into account, we can derive pulse transfer functions that are appropriate for process control calculations. First we derive the appropriate expression for H(s). Figure 24.5 shows the response of the hold device to an impulse input of unit strength. The hold yields a constant output value over the sampling period I:::.t, which is the same as the strength of the impulse. The impulse response of the ZOH over the interval hW :Cl o !:J.t Time Figure 24.5 Response of a zero-order hold element to an impulse of unit magnitude. 576 DYNAMIC RESPONSE OF DISCRETE-TIME t = 0 to t = 6.t can be written and S(t-6.t): SYSTEMS as the difference h(t) = Set) of two unit step functions, S(t-M) - Set) (24-93) of h(t) is From Eq. 3-22, the Laplace transform 1 e -s6.1 1 - e -s6.t H(s) = - - s s = --- s (24-94 ) For processes with a piecewise constant input, the difference equation model must be based on the product H(s)G(s) rather than G(s) alone. Then Table 24.1 can be used to convert H(s)G(s) to a z-transform. EXAMPLE 24.10 For a first-order transfer function with gain equal to one, = G(s) 1 + 1 TS Show by transform techniques that a zero-order hold placed ahead of this process will yield the same difference equation model for the combined system (ZOH plus first-order process) as was derived in Eq. 23-19 for piecewise constant inputs to a first-order process. Solution First form the product H(s)G(s): 1 - e -s6.1 H(s)G(s) To convert this expression expansIOn: H(s)G ( s) s to its equivalent = ~1 - s-+-l/-T 1 TS 1 + 1 z-transform, (24-95) we use a partial fraction (24-96) - e -s6.t C ~ - s-+-l/-T 1) HG(z) is defined as the z-transform of the combined ZOH plus process. Z is used as a shorthand way to denote the z-transform of the time-domain function given by the inverse Laplace transform, HG(z) = Z [H(s)G(s)] - Z ~ C) = Z{cS:'-1[H(s)G(s)]} (_1 ) - - Z s + 1/T Table 24.1 is then used to convert z-transform. Since Z [e-S6.tp(s)] = HG(z) e ~ - su_1 + liT Z [-S6.tC )] (24-97) each term in Eq. 24-97 into its equivalent Z [pes)], Eq. 24-97 becomes r1 = C _1 Z-1 - 1 _ e ~6.tI'Z-1) - z -1( 1 _1Z-1 - 1 _ e-6.II'z-1 1) (24-98) 24.4 Relating Pulse Transfer Functions to Difference 577 Equations or = (1 - z -I ) [ (1 _ z-l(l z-I)(l - _e-M/T) e-Llt/Tz-I) HG(z) ] Z-I (1 - e-LltIT) e-M/Tz-1 = 1Defining al ~ e-M/T, Y(z) X(z) In difference = (24-99) (24-99) can be written = (1 - HG(z) equation as (24-100) al)z-l alz-I 1- form, (24-100) becomes y" - alY,,-1 = (1 - al) (24-101) X,,_I or y" = + (1 - al) aIY,,_1 X,,_I (24-102) the same result as given in Eq. 23-19. Several comments should be made about the procedure for transforming First recognize that the combined transfer function H(s)G(s) could have been converted to a series of impulse terms as in Example 24.7 by using the time-domain impulse response followed by transformation to the z-domain. The approach taken in Example 24.10, however, is more direct, because Table 24.1 provides the relation between sand z, thus bypassing the need to convert from the s-domain to the t-domain (and then to the z-domain). We can also generalize the results in (24-97) to (24-99) as H(s)G(s). HG(z) = = (1 - Z(H(s)G(s)) Z-I)Z(G;S)) (24-103) In the second term, the operator Z indicates that the z-transform equivalent of G(s)/s can be determined using Table 24.1. Therefore, the calculation of HG(z) first requires partial fraction expansion of G(s)/ s, followed by transformation to its z-transform. Finally multiplication by (1 - Z-I) yields HG(z). Equation 24-103 can also be employed to illustrate an important property of the zero-order hold; in general, for dynamic systems, ¥ HG(z) First calculate the z-transform of H(s): e H(z) = H(z) 1 - Z-I = 1 - ~Z-I = 1 Z (24-104 ) H(z)G(z) se-s;!.t) = (1 - ¥ G) (24-105) (24-106) This result is consistent with the fact that H(z) = 1, Eq. 24-104 becomes HG(z) Z-I)Z the gain of H(s) G(z) is unity. Using (24-107) 578 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS Substituting (24-103) for the above expression is HG(z), rl)Z [G;S)] (1 - ¥ Z[G(s)] (24-108) The inequality in 24-108 is valid, in general, except for the case G(s) - K. One other interesting characteristic of the zero-order hold is that lim = HG(z) (24-109) G(s) clt~O This result seems intuitively correct in view of Fig. 22.2b. For example, if we substitute z = esclt in Eq. 24-99 and apply L'Hospital's rule for M -7 0, the z-transforrn reduces to the original first-order transfer function G(s) = 1/(TS + 1). In contrast, the limit of G(z) as /1t -7 0 does not equal G(s) because of the discontinuous nature of the pulse transfer function G(z) [1]; for example, see Eq. 24-80. EXAMPLE 24.11 Derive the difference equation that corresponds to an integrating element, G(s) = Y(s)IX(s) = lis, using the ZOH and Eq. 24-103. Solution First determine which is G(s)/s, lIs2. The z-transform is /1t Z(1/s2) rl = (1 _ Multiply (24-110) by (1 - Z-I), yielding (24-110) Z-I)2 HG(z): = 1M_ rlZ HG(z) (24-111) The corresponding difference equation is Yn - Yn-I - (24-112) /1t Xn-I The infinite series version of (24-112) can be obtained by long division of in (24-111) and conversion to discrete-time form: HG(z) n Yll (24-113) /1t ~ Xk-I k=1 Equations 24-112 and 24-113 describe the two equivalent forms of the integrating element in discrete time. Higher-Order Systems As discussed in Chapters 6 and 7, many processes can be approximated by a secondorder transfer function with time delay 8: G(s) = yes) Xes) = (TIS + Ke-es 1)(T2S + 1) (24-114) Assume that 8 is an integer multiple of the sampling period (8 = N/1t), and x(t) is a piecewise constant input (i.e., G(s) is placed in series with a ZOH). The 24.5 following difference equation Effect of Pole and Zero Locations 579 results: (24-115) The relations between (a), az, b), bz) and (K, T), TZ) have been previously derived in Eqs. 23-21 through 23-25, based on the analytical solution of the differential equation. The pulse transfer function for (24-115) is G(z) = Y(z) X(z) = (b1r1 l+alz. + _~zz-Z)z=~ +azz- _ (b1 + bz_~-I)rN=~ l+alz +azz- (24-116) Note that (24-116) is a general expression for a second-order discrete-time model with a time delay of N sampling periods (the apparent time delay is one sampling period longer (i.e., N + 1) in (24-116) because the output cannot respond instantly). Neuman and Baradello [6] have derived difference equations incorporating the zero-order hold for a variety of linear process models. Table 24.2 gives pulse transfer functions for a number of transfer functions with the zero-order hold. Note that the transfer functions are given in pole-zero form (rather than using time constants). Only overdamped and integrating systems are considered. 24.5 EFFECT OF POLE AND ZERO LOCATIONS For both continuous-time and discrete-time systems, the nature of the dynamic response is influenced by the location of the poles and zeros of the transfer function (see Section 6.1). In fact, a pole Pi of a continuous system maps into a pole in discrete time as ePiM (recall the transformation z = eSM). A process with two time constants (T), TZ) has two negative continuous-time poles (-lIT), -l/Tz); therefore, after conversion to discrete-time, two positive poles in the z-plane (e -MITl, e-M/TZ) occur. This result is consistent with the expressions for al and az in a second-order difference equation (see Eqs. 23-22 and 23-23). It is possible to categorize discrete-time responses for first- and second-order continuous-time processes with no zeros into eight different patterns [1], as shown in Fig. 24.6a-h. All responses exhibit an apparent one-unit time delay as noted above. For first-order systems, recall that in Fig. 24.2 we identified several possible responses depending on the pole location. The appropriate first-order difference equation is Yll - PIYIl-l - XIl-l (24-117) 24.3 gives the response for the case of a unit impulse input at n = 0 Yo = 0). The analytical solution is Yll = (Pl)ll· It is clear that a negative pole near the unit circle has a pronounced effect on the response. The alternation in sign of Y is referred to as ringing of the output signal (see Chapter 26 for a discussion of ringing in control systems). Negative poles nearer the origin, although they produce a change in sign, are heavily damped and their results are not so noticeable. Positive poles do not cause the output to change in sign. In Fig. 24.6 case c corresponds to a second-order overdamped system with two positive poles on the real axis. It has similar properties to case b. Cases d and e are noteworthy, because the two complex poles in continuous time map into a single pole in discrete time. In case e, the pole is located at s = ±w)2j in continuous time, indicating an undamped oscillation. Since Ws is the sampling frequency, and Ws = 2'IT/6.t, the discrete-time pole (eSM) is given by e±"ITJ. Via Euler's identity, the value of the single pole in discrete time is established as e±"ITj = COS'IT ± j sin 'IT = -1. It is important to remember that a first-order discrete-time system Table (xo = 1 and <.n CO o Table 24.2 Pulse Transfer Functions with Zero-Order Hold Transfer Function G(s) HG(z) ~ K 1 K r 1 K (.I + + bl + 1') + K + + r) (1\z-} = = -I o Kt.! m JJ o-0Z al = -exp( -rt.!) bl = -r [I - exp( -rt.!)] (J) m K + b1z-2 + (l\Z-1 blz-I z» s:: (J) alz-I bIZ-I r)(s .1(.1 air I o -< Z[H(s)G(s)] al + blrl + .I = + (l2Z-2 "o o = - {exp( -rt.!) + exp( -pt.!)} a, = exp[ - (r + I' )t.!] bl = [Klrp(r - p)][(r - 1')- rexp(-pt.!) + pexp(-rt.!)] + p)t.!] + I' exp(-pM)-rexp(-rt.!)} b, =IKlrp(r - p)I{(r - 1') exp[-(r al en () JJ m --i m ::J s:: b,Z-2 + (12Z-2 m = -{I + exp(-rt.!)} a, = exp( - rM) al hi h, = = -(Klr')[l (Klr')!l (J) - rt.t - -< (J) --i exp(-rM)] exp( -rt.!) - m rM exp( -rt.!)] s:: (J) K(s (.I + + r)(s 'I) h]z- [ + h2z-2 + 1') + ([IZ-! + (l2Z-2 = -{exp( -I'M) + exp( -rM)) a, = exp[ -(r + p)M)1 al K bl = --{exp(-pt.!) I' - r b, = K{(qlrp) K (.I + r)(.\' + h1z-' 1')(.1 + v) I + (ltZ-! + [,22-2 + h3z-J + (l2Z-'2 + (lJz-J exp[ -(r - exp(-rM) + ('1/1')[1 - exp(-pt.!)1 + p)t.!1 + [(I' - q)/p(r - 1')1 exp( -rt.!) - (qlr)!1 - exp(-rM)J) + [('I - r)/r(r - 1')] exp( -pt.I)} = -{exp( -rt.t) + exp( -I'M) + exp( -vt.!)} + p)t.I] + exp[-(p + V)t.I) + exp[-(r '" v)t.11 a, = -exp[-(r + I' + v)t.11 bl = [KI(rpv»]( - '1[ exp( - rt.l) + exp( - pt.!) + exp( - Vt.I)] + {[pv(q - r)l/l(p - r)(v - r)IHI + exp(-pt.l) + exp(-ut.I)1 + {[rv(q - p)I/[(r - p)(v - p)IHI + exp(-rt.l) + exp(- vt.I)1 + {[rp(ll - v)]I[(r - v)(p - v)[H + exp( -rt.l) + exp( -pt.!)]) b, = [-KI(rpvJl(-q exp[ -(r + p)t.I] + expl-(p + v)t.tl + exp[ -(r + v)t.!J) + {[pv(q - r)JI[(p - r)(v - r)IH exp( -pt.l) + exp( -wt.l) + expl-(p + v)t.!J} al a, = exp[-(r I b, K(s (s + .1'(.1' rHs + 'I) + pHs + K(s + + r)(,,' 1 b,2-' + b,Z-2 + b,z-' + a,z-' + a,r' + a3z-' b,r' 'I) + v) 1') I + a\z-I + b,r2 + b,z-' +U2Z-2 + uJz-J = + {[ru(q - p)]/[(r - p )(u - p)]}{ + {[rp(q - v)J/[(r - vHp - v)]}{ cxp[- [KI(rpu)]( - 'I + + + {[pv(q - r)]/[(p {[rv(q - p)]/[(r {[rp(q - u)]/[(r + (I' - + P cxp( - rl>t) cxp( -rl>t) + cxp( - vl>t) + cxp[- (r + + cxp( -pl>t) + cxp[-(r + v)l>t]} p)l>t]}) v)l>t] r)(u - r)]} - pHu - p)]} - v)(p - v)]} cxp[ -(p cxp[-(r cxp[-(r + v)l>tJ + u)MJ + p)l>t» a, = - {cxp( - I'M) + cxp( - pl>t) + cxp( - vl>t)} = cxp[-(r + p)l>t] + cxp[-(p + u)l>tJ + cxpl-(r + v)l>tJ + p + v)M)] a3 = -cxp[-(r b, = [KI(rpv)](-q[ cxp(-rl>t) + cxp(-pl>t) + cxp(-uM)] + {[pv(q - rW[(p - r)(v - r)]}[l + cxp( -pl>t) + cxp( -vM)] + {[ru(q - p)]/[(r - p)(u - p)IHl + cxp( -rl>t) + cxp( -vl>t)] + {[rp(q - u)]/[(r - v)(p - v)]}[l + cxp( -rl>t) + cxp( -pl>t)j) + p)l>t] + cxp[-(p + v)l>t) + cxp[-(r + v)l>t]) b, = [-KI(rpv)]{-q(cxpl-(r + {[pu(q - 1')]/[(1' - r)(v - r)]}{ cxp( -I'M) + cxp( -vl>t) + cxp[ -(I' + v)l>t]) + {[rv(q - 1')]/[(1' - p)(v - p)J}{cxp«-rl>t) + cxp(-vl>t) + cxp[-(r + v)l>t]) + {[rp(q - v)]/[(r - v)(p - v)]H cxp( -rl>t) + cxp( -pl>t) + cxp[- (r + p)M]}) b, = [KI(rpv)I(qcxp[-(r + I' + v)M] + {[pu(q - r)]/[(p - r)(u - r)]} cxp[ -(I' + v)l>t] + {[rv(q - 1')]/[1' - p)(v - p)]} cxp[-(r + v)l>t] + {[rp(q - v)]/[(r - v)(p - v)]} cxp[ -(I' + p)l>tj) a, a, "2 11, b, b2 = -{I + cxp(-rl>t) + cxp(-pl>t)} = cxp( -rl>t) + cxp( -pl>t) + cxp[-(r + p)l>tl = -cxp[- (r + p)l>t] = (Klrp){ql>t - (I - 'III' - '1/1')11 + cxp( -rl>t) + cxp( -pl>t)J + ([1'('1 - 1')1/[1'(1' - 1')1)[2 + cxp( -rl>t)] + ([1'('1 - 1')1/[1'(1' - 1')])[2 + cxp(-pM)]) = (- Kilp )(ql>t[ cxp( - rl>t) + cxp( - pl>t)] - (I - 'III' - qlr){cxp( -rl>t) + cxp( -pl>t) + cxpl-(r + p)l>t]} + {[p(q - 1')1/[1'(1' - p)IH 1 + 2 cxp( -pl>t)1 + 1>, = {[r(q - 1')]/11'(1' (Klrp({[(ql>t + + {[r(q {[p(q - + 1)1'1' 1')[/11'(1' - 1')1/[1'(1' r)IHI + - - '1(1' + r)]}cxp(-rl>t) p)]} cxp( -pl>t» "'" :". JJ CD §I S' (Q -0 c en CD -I 03 ::J (f) " ~ C ::J "- 0' ::J (f) o o :::;; CD (i) ::J () CD m 2 cxp(-rl>t)j) p)l/(rp)}cxp[-(r '" + ..0 p)l>t] c ~ 0' ::J (f) U1 CO ....•. 582 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS $ b, c, W ill, lm, -$ W ' W' -$w' -+ =f =t:f'rr s-plane First-order -ws/2 systems (s-domain) (a) y(l) z-plane , ~, ~, ~, ~ ~, (b) Second-order systems (s-domain) (c) (d) (e) (f) (g) (h) Figure 24.6 Effect of pole locations on impulse response. y*(1) + {[ru(q - p)]/[(r + {[rp(q - u)]/[(r b, = [KI(rpv)](- qcxp[-(r + {[pv(q - r)]/[(p + {[rv(q - p)]/[(r + {[rp(q - v)]I[(r K(s (s + rHs + 'I) + p)(s + b12-1 v) 1 + + b,Z-2 + b,z-' + (11Z-] (12Z-2 + (1:1Z-3 a1 a, a, b1 b2 b, - p)(u - r)(v + cxp(-uM) + cxp( -pM) - p)J}{cxp(-rt.l) u)(p +p - u)]}{ cxp( -rt.l) + u)t.l] r)J} cxp[-(p - p)(v - p)J} cxp[ -(r - vHp - v)]} cxp[-(r + exp[-(r + cxp[ -(r + + u)M]} p)M]}) + v)M] + u)t.l] + p)M)) = -{cxp( -rt.l) + cxp( -pt.l) + cxp( -vt.l)) = cxp[-(r + p)M] + cxp[-(p + u)t.l] + cxp[ -(r + U)t.l] = -cxp[-(r + I' + V)t.l)] = [KI(rpu)]( - q[ cxp( - rM) + cxp( - pt.l) + cxp( - Ut.l)] + {[pu(q - r)]/[(p - r)(u - r)]}[! + cxp( -pt.l) + cxp( -vt.l)J + {[rv(q - p)I/[(r - p)(v - p)]}[1 + cxp( -rt.l) + cxp( -Vt.l)] + {[rp(q - v)]/[(r - vHp - v)]}[! + cxp( -rt.l) + cxp( -pt.l)]) = [-KI(rpv)J{ -q( cxp[ -(r + p)t.l] + cxp[-(p + u)M) + cxp[ -(r + v)MJ) + {[pu(q - r)]I[(p - r)(u - r)]H cxp( -pt.l) + cxp( -ut.l) + cxp[ -(p + U)t.lJ) + {[ru(q - p)J/[(r - p)(u - p)]}{ cxp« -rt.l) + cxp( -Vt.l) + cxp[-(r + U)t.lJ} + {[rp(q - v)]I[(r - u)(P - v)]H cxp( -rt.l) + cxp( -pt./) + cxp[ -(r + p)M]}) = [KI(rpv)I('I cxp[ -(r + I' + U)t.l] + {[pU(11 - r)]/[(p - r)(u - r)]} cxp[ -(I' + u)t.ll + {[rv(q - p)l/[r - p)(v - p)]} cxp[ -(r + v)t.lj + {[rp(q - u)]/[(r - u)(p - v)]} cxpl-(r + p)t.lj) I\) "' :". :IJ <1> ![ S' to -u c: en <1> -i OJ ::J (J) K(s s(s + + rHs 'I) + b12-1 1') 1 + + (1!Z-1 b22-2 +(/2Z-2 + b,z-' + U3Z-J = -{I + cxp( -rt./) + cxp( -pt.l)} "2 = cxp( - rt.l) + cxp( - pt.l) + cxp[- (r + I' )t.l] ", = -cxp[-(r + p)t.l] bl = (Klrp){qt./ - (I - 'III' - qlr)[ I + cxp( -rt.l) + cxp( + (lr(q - 1')1/11'(1' - r)J)12 + cxp( -rt./)] + (11'('1 - r)l/[r(r - 1')1)[2 + cxp( -pt.l)]} b2 = (- Klrp )(qt.ll cxp( - rt./) + cxp( - pt.l) I - (1 - 'III' - qlr){cxp( -rM) + cxp( -pt./) + cxp[-(r + {[p(q - r)l/lr(r - p)]}11 + 2cxp(-pt./)] ~ a1 + {Ir(q - 1')1/11'(1' - r)]}[ I + 2 cxp( -rt./)J) - I)rp + q(r + p)l/(rp)} cxp[ -(r b, = (Klrp({[(qt./ + {[r(q - 1')]/11'(1' - r)J} cxp( -rt./) + {[p(q - r)]I[r(r - p)]} cxp( -pt./)) T1 c: ::J >1 o' -pM)1 ::J (J) o o =0 <1> + p)t./]} ro ::J () <1> m + p)t./] .D c: ~ o' ::J (J) 01 CO •...•. 582 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS c, b, lllilL -$ W' -$W' =t:f'iT-+ s-plane First-order y(t) -ws/2 systems (s-domain) (a) z-plane ~, ~, ~, ~, ~, ~ (b) Second-order systems (s-domain) (c) (d) (e) (f) (g) (h) Figure 24.6 Effect of pole locations on impulse response. y*(t) 24.6 Table 24.3 Conversion First-order Difference Output as a Function of Pole Location (unit impulse input) Xn 00+ 1PI-0.9 00.656 -0.9 +0.81 -0.729- = 10.590 0101-0.3 +0.09 -+PI 0.0024 0.8 0.64 0.410 0.512 0.027 0.328 0.0081 = 0.8 -0.3 can oscillate. tem. 583 Between Laplace and z-Transforms Such behavior Yn is not possible with a first-order continuous-time sys- Oscillation can also occur for second-order discrete-time systems, if the poles have imaginary (complex conjugate) values (see cases f-h in Fig. 24.6). When a positive or negative zero occurs in the discrete-time model, the degree of oscillation as well as its frequency can be affected. Unfortunately it is not possible to categorize this case easily, so we refer the reader to some examples presented by Franklin and Powell [5, pp. 32-35]. The mapping of zeros from continuous time to discrete time is unpredictable, mainly due to sampling effects. Consider the second-order difference equation resulting from a second-order continuous-time transfer function with no zero. In Eq. 24-116, the poles are found from factoring the denominator polynomial into two roots. The zero of the discrete-time transfer function is - bz/ b1, which is fairly complicated when expressed in terms of TJ and TZ (see Eqs. 23-24 and 23-25). Therefore, there is no apparent simple relation between continuous- and discretetime zeros. In addition, the sampling period can have a profound influence on the sampled response [7]. For example, an inverse response in continuous time (see Fig. 6.3) may not be observed at the sampling instants if the sampling rate is too slow. 24.6 CONVERSION BETWEEN LAPLACE AND z-TRANSFORMS We have previously seen that Table 24.1 can be used to convert Laplace transforms to z-transforms and vice versa. However, implicit in this approach is the requirement that partial fraction expansion be performed to obtain the correct conversion. An alternative approach that avoids partial fraction expansion yields an approximate result merely by performing a variable substitution. No zero-order hold is explicitly considered in this approach. As discussed earlier, the transform variable z was defined by z = eS::'t or Z-1 = e-s!lt. To obtain an approximate relation expressing s in terms of a ratio of polynomials in z, we can use the Pade approximation for e -s!lt _ 2 - stit e -stlt =--- 2 + stit Equating to r J (24-118) gives z- 1 :::= 2 - --- 2 stit + stit (24-119) 584 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS or (24-120) The approximation suggests that a Laplace transform can be converted to a z-transform by substituting (24-120) for s. Such an approach is known as Tustin's method [1]. A less accurate expression for s can be derived using the power series e-s':'t = 1- s26.t2 s6.t + -- 2 - ... (24-121) Retaining only the first two terms, we have Z-I = e-s':'t == 1- s6.t or s= (24-122) which is equivalent to the backward difference formula we have used in Chapter 23. When the algebra involved in the substitution is not too complicated, (24-120) should be used instead of (24-122) to improve accuracy. Ogata [1] has listed more accurate formulas for algebraic substitution into a transfer function G(s). Approximate substitution is a procedure that should always be used with care. Exact conversion, especially of the process model (up to third order), is recommended. A bilinear transformation similar to (24-120) in form is sometimes used for stability analysis; its use will be discussed in Chapter 25. EXAMPLE 24.12 Find an expression for the pulse transfer function of an ideal PID controller, Ge(s) TIS + = Ke( 1 + ~ TDS) (24-123) using the approximation in (24-122). Compare your result with the velocity form of the PID algorithm given in Eq. 8-18. Solution Substituting (24-122) into (24-123) gives Ke(ao + alrl + a2z-2) 1 - Z-I (24-124) (24-125) If e" is P(z)/E(z) the error signal and and p" is the output from the controller, then Gc(z) = (24-126) Summary Using the real translation discrete-time form gives: theorem and converting the controller equation 585 into a (24-127) Substituting for aQ, settings Kn Tf, and Pn - Pn-I = al> TD and gives az Kc [ (en - and collecting en-I) Note that this equation is identical difference approximation. + ---:-en -II IlT + terms with respect A(en ~t TD - 2en_1 + to the controller en-z) ] to Eq. 8-18 which was derived (24-128) . using a finite- SUMMARY In this chapter we have introduced the z-transform and its properties, in much the same fashion as was done for Laplace transforms and continuous-time linear systems in Chapters 3 and 4. Operational use of the z-transform with linear process models has been emphasized here, since z-transforms are a convenient medium to analyze Table 24.4 Discrete/Continuous Conversions for Linear Systems hold function, Method (section or (C) equation) Conversion table transfer (§24.1, (§24.1) (§24.2) §24.2) of then use (E)regression Translation theorem (1) Zero-order Linear Use Convert 24-104 ~ followed to(§24.4) partial Laplace fraction by (§23.3) transform; integration Eq. Conversion 23-21 Finite difference approximation 24.2 or Eq. constant input, Table (3) use Analytical (§23.2) Contour time Nonlinear Approximate (§23.1) (C)series (§24.2) (§7.1) integration, regression ~rksubstitution analytical for 24.1 Eq. piecewise (§23.1) ~in24-66 continuous then solution (§24.6) expansion difference ~solution Table equation (2) (2) Power in by long division (§24.3) 586 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS digital feedback control systems (Chapters 25 and 26). In Chapters 22-24 we have presented a rather diverse set of techniques for converting continuous models to discrete models and vice versa. Hence, a suitable epilog to this chapter would be to provide a summary of the possible avenues for interconversion. Table 24.4 gives a list of different approaches, the steps involved, and the pertinent sections or equations where the specifics are demonstrated. REFERENCES 1. Ogata, K., Discrete Time Control Systems, Prentice-Hall, Englewood Cliffs, NJ, 1987. 2. Corripio, A. B., Module 3.3 in AIChemI Modular Instruction, Series A, Vol. 3, AIChE, New York (1983). 3. Smith. C. L., Digital Computer Process Control, InText, Scranton, PA, 1972. 4. Deshpande. P. B., and R. H. Ash, Elements of Computer Process COllfrol, Instrum. Soc. of America, Research Triangle Park, NC, 1981. 5. Franklin, G. E, and J. D. Powell, Digital Control of Dynamic Systems, Addison-Wesley, Reading. MA. 1980. 6. Neuman, C. P., and C. S. Baradello. Digital Transfer Functions for Microcomputer Control. IEEE Trans. Systems, Man, Cybernetics SMC-9 (12), 856 (1979). 7. Astrom, K. J., and B. Wittenmark, Computer-Controlled Systems, Prentice-Hall. Englewood Cliffs, NJ. 1984. EXERCISES 24.1. What is the z-transform F(z) of the triangular values: period has the following pulse in the figure if the sampling (a) I1t = 5 s (b) I1t = 10s 2 f 1 I 40 00 Time (s) 24.2. A temperature sensor has the transfer function, T~,(S ) T' (s) 1 lOs + 1 where T;/1 is the measured temperature and T' is the temperature (both in deviation variables). The temperature measurement is sampled every five seconds and sent to a digital controller. Suppose that the actual temperature changes in the following manner, T(t) = 370 of { 350 350 of of for 0 :s:; t < 4 s for 4 :s:; t < 12 s for t 2: 12 s (a) What is the z-transform of this signal, T(z)? T", (z). (b) Derive an expression for the z-transform of the measured temperature (c) The digital controller sounds an alarm if the sampled value of T", exceeds 360 oF. Does the alarm sound? (d) What is the maximum value of the measured temperature T",(t)? 587 Exercises 24.3. Suppose that 1 - 0.2rl = (1 + 0.6r1)(1 - 0.3rl)(1 F(z) - rl) r (a) Calculate the corresponding time-domain response (t). (b) As a check, use the final value theorem to determine the steady-state value of r(t). 24.4. Determine the inverse transform of z(z (z - 1) (Z2 + 1) - Z + 1) by the following methods: (a) Partial fraction expansion. (b) Long division. 24.S. Calculate the z-transform of the rectangular pulse shown in the drawing. Assume that the sampling period is t:.t = 2 min. The pulse is f = 3 for 2 s:: t < 6. 6.3 46 2 Time (min) f oLL 0 18 24.6. The pulse transfer function of a process is given by Y(z) X(z) + 0.6) + 0.41 5(z Z2 - Z (a) Calculate the response Y(nLlt) to a unit step change in x using the partial fraction method. (b) Check your answer in part (a) by using long division. (c) What is the steady-state value of y? 24.7. The desired temperature trajectory T(t) for a batch reactor is shown in the drawing. (a) Derive an expression for the Laplace transform of the temperature trajectory, T(s). (b) Determine the corresponding z-transform T( z) for sampling periods of and 8 min. t:.t =4 T(OC) 80r 25~ / J o 40 20 Time (min) 24.8. The dynamic behavior of a temperature sensor and transmitter can be described by the first-order transfer function, T;"(s) _ e-2s T' (s) - 8s + 1 588 DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS where the time constant and time delay are in seconds T = actual temperature T m = measured temperature If the actual temperature changes as follows (t in seconds): T = for a :S t < 10 for < a10 for tt ~ 85°C 70 { 70 °C °C (a) What is the maximum value of the measured temperature Tm? (b) If samples of the measured temperature are automatically logged in a digital computer every two minutes beginning at t = 0, what is the maximum value of the logged temperature? 24.9. The transfer function for a process model and a zero-order H (s) Derive an expression Gpes) = (1 - (lOs + 1)(5s 3.8e-2s se-s~t) for the pulse transfer hold can be written + 1) of H(s) G p(s) when function as !:::,.t = 2. 24.10. The pulse transfer function of a process is given by 2.7r1(z Y(z) X(z) (a) Calculate method. the response 0.5z Z2 - + 3) + 0.06 y(n!:::"t) to a unit step change in x using the partial fraction (b) Check your answer in part (a) by using long division. (c) What is the steady-state value of y? 24.11. A gas chromatograph control is used to provide composition measurements loop. The open-loop transfer function is given by G(s) = GcHGpGm G(s) = E(s) B(s) (Gu in a feedback = 1) and is ~)C - 5e-SM)( 12510+ 1)e-2S = 2(1 + 8s (a) Suppose that a sampling period of At = 1 min is selected. Calculate HG(z), pulse transfer function of G(s) with ZOH. (b) If a unit step change in the controller error signal e(t) is made, calculate sampled open-loop response b(n!:::"t) using HG(z). the the 24.12. Determine the pulse transfer function with zero-order hold for the second-order process Gp(s) = K/[(5s + 1)(3s + 1)] using partial fraction expansion in the s-domain. Check your results with those in Section 23.3. Note that At is unspecified here. 24.13. FindHG(z)ifG(s) = (1- 9s)/[(3s + 1)(15s + 1)] for At = 4 (use partial fraction expansion). What is the corresponding difference equation? Do you detect inverse response in the output Y n for a step change in the input at this sampling period? 24.14. Verify the z-transform J(t) = 1- in Table 24.15. Find the response Yn for the difference Yn - Let Xo = 1, the results. 24.1 for J(t) = t2. What is the z-transform for e -at? Xn = a for n ~ Yn-l equation + 0.21 Yn-2 = Xn-2 1. Use long division as well as direct integration to check Exercises 24.16. Use long division to calculate the first eight coefficients of the z-transform F(z) 589 given by 0.8r1 = (1 _ 0.8r1)Z 24.17. Derive the pulse transfer function for an analog lead-lag device cascaded with a zeroorder hold. The lead-lag device has the transfer function the steady-state gain of the pulse transfer function. 24.18. Determine the sampled function f(n6.t) corresponding (TIS + 1)1(TZS + 1). Check to the z-transform F( z ) = 1 _ 1.5r1 0.5r1+ 0.5z-2 Use partial fraction expansion (6.t = 1) and compare the results with the long division method for the first six sampled values (n = 0, 1, ... ,5). 24.19. For G(s) = 1/[(s + 1)(s + 2)], obtain G(z) for IJ.t = 1. Determine the response to a unit step change in the input. Repeat using Tustin's method (approximate z-transform) and compare the step responses for the first five samples. 24.20. To determine the effects of pole and zero locations, calculate and sketch the unit step responses of the pulse transfer functions shown below for the first six sampling instants, n = 0 to n = 5. What conclusions can you make concerning the effect of pole and zero locations? 1 1 r1 (b) (c)(a)11=_+ 0.7r1 1 (d) (1 + 0.7z-1)(1 - 0.3r1) 1 - 0.5r1 (e) (1 + 0.7r1)(1 f ( ) (1 + - 0.3r1) 1 - 0.2rl - 0.3r1) 0.6r1)(1 24.21. For the transfer functions shown below, determine function HGp(z) for the system and a zero-order the corresponding pulse transfer hold. 1 Gp(s) = (s + (b) Gp(s) = (s + (a) 1)3 6(1 2)(s s) + 3) For sampling periods of 6.t = 1 and IJ.t = 2, determine whether any poles or zeros of HG p(z) lie outside the unit circle for either process. Discuss the significance of these results.