Digital controlled ciritcal pfc stage qspice

HI,

I am trying to make a digital pfc stage in critical mode. I’m using the dll files for the controls and it works. It is stable and regulating the output voltage.

But i want to have a bode plot of the closed loop. I’m trying the FRA block for this. But my bodeplot is not nice as i would expect. I simplified and used a DC source for the input.

What am i missing ?

kind regards,

Mike

This is de spice schematic:

Is your switching period 20µs (50kHz)? You normally wouldn’t expect to get anything meaningful above 1/10 of the switching frequency. The Bode plot for a PFC is generally in the range from 0.01Hz to 1kHz. Refer to Figure 17 (pdf p.11) of this TI design resource : https://www.ti.com/lit/ml/zhcp224/zhcp224.pdf

Well, running a Bode plot for a PFC is time-consuming because you are running a simulation at a high switching frequency but are interested in perturbations down to 1Hz or even lower. This means the .tran stop time must be very long, yet with a very small timestep because the switching frequency is high. I may switch at a lower switching frequency to make simulation more effective.

I understand what you mean and normally i would reduce the crossover freq to 1/10th of my switching frequency. But i would expect to see more signal. nyquist is around 25kHz. But in the bode i see after 500Hz there are issues. Might be alisiang issue ?

Consider increasing your forum trust level to basic user (https://forum.qorvo.com/t/qspice-forum-new-user-to-basic-user-file-upload/24340), which will allow you to upload your .qsch and C++ code if you need a more detailed review. Alternatively, you can review what the .tran waveform looks like. In general, you can usually figure out why the system is struggling to get a smooth Bode plot by looking into the input and output signals for that specific frequency duration. Instead of using my FRA, you can also consider .bode command in Qspice.

Well i am basic but i cant post my files still

pfc_crit.qsch (23.9 KB)
pfc_crit_x5.cpp (1.2 KB)

Seems now i can ^^

This schematic file calls the DPWM_typ2.cpp but you uploaded pfc_crit_x5.cpp.
Please be sure that you upload the schematic that you can replicate the issue. This schematic also not match to the screenshot you posted. In addition, if you link to external library “C:\Users\Mike\Documents\QSPICE\MyLibrary\MyLibrary.lib”, you needs to include MyLibrary.lib in your upload.

My appologies. I was simulating different situations as you can understand. See attachments for the schematic ( reworked it back for this discussion), c++
dpwm_typ2.cpp (4.4 KB)
pfc_crit_simple.qsch (20.0 KB)
MyLibrary.lib (15.7 KB)
and lib file.