Contenu principal

Unexpected Behavior with Multiple PWM Stacks and Multiple PWM Blocks

Issue

When multiple PWM blocks are used in a model and each block refers to a different PWM stack while targeting the same PWM channel, the PWM configuration may be overridden at build or runtime. This can result in unexpected duty cycle, frequency, or output behavior, and the generated PWM signal may not match the block parameter settings.

Solution

Ensure that all PWM blocks in the model that target the same PWM channel refer to the same PWM stack instance.

If multiple PWM stacks are configured in the model:

  • Avoid mixing PWM stacks across different PWM blocks within the same model.

  • Use a single, consistent PWM stack for all PWM blocks that target the same hardware resources.

  • Review the PWM stack configuration to confirm that the intended conversion groups, triggers, and channels are not being overridden.

After aligning all PWM blocks to the same PWM stack, rebuild and redeploy the model to apply the corrected configuration.