Evaluate tuning goals for tuned control system
Tune a control system with
systune, and evaluate the tuning goals with
Open the Simulink® model
Create tracking, roll-off, stability margin, and disturbance rejection requirements for tuning the control system.
Req1 = TuningGoal.Tracking('az ref','az',1); Req2 = TuningGoal.Gain('delta fin','delta fin',tf(25,[1 0])); Req3 = TuningGoal.Margins('delta fin',7,45); MaxGain = frd([2 200 200],[0.02 2 200]); Req4 = TuningGoal.Gain('delta fin','az',MaxGain);
slTuner interface, and tune the model using these tuning goals.
ST0 = slTuner('rct_airframe2','MIMO Controller'); rng default [ST1,fSoft] = systune(ST0,[Req1,Req2,Req3,Req4]);
Final: Soft = 1.13, Hard = -Inf, Iterations = 91
ST1 is a tuned version of the
slTuner interface to the control system.
ST1 contains the tuned values of the tunable parameters of the MIMO controller in the model.
Evaluate the margin goal for the tuned system.
[hspec,fval] = evalGoal(Req3,ST1); fval
fval = 0.5140
The normalized value of the tuning goal is less than 1, indicating that the tuned system satisfies the margin requirement. For more information about how the normalized value of this tuning goal is calculated, see the
TuningGoal.Margins reference page.
Evaluate the tracking goal for the tuned system.
[hspec,fval] = evalGoal(Req1,ST1); fval
fval = 1.1327
The tracking requirement is nearly met, but the value exceeds 1, indicating a small violation. To further assess the violation, you can use
viewGoal to visualize the requirement against the corresponding response of the tuned system.
Req— Tuning goal to evaluate
TuningGoalobject | vector of
Tuning goal to evaluate, specified as a
or vector of
TuningGoal objects. For a list of
TuningGoal objects, see Tuning Goals.
T— Tuned control system
Tuned control system, specified as a generalized state-space
genss) model or an
to a Simulink® model.
T is typically the result
of using the tuning goal to tune control system parameters with
[T,fSoft,gHard] = systune(T0,SoftReq,HardReq),
T0 is a tunable
[T,fSoft,gHard] = systune(ST0,SoftReq,HardReq),
ST0 is a
Hspec— transfer function associated with tuning goal
Transfer function associated with the tuning goal, returned as a state-space
Hspec to compute the evaluated tuning goal,
For example, suppose
Req is a
that limits the gain H(s) between
some specified input and output to the gain profile w(s).
In that case,
Hspec is given by:
fval is the peak gain of
If H(s) satisfies the tuning
fval <= 1.
For more information about the transfer function associated with the tuning goal, see the reference page for each tuning goal.
fval— Normalized value of tuning requirement
Normalized value of tuning requirement, returned as a positive
scalar. The normalized value is a measure of how closely the requirement
is met in the tuned system. The tuning requirement is satisfied if
fval < 1. For information about
how each type of
TuningGoal requirement is converted
into a normalized value, see the reference page for each tuning goal.
For MIMO feedback loops, the
Rejection goals are
sensitive to the relative scaling of each SISO loop.
systune tries to balance the overall loop-transfer
matrix while enforcing such goals. The optimal loop scaling is stored in the
tuned closed-loop model or
T returned by
evalGoal(R,T) applies this same scaling when
evaluating the tuning goals. To omit this scaling, use
T might compromise the validity of the stored scaling. Therefore,
if you make significant modifications to
T, retuning is
recommended to update the scaling data.