Implement SPWM using QSPICE

This is the method I would recommend.

  1. Use ¥-device HMITT as the comparator instead of a B-source, as we can take advantage of TTOL in ¥-device.
  2. ¥-device with TTOL, this will eliminate the requirement of maxstep as its can reduce timestep at output change its state, which give you fast simulation time but good switching waveform. For more information, take a look of this post
    TTOL device to Interface analog and digital - QSPICE - Qorvo Tech Forum

PWM.qsch (5.2 KB)