You are on page 1of 6

>> H=tf([1 3],[1 5 9 5]);

pp=pole(H)

dt=0.05;

t=0:dt:8;

pp =

-2.0000 + 1.0000i

-2.0000 - 1.0000i

-1.0000

>> y=step(H,t)';

>> dy=diff(y)/dt;

>> [m,p]=max(dy);

>> d2y=diff(dy)/dt;

>> yi=y(p);

>> ti=t(p);

>> L=ti-yi/m;

>> Tau=(y(end)-yi)/m+ti-L;

>> plot(t,y,'b',[0 L L+Tau t(end)],[0 0 y(end) y(end)],'K')

>>

>> title('Respuesta al escalon')

>> ylabel('Amplitud')

xlabel('tiempo (s)')

legend('Exacta','Aproximacion Lineal')
>>

>> Kp=1.2*Tau/L; Ti=2*L; Td=0.5*L;

>> Ki=Kp/Ti; Kd=Kp*Td;

>> G=tf([Kd Kp Ki],[1 0]);

??? z-n curva de reaccion

Error: Unexpected MATLAB expression.

??? z-n curva de reaccion

Error: Unexpected MATLAB expression.

>> figure

>> plot(y)

>> hold on

>> plot(dy)

>> plot(d2y)

>> grid

>> L

L=

0.2241

>> Tau=
??? Tau=

Error: Expression or statement is incomplete or

incorrect.

>> Tau

Tau =

1.9406

>> Kp

Kp =

10.3933

>> Ti

Ti =

0.4481

>> Td
Td =

0.1120

>> G

Transfer function:

1.164 s^2 + 10.39 s + 23.19

---------------------------

>> L

L=

0.2241

>> 1/L

ans =

4.4631

>> zero(G)
ans =

-4.4631

-4.4631

>> HLC=feedback(G*H,1);

>> pole(HLC)

ans =

-0.5832 + 3.1565i

-0.5832 - 3.1565i

-2.4989 + 0.7129i

-2.4989 - 0.7129i

>> pole(HLC)

ans =

-0.5832 + 3.1565i

-0.5832 - 3.1565i

-2.4989 + 0.7129i

-2.4989 - 0.7129i

>> figure(2)
>> step(HLC)

figure(3)

>> pzmap(HLC)

You might also like