Matlab大作业2.docx

上传人:b****2 文档编号:2147396 上传时间:2023-05-02 格式:DOCX 页数:22 大小:407.58KB
下载 相关 举报
Matlab大作业2.docx_第1页
第1页 / 共22页
Matlab大作业2.docx_第2页
第2页 / 共22页
Matlab大作业2.docx_第3页
第3页 / 共22页
Matlab大作业2.docx_第4页
第4页 / 共22页
Matlab大作业2.docx_第5页
第5页 / 共22页
Matlab大作业2.docx_第6页
第6页 / 共22页
Matlab大作业2.docx_第7页
第7页 / 共22页
Matlab大作业2.docx_第8页
第8页 / 共22页
Matlab大作业2.docx_第9页
第9页 / 共22页
Matlab大作业2.docx_第10页
第10页 / 共22页
Matlab大作业2.docx_第11页
第11页 / 共22页
Matlab大作业2.docx_第12页
第12页 / 共22页
Matlab大作业2.docx_第13页
第13页 / 共22页
Matlab大作业2.docx_第14页
第14页 / 共22页
Matlab大作业2.docx_第15页
第15页 / 共22页
Matlab大作业2.docx_第16页
第16页 / 共22页
Matlab大作业2.docx_第17页
第17页 / 共22页
Matlab大作业2.docx_第18页
第18页 / 共22页
Matlab大作业2.docx_第19页
第19页 / 共22页
Matlab大作业2.docx_第20页
第20页 / 共22页
亲,该文档总共22页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

Matlab大作业2.docx

《Matlab大作业2.docx》由会员分享,可在线阅读,更多相关《Matlab大作业2.docx(22页珍藏版)》请在冰点文库上搜索。

Matlab大作业2.docx

Matlab大作业2

Matlab大作业

(2)

(组内成员:

彭超杰、南彦东、江明伟)

一、研究模型

(电车)通过控制油门(保持一定角度)来调节电动机能输出稳定的转速,从而控制车速稳定。

数学依据说明如下:

由图可知存在以下关系:

为反电势常数,

为电动机电磁力矩常数,这里忽略阻尼力矩。

二、数学模型

再看整个研究对象,示意图以课本为依据,不同点是这里将数控的进给运动,转换为汽车行驶所需要的扭矩。

(这里不说明扭矩的具体产生过程,仅仅说明输出车轮旋转的角速度w)

对照课本不同,

变为

为电动机的转速,

为轮胎的转速,

为电动机的光轴齿轮的齿数,

为与轮胎相连光轴的齿轮齿数。

同理,忽略电枢绕组的电感L,简化系统传递函数方框图如下

三、系统分析

1.分析时间响应

其传递函数如下:

(1)系统时间响应

令τ=0、τ=0.0125、τ=0.025,应用impulse函数,可得到系统单位脉冲响应;应用step函数,可得系统单位跃阶响应。

其程序与曲线图像如下:

t=0:

0.001:

1;

%

nG=[109.375];

tao=0;dG=[3.1251+109.375*tao109.375];G1=tf(nG,dG);

tao=0.0125;dG=[3.1251+109.375*tao109.375];G2=tf(nG,dG);

tao=0.025;dG=[3.1251+109.375*tao109.375];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)');

(2)系统的瞬态性能指标

分别计算在τ=0、τ=0.0125、τ=0.025时系统的性能指标.其程序与结果如下:

t=0:

0.001:

1;

yss=1;dta=0.02;

%

nG=[109.375];

tao=0;dG=[3.1251+109.375*tao109.375];G1=tf(nG,dG);

tao=0.0125;dG=[3.1251+109.375*tao109.375];G2=tf(nG,dG);

tao=0.025;dG=[3.1251+109.375*tao109.375];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]

%

subplot(121),plot(T,y1,)

结果:

Τ

上升时间/s

峰值时间/s

最大超调量/%

调整时间

0

0.2710

0.5310

0.9185

1.0000

0.125

0.2770

0.5320

0.8175

1.0000

0.25

0.2850

0.5340

0.7269

1.0000

2.分析系统的频率特性

(1)利用MATLAB绘制Nyquist图

其程序与曲线图像如下:

nunG1=35;

denG1=[10.3235];

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

%

%

plot(re,im);

(2)利用MATLAB绘制Bode图

其程序与曲线图像如下:

nunG1=35;

denG1=[10.3235];;

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

%

bode(nunG1,denG1,w);

(3)利用MATLAB求系统的频域特征量

应用带输出函数的nyquist函数和bode函数,可以得到系统的实频特性、虚频特性、幅频特性,从而得到系统的频域特征量。

其程序与结果如下

numG1=35;denG1=[10.3235];

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

%

[Gm,Pm,w]=bode(numG1,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)

结果

谐振峰值/dBMr=24.2916

峰值频率/s-Wr=5.9948

零频值/dBM0=0.0025

截止频率/s-1Wb=9.5455

(由于模型数据太过繁琐,后续采用书中例题的数据)

3分析系统的稳定性

其程序与结果如下:

clear

K=10;num1=4000*K;

den=conv([10],[0.22002000]);

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

figure

(1);

margin(mag,phase,w);holdon

figure

(2);

sys1=tf(num1,den);

sys=feedback(sys1,1);

step(sys);

[Gm1Pm1Wg1Wc1]=margin(num1,den);

%

K=40;num2=4000*K;

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

figure(3);

margin(mag,phase,w);holdon

figure(4);

sys2=tf(num2,den);

sys=feedback(sys2,1);

step(sys);

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

%

K=600;num3=4000*K;

den=conv([10],[0.22002000]);

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

figure(5);

margin(mag,phase,w);holdon

figure(6);

sys3=tf(num3,den);

sys=feedback(sys3,1);

step(sys);

[Gm3Pm3Wg3Wc3]=margin(num3,den);

[20*log10(Gm1)Pm1Wg1Wc1];

[20*log10(Gm1)Pm2Wg2Wc2];

[20*log10(Gm1)Pm3Wg3Wc3];

 

[33.9794,38.1203,100.0,12.5437;

21.938,18.5503,100.000,27.5315]

四,矫正

绘制矫正后系统的Bode图,检验系统的相对裕度是否符合要求

程序:

clear

>>K=40;num2=4000*K;

den=conv([10],[0.22002000]);

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

figure(3);

margin(mag,phase,w);holdon

figure(4);

sys2=tf(num2,den);

sys=feedback(sys2,1);

step(sys);

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

%

K=40;

num2=4000*K;den=conv([10],[0.22002000]);

%

sys=tf(num2,den);

[mag,phase,w]=bode(sys,w);

gama=45;[mu,pu]=bode(sys,w);

gam=gama*pi/180;

alfa=(1-sin(gam))/(1+sin(gam));

adb=20*log10(mu);am=10*log10(alfa);

ca=adb+am;wc=spline(adb,w,am);

T=1/(wc*sqrt(alfa));

alfa=alfa*T;

Gc=tf([T,1],[alfa,1])

Gc=

0.0554s+1

--------------

0.009506s+1

Continuous-timetransferfunction.

>>K=40;num3=4000*K;den1=conv([10],[0.22002000]);

sys1=tf(num3,den1);

num3=[0.0554,1];den3=[0.009506,1];

sys2=tf(num3,den3);

sys=sys1*sys2;

[mag,phase,w]=bode(sys);

margin(mag,phase,w);

相对裕度=50.4695oC

 

幅值域度=27.1084dB相位裕度=55.1973oC

超前校正后系统的Bode图

系统矫正后,其相当裕度由18.5503o变为50.1973o,幅值裕度由矫正前的21.938dB变为27.1084dB.因此通过相位超前矫正环节后,可使系统性能满足设计要求。

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

当前位置:首页 > 求职职场 > 简历

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

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