Main Content

TuningGoal.Margins class

Package:TuningGoal

Stability margin requirement for control system tuning

Description

UseTuningGoal.Marginsto specify a tuning goal for the gain and phase margins of a SISO or MIMO feedback loop. You can use this tuning goal for validating a tuned control system withviewGoal. You can also use the tuning goal for control system tuning with tuning commands such assystuneorlooptune.

After you create a tuning goal, you can configure it further by settingPropertiesof the object.

After using the tuning goal to tune a control system, you can visualize the tuning goal and the tuned value using theviewGoalcommand. For information about interpreting the margins goal, seeStability Margins in Control System Tuning.

Construction

Req= TuningGoal.Margins(location,gainmargin,phasemargin)creates a tuning goal that specifies the minimum gain and phase margins at the specified location in the control system.

Input Arguments

location

Location in the control system at which the minimum gain and phase margins apply, specified as a character vector or cell array of character vectors that identify one or more locations in the control system to tune. What locations are available depends on what kind of system you are tuning:

  • If you are tuning a Simulink®model of a control system, you can use any linear analysis point marked in the model, or any linear analysis point in anslTuner(Simulink Control Design)interface associated with the Simulink model. UseaddPoint(Simulink Control Design)添加分析指出slTunerinterface. For example, if theslTunerinterface contains an analysis pointu, you can use'u'to refer to that point when creating tuning goals. UsegetPoints(Simulink Control Design)to get the list of analysis points available in anslTunerinterface to your model.

  • If you are tuning a generalized state-space (genss) model of a control system, you can use anyAnalysisPointlocation in the control system model. For example, the following code creates a PI loop with an analysis point at the plant input'u'.

    AP = AnalysisPoint('u'); G = tf(1,[1 2]); C = tunablePID('C','pi'); T = feedback(G*AP*C,1);

    When creating tuning goals, you can use'u'to refer to the analysis point at the plant input. UsegetPointsto get the list of analysis points available in agenssmodel.

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 specified location, and measuring the return signals at the same point.

Iflocationis a cell array, 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.TuningGoal.Margins使用基于磁盘的增益和相位的利润率,箴言ide a stronger guarantee of stability than the classical gain and phase margins. (For details about disk margins, seeStability Analysis Using Disk Margins(Robust Control Toolbox).)

The gain margin indicates how much the gain of the open-loop response can increase or decrease without loss of stability. For instance,

  • For a SISO system, settinggainmargin = 3specifies a requirement that the closed-loop system remain stable for changes in the open-loop gain of up to ±3 dB.

  • For a MIMO system, settinggainmargin = 3specifies a requirement that the closed-system remain stable for gain changes up to ±3 dB in each feedback channel. The gain can change in all channels simultaneously, and by a different amount in each channel.

phasemargin

Required minimum phase margin for the feedback loop, specified as a scalar value in degrees.TuningGoal.Margins使用基于磁盘的增益和相位的利润率,箴言ide a stronger guarantee of stability than the classical gain and phase margins. (For details about disk margins, seeStability Analysis Using Disk Margins(Robust Control Toolbox).)

The phase margin indicates how much the phase of the open-loop response can increase or decrease without loss of stability. For instance,

  • For a SISO system, settingphasemargin= 45specifies a requirement that the closed-loop system remain stable for changes of up to ±45° in the phase of the open-loop response.

  • For a MIMO system, settingphasemargin= 45specifies a requirement that the closed-system remain stable for phase changes up to ±45° in each feedback channel. The phase can change in all channels simultaneously, and by a different amount in each channel.

Properties

GainMargin

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

The value of theGainMarginproperty is set by thegainmargininput argument when you create the tuning goal.

PhaseMargin

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

The value of thePhaseMarginproperty is set by thephasemargininput argument when you create the tuning goal.

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. UseviewGoalto assess the gap between optimized and actual margins. If this gap is too large, consider increasing the scaling order. SeeStability Margins in Control System Tuning.

Default:0 (static scaling)

Focus

Frequency band in which tuning goal is enforced, specified as a row vector of the form[min,max].

Set theFocusproperty to limit enforcement of the tuning goal 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, supposeReqis aTuningGoal.Marginsobject that you are using to tune a system with approximately 10 rad/s bandwidth. To limit the enforcement of the tuning goal, use the following command:

Req.Focus = [1,100];

Default:[0,Inf]for continuous time;[0,pi/Ts]for discrete time, whereTsis the model sample time.

Location

Location at which the minimum gain and phase margins apply, specified as a cell array of character vectors that identify one or more analysis points in the control system to tune. For example, ifLocation = {'u'}, the tuning goal enforces the minimum gain and phase margins at an analysis point'u'.

The value of theLocationproperty is set by thelocationinput argument when you create the tuning goal.

Models

Models to which the tuning goal applies, specified as a vector of indices.

Use theModelsproperty when tuning an array of control system models withsystune, to enforce a tuning goal for a subset of models in the array. For example, suppose you want to apply the tuning goal,Req, to the second, third, and fourth models in a model array passed tosystune. To restrict enforcement of the tuning goal, use the following command:

Req.Models = 2:4;

WhenModels = NaN, the tuning goal applies to all models.

Default:NaN

Openings

Feedback loops to open when evaluating the tuning goal, specified as a cell array of character vectors that identify loop-opening locations. The tuning goal is evaluated against the open-loop 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, thenOpeningscan include any linear analysis point marked in the model, or any linear analysis point in anslTuner(Simulink Control Design)interface associated with the Simulink model. UseaddPoint(Simulink Control Design)to add analysis points and loop openings to theslTunerinterface. UsegetPoints(Simulink Control Design)to get the list of analysis points available in anslTunerinterface to your model.

If you are using the tuning goal to tune a generalized state-space (genss) model of a control system, thenOpeningscan include anyAnalysisPointlocation in the control system model. UsegetPointsto get the list of analysis points available in thegenssmodel.

For example, ifOpenings = {'u1','u2'}, then the tuning goal is evaluated with loops open at analysis pointsu1andu2.

Default:{}

Name

Name of the tuning goal, specified as a character vector.

For example, ifReqis a tuning goal:

Req.Name = 'LoopReq';

Default:[]

Examples

collapse all

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 modelsG1andG2, and the tunable controllersC1andC2. Also specify and connect theAnalysisPointblocksAP1andAP2that mark points of interest for analysis and tuning.

G1 = tf(10,[1 10]); G2 = tf([1 2],[1 0.2 10]); C1 = tunablePID('C','pi'); C2 = tunableGain('G',1); AP1 = AnalysisPoint('AP1'); AP2 = AnalysisPoint('AP2'); T = feedback(G1*feedback(G2*C2,AP2)*C1,AP1);

Create a tuning requirement object.

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

This requirement imposes the specified stability margins on the feedback loop identified by theAnalysisPointchannel'AP2', which is the inner loop.

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

Req.Openings = {'AP1'};

Adding'AP1'to theOpeningsproperty of the tuning requirements object ensures thatsystuneevaluates the requirement with the loop open at that location.

Usesystuneto tune the free parameters ofTto meet the tuning requirement specified byReq. You can then useviewGoalto validate the tuned control system against the requirement.

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];

Tips

  • This tuning goal imposes an implicit stability constraint on the closed-loop sensitivity function measured atLocation, evaluated with loops opened at the points identified inOpenings. The dynamics affected by this implicit constraint are thestabilized dynamics这个桶ing goal. TheMinDecayandMaxRadiusoptions ofsystuneOptionscontrol 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, usesystuneOptionsto change these defaults.

Algorithms

When you tune a control system using aTuningGoal, the software converts the tuning goal into a normalized scalar valuef(x), wherexis the vector of free (tunable) parameters in the control system. The software then adjusts the parameter values to minimizef(x)或开车f(x) below 1 if the tuning goal is a hard constraint.

ForTuningGoal.Margins,f(x) is given by:

f ( x ) = 2 α S α I .

S=D–1[IL(s,x)]–1Dis the scaled sensitivity function.

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

Dis an automatically-computed loop scaling factor. For more information aboutD, seeStability Margins in Control System Tuning.

αis a scalar parameter computed from the specified gain and phase margin. For more information aboutα, seeStability Analysis Using Disk Margins(Robust Control Toolbox).

Version History

Introduced in R2016a

expand all