function [alfa,beta,PM,a,f]=pi_tun_maxdelay(c,delta)
% [alfa,beta,PM,a,f]=pi_tun_maxdelay(c,delta)
% On Input
% c=alfa*beta; - Method dependent product.
% delta - The prescribed maximum time
% delay error.
% On output
% alfa - Kp=alfa/(k*tau)
% beta - Ti=beta*tau
% PM   - The phase margin
f=(1+sqrt(1+4/(c)^2))/2;
a=atan(sqrt(f)*c)/sqrt(f);
beta=(c/a)*(delta+1);
alfa=a/(delta+1);
PM=delta*sqrt(f)*alfa;
% End pi_tun_maxdelay