function [u,e] = Controller_PI(T,Ts,u0,y,Kc,taui,min,max)
%PI controller with saturation

e=-T+Ts; eint=y;
u = u0 + Kc*e + (Kc/taui)*eint;



if u<min
    u=min;
elseif u>max
    u=max;
end