br3ttb / Arduino-PID-AutoTune-Library

420 stars 225 forks source link

Swapped constants used for Ki calculation #26

Open Breinholm-coder opened 2 years ago

Breinholm-coder commented 2 years ago

I think you accidently swapped the 1.2 and 0.48 in the Ki calculation:

double PID_ATune::GetKi() { return controlType==1? 1.2Ku / Pu : 0.48 Ku / Pu; // Ki = Kc/Ti }

Should be like this for Ziegler & Nichols (closed loop):

double PID_ATune::GetKi() { return controlType==1? 0.48 Ku / Pu : 1.2 Ku / Pu; // Ki = Kc/Ti }

/Thanks