机电系统智能控制技术课程设计报告模板_第1页
机电系统智能控制技术课程设计报告模板_第2页
机电系统智能控制技术课程设计报告模板_第3页
机电系统智能控制技术课程设计报告模板_第4页
机电系统智能控制技术课程设计报告模板_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、高等教育自学考试课程设计考核报告姓名 侯 代 勇 报考专业 机 电 系 统 智 能 控 制 报考号 8 考核时间2011年10月282011年11月30日 课程名称机 电 系 统 智 能 控 制 技 术 课 程 设 计 考核成绩 评阅老师主考院校西安理工大学任务一常规PID控制器的设计与仿真 1.1 PID控制原理模拟PID控制系统原理框图如下图所示设error(t)=rin(t)-yout(t)则 U(t)=Kperror(t)+error(t)dt+写成传递函数形式:(s)=Kp(1+TDs)式中:Kp比例系数;TI 积分时间常数;TD微分时间常数PID控制器各校正环节的作用如下:() 比

2、例环节:成比例地反映控制系统的偏差信号error(t),偏差一旦产生,控制器立即产生控制作用,以减少偏差随着Kp增大,系统响应速度加快,超调也增加,调节时间也增长。比例控制(Kp)只能改变系统的增益而不影响系统的相位,它对系统的影响主要反映在稳态误差和稳定性上,增大比例系数可以提高系统的开环增益,减小系统的稳态误差,从而提高系统的精度,但这样会降低系统的相对稳性,甚至会使系统不稳低,因此,一般不单独使用比例控制器.() 积分环节:主要用于消除静差,提高系统的无差度积分作用的强弱取决于积分时间常数TI ,TI越大积分作用越弱,反之,则越强。积分环节的主要作用就是消除系统的稳态误差,为了消除稳态误

3、差,在控制系统中必须引入积分环节,而且随积分时间的增加,系统的稳态误差会进一步减小,直到为零但积分作用的引入,即加入了极点,同时也引起了系统的相位滞后,所以使系统的稳定性变差积分时间选择不当,还可能使系统不稳定因此,积分环节一般不单独使用,通常结合比例环节构成比例积分PID控制器.() 微分环节:反映偏差信号的变化趋势(变化速率),并能在偏差信号变 得太大之前,在系统中引入一个有效的早期修正信号,从而加快系 统的动作速度,减少调节时间。在微分控制中,控制器的输出与输入误 差信号的微分成正比关系,而且微分作用加强时,系统的超调量减小, 稳定性提高,上升时间小,快速性提高。但微分时间不能太大。微分

4、控 制反映了误差的变化率,只有当误差随时变化时,微分控制才有作用, 否则微分不起作用,所以微分一般不单独使用,常构成PD或PID控制 器使用。1.2 离散系统的数字PID控制仿真作业要求:) 设被控对象为)推导出增量式PID控制算法模拟PID的控制算法为 u(t)=Kpe(t)+ + (式1) 式中:u(t)t时刻控制器的输出;e(t)误差信号;KP比例增益;TI积分时间常数;TD微分时间常数;将(式1)离散化,可得数字PID算法的表达式 u(k)= Kpe(k)+ +e(k)-e(k-1) (式2) 式中: k采样序列号,k=0,1,2,; T采样周期; u(k)采样时刻PID控制器的输出;

5、 e(k)第k个采样时刻系统的误差; e(k-1)第k-1个采样时刻系统的误差;根据递推原理,由(式2)可得u(k-1)=kpe(k-1)+ +e(k-1)-e(k-2) (式3)则由(式2)减去(式3)可得 u(k)=u(k)-u(k-1) =Kpe(k)-e(k-1)+e(k)+ e(k)-2e(k-1)+e(k-2) 这就是PID算法的增量式 )画出增量式PID控制算法程序流程图计算控制参数A,B,C开始设初值e(k-1)=e(k-2)=0计算控制量u(k)u(k)=Ae(k)-Be(k-1)+Ce(k-2)计算偏差值e(k)=r(k)-y(k)A/D本次采样输入y(k)输出u(k)为下

6、一时刻作准备e(k-2)=e(k-1),e(k-1)=e(k)D/A被控对象采样时刻到没?)用MATLAB语言编写增量式PID控制系统程序如下为用 MATLAB语言编写的离散系统数字 PID 控制仿真语句.clear all;close all;T=0.01;sys=tf(35,0.00001,0.00305,0.215,1,0);dsys=c2d(sys,T,z);num,den=tfdata(dsys,v);u_1=0.0;u_2=0.0;u_3=0.0;u_4=0.0;y_1=0.0;y_2=0.0;y_3=0.0;y_4=0.0;x=0,0,0;error_1=0.0;error_2=

7、0.0;for k=1:1:1000time(k)=k*T;s=1;if s=1kp=0.225;Ti=120;Td=0.25;rin(k)=1;endA=kp*(1+T/Ti+Td/T);B=kp*(1+2*Td/T);C=kp*Td/T;u(k)=A*x(1)-B*x(2)+C*x(3)+u_1;%Restricting the output of controllerif u(k)=10u(k)=10;endif u(k)=10 u(k)=10; end if u(k)=10 u(k)=10;endif u(k)=-10 u(k)=-10;endyout(k)=-den(2)*y_1-d

8、en(3)*y_2-den(4)*y_3-den(5)*y_4+num(1)*u(k)+num(2)*u_1+num(3)*u_2+num(4)*u_3+num(5)*u_4;error(k)=rin(k)-yout(k);%Return of PID parameters% u_4=u_3;u_3=u_2; u_2=u_1; u_1=u(k); y_4=y_3; y_3=y_2; y_2=y_1; y_1=yout(k); x(1)=error(k); % Calculating P x(2)= error(k)-error_1; % Calculating D x(3)=x(3)+erro

9、r(k); % Calculating I e_1=x(1); ec_1=x(2); error_1=error(k); endshowrule(a)figure(1);plot(time,rin,b,time,yout,r);xlabel(time(s);ylabel(rin,yout);grid onfigure(2);plot(time,error,r);xlabel(time(s);ylabel(error);grid onfigure(3);plot(time,u,r);xlabel(time(s);ylabel(u);grid onfigure(4);plot(time,kp,r)

10、;xlabel(time(s);ylabel(kp);grid onfigure(5);plot(time,ki,r);xlabel(time(s);ylabel(ki);grid onfigure(6);plot(time,kd,r);xlabel(time(s);ylabel(kd);figure(7);plotmf(a,input,1)figure(8);plotmf(a,input,2)figure(9);plotmf(a,output,1)figure(10);plotmf(a,output,2)figure(11);plotmf(a,output,3)figure(12);plot

11、fis(a)通过仿真,还可以得到以下几个结果:(1) 在MATLAB下运行plotmf(a,input,1)可得到模糊系统第一个输入e的隶属函数,同理可得到ec, kp, ki, kd的隶属函数,如图2-9至2-13所示图2-9误差的隶属函数图2-10误差变化率的隶属函数 图2-11 kp的隶属函数 图2-12 ki的隶属函数图2-13 kd的隶属函数 (2)在MATLAB下运行plotfis(a)可观察模糊控制系统的构成,如图2-14所示 图2-14 模糊PID的控制系统构成(3)在MATLAB下运行fuzzy fuzzpid.fis可进入MATLAB动态仿真工具箱动态仿真环境,如图2-15

12、所示 图2-15 模糊PID的控制系统环境(4)在MATLAB下运行showrule(a),可得到以下49条模糊规则;1. If (e is NB) and (ec is NB) then (kp is PB)(ki is NB)(kd is PS) (1) 2. If (e is NB) and (ec is NM) then (kp is PB)(ki is NB)(kd is NS) (1) 3. If (e is NB) and (ec is NS) then (kp is PM)(ki is NM)(kd is NB) (1) 4. If (e is NB) and (ec is Z

13、) then (kp is PM)(ki is NM)(kd is NB) (1) 5. If (e is NB) and (ec is PS) then (kp is PS)(ki is NS)(kd is NB) (1) 6. If (e is NB) and (ec is PM) then (kp is Z)(ki is Z)(kd is NM) (1) 7. If (e is NB) and (ec is PB) then (kp is Z)(ki is Z)(kd is PS) (1) 8. If (e is NM) and (ec is NB) then (kp is PB)(ki

14、 is NB)(kd is PS) (1) 9. If (e is NM) and (ec is NM) then (kp is PB)(ki is NB)(kd is NS) (1) 10. If (e is NM) and (ec is NS) then (kp is PM)(ki is NM)(kd is NB) (1)11. If (e is NM) and (ec is Z) then (kp is PS)(ki is NS)(kd is NM) (1) 12. If (e is NM) and (ec is PS) then (kp is PS)(ki is NS)(kd is N

15、M) (1)13. If (e is NM) and (ec is PM) then (kp is Z)(ki is Z)(kd is NS) (1) 14. If (e is NM) and (ec is PB) then (kp is NS)(ki is Z)(kd is Z) (1) 15. If (e is NS) and (ec is NB) then (kp is PM)(ki is NB)(kd is Z) (1) 16. If (e is NS) and (ec is NM) then (kp is PM)(ki is NM)(kd is NS) (1)17. If (e is

16、 NS) and (ec is NS) then (kp is PM)(ki is NS)(kd is NM) (1)18. If (e is NS) and (ec is Z) then (kp is PS)(ki is NS)(kd is NM) (1) 19. If (e is NS) and (ec is PS) then (kp is Z)(ki is Z)(kd is NS) (1) 20. If (e is NS) and (ec is PM) then (kp is NS)(ki is PS)(kd is NS) (1)21. If (e is NS) and (ec is P

17、B) then (kp is NS)(ki is PS)(kd is Z) (1) 22. If (e is Z) and (ec is NB) then (kp is PM)(ki is NM)(kd is Z) (1) 23. If (e is Z) and (ec is NM) then (kp is PM)(ki is NM)(kd is NS) (1) 24. If (e is Z) and (ec is NS) then (kp is PS)(ki is NS)(kd is NS) (1) 25. If (e is Z) and (ec is Z) then (kp is Z)(k

18、i is Z)(kd is NS) (1) 26. If (e is Z) and (ec is PS) then (kp is NS)(ki is PS)(kd is NS) (1) 27. If (e is Z) and (ec is PM) then (kp is NM)(ki is PM)(kd is NS) (1) 28. If (e is Z) and (ec is PB) then (kp is NM)(ki is PM)(kd is Z) (1) 29. If (e is PS) and (ec is NB) then (kp is PS)(ki is NM)(kd is Z)

19、 (1) 30. If (e is PS) and (ec is NM) then (kp is PS)(ki is NS)(kd is Z) (1) 31. If (e is PS) and (ec is NS) then (kp is Z)(ki is Z)(kd is Z) (1) 32. If (e is PS) and (ec is Z) then (kp is NS)(ki is PS)(kd is Z) (1) 33. If (e is PS) and (ec is PS) then (kp is NS)(ki is PS)(kd is Z) (1) 34. If (e is P

20、S) and (ec is PM) then (kp is NM)(ki is PM)(kd is Z) (1) 35. If (e is PS) and (ec is PB) then (kp is NM)(ki is PB)(kd is Z) (1) 36. If (e is PM) and (ec is NB) then (kp is PS)(ki is Z)(kd is PB) (1) 37. If (e is PM) and (ec is NM) then (kp is Z)(ki is Z)(kd is PS) (1) 38. If (e is PM) and (ec is NS) then (kp is NS)(ki is PS)(kd is PS) (1)39. If (e is PM) and (ec is Z) then (kp is NM)(ki is PS)(kd is PS) (1) 40. If (e is PM) and (ec is PS) then (kp is NM)(ki is PM)(kd is PS) (1)41. If (e is PM) and (ec is PM) then (kp is NM)(ki is PB)(kd is P

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论