资源描述
现代机械控制工程仿真实验
实验报告
现代机械控制工程仿真实验
实验一
1.比例环节:G(s)=k k=12
num=[12]; num=[12];
den=[1]; den=[1];
t=[0:0.1:10]; t=[0:0.1:10];
y=impluse(num,den,t); y=step(num,den,t);
plot(t,y); plot(t,y);
grid on grid on
积分环节:G(s)=1/s
num=[1]; num=[1];
den=[1,0]; den=[1,0];
t=[0:0.1:10]; t=[0:0.1:10];
y=impluse(num,den,t); y=step(num,den,t);
plot(t,y); plot(t,y);
grid on grid on
微分环节:G(s)=s num=[1,0];den=[1]
num=[1,0]; num=[1,0];
den=[1]; den=[1];
t=[0:0.1:10]; t=[0:0.1:10];
y=impluse(num,den,t); y=step(num,den,t);
plot(t,y); plot(t,y);
grid on grid on
不存在
惯性环节: G(s)=1/(Ts+1) T取2
num=[1]; num=[1];
den=[2,1]; den=[2,1];
t=[0:0.1:10]; t=[0:0.1:10];
y=impluse(num,den,t); y=step(num,den,t);
plot(t,y); plot(t,y);
grid on grid on
二阶振荡系统:
G(s)=50/((0.05s^2+(1+50T)s+50) T取1
num=[50]; num=[50];
den=[0.05,51,50]; den=[0.05,51,50];
t=[0:0.1:10]; t=[0:0.1:10];
y=impluse(num,den,t); y=step(num,den,t);
plot(t,y); plot(t,y);
grid on grid on
Simulink练习:
实验二
例1
系统模型如下所示,判断系统的稳定性,以及系统是否为最小相位系统。
num=[3,16,41,28];
den= [1,14,110,528,1494,2117,112];
G=tf(num,den);
sys=zpk(G);
pzmap(sys)
clc;
clear;
close all;
num=[20];
den=[1 8 36 40 0];
[numc,denc]=cloop(num,den);
t=0:0.1:10;
y=step(numc,denc,t);
[y1,x,t1]=step(numc,denc);
plot(t,y,'r:',t1,y1);
title('the step responce');
xlabel('time-sec');
disp(‘稳态值dc为');
dc=dcgain(numc,denc)
clc;
clear;
close all;
num=[20];
den=[1 8 36 40 0];
[numc,denc]=cloop(num,den);
t=0:0.1:10;
y=impulse(numc,denc,t);
[y1,x,t1]=impulse(numc,denc);
plot(t,y,'r:',t1,y1);
title('the impulse responce');
xlabel('time-sec');
disp(‘稳态值dc为');
dc=dcgain(numc,denc)
clc;
clear;
close all;
num=[25];
den=[1 6 25];
t=0:0.1:10;
y=step(num,den,t);
[y1,x,t1]=step(num,den);
plot(t,y,'r:',t1,y1);
title('the step responce');
xlabel('time-sec');
disp(‘稳态值dc为');
dc=dcgain(num,den)
clc;
clear;
close all;
num=[10 25];
den=[0.16 1.96 10 25];
[numc,denc]=cloop(num,den);
t=0:0.1:10;
y=step(numc,denc,t);
[y1,x,t1]=step(numc,denc);
plot(t,y,'r:',t1,y1);
title('the step responce');
xlabel('time-sec');
disp(‘稳态值dc为');
dc=dcgain(numc,denc)
clear
clc
close all
%输入期望的超调量及峰值时间
pos=40('input please input expect pos(%)=');
tp=0.8('please input expect tp=');
z=log(100/pos)/sqrt(pi^2+(log(100/pos))^2);
wn=pi/(tp*sqrt(1-z^2));
num=wn^2;
den=[1 2*z*wn wn^2];
t=0:0.02:4;
y=step(num,den,t);
plot(t,y)
xlabel('time-sec')
ylabel('y(t)')
grid
d=wn^2
e=(2*z*wn-1)/d
D=16.7331,E=0.0771
clc; clc;
clear; clear;
close all; close all;
num=[20]; num=[20];
den=[1 8 36 40 0]; den=[1 8 36 40 0];
[numc,denc]=cloop(num,den); [numc,denc]=cloop(num,den);
nyquist(numc,denc) bode(numc,denc)
实验三
1.Simulink 进行控制系统的仿真
对于单位负反馈系统,如果开环传递函数为:
2. 利用simulink对系统建模:
课本P115中3.9:
3. 利用simulink分析稳态误差:
K=0.1
K=10
展开阅读全文