Spike Pulses in Variable Phase PWM block

Hello, when using the Variable Phase PWM block, I found that complementary pulse outputs can be achieved by swapping the block’s Output values parameter. However, the pulse range for the upper arm is 0~4, and the pulse range for the lower arm should also be 0~4, but in reality it is 0~5 in scope3. can you help me solve it?

TESTVariablephasePWM.plecs (213.7 KB)

You are using different settings for the “Modulation index sampling” parameters - single update in the upper arm, double update in the lower arm.

It’s not exactly clear what you want to achieve. Look at the individual PWM signals and decide what waveforms you need to generate. If you set the modulation index sampling to “Regular (single update at max)” in the lower arm, the spikes are gone.

Although that glitch has been resolved, why does the sum of the upper and lower pulses on the scope still have a glitch? I originally wanted these two pulses to be complementary, and their sum to be a constant value of 4. However, there is a very small portion where it adds up to 5. Could you help me analyze this?