Powerstage Protection of RTBox in Simulation

Hi,

I wanted to test my Powerstage Protection linked to a PWM output of RTBox1 in Simulation. But it didn’t work as expected.

So a made a simple example in the attachement.

I have the system separated into a Controller and a Plant. The Controller and Plant are set to code generation and to normal simulation mode.

Simulation start:

  • Enable Input = 0
  • Trip Input = 1
    ——————————-
  • Power Stage Output = 0
  • BUT: PWM is already running

after 5ms

  • Enable Input = 0
  • set Trip Input = 0
    ——————————-
  • Power Stage Output = 0
  • BUT: PWM is still running

after 10ms

  • set Enable Input = 1
  • Trip Input = 0
    ——————————-
  • Power Stage Output = 0
  • BUT: PWM is still running –> I would expect that the PWM output would start only now after a rising edge on the Enable Input

But the PWM Capture in the Plant sees the PWM starting at Simulation start immediately.

I tried also switching from HIL to RCP and back.

Is there something I messed up in wiring / parameter settings? Can someone help me please?

Powerstage_Protection_SIM.plecs (42.1 KB)

I assume you are talking about the offline simulation here.

Unfortunately, the behavior of the Powerstage Protection unit currently is not modeled for offline simulation. To mimic the behavior, you’d need to insert a signal switch into the PWM signals on the top level schematic. The switch would be controlled by the Powerstage Protection/enable output.

This behavior will be corrected in the next major release of PLECS / RT Box TSP.

Hi Oliver,

thanks for your reply. Yes, I’m using offline simulation.

I already implemented exactly want you have explained using the Powerstage Protection output to pilot a switch between PWM Capture and the Gates of my switches. This works well.

With your reply I can stop trying to implement a more elegant solution for this until the described major release is coming.

Thanks agian.

BR