Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

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

0 votes
384 views
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
asked Mar 2, 2021 by BenjaminH. (33 points)

1 Answer

0 votes
 
Best answer
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!
answered Mar 2, 2021 by Bryan Lieblick (1,819 points)
selected Mar 3, 2021 by BenjaminH.
...