CB-PWM phase jump at each carrier period boundary is delayed until next extremum (missing segment)

Toolchain: PLECS (version 4.9.5) with imperix ACG target (SDK 2025.1), running on B-Box in simulation.

Blocks: CONFIG (CLOCK_0 = f_sw, Postscaler = 1), CB-PWM with Triangle carrier.

CONFIG.PWM → CB-PWM “>” (clock)

Phase(s) input enabled; my phase P ∈ [0,1) comes from a Triggered Subsystem that runs once per carrier period (triggered by CONFIG.Task).

I tried Single-rate and Double-rate for PWM parameters update rate.

Goal: my algorithm requires changing the carrier phase every carrier period (randomly among 0°, 90°, 180°, 270°).

What I expect
At each period boundary, when I jump the phase (e.g., from 0° to 90° or 180°), the carrier should instantaneously jump to the new phase index and then continue with the normal slope (no extra “fold” within the same period).

What I observe
When I jump the phase at the period boundary, the new phase does not take effect immediately. Instead, it seems to wait until the next carrier extremum (peak or valley) before continuing integration, leaving a missing segment.

The image shows the internals of CB_PWM.

Questions

Is this just a simulation issue? Or does this also happen when generating code for FPGA?

Is this behavior expected from CB-PWM’s parameter sampling/locking semantics in PLECS/imperix ACG, or is it a known issue?

How can I guarantee the phase jump is applied exactly at the period boundary (i.e., no wait until the next peak/valley)?

Hi Perry, it’s a bit difficult to debug without seeing the model directly. Can you clarify whether the issue occurs within a component developed by Imperix, or if the phase loading was implemented in PLECS? If possible, would you be able to share the model here?

Hi, Thanks for your help!
I’m working on random PWM, so being able to change the carrier phase is very important for my research—thank you in advance for any help.

I’m using the imperix CB-PWM block. If you right-click the block CB-PWM and choose Subsystem → Look under mask, the schematic you see matches the screenshot I uploaded in my first post.

My opinion is that the internal carrier model used for simulation inside CB-PWM is too simplified, and the carrier-generation logic may not be rigorous enough for sudden phase changes.

However, when generating code to the imperix B-Box, it looks like the implementation uses the API call void CbPwm_SetPhase().
So my question is: Is this issue only present in simulation, and will it disappear on real hardware (B-Box) because the FPGA-based implementation uploads the phase immediately?

I’ve attached my PLECS model and a brief description of the issue.
Many thanks!

RPWM_filure.plecs (58.3 KB)

Hi Perry, thanks for the model and the detailed description. Unfortunately I don’t have a license for the Imperix target so I’m unable to investigate further. Since this module was developed by Imperix, have you tried reaching out to them? They would know the ins and outs of the module implementation and get you the explanation you are looking for.

Thanks for your help. I’m contacting them.