資源簡介
位置式數字PID仿真程序,包括三種實現方法,三個程序和一個PDF文檔

代碼片段和文件信息
%Discrete?PID?control?for?continuous?plant
clear?all;
close?all;
ts=0.001;??%Sampling?time
xk=zeros(21);
e_1=0;
u_1=0;
for?k=1:1:2000
time(k)?=?k*ts;
rin(k)=0.50*sin(1*2*pi*k*ts);
??
para=u_1;??????????????%?D/A
tSpan=[0?ts];
[ttxx]=ode45(‘chap1_6f‘tSpanxk[]para);
xk?=?xx(length(xx):);????%?A/D
yout(k)=xk(1);?
e(k)=rin(k)-yout(k);
de(k)=(e(k)-e_1)/ts;?
u(k)=20.0*e(k)+0.50*de(k);
%Control?limit
if?u(k)>10.0
???u(k)=10.0;
end
if?u(k)<-10.0
???u(k)=-10.0;
end
u_1=u(k);
e_1=e(k);
end
figure(1);
plot(timerin‘r‘timeyout‘b‘);
xlabel(‘time(s)‘)ylabel(‘rinyout‘);
figure(2);
plot(timerin-yout‘r‘);
xlabel(‘time(s)‘)ylabel(‘error‘);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????611249??2018-01-18?19:08??位置式數字PID仿真程序.pdf
?????文件???????1836??2004-06-13?12:08??chap1_8s.m
?????文件????????691??2004-07-03?17:19??chap1_6.m
?????文件????????132??2004-06-13?12:04??chap1_6f.m
?????文件???????8014??2004-06-13?12:06??chap1_7.mdl
?????文件????????266??2004-06-13?12:06??chap1_7f.m
?????文件???????7825??2004-06-13?12:07??chap1_8.mdl
-----------?---------??----------?-----??----
???????????????630013????????????????????7
評論
共有 條評論