Hi, I am trying to migrate a Vienna rectifier from the standard simulation mode to the RTBOX 1 CE, but the offline simulation of the model stops working correctly when I add the RTBOX components such as PWM and similar things. What should I do? The models are attached below
The step-size for your RT Box execution is 5 usec. However, you have a parameter Ts_control set to 50 usec which then is used for the Delay blocks outside of the subsystem.
The demo model you are basing your work on uses a hysteretic type controller. If you set a 50 usec delay in the feedback path of the original demo model you’ll see similar waveforms. If you set the Ts_control parameter to 5e-6 in your model then the results are improved.
You also have the PWM Out blocks set with a 5 kHz switching frequency, although the input to the blocks is the switch state updated at 5 usec.
I’ll also note that maybe you don’t want to use hysteretic control if you’re targeting a specific switching frequency or controller step size. There also is an open-loop model for a Vienna in the minimal examples RT Box demo models.