Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.64 KB | None | 0 0
  1. %q1=dlmread('D:\F19\MTE360\Lab1\Lab 1\lab1_q2_0_3.txt')
  2. %q1=dlmread('D:\F19\MTE360\Lab1\Lab 1\lab1_q2_0_6.txt')
  3. q1=dlmread('D:\F19\MTE360\Lab1\Lab 1\lab1_q2_2_1.txt')
  4.  
  5. %W_n=19.368;
  6. %Z=0.210;
  7.  
  8. %W_n=27.391;
  9. %Z=0.148;
  10.  
  11. W_n=51.243;
  12. Z=0.079;
  13.  
  14. figure(2)
  15. subplot(2,1,1);
  16. plot(q1(:,[1]),q1(:,[2]))
  17. hold on
  18. plot(q1(:,[1]),q1(:,[4]))
  19. xlim([0 4])
  20. ylim([-2 2])
  21. legend({'Measured', 'Command'})
  22. title('Closed Loop Position Step Response Kp=0.6');
  23. ylabel('Position [mm]');
  24. xlabel('Time [s]');
  25.  
  26. subplot(2,1,2);
  27. plot(q1(:,[1]),q1(:,[3]))
  28. xlim([0 4])
  29. ylim([-5 5])
  30. title('Control');
  31. ylabel('Control [V]');
  32. xlabel('Time [s]');
  33. legend({'Input'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement