next up previous
Next: PID Up: Control examples Previous: Impulse response

Mixed-sensitivity

\fbox{\epsfig{file=foo0_100.eps,width=3.75in}}

Mixed Sensitivity Controller Design
file: /usr/local/lib/scilab/demos/control/scheme.dem
-->s=poly(0,'s');
-->str='[(s-1)/((s-1)^2*(s+2))]';
-->rep=x_dialog('Nominal plant?',str)
 rep  =
 [(s-1)/((s-1)^2*(s+2))]
-->if rep==[] then return,end
-->Plant=evstr(rep);Plant=syslin('c',Plant);
--> //Nominal Plant
-->P22=tf2ss(Plant);    //...in state-space form
-->[ny,nu,nx]=size(P22);
-->[Pms,r]=augment(P22);
-->txt=['W1 (sensitivity function S)';'W2 (K*S)';'W3 (complementary sensitivity T)'];
-->default=['s';'1';'1'];
-->while %t
-->  rep=x_mdialog('Set weighting functions',txt,default);
-->  if rep==[] then return;end
-->  W1=evstr(rep(1));W2=evstr(rep(2));W3=evstr(rep(3));
-->  default=rep;
-->  Pms=sysdiag(W1,W2,W3,eye(P22))*Pms;
-->  gms=['gamma min= ';'gamma max= ';'# iterations'];
-->  vals=['0.01';'1000';'50'];
-->  reps=x_mdialog('Set interval for gamma and #iterations',gms,vals);
-->  if reps==[] then return;end
-->  mumin=1/evstr(reps(2))^2;
-->  mumax=1/evstr(reps(1))^2;
-->  iter=evstr(reps(3));
-->  [K,mu]=h_inf(Pms,r,mumin,mumax,iter);
-->  if K~=[] then break;end
-->end
P22 is stabilizable
P22 is detectable
 gama =       0.0141421356 Unfeasible (Hy hamiltonian)  test =     0.10002E+01
 gama =       0.0200000000 Unfeasible (Hy hamiltonian)  test =     0.10004E+01
 gama =       0.0282842712 Unfeasible (Hy hamiltonian)  test =     0.10008E+01
 gama =       0.0400000000 Unfeasible (Hy hamiltonian)  test =     0.10016E+01
 gama =       0.0565685424 Unfeasible (Hy hamiltonian)  test =     0.10032E+01
 gama =       0.0799999997 Unfeasible (Hy hamiltonian)  test =     0.10064E+01
 gama =       0.1131370843 Unfeasible (Hy hamiltonian)  test =     0.10129E+01
 gama =       0.1599999980 Unfeasible (Hy hamiltonian)  test =     0.10259E+01
 gama =       0.2262741642 Unfeasible (Hy hamiltonian)  test =     0.10525E+01
 gama =       0.3199999836 Unfeasible (Hy hamiltonian)  test =     0.11079E+01
 gama =       0.4525482936 Unfeasible (Hy hamiltonian)  test =     0.12282E+01
 gama =       0.6399998690 Unfeasible (Hy hamiltonian)  test =     0.15151E+01
 gama =       0.9050963092 Unfeasible (Hy hamiltonian)  test =     0.23875E+01
 gama =       1.2799989515 Unfeasible (Hy hamiltonian)  test =     0.10062E+02
 gama =       1.8101903941 Unfeasible (spectral radius) test =     0.30241E+02
 gama =       2.5599916116 Unfeasible (spectral radius) test =     0.77599E+01
 gama =       3.6203629935 Unfeasible (spectral radius) test =     0.25913E+01
 gama =       5.1199328927 Unfeasible (spectral radius) test =     0.64735E+00
 gama =       7.2405836346              OK              test =    -0.20897E+00
 gama =       5.9119634387 Unfeasible (spectral radius) test =     0.21053E+00
 gama =       6.4762088338              OK              test =    -0.13204E-02
 gama =       6.1748346150 Unfeasible (spectral radius) test =     0.10407E+00
 gama =       6.3201389847 Unfeasible (spectral radius) test =     0.51243E-01
 gama =       6.3967464111 Unfeasible (spectral radius) test =     0.24929E-01
 gama =       6.4361097503 Unfeasible (spectral radius) test =     0.11796E-01
 gama =       6.4560658971 Unfeasible (spectral radius) test =     0.52357E-02
 gama =       6.4661138349 Unfeasible (spectral radius) test =     0.19572E-02
 gama =       6.4711554288 Unfeasible (spectral radius) test =     0.31827E-03
 gama =       6.4736806521              OK              test =    -0.50108E-03
 gama =       6.4724176710              OK              test =    -0.91414E-04
 gama =       6.4717864576 Unfeasible (spectral radius) test =     0.11343E-03
 gama =       6.4721020412 Unfeasible (spectral radius) test =     0.11005E-04
 gama =       6.4722598503              OK              test =    -0.40204E-04
 gama =       6.4721809443              OK              test =    -0.14599E-04
 gama =       6.4721414924              OK              test =    -0.17969E-05
 gama =       6.4721217667 Unfeasible (spectral radius) test =     0.46043E-05
 gama =       6.4721316295 Unfeasible (spectral radius) test =     0.14037E-05
 gama =       6.4721365610              OK              test =    -0.19664E-06
 gama =       6.4721340952 Unfeasible (spectral radius) test =     0.60351E-06
 gama =       6.4721353281 Unfeasible (spectral radius) test =     0.20344E-06
 gama =       6.4721359445 Unfeasible (spectral radius) test =     0.33990E-08
 gama =       6.4721362527              OK              test =    -0.96620E-07
 gama =       6.4721360986              OK              test =    -0.46611E-07
 gama =       6.4721360216              OK              test =    -0.21606E-07
 gama =       6.4721359831              OK              test =    -0.91034E-08
 gama =       6.4721359638              OK              test =    -0.28522E-08
 gama =       6.4721359542 Unfeasible (spectral radius) test =     0.27340E-09
 gama =       6.4721359590              OK              test =    -0.12894E-08
 gama =       6.4721359566              OK              test =    -0.50800E-09
 gama =       6.4721359554              OK              test =    -0.11730E-09
-->disp(spec(h_cl(Pms,r,K)),'closed loop eigenvalues')    //Check internal stability
 closed loop eigenvalues
! - 2.236068 !
! - 2.       !
! - 1.       !
-->[Ssens,Rsens,Tsens]=sensi(P22,K);  //Sensitivity functions

-->//Singular values plot
-->fcts=['S function';'R (=K*S) function';'T function'];
-->www=x_mdialog('Select sensitivity function',fcts,['Yes';'No';'Yes']);
-->if www==[] then return,end
-->ww1=part(www(1),1)=='Y';
-->if ww1 then
-->  xbasc(1);xset("window",1);xselect();gainplot(Ssens)
-->  xtitle('S = Sensitivity function');
\fbox{\epsfig{file=foo1_3.eps,width=3.75in}}
-->end
-->ww2=part(www(2),1)=='Y';
-->if ww2 then
-->  xbasc(2);xset("window",2);xselect();gainplot(Rsens);
-->  xtitle('R (=G*S) Sensitivity function');
-->  xend()
-->end
-->ww3=part(www(3),1)=='Y';
-->if ww3 then
-->  xbasc(3);xset("window",3);xselect();gainplot(Tsens);
-->  xtitle('T = Complementary Sensitivity function');
\fbox{\epsfig{file=foo3_1.eps,width=3.75in}}



Scilab group