[ST,fSoft,gHard] = systune(ST0,SoftReqs,HardReqs)
[ST,fSoft,gHard] = systune(ST0,SoftReqs,HardReqs,options)
[ST,fSoft,gHard,info] = systune(___)
[ST,fSoft] = systune(ST0,SoftReqs) tunes the free parameters of the Simulink® control system described by the slTunable interface, ST0. The systune command tunes the parameters to best meet the soft tuning requirements SoftReqs, and returns the best achieved soft constraint values as fSoft.
[ST,fSoft,gHard] = systune(ST0,SoftReqs,HardReqs) tunes the control system to best meet the soft tuning requirements subject to satisfying the hard tuning requirements (constraints). It returns the best achieved values for the soft and hard constraints.
slTunable.systune allows you to use the Robust Control Toolbox™ tuning command, systune, on a control system described in a Simulink model. Using slTunable provides an interface between the Simulink model and the systune command, allowing you to identify the tunable components of the system for systune to tune. Using slTunable.systune requires Robust Control Toolbox software.
slTunable interface object representing the Simulink control system to tune. For information on how to create and configure the slTunable interface, see the slTunable reference page.
Soft tuning requirements (objectives) for tuning the control system, specified as a vector of TuningGoal requirement objects. These requirement objects can include TuningGoal.Tracking, TuningGoal.Gain, or TuningGoal.Margins. (See Specifying Design Requirements for systune for a complete list.)
systune tunes the tunable parameters of the control system to minimize the soft tuning requirements, subject to satisfying the hard tuning requirements (if any).
Hard tuning requirements (constraints) for tuning the control system, specified as a vector of TuningGoal requirement objects. These requirement objects can include TuningGoal.Tracking, TuningGoal.Gain, or TuningGoal.Margins. (See Specifying Design Requirements for systune for a complete list.)
systune converts each hard tuning requirement to a normalized scalar value. systune then optimizes the free parameters minimize those normalized values. A hard requirement is satisfied if the normalized value is less than 1.
Options for the tuning algorithm, specified as an options set you create with systuneOptions. Available options include:
Tuned version of ST0.
Use viewSpec to graphically validate the design. Use slTunable.writeBlockValue to apply the tuned parameter values to the Simulink model.
Best achieved soft constraint values, returned as a vector. systune converts the soft requirements to a function of the free parameters of the control system. The command then tunes the parameters to minimize that function subject to the hard constraints. (See Algorithms.) fSoft contains the best achieved value for each of the soft constraints. These values appear in fSoft in the same order that the constraints are specified in SoftReqs. fSoft values are only meaningful when the hard constraints are satisfied.
Best achieved hard constraint values, returned as a vector. systune converts the hard requirements to a function of the free parameters of the control system. The command then tunes the parameters to drive those values below 1. (See Algorithms.) gHard contains the best achieved value for each of the hard constraints. These values appear in gHard in the same order that the constraints are specified in HardReqs. If all values are less than 1, then the hard constraints are satisfied.
Detailed information about each optimization run, returned as a data structure. In addition to examining detailed results of the optimization, you can use info as an input to viewSpec when validating a tuned MIMO system. info contains scaling data that viewSpec needs for correct evaluation of MIMO open-loop requirements, such as loop shapes and stability margins.
The fields of info are:
x is the vector of tunable parameters in the control system to tune. systune converts each soft and hard tuning requirement SoftReqs(i) and HardReqs(j) into normalized values fi(x) and gj(x), respectively. systune then solves the minimization problem:
Minimize subject to , for .
xmin and xmax are the minimum and maximum values of the free parameters.
systune returns a control system ST with parameters tuned to the values that best solve the minimization problem. systune also returns the best achieved values of fi(x) and gj(x), as fSoft and gHard respectively.
For information about the functions fi(x) and gj(x) for each type of constraint, see the reference pages for each TuningGoal requirement object.
For information about the optimization algorithms, see .
Tune the following control system to soft requirements for tracking, roll off, stability margin, and disturbance rejection.
Create and configure an slTunable interface to the model.
open_system('rct_airframe2') ST0 = slTunable('rct_airframe2','MIMO Controller'); addControl(ST0,'delta fin');
These commands create an slTunable interface to the model and specify the MIMO Controller block as the tunable portion of the control system.
The model already has linearization input points on the signals az ref, delta fin, and az. These signals are therefore available for specifying as inputs for tuning requirements. Similarly, you can use the linearization output points e and az as outputs for tuning requirements. The addControl command adds delta fin to the Controls signals of the slTunable interface. Doing so makes delta fin available as both input and output for specifying tuning requirements.
Specify the tracking requirement, roll-off requirement, stability margins, and disturbance rejection requirement.
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);
Req1 constrains az to track az ref. The next requirement, Req2, imposes a roll-off requirement by specifying a gain profile for the open-loop, point-to-point transfer function measured at delta fin. The next requirement, Req3, imposes open-loop gain and phase margins on that same point-to-point transfer function. Finally, Req4 rejects disturbances to az injected at delta fin, by specifying a maximum gain profile between those two points.
Tune the model using these tuning requirements.
Options = systuneOptions('RandomStart',3); [ST1,fSoft,~,Info] = systune(ST0,[Req1,Req2,Req3,Req4],Options);
Final: Soft = 1.13, Hard = -Inf, Iterations = 55 Final: Soft = 1.5, Hard = -Inf, Iterations = 75 Final: Soft = 1.13, Hard = -Inf, Iterations = 92
ST1 is a tuned version of the slTunable interface to the control system that contains the tuned values of the tunable parameters of the MIMO controller in the model.
The RandomStart option causes systune to perform three independent optimization runs beginning at different random values of the tunable parameters. The displayed value, Soft, is the largest normalized soft constraint value for each optimization run.
Examine the best achieved values of the soft constraints.
1.1327 1.1327 0.5140 1.1327
Only Req3, the stability margin requirement, is met for all frequencies. The other values are close to but exceed 1, indicating violations of the requirements for at least some frequencies. Use viewSpec to visualize the tuned control system performance against the requirements and to determine whether the violations are acceptable.
 P. Apkarian and D. Noll, "Nonsmooth H-infinity Synthesis." IEEE Transactions on Automatic Control, Vol. 51, Number 1, 2006, pp. 71–86.
 Bruisma, N.A. and M. Steinbuch, "A Fast Algorithm to Compute the H∞-Norm of a Transfer Function Matrix," System Control Letters, 14 (1990), pp. 287-293.
slTunable | systune | TuningGoal.Gain | TuningGoal.LoopShape | TuningGoal.Margins | TuningGoal.Poles | TuningGoal.StableController | TuningGoal.Tracking | TuningGoal.Variance | TuningGoal.WeightedGain | TuningGoal.WeightedVariance