Main Content

Stability Margins of a Simulink Model

This example illustrates how to compute classical and disk-based gain and phase margins of a control loop modeled in Simulink®. To compute stability margins, linearize the model to extract the open-loop responses at one or more operating points of interest. Then, useallmargin.ordiskmargin.计算基于古典或基于磁盘的稳定性边距。

MIMO Control Loop

For this example, use the Simulink modelairframemarginEx.slx。This model is based on the exampleTrim and Linearize an Airframe(Simulink Control Design)

Open_System('airframemarginEx.slx')

该系统是双通道反馈循环。该工厂是单输入,双输出子系统机身模型, and the controller is a two-input, one-output system whose inputs are the normal accelerationazand pitch rateq,并且其输出是鳍偏转signal.

Loop Transfer Functions

为了计算该反馈系统的增益边距和相位利润,将模型线性化以在工厂输出和输入处获得开环传输功能。您可以使用环形传输类型的线性化分析点来执行此操作。有关线性化分析点的更多信息,请参阅Specify Portion of Model to Linearize(Simulink Control Design)

创建一个移圈th分析点e plant input, which is the first output port of theq Control子系统。

ioInput = linio('airframemarginEx/q Control',1,'looptransfer');

同样,为工厂输出创建分析点。由于有两个输出,指定这些分析点作为线性化I / O对象的向量。

ioOutput(1) = linio('airframemarginEx/Airframe Model',1,'looptransfer');ioOutput(2) = linio('airframemarginEx/Airframe Model'2,'looptransfer');

线性化模型以获得开环传输功能。对于此示例,请使用模型中指定的操作点。工厂输入的环路传输是SISO,而输出处的环路传输是2×2。

Li =线性化('airframemarginEx',ioInput);%siso.Lo = linearize('airframemarginEx',iooutput);% MIMO

Classical Gain and Phase Margins

计算经典增益边距和相位利润,使用allmargin.。For an open-loop transfer function,allmargin.assumes a negative-feedback loop.

返回的开环传递函数线性化command is the actual linearized open-loop response of the model at the analysis point. Thus, for an open-loop responseL,closed-loop response of the entire model is a positive feedback loop.

这refore, use-Lto makeallmargin.compute the stability margins with positive feedback. Compute the classical gain and phase margins at the plant input.

Si = allmargin(-Li)
Si = struct with fields: GainMargin: [0.1633 17.6538] GMFrequency: [1.5747 47.5230] PhaseMargin: 44.4551 PMFrequency: 5.3929 DelayMargin: 14.3871 DMFrequency: 5.3929 Stable: 1

结构Sicontains information about classical stability margins. For instance,Li.GMFrequencygives the two frequencies at which the phase of the open-loop response crosses –180°.Li.GainMargingives the gain margin at each of those frequencies. The gain margin is the amount by which the loop gain can vary at that frequency while preserving closed-loop stability.

Compute the stability margins at the plant output.

SO = ALLMARGIN(-LO);

Because there are two output channels,allmargin.返回包含每个通道的一个结构的数组。每个条目都包含为该频道计算的边距,其中包含其他反馈通道关闭。指数进入结构Soto obtain the stability margins for each channel. For instance, examine the margins with respect to gain variations or phase variations at theqoutput of the plant, which is the second output.

So(2)
ans = struct with fields: GainMargin: [0.3456 17.4288] GMFrequency: [3.4361 49.8461] PhaseMargin: [-78.2449 52.6040] PMFrequency: [1.5685 6.5428] DelayMargin: [313.5216 14.0324] DMFrequency: [1.5685 6.5428] Stable: 1

基于磁盘的增益和相位利润

磁盘边距提供比经典增益和阶段利润更强的稳定性保证。基于磁盘的边际分析模型增益和相位变化作为开环系统响应的复杂不确定性。磁盘裕度是与闭环稳定性兼容的最小这种不确定性。(有关磁盘边距的一般信息,请参阅Stability Analysis Using Disk Margins。)

To compute disk-based margins, usediskmargin.。Likeallmargin.,diskmargin.command assumes a negative-feedback system. Thus, use-Lito compute the disk-based margins at the plant input.

DMi = diskmargin(-Li)
DMI =带有字段的结构:GainMargin:[0.4419 2.2628] Phasmargin:[-42.3153 42.3153] DiskMargin:0.7740下行:0.7740 Upperbound:0.7740频率:4.2515谷类术:[1x1 ss]

dmi.gainmargin.告诉您工厂输入的开环增益可以在约0.44和约2.26之间的任何因素之间变化,而不会损失闭环稳定性。基于磁盘的边距考虑了所有频率的变化。

For a MIMO loop transfer function such as the responseLo在工厂输出,有两种类型的基于磁盘的稳定性边距。这loop-at-a-time marginsare the stability margins in each channel with the other loop closed. Themultiloop marginsare the margins for independent variations in gain (or phase) in both channels simultaneously.diskmargin.computes both.

[DMO,MMO] = DiskMargin(-LO);

这loop-at-a-time margins are returned as a structure arrayDMO.with one entry for each channel. For instance, examine the margins for gain variations or phase variations at theq工厂的产出azloop closed, and compare with the classical margins given bySo(2)更多。

DMO.(2)
ANS =带有字段的结构:GainMargin:[0.3771 2.6521] Phasmargin:[-48.6811 48.6811] DiskMargin:0.9047下行:0.9047 Upperbound:0.9047频率:4.4982谷类术:[2x2 SS]

多环边缘,MMo,考虑所有反馈信道中的增益(或阶段)的同时变化,考虑到循环交互。这通常为多环控制系统提供最逼真的稳定性估计估计。

MMo
MMo = struct with fields: GainMargin: [0.6238 1.6030] PhaseMargin: [-26.0867 26.0867] DiskMargin: 0.4633 LowerBound: 0.4633 UpperBound: 0.4643 Frequency: 3.6830 WorstPerturbation: [2x2 ss]

mmo.gainmargin.表明,两个输出通道中的增益可以在约0.62和1.60之间的因素之间独立变化,而不会影响闭环稳定性。MMo.PhaseMargin表明,对于高达±26°的每个通道中的独立相变化,保留了稳定性。采用diskmargin.plotto examine the multiloop margins graphically.

diskmarginplot(-lo)

This shows the disk-based gain and phase margins as a function of frequency. TheMMovalues returned bydiskmargin.correspond to the weakest disk margin across frequency.

多个操作点的边缘

When you use线性化, you can provide multiple operating points to generate an array of linearizations of the system.allmargin.anddiskmargin.可以在线性模型阵列上运行,以返回多个操作点的边距。例如,在三个仿真快照时间下线性化机架系统。

Snap = [0;2;5];lisnap =线性化('airframemarginEx',ioInput,Snap); LoSnap = linearize('airframemarginEx',ioOutput,Snap);

LiSnap是一个3×1阵列的SISO线性模型,一个用于在每个快照时间获得的工厂输入的循环传输。相似地,LoSnap是一个3×1阵列的2输入,2输出线性模型,表示每个快照时间的工厂输出的环路传输。在三个快照时间计算工厂输入的经典增益和相位利润。

Sisnap = Allmargin(-lisnap);

Each entry in the structure arraySiSnapcontains the classical margin information for the corresponding snapshot time. For instance, examine the classical margins for the second entry,t= 2 s。

Sisnap(2)
ans = struct with fields: GainMargin: [0.0171 18.2441] GMFrequency: [0.0502 51.4351] PhaseMargin: 93.1041 PMFrequency: 2.8474 DelayMargin: 57.0691 DMFrequency: 2.8474 Stable: 1

Compute the disk margins at the plant outputs.

[DMoSnap,MMoSnap] = diskmargin(-LoSnap);

Because there are two feedback channels and three snapshot times, the structure array containing the loop-at-a-time disk margins has dimensions 2-by-3. The first dimension is for the feedback channels, and the second is for the snapshot times. In other words,DMO.Snap(j,k)contains the margins for the channeljat the snapshot timek。例如,在第三快照时间检查第二反馈通道中的磁盘边距,t= 5 s.

DMOSNAP(2,3)
ANS =带有字段的结构:GainMargin:[0.1345 7.4338] PhaseMargin:[-745771 74.6771] DiskMargin:1.5257下行:1.5257 Upperbound:1.5257频率:24.1993谷类术:[2x2 SS]

每个快照时间只有一组多环边距,所以MMoSnapis a 3-by-1 structure array.

As before, you can also plot the multiloop margins. There are now three curves, one for each snapshot time. Click on a curve to identify which snapshot time it corresponds to.

diskmarginplot(-losnap)

See Also

|||(Simulink Control Design)

Related Topics