使用模型线性化器的参数值变化的批量线性化模型
此示例显示了如何使用模型线性化器批量线性化模拟链接金宝app®model. You vary model parameter values and obtain multiple open-loop and closed-loop transfer functions from the model.
Thescdcascade
用于此示例的模型包含一对级联反馈控制环路。每个循环包括PI控制器。植物模型,G1(外循环)和G2(内循环),是LTI模型。在这个例子中,您使用模型线性化器to vary the PI controller parameters and analyze the inner-loop and outer-loop dynamics.
Open模型线性化器对于模型
在Matlab.®command line, open the Simulink model.
mdl ='scdcascade';Open_System(MDL)
To open the模型线性化器, in the Simulink model window, in theAppsgallery, click模型线性化器。
改变内环控制器增益
分析内圈的行为,非常循环PI控制器的增益,C2
。As you can see by inspecting the controller block, the proportional gain is the variablekp2.
, and the integral gain isKi2
。检查内循环的性能,用于每个增加的两个不同值。
在里面Parameter Variations下拉列表,点击Select parameters to vary
。
TheParameter Variations标签打开。点击Manage Parameters。
在里面Select model variables dialog box, check the parameters to vary,Ki2
和kp2.
。
The selected variables appear in theParameter Variations桌子。表中的每个列对应于其中一个选定的变量。表中的每一行代表一个(ki2,kp2)
对此进行线性化。调用这些参数值组合parameter samples。When you linearize,模型线性化器computes as many linear models as there are parameter samples, or rows in the table.
指定要线性化模型的参数样本。对于此示例,请指定四个(ki2,kp2)
pairs,(ki2,kp2)
=(3.5,1),(3.5,2),(5,1)和(5,2)。手动在表中输入这些值。为此,请在表中选择一行。然后,选择插入行>插入行Belowtwice.
Edit the values in the table as shown to specify the four(ki2,kp2)
pairs.
Tip
For more details about specifying parameter values, see为批量线性化指定参数样本
Analyze the Inner Loop Closed-Loop Response
To analyze the inner-loop performance, extract a transfer function from the inner-loop inputu1
to the inner-plant outputy2
,使用外环开放。指定此I / O用于线性化,在Linear Analysis标签,在Analysis I/Osdrop-down list, selectCreate New Linearization I/Os
。
通过创建指定I / O设置:
An input perturbation point at
u1
An output measurement point at
y2
循环打破
e1
Name the I/O set by typingInnerLoop
在里面Variable name“创建线性化I / O集”对话框的字段。对话框的配置如图所示。
Tip
For more information about specifying linearization I/Os, seeSpecify Portion of Model to Linearize。
点击好的。
Now that you have specified the parameter variations and the analysis I/O set for the inner loop, linearize the model and examine a step response plot. ClickStep。
模型线性化器在参数变体表中指定的每个参数样本中线性化模型。一个新变量,Linsys1.
,出现在数据浏览器的线性分析工作空间部分中。此变量是一个状态空间数组(ss
)模型,每个人(ki2,kp2)
一对。绘图显示所有条目的步骤响应Linsys1.
。这张图给你的一系列步骤responses of the system in the operating ranges covered by the parameter grid.
Vary the Outer-Loop Controller Gains
Examine the overall performance of the cascaded control system for varying values of the outer-loop controller,C1
。为此,改变系数Ki1
和kp1.
,同时保留Ki2
和kp2.
固定在模型中指定的值。
在里面Parameter Variationstab, clickManage Parameters。清除Ki2
和kp2.
checkboxes, and checkKi1
和kp1.
。点击好的。
采用模型线性化器to generate parameter values automatically. Click生成值。在里面Valuescolumn of the Generate Parameter Values table, enter an expression specifying the possible values for each parameter. For example, varykp1.
和Ki1
按照所示输入表达式,通过输入表达式±50%。
TheAll Combinationsgridding method generates a complete parameter grid of(Kp1,Ki1)
pairs, to compute a linearization at all possible combinations of the specified values. ClickOverwrite用生成的值替换参数变体表中的所有值。
因为要检查系统的整体闭环传输功能,请创建一个新的线性化I / O集。在里面Linear Analysis标签,在Analysis I/Osdrop-down list, selectCreate New Linearization I/Os
。Configurer
作为输入扰动点,以及系统输出y1m
as an output measurement. Click好的。
Linearize the model with the parameter variations and examine the step response of the resulting models. ClickStep为新模型阵列进行线性化和生成新的绘图,Linsys2.
。
The step plot shows the responses of every model in the array. This plot gives you a sense of the range of step responses of the system in the operating ranges covered by the parameter grid.
Note
虽然新情节反映了新的参数变化集,但Step Plot 1
和Linsys1.
不变。绘图和阵列仍然反映了使用内部环路参数变化获得的线性化。
Further Analysis of Batch Linearization Results
The results of both batch linearizations,Linsys1.
和Linsys2.
,是国家空间数组(ss
) models. Use these arrays for further analysis in any of several ways:
Create additional analysis plots, such as Bode plots or impulse response plots, as described inAnalyze Results Using Model Linearizer Response Plots。
Examine individual responses in analysis plots as described inAnalyze Batch Linearization Results in Model Linearizer。
将数组从线性分析工作区拖动到MATLAB工作区。
You can then use Control System Toolbox™ control design tools, such as the线性系统分析仪应用程序,分析线性化结果。或者,使用控制系统工具箱控制设计工具,如
PidTune.
或者控制系统设计师,设计线性化系统的控制器。
也看Validate Batch Linearization Resultsfor information about validating linearization results in the MATLAB workspace.