Main Content

Create and Configure slTuner Interface to Simulink Model

此示例显示了如何创建和配置SltunerSimulink®型号的接口。金宝app这Sltunerinterface parameterizes blocks in your model that you designate as tunable and allows you to tune them usingSystune。这Sltunerinterface generates a linearization of your Simulink model, and also allows you to extract linearized system responses for analysis and validation of the tuned control system.

For this example, create and configure anSltunerinterface for tuning the Simulink modelrct_helico,用于旋翼的多旋转控制器。打开模型。

open_system('rct_helico');

这control system consists of two feedback loops. The inner loop (static output feedback) provides stability augmentation and decoupling. The outer loop (PI controllers) provides the desired setpoint tracking performance.

Suppose that you want to tune this model to meet the following control objectives:

  • Track setpoint changes inTheta,,,,phi,,,,andR.稳态误差,指定的上升时间,最小的过冲和最小的交叉耦合。

  • Limit the control bandwidth to guard against neglected high-frequency rotor dynamics and measurement noise.

  • 提供强大的多变量增益和相位边缘(对工厂输入和输出的同时增益/相变的稳健性)。

Systune命令可以共同调整控制器块SOF以及PI控制器以满足这些设计要求。这Sltuner接口设置此调整任务。

创建Sltuner界面。

ST0 = slTuner('rct_helico',,,,{'pi1',,,,'pi2',,,,'pi3',,,,'sof'});

此命令初始化Sltuner与三个PI控制器的接口和SOF被指定为可调的块。每个可调块根据其类型自动对参数化,并在Simulink模型中以其值初始化。金宝app

To configure theSltunerinterface, designate as analysis points any signal locations of relevance to your design requirements. First, add the outputs and reference inputs for the tracking requirements.

addpoint(st0,{“theta-ref”,,,,'theta',,,,'phi-ref',,,,'phi',,,,'r-ref',,,,'r'});

当您创建一个TuningGoal.Trackingobject that captures the tracking requirement, this object references the same signals.

配置Sltunerinterface for the stability margin requirements. Designate as analysis points the plant inputs and outputs (control and measurement signals) where the stability margins are measured.

addpoint(st0,{'U',,,,'y'});

显示Sltunerinterface configuration in the command window.

ST0
slTuner tuning interface for "rct_helico": 4 Tuned blocks: (Read-only TunedBlocks property) -------------------------- Block 1: rct_helico/PI1块2:rct_helico/pi2块3:rct_helico/pi3块4:rct_helico/sof 8分析点:-------------------------------------------------------------------------------------------------------------------------------------1:rct_helico/theta-ref点的“输出端口1”:信号“ theta”,位于rct_helico/demux1点3:rct_helico/phi-ref点的'输出端口1':“输出端口1”:信号“ phi”,位于rct_helico/demux1的'输出端口2'点5:rct_helico/r-ref点的'输出端口1',位于rct_helico/demux1点7的'输出端口3'的信号“ r”点7:信号“ U”,位于RCT_HELICO/MUX3点8的'输出端口1':信号“ y”,位于RCT_HELICO/HELICOPTER的'输出端口1',没有永久性开口。使用addopening命令添加新的永久性开口。带有点符号get/set访问的属性:[] operionts:[](将使用模型初始条件。)blockSubStitutions:[]选项:[1x1 linearize.sltuneroptions] ts:0

在命令窗口中,单击任何突出显示的信号以查看其在Simulink模型中的位置。金宝app

In addition to specifying design requirements, you can use analysis points for extracting system responses. For example, extract and plot the step responses between the reference signals and'theta',,,,'phi',,,,and'r'

t0 = getiotransfer(st0,{“theta-ref”,,,,'phi-ref',,,,'r-ref'},{'theta',,,,'phi',,,,'r'});stepplot(T0,1)

All the step responses are unstable, including the cross-couplings, because this model has not yet been tuned.

After you tune the model, you can similarly use the designated analysis points to extract system responses for validating the tuned system. If you want to examine system responses at locations that are not needed to specify design requirements, add these locations to theSltunerinterface as well. For example, plot the sensitivity function measured at the output of the blockR.oll-off 2

AddPoint(ST0,'DC')dcs0 =敏感性(st0,'DC');Bodeplot(DCS0)

假设您想更改可调块的参数化Sltuner界面。例如,假设在调整模型后,您要测试从PI转换为PID控制器是否会产生改善的结果。将三个PI控制器的参数化更改为PID控制器。

PID0 = PID(0,0.001,0.001,.01);PID控制器的初始值%pid1 = tunablepid('C1',pid0);pid2 = tunablepid('C2',pid0);pid3 = tunablepid('C3',pid0);SetBlockParam(ST0,'pi1',,,,PID1,'pi2',,,,PID2,'pi3',pid3);

配置后Sltunerinterface to your Simulink model, you can create tuning goals and tune the model usingSystuneorlooptune

也可以看看

(金宝appSimulink控制设计)|(金宝appSimulink控制设计)|(金宝appSimulink控制设计)|(金宝appSimulink控制设计)|(金宝appSimulink控制设计)|(金宝appSimulink控制设计)

Related Topics