I have a PI temperature controller being used in experiments, which I am also trying to simulate. However, using the proportional gain and integral time as used in the experiments gives different outputs from the experiments.
Is there a way to determine the k_p and T_i of the controller using only the measured input and output temperatures? A linear regression on the difference between output and input temperatures as a function of the error and the integral of the error gives unrealistic results.
The (possibly incorrect) estimation code in MATLAB I used is:
error = T_target - T_in(1:end-1); integ = cumsum(error.*diff(time)); ctrl_input_exp = T_out(1:end-1) - T_in(1:end-1); fit_model = @(a,b,x,y) a*x + a/b*y ; fittedmodel = fit([error,integ],ctrl_input_exp,fit_model); fit_coeffs = coeffvalues(fittedmodel); k_p = fit_coeffs(1); T_i = fit_coeffs(2);