预测控制MATLAB仿真与设计

预测控制MATLAB仿真与设计

2023年7月20日发(作者:)

动态矩阵控制算法实验报告

院系:电子信学院

姓名:***

学号:*********

专业:控制理论与控制工程

导师:***

1 / 11

MATLAB环境下动态矩阵控制实验

一、实验目的:

对于带有纯滞后、大惯性的研究对象,通过动态控制矩阵的MATLAB的直接处理与仿真实验,具有较强的鲁棒性和良好的跟踪性。输入已知的控制模型,通过对参数的选择,来取的良好的控制效果。

二、实验原理:

动态矩阵控制算法是一种基于被控对象非参数数学模型的控制算法,它是一种基于被控对象阶跃响应的预测控制算法,以对象的阶跃响应离散系统为模型,避免了系统的辨识,采用多步预估技术,解决时延问题,并按照预估输出与给定值偏差最小的二次性能指标实施控制,它适用于渐进稳定的线性对象,系统动态特性中存在非最小相位特性或纯滞后都不影响算法的直接使用。

三、实验环境:

计算机 MATLAB2016b

四、实验步骤:

影响控制效果的主要参数有:

1)采样周期T与模型长度N

在DMC中采样周期T与模型长度N的选择需要满足香农定理和被控对象的类型及其动态特性的要求,通常需要NT后的阶跃响应输出值接近稳定值。

2)预测时域长度P

P对系统的快速性和稳定性具有重要影响。为使滚动优化有意义,应使P包含对象的主要动态部分,P越小,快速性提高,稳定性变差;反之,P越大,系统实时性降低,系统响应过于缓慢。

3)控制时域长度M

2 / 11 M控制未来控制量的改变数目,及优化变量的个数,在P确定的情况下,M越小,越难保证输出在各采样点紧密跟踪期望输出值,系统响应速度缓慢,

可获得较好的鲁棒性,M越大,控制机动性越强,改善系统的动态性能,但是稳定性会变差。

五 、实例仿真

(一)算法实现

设GP(s)=e-80s/(60s+1),采用DMC后的动态特性如图1所示,采样周期T=20s,优化时域P=10,M=2,建模时域N=20。

MATLAB程序1:

g=poly2tfd(1,[60 1],0,80);%通用传函转换为MPC模型

delt=20; %采样周期

nt=1; %输出稳定性向量

tfinal=1000; %截断时间

model=tfd2step(tfinal,delt,nt,g);%传函转换为阶跃响应模型

plant=model;%进行模型预测控制器设计

p=10;

m=2;

ywt=[];uwt=1;%设置输入约束和参考轨迹等控制器参数

kmpc=mpccon(plant,ywt,uwt,m,p);%模型预测控制器增益矩阵计算

tend=1000;r=1;%仿真时间

[y,u,yrn]=mpcsim(plant,model,kmpc,tend,r);%模型预测控制仿真

t=0:20:1000;%定义自变量t的取值数组

plot(t,y)

xlabel(‘图一DMC控制动态响应曲线(time/s)’);

ylabel(‘响应曲线’);

结果如下:

Percent error in the last step response coefficient

3 / 11 of output yi for input uj is :

2.2e-05%

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.003 seconds.

结论:采用DMC后系统调整时间减小,响应的快速性好,无超调。

二、P和M对系统性能的影响

1、P对系统性能的影响

P表示我们对K时刻起未来多少步的输出逼近期望值感兴趣,T=20,p=6,10,20时的响应曲线。

Matlab程序2:

g=poly2tfd(1,[60 1],0,80);%通用传函转换为MPC模型

delt=20; %采样周期

4 / 11 nt=1; %输出稳定性向量

tfinal=1000; %截断时间

model=tfd2step(tfinal,delt,nt,g);%传函转换为阶跃响应模型

plant=model;%进行模型预测控制器设计

p1=6;p2=10;p3=20;%优化时域

m=2;%控制时域

ywt=[];uwt=1;%设置输入约束和参考轨迹等控制器参数

kmpc1=mpccon(plant,ywt,uwt,m,p1);%模型预测控制器增益矩阵计算

kmpc2=mpccon(plant,ywt,uwt,m,p2);

kmpc3=mpccon(plant,ywt,uwt,m,p3);

tend=1000;r=1;%仿真时间

[y1,u,yrn]=mpcsim(plant,model,kmpc1,tend,r);%模型预测控制仿真

[y2,u,yrn]=mpcsim(plant,model,kmpc2,tend,r);

[y3,u,yrn]=mpcsim(plant,model,kmpc3,tend,r);

t=0:20:1000;%定义自变量t的取值数组

plot(t,y1,t,y2,t,y3)

legend('1-p=6,2-p=10,3-p=20');

xlabel('图二p不同对系统性能的影响(time/s)');

ylabel(‘响应曲线’);

结果l:

Percent error in the last step response coefficient

of output yi for input uj is :

2.2e-05%

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.003 seconds.

5 / 11 Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.003 seconds.

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.002 seconds.

>>

结论:p越大,系统的快速性变差,系统稳定性增强,减小p,系统快速性变好,系统稳定性变差。

6 / 11 2. M对系统的影响

T=20,P=20 N=20 m=4、2、1 时的控制规律

MATLAB程序3:

g=poly2tfd(1,[60 1],0,80);%通用传函转换为MPC模型

delt=20; %采样周期

nt=1; %输出稳定性向量

tfinal=1000; %截断时间

model=tfd2step(tfinal,delt,nt,g);%传函转换为阶跃响应模型

plant=model;%进行模型预测控制器设计

p=20;

m1=4;m2=2;m3=1;

ywt=[];uwt=1;%设置输入约束和参考轨迹等控制器参数

kmpc1=mpccon(plant,ywt,uwt,m,p1);%模型预测控制器增益矩阵计算

kmpc2=mpccon(plant,ywt,uwt,m,p2);

kmpc3=mpccon(plant,ywt,uwt,m,p3);

tend=1000;r=1;%仿真时间

[y1,u,yrn]=mpcsim(plant,model,kmpc1,tend,r);%模型预测控制仿真

[y2,u,yrn]=mpcsim(plant,model,kmpc2,tend,r);

[y3,u,yrn]=mpcsim(plant,model,kmpc3,tend,r);

t=0:20:1000;%定义自变量t的取值数组

plot(t,y1,t,y2,t,y3)

legend('1-m=4,2-m=2,3-m=1');

xlabel('图二p不同对系统性能的影响(time/s)');

ylabel(‘响应曲线’);

结果;

Percent error in the last step response coefficient

of output yi for input uj is :

2.2e-05%

Time remaining 1000/1000

Time remaining 800/1000

7 / 11 Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.003 seconds.

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.003 seconds.

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.002 seconds.

>>

8 / 11

三模型失配时的响应曲线

模型失配时 GM(s)GP(s),当GM(s)=2e-50s/(40s+1)时的响应曲线,为图4所示

Matlab程序4:

g1=poly2tfd(1,[60 1],0,80);%通用传函转换为MPC模型

g2=poly2tfd(2,[40 1],0,50);

delt=20; %采样周期

nt=1; %输出稳定性向量

tfinal=1000; %截断时间

model1=tfd2step(tfinal,delt,nt,g1);%传函转换为阶跃响应模型

model2=tfd2step(tfinal,delt,nt,g2);

plant1=model1;%进行模型预测控制器设计

plant2=model2;

p=10;

m=2;

ywt=[];uwt=1;%设置输入约束和参考轨迹等控制器参数

kmpc1=mpccon(plant1,ywt,uwt,m,p);%模型预测控制器增益矩阵计算

9 / 11 kmpc2=mpccon(plant2,ywt,uwt,m,p);

tend=1000;r=1;%仿真时间

[y1,u,yrn]=mpcsim(plant1,model1,kmpc1,tend,r);%模型预测控制仿真

[y2,u,yrn]=mpcsim(plant2,model2,kmpc2,tend,r);

t=0:20:1000;%定义自变量t的取值数组

plot(t,y1,t,y2,)

legend('1-模型未失配,2-模型未失配');

xlabel('图四模型失配响应曲线(time/s)');

ylabel(‘响应曲线’);

结果分析:

Percent error in the last step response coefficient

of output yi for input uj is :

2.2e-05%

Percent error in the last step response coefficient

of output yi for input uj is :

4.8e-09%

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.004 seconds.

Time remaining 1000/1000

Time remaining 800/1000

Time remaining 600/1000

Time remaining 400/1000

Time remaining 200/1000

Time remaining 0/1000

Simulation time is 0.002 seconds.

10 / 11

11 / 11

发布者:admin,转转请注明出处:http://www.yc00.com/news/1689851042a290441.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信