Documentation Center

  • Trial Software
  • Product Updates

TuningGoal.WeightedGain class

Package: TuningGoal

Frequency-weighted gain constraint for control system tuning

Description

Use the TuningGoal.WeightedGain object to specify a tuning requirement that limits the weighted gain from specified inputs to outputs. The weighted gain is the maximum across frequency of the gain from input to output, multiplied by weighting functions that you specify. You can use the TuningGoal.WeightedGain requirement for control system tuning with tuning commands such as systune or looptune.

After you create a requirement object, you can further configure the tuning requirement by setting Properties of the object.

Construction

Req = TuningGoal.WeightedGain(inputname,outputname,WL,WR) creates a tuning requirement. This tuning requirement specifies that the closed-loop transfer function, H(s), from the specified input to output meets the requirement:

||WL(s)H(s)WR(s)|| < 1.

The notation ||•|| denotes the maximum gain across frequency (the H norm).

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:

WL,WR

Frequency-weighting functions, specified as scalars or as SISO or MIMO numeric LTI models.

The functions WL and WR provide the weights for the tuning requirement. The tuning requirement ensures that the gain H(s) from the specified input to output satisfies the inequality:

||WL(s)H(s)WR(s)|| < 1.

WL provides the weighting for the output channels of H(s), and WR provides the weighting for the input channels. You can specify scalar weights or frequency-dependent weighting. To specify a frequency-dependent weighting, use a numeric LTI model. For example:

WL = tf(1,[1 0.01]);
WR = 10;

If you specify MIMO weighting functions, then inputname and outputname must be vector signals. The dimensions of the vector signals must be such that the dimensions of H(s) are commensurate with the dimensions of WL and WR. For example, if you specify WR = diag([1 10]), then inputname must include two signals. Scalar values, however, automatically expand to any input or output dimension.

A value of WL = [] or WR = [] is interpreted as the identity.

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.

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.

WL

Frequency-weighting function for the output channels of the transfer function H(s) to constrain, specified as a scalar, or as a SISO or MIMO numeric LTI model. The initial value of the WL property is set by the WL input argument when you construct the requirement object.

WR

Frequency-weighting function for the input channels of the transfer function to constrain, specified as a scalar or as a SISO or MIMO numeric LTI model. The initial value of the WR property is set by the WR input argument when you construct the requirement object.

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

Name

Name of the requirement object, specified as a string.

For example, if Req is a requirement:

Req.Name = 'LoopReq';

Default: []

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: {}

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). 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.WeightedGain 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).

Examples

expand all

Constrain Weighted Gain of Closed-Loop System

Create a tuning goal requirement that constrains the gain of a closed-loop SISO system from its input, r, to its output, y. Weight the gain at its input by a factor of 10 and at its output by the frequency-dependent weight 1/(s + 0.01).

WL = tf(1,[1 0.01]);
WR = 10;
Req = TuningGoal.WeightedGain('r','y',WL,WR);

You can use the requirement Req with systune to tune the free parameters of any control system model that has an input signal named 'r' and an output signal named 'y'.

You can then use viewSpec to validate the tuned control system against the requirement.

Constrain Weighted Gain Evaluated with a Loop Opening

Create a requirement that constrains the gain of the outer loop of the following control system, evaluated with the inner loop open.

Create a model of the system. To do so, specify and connect the numeric plant models, G1 and G2, the tunable controllers C1 and C2. Also, create and connect the loopswitch blocks, X1 and X2, that mark potential loop-opening sites.

G1 = tf(10,[1 10]);
G2 = tf([1 2],[1 0.2 10]);
C1 = ltiblock.pid('C','pi');
C2 = ltiblock.gain('G',1);
X1 = loopswitch('X1');
X2 = loopswitch('X2');
T = feedback(G1*feedback(G2*C2,X2)*C1,X1);

Create a tuning requirement that constrains the gain of this system from r to y. Weight the gain at the output by s/(s + 0.5).

WL = tf([1 0],[1 0.5]);
Req = TuningGoal.WeightedGain('r','y',WL,[]);

This requirement is equivalent to Req = TuningGoal.Gain('r','y',1/WL). However, for MIMO systems, you can use TuningGoal.WeightedGain to create channel-specific weightings that cannot be expressed as TuningGoal.Gain requirements.

Specify that the transfer function from r to y be evaluated with the outer loop open for the purpose of tuning to this constraint.

Req.Openings = 'X1';

By default, tuning using TuningGoal.WeightedGain imposes a stability requirement as well as the gain requirement. Practically, in some control systems it is not possible to achieve a stable inner loop. When this occurs, remove the stability requirement for the inner loop by setting the Stabilize property to false.

Req.Stabilize = false;

The tuning algorithm still imposes a stability requirement on the overall tuned control system, but not on the inner loop alone.

Use systune to tune the free parameters of T to meet the tuning requirement specified by Req. You can then validate the tuned control system against the requirement using the command viewSpec(Req,T,Info).

See Also

| | | | | |

How To

Was this topic helpful?