机械工程控制基础实验1.docx

上传人:b****2 文档编号:2319108 上传时间:2023-05-03 格式:DOCX 页数:11 大小:88.07KB
下载 相关 举报
机械工程控制基础实验1.docx_第1页
第1页 / 共11页
机械工程控制基础实验1.docx_第2页
第2页 / 共11页
机械工程控制基础实验1.docx_第3页
第3页 / 共11页
机械工程控制基础实验1.docx_第4页
第4页 / 共11页
机械工程控制基础实验1.docx_第5页
第5页 / 共11页
机械工程控制基础实验1.docx_第6页
第6页 / 共11页
机械工程控制基础实验1.docx_第7页
第7页 / 共11页
机械工程控制基础实验1.docx_第8页
第8页 / 共11页
机械工程控制基础实验1.docx_第9页
第9页 / 共11页
机械工程控制基础实验1.docx_第10页
第10页 / 共11页
机械工程控制基础实验1.docx_第11页
第11页 / 共11页
亲,该文档总共11页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

机械工程控制基础实验1.docx

《机械工程控制基础实验1.docx》由会员分享,可在线阅读,更多相关《机械工程控制基础实验1.docx(11页珍藏版)》请在冰点文库上搜索。

机械工程控制基础实验1.docx

机械工程控制基础实验1

机械工程控制基础实验报告1

第三章实验:

MATLAB分析时间响应利用

一、利用MATLAB求系统的时间相应

源程序:

clearall;

t=[0:

0.01:

0.8];

%

nG=[50];

tao=0;dG=[0.051+50*tao50];G1=tf(nG,dG);

tao=0.0125;dG=[0.051+50*tao50];G2=tf(nG,dG);

tao=0.025;dG=[0.051+50*tao50];G3=tf(nG,dG)

%

[y1,T]=impulse(G1,t);[y1a,T]=step(G1,t);

[y2,T]=impulse(G2,t);[y2a,T]=step(G2,t);

[y3,T]=impulse(G3,t);[y3a,T]=step(G3,t);

%

subplot(121),plot(T,y1,'--',T,y2,'-.',T,y3,'-')

legend('tao=0','tao=0.0125','tao=0.025')

xlabel('t(sec)'),ylabel('x(t)');gridon;

subplot(122),plot(T,y1a,'--',T,y2a,'-.',T,y3a,'-')

legend('tao=0','tao=0.0125','tao=0.025')

gridon;xlabel('t(sec)'),ylabel('x(t)');

输出曲线:

单位脉冲相应曲线单位阶跃响应曲线

一、利用MATLAB求系统的瞬态性能指标

源程序:

clearall;

t=[0:

0.01:

1];u=sin(2*pi.*t);

%

tao=0.025;

nG=[50];dG=[0.051+50*tao50];G=tf(nG,dG);

%

y=lsim(G,u,t);

%

plot(t,u,'-.',t,y,'-',t,u'-y,'-.','linewidth',1)

legend('u(t)','xo(t)','e(t)')

grid;xlabel('t(sec)'),ylabel('x(t)');

输出曲线:

系统响应及其误差曲线

源程序:

closeall;

%

t=0:

0.001:

1;

%

yss=1;dta=0.02;

%

nG=[50];

tao=0;dG=[0.051+50*tao50];G1=tf(nG,dG);

tao=0.0125;dG=[0.051+50*tao50];G2=tf(nG,dG);

tao=0.025;dG=[0.051+50*tao50];G3=tf(nG,dG);

y1=step(G1,t);y2=step(G2,t);y3=step(G3,t);

%

r=1;whiley1(r)

tr1=(r-1)*0.001;

%

[ymax,tp]=max(y1);tp1=(tp-1)*0.001;

%

mp1=(ymax-yss)/yss;

%

s=1001;whiley1(s)>1-dta&y1(s)<1+dta;s=s-1;end

ts1=(s-1)*0.001;

%

r=1;whiley2(r)

tr2=(r-1)*0.001;[ymax,tp]=max(y2);

tp2=(tp-1)*0.001;mp2=(ymax-yss)/yss;

s=1001;whiley2(s)>1-dta&y3(s)<1+dta;s=s-1;end

ts2=(s-1)*0.001;

%

r=1;whiley3(r)

tr3=(r-1)*0.001;[ymax,tp]=max(y3);

tp3=(tp-1)*0.001;mp3=(ymax-yss)/yss;

s=1001;whiley3(s)>1-dta&y3(s)<1+dta;s=s-1;end

ts3=(s-1)*0.001

%

[tr1tp1mp1ts1;tr2tp2mp2ts2;tr3tp3mp3ts3]

输出系统在不同tao值的瞬态性能指标:

ts3=

0.1880

ans=

0.06400.10500.35090.3530

0.07800.11600.15230.2500

0.10700.14100.04150.1880

第四章实验:

利用MATLAB分析频率特性

一、利用MATLAB绘制Nyquist图

源程序:

k=24;nunG1=k*[0.250.5];

denG1=conv([52],[0.052]);

%

[re,im]=nyquist(nunG1,denG1);

%

plot(re,im);grid

pause

w=logspace(-2,3,100);

bode(nunG1,denG1,w);

输出曲线:

二、利用MATLAB绘制Bode图

源程序:

k=24;nunG1=k*[0.250.5];

denG1=conv([52],[0.052]);

%

w=logspace(-2,3,100);

%

bode(nunG1,denG1,w);

输出曲线:

三、利用MATLAB求系统的频域特征量

源程序:

nunG1=200;denG1=[18100];

w=logspace(-1,3,100);

%

[Gm,Pm,w]=bode(nunG1,denG1,w);

%

[Mr,k]=max(Gm);

Mr=20*log10(Mr);Wr=w(k);

%

M0=20*log10(Gm

(1));

%

n=1;while20*log10(Gm(n))>=-3;n=n+1;end

Wb=w(n);

%

[M0WbMrWr]

输出的频域特征量:

ans=

6.021220.09238.69427.9248

第五章实验:

利用MATLAB分析系统的稳定性

一、利用MATLAB分析系统的相对稳定性

源程序:

den=conv([15],[110]);

K=10;num1=[K];

%

[Gm1Pm1Wg1Wc1]=margin(num1,den);

%

K=100;num2=[K];

[mag,phase,w]=bode(num2,den);

[Gm2Pm2Wg2Wc2]=margin(mag,phase,w);

[20*log10(Gm1)Pm1Wg1Wc1;20*log10(Gm2)Pm2Wg2Wc2]

输出计算结果:

ans=

6.021220.09238.69427.9248

>>

ans=

9.542425.38982.23611.2271

-10.4576-23.54632.23613.9010

第六章实验:

利用MATLAB进行系统校正

一、未校正前的Bode图曲线

源程序:

k=20;numg=[1];deng=[0.510];

[num,den]=series(k,1,numg,deng);

%

w=logspace(-1,2,200);

[mag,phase,w]=bode(tf(num,den),w);

[Gm,Pm,Wcg,Wcp]=margin(mag,phase,w);

%

Phi=(50-Pm+5)*pi/180;

%

alpha=(1-sin(Phi))/(1+sin(Phi));

%

M=10*log10(alpha)*ones(length(w),1);

semilogx(w,20*log10(mag(:

)),w,M);grid;

输出曲线:

二、校正后的Bode图曲线

源程序:

k=20;

%

numg=[1];deng=[0.510];

%

numgc=[0.231];dengc=[0.0551];

%

[nums,dens]=series(numgc,dengc,numg,deng);

%

[num,den]=series(k,1,nums,dens);

%

w=logspace(-1,2,200);

[mag,phase,w]=bode(tf(num,den),w);

[Gm,Pm,Wcg,Wcp]=margin(mag,phase,w);

bode(tf(num,den),w);

grid;

title(['相位裕度=',num2str(Pm)]);

输出曲线:

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

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2