Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- clc;
- s=tf('s');
- F1=5/s; %h=1
- F2=(s+20)/((s+1)*(s+5)^2); %h=0
- K1=dcgain(s*F1);
- K2=dcgain(F2);
- Kr=1;
- d1=0.5;
- alpha2=0.1;
- %% SPECIFICHE STATICHE
- Kca=Kr/(0.05*K1*K2);
- Kcc=0.1/(0.01*K1*K2);
- Kc=5;
- %% SPECIFICHE DINAMICHE
- ts=1; % compreso tra 0.8 e 1.2
- wBmin=3/ts;
- wcd=0.63*wBmin %compreso tra 1.51 e 2.27
- Mrdb=2.5;
- mp_min=60-5*Mrdb
- %% Inserimento reti
- Ga=Kc*F1*F2;
- figure,bode(F1*F2);
- [m0,f0]=bode(Ga,wcd)
- %bode a -188, scelgo di recuperare 10+50=circa 60 gradi
- md1=4;
- xd1=1;
- taud1=xd1/wcd;
- Rd1=(1+taud1*s)/(1+s*taud1/md1);
- Ga2=Ga*Rd1^2;
- [m2,f2]=bode(Ga2, wcd)
- %rete attenuatrice da 8.2
- mi=8.2;
- mi_db=20*log10(mi)
- bode((1+s/mi)/(1+s))
- xi=150;
- taui=xi/wcd;
- Ri = (s*taui/mi+1)/(s*taui+1);
- Ga3=Ga2*Ri;
- [m2,f2]=bode(Ga3, wcd)
- figure,margin(Ga3);
- Cs=Kc*Rd1^2*Ri;
- Wy=feedback(Cs*F1*F2, 1/Kr);
- figure,bode(Wy);
- figure,step(Wy);
- Werr=feedback(Ga3,1)
- Err_perm=dcgain(s*Werr*1/s^2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement