close all clear all %Declarando as constantes de modelagem R = ureal ('R', 2, 'Percentage', 40) L = ureal ('L', 0.5,'Percentage', 40) K = ureal ('K', 0.015, 'Range', [0.012 0.019]) Km = K Kb = K Kf = ureal('Kf', 0.2, 'Percentage', 50) %Sistema MIMO % [i % w = H [V % w] % TorqueRotor] % TorqueRotor/(Js)=w H = [1;0;Km] * tf(1,[L R]) * [1 -Kb] + [0 0;0 1;0 -Kf]; %Entrada e saidas do Sistema H.InputName = {'Tensão.Aplicada';'Vel.Angular'}; H.OutputName = {'Corrente';'Vel.Angular';'Torque'}; %Aproximação da inercia J = 0.02*(1 + ultidyn('Jlti',[1 1],'Type','GainBounded','Bound',0.15,'SampleStateDim',4)); %relacionando H e J e construindo SISO M = tf(1,[1 0])/J; Pall = lft(H, M); P = Pall(2,:); Pi=Pall(1,:); figure (1) step(P.NominalValue, 'r-+',usample(P,10),'b',3) legend('valor nominal','amostras') title('Resposta no tempo do sistema') figure (2) bodemag(P.NominalValue, 'r-+',usample(P,10),'b') figure (3) step(Pi.NominalValue, 'r-+',usample(Pi,10),'b',3) legend('valor nominal','amostras') title('Resposta no tempo do sistema') figure (4) bodemag(Pi.NominalValue, 'r-+',usample(Pi,10),'b') J=0.02;R=2;L=0.5;K=0.015;Kf=0.2; s=tf('s'); Gi=(J*s+Kf)/((L*s+R)*(J*s+Kf+K^2)); Gw=K/((J*s+Kf)*(L*s+R)+K^2);