How to Use PWM Capture with Differential 5V Gate Signals in RT Box

I am working with RT Box and I have a question about the PWM Capture block:

  1. I want to use two PWM capture signals that are coming in as 5V differential signals, and feed them to the gate drive. Is there a recommended way to make this work in RT Box?

  2. When I connect additional logic blocks (e.g., Comparator or SR Flip-Flop) after the PWM Capture output, I get errors during simulation/code generation. Is there a specific reason for this limitation, or an alternative way to process the PWM Capture signals with logic?

I would appreciate any guidance or example setup for handling differential PWM signals correctly and for combining PWM Capture with logic blocks inside RT Box.

Thanks in advance!

Can you please clarify:

  1. What does the voltage of the coming signals look like? Is it from 0 to 5V (with a complementary signal s’ = 5-s) or from -5 to 5V (with a complementary signal of s’ = -s)? Please show a graphic of what the two signals should like and how that should be resolved into the PWM signal.
  2. Please post a model to share the exact error. There can be datatype conflicts, width errors, and other potential problems.
  3. Are you using a CPU-based or FPGA-based solver (FlexArray / Nanostep)?

A few initial comments:

  1. For FPGA-based solvers you cannot insert logic to modify the incoming signals to the FPGA. You will need external hardware to do this.
  2. For accurate real-time performance the RT Box uses a technique called sub-cycle averaging, where PWM signals are averaged over the RT Box model step returning a value between 0 and 1, providing additional information on when exactly a switching instant occurred within the model step. Resolving the signals from the PWM Capture block into a boolean logic will eliminate the advantages of sub-cycle averaging.