Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- s = tf('s');
- F1 = 5/s;
- F2 = (s+20)/((s+1)*(s+5)^2);
- Kr = 1;
- KF1 = dcgain(s*F1);
- KF2 = dcgain(F2);
- % bode(F1*F2/Kr) Kc positivo
- % 1.1.a
- errore = 0.05;
- Kc1 = Kr^2/(errore*KF1*KF2);
- % 1.1.b
- % effetto1 = 0.01;
- % F1 è di tipo 1 -> effetto zero sull'uscita
- % 1.1.c
- % effetto2 = 0.01;
- % Ga è di tipo 1 -> effetto zero sull'uscita
- Kc = Kc1;
- % Desiderate
- ts = 1;
- wb_min = 3/(ts + 0.2*ts); wb_max = 3/(ts - 0.2*ts);
- wb = 3/ts;
- wc_min = 0.63*wb_min; wc_max = 0.63*wb_max;
- wc = 1.82;%0.63*wb;
- MrdB = 2.5;
- mphi_min = 60 - 5*(MrdB) + 4;
- % Da Nyquist viene circa 40°, qui già aumentato di un fattore di sicurezza
- % Determinazione parametri da "aggiustare"
- Ga1 = Kc*F1*F2/Kr;
- [modulo, fase] = bode(Ga1, wc);
- moddB1 = 20*log10(modulo);
- frecu1 = (180 - fase) + mphi_min;
- % Anticipatrice
- md = 3.1;
- xd = 1.39;
- %figure, bode((1+s)/(1+s/md))
- taud = xd / wc;
- Rd = (1 + taud*s)/(1 + (taud/md)*s);
- Ga2 = Ga1 * Rd^2;
- [modulo2, fase2] = bode(Ga2, wc);
- % Attenuatrice
- mi = modulo2;
- xi = 90;
- %figure, bode((1+s/mi)/(1+s))
- taui = xi / wc;
- Ri = (1 + (taui/mi)*s)/(1 + taui*s);
- Ga3 = Ga2 * Ri;
- margin(Ga3)
- % Verifica tempo di salita e picco di risonanza
- C = Kc*Ri * Rd^2;
- W = feedback(C*F1*F2, 1/Kr);
- step(W)
- bode(W)
Advertisement
Add Comment
Please, Sign In to add comment