www.gusucode.com > robust 案例源码程序 matlab代码 > robust/MixedSensitivityLoopShapingControllerDesignExample.m

    %% Mixed-Sensitivity Loop-Shaping Controller Design
% 
%% Recreate Plant Model 

% Copyright 2015 The MathWorks, Inc.

ag =[ -2.2567e-02  -3.6617e+01 -1.8897e+01  -3.2090e+01   3.2509e+00  -7.6257e-01;
       9.2572e-05  -1.8997e+00   9.8312e-01  -7.2562e-04  -1.7080e-01 -4.9652e-03;
       1.2338e-02   1.1720e+01  -2.6316e+00   8.7582e-04  -3.1604e+01  2.2396e+01;
       0            0            1.0000e+00   0            0           0;
       0            0            0            0           -3.0000e+01  0;
       0            0            0            0            0  -3.0000e+01];
bg = [ 0     0;
       0     0;
       0     0;
       0     0;
       30     0;
       0    30];
cg = [ 0     1     0     0     0     0;
       0     0     0     1     0     0];
dg = [ 0     0;
       0     0];
G = ss(ag,bg,cg,dg);
%% Set Up Performance and Robustness bounds
s = zpk('s'); % Laplace variable s
MS = 2; AS = .03; WS = 5;
W1 = (s/MS+WS)/(s+AS*WS);
MT = 2; AT = .05; WT = 20;
W3 = (s+WT/MT)/(AT*s+WT);
%% Compute Mixed-Sensitivity Optimal Controller
[K1,CL1,GAM1] = mixsyn(G,W1,[],W3);
%% Compute Closed-Loop System
L1 = G*K1;
I = eye(size(L1));
S1 = feedback(I,L1); % S=inv(I+L1);
T1 = I-S1;
%% Plot Results
step(T1,1.5);
title('\alpha and \theta command step responses');

figure;
sigma(I+L1,'--',T1,':',L1,'r--',W1/GAM1,'k--',GAM1/W3,'k-.',{.1,100})
legend('1/\sigma(S) performance','\sigma(T) robustness','\sigma(L) loopshape',...
       '\sigma(W1) performance bound','\sigma(1/W3) robustness bound')