(完整版)MATLAB控制系统仿真计算_第1页
(完整版)MATLAB控制系统仿真计算_第2页
(完整版)MATLAB控制系统仿真计算_第3页
(完整版)MATLAB控制系统仿真计算_第4页
(完整版)MATLAB控制系统仿真计算_第5页
免费预览已结束,剩余23页可下载查看

下载本文档

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

文档简介

1、控制系统的模型与转换1.请将下面的传递函数模型输入到matlab环境。32s 4s 2z 0.568G(s) 23 H (z) 2,T=0.1ss3(s2 2)(s2 1)3 2s 5(z 1)(z20.2z 0.99) s=tf(s);G=(sA3+4*s+2)/(sA3*(sA2+2)*(sA2+1)A3+2*s+5); GTransfer function: sA3 + 4 s + 2sA11 + 5 sA9 + 9 sA7 + 2 sA6 + 12 $八5 + 4 $八4 + 12 $八3 num=1 0 0.56;den=conv(1 -1,1 -0.2 0.99);H=tf(num

2、,den,Ts,0.1)Transfer function:zA2 + 0.562.请将下面的零极点模型输入到zA3 - 1.2 zA2 + 1.19 z - 0.99matlab环境。请求出上述模型的零极点,并绘制其位置。G(s)8(s 1 j)(s 1 j)2_2s (s 5)(s 6)(s1)z=-1-j -1+j;p=0 0 -5 -6 -j j;G=zpk(z,p,8)Zero/pole/gain:8 *2 + 2s + 2)sA2 (s+5) (s+6)伊人2 + 1)pzmap(G),、 (z 1 3.2)(z 1 2.6)H (z) 5一t , T=0.05s5z (z 8.2

3、)Pck!-Z*re M 邯i f1t r0M0.0 -1 O.G 0.6 0.4 z=0 0 0 0 0 -1/3.2 -1/2.6;P=1/8.2;Zero/pole/gain:zA5 (z+0.3125) (z+0.3846)亿-0.122)Sampling time: 0.05pzmap (H)线性系统分析1.请分析下面传递函数模型的稳定性。G(s)1332-s 2ss 2G(s)3s 1-2Z2 11s (300s600s 50) 3s 1 num=1;den=1 2 1 2;G=tf(num,den);eig(G)ans =-2.00000.0000 - 1.0000i0.0000

4、 + 1.0000i可见,系统有两个特征根在虚轴上, 一个特征根在虚轴左侧,所以系统是临 界稳定的。 num=3 1;den=300 600 50 3 1;1 PdB 工 5r 口 IVtip105 Iirf-L.fK fl rFde-ZEfuMBt&必0.1150.1。,&5S3-,n its由iO.HQ2r111界3JI111-1.5-1-05D0,Heel floas5G=tf(num,den);eig(G) ans =-1.9152-0.14140.0283 - 0.1073i0.0283 + 0.1073i可见,有两个特征根在虚轴右侧,所以系统是不稳定的。2.请判定下面离散系统的稳定

5、性。H(z) (z3 0.22产0.252 0.05)H(z)212.12z 2 11.76z 1 15.91z 5 7.368z 4 20.15z 321102.4z 2 80.39z1 340) num=-3 2;den=1 -0.2 -0.25 0.05;H=tf(num,den,Ts,0.1);eig(H) abs(eig(H)ans =-0.50000.50000.50000.50000.20000.2000可以看出,由于各个特征根的模均 小于1,所以可以判定闭环系统是稳定 的。 z=tf(z,0.1);H=(2.12*zA-2+11.76*zA- 1+15.91)/ :(zA-5-

6、7.368*zA-4-20.15*zA-3+102.4*zA-2+80.39*z-1-340);eig(H) abs(eig(H)ans =0000000000000000000000004.17244.17240.3755 + 0.1814i0.41700.3755 - 0.1814i0.4170-0.52920.5292-0.27160.27160.11930.1193Pule-Zelv Mb i;可以看出,由于4.1724这个特征根的模大于 1,所以可以判定闭环系统是不稳定的。3.设描述系统的传递函数为G(s)18 s7514 s65982 s536380 s4 122664 s3222

7、088 s2185760 s 40320s836 s7546 s6 4536 s522449 s4 67284 s3118124 s2 109584 s 40320具有零初始状态,请求出单位阶跃响应曲线和单位脉冲响应曲线。 num=18 514 5982 36380 122664 22088 185760 40320;den=1 36 546 4536 22449 67284 118124 109584 40320;G=tf(num,den)Transfer function:18 sA7 + 514 sA6 + 5982 sA5 + 36380 sA4 + 122664 sA3 + 2208

8、8 sA2 + 185760 s + 40320 sA8 + 36 sA7 + 546 $八6 + 4536 $人5 + 22449 $人4 + 67284 $人3 + 118124 sA2 + 109584 s + 40320 step(G10) impulse(G,10)单位阶跃响应:单位脉冲响应:线性系统Simulink仿真应用1 .请分析下面传递函数模型阶跃响应。G(s)1s3 2s2 s 2利用Simulink建模,建立系统仿真模型如下:单击启动仿真按钮,双击示波器得到系统的阶跃响应如下:2 .请分析下面离散系统的脉冲响应。、3s3 4s2 1G (s)-22s2 (300s2 60

9、0s 50) 3s 1利用Simulink建模,建立系统仿真模型如下:单击启动仿真按钮,双击示波器得到系统的脉冲响应如下:3 .对离散采样系统进行分析,并求出其阶跃响应其中:G(s)s 3 二2 ZZs 7 s 3s 2利用Simulink建模,建立系统仿真模型如下:Step单击启动仿真按钮,双击示波器得到系统的阶跃响应如下:4 .设计控制器,使得下列系统稳定。(s 1)(s 2.3)(s 3)(s 2)(s 1.2)利用Simulink建模,未连入控制器时,仿真模型和响应如下:25利用Simulink建模,设计控制器:Time offset: 0从响应输出图形可以看出,连入控制器后系统稳定,

10、性能明显提高。四、基于MATLAB 的PID控制器设计设计题目:1.应用Ziegler Nichols算法设计PID控制器,实现系统的闭环稳定,并比较对各个系统的控制效果。G(s)1(s 1)3未连入PID控制器时的系统仿真及其性能指标如下:StepS*1可见,未调节时的系统性能有待提高,需设计输入: num=1;den=conv( 1,1,conv( 1,1,1,1);Step(num,den);K=dcgain (num,den)得出:K =1根据图形,得出:L=1.86T=4.41a. 3LIBM0.2D0510Tirnc offset 0PID控制器连入。15 如利用自定义的 Zieg

11、ler_std函数求出 Kp、Ti、Td输入: K=1;L=1.86;T=4.4;num,den,Kp,Ti,Td=Ziegler_std (3,K,L,T)得出:num =2.64002.83871.5262den =10Kp =2.8387Ti =3.7200Td =0.9300根据得出的Kp、Ti、Td值,设计PID控制器,并利用利用Simulink仿真建模。可见,加入PID控制器调节后,系统性能明显改善。G(s)1(s 1)5未连入PID控制器时的系统仿真及其性能指标如下:号一-0与输入: num=1;den=conv(1,1,conv(1,1,;conv( 1,1,conv( 1,1

12、,1,1 ); Step(num,den);K=dcgain (num,den)得出:K = 1根据图形,得出:L=3.4 T=6.8利用自定义的 Ziegler_std函数求出 Kp、Ti、Td 输入: K=1;L=3.4;T=6.8;num,den,Kp,Ti,Td=Ziegler_std (3,K,L,T)得出:num =4.08002.40000.7059den =1 0Kp =2.4000Ti =6.8000Td =1.7000根据得出的Kp、Ti、Td值,设计PID控制器,并利用利用 Simulink仿真建模。 仿真模型及其响应如下:Time offsM: 0可见,加入PID控制器

13、调节后,系统性能明显改善。-1.5s 1G(s) 3(s 1)3利用Simulink建模,未连入控制器时,仿真模型和响应如下:输入:num=-1.5 1;Time (sec)den=conv( 1,1,conv( 1,1,1,1);Step(num,den);K=dcgain (num,den)得出:K =1根据图形,得出:L=1.8T=5.7利用自定义的 Ziegler_std函数求出Kp、Ti、Td输入: K=1;L=1.8T=5.7;num,den,Kp,Ti,Td=Ziegler_std (3,K,L,T)得出:num =3.42003.80002.1111den =1 0Kp = 3

14、.8000Ti =3.6000Td =0.9000根据得出的Kp、Ti、Td值,设计PID控制器,并利用利用 Simulink仿真建模。 仿真模型及其响应如下:可见,加入PID控制器调节后,系统性能明显改善。五、模糊控制器设计设计任务:试设计一个模糊控制器,实现对室内温度的控制的模拟。参考输入:(1)温度18-40 C范围内分为七个论域,NB NM NS ZE PS PM PB ;隶属度函数满足高斯分布;(2)温度变化率-2 2c范围内分为七个论域,NB NM NS ZE PS PM PB ;隶属度函数满足高斯分布;参考输出:变频空调输出的控制信号。在一定范围内分为七个论域,NB NM NS

15、ZE PS PM PB ,隶属度函数为常数1。模糊推理过程,output=输入隶属度函数值*输出论域的中心值。注:本模糊程序采用PAM控制方式的压缩机,则其车出的转速范围为:010500转/分。控制规则:%if input is NB and errorinput is NB, then output isNB;%if input is NB and errorinput is NM, then output isNB;%if input is NB and errorinput is NS, then output isNB;%if input is NB and errorinput is

16、 ZE, then output isNM;%if input is NB and errorinput is PS, then output isNM;%if input is NB and errorinput is PM, then output isNM;%if input is NB and errorinput is PB, then output isNS;%if input is NM and errorinput is NB, then output isNB;%if input is NM and errorinput is NM, then output isNM;%if

17、 input is NM and errorinput is NS, then output isNM;%if input is NM and errorinput is ZE, then output isNM;%if input is NM and errorinput is PS, then output isNM;%if input is NM and errorinput is PM, then output isNS;%if input is NM and errorinput is PB, then output isNS;%if input is NS and errorinp

18、ut is NB, then output isNM;%if input is NS and errorinput is NM, then output isNS;%if input is NS and errorinput is NS, then output isNS;%if input is NS and errorinput is ZE, then output isNS;%if input is NS and errorinput is PS, then output isNS;%if input is NS and errorinput is PM, then output isZ

19、E;%if input is NS and errorinput is PB, then output isZE;%if input is ZE and errorinput is NB, then output isNS;%if input is ZE and errorinput is NM, then output isZE;%if input is ZE and errorinput is NS, then output isZE;%if input is ZE and errorinput is ZE, then output isZE;%if input is ZE and err

20、orinput is PS, then output isZE;%if input is ZE and errorinput is PM, then output isPS;%if input is ZE and errorinput is PB, then output isPS;%if input is PS and errorinput is NB, then output isZE;%if input is PS and errorinput is NM, then output isPS;%if input is PS and errorinput is NS, then outpu

21、t isPS;%if input is PS and errorinput is ZE, then output isPS;%if input is PS and errorinput is PS, then output isPS;%if input is PS and errorinput is PM, then output isPM;%if input is PS and errorinput is PB, then output isPM;%if input is PM and errorinput is NB, then output isPS;%if input is PM an

22、d errorinput is NM, then output isPS;%if input is PM and errorinput is NS, then output isPM;%if input is PM and errorinput is ZE, then output isPM;%if input is PM and errorinput is PS, then output isPM;%if input is PM and errorinput is PM, then output isPM;%if input is PM and errorinput is PB, then

23、output isPB;%if input is PB and errorinput is NB, then output isPS;%if input is PB and errorinput is NM, then output isPM;%if input is PB and errorinput is NS, then output isPM;%if input is PB and errorinput is ZE, then output isPM;%if input is PB and errorinput is PS, then output isPB;%if input is

24、PB and errorinput is PM, then output isPB;%if input is PB and errorinput is PB, then output isPB;1.输入为 程序为 x1 = (18:0.1:40);y0 = gaussmf(x1, 1 18);y1 = gaussmf(x1, 1 21);y2 = gaussmf(x1, 1 25);y3 = gaussmf(x1, 1 29);y4 = gaussmf(x1, 1 33);y5 = gaussmf(x1, 1 37);y6 = gaussmf(x1, 1 40);plot(x1,y0 y1 y

25、2 y3 y4 y5 y6)2 .误差图:程序为: x1 = (-2:0.1:2);y0 = gaussmf(x1, 0.5 -2);y1 = gaussmf(x1, 0.5 -1.3);y2 = gaussmf(x1, 0.5 -0.7);y3 = gaussmf(x1, 0.5 0);y4 = gaussmf(x1, 0.5 0.7);y5 = gaussmf(x1, 0.5 1.3);y6 = gaussmf(x1, 0.5 2);plot(x1,y0 y1 y2 y3 y4 y5 y6)3 .程序为;x=35;ex=-0.8;% define input type in fuzzy z

26、oney0 = gaussmf(x, 1 18);y1 = gaussmf(x, 1 21);y2 = gaussmf(x, 1 25);y3 = gaussmf(x, 1 29);y4 = gaussmf(x, 1 33);y5 = gaussmf(x, 1 37);y6 = gaussmf(x, 1 40);a=y0 y1 y2 y3 y4 y5 y6;b=max(a);% caculate input in fuzzy zone,get input_type and input_authorityvalueif x=18if b=a(1)type= NB ;authorityvalue=y0;elseif b=a(2)type= NM ;authorityvalue=y1;elseif b=a(3)type= NS ;authorityvalue=y2;elseif b=a(4)type= ZE ;authorityvalue=y3;el

温馨提示

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

评论

0/150

提交评论