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.

UCD3138: How to switch polarity in the totem pole PFC.

Part Number: UCD3138
Other Parts Discussed in Thread: PMP20873

Hi,

Implementing Totem pole PFC using the PMP20873 reference design (UCD3138 controller). Since the sensed current sinusoidal (not rectified as in traditional PFC). Facing problem in writing code for reference current generation. 

Referred this article https://www.ti.com/lit/an/slyt718/slyt718.pdf?ts=1625152269540 and got some help in understanding the logic of sinusoidal reference current .

But not able to generate  the negative half error which is: Error = Feedback – Current Reference (4) (from above article)

 So need help regarding how to generate Error = Feedback – Current Reference  in UCD3138.

Please provide a sample code just for sinusoidal reference current and error generation. That would be helpful.

Thanks and regards

Ishtiyaque Ahmad 

  • It would be pretty difficult for us to detach the current loop from the rest of the code.  It shouldn't be too hard to follow based on starting with the write to the EADC and working backward from there using the global search in CCS.  As for as inverting the current, this is very straight forward and it uses the UCD hardware.  

    There is a bit called FeCtrl0Regs.EADCCTRL.bit.EADC_INV which inverts the EADC.  That's all there is to it.  If you search for this bit in the code you will find that is is in one state on the positive half cycle and in the other in the negative one.  

  • Dear Ian,

    You are saying " If you search for this bit in the code", Please clarify which code you are referring, because as per my search I didn't find this bit

    FeCtrl0Regs.EADCCTRL.bit.EADC_INV in the UCD3138 PFC EVM code.

    I request just give the code where this bit "FeCtrl0Regs.EADCCTRL.bit.EADC_INV" is used in the positive half cycle and in the negative one.

    Also can I read the sensed current at EAP0?

    Thanks and regards,

    Ishtiyaque Ahmad

  • Do you have the code for the PMP20873?

  • NO, I don't have   PMP20873 code

    Regards,

    Ishtiyaque Ahmad

  • OK.  that explains why you can't find it.  But in any case, that is how we switch the polarity for the current.  That way we can just use the same current calculation regardless of the phase.  

  • In PMP20873 reference design input to EAP0 AND EAN0 is a sinusoidal sensed input current  without offset and it has to compare with EADC DAC. But The DAC input is a unsigned 10 bit number, giving a range from 0 to 1.6 Volts, so how it get compared with negative value of sensed input current 

  • If you look at the schematic and the hall sensor datasheet, you will see that there is a VZCR pin which provides a reference voltage that is equal to zero current.  We read this through an ADC pin continuously in case it changes over temperature, and we use it as an offset.  We either add or subtract our target current from this offset, depending on the AC phase.   

  • Can DAC input be negative? 

  • The DAC is always positive.  I'm not sure if you are really asking about the DAC, however.  The DAC range is from 0 to 1.6 volts.  the hall sensor always has a positive offset, so you don't need to make the DAC negative.  The Error ADC, however, can accept a negative input.  I think this may be what you are asking about.  If you want a good understanding of how that whole thing works, I suggest reading section 3 of the UCD3138 Family Technical Reference Manual.  It will probably save both of us a lot of time.  The manual is here:  https://www.ti.com/lit/pdf/sniu028

  • I have read this menual https://www.ti.com/lit/pdf/sniu028

    But my confusion is : In PMP20873 reference design input to EAP0 and EAN0 is a sinusoidal current  without offset . There is no positive offset in the sensed current(as o/p of hall sensor is not directly connected to i/p of EAP0), than how it can be compared with DAC ( 0 to 1.6 volts).

     

  • If you look closely at the schematic for the PMP20873 here: https://www.ti.com/lit/pdf/tidrrc9

    you will see that it does go though an op amp, but you will also notice that the bias for the op amp comes from the same AC_CUR_VREF signal that I mentioned earlier that is provided also to the UCD on another ADC pin.  To refresh your memory, this signal is generated by the hall effect sensor to indicate where its zero point is.  So the offset is preserved through the op amp.  We put the op amp in  so we can increase the gain on the current signal at low current to improve our low power THD.  

    Looking at the spec for the hall sensor, its center point is at the middle of the voltage range, so at about 1.65 V.  However the PMP20873 does work correctly with an EADC range of 0 to 1.6 volts.  I'm not an expert on op amp circuitry, and it would take me quite a while to figure out what's going on in the schematic, but I bet that the resistors after the op amp output are scaling the signal down from the range of 0 to 3.3 V from the hall sensor to a good 0 to 1.6 V range to match the UCD's needs.  Probably it shrinks a little extra to allow for a guardband.