riccardinofuffolo

Controlli Automatici - Controllore 7/VII/2003

Jun 17th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.26 KB | None | 0 0
  1. clear all
  2. close all
  3. s = tf('s');
  4.  
  5. F1 = 5/s;
  6. F2 = (s+20)/((s+1)*(s+5)^2);
  7. Kr = 1;
  8.  
  9. KF1 = dcgain(s*F1);
  10. KF2 = dcgain(F2);
  11.  
  12. % bode(F1*F2/Kr) Kc positivo
  13. % 1.1.a
  14. errore = 0.05;
  15. Kc1 = Kr^2/(errore*KF1*KF2);
  16.  
  17. % 1.1.b
  18. % effetto1 = 0.01;
  19. % F1 è di tipo 1 -> effetto zero sull'uscita
  20. % 1.1.c
  21. % effetto2 = 0.01;
  22. % Ga è di tipo 1 -> effetto zero sull'uscita
  23.  
  24. Kc = Kc1;
  25.  
  26. % Desiderate
  27. ts = 1;
  28. wb_min = 3/(ts + 0.2*ts); wb_max = 3/(ts - 0.2*ts);
  29. wb = 3/ts;
  30.  
  31. wc_min = 0.63*wb_min; wc_max = 0.63*wb_max;
  32. wc = 1.82;%0.63*wb;
  33.  
  34. MrdB = 2.5;
  35. mphi_min = 60 - 5*(MrdB) + 4;
  36. % Da Nyquist viene circa 40°, qui già aumentato di un fattore di sicurezza
  37.  
  38. % Determinazione parametri da "aggiustare"
  39. Ga1 = Kc*F1*F2/Kr;
  40. [modulo, fase] = bode(Ga1, wc);
  41.  
  42. moddB1 = 20*log10(modulo);
  43. frecu1 = (180 - fase) + mphi_min;
  44.  
  45. % Anticipatrice
  46. md = 3.1;
  47. xd = 1.39;
  48. %figure, bode((1+s)/(1+s/md))
  49. taud = xd / wc;
  50. Rd = (1 + taud*s)/(1 + (taud/md)*s);
  51. Ga2 = Ga1 * Rd^2;
  52.  
  53. [modulo2, fase2] = bode(Ga2, wc);
  54.  
  55. % Attenuatrice
  56. mi = modulo2;
  57. xi = 90;
  58. %figure, bode((1+s/mi)/(1+s))
  59. taui = xi / wc;
  60. Ri = (1 + (taui/mi)*s)/(1 + taui*s);
  61. Ga3 = Ga2 * Ri;
  62.  
  63. margin(Ga3)
  64.  
  65. % Verifica tempo di salita e picco di risonanza
  66. C = Kc*Ri * Rd^2;
  67. W = feedback(C*F1*F2, 1/Kr);
  68.  
  69. step(W)
  70. bode(W)
Advertisement
Add Comment
Please, Sign In to add comment