View tuning requirements; validate design against requirements
a graphical view of a
TuningGoal tuning requirement
or vector of tuning requirements.
Create a tuning requirement that constrains the response from a signal,
'd', to another signal,
'y', to roll off at 20 dB/decade at frequencies greater than 1. The requirement also imposes disturbance rejection (maximum gain of 1) in the frequency range [0,1].
gmax = frd([1 1 0.01],[0 1 100]); Req = TuningGoal.MaxGain('du','u',gmax);
When you use a frequency response data (
frd) model to sketch the bounds of a gain constraint or loop shape, the tuning requirement interpolates the constraint. This interpolation coverts the constraint to a smooth function of frequency.
Examine the interpolated gain constraint using
The yellow region represents gain values that violate the tuning requirement.
Validate a control system tuned with
systune to determine whether small violations of tuning requirements are acceptable.
When you tune a control system using tuning commands such as
viewSpec to compare the tuned result against the tuning requirements. Doing so can help you determine whether the tuned system comes sufficiently close to meeting your soft requirements.
Open a Simulink® model that contains a control system you want to tune.
Create requirements for tuning the control system. For this example, use tracking, roll-off, stability margin, and disturbance rejection requirements.
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);
Tune the model using these tuning requirements.
ST0 = slTuner('rct_airframe2','MIMO Controller'); addPoint(ST0,'delta fin'); rng('default'); [ST1,fSoft,~,Info] = systune(ST0,[Req1,Req2,Req3,Req4]);
Final: Soft = 1.15, Hard = -Inf, Iterations = 57
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.
Verify that the tuned system satisfies the margin requirement.
The yellow region denotes margins that do not satisfy the requirement. The red plot represents the actual stability margin of the tuned system,
ST1. The blue plot represents the margin used in the optimization calculation, which is an upper bound on the actual margin. For
ST1, the plot indicates that the margin requirement is satisfied at all frequencies.
Validate the tracking and disturbance rejection requirements in the frequency domain.
When you provide a vector of requirements,
viewSpec puts all the requirements into a single figure window.
The first plot shows that the tuned system very nearly meets the tracking requirement. The slight violation suggests that setpoint tracking will perform close to expectations.
The second plot shows that the disturbance rejection levels off in violation of the requirement at very low frequencies. A small bump near 35 rad/s suggests possible damped oscillations at this frequency.
getIOTransfer to examine setpoint tracking and disturbance rejection in the time domain.
Req— Tuning requirement to view or validate
TuningGoalrequirement object | vector of
Tuning requirement to view or validate, specified as a
object or vector of
T— Tuned control systemgeneralized state-space model |
Tuned control system, specified as a generalized state-space
genss) model or an
to a Simulink® model.
The control system,
T, is typically the result
of using the tuning requirement to tune control system parameters
[T,fSoft,gHard,Info] = systune(T0,SoftReq,HardReq),
T0 is a tunable
[T,fSoft,gHard,Info] = systune(ST0,SoftReq,HardReq),
ST0 is a
Info— System informationdata structure returned by
System information, specified as the data structure returned
systune when you use that command to tune a
control system. Use
Info when validating tuned
MIMO systems, to ensure that
scales open-loop requirements such as loop shapes and stability margins.
systune (for slTuner) |