Exercie for lecture 0 Digital Control Micael Šebek Automatic control 06-4-
Sampling: and z relationip for complex pole Continuou ignal Laplace tranform wit pole Dicrete ignal z-tranform, t y( t) e in t, t 0 y () ( ) j k y( k) e in( k) yz ( ) Wit pole z e in( ) ze in( ) z e co( ) z e z ze co( ) e ( ) z, e co( ) j in( ) e j Tere i a relationip between te continuou and ampled ytem pole. z, e, Micael Šebek Pr-ARI-0-03
Strobocopic effect Signal wit frequencie from 0 to π/ are diplayed to unit circle after ampling. Were are diplayed ignal wit iger frequencie? Conider ine ignal wit L-tranform and pole y( t) int y (), j Te ampling period zin y( k) in( k) yz ( ) j z z zco, e In cae in Hz dicrete pole ave an angle > 80 f Hz, f f for j j( ) j j( ) i e e, e e, were( ) 0,80 And poition of te pole correpond to te frequency Micael Šebek Pr-ARI-0-03 3
Strobocopic effect ampling z e z We don't know te correct frequency band in a revere tranform (ignal recontruction) To prevent ti, we ave to ample wit a iger ample rate. Or filter out a iger frequencie tan (anti-aliaing filter) N 3 ampling z e z Micael Šebek Pr-ARI-0-03 4
Dik drive Arm implified (normalized to ) more detail ÅW, 3, ex. Tranfer function from voltage to arm poition G () goal: follow te track Accurate poition control Important dynamic reading peed Control tructure u () C u () y () controller amplifier arm Example: Dik drive Micael Šebek ARI-Pr-0-03 5
Example: continuou control Continuou controller (deigned by continuou metod ) 0.5 u( ) uc ( ) y( ) CL caracteritic polynomial c ( ) CL,3 CL tranfer function y( ) u ( ) C imulation AW.mdl Setting time for 5% i 5.5, overoot to 0% - OK How to realize digitally? ARI_0 AW.mdl >> a=^; b=;p=+;q=*+;r=.5*+; >> c=a*p+b*q c = + + ^ + ^3 >> pformat rootr >> c=a*p+b*q c = (+.0000)(^+.0000+.0000) >> T=b*r/c T = 0.5000(+) / u () C t (+.0000)(^+.0000+.0000) >> yt () >> pbar=+;qbar=*+;rbar=/; >> cbar=a*pbar+b*qbar cbar = ut () (+.0000)(^+.0000+.0000) >> Tbar=b*rbar*pbar/cbar Tbar = 0.5000(+) / (+.0000)(^+.0000+.0000) Micael Šebek ARI-Pr-0-03 6 3 j
Continuou controller i Example: Naive controller approximaton 0.5.5 u( ) 0.5 uc( ) y( ) 0.5 uc( ) y( ) y( ) 0.5 uc ( ) y( ) x( ).5 were x( ) y( ) We get a continuou time domain algoritm (control law) u( t) 0.5 u ( t) y( t) x( t) C Dicrete algoritm we ample ignal wit a period And te derivative i approximated by difference 0.5.5 dx x( t).5 y( t) dt x( t ) x( t) x( t).5 y( t) Micael Šebek ARI-Pr-0-03 7
Example: Naive deign So we get a decrete approximation x( t ) x( t ).5 y( t ) x( t ) k k k k u( t ) 0.5 u ( t ) y( t ) x( t ) k C k k k It can be realized by algoritm (were u C i dicrete) dx x( t).5 y( t) dt u( t) 0.5 u ( t) y( t) x( t) C y:= adin(in) u:= *(0.5*uc-y+x) dout(u) x:= x+(.5*y-*x) {read a proce value} {compute a control value} {end out a control value} {compute te new x value} algoritm Or dicrete tranfer function z0.5 u( z) 0.5 uc ( z) y( z) z Micael Šebek ARI-Pr-0-03 8 u( z) 0.5 u ( z) y( z) x( z) C zx( z) x( z).5 y( z) x( z) Correpond to z continuou tranfer function ubtitution
Example: comparion Comparin continuou and dicrete control for = 0. z 0.9 u( z) 0.5 uc ( z) y( z) z 0.6 ydt () t yct () t yct () t uct udt () t () t ydt () t udt () t ARI_0 AW.mdl uct () t Micael Šebek ARI-Pr-0-03 9
Variou ampling period = 0., 0.5,,.5 0. Example: comparion 0.5.5 Micael Šebek ARI-Pr-0-03 0
Example: anoter olution We find a dicrete tranfer function of a ytem and a aper. We ue dicreté metod for decreet controller deign Solve te equation We get G () z z p( z) z q( z) z 3 p p q q 0 0 0 p p q q 0 0 3 4 Gz () 0 0 0 0 0 0 3 5 0 0 z z p( z) 3 4 z 3 5 q( z) z Micael Šebek ARI-Pr-0-03
Example: anoter olution Ti pure dicrete controller 4 5 z 3 5 u( z) u ( z) y( z) C 7 z 3 4 It give a tranfer function ( z)( z3 4) y( z) u ( ) 3 C z 7 z and CL caracteritic polynomial c z z CL () imulation ARI_0 AW 3.mdl for =.4 3 Micael Šebek ARI-Pr-0-03
Example: anoter olution Simulation ARI_0 AW 3.mdl for =.4 output: input: peed: yt () ut () yt () Te output value i te ame a required value in te 4t ample tep. Ti pure dicrete olution i better tan continuou and Tere i no parallel in continuou ytem. So wat append wit decreaing? Micael Šebek ARI-Pr-0-03 3
I it poible to decreae te number of tep even more? Apparently ye: z z p( z) z q( z) z ( z ) Solve 0 0 p0 p q0 q 0 0 0 0 0 0 we get p p q q Example: econd anoter olution 4 0 0 Micael Šebek 4 p ( z) z weak q ( z) 4 z weak controller 4 z u u C y z ( z ) y u wit CL tranfer function z and CL caracteritic polynomial c ( ) ( ) CL z z z C
Simulation Simulation econd model in ARI_0 AW 3.mdl it look OK But for nonzero initial condition reveal a problém. Note tat in moment of ampling beave perfectly Micael Šebek ARI-Pr-0-03 5
Solution wit tate feedback State equiation of double integrator are It dicrete verion (wit ZOH and ampling period ) State controller Te ytem cange to. wit polynomial Example: anoter tate olution 0 0 x( t) x( t) u( t), y 0 x( t) 0 0 G( ) x( k ) x( k) u( k), y( k) 0 x( k) 0 u k x k u k 3 ( ) ( ) ( ) C ( ) 4 x( k ) x( k) uc ( k), y( k) 0 x( k) Micael Šebek ARI-Pr-0-03 6 c z z CL () z y( z) u ( ) C z z
Simulation Simulation ARI_0_3_AW_4_5.mdl for =.4 Starting from te tird tep, te et point i exactly et, and control i zero. And for eac initial condition ytem i internally table. Micael Šebek ARI-Pr-0-03 7