# Variable Phase PWM Signal, where phase updates twice (or an arbitrary amount) a period?

**URL:** <https://forum.plexim.com/t/variable-phase-pwm-signal-where-phase-updates-twice-or-an-arbitrary-amount-a-period/2345>\
**Category:** PLECS\
**Tags:** plecs\
**Created:** [July 18, 2025, 4:06am UTC](https://forum.plexim.com/t/variable-phase-pwm-signal-where-phase-updates-twice-or-an-arbitrary-amount-a-period/2345 "2025-07-18T04:06:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJM](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@AJM](https://forum.plexim.com/u/AJM)\
**Post date:** [July 18, 2025, 4:06am UTC](https://forum.plexim.com/t/variable-phase-pwm-signal-where-phase-updates-twice-or-an-arbitrary-amount-a-period/2345/1 "2025-07-18T04:06:21Z")

</div>

Hello all,

How would I implement such a thing? I have tried modifying the code for the Variable Phase PWM without success. I need the phase to update independently of when the carrier signal reaches its minimum and maximum values, and I require it to update several times per period. Thanks.

Thank you!

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [July 28, 2025, 3:26pm UTC](https://forum.plexim.com/t/variable-phase-pwm-signal-where-phase-updates-twice-or-an-arbitrary-amount-a-period/2345/2 "2025-07-28T15:26:25Z")

</div>

You can always generate the carrier waveforms directly and use an “Naturally” sampled approach, where the compare value with instantaneously update.

Some relevant posts:

- Variable Phase: [Phase shift modulation simulation in dual active bridge converter - #3 by rangitray](https://forum.plexim.com/t/phase-shift-modulation-simulation-in-dual-active-bridge-converter/1782/3)
- Variable Frequency: [Triangular wave with variable frequency - #2 by Bryan\_Lieblick](https://forum.plexim.com/t/triangular-wave-with-variable-frequency/1152/2)
