%Ziegler Nichols PID
ks=1;
tt=1;
tn=4.463; tu=1.425;
Zr=1.2/ks*tn/tu;
Ti=2*tu;
Td=0.5*tu;
P = Zr; I = Zr/Ti; D = Zr*Td;
sim('sys4pid');

t=res(:,1);
w=res(:,2);
u=res(:,3);
y=res(:,4);
plot(t,w,'k:',t,y,'k-',t,u,'k--');
v=axis;
%axis([v(1) v(2) v(3) 1.5]);
legend(' w', ' y', ' u');
ylabel('w,y,u');

xlabel('t');
set(1, 'PaperUnits', 'centimeters')
set(1, 'PaperPosition', [3 10 11 8.25])
print -deps 'obr6zn.eps'
