Documentation Center

  • Trial Software
  • Product Updates

TuningGoal.Margins class

Package: TuningGoal

Stability margin requirement for control system tuning

Description

Use the TuningGoal.Margins requirement object to specify a tuning requirement for the gain and phase margins of a SISO or MIMO feedback loop. You can use this requirement for validating a tuned control system with viewSpec. You can also use the 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.Margins(location,gainmargin,phasemargin) creates a tuning requirement that specifies the minimum gain and phase margins at the specified loop-opening location.

Input Arguments

location

Loop-opening locations at which the minimum gain and phase margins apply, specified as a string or cell array of strings. These strings identify one or more loop-opening locations in the control system to tune. What loop-opening locations are available depends 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, location contains the names of one or more feedback loops in the Location property of loopswitch blocks in the control system model. For example, the following code creates a PI loop with a loop switch marking the plant input 'u'.

    S = loopswitch('u');
    G = tf(1,[1 2]);
    C = ltiblock.pid('C','pi');
    T = feedback(G*S*C,1);
    

    You can use the string 'u' to refer to the sensitivity at the plant input.

  • 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, location contains 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, location contains the names of one or more of these analysis points.

The margin requirements apply to the point-to-point, open-loop transfer function at the specified loop-opening location. That transfer function is the open-loop response obtained by injecting signals at the loop-opening location, and measuring the return signals at the same point.

If location is a cell array of loop-opening locations, then the margin requirement applies to the MIMO open-loop transfer function.

gainmargin

Required minimum gain margin for the feedback loop, specified as a scalar value in dB.

For MIMO feedback loops, the gain margin is based upon the notion of disk margins, which guarantee stability for concurrent gain and phase variations of ±gainmargin and ±phasemargin in all feedback channels. See loopmargin for more information about disk margins.

phasemargin

Required minimum phase margin for the feedback loop, specified as a scalar value in degrees.

For MIMO feedback loops, the phase margin is based upon the notion of disk margins, which guarantee stability for concurrent gain and phase variations of ±gainmargin and ±phasemargin in all feedback channels. See loopmargin for more information about disk margins.

Properties

Location

Location at which the minimum gain and phase margins apply, specified as a string or cell-array of strings. These strings identify one or more loop-opening locations in the control system to tune.

The value of the Location property is set by the location input argument when you create the TuningGoal.Margins requirement.

GainMargin

Required minimum gain margin for the feedback loop, specified as a scalar value in decibels (dB).

The value of the GainMargin property is set by the gainmargin input argument when you create the TuningGoal.Margins requirement.

PhaseMargin

Required minimum phase margin for the feedback loop, specified as a scalar value in degrees.

The value of the PhaseMargin property is set by the phasemargin input argument when you create the TuningGoal.Margins requirement.

ScalingOrder

Controls the order (number of states) of the scalings involved in computing MIMO stability margins. Static scalings (ScalingOrder = 0) are used by default. Increasing the order may improve results at the expense of increased computations. Use viewSpec to assess the gap between optimized and actual margins. If this gap is too large, consider increasing the scaling order.

Default: 0 (static scaling)

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. For best results with stability margin requirements, pick a frequency band extending about one decade on each side of the gain crossover frequencies. For example, suppose Req is a TuningGoal.Margins requirement that you are using to tune a system with approximately 10 rad/s bandwidth. To limit the enforcement of the requirement, 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), 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.Margins requirement, f(x) is given by:

S = D–1[I – L(s,x)]–1D is the scaled sensitivity function.

L(s,x) is the open-loop response being shaped.

D is an automatically-computed loop scaling factor.

α is a scalar parameter computed from the specified gain and phase margin.

Examples

expand all

SISO Margin Requirement Evaluated with Additional Loop Opening

Create a margin requirement for the inner loop of the following control system. The requirement imposes a minimum gain margin of 5 dB and a minimum phase margin of 40 degrees

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

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 object.

Req = TuningGoal.Margins('X2',5,40);

This requirement imposes the specified stability margins on the feedback loop identified by the loopswitch channel 'X2', which is the inner loop.

Specify that these margins are evaluated with the outer loop of the control system open.

Req.Openings = {'X1'};

Adding 'X1' to the Openings property of the tuning requirements object ensures that systune evaluates the requirement with the loop open at that location.

Use systune to tune the free parameters of T to meet the tuning requirement specified by Req. You can then use viewSpec to validate the tuned control system against the requirement.

MIMO Margin Requirement in Frequency Band

Create a requirement that sets minimum gain and phase margins for the loop defined by three loop-opening locations in a control system to tune. Because this loop is defined by three loop-opening locations, it is a MIMO loop.

The requirement sets a minimum gain margin of 10 dB and a minimum phase margin of 40 degrees, within the band between 0.1 and 10 rad/s.

Req = TuningGoal.Margins({'r','theta','phi'},10,40);

The names 'r', 'theta', and 'phi' must specify valid loop-opening locations in the control system that you are tuning.

Limit the requirement to the frequency band between 0.1 and 10 rad/s.

 Req.Focus = [0.1 10];

See Also

| | | | |

How To

Was this topic helpful?