% % Loop Shaping % % SEM 5928 - Sistemas de Controle % Escola de Engenharia de São Carlos - USP % % Adriano Siqueira - 2016 % clear all close all n=[200]; d=[10 1]; d=conv(d,[0.05 1]); d=conv(d,[0.05 1]); G=tf(n,d) Gd = tf(100,[10 1]); n=10*[10 1]; n=conv(n,[0.1 1]); d=200*[1 0]; d=conv(d,[0.01 1]); K1 = tf(n,d); L1 = G*K1; figure(1);bode(L1) title('Malha Aberta - G(s)*K(s)') hold on grid T1 = feedback(L1,1) figure(2);step(T1) title('Referência') hold on S1 = 1 - T1; grid figure(3);step(S1*Gd,3) title('Distúrbio') hold on grid pause %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% K2 = tf(0.5*[1 2],[1 0]); L2 = G*K2; figure(1);bode(L2) T2 = feedback(L2,1) figure(2);step(T2) S2 = 1 - T2; figure(3);step(S2*Gd,3) pause %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% K3 = tf(0.5*conv([1 2],[0.05 1]),conv([1 0],[0.005 1])); L3 = G*K3; figure(1);bode(L3) T3 = feedback(L3,1) figure(2);step(T3) S3 = 1 - T3; figure(3);step(S3*Gd,3)