SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
There are several registers which hold the Kp, Ki, and Kd coefficients:
FILTERKPCOEF0
FILTERKPCOEF1
FILTERKICOEF0
FILTERKICOEF1
FILTERKDDOEF0
FILTERKDCOEF1
These registers hold all of the coefficients for the PID for the various coefficient sets as described above. For specific details, see the Filter Reference chapter below. All of the K coefficients are 16 bit signed numbers. They are stored 1 or 2 per register. Systems which do not use nonlinear mode only need to load Coefficient Set A. Here is an example:
Filter1Regs.FILTERKPCOEF0.bit.KP_COEF_0 = 500;
Filter1Regs.FILTERKICOEF0.bit.KI_COEF_0 = 150;
Filter1Regs.FILTERKDCOEF0.bit.KD_COEF_0 = 250;