%Define the process transfer function tau = 0.0015; % time delay s = tf('s'); Gp = exp(-tau*s)/s^2; % Calculate the ultimate gain and period of the ideal controller for the time-delay-free process using the standard IMC equations Kc = 1/(tau*sqrt(2)); Pu = pi*sqrt(tau^2+4)/(2*sqrt(2)); % Modify the ultimate period to account for the time delay by adding a term proportional to the time delay Pum = Pu*(1 + 0.2*tau/Pu); % Calculate the tuning parameters for the actual controller Kp = 0.6*Kc; Ti = 0.5*Pum; Td = 0.125*Pum; % Define the PID controller transfer function Gc = Kp*(1 + 1/(Ti*s) + Td*s); % Calculate the closed-loop transfer function with set point and plot the step response setpoint = 5; % set-point value Gcl = (Gc*Gp)/(1+Gc*Gp); % feedback(Gc*Gp, 1); Gcl_sp = setpoint*Gcl; step(Gcl_sp);