SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
Using KComp as an output multiplier can be useful in places where the DPWM output is limited to less than 100%, for example. This can permit using the whole dynamic range of the Filter for a more limited range, and remove the need for output clamping. The scaling works exactly the same, except the 14 bit KCOMP value is used instead of the 14 bit period value.
This option also makes it possible to change the gain of the Filter dynamically without change pole and zero positions. It can also be used to increase the gain of the Filter beyond what the normal Filter structure supports. It is also used to match up the PWM and Resonant mode waveforms in the LLC configuration.
There are registers in the Loop Mux which contain KCOMP values and select which of 3 KCOMP values is used for each filter.
Here is an example of a code which would provide a maximum output of 50%:
#define SWITCHING_PERIOD 2500 // 250 MHz clock divided by period of 100 KHZ
Dpwm0Regs.DPWMPRD.bit.PRD = SWITCHING_PERIOD;
LoopMuxRegs.FILTERKCOMPA.bit.KCOMP0 = SWITCHING_PERIOD >> 1;
//KCOMP = period/2
LoopMuxRegs.FILTERMUX.bit.FILTER0_KCOMP_SEL = 0; //select KCOMP0 for filter 0
Filter1Regs.FILTERCTRL.bit.OUTPUT_MULT_SEL = 0; //Multiply output by KCOMP
This approach yields 1 more bit of filter resolution than clamping the Filter output at 50%, which should reduce the size of any limit cycling.