This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

About digital PID controller in TI source code

Hi everyone~

The digital PID controller in TI source code :

 CNTL_2P2Z_CoefStruct1.b2 = _IQ16(Dgain);
 CNTL_2P2Z_CoefStruct1.b1 = _IQ16(Igain - Pgain - Dgain - Dgain);  <=wrong
 CNTL_2P2Z_CoefStruct1.b0 = _IQ16(Pgain + Igain + Dgain);
 CNTL_2P2Z_CoefStruct1.a2 = _IQ26(0.0);
 CNTL_2P2Z_CoefStruct1.a1 = _IQ26(1.0);
 CNTL_2P2Z_CoefStruct1.max = Max_Period;
 CNTL_2P2Z_CoefStruct1.min = Min_Period;

Red line is wrong, i think b1 should be " -Pgain-Dgain-Dgain".

If Red line is right and why?

thx.

by Bin