I modeled a controller for a totem pole PFC in Embed, also using PSIM coupler for plant simulation. This is the top level diagram.
This is the inside of "MCU compound". it contains sense signals scaling and processing, inrush control, inner outer PFC loops.
This is the inside of "VAC-iL - Bus processing" compound. I'm using FPU since STM32g4 supports FPU.
this is the inside of "voltage current loop", also in FPU.
I'm trying to do PIL in a separate file, this is the main diagram. System time step is 200khz with run in real time unchecked and target interface sample rate is also 200kHz with sync target to this block checked. Code gets downloaded successfully but when I hit f5 after 3secs it say "program did not start on DSP"
Here are some of my doubts -
- Is the problem with the MCU not being able to process the FPU?
- Blocks like const, multiplier , summer etc is default to "double", do I need to add convert block to float for each of this blocks as stm32g4 only support single precision FPU?
- If I decide to use the fixed point then do i need to convert each block to fixed point including simple blocks like const, multiplier etc?
- as you can see in the image I'm using local time step for blocks like rms, PLL, PI,etc will code gen work with this set up?
- When i run the MCU compound file, it works as expected, error happens only during PIL.
Any help is greatly appreciated. If any more information needed then please let me know.