The Indirect sTR Self-tuning regulator Lecture 4 Deterministic sTR Part 2 Controlle -Estimation Theme: Add practically useful feat ures Controller parameters Reference I 1. Review of indirect str Controller Process 2. Distur bances wit h known properties 3. the direct Selftunel 4. Continuo us time str The separat io n principle 5. Coding and im plement at ion 6. Conclusio ns Desig n co nt roller as if the estimates were correct. (The Cert ainty Equivalence Direct and indirect co nt ro llers Designing the Controller Cancellation of process zeros Process Ay= Bu and cont roller ru Closed loop respo nse BT yt AR+Bs be(t) res ponse Perfect mo del follow ing AR+Bs Factore B-polyno mial B=B+B B=BBy Ac= AoAm B Hence AR+B-S=A,Am= A C K. J. Ast ro m and B. Wittenmark
Lecture 4 Deterministic STR Part 2 Theme:Add practically useful features 1. Review of Indirect STR 2. Disturbances with known properties 3. The Direct Self-tuner 4. Continuous time STR 5. Coding and implementation 6. Conclusions The Indirect STR Process parameters Controller design Estimation Controller Process Controller parameters Reference Input Output Specification Self-tuning regulator The separation principle Estimate parameters Design controller as if the estimates were correct. (The Certainty Equivalence Principle) Direct and indirect controllers Designing the Controller Process Ay = Bu and controller Ru = T uc Sy Closed loop response y(t) = BT AR + BS uc(t) Desired response ym(t) = AmBm uc(t) Perfect model following BT AR + BS = BT Ac = BmAm Factore B-polynomial B = B+B Bm = BB0m Ac = AoAmB+ R = R0B+ (1) Hence AR0 + B S = AoAm = A0c T = AoB0m Cancellation of Process Zeros 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 5 10 15 20 −2 −1 0 0 5 10 15 20 0.0 0.1 0.2 Time Time ^a2 ^a1 ^ b1 ^ b0 c K. J. Åström and B. Wittenmark 1
No Process Zeros Canceled Load disturbances Controller Process What happens wit h dist urbances? Can we underst and w hat happens? . How to modify th system Simulation Compare Exampel 3.5 Explain what happe What happens to estimator y Process model Act ual process f t he co nt rol u(t)+r1(t-1)=t y(t)-s1y(t-1) No integral act io n what the adapt Parameters do not settl No steady stat C K. J. Ast ro m and B. Wittenmark
No Process Zeros Canceled 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 100 200 300 400 500 −2 −1 0 0 100 200 300 400 500 0.0 0.1 0.2 Time Time ^a2 ^a1 ^ b1 ^ b0 Load Disturbances Controller u Process y B A uc Ru = Tuc − Sy v Σ What happens with disturbances? Can we understand what happens? How to modify the system Simulation Compare Exampel 3.5 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 20 40 60 80 100 −2 −1 0 0 20 40 60 80 100 0.0 0.1 0.2 Time Time a^2 a^1 ^ b1 ^ b0 Explain what happens What happens to estimator? Process model Ay = Bu Actual Process Ay = Bu + Bv Structure of the control law u(t) + r1u(t 1) = touc s0y(t) s1y(t 1) No integral action Notice what the adaptive controller does! { Parameters do not settle { No steady state error if setpoint constant c K. J. Åström and B. Wittenmark 2
How to deal with Disturbances Modified Control design Characterize disturbances as filt ers driven Process model (pulse) Ay=B(u+u) Sequences of im pulses(pulses) Disturbance model White noise The only thing that matters is the poles of the filter! think about t his as the H nce disturbance annihil ator which wipes out as much as possible of the dist ur bance BI BR AR+ Ad(ar+ bs Adv=e BS AR+Bs Ad (ar+ bs) ●H。 w will t he dist urbance influence t he system The effect of t he dist urbances can be reduced How s hould the co ntrol system be mo by requiring that Ad is a factor of r The co nt roller s hould co nt ain a model of the the Internal Model principle dist urbances(Internal Model Principle) Details Find a cont roller which gives a specified closed op charact eristic poly nomial such that Ad is ample Integral acti a factor of r Step dist urbance Let ro and so be a solut ion to ARo+BS=A Same Ad for any piece-wise const ant sig nal Poly nomials Choose X=g+zo. the R=XRo+YB (q-1)R'=(q +zo)R+yo B then satisfies Hence AR+ BS=XA Determine ro, so to give A0 as before. Choose The new co nt roller is given by a stable polyno mial X with deg X which represents the addit io nal dynamics R=(q+co)Ro+ yo B equired to deal wit h dist ur bances. Determine (q+so)S-yo A e and x so th R=Adr=Xro+YB C K J. Ast ro m and B.Wittenmark
How to Deal with Disturbances Characterize disturbances as lters driven by { An impulse (pulse) { Sequences of impulses (pulses) { White noise The only thing that matters is the poles of the lter! Think about this as the disturbance annihilator which wipes out as much as possible of the disturbance! Adv = e How will the disturbance in uence the system? How should the control system be modi- ed? The Internal Model Principle Modied Control Design Process model Ay = B(u + v) Disturbance model Adv = e Hence y = BT AR + BS uc + BR Ad (AR + BS) e u = AT AR + BS uc BS Ad (AR + BS) e The eect of the disturbances can be reduced by requiring that Ad is a factor of R!! The controller should contain a model of the disturbances (Internal Model Principle) Details Find a controller which gives a specied closed loop characteristic polynomial such that Ad is a factor of R Let R0 and S0 be a solution to AR0 + BS0 = A0 c Polynomials R = XR0 + Y B S = XS0 Y A then satises AR + BS = XA0 c Determine R0 , S0 to give A0 c as before. Choose a stable polynomial X with deg X = deg Ad which represents the additional dynamics required to deal with disturbances. Determine R0 and X so that R = AdR0 = XR0 + Y B Example Integral action Step disturbance Ad = q 1 Same Ad for any piece-wise constant signal Choose X = q + x0. Then (q 1)R0 = (q + x0)R0 + y0B Hence y0 = (1 + x0)R0 (1) B(1) The new controller is given by R = (q + x0)R0 + y0B S = (q + x0)S0 y0A c K. J. Åström and B. Wittenmark 3
Ex ample 3.10 Modification of estimator Process model Process model G(s) s(s+1) Ay= B(a+u) Disturbance st Disturbance model Nominal cont roller Notice e small. hence Modified cont roller Ad=g-1, X AAy= Baru+ BAv= BAu+ Be R=q(g+r1)+(b+b)=(q-1)(q-b23) nt roduce the filtered signals Estimator A t a-d Then +a19+a,y Estimat io Ayy= Bu+ Be y(t)+a13(t-1)+a2y(t-2) (2) bu(t-1)+bu,(t-2) Simulation y Direct str Com pariso ns wit h ot her algo rit hms The Id phase Syster Feedforward cont rol Phase b 1 C K. J. Ast ro m and B. Wittenmark
Modication of Estimator Process model Ay = B(u + v) Disturbance model Adv = e Notice e small. Hence AdAy = BAdu + BAdv = BAdu + Be Introduce the ltered signals yf = Ady uf = A du Then Ayf = Buf + Be Example 3.10 Process model G(s) = 1 s(s + 1) Disturbance step i.e. Ad = q 1 Nominal controller R0 = q + r1 S0 = s0q + s1 Modied controller Ad = q 1, X = q R = q(q + r1) + y0(b0 + b1)=(q 1)(q b1y0) S = q(s0q + s1) y0(q 2 + a1q + a2) Estimator uf = q 1 q2 + a1q + a2 u yf = q 1 q2 + a1q + a2 y Estimation model yf (t) + a1yf (t 1) + a2yf (t 2) (2) = b0uf (t 1) + b1uf (t 2) (3) Simulation 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 20 40 60 80 100 −2 −1 0 0 20 40 60 80 100 0.0 0.1 0.2 Time Time ^a2 ^a1 ^ b1 ^ b0 Direct STR Why? { Avoid design calculation { Comparisons with other algorithms The Idea Minimum-phase Systems Examples Feedforward Control Non-minimum Phase Systems c K. J. Åström and B. Wittenmark 4
Minimum phase systems The ldea Consider the equation Process mode 八(t)=B-(Ru(t)+Sy(t) Ay(t= Bu(t Mirimumphase system(B-=bo)!! respoNse AmOy(t=bo(Ru(t+ Sy(t))= Ru(t+ Sy(t Amym(t=Bmc(t Natual to choase Diophantine eq uation A,Am= AR+B-s Introduce parameter vector let this operate ony(t)! A. Amy(t)= R'Ay(t+B- Sy(t and regression vector RBu(t)+B- Sy(t) But Hence p(t)=(u(t) u(t-e y(t y(t-) AoAmy(t=B(Ru(t+ Sy(t)) Estimate parameters in this ea uation instead n(t)=A%(9)Am(9 )y(t)=p(t-d )e An Alternat As bef an direct str Am Aoy(t=bo(Ru (t+ Sy(t)= Ru(t)+ Sy(t dly nomials Am, Bm, and A, and Filt (deg A. 2. Estimate the coeffiaents of the poly nomi (t) A2(q-1)Amn(q-1) (t as r and s in y(t) A3()4(-y( y(t)=Ru,(t-d)+S"y(t-d) Introduce parameter vector by recursive least squares. 8=(ro Compute the contro signa from and regression vector Ru(t=Tuc(t-Sy(t p(t)=(u(t)…ur(t-)gy(t)…y(t-) were The mode then becomes T=A, Am(1) y(t ADAm(Ru(t+ Sy(t) R",(t-do)+s"y,(t-d)=p (t-d, )e Repeat Steps 2 and 3 at each sampling A standard regression modd C K.J. AstO m and B wittenmark
The Idea Process model Ay(t) = Bu(t) Desired response Amym(t) = Bmuc(t) Diophantine equation AoAm = AR0 + B S let this operate on y(t)! AoAmy(t) = R0Ay(t) + B Sy(t) = R0Bu(t) + B Sy(t) But Hence AoAmy(t) = B (Ru(t) + Sy(t)) (4) Estimate parameters in this equation instead. Minimum Phase Systems Consider the equation AoAmy(t) = B (Ru(t) + Sy(t)) Minimum phase system (B = b0)!! AmAoy(t) = b0 (Ru(t) + Sy(t)) = Ru~ (t) + Sy~ (t) Natural to choose Bm = q d0Am(1) Introduce parameter vector = ( r0 ::: r` s0 ::: s` ) and regression vector '(t)=( u(t) ::: u(t `) y(t) ::: y(t `) ) Hence (t) = A o q1 Am q1 y(t) = 'T (t d0) An Alternative As before AmAoy(t) = b0 (Ru(t) + Sy(t)) = Ru~ (t) + Sy~ (t) Filter signals so that we can take derivatives uf (t) = 1 A o (q1 )Am(q1 ) u(t) yf (t) = 1 A o (q1 )Am(q1 ) y(t) Introduce parameter vector = ( r0 ::: r` s0 ::: s` ) and regression vector '(t)=( uf (t) ::: uf (t `) yf (t) ::: yf (t `) ) The model then becomes y(t) = 1 AoAm (Ru(t) + Sy(t)) = Ruf (t d0) + Syf (t d0)= 'T (t d0) A standard regression model!! An direct STR 1. Data: Polynomials Am, Bm, and Ao and relative degree d0 (deg Ao = d0 1) 2. Estimate the coecients of the polynomials R and S in y(t) = Ruf (t d0) + Syf (t d0) by recursive least squares. 3. Compute the control signal from Ru(t) = T uc(t) Sy(t) where T = A oAm(1) 4. Repeat Steps 2 and 3 at each sampling period. c K. J. Åström and B. Wittenmark 5
Example 3.7 G)=ss+1) simulation ith deg Am=2 and do Ao=d-1=0 u(t)+amn1u(t-1)+am1u(t-2)=u(t)(5) y(t)+miyi(t-1)+amly(t-2=y(t(6) gr ession mode r y(t)=rou(t-1)+riu(t-2) +Soy (t-1)+Siyi(t-2) fou(t)+fiu(t-1)=tou(t)-soy(t)-s1y(t-1) T=As A(1)=1+am1 +am2 W hat happens with do>1? Choose do= 2 and Ao=q (dead-beat) Continuous t ime stR Estimat i Exam ple C K.J. Ast rom and B Wittenmark
Example 3.7 G(s) = 1 s(s + 1) With deg Am = 2 and d0 = 1 we have deg A0 = d0 1=0. Filtering uf (t) + am1uf (t 1) + am1uf (t 2) = u(t) (5) yf (t) + am1yf (t 1) + am1yf (t 2) = y(t) (6) Regression model y(t) = r0uf (t 1) + r1uf (t 2) + s0yf (t 1) + s1yf (t 2) Control law r^0u(t)+^r1u(t 1) = t^ 0uc(t) s^0y(t) s^1y(t 1) where T = A 0Am(1) = 1 + am1 + am2 Simulation 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 5 10 15 20 −4 −2 0 2 Time ^t0=r^0 s^0=r^0 r^1=r^0 s^1=r^0 What happens with d0 > 1? Choose d0 = 2 and A0 = q (dead-beat) 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 5 10 15 20 −2 −1 0 1 2 Time t^ 0=r^0 s^0=r^0 r^1=r^0 s^1=r^0 Continuous Time STR Estimation An Algorithm Examples c K. J. Åström and B. Wittenmark 6
Estimation A(p)y(t)=B(p)u(t) Example where p=d/ dt and Process model B(p)=boP" Reg ressor filter (t= Hyy(t) (t)=Hyu(t) t)=( )2 bn T D res po nse Model for filt ered p"y(t)=9(t)e s) cws+ Recursive least squares wit h ex po entia forgetting Observer poly nomial Ao(s)=s+ao de(t) t)-g(t)( Nominal values a=l, b=l,(=0.7 and dP(2-aP()-P()(t) p (t)P(t) Control di esg ugn fb≠0 Bn(s) cWs +w2 Dio phantine equation (10) Ident ificat io n of coefficients of powers of s C K.J. Ast ro m and B Wittenmark
Estimation Process model (No disturbances!) A(p)y(t) = B(p)u(t) where p = d=dt and A(p) = p n + a1p n1 + + an B(p) = b0p n1 + + bn (7) Filtered signals yf (t) = Hf y(t) uf (t) = Hf u(t) '(t)=(p n1yf yf p n1 uf uf )T = (a1 an b1 bn)T (8) Model for ltered signals p n yf (t) = 'T (t) Recursive least squares with exponential forgetting d^ (t) dt = P (t)'(t) p n yf (t) 'T (t)^ (t) dP (t) dt = P (t) P (t)'(t)'T (t)P (t) Example Process model G(s) = b s(s + a) Regressor lter Hf (s) = 1 Am(s) Desired response Gm(s) = !2 s2 + 2!s + !2 Observer polynomial Ao(s) = s + ao Nominal values a = 1, b = 1, = 0:7, ! = 1 and ao = 2. Control Design G(s) = b s(s + a) Choose Ao (s) = s + ao and Bm(s) Am(s) = !2 s2 + 2!s + !2 Diophantine equation s(s + a)(s + r1) + b(s0s + s1 ) = (s 2 + 2!s + !2 )(s + ao ) Identication of coecients of powers of s a + r1 = 2! + ao ar1 + bs0 = !2 + 2!ao bs1 = !2ao (9) Control Design - Cont. If b 6= 0 r1 = 2! + ao a s0 = ao2! + !2 ar1 b s1 = !2ao b (10) c K. J. Åström and B. Wittenmark 7
Simulation Prototy pe algorithm skeleto n algorit hm 1 Analog-Digit al_conver sion 3 Digit al-Analog-conversion 6 Or ganize-dat a-for -est imat ion Par amet er 工 f tune t hen th_design:=th_est imat Designcalcu lat ions 11 Or ganize_dat a 12 Compute_as_much_as_possible_of cont r sIgna Parameter_update Mola code y(t)/p(t Recursive Least Squares Code (W):=P*EC. ph new(den): =lambda+trans(new(w))*EC. phi; est imat ed new( K): =new(w/de new(EC.e): =EC. val-trans(Ec. phi)*EC. theta; 1 amb da+phig*矿 (EC. thet a) k new(P): =(P-new(K*trans(w) th est imat ed h est imat ed kke (P-可*矿y/den)/1ambd C K J. Ast ro m and B.Wittenmark
Simulation 0 20 40 60 80 100 −1 0 1 0 20 40 60 80 100 −4 −2 0 2 Time Time uc y u 0 20 40 60 80 100 0 1 2 0 5 10 15 20 0 1 2 Time Time ^a ^ b a^ ^ b Prototype algorithm Skeleton algorithm 1 Analog_Digital_conversion 2 Compute_control_signal 3 Digital_Analog_conversion 4 If estimate then 5 Filter_data 6 Organize_data_for_estimation 7 Parameter_update 8 If tune then 9 th_design:=th_estimate 10 Design_calculations 11 Organize_data 12 Compute_as_much_as_possible_of_ control_signal| Parameter update Estimated model y(t) = 'T (t) Recursive Least Squares Code eps = y - phi'*th_estimated w = P*phi den = lambda + phi'*w k = w/den th_estimated = th_estimated + k*eps P = (P - w*w'/den)/lambda Omola code new(w):=P*EC.phi; new(den):=lambda+trans(new(w))*EC.phi; new(K):=new(w/den); new(EC.e):=EC.val-trans(EC.phi)*EC.theta; new(EC.theta):=EC.theta+new(K*EC.e); new(P):=(P-new(K*trans(w) c K. J. Åström and B. Wittenmark 8