相关代码 |
|
% 设计P、PI、PID控制器 G=tf(10,[1,10,35,50,24]); [k,L,T]=getfod(G); [Gc1,Kp1]=cohen(1,[k,L,T,10]);[Kp1] [Gc2,Kp2,Ti2]=cohen(2,[k,L,T,10]);[Kp2,Ti2] [Gc3,Kp3,Ti3,Td3]=cohen(3,[k,L,T,10]);[Kp3,Ti3,Td3] [Gc4,Kp4,Ti4,Td4]=cohen(4,[k,L,T,10]);[Kp4,Td4] t=0:0.1:10; G_c1=feedback(G*Gc1,1);y=step(G_c1,t); G_c2=feedback(G*Gc2,1);y=[y step(G_c2,t)]; G_c3=feedback(G*Gc3,1);y=[y step(G_c3,t)]; G_c4=feedback(G*Gc4,1);y=[y step(G_c4,t)]; plot(t,y)
相关资源 |
|