PWM Capture - Averaging intervall time and discretization step size of code generation

Hi,

regarding to my first question with a great answer (https://forum.plexim.com/5731/which-pins-corresponds-to-wich-digital-inputs-epwm-f28379d) i would like to know if the averaging time of the pwm capure block has to match with the discretization step of the code generation?

I’ve done the tutorial and read the sentence: “Confirm that the Averaging interval (offline only) parameter of the PWM Capture block matches the discretization time of 10e−6 s”… I’m not 100% sure if that means it always has to match the chosen discretization time.

Thanks a lot!

Benjamin

If you are simulating the model before deploying it to the RT Box, setting that parameter equal to the discretization step size emulates the behavior of the RT Box hardware’s PWM Capture behavior.

You can run the model with other values, but they aren’t particularly meaningful and won’t represent the hardware behavior. The vast majority of the time it is best to create a variable in your initialization scripts and assign it to both settings.

Glad to hear the previous answer was helpful!