Digital Control Sytem Summary # he -tranform play an important role in digital control and dicrete ignal proceing. he -tranform i defined a F () f(k) k () A. Example Conider the following equence: f(k) (0.5) k, k 0 () he correponding -tranform i F () (0.5) k k 0.5 In general, if then B. he final value theorem (3) f(k) a k, k 0 (4) F () a he final value theorem tate that: (5) lim( )F () f( ) (6) he final value theorem allow to obtain the final value of a equence without olving for the time repone. C. Example: tranfer function from difference equation Find the tranfer function for the following ytem y(k + ) y(k) u(k + ) (7) Uing the time advance property of the -tranform, it i poible to write Y () Y () U() (8) and therefore, we obtain for the tranfer function Y () U() which uually give the relationhip between the input and the output. INVERSE OF HE Z-RANSFORM he invere -tranform i f(k) Z {F ()} πj C (9) F () k d (0) where C i the cloed path defining the region of convergence. Partial fraction expanion i one of the eaiet method to olve for the invere -tranform. An example i hown below. Example Obtain the invere -tranform for the following: F () ( + 0.)( + 0.)( + 0.3) Partial fraction expanion give u: F () In order to find A: A ( + 0.) + B ( + 0.) + C ( + 0.3) () () A ( + 0.) F () 0. 50 (3) Similarly: B 00, and C 50 { 50( 0.) f(k) k 00( 0.) k + 50( 0.3) k for k 0 0 for k < 0 (4) D. ime repone of a dicrete time ytem he general form for dicrete time dynamical ytem i x(k + ) ax(k) + bu(k) (5) where x and u are the tate and input variable, repectively. he olution for ytem (5) can be obtained uing the following formula k x(k) a k x(0) + a k n bu(n) (6) n0 he time repone ha two component: Natural repone: characteried by the initial condition, i.e., the firt term in the right hand ide in equation (6). Forced repone: characteried by the input, i.e., the econd term in the right hand ide in equation (6). For a linear time invariant ytem uch a the one in figure, the relationhip between the input and the output i : y(k) h(k) u(k) h(k i)u(i) (7) i0 hi operation i called convolution and h i called the impule repone of the ytem (repone to an impule). he convolution become a imple multiplication in the -domain. hat i: Y () H()U() (8) and y(k) can be obtained from Y () uing the invere - tranform.
Digital Control Sytem Spring 08, Summary 5 Step Repone 4.5 4 3.5 Fig.. Linear time invariant ytem Amplitude 3.5 E. Example.5 0.5 Find the impule repone of the ytem y(k + ) 0.5y(k) u(k) (9) y(0) 0 (0) he unit impule i defined a { for k 0 u(k) δ(k) 0 for k 0 We get which lead u to: () y() 0.5 0 + () y() 0.5 0 + 0.5 + 0 (3) y(3) 0.5 (4) y(4) 0.5 3 (5) y(5) 0.5 4 (6) Uing the -tranform, we get from which we get (7) y(k) 0.5 k (8) Y () 0.5Y () U() (9) Y () U() 0.5 Since the input i a unit impule Y () 0.5 We already know that a k a he time delay property implie that: (30) (3) (3) Z{f(k n)} n F () (33) Uing the previou equation including the time delay property with n, we get which confirm the previou reult. y(k) 0.5 k (34) 0 0 0.5.5.5 3 ime (ec) Fig.. ime repone with ampling time 0. F. Example: Final value of a equence Conider the ytem y(k + ) 0.75y(k) u(k) (35) y(0) 0 (36) where u(k) i a unit tep. Find y( ) uing the time repone and then uing the final value theorem. Uing the time repone: partial fraction expanion allow u to write Y () herefore ( 0.75)( ) 4 ( ) + 4 ( 0.75) (37) y(k) 4() k 4(0.75) k (38) a k approache infinity, (0.75) k 0, and thu: Uing the final value theorem y( ) 4 (39) Y () U() 0.75 Since the input i a unit tep: Y () ( 0.75)( ) (40) (4) Now y( ) lim( ) ( 0.75)( ) 4 (4) he unit tep repone for ytem (35) i hown in figure. Clearly, from the figure, the final value i 4. G. Forward and backward Euler approximation Forward Euler approximation: We approximate the derivative at ample k by looking forward and comparing
Digital Control Sytem Spring 08, Summary between current (at time k) and next ample (at time k + ). hi give u ẏ(k) y(k + ) y(k) (43) Backward Euler approximation: We approximate the derivative at ample k by looking backward and comparing between current (k) and pat ample (k ). hi implie y(k) y(k ) ẏ(k) (44) Equation (44) i then written a y(k + ) y(k) ẏ(k + ) (45) aking the average: By averaging the forward and backward approximation we obtain: ẏ(k + ) + ẏ(k) (y(k + ) y(k)) (46) By introducing the and variable in equation (43, 44, 46), it i poible to write: From equation (43): Y Y Y From equation (44): Y Y Y From equation (46): (47) (48) (49) (50) Y + Y (Y Y ) (5) (5) + hi tranformation i called bilinear or utin tranformation. Equation (48, 50, 5) allow to obtain a digital approximation of continuou time tranfer function. H. utin tranformation: to -plane he tranformation between the -plane and the -plane i e (53) he utin tranformation i a linear approximation of thi relationhip. Solving for a a function of, we get ln (54) Fig. 3. Relationhip between the -plane and the -plane and block diagram for example he natural logarithm can be expanded into an infinite erie a follow where ln (x + /3x 3 + /5x 5 +...) (55) x + (56) he utin tranformation i obtained by keeping the firt term only: (57) + or + (58) he tranformation map the left half plane in the -domain to the unit dik in the -plane a hown in figure 3- top. utin method i alo called the bilinear tranform. It i poible to ue Matlab function yd cd(y,, method) (59) to find the dicrete time ytem where i the ampling time, for utin approximation method tutin. I. MODELING OF DIGIAL CONROL SYSEMS he block diagram of a digital control ytem i hown in figure 5, where DAC convert number calculated by the micro controller into analog ignal he analog ubytem include the plant, amplifier, actuator, etc. he output of the analog ytem i meaured and converted into a number fed back to the microcontroller. A. ADC model We aume that there i no delay and the ampling i uniform, thi implie a fixed ampling rate. hee aumption 3
Digital Control Sytem Spring 08, Summary Fig. 4. Relationhip between continuou (differential equation), dicrete (difference equation) and frequency domain repreentation Fig. 6. op: ZOH, FOH and SOH continuou approximation of digital ignal, and bottom approximation of a rectangular pule, by a poitive tep followed by a negative tep. Fig. 5. op: block diagram for a digital control ytem, middle: an ideal ampler, and bottom ero order hold. Fig. 7. are reaonable and accepted for mot engineering application. he ideal ampler of period i jut a witch. Ideal ampler implie that the witch cloure time i much maller that the ampling period. Ideal ampling i alo called impule ampling becaue it can modeled a an impule train a follow: δ (t) δ(t k ) (60) where δ(t k ) i a delayed impule. he ampled ignal become f(k ) f(t)δ (t)) f(t)δ(t k ) (6) where f(k ) repreent f(t) at ampling time k. B. DAC model Continuou ignal recontruction i achieved by the DAC. We want to find an input-output relationhip for the DAC. he ero-order hold (ZOH) i the mathematical model that allow modeling the conventional digital-to-analog converter (DAC). he ZOH recontruct the analog ignal by holding each ample value for one ampling period: {u(k)} u(t) u(k) for k t (k + ) (6) Zero order hold i the mot widely ued technique, but firt order hold and econd order hold are alo ued. Firt order hold ue traight line a hown in figure 6. Second order hold ue a parabola a hown in figure 6. he tranfer function of a ero order hold can be obtained noting that a rectangular pule can be repreented by a poitive tep followed by a negative tep (figure 6 bottom). We already know that L{u(t)} (63) where u(t) i the unit tep. Uing Laplace tranform propertie, we can write herefore L{u(t )} e G oh () e C. DAC, analog ubytem and ADC (64) (65) Cacading the DAC, and analog ytem and ADC appear frequently in digital control ytem. he goal here i to derive dicrete time tranfer function of the entire ytem. 4
Digital Control Sytem Spring 08, Summary D. Example Conider the circuit in figure 7, the goal i to find the digital tranfer function of the ytem. It i poible to write and G a () G()G oh () ( e ) G() (66) g a (t) g(t) g oh (t) (67) from which it i poible to write { } G() G() a ( )Z (68) E. Example Find G a knowing the analog ytem i the circuit of figure 7. We have G() τ (69) + τ herefore, { } G a ( )Z + (70) τ with τ L/R. From the table it i poible to write G a (7) e /τ G a (7) e τ We can alo ue the utin tranform. In thi cae, we have G a G a τ ( ) (+) + τ( ) (+) τ τ ( + τ) + τ (73) (74) Fig. 8. A unity feedback cloed loop ytem. G a tand for the dicrete time tranfer function of the ZOH and the analog ubytem he cloed loop characteritic equation i + C()G a () 0 (79) he root of thi equation are called the pole of the cloed loop ytem. II. CLOSED LOOP RANSFER FUNCION AND CHARACERISIC POLYNOMIAL he characteritic and propertie of the cloed loop ytem play an important role in control tudie. Conider the unity feedback ytem of figure 8. he input i R() and the output i denoted by Y (), C() i the digital controller. he goal i to derive the cloed loop tranfer function. he error ignal i E() R() Y () (75) We alo have Y () C()G a ()E() (76) By definition, the open loop ytem i C()G a (). Subtituting the error by it value in equation (75), we get Y () C()G a () (R() Y ()) (77) from which the tranfer function i derived G cl () C()G a() + C()G a () (78) 5