I'm having a problem with my simulation:
I'm using a C-script to make the discrete control of my converter, everyone works fine until now,
I'm trying to make the inicialization routine, (context: is an active rectifier with a LCL filter, i need make the precharge of the DC-Link, connecting a resistor in the beginning of the circuit (1 per line) when i make the precharge, then, when the capacitor is charged, i need to bypass this 3 resistor), but it does'n work as i want. Now, i'm getting the on-off signal of the switch to activate/desactivate the resistor to make the precharge, but some pulses in the output (should stay calm on 750V) cause problems in the modulation, i don't know why this appears. i think can be because of the way what i make the on-off of the switch (just an IF in the c-script, if the value of the output is less than 520V, connect the resistor, else, disconnect). The sample of the C-script is 50khz.
Anyone have an idea of what happen? Or, another way to make the precharge?
PD: attach the schematic and photo of results of the problem.