SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The COECONFIG register is used to configure filter coefficients for nonlinear mode. Each Filter coefficient has from 2 to 4 values which are programmable via Filter registers. Kp, Ki, and Kd are arranged into 7 coefficient sets as shown in Figure 4-4.
These sets are designed so that bandwidth increases as the set goes from A to G. These sets can be mapped in any possible combination into 7 bins, numbered from Bin 0 to Bin 6.
These bins are selected based on the nonlinear limit register contents and the Xn value into the filter. There are two options – symmetrical and non-symmetrical. Here are the bins for the two modes:
There are many possible combinations. In symmetric mode, if bandwidth is to increase as error increases, then Bin 0 could be set to Coefficient Set A, Bin 1 set to Coefficient Set B, and so on.
If fewer bins are desired, then Bins 0 and 1 could both be set to Coefficient Set A, Bins 2 and 3 to B, and so on.
The default configuration is the non-symmetric mode, with all bins set to Coefficient Set A.
Limit values must be increasing, with limit 0 the lowest possible value, Limit 1 higher, and so on. In symmetric mode, all limit values must be positive.
Each bin has a separate bit which selects one of the 2 alpha values.
Here is a code example which uses all the Coefficient sets with increasing bandwidth for increasing error:
Filter0Regs.COEFCONFIG.bit.BIN0_CONFIG = 0; //coefficient set A
Filter0Regs.COEFCONFIG.bit.BIN1_CONFIG = 1; //coefficient set B
Filter0Regs.COEFCONFIG.bit.BIN2_CONFIG = 2; //coefficient set C
Filter0Regs.COEFCONFIG.bit.BIN3_CONFIG = 3; //coefficient set D
Filter0Regs.COEFCONFIG.bit.BIN4_CONFIG = 4; //coefficient set E
Filter0Regs.COEFCONFIG.bit.BIN5_CONFIG = 5; //coefficient set F
Filter0Regs.COEFCONFIG.bit.BIN6_CONFIG = 6; //coefficient set G
Filter0Regs.COEFCONFIG.bit.BIN0_ALPHA = 0; //alpha 0
Filter0Regs.COEFCONFIG.bit.BIN1_ALPHA = 0; //alpha 0
Filter0Regs.COEFCONFIG.bit.BIN2_ALPHA = 0; //alpha 0
Filter0Regs.COEFCONFIG.bit.BIN3_ALPHA = 0; //alpha 0
Filter0Regs.COEFCONFIG.bit.BIN4_ALPHA = 1; //alpha 1
Filter0Regs.COEFCONFIG.bit.BIN5_ALPHA = 1; //alpha 1
Filter0Regs.COEFCONFIG.bit.BIN6_ALPHA = 1; //alpha 1