% ZIN
Ku=8;
Pu=3.7;Tu=1/3.7;
opcao = menu('Selecione o controlador a ser calculado os parāmetros','P','PI', 'PID')

if opcao == 1
% P
Kp = .5 * Ku
D = 0;
I = 0;
P = Kp

else
    if opcao == 2
    % PI
    Kp = .45 * Ku
    Ti = Tu / 1.2
    
    P = Kp
    I = Kp/Ti
    
    GE = 100;
    GCE = Ti*GE;
    GCU = Kp*GCE;
   
    else
        % PID
        Ku = 8
        Tu = 15/4
        Kp = .6 * Ku
        Ti =  Tu / 2
        Td =  Tu / 8

        P = Kp
        I = Kp/Ti
        D = Kp*Td

        % Parāmetros PD+I Fuzzy
        GE = .5;
        GU = Kp/GE;
        GCE = GE*Td
        GIE = GE*1/Ti
    end
end