主要内容

Tuning of a Two-Loop Autopilot

This example shows how to use Simulink Control Design to tune a two-loop autopilot controlling the pitch rate and vertical acceleration of an airframe.

机身自动驾驶仪的模型

机身动力学和自动驾驶仪是在Simulink中建模的。万博1manbetx

open_system('rct_airframe1'

自动驾驶仪由两个级联回路组成。内环控制螺距速率Q,外圈控制垂直加速度AZin response to the pilot stick commandazref。In this architecture, the tunable elements include the PI controller gains ("az Control" block) and the pitch-rate gain ("q Gain" block). The autopilot must be tuned to respond to a step commandazref在大约1秒钟内,最小的过冲。在此示例中,我们将自动驾驶仪的收益调整为一个飞行条件,对应于零发射率和984 m/s的速度。

要分析机身动力学,请修剪机身$\alpha=0$$V = 984 m/s$。修剪条件对应于零正常加速度和俯仰力矩($ W $$q$steady). UseFindopto compute the corresponding closed-loop operating condition. Note that we added a "delta trim" input port so thatFindop可以调整鳍片挠度以产生所需的力和力矩平衡。

opspec = operspec('rct_airframe1');% Specify trim condition% Xe,Ze: known, not steadyopspec.States(1)。已知= [1; 1];opspec.States(1).steadyState = [0; 0];%u,w:已知,w稳定opspec.States(3)。已知= [1 1];opspec.States(3).steadyState = [0 1];%theta:已知,不稳定OPspec.States(2).Known = 1; opspec.States(2).SteadyState = 0;% q: unknown, steadyOPspec.States(4).Known = 0; opspec.States(4).SteadyState = 1;%集成剂状态未知,不稳定opspec.states(5).steadystate = 0;opspec.states(6).steadystate = 0;op = findop('rct_airframe1',,,,OPspec);
Operating point search report: --------------------------------- opreport = Operating point search report for the Model rct_airframe1.(在时间t = 0上评估的时变组件)成功满足了操作点规格。States: ---------- Min x Max dxMin dx dxMax ___________ ___________ ___________ ___________ ___________ ___________ (1.) rct_airframe1/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/Position 0 00 -INF 984 INF -3047.9999 -3047.9999 -3047.9999 -INF 0 INF(2))rct_airframe1/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/U,w 984 984 984 -Inf 22.6897 Inf 0 0 0 0 -1.4367e-11 0 (4.) rct_airframe1/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/q -Inf -0.0097235 Inf 0 1.1477e-16 0 (5.) rct_airframe1/Integrator -Inf 0.00070807 Inf -Inf -0.0097235 Inf (6.) rct_airframe1/az Control/Integrator/Continuous/Integrator -Inf 0 Inf -Inf 0.00024207 Inf Inputs: ---------- Min u Max __________ __________ __________ (1.) rct_airframe1/delta trim -Inf 0.00070807 Inf Outputs: None ----------

线性化计算的装饰条件的“机身型号”块OP和plot the gains from the fin deflection三角洲toAZq

g =线性化('rct_airframe1',,,,'rct_airframe1/Airframe Model',OP);G.InputName ='delta';G.Outputname = {'az',,,,'Q'};bodemag(g),网格

请注意,机身型号具有不稳定的极:

pole(G)
ans = -0.0320 -0.0255 0.1253 -29.4685

频域调整looptune

您可以使用looptunefunction to automatically tune multi-loop control systems subject to basic requirements such as integral action, adequate stability margins, and desired bandwidth. To applylooptune对于自动驾驶模型,创建一个实例Sltunerinterface and designate the Simulink blocks "az Control" and "q Gain" as tunable. Also specify the trim conditionOP正确地使机身动力学线性化。

st0 = sltuner('rct_airframe1',{“ AZ控制”,,,,'q Gain'},op);

Mark the reference, control, and measurement signals as points of interest for analysis and tuning.

addpoint(st0,{'AZ Ref',,,,'delta fin',,,,'az',,,,'Q'});

Finally, tune the control system parameters to meet the 1 second response time requirement. In the frequency domain, this roughly corresponds to a gain crossover frequencywc= 5 rad/s for the open-loop response at the plant input "delta fin".

WC = 5;控件='delta fin';Measurements = {'az',,,,'Q'};[st,gam,info] = looptune(ST0,控件,测量,WC);
最终:峰值增益= 1.01,迭代= 69

The requirements are normalized so a final value near 1 means that all requirements are met. Confirm this by graphically validating the design.

figure('位置',[100,100,560,714])loopview(st,info)

第一个图证实,开环响应具有积分动作和所需的增益交叉频率,而第二个图表明,MIMO稳定性边缘令人满意(蓝曲线应保持在黄色结合以下)。接下来检查步骤命令的响应azrefto the vertical accelerationAZ

T = getIOTransfer(ST,'AZ Ref',,,,'az');图步(t,5)

加速度AZdoes not trackazref尽管在循环中存在集成器。这是因为反馈循环作用于两个变量AZq而且我们尚未指定哪个应该跟踪azref

添加跟踪要求

To remedy this issue, add an explicit requirement thatAZ应遵循step命令azref有1秒的响应时间。还要放松间隔[3,12]的增益交叉要求,让调谐器找到适当的增益交叉频率。

trackreq = tuninggoal.tracking('AZ Ref',,,,'az',1);st = looptune(ST0,对照,测量,[3,12],TrackReq);
Final: Peak gain = 1.23, Iterations = 54

来自azreftoAZ现在令人满意:

Tr1 = getIOTransfer(ST,'AZ Ref',,,,'az');step(Tr1,5) grid

Also check the disturbance rejection characteristics by looking at the responses from a disturbance entering at the plant input

Td1 = getIOTransfer(ST,'delta fin',,,,'az');bodemag(Td1) grid

步骤(TD1,5)网格标题(“干扰拒绝”

利用showBlockValueto see the tuned values of the PI controller and inner-loop gain

showBlockValue(ST)
分析点_ = d = u1 u2 u3 u4 y1 1 0 0 0 0 y2 0 0 0 0 0 0 y3 0 0 1 0 y4 0 0 0 0 1名称:Analysispoints_静态增益。----------------------------------- az_Control = 1 Kp + Ki * --- s with Kp = 0.00166,ki = 0.0017名称:AZ_Control连续时间PI控制器并行形式。----------------------------------- q_Gain = D = u1 y1 1.985 Name: q_Gain Static gain.

如果此设计令人满意,请使用writeBlockValueto apply the tuned values to the Simulink model and simulate the tuned controller in Simulink.

writeBlockValue(ST)

带有Systune的MIMO设计

级联回路通常用于自动驾驶仪。然而,一个人可能想知道一个同时使用的单个MIMO控制器AZq生成执行器命令三角洲fin将与两循环体系结构进行比较。尝试新的控制体系结构很容易Systune或者looptune。For variety, we now useSystune调整以下MIMO架构。

open_system('rct_airframe2'

As before, compute the trim condition for$\alpha=0$$V = 984 m/s$

opspec = operspec('rct_airframe2');% Specify trim condition% Xe,Ze: known, not steadyopspec.States(1)。已知= [1; 1];opspec.States(1).steadyState = [0; 0];%u,w:已知,w稳定opspec.States(3)。已知= [1 1];opspec.States(3).steadyState = [0 1];%theta:已知,不稳定OPspec.States(2).Known = 1; opspec.States(2).SteadyState = 0;% q: unknown, steadyOPspec.States(4).Known = 0; opspec.States(4).SteadyState = 1;% controller states unknown, not steadyopspec.States(5).steadyState = [0; 0];op = findop('rct_airframe2',,,,OPspec);
Operating point search report: --------------------------------- opreport = Operating point search report for the Model rct_airframe2.(在时间t = 0上评估的时变组件)成功满足了操作点规格。States: ---------- Min x Max dxMin dx dxMax ___________ ___________ ___________ ___________ ___________ ___________ (1.) rct_airframe2/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/Position 0 00 -INF 984 INF -3047.9999 -3047.9999 -3047.9999 -INF 0 INF(2))rct_airframe2/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/U,w 984 984 984 -Inf 22.6897 Inf 0 0 0 0 2.4588e-11 0 (4.) rct_airframe2/Airframe Model/Aerodynamics & Equations of Motion/ Equations of Motion (Body Axes)/q -Inf -0.0097235 Inf 0 -4.0169e-16 0 (5.) rct_airframe2/MIMO Controller -Inf 0.00065361 Inf -Inf -0.0089973 Inf -Inf 2.6167e-19 Inf -Inf 0.030259 Inf Inputs: ---------- Min u Max __________ __________ __________ (1.) rct_airframe2/delta trim -Inf 0.00043574 Inf Outputs: None ----------

looptune,,,,use theSltuner接口配置用于调整的simulink模型。万博1manbetx请注意,感兴趣的信号已经标记为Simulink模型中的线性分析点。万博1manbetx

st0 = sltuner('rct_airframe2',,,,'MIMO Controller',OP);

尝试使用零进料的二阶Mimo控制器eto三角洲fin。To do this, create the desired controller parameterization and associate it with the "MIMO Controller" block usingsetBlockParam

c0 = tunabless('C',,,,2,1,2);% Second-order controllerc0.d.value(1)= 0;%修复D(1)为零c0.d.free(1)= false;SetBlockParam(ST0,'MIMO Controller',C0)

接下来创建调整要求。在这里,我们使用以下四个要求:

  1. 追踪AZ应该在大约1秒钟内回应azref命令

  2. 带宽和滚动:循环获得三角洲finshould roll off after 25 rad/s with a -20 dB/decade slope

  3. Stability margins:边缘在三角洲fin应超过7 dB和45度

  4. 干扰拒绝:输入干扰的衰减因子应为40 dB,在1 rad/s时为0.001 rad/s增加到100 dB。

% TrackingReq1 = TuningGoal.Tracking('AZ Ref',,,,'az',1);%带宽和滚动req2 = tuninggoal.maxloopgain('delta fin',TF(25,[1 0]));利润率%Req3 = TuningGoal.Margins('delta fin',,,,7,45);%干扰拒绝%使用FRD型号用几个点来绘制所需的衰减轮廓freqs = [0 0.001 1];minatt = [100 100 40];% in dBreq4 = tuninggoal.spoction('delta fin',frd(db2mag(minatt),freqs));req4.focus = [0 1];

You can now useSystuneto tune the controller parameters subject to these requirements.

AllReqs = [Req1,Req2,Req3 Req4]; Opt = systuneOptions('RandomStart',,,,3); rng(0) [ST,fSoft] = systune(ST0,AllReqs,Opt);
Final: Soft = 1.42, Hard = -Inf, Iterations = 47 Final: Soft = 1.42, Hard = -Inf, Iterations = 62 Final: Soft = 1.14, Hard = -Inf, Iterations = 86 Final: Soft = 1.14, Hard = -Inf, Iterations = 112

The best design has an overall objective value close to 1, indicating that all four requirements are nearly met. UseViewGoalto inspect each requirement for the best design.

figure('位置',,,,[100,100,987,474]) viewGoal(AllReqs,ST)

Compute the closed-loop responses and compare with the two-loop design.

t = getiotransfer(st,{'AZ Ref',,,,'delta fin'},,'az');figure step(Tr1,'b',t(1),'r',5)标题('追踪')legend('级联',,,,'2 dof'

step(Td1,'b',,,,T(2),'r',5)标题(“干扰拒绝”)legend('级联',,,,'2 dof'

跟踪性能相似,但第二个设计具有更好的干扰拒绝属性。

See Also

|

相关话题