Advertisement
SubhamRath

expt_5

Oct 13th, 2020 (edited)
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.60 KB | None | 0 0
  1. %open loop response
  2.  
  3. s=tf('s')
  4. num=1;
  5. t=0:0.01:10
  6. den=[1 10 20];
  7. sys=tf(num,den)
  8. subplot(3,2,1);
  9. step(sys);
  10. stepinfo(sys)
  11. %response with p conroller
  12.  
  13. Kp=300;
  14. sys1=feedback(Kp*sys,1);
  15. subplot(3,2,2);
  16. step(sys1);
  17. stepinfo(sys1)
  18.  
  19. %reponse with PI controller
  20.  
  21. Ki=500;
  22. C=Kp+(Ki/s);
  23. sys2=feedback(C*sys,1);
  24. subplot(3,2,3);
  25. step(sys2);
  26. stepinfo(sys2);
  27.  
  28. %response with PD contoller
  29.  
  30. Kd=50;
  31. C1=Kp+(Kd*s);
  32. sys3=feedback(C1*sys,1);
  33. subplot(3,2,4);
  34. step(sys3);
  35. stepinfo(sys3);
  36.  
  37. %PID controller
  38.  
  39. C2=Kp+(Ki/s)+(Kd*s);
  40. sys4=feedback(C2*sys,1);
  41. subplot(3,2,5);
  42. step(sys4);
  43. stepinfo(sys4);
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement