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
- 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;
- % Funzione ad anello definita fin qui
- Ga0 = Kc*F1*F2/(s*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) ; % Con Nichols ottengo poco più di 40°
- [modulo0 fase0] = bode(Ga0, wc);
- deltamodulo = 20*log10(modulo0);
- deltafase = (180 - fase0) + mphi + 15;
- % Rete PI
- xz = 3.84;
- tauz = xz/wc;
- %bode(1+s)
- Cz = (1 + tauz*s);
- Ga1 = Ga0 * Cz;
- [modulo1 fase1] = bode(Ga1, wc);
- % Attenuatrice
- mi = modulo1;
- xi = 75;
- taui = xi/wc
- %figure, bode((1+s/mi)/(1+s))
- Ri = (1 + (taui/mi)*s)/(1 + taui*s);
- Ga2 = Ga1 * Ri;
- margin(Ga2)
- W = feedback(Kc*F1*F2*Cz*Ri/s, 1/Kr);
- step(W)
- bode(W)
Advertisement
Add Comment
Please, Sign In to add comment