Tracking requirement for control system tuning
Use the TuningGoal.Tracking object to specify a tracking requirement that constrains a specified output to track a specified input. Use this requirement for control system tuning with tuning commands such as systune or looptune.
Req = TuningGoal.Tracking(inputname,outputname,responsetime,dcerror) creates a tuning requirement Req. This tuning requirement specifies that the output signal outputname tracks a step change in the reference signal inputname. Req also specifies a target responsetime and maximum steady-state error dcerror.
Req = TuningGoal.Tracking(inputname,outputname,maxerror) specifies the maximum relative error as a function of frequency. You can specify the target error profile (maximum gain from reference signal to tracking error signal) as a smooth transfer function. Alternatively, you can sketch a piecewise error profile using an frd model.
Input signal for requirement, specified as a string or a cell array of strings for vector-valued signals. The signals available to designate as input signals for the tuning requirement are as follows.
If inputname is a loopswitch channel of a generalized model, the input signal for the requirement is the implied input associated with the switch:
Output signal for requirement, specified as a string or a cell array of strings for vector-valued signals. The signals available to designate as output signals for the tuning requirement are as follows.
If outputname is a loopswitch channel of a generalized model, the output signal for the requirement is the implied output associated with the switch:
Target response time.
Express the target response time in the time units of the models to be tuned with looptune. For example, when tuning a plant G0 and controller C0, if C0.TimeUnit and G0.TimeUnit are 'minutes', then express the target response time in minutes.
Maximum steady-state fractional tracking error.
Target tracking error profile as a function of frequency.
maxerror is the maximum gain from reference signal to tracking error signal. You can specify maxerror as a smooth transfer function (tf, zpk, or ss model). Alternatively, you can sketch a piecewise error profile using a frd model. When you do so, the software automatically maps the error profile to a zpk model. The magnitude of the zpk model. approximates the desired error profile. Use show(Req) to plot the magnitude of the zpk model.
Reference signal names. String or cell array of strings specifying the names of the signals to be tracked, populated by the inputname argument.
Output signal names. String or cell array of strings specifying the names of the signals that must track the reference signals, populated by the outputname argument.
Maximum error as a function of frequency, expressed as a SISO zpk model. This property stores the maximum tracking error as a function of frequency (maximum gain from reference signal to tracking error signal).
The software automatically maps the dcerror or maxerror input arguments onto a zpk model. The magnitude of this zpk model approximates the desired error profile. The zpk model is stored in the MaxError property. Use show(Req) to plot the magnitude of MaxError.
Frequency band in which tuning requirement is enforced, specified as a row vector of the form [min,max].
Set the Focus property to limit enforcement of the requirement to a particular frequency band. Express this value in the frequency units of the control system model you are tuning (rad/TimeUnit). For example, suppose Req is a requirement that you want to apply only between 1 and 100 rad/s. To restrict the requirement to this band, use the following command:
Req.Focus = [1,100];
Default: [0,Inf] for continuous time; [0,pi/Ts] for discrete time, where Ts is the model sampling time.
Models to which the tuning requirement applies, specified as a vector of indices.
Use the Models property when tuning an array of control system models with systune, to enforce a tuning requirement for a subset of models in the array. For example, suppose you want to apply the tuning requirement, Req, to the second, third, and fourth models in a model array passed to systune. To restrict enforcement of the requirement, use the following command:
Req.Models = 2:4;
When Models = NaN, the tuning requirement applies to all models.
Feedback loops to open when evaluating the requirement, specified as a cell array of strings that identify loop-opening locations. The available loop-opening locations depend on what kind of system you are tuning:
All feedback loops are closed by default.
Name of the requirement object, specified as a string.
For example, if Req is a requirement:
Req.Name = 'LoopReq';
When you tune a control system using a TuningGoal object to specify a tuning requirement, the software converts the requirement into a normalized scalar value f(x), where x is the vector of free (tunable) parameters in the control system. The software then adjusts the parameter values to minimize f(x) or to drive f(x) below 1 if the tuning requirement is a hard constraint.
For the TuningGoal.Tracking requirement, f(x) is given by:
T(s,x) is the closed-loop transfer function from Input to Output. denotes the H∞ norm (see norm).
Tracking requirement with response time and maximum steady-state tracking error
Create a tracking requirement specifying that a signal 'theta' track a signal 'theta_ref'. The required response time is 2, in the time units of the control system you are tuning. The maximum steady-state error is 0.1%.
Req = TuningGoal.Tracking('theta_ref','theta',2,0.001);
Tracking requirement with maximum tracking error as a function of frequency
Create a tracking requirement specifying that a signal 'theta' track a signal 'theta_ref'. The maximum relative error is 0.01 (1%) in the frequency range [0,1]. The relative error increases to 1 (100%) at the frequency 100.
Use a frd model to specify the error profile as a function of frequency.
err = frd([0.01 0.01 1],[0 1 100]); Req = TuningGoal.Tracking('theta_ref','theta',err);
The software converts err into a smooth function of frequency that approximates the piecewise specified requirement. Display the error requirement using viewSpec.
The yellow region indicates where the requirement is violated.