TuningGoal.StepTracking class
Package: TuningGoal
Step response requirement for control system tuning
Description
Use TuningGoal.StepTracking
to specify a target step
response from specified inputs to specified outputs of a control system. Use this tuning goal
with control system tuning commands such as systune
or
looptune
.
Construction
creates a tuning goal that constrains the step response between the specified signal locations to
match the step response of a stable reference system, Req
= TuningGoal.StepTracking(inputname
,outputname
,refsys
)refsys
. The constraint
is satisfied when the relative difference between the tuned and target responses falls within a
tolerance specified by the RelGap
property of the tuning goal (see Properties).
inputname
and outputname
can describe a SISO or MIMO
response of your control system. For MIMO responses, the number of inputs must equal the number
of outputs.
specifies the desired step response as a firstorder response with time constant
Req
= TuningGoal.StepTracking(inputname
,outputname
,tau
)tau
:
$$\text{Req}\text{.ReferenceModel}=\frac{1/\text{tau}}{s+1/\text{tau}}.$$
specifies the desired step response as a secondorder response with natural period
Req
= TuningGoal.StepTracking(inputname
,outputname
,tau
,overshoot
)tau
, natural frequency 1/tau
, and percent overshoot
overshoot
:
$$\text{Req}\text{.ReferenceModel}=\frac{{\left(1/\text{tau}\right)}^{2}}{{s}^{2}+2\left(\text{zeta}/\text{tau}\right)s+{\left(1/\text{tau}\right)}^{2}}.$$
The damping is given by zeta =
cos(atan2(pi,log(overshoot/100)))
.
Input Arguments

Input signals for the tuning goal, specified as a character vector or, for multipleinput tuning goals, a cell array of character vectors.
For more information about analysis points in control system models, see Mark Signals of Interest for Control System Analysis and Design. 

Output signals for the tuning goal, specified as a character vector or, for multipleoutput tuning goals, a cell array of character vectors.
For more information about analysis points in control system models, see Mark Signals of Interest for Control System Analysis and Design. 

Reference system for target step response, specified as a dynamic system model, such as
a
For best results, 

Time constant or natural period of target step response, specified as a positive scalar. If you use the syntax $$\text{Req}\text{.ReferenceModel}=\frac{1/\text{tau}}{s+1/\text{tau}}.$$ If you use the syntax $$\text{Req}\text{.ReferenceModel}=\frac{{\left(1/\text{tau}\right)}^{2}}{{s}^{2}+2\left(\text{zeta}/\text{tau}\right)s+{\left(1/\text{tau}\right)}^{2}}.$$ The damping of the system is given by 

Percent overshoot of target step response, specified as a scalar value in the range (0,100). 
Properties

Reference system for target step response, specified as a SISO or MIMO statespace
( If you use the If you use the


Maximum relative matching error, specified as a positive scalar value. This property specifies the matching tolerance as the maximum relative gap between the target and actual step responses. The relative gap is defined as: $$\text{gap}=\frac{{\Vert y\left(t\right){y}_{ref}\left(t\right)\Vert}_{2}}{{\Vert 1{y}_{ref}\left(t\right)\Vert}_{2}}.$$ y(t) – y_{ref}(t) is the response mismatch, and 1 – y_{ref}(t) is the steptracking error of the target model. $${\Vert \text{\hspace{0.17em}}\cdot \text{\hspace{0.17em}}\Vert}_{2}$$ denotes the signal energy (2norm). Increase the value of Default: 0.1 

Reference signal scaling, specified as a vector of positive real values. For a MIMO tracking requirement, when the choice of units results in a mix of small and large signals in different channels of the response, use this property to specify the relative amplitude of each entry in the vectorvalued step input. This information is used to scale the offdiagonal terms in the transfer function from reference to tracking error. This scaling ensures that crosscouplings are measured relative to the amplitude of each reference signal. For example, suppose that Req.InputScaling = [100,1]; This tells the software to take into account that the first reference signal is 100 times greater than the second reference signal. The default value, Default: 

Input signal names, specified as a cell array of character
vectors that identify the inputs of the transfer function that the
tuning goal constrains. The initial value of the 

Output signal names, specified as a cell array of character
vectors that identify the outputs of the transfer function that the
tuning goal constrains. The initial value of the 

Models to which the tuning goal applies, specified as a vector of indices. Use the Req.Models = 2:4; When Default: 

Feedback loops to open when evaluating the tuning goal, specified as a cell array of character vectors that identify loopopening locations. The tuning goal is evaluated against the openloop configuration created by opening feedback loops at the locations you identify. If you are using the tuning goal to tune a Simulink model
of a control system, then If you are using the tuning goal to tune a generalized statespace
( For example, if Default: 

Name of the tuning goal, specified as a character vector. For example, if Req.Name = 'LoopReq'; Default: 
Examples
Step Response Requirement with Specified Tolerance
Create a requirement for the step response from a signal named 'r'
to a signal named 'y'
. Constrain the step response to match the transfer function H = 10/(s+10), but allow 20% relative variation between the target the tuned responses.
H = tf(10,[1 10]); Req = TuningGoal.StepResp('r','y',H);
By default, this requirement allows a relative gap of 0.1 between the target and tuned responses. To change the relative gap to 20%, set the RelGap
property of the requirement.
Req.RelGap = 0.2;
Examine the requirement.
viewGoal(Req);
The dashed line shows the target step response specified by this requirement. You can use this requirement to tune a control system model, T
, that contains valid input and output locations named 'r'
and 'y'
. If you do so, the command viewGoal(Req,T)
plots the achieved step response from 'r'
to 'y'
for comparison to the target response.
FirstOrder Step Response With Known Time Constant
Create a requirement that specifies a firstorder step response with time constant of 5 seconds. Create the requirement for the step response from a signal named 'r'
to a signal named 'y'
.
Req = TuningGoal.StepResp('r','y',5);
When you use this requirement to tune a control system model, T
, the time constant 5 is taken to be expressed in the prevailing units of the control system. For example, if T
is a genss
model and the property T.TimeUnit
is 'seconds'
, then this requirement specifies a target time constant of 5 seconds for the response from the input 'r'
to the output 'y'
of 'T'
.
The specified time constant is converted into a reference statespace model stored in the ReferenceModel
property of the requirement.
refsys = tf(Req.ReferenceModel)
refsys = 0.2  s + 0.2 Continuoustime transfer function.
As expected, refsys
is a firstorder model.
Examine the requirement. The viewGoal
command displays the target response, which is the step response of the reference model.
viewGoal(Req);
The dashed line shows the target step response specified by this requirement, a firstorder response with a time constant of five seconds.
SecondOrder Step Response With Known Natural Period and Overshoot
Create a requirement that specifies a secondorder step response with a natural period of 5 seconds, and a 10% overshoot. Create the requirement for the step response from a signal named 'r'
to a signal named 'y'
.
Req = TuningGoal.StepResp('r','y',5,10);
When you use this requirement to tune a control system model, T
, the natural period 5 is taken to be expressed in the prevailing units of the control system. For example, if T
is a genss
model and the property T.TimeUnit
is 'seconds'
, then this requirement specifies a target natural period of 5 seconds for the response from the input 'r'
to the output 'y'
of 'T'
.
The specified parameters of the response is converted into a reference statespace model stored in the ReferenceModel
property of the requirement.
refsys = tf(Req.ReferenceModel)
refsys = 0.04  s^2 + 0.2365 s + 0.04 Continuoustime transfer function.
As expected, refsys
is a secondorder model.
Examine the requirement. The viewGoal
command displays the target response, which is the step response of the reference model.
viewGoal(Req);
The dashed line shows the target step response specified by this requirement, a secondorder response with 10% overshoot and a natural period of five seconds.
Tracking Goal with Limited Model Application and Additional Loop Openings
Create a tuning goal that specifies a firstorder step response with time constant of 5
seconds. Set the Models
and Openings
properties to further
configure the tuning goal’s applicability.
Req = TuningGoal.StepTracking('r','y',5); Req.Models = [2 3]; Req.Openings = 'OuterLoop'
When tuning a control system that has an input 'r'
, an output
'y'
, and an analysispoint location 'OuterLoop'
, you can
use Req
as an input to looptune
or
systune
. Setting the Openings
property specifies that the
step response from 'r'
to 'y'
is measured with the loop
opened at 'OuterLoop'
. When tuning an array of control system models, setting
the Models
property restricts how the tuning goal is applied. In this
example, the tuning goal applies only to the second and third models in an array.
Tips
This tuning goal imposes an implicit stability constraint on the closedloop transfer function from
Input
toOutput
, evaluated with loops opened at the points identified inOpenings
. The dynamics affected by this implicit constraint are the stabilized dynamics for this tuning goal. TheMinDecay
andMaxRadius
options ofsystuneOptions
control the bounds on these implicitly constrained dynamics. If the optimization fails to meet the default bounds, or if the default bounds conflict with other requirements, usesystuneOptions
to change these defaults.
Algorithms
When you tune a control system using a TuningGoal
, the software converts
the tuning goal into a normalized scalar value f(x). Here,
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 goal is a hard
constraint.
For TuningGoal.StepTracking
, f(x)
is given by:
$$f\left(x\right)=\frac{{\Vert \frac{1}{s}\left(T\left(s,x\right){T}_{ref}\left(s\right)\right)\Vert}_{2}}{\text{RelGap}{\Vert \frac{1}{s}\left({T}_{ref}\left(s\right)I\right)\Vert}_{2}}.$$
T(s,x) is the closedloop transfer
function from Input
to Output
with parameter values
x, and T_{ref}(s)
is the reference model specified in the ReferenceModel
property. $${\Vert \text{\hspace{0.17em}}\cdot \text{\hspace{0.17em}}\Vert}_{2}$$ denotes the H_{2} norm (see
norm
).
Version History
Introduced in R2016aSee Also
looptune
 systune
 looptune (for slTuner)
(Simulink Control Design)  systune (for slTuner)
(Simulink Control Design)  viewGoal
 evalGoal
 TuningGoal.Tracking
 TuningGoal.Overshoot