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.

UCD3138PFCEVM-026: UCD3138PFCEVM-026

Part Number: UCD3138PFCEVM-026

Hello expert
There is a double power frequency ripple on the output voltage of Boost PFC, which will affect the reference current waveform calculated in the dual-loop control. How do you deal with this in the program? I have observed that you use the sample averaging register iv.adc_avg[VBUS_CHANNEL] to average 4 samples, but this will not attenuate the double power frequency ripple by how much, right?

Another problem is that the program is similar to [iv.vbus_filtered = iv.adc_raw[VBUS_CHANNEL] + iv.vbus_filtered-(iv.vbus_filtered >> 6); ], how does this filter the data? Q18=Q12+Q18-(Q18>>6)?

Is there an initial value for the variable zvs_flag? I only saw ZVS_CONTROL=OFF.


I’m about to cry, this procedure will make me lose my hair sooner or later !  <^_^> <^_^> <^_^>

  • Xiaoxiao, fortunately most of my hair had already left before I started on PFC so I can't blame it.   My first wife may have divorced me, but my second wife is better, and she says she prefers men with bald heads.  So don't worry too much.  

    As far as your technical questions go, here are some answers.

    The load.asm program clears all the RAM, so all variables are by default set to 0, so we tend not to initialize them if we want a 0.  This may be why you don't see one.  

    That funny program with the right shift of 6 does provide a really efficient 1 pole filter.

    The best way to see it is with a spreadsheet.  sample filter in spreadsheet 002.xlsx

    I'm not sure how you would present it theoretically, but you can see how it works from the spreadsheet.  

    The spreadsheet is for one with a shift of 2 so that you don't have to look at as many numbers.  The graph above is from the same spreadsheet.

    There is a firmware PI which handles the filtering, and it is tuned to filter out the ripple you mention.  It does have a non-linear mode that will make it respond more quickly if the ripple exceeds a limit that indicates a big load transient or something.  

    The function is proportional_integral, and it is called from handle_voltage_loop, which is called once every 5 times through the standard interrupt, so at a 10 kHz rate.