In HIL experiments, how to accurately and repeatably set the occurrence time of the switch tube open-circuit fault at the moment of wave emission

Dear PLECS Technical Support,

Hello.

I am currently using the demo model three_phase_npc_inverter in PLECS and running HIL experiments on RT Box 2 for open-circuit fault diagnosis of a three-phase three-level NPC inverter.

My objective is not only to inject an open-circuit fault into a switch, but more importantly to control the fault occurrence time accurately and repeatably during HIL testing.

In offline simulation, I can use a Step block to force the gate signal of a target switch to zero at a predefined simulation time, which works well for basic fault injection. However, in the HIL setup, the power stage gate enabling is controlled by an external switch, so the controller and the real-time simulation do not start in a strictly synchronized manner. Because of this, a Step block triggered by absolute simulation time cannot accurately represent a fault occurring at a specific time after the gate signals are enabled.

My actual experimental requirement is to define the fault timing precisely relative to the gate-enable instant or relative to the current fundamental period. For example, I need to perform tests such as:

  • injecting the fault 0.2 s after the gate signals are enabled;

  • taking one current period as 0.02 s;

  • selecting 10 equally spaced fault time points within one current period.

The reason is that I need to carry out full-cycle fault diagnosis tests in order to evaluate the timeliness and effectiveness of my diagnosis method over the entire period.

At present, I can manually change the value of a Constant block online to force a gate signal to zero, but this method does not allow me to control the fault occurrence time accurately or repeatably enough for this kind of systematic testing.

Therefore, I would like to ask for your advice on the following point:

In a PLECS/RT Box HIL setup, what is the recommended method to inject an open-circuit fault at an accurate and repeatable instant relative to the gate-enable event or to a periodic signal such as the current cycle?

More specifically, I would like to know:

  1. Whether there is a recommended way to trigger the fault based on a synchronization event, such as gate-enable activation, instead of absolute simulation time;

  2. Whether it is possible to define fault injection times relative to a reference event, for example 0.2 s after gate enabling;

  3. Whether PLECS/RT Box provides a suitable method to generate multiple repeatable fault instants within one electrical period, such as 10 equally spaced points in a 0.02 s current cycle.

Any suggestions, recommended implementation methods, or example models would be greatly appreciated.

Thank you very much for your time and support.

Best regards,
Jiarong