Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.08 KB | None | 0 0
  1. %part A
  2. %%
  3. %q1
  4. J=200;
  5. B=150;
  6. tao=0.2;
  7. K=1; %for simulink diagram only
  8. %%
  9. %q3
  10. s=tf('s')
  11. G_motor=55/(tao*s+1);
  12. G_antenna=1/(J*s^2+B*s);
  13. G=G_motor*G_antenna
  14. figure(1)
  15. rlocus(G);
  16. grid on
  17. %%
  18. %q4
  19. a=(0.2*s+1)/(40*s^3+230*s^2+150*s+55);
  20. figure(2)
  21. bode(a)
  22. grid on
  23.  
  24. C=(6*(5.3*s+1)*(s+1)*(0.19*s+1))/(s*(1+0.01*s)*(1+0.02*s));
  25. GC_cl=minreal(G*C/(1+G*C));%H=1
  26. q5poles=pole(GC_cl)
  27. G_diturbance = G_antenna/(1+C*G);%H=1
  28. figure(3)
  29. bode(G_diturbance)
  30. grid on
  31. %%
  32. %q7+8
  33. stepinfo(out.simout.Data,out.simout.time,'SettlingTimeThreshold',0.05)
  34. %%
  35. % part B
  36. %q1
  37. B_max=1.1*B;
  38. B_min=0.9*B;
  39. J_max=1.1*J;
  40. J_min=0.9*J;
  41. G2=[1/(J_max*s^2+B_max*s) 1/(J_max*s^2+B_min*s) 1/(J_min*s^2+B_max*s) 1/(J_min*s^2+B_min*s)];
  42. for i=1:4
  43.     G=G_motor*G2(i);
  44.     G_diturbance2(i) = G2(i)/(1+C*G);%H=1
  45.     figure(i+3)
  46.     bode(G_diturbance2(i))
  47.     grid on
  48. end  
  49. %%
  50. %q3
  51. sti=stepinfo(out.simout.Data,out.simout.time,'SettlingTimeThreshold',0.05);
  52. if sti.RiseTime<0.3 && sti.SettlingTime<3  && sti.Overshoot<10 %find which variance the system can manage
  53.     check='ok'
  54. else
  55.     check='no'
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement