Advertisement
Guest User

20020715

a guest
Jul 17th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.33 KB | None | 0 0
  1. clear all
  2. close all
  3. clc
  4.  
  5. s = tf('s');
  6. d = 1.5;
  7. Kr = 1;
  8.  
  9. F1 = (1 + s / 0.1)/((1 + s / 0.2)*(1 + s / 10));
  10. F2 = 1/s;
  11. % pole(F1)
  12. % pole(F2)
  13. Kf1 = dcgain(F1);
  14. Kf2 = dcgain(s*F2);
  15.  
  16. Kc1 = 1/0.16*Kr^2/(Kf1*Kf2);
  17. %Kc2 = 1/0.05*Kr/(Kf1); %soddisfatta perchè h=1
  18. %Kcmin = max(Kc1,Kc2);
  19. h=1;
  20.  
  21. % figure()
  22. % bode(F1*F2/s)
  23. % zpk(F1*F2) % Kc > 0
  24. Kc = Kc1;
  25.  
  26. wcdes = 0.63*4;
  27. wcdes = 2.2;
  28. Mr = (1+0.25)/0.9;
  29. Mrdb = 20*log10(Mr);
  30. mphi = 60-5*Mrdb;
  31.  
  32. Ga1 = Kc/s^h*F1*F2/Kr;
  33. % figure
  34. % bode(Ga1)
  35. deltaphi = 192-180+mphi;
  36. deltadb = 5.61;
  37.  
  38. md0 = 3;
  39. Rd0 = (1+s)/(1+s/md0);
  40. % figure()
  41. % bode(Rd0)
  42. xd0 = sqrt(md0); %aumento modulo 3.37
  43. taud0=xd0/wcdes;
  44. Rdt0 = (1+s*taud0)/(1+s*taud0/md0);
  45.  
  46. md = 4;
  47. Rd = (1+s)/(1+s/md);
  48. % figure()
  49. % bode(Rd)
  50. xd = 1.35; %aumento modulo 3.37
  51. taud=xd/wcdes;
  52. Rdt = (1+s*taud)/(1+s*taud/md);
  53.  
  54. Ga2 = Ga1*Rdt^2;
  55. % figure()
  56. % bode(Ga2), title Ga2
  57. %recuperato 66 di fase, da recuperare 12.3 di modulo
  58. %
  59. [mi,phii] = bode(Ga2, wcdes);
  60. % mi = mi*1.1;
  61. Ri = (1+s/mi)/(1+s);
  62. % figure()
  63. % bode(Ri)
  64. xi = 100; %90 38
  65. taui = xi/wcdes;
  66. Rit= (1+s*taui/mi)/(1+s*taui);)
  67. Ga3 = Ga2*Rit;
  68. % figure
  69. % bode(Ga3)
  70. % figure
  71. % margin(Ga3)
  72.  
  73. C = Kc/s*Rdt^2*Rit;
  74. W = feedback(C*F1*F2, 1/Kr);
  75.  
  76. % figure()
  77. % step(W), title overshoot %os = 23.4
  78. % figure()
  79. % bode(W), title wwb % wb=4.36 con wcdes modificata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement