Documentation Center

  • Trial Software
  • Product Updates

TuningGoal.StepResp class

Package: TuningGoal

Step response requirement for control system tuning

Description

Use the TuningGoal.StepResp object to specify a target step response from specified inputs to specified outputs of a control system. Use this requirement with control system tuning commands such as systune or looptune.

Construction

Req = TuningGoal.StepResp(inputname,outputname,refsys) creates a tuning requirement that constrains the step response between the specified signal locations to match the step response of a stable reference system, 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 requirement (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.

Req = TuningGoal.StepResp(inputname,outputname,tau) specifies the desired step response as a first-order response with time constant tau:

Req = TuningGoal.StepResp(inputname,outputname,tau,overshoot) specifies the desired step response as a second-order response with natural period tau, natural frequency 1/tau, and percent overshoot overshoot:

The damping is given by zeta = cos(atan2(pi,-log(overshoot/100))).

Input Arguments

inputname

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 you are using the requirement to tune a Simulink® model of a control system, then inputname can include:

    • Any model input.

    • Any linearization input point in the model.

    • Any signal identified as an analysis point or a loop-opening location in an slTuner interface associated with the Simulink model. Use addPoint and addOpening to add analysis points and loop openings to the slTuner interface.

  • If you are using the requirement to tune a generalized state-space model (genss) of a control system using systune, then inputname can include:

    • Any input of the control system model

    • Any loopswitch channel in the control system model

    For example, if you are tuning a control system model, T, then inputname can be a string contained in T.InputName. Also, if T contains a loopswitch block with a switch channel X, then inputname can include X.

  • If you are using the requirement to tune a controller model, C0 for a plant G0, using looptune, then inputname can include:

    • Any input of C0 or G0

    • Any loopswitch channel in C0 or G0

If inputname is a loopswitch channel of a generalized model, the input signal for the requirement is the implied input associated with the switch:

outputname

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 you are using the requirement to tune a Simulink model of a control system, then outputname can include:

    • Any model output

    • Any linearization output point in the model

    • Any signal identified as an analysis point or a loop-opening location in an slTuner interface associated with the Simulink model. Use addPoint and addOpening to add analysis points and loop openings to the slTuner interface.

  • If you are using the requirement to tune a generalized state-space model (genss) of a control system using systune, then outputname can include:

    • Any output of the control system model

    • Any loopswitch channel in the control system model

    For example, if you are tuning a control system model,T, then outputname can be a string contained in T.OutputName. Also, if T contains a loopswitch block with a switch channel X, then outputname can include X.

  • If you are using the requirement to tune a controller model, C0, for a plant, G0, using looptune, then outputname can include:

    • Any output of C0 or G0

    • Any loopswitch channel in C0 or G0

If outputname is a loopswitch channel of a generalized model, the output signal for the requirement is the implied output associated with the switch:

refsys

Reference system for target step response, specified as a dynamic system model, such as a tf, zpk, or ss model. refsys must be stable and must have DC gain of 1 (zero steady-state error).

refsys can be continuous or discrete. If refsys is discrete, it can include time delays which are treated as poles at z = 0.

refsys can be MIMO, provided that it is square and that its DC singular value (sigma) is 1. If refsys is a MIMO model, then its number of inputs and outputs must match the dimensions of inputname and outputname.

For best results, refsys should also include intrinsic system characteristics such as non-minimum-phase zeros (undershoot).

tau

Time constant or natural period of target step response, specified as a positive scalar.

If you use the syntax Req = TuningGoal.StepResp(inputname,outputname,tau) to specify a first-order target response, then tau is the time constant of the response decay. In that case, the target is the step response of the system given by:

If you use the syntax Req = TuningGoal.StepResp(inputname,outputname,tau,overshoot) to specify a second-order target response, then tau is the inverse of the natural frequency of the response. In that case, the target is the step response of the system given by:

The damping of the system is given by zeta = cos(atan2(pi,-log(overshoot/100))).

overshoot

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

Properties

Input

Input signal names, specified as a cell array of strings. These strings specify the names of the inputs of the transfer function that the tuning requirement constrains. The initial value of the Input property is set by the inputname input argument when you construct the requirement object.

InputScaling

Reference signal scaling, specified as a vector of positive real values.

For a MIMO tuning 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 vector-valued step input. This information is used to scale the off-diagonal terms in the transfer function from reference to tracking error. This scaling ensures that cross-couplings are measured relative to the amplitude of each reference signal.

For example, suppose that Req is a requirement that signals {'y1','y2'} track reference signals {'r1','r2'}. Suppose further that you require the outputs to track the references with less than 10% cross-coupling. If r1 and r2 have comparable amplitudes, then it is sufficient to keep the gains from r1 to y2 and r2 and y1 below 0.1. However, if r1 is 100 times larger than r2, the gain from r1 to y2 must be less than 0.001 to ensure that r1 changes y2 by less than 10% of the r2 target. To ensure this result, set the InputScaling property as follows.

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, [] , means no scaling.

Default: []

Output

Output signal names, specified as a cell array of strings. These strings specify the names of the outputs of the transfer function that the tuning requirement constrains. The initial value of the Output property is set by the outputname input argument when you construct the requirement object.

ReferenceModel

Reference system for target step response, specified as a SISO or MIMO state-space (ss) model. When you use the requirement to tune a control system, the step response from inputname to outputname is tuned to match this target response to within the tolerance specified by the RelGap property.

If you use the refsys input argument to create the tuning requirement, then the value of ReferenceModel is ss(refsys).

If you use the tau or tau and overshoot input arguments, thenReferenceModel is a state-space representation of the corresponding first-order or second-order transfer function.

ReferenceModel must be stable and have unit DC gain (zero steady-state error). For best results, ReferenceModel should also include intrinsic system characteristics such as non-minimum-phase zeros (undershoot).

RelGap

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:

y(t) – yref(t) is the response mismatch, and 1 – yref(t) is the step-tracking error of the target model. denotes the signal energy (2-norm).

Increase the value of RelGap to loosen the matching tolerance.

Default: 0.1

Models

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.

Default: NaN

Openings

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:

  • If you are tuning a control system specified as a genss model in MATLAB®, a loop-opening location can be any feedback channel in a loopswitch block in the model. In this case, set Openings to a cell array containing the names of one or more loop-opening locations listed in the Location property of a loopswitch block in the control system model.

  • If you are using looptune to tune a system that includes a plant model and controller model, a loop-opening location can be any control or measurement signal. In this case, set Openings to a cell array containing the names of one or more measurement or control signals.

    • A control signal is a signal that is an output of the controller model and an input of the plant model.

    • A measurement signal is a signal that is an output of the plant model and an input of the controller model.

  • If you are tuning a Simulink model of a control system using an slTuner interface, a loop-opening location can be any analysis point added to the interface using addPoint. In this case, set Openings to a cell array containing the names of one or more of these analysis points.

All feedback loops are closed by default, except where there is a permanent loop-opening defined in an slTuner interface.

Default: {}

Name

Name of the requirement object, specified as a string.

For example, if Req is a requirement:

Req.Name = 'LoopReq';

Default: []

Algorithms

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). 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 requirement is a hard constraint.

For the TuningGoal.StepResp requirement, f(x) is given by:

T(s,x) is the closed-loop transfer function from Input to Output with parameter values x. denotes the H2 norm (see norm).

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.

viewSpec(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 viewSpec(Req,T) plots the achieved step response from 'r' to 'y' for comparison to the target response.

First-Order Step Response With Known Time Constant

Create a requirement that specifies a first-order 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 state-space model stored in the ReferenceModel property of the requirement.

refsys = tf(Req.ReferenceModel)
refsys =
 
    0.2
  -------
  s + 0.2
 
Continuous-time transfer function.

As expected, refsys is a first-order model.

Examine the requirement. The viewSpec command displays the target response, which is the step response of the reference model.

viewSpec(Req);

The dashed line shows the target step response specified by this requirement, a first-order response with a time constant of five seconds.

Second-Order Step Response With Known Natural Period and Overshoot

Create a requirement that specifies a second-order 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 state-space model stored in the ReferenceModel property of the requirement.

refsys = tf(Req.ReferenceModel)
refsys =
 
          0.04
  ---------------------
  s^2 + 0.2365 s + 0.04
 
Continuous-time transfer function.

As expected, refsys is a second-order model.

Examine the requirement. The viewSpec command displays the target response, which is the step response of the reference model.

viewSpec(Req);

The dashed line shows the target step response specified by this requirement, a second-order response with 10% overshoot and a natural period of five seconds.

Requirement with Limited Model Application and Additional Loop Openings

Create a requirement that specifies a first-order step response with time constant of 5 seconds. Set the Models and Openings properties to further configure the requirement's applicability.

Req = TuningGoal.StepResp('r','y',5);
Req.Models = [2 3];
Req.Openings = 'OuterLoop'

When tuning a control system that has and input 'r', an output 'y', and an optional loop-opening 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 requirement is applied. In this example, the requirement applies only to the second and third models in an array.

See Also

| | | | | | |

How To

Was this topic helpful?