Documentation Center

  • Trial Software
  • Product Updates

TuningGoal.Gain class

Package: TuningGoal

Gain constraint for control system tuning

Description

Use the TuningGoal.Gain object to specify a constraint that limits the gain from a specified input to a specified output. Use this requirement for control system tuning with tuning commands such as systune or looptune.

When you use a TuningGoal.Gain requirement, the software attempts to tune the system so that the gain from the specified input to the specified output does not exceed the specified value. By default, the constraint is applied with the loop closed. To apply the constraint to an open-loop response, use the Openings property of the TuningGoal.Gain object.

You can use a gain constraint to:

  • Enforce a design requirement of disturbance rejection across a particular input/output pair, by constraining the gain to be less than 1

  • Enforce a custom roll-off rate in a particular frequency band, by specifying a gain profile in that band

Construction

Req = TuningGoal.Gain(inputname,outputname,gainvalue) creates a tuning requirement Req. This requirement constrains the gain from inputname to outputname to remain below the value gainvalue.

You can specify the inputname or outputname as cell arrays (vector-valued signals). If you do so, then the tuning requirement constrains the largest singular value of the transfer matrix from inputname to outputname. See sigma for more information about singular values.

Req = TuningGoal.Gain(inputname,outputname,gainprofile) specifies the maximum gain as a function of frequency. You can specify the target gain profile (maximum gain across the I/O pair) as a smooth transfer function. Alternatively, you can sketch a piecewise error profile using an frd model.

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:

gainvalue

Maximum gain (linear). The gain constraint Req specifies that the gain from inputname to outputname is less than gainvalue.

gainvalue is a scalar value. If the signals inputname or outputname are vector-valued signals, then gainvalue constrains the largest singular value of the transfer matrix from inputname to outputname. See sigma for more information about singular values.

gainprofile

Gain profile as a function of frequency. The gain constraint Req specifies that the gain from inputname to outputname at a particular frequency is less than gainprofile. You can specify gainprofile as a smooth transfer function (tf , zpk, or ss model). Alternatively, you can sketch a piecewise gain profile using a frd model. When you do so, the software automatically maps the gain profile onto a zpk model. The magnitude of this zpk model approximates the desired gain profile. Use viewSpec(Req) to plot the magnitude of the zpk model.

gainprofile is a SISO transfer function. If inputname or outputname are cell arrays, gainprofile applies to all I/O pairs from inputname to outputname

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

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

Use this property to specify the relative amplitude of each entry in vector-valued input signals when the choice of units results in a mix of small and large signals. This information is used to scale the closed-loop transfer function from Input to Output when the tuning requirement is evaluated.

Suppose T(s) is the closed-loop transfer function from Input to Output. The requirement is evaluated for the scaled transfer function Do–1T(s)Di. Do and Di are diagonal matrices with the OutputScaling and InputScaling values on the diagonal, respectively.

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.

OutputScaling

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

Use this property to specify the relative amplitude of each entry in vector-valued output signals when the choice of units results in a mix of small and large signals. This information is used to scale the closed-loop transfer function from Input to Output when the tuning requirement is evaluated.

Suppose T(s) is the closed-loop transfer function from Input to Output. The requirement is evaluated for the scaled transfer function Do–1T(s)Di. Do and Di are diagonal matrices with the OutputScaling and InputScaling values on the diagonal, respectively.

The default value, [] , means no scaling.

Default: []

MaxGain

Maximum gain as a function of frequency, expressed as a SISO zpk model.

The software automatically maps the gainvalue or gainprofile input arguments to a zpk model. The magnitude of this zpk model approximates the desired gain profile, and is stored in the MaxGain property. Use viewSpec(Req) to plot the magnitude of MaxGain.

Stabilize

Stability requirement on closed-loop dynamics, specified as 1 (true) or 0 (false).

By default, TuningGoal.Gain imposes a stability requirement on the closed-loop transfer function from the specified inputs to outputs, in addition to the gain requirement. If stability is not required or cannot be achieved, set Stabilize to false to remove the stability requirement. For example, if the gain constraint applies to an unstable open-loop transfer function, set Stabilize to false.

Default: 1(true)

Focus

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

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), 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.Gain requirement, f(x) is given by:

T(s,x) is the closed-loop transfer function from Input to Output. Do and Di are diagonal matrices with the OutputScaling and InputScaling property values on the diagonal, respectively. denotes the H norm (see norm).

Examples

Disturbance rejection

Create a gain constraint that enforces a disturbance rejection requirement from a signal 'du' to a signal 'u'.

Req = TuningGoal.Gain('du','u',1);

This requirement specifies that the maximum gain of the response from 'du' to 'u' not exceed 1 (0 dB).

Custom roll-off specification

Create a gain constraint that constrains the response from a signal 'du' to a signal 'u' to roll off at 20 dB/decade at frequencies greater than 1. The gain constraint also specifies disturbance rejection (maximum gain of 1) in the frequency range [0,1].

gmax = frd([1 1 0.01],[0 1 100]);
Req = TuningGoal.Gain('du','u',gmax);

These commands use a frd model to specify the gain profile as a function of frequency. The maximum gain of 1 dB at the frequency 1 rad/s, together with the maximum gain of 0.01 dB at the frequency 100 rad/s, specifies the desired rolloff of 20 dB/decade.

The software converts gmax into a smooth function of frequency that approximates the piecewise specified requirement. Display the error requirement using viewSpec.

viewSpec(Req)

The yellow region indicates where the requirement is violated.

Disturbance rejection

Create a gain constraint that enforces a disturbance rejection requirement from a signal 'du' to a signal 'u'.

Req = TuningGoal.Gain('du','u',1);

This requirement specifies that the maximum gain of the response from 'du' to 'u' not exceed 1 (0 dB).

See Also

| | | | | | |

How To

Was this topic helpful?