Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- s = tf('s');
- F1 = (1 + s/0.1)/((1 + s/0.2)*(1 + s/10)); F2 = 1/s; Kr = 1;
- KF1 = dcgain(F1); KF2 = dcgain(s*F2);
- % 1.1.a
- % Già garantita in quanto il sistema è di tipo 1
- % 1.1.b
- % Devo aggiungere un polo nel controllore
- C1 = 1/s;
- errore = 0.16;
- Kcb = Kr^2/(errore*KF1*KF2);
- % 1.1.c
- % Disturbo lungo il ramo diretto, G1 di tipo 1(+1). Effetto nullo.
- % bode(F1*F2*C) -> A stabilità regolare -> Kc positivo
- Kc = Kcb;
- C2 = Kc*C1;
- % Funzione ad anello definita fin qui
- Ga0 = C2*F1*F2/Kr;
- % 1.1.d
- wb = 4;
- wc = 0.63*wb;
- % 1.1.e
- sovra = 0.25;
- MrdB = 20*log10((1 + sovra)/0.9);
- mphi = 60 - 5*(MrdB) + 18; % Con Nichols ottengo poco più di 40°
- [modulo0 fase0] = bode(Ga0, wc);
- deltamodulo = 20*log10(modulo0);
- deltafase = (180 - fase0) + mphi;
- % Anticipatrice
- md = 7;
- xd = 1.14;
- % figure, bode((1+s)/(1+s/md))
- taud = xd/wc;
- Rd = (1 + taud*s)/(1 + (taud/md)*s);
- C3 = C2 * Rd^2;
- Ga1 = Ga0 * Rd^2;
- [modulo1 fase1] = bode(Ga1, wc);
- % Attenuatrice
- mi = modulo1;
- xi = 41;
- % figure, bode((1+s/mi)/(1+s))
- taui = xi/wc;
- Ri = (1 + (taui/mi)*s)/(1 + taui*s);
- C4 = C3 * Ri;
- Ga2 = Ga1 * Ri;
- margin(Ga2)
- % Valutazione soddisfacimento specifiche d/e
- W = feedback(C4*F1*F2, 1/Kr);
- figure, step(W)
- figure, bode(W)
Advertisement
Add Comment
Please, Sign In to add comment