www.gusucode.com > control 案例程序 matlab源码代码 > control/MinimumLoopGainAsConstraintOnSensitivityFunctionExample.m

    %% Minimum Loop Gain as Constraint on Sensitivity Function
% 
% Examine a minimum loop gain requirement against the tuned loop gain.
% A minimum loop gain requirement is converted to a constraint on the gain
% of the sensitivity function at the requirement location.  
% 
% To see this relationship between the requirement and the sensitivity
% function, tune the following closed-loop system with analysis points at |X1| and |X2|.  The control system has tunable PID
% controllers |C1| and |C2|.
%%
% 
% <<../minloopgain1.png>>
% 
%% 
% Create a model of the control system.
G2 = zpk([],-2,3);
G1 = zpk([],[-1 -1 -1],10);
C20 = tunablePID('C2','pi');
C10 = tunablePID('C1','pid');
X1 = AnalysisPoint('X1');
X2 = AnalysisPoint('X2');
InnerLoop = feedback(X2*G2*C20,1);
CL0 = feedback(G1*InnerLoop*C10,X1);
CL0.InputName = 'r';
CL0.OutputName = 'y';
%%
% Specify some tuning requirements, including a minimum loop gain
% requirement.  Tune the control system to these requirements. 
Rtrack = TuningGoal.Tracking('r','y',10,0.01);
Rreject = TuningGoal.Gain('X2','y',0.1);
Rgain = TuningGoal.MinLoopGain('X2',100,10000);
Rgain.Openings = 'X1';

[CL,fSoft] = systune(CL0,[Rtrack,Rreject,Rgain]);

%% 
% Examine the |TuningGoal.MinLoopGain| requirement against the
% corresponding tuned response. 
viewSpec(Rgain,CL)
%% 
% The plot shows the achieved loop gain for the loop at |X2| (blue line).
% The plot also shows the inverse of the achieved sensitivity function,
% |S|, at the location |X2| (green line).  The inverse sensitivity function at this
% location is given by |inv(S) = I+L|.  Here, |L| is the open-loop point-to-point
% loop transfer measured at |X2|. 
% 
% The minimum loop gain requirement |Rgain| is 
% constraint on |inv(S)|, represented in the plot by
% the green shaded region.  The constraint on |inv(S)| can be thought of as
% a minimum gain constraint on |L| that applies where the gain of |L| (or
% the smallest singular value of |L|, for MIMO loops) is greater than 1.