西电电院自动控制技术上机报告Word格式文档下载.doc

上传人:wj 文档编号:8707101 上传时间:2023-05-13 格式:DOC 页数:40 大小:1.99MB
下载 相关 举报
西电电院自动控制技术上机报告Word格式文档下载.doc_第1页
第1页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第2页
第2页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第3页
第3页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第4页
第4页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第5页
第5页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第6页
第6页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第7页
第7页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第8页
第8页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第9页
第9页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第10页
第10页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第11页
第11页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第12页
第12页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第13页
第13页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第14页
第14页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第15页
第15页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第16页
第16页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第17页
第17页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第18页
第18页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第19页
第19页 / 共40页
西电电院自动控制技术上机报告Word格式文档下载.doc_第20页
第20页 / 共40页
亲,该文档总共40页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

西电电院自动控制技术上机报告Word格式文档下载.doc

《西电电院自动控制技术上机报告Word格式文档下载.doc》由会员分享,可在线阅读,更多相关《西电电院自动控制技术上机报告Word格式文档下载.doc(40页珍藏版)》请在冰点文库上搜索。

西电电院自动控制技术上机报告Word格式文档下载.doc

,x(i,1));

disp(result);

速度v=%8.6f\n'

x(i,2));

加速度a=%9.6f\n'

a(i));

时间t=%4.2f\n'

t(i));

d=x(:

1);

subplot(1,3,1),plot(t,d);

%绘制时间-位移曲线

xlabel('

时间(秒)'

ylabel('

位移(米)'

title('

时间-位移曲线'

grid;

v=x(:

2);

subplot(1,3,2),plot(t,v);

%绘制时间-速度曲线

速度(米/秒)'

时间-速度曲线'

subplot(1,3,3),plot(d,v);

%绘制位移-速度曲线

位移-速度曲线'

运行结果:

>

EX11

位移d=1.5000

速度v=-0.000086

加速度a=-0.000084

时间t=4.46

源程序代码:

num=[0,2,5,7];

den=[1,6,10,6];

[z1,p1,k1]=tf2zp(num,den)

[r2,p2,k2]=residue(num,den)

运行结果:

EX12

z1=

-1.2500+1.3919i

-1.2500-1.3919i

p1=

-3.7693+0.0000i

-1.1154+0.5897i

-1.1154-0.5897i

k1=

2

r2=

2.2417+0.0000i

-0.1208-1.0004i

-0.1208+1.0004i

p2=

k2=

[]

clc

a=[6.32231812.811];

b=[161.3221812.811];

sys=tf(a,b);

t=0:

.005:

35;

step(sys)

系统的单位阶跃响应'

[y,t]=step(a,b,t);

r=1;

while(y(r)<

1.001)

r=r+1;

end;

rise_time=(r-1)*0.005%求系统上升时间

[ymax,tp]=max(y);

peak_time=(tp-1)*0.005

k=dcgain(sys);

max_overshoot=(ymax-k)/k

s=7001;

while(y(s)>

0.98&

y(s)<

1.02)

s=s-1;

end

setting_time=(s-1)*0.005

rise_time=

0.7050

peak_time=

34.6100

max_overshoot=

2.6819e+06

setting_time=

35

num=[11];

den=[1560];

sys1=tf(num,den)

subplot(3,1,1)

step(sys1)

subplot(3,1,2)

rlocus(num,den)

系统的根轨迹曲线'

r=rlocus(num,den,20.575)

a=[1];

b=[10.8989];

sys2=tf(a,b)

sys=series(sys1,sys2)%串联

subplot(3,1,3)

35

EX14

sys1=

s+1

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

s^3+5s^2+6s

Continuous-timetransferfunction.

r=

-2.0505+4.3225i-2.0505-4.3225i-0.8989+0.0000i

sys2=

1

----------

s+0.8989

sys=

s+1

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

s^4+5.899s^3+10.49s^2+5.393s

频域分析:

num=[0.01,0.0001,0.01];

dun=[0.25,0.01,1,0,0];

sys=tf(num,dun)

figure

(1)

bode(sys)

figure

(2)

sys2=feedback(sys,1)

bode(sys2)

0.01s^2+0.0001s+0.01

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

0.25s^4+0.01s^3+s^2

0.01s^2+0.0001s+0.01

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

0.25s^4+0.01s^3+1.01s^2+0.0001s+0.01

num=[0202010];

%开环传递函数分子

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

%开环传递函数的分母

nyquist(num,den)

%v=[-23-3];

axis([-22-33])

grid

x=-pi:

0.01:

pi;

plot(x,sin(x)),gridon

num=[2000,2000];

%开环传递函数的分子

den=conv([10.50],[114400]);

%开环传递函数的分母

nichols(num,den)%绘制nichols图

v=[-270-90-4040];

axis(v)

ngrid%标出nichols图线

num=[020002000];

den=conv([10.50],[114400]);

h=tf(num,den);

[gm,pm,wg,wc]=margin(h);

gm,pm,wg,wc

EX24

gm=

2.7493

pm=

73.3527

wg=

19.8244

wc=

5.3477

num=[1];

den=[0.51.510];

sys=tf(num,den)

[gmpmwgwp]=margin(sys)

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

0.5s^3+1.5s^2+s+1

3.0000

32.6133

1.4142

wp=

0.7494

现代控制理论

%3.1_A

num=[123];

%传递函数分子多项式的系数

den=[1331];

%传递函数分母多项式的系数

[A,B,C,D]=tf2ss(num,den)

%3.1_B

z=[-1;

-3];

%传递函数的零点

p=[0;

-2;

-4;

-6;

];

%传递函数的极点

k=4;

[A,B,C,D]=zp2ss(z,p,k)

%3.1_C

A=[0,1;

-1,-2];

B=[0;

1];

C=[1,3];

D=[1];

[num,den]=ss2tf(A,B,C,D)

printsys(num,den,'

s'

[z,p,k]=ss2zp(A,B,C,D)

EX31

A=

-3-3-1

100

010

B=

1

0

C=

123

D=

-10.0000-4.899000

4.8990000

-6.0000-4.2866-2.00000

001.00000

0004

num=

1.00005.00002.0000

den=

121

num/den=

s^2+5s+2

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

s^2+2s+1

z=

-0.4384

-4.5616

p=

-1

k=

A1=[0,1;

B1=[0;

C1=[1,3];

D1=[1];

A2=[0,1;

-1,-3];

B2=[0;

C2=[1,4];

D2=[0];

[A,B,C,D]=series(A1,B1,C1,D1,A2,B2,C2,D2)

[A,B,C,D]=parallel(A1,B1,C1,D1,A2,B2,C2,D2)

[A,B,C,D]=feedback(A1,B1,C1,D1,A2,B2,C2,D2)

[A,B,C,D]=feedback(A1,B1,C1,D1,A2,B2,C2,D2,+1)

EX32

0100

-1-313

0001

00-1-2

1400

-1-200

00-1-3

1314

-1-2-1-4

13-2-7

13-1-4

-1-214

1301

clc;

A=[0-2;

1-3];

t=0.2;

Phi=expm(A*t);

%求状态转移矩阵

B=[2;

0];

C=[03];

D=[0];

x0=[11];

t=[00.2];

u=0*t;

[y,x]=lsim(A,B,C,D,u,t,x0)%求系统响应

y=

2.0110

x=

1.00001.0000

0.67030.6703

A=[-31;

B=[11;

11];

C=[11;

1-1];

D=[00;

00];

N=size(A);

n=N

(1);

[num,den]=ss2tf(A,B,C,D,2);

可控矩阵:

'

S=ctrb(A,B)

f=rank(S)

if(f==n)

disp('

系统是可控的'

else

系统是不可控的'

可观测矩阵:

V=obsv(A,C)

m=rank(V)

系统时可观测的'

系统是不可观测的'

S=

11-2-2

f=

系统是不可控的

V=

11

1-1

-2-2

-44

m=

系统是不可观测的

A=[01;

-2-3];

B=[0;

C=[20];

D=0;

P_S=[-1-2];

k=acker(A,B,P_S);

P_O=[-3-3];

h=(acker(A'

C'

P_O));

A1=[A,-B*k;

h*CA-B*k-h*C];

B1=[B;

B];

C1=[C,zeros(1,2)];

D1=0;

sys=ss(A1,B1,C1,D1)

tf(sys)

校正设计

ts=0.001;

sys=tf([400],[1,50,0]);

dsys=c2d(sys,ts,'

z'

[num,den]=tfdata(dsys,'

v'

u_1=0.0;

u_2=0.0;

y_1=0.0;

y_2=0.0;

x=[0,0,0]'

;

error_1=0;

error_2=0;

fork=1:

1:

1000

time(k)=k*ts;

kp=8;

ki=0.1;

kd=10;

rin(k)=0.5*sin(2*pi*k*ts);

du(k)=kp*x

(1)+kd*x

(2)+ki*x(3);

u(k)=u_1+du(k);

yout(k)=-den

(2)*y_1-den(3)*y_2+num

(2)*u_1+num(3)*u_2;

error(k)=rin(k)-yout(k);

u_2=u_1;

u_1=u(k);

y_2=y_1;

y_1=yout(k);

x

(1)=error(k)-error_1;

x

(2)=error(k)-2*error_1+error_2;

x(3)=error(k);

error_2=error_1;

error_1=error(k);

figure

(1);

plot(time,rin,'

b'

time,yout,'

r'

),gridon

gtext('

rin\rightarrow'

\leftarrowyout'

系统输出曲线'

time(s)'

),ylabel('

rin,yout'

figure

(2);

plot(time,error,'

误差曲线'

error'

注:

输入信号为正弦,采样信号为1ms。

ts=20;

sys=tf([1],[60,1],'

inputdelay'

80);

u_1=0;

u_2=0;

u_3=0;

u_4=0;

u_5=0;

y_1=0;

y_2=0;

y_3=0;

ei=0;

200

rin(k)=40;

kp=0.80;

ki=0.005;

kd=3.0;

yout(k)=-den

(2)*y_1+num

(2)*u_5;

M=2;

ifM==1

ifabs(error(k))>

=30&

abs(errpr(k))<

=40

beta=0.3;

elseifabs(error(k))>

=20&

abs(error(k))<

=30

beta=0.6;

=10&

=20

beta=0.9;

else

beta=1.0;

end

elseifM==2

beta=1.0;

ei=ei+error(k)*ts;

u(k)=kp*error(k)+kd*(error(k)-error_1)/ts+beta*ki*ei;

ifu(k)>

=110

u(k)=110;

ifu(k)<

=-110

u(k)=-110;

u_5=u_4;

u_4=u_3;

u_3=u_2;

u_2=u_1;

y_3=y_2;

y_2=y_1;

time,yout,

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

当前位置:首页 > 高等教育 > 军事

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

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