预测控制MATLAB仿真与设计.docx

上传人:scccc 文档编号:11417242 上传时间:2021-08-03 格式:DOCX 页数:11 大小:42.36KB
返回 下载 相关 举报
预测控制MATLAB仿真与设计.docx_第1页
第1页 / 共11页
预测控制MATLAB仿真与设计.docx_第2页
第2页 / 共11页
预测控制MATLAB仿真与设计.docx_第3页
第3页 / 共11页
预测控制MATLAB仿真与设计.docx_第4页
第4页 / 共11页
预测控制MATLAB仿真与设计.docx_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《预测控制MATLAB仿真与设计.docx》由会员分享,可在线阅读,更多相关《预测控制MATLAB仿真与设计.docx(11页珍藏版)》请在三一文库上搜索。

1、动态矩阵控制算法实验报告院系:电子信学院姓名:郝光杰学号:172030039 专业:控制理论与控制工程导师:俞孟蕻MATLAB环境下动态矩阵控制实验1、 实验目的: 对于带有纯滞后、大惯性的研究对象,通过动态控制矩阵的MATLAB的直接处理与仿真实验,具有较强的鲁棒性和良好的跟踪性。输入已知的控制模型,通过对参数的选择,来取的良好的控制效果。2、 实验原理:动态矩阵控制算法是一种基于被控对象非参数数学模型的控制算法,它是一种基于被控对象阶跃响应的预测控制算法,以对象的阶跃响应离散系统为模型,避免了系统的辨识,采用多步预估技术,解决时延问题,并按照预估输出与给定值偏差最小的二次性能指标实施控制,

2、它适用于渐进稳定的线性对象,系统动态特性中存在非最小相位特性或纯滞后都不影响算法的直接使用。3、 实验环境:计算机 MATLAB2016b4、 实验步骤:影响控制效果的主要参数有:1) 采样周期T与模型长度N在DMC中采样周期T与模型长度N的选择需要满足香农定理和被控对象的类型及其动态特性的要求,通常需要NT后的阶跃响应输出值接近稳定值。2)预测时域长度PP对系统的快速性和稳定性具有重要影响。为使滚动优化有意义,应使P包含对象的主要动态部分,P越小,快速性提高,稳定性变差;反之,P越大,系统实时性降低,系统响应过于缓慢。3)控制时域长度MM控制未来控制量的改变数目,及优化变量的个数,在P确定的

3、情况下,M越小,越难保证输出在各采样点紧密跟踪期望输出值,系统响应速度缓慢,可获得较好的鲁棒性,M越大,控制机动性越强,改善系统的动态性能,但是稳定性会变差。五 、实例仿真(1) 算法实现设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);%传函转换为阶跃响应

4、模型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 c

5、oefficient 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/1000Simulation time is 0.003 seconds.结论:采用DMC后系统调整时间减小,响应的快速性好,无超调。2、 P和M对系统性能的影响1、 P对系统性能的影响P表示我们对K时刻起未来多少步的输出

6、逼近期望值感兴趣,T=20,p=6,10,20时的响应曲线。Matlab程序2:g=poly2tfd(1,60 1,0,80);%通用传函转换为MPC模型delt=20; %采样周期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);%模型预测控制器增益矩阵计算k

7、mpc2=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(图二

8、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/1000Simulation time is 0.003 se

9、conds. Time remaining 1000/1000 Time remaining 800/1000 Time remaining 600/1000 Time remaining 400/1000 Time remaining 200/1000 Time remaining 0/1000Simulation time is 0.003 seconds. Time remaining 1000/1000 Time remaining 800/1000 Time remaining 600/1000 Time remaining 400/1000 Time remaining 200/1

10、000 Time remaining 0/1000Simulation time is 0.002 seconds. 结论:p越大,系统的快速性变差,系统稳定性增强,减小p,系统快速性变好,系统稳定性变差。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;%进行模型预测控

11、制器设计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,

12、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 Time remaining 600/100

13、0 Time remaining 400/1000 Time remaining 200/1000 Time remaining 0/1000Simulation 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/1000Simulation time is 0.003 seconds. Time remaining 1000

14、/1000 Time remaining 800/1000 Time remaining 600/1000 Time remaining 400/1000 Time remaining 200/1000 Time remaining 0/1000Simulation time is 0.002 seconds. 三模型失配时的响应曲线模型失配时 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;

15、%采样周期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);%模型预测控制器增益矩阵计算kmpc2=mpccon(plant2,ywt,uwt,m,p);tend=1000;r=1;%仿真时间y1,u

16、,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% Percen

17、t 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/1000Simulation 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/1000Simulation time is 0.002 seconds.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1