Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %open loop response
- s=tf('s')
- num=1;
- t=0:0.01:10
- den=[1 10 20];
- sys=tf(num,den)
- subplot(3,2,1);
- step(sys);
- stepinfo(sys)
- %response with p conroller
- Kp=300;
- sys1=feedback(Kp*sys,1);
- subplot(3,2,2);
- step(sys1);
- stepinfo(sys1)
- %reponse with PI controller
- Ki=500;
- C=Kp+(Ki/s);
- sys2=feedback(C*sys,1);
- subplot(3,2,3);
- step(sys2);
- stepinfo(sys2);
- %response with PD contoller
- Kd=50;
- C1=Kp+(Kd*s);
- sys3=feedback(C1*sys,1);
- subplot(3,2,4);
- step(sys3);
- stepinfo(sys3);
- %PID controller
- C2=Kp+(Ki/s)+(Kd*s);
- sys4=feedback(C2*sys,1);
- subplot(3,2,5);
- step(sys4);
- stepinfo(sys4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement