Closed-loop controlled interleaved totem-pole PFC problem consultation

Hi Alps, I’m not very familiar with the control strategy you are working on but would be very interested in learning more. Would you be mind providing a reference to the paper you are basing the controls on?

Like I had recommended in Capture the PWM on-time using C-Script - #2 by Munadir_Ahmed I would avoid C-Scripts. The reason I say this is because the C-Script heavily interacts with the solver and may execute/operate in a way you may not expect. For example if you look at the documentation you’ll notice:

Note It is not safe to make any assumptions about the progression of time between calls to the output function. The output function may be called multiple times during the same major time step, and the time may jump back and forth between function calls during minor time steps. Code that should execute exactly once per major time step should be placed in the update function.

It is for that reason I try my best to avoid using it unless absolutely necessary. Typically that is only to implement discrete controls that I would then want to execute on an microcontroller.

Additionally, your simulation has an algebraic loop and I would recommend avoiding this. Basically you are using Q1-4 to calculate the period and phase and then using these quantities to drive Q1-4 which is forming your algebraic loop. I would consider modeling delays in your controls architecture to break this algebraic loop. Potential options:

  • filter delays on measurements like electrical quantities
  • calculation delays
  • gate driver delays → you could utilize pulse delay blocks to easily model this type of delay