PWM Simulator: SPWM, SVPWM and Discontinuous PWM

Compare SPWM, SVPWM, THIPWM and DPWM0–3. Animate the space-vector hexagon, inspect seven-segment switching and dwell times, and compare current ripple and relative switching loss.

#DPWM #motor drives #PWM #SPWM #SVPWM #switching losses #THIPWM #three-phase inverter

This PWM Simulator compares SPWM, space vector PWM, one-sixth third-harmonic injection and DPWM0–3 for a two-level, three-phase voltage-source inverter. Engineers can compare modulation strategies for motor drives, students can follow the switching process, and designers can estimate the tradeoff between current ripple and switching loss.

Choose a modulation method, then enter the DC-link voltage, fundamental frequency, base carrier frequency and per-phase high-frequency inductance. Specify the fundamental phase current as an RMS value and its displacement angle relative to phase voltage. Positive angles mean lagging current; negative angles mean leading current. Power factor here means the cosine of that angle.

The modulation index follows Hava, Kerkman and Lipo: fundamental phase-voltage peak divided by the six-step fundamental peak, 2 Vdc/π. The familiar carrier amplitude ratio is also reported. SPWM stays linear to M_i = π/4, or 0.7854. SVPWM, THIPWM and the discontinuous methods extend that limit to π/(2√3), or 0.9069. SVPWM therefore raises the maximum phase-voltage peak from Vdc/2 to Vdc/√3: a 15.47% increase.

Use the play button beside electrical angle to rotate the reference vector through all six sectors. The hexagon shows the six active switching states, highlights the adjacent vectors, and reports their total dwell times. Both zero vectors lie at the origin. Conventional SVPWM shares the remaining time equally between 000 and 111. The solid circle marks the SVPWM linear limit; the dashed circle marks SPWM's limit.

The seven-segment view shows the switching order and each segment's duration. The three gate traces use the actual dwell-time proportions. In even sectors, the active-vector order reverses so only one inverter leg changes at each transition. At a sector boundary or the linear limit, zero-duration segments disappear from the physical waveform. These two space-vector views always illustrate conventional SVPWM at the specified voltage and actual carrier frequency; when another method is selected, they remain an explicitly labeled SVPWM comparison.

The duty table demonstrates that symmetric SVPWM and sinusoidal references with min-max zero-sequence injection give the same three duties. Their switching patterns agree up to the carrier time origin. The selected-method waveform charts and live comparator show how the other injection and clamping rules differ.

For an SVPWM calculator comparison, use the harmonic distortion factor chart across modulation index and the loss curves across signed current angle. HDF is a normalized squared ripple measure, not a percentage. The inductance and current convert it into RMS switching-ripple current and an estimated current THD. This estimate does not calculate an individual harmonic spectrum.

At equal carrier frequency, DPWM suppresses each leg's switching during one third of its cycle. At equal average switching frequency, its carrier rises by 50%, affecting both ripple and switching loss. The space vector PWM simulator assumes a balanced three-wire load and ideal switches. It excludes overmodulation, dead time, minimum pulses, conduction loss and device-specific switching energies. Beyond the linear limit, voltage gain becomes nonlinear and low-order harmonics appear; the tool withholds those operating points. Use measured device data for final thermal design.

How it is calculated

The reference phase commands are ra=macos⁡θr_a=m_a\cos\theta, rb=macos⁡(θ−120∘)r_b=m_a\cos(\theta-120^\circ) and rc=macos⁡(θ+120∘)r_c=m_a\cos(\theta+120^\circ), with ma=4Mi/πm_a=4M_i/\pi and carrier limits ±1. An identical zero sequence is added to all three phases, so it cancels from line-to-line voltage. Upper duty is dx=(1+rx+z)/2d_x=(1+r_x+z)/2.

SPWM uses zero injection. SVPWM uses z=−(max⁡rx+min⁡rx)/2z=-(\max r_x+\min r_x)/2. THIPWM here means one-sixth injection, z=−macos⁡(3θ)/6z=-m_a\cos(3\theta)/6. DPWM0, 1 and 2 select the largest absolute phase reference after rotating the selection signals by −30°, 0° and +30° respectively, then clamp the corresponding original phase to its rail. DPWM3 selects the intermediate absolute magnitude. See PESC author copy, pp. 3–4, magnitude rules, and APEC author copy, p. 3, equations (2)–(4).

The HDF polynomials are PESC p. 7, equations (26)–(35), evaluated first at the actual carrier frequency. Ih=VdcHDF/(24Lσfc)I_h=V_{dc}\sqrt{HDF}/(24 L_\sigma f_c) from equation (36) gives each phase’s RMS switching ripple. THDh=100Ih/I1THD_h=100 I_h/I_1. Both are high-frequency inductive estimates.

For a DPWM method, equal average switching frequency means fc=1.5fbf_c=1.5f_b. The plotted base-frequency HDF is HDFb=HDF/(fc/fb)2HDF_b=HDF/(f_c/f_b)^2, so Ih=VdcHDFb/(24Lσfb)I_h=V_{dc}\sqrt{HDF_b}/(24L_\sigma f_b). This is the kf2k_f^2 correction in PESC equations (19), (32)–(35).

The loss function is the integral of absolute sinusoidal current over the intervals that actually switch, normalized to continuous PWM; PESC p. 9, equations (39)–(45). For DPWM0–2 the clamping center is −30°, 0°, +30°. At a fixed carrier, SLF=1−cos⁡δ/2SLF=1-\cos\delta/2 for ∣δ∣≤60∘|\delta|\le60^\circ, otherwise SLF=(3/2)sin⁡∣δ∣SLF=(\sqrt3/2)\sin|\delta|, where δ\delta is load angle minus clamping-center angle. The separate DPWM3 expression follows equation (45). Relative loss on the selected basis is (fc/fb)SLF(f_c/f_b)SLF.

Source discrepancy: the APEC author manuscript p. 4 equations (5)–(7) display πMi/4\pi M_i/4 inside the HDF terms. Its modulation-index definition and plotted curves instead agree with 4Mi/π4M_i/\pi, as explicitly printed in the later PESC equations. This tool uses PESC. A separate time integration of the actual three-phase switched voltage verifies all seven HDF polynomials; no polynomial was adjusted to fit a reference.

Gate commands explicitly hold the upper device OFF at the negative rail and ON at the positive rail, including equality at carrier extrema. A dimensionless tolerance of 10−1210^{-12} around ±1 absorbs floating-point roundoff; interior commands use the triangular-carrier comparison.

Space-vector synthesis and carrier equivalence

The amplitude-invariant Clarke convention makes the reference-vector magnitude equal to the phase-voltage peak. The six active states V1…V6 are 100, 110, 010, 011, 001, 101 at angles 0°, 60°, …, 300°, each with magnitude 2Vdc/32V_{dc}/3; V0 = 000 and V7 = 111 both give zero load voltage. With wrapped angle θ\theta, sector k=1+⌊θ/60∘⌋k=1+\lfloor\theta/60^\circ\rfloor and local angle α=θ−60∘(k−1)\alpha=\theta-60^\circ(k-1), volt-second balance gives

TL=Ts3Vph,pkVdcsin⁡(60∘−α),TU=Ts3Vph,pkVdcsin⁡α,T0=Ts−TL−TU.T_L=T_s\frac{\sqrt3 V_{ph,pk}}{V_{dc}}\sin(60^\circ-\alpha),\qquad T_U=T_s\frac{\sqrt3 V_{ph,pk}}{V_{dc}}\sin\alpha,\qquad T_0=T_s-T_L-T_U.

Here T0T_0 is the combined zero-state time, unlike sources that call the individual 000 share T0. Conventional SVPWM allocates half of this combined time to each zero vector. The displayed seven segments are 000,F,S,111,S,F,000000,F,S,111,S,F,000, with durations T0/4,TF/2,TS/2,T0/2,TS/2,TF/2,T0/4T_0/4,T_F/2,T_S/2,T_0/2,T_S/2,T_F/2,T_0/4. In odd sectors F is the lower active vector; in even sectors F is the upper one. This order changes one leg at each transition. Zero-duration segments are allowed at boundaries.

Integrating these states gives the three phase duties independently of the carrier implementation. The table compares them with dx=[1+rx−(rmax+rmin)/2]/2d_x=[1+r_x-(r_{max}+r_{min})/2]/2. Equal zero-state sharing yields the same result: symmetric SVPWM is sinusoidal PWM plus min-max zero-sequence injection. The sequence starts at 000; the existing triangular carrier starts at its minimum, so the sequence cursor includes a half-period shift.

The largest circular reference that fits inside the hexagon is Vdc/3V_{dc}/\sqrt3, versus Vdc/2V_{dc}/2 for SPWM. The gain is 2/3−1=15.47%2/\sqrt3-1=15.47\%. DUTH course notes, attached PDF pp. 16–23, give the state map, volt-second derivation and range comparison; Imperix TN146 explains min-max equivalence. Van der Broeck, Skudelny and Stanke (1988) is cited as the original journal reference, DOI 10.1109/28.87265; its paywalled text is not used. The state integration, residuals and original drawings are derived here from these equations.

For drawing the exact gate traces, segments shorter than 10−13Ts10^{-13}T_s are treated as floating-point zero and omitted from the plotted trace. This prevents a zero-duration 000 or 111 entry from drawing a false OFF/ON spike when a phase is continuously clamped at the maximum linear demand. The dwell table and voltage/duty integrations retain the unrounded fractions.

The frozen phase B gate chart uses exact triangular-carrier crossings rather than sampled gate values. For a carrier starting at −1 and peaking at half a period, the upper gate is ON over [0,db/2)[0,d_b/2) and [1−db/2,1][1-d_b/2,1] in normalized time. At duty zero or one, the trace is constant. Its piecewise-constant area over one period equals dbd_b; checks verify this for every modulation method and near clamping. The displayed duties use the same 10−1210^{-12} reference-rail tolerance as the live comparator.

Assumptions

  • Balanced three-phase voltage references and approximately sinusoidal fundamental currents; isolated load neutral with no zero-sequence current path.
  • Ideal two-level inverter, symmetric triangular carrier, complementary gate commands, and no dead time or minimum pulse width.
  • Load high-frequency impedance is represented by the specified per-phase transient/leakage inductance.
  • The base carrier/fundamental frequency ratio exceeds 20 for every method in the comparison, following PESC p. 5. Carrier detail uses locally constant references.
  • Switching energy is proportional to current magnitude; only relative commutation loss is modeled. The loss reduction is not a total efficiency gain.
  • Voltage and current are independent specified operating-point quantities; no load resistance, back EMF or motor current-control loop is solved.
  • The comparison covers THIPWM1/6; THIPWM1/4 and adaptive GDPWM are outside the selectable set.
  • The reference angle is measured counterclockwise from the phase A / alpha axis (cosine convention). The vector magnitude is the phase-voltage peak.
  • Both space-vector scenes and the duty-equivalence table always use conventional SVPWM at the current voltage and actual carrier frequency. Their equal 000/111 split and seven-segment pattern do not describe DPWM, SPWM or THIPWM when those methods are selected.

Where it applies

Use only the linear modulation region: 0<Mi≤π/40<M_i\le\pi/4 for SPWM and 0<Mi≤π/(23)0<M_i\le\pi/(2\sqrt3) for the other six methods. The HDF chart stops SPWM at its own limit. Signed current angle is limited to −90°…+90°; power factor is displacement factor, not true power factor including harmonics.

The ripple approximation is intended for high carrier ratios and predominantly inductive switching-frequency impedance. If estimated ripple exceeds 20% of fundamental current, a warning asks for better operating-point data or a more suitable inductance/frequency; the sinusoidal-current loss assumption becomes less reliable.

Playback is slowed for learning; the displayed frequency values remain the physical operating frequencies. Only the angle, local comparator, duties and drawing change each frame. No device loss in watts, individual harmonic spectrum, peak ripple, common-mode voltage, overmodulation, dead time, pulse suppression, semiconductor conduction loss or thermal model is included.

Above Vph,pk=Vdc/3V_{ph,pk}=V_{dc}/\sqrt3, a circular reference leaves the hexagon during part of the cycle. Dwell-time saturation and the transition toward six-step operation require an overmodulation algorithm; amplitude gain becomes nonlinear and low-order distortion grows. This tool rejects that region instead of silently clipping. At the linear limit or a sector boundary, some seven-segment durations are zero and the number of distinct physical transitions is reduced.

References

  • Hava, Kerkman and Lipo, Simple Analytical and Graphical Tools for Carrier Based PWM Methods, PESC 1997, pp. 1462–1471. Author copy (11 PDF pages): https://users.metu.edu.tr/home101/hava/wwwhome/pesc97.pdf . DOI: 10.1109/PESC.1997.616959.
  • Hava, Kerkman and Lipo, A High Performance Generalized Discontinuous PWM Algorithm, APEC 1997. Author copy includes expanded manuscript (13 PDF pages): https://users.metu.edu.tr/home101/hava/wwwhome/apec97.pdf . See pp. 3–6 for clamping rules and switching-loss normalization.
  • Hava, Kerkman and Lipo, Simple Analytical and Graphical Methods for Carrier-Based PWM-VSI Drives, IEEE Transactions on Power Electronics 14(1), 1999, 49–61. DOI: https://doi.org/10.1109/63.737592 (journal citation; full text not used).
  • DUTH open course notes, Space Vector Modulation, PDF pp. 9, 16–23: numerical three-phase example, switching-state hexagon, dwell-time derivation and linear range. https://eclass.duth.gr/modules/document/file.php/1031622/SVPWM.pdf .
  • Imperix, TN146, SVPWM vs SPWM modulation techniques (2021), min/max injection and DC-bus utilization. https://imperix.com/doc/implementation/svpwm-vs-spwm-modulation-techniques ; DOI: https://doi.org/10.66800/0146 .
  • Van der Broeck, H. W., Skudelny, H.-C., and Stanke, G. V., Analysis and realization of a pulsewidth modulator based on voltage space vectors, IEEE Transactions on Industry Applications 24(1), 142–150, 1988. DOI: https://doi.org/10.1109/28.87265 (journal citation; paywalled full text not used).

Inputs

InputSymbolUnitDefault
Modulation method
SVPWM opens the space-vector and seven-segment example. The two vector views remain an SVPWM comparison when selecting another method. DPWM0 leads, DPWM1 centers and DPWM2 lags the voltage peak; DPWM3 uses intermediate magnitude clamping.
methodSVPWM
Modulation index, relative to six-step voltage
M_i = phase-voltage peak / (2 Vdc/π); carrier ratio m_a = 4 M_i/π. SPWM limit π/4 = 0.785398. SVPWM limit π/(2√3) = 0.906900, corresponding to phase peak Vdc/√3 and 15.47% more linear voltage.
M_i0.75
Comparison basis
The base frequency is always the CPWM carrier. Equal average switching uses a 1.5× carrier for DPWM, compensating for its one-third clamping time.
basisEqual carrier frequency
DC-link voltageV_dcV600
Base frequency (CPWM carrier)f_baseHz8000
Fundamental output frequencyf_eHz50
Per-phase high-frequency inductance
Use the load transient/leakage inductance at switching frequency, not necessarily its low-frequency inductance.
L_sigmamH3
Fundamental phase current, RMS
Sets the estimated switching-ripple THD. Current is specified independently of voltage; no motor equivalent circuit is solved.
I_1A10
Current displacement angle (+ lagging, − leading)
Power factor here is displacement cos(angle). The switching-loss model assumes nearly sinusoidal current.
load_angledeg30
Electrical angle · ▶ animate PWM
Rotate the reference vector, update sector and dwell times, and follow the carrier cursor. Angle zero is the phase A / alpha axis. Slow-motion playback leaves ripple and loss sweeps cached.
theta_edeg20

Results

With the default inputs above, the calc gives:

ResultValue
Fundamental line-to-line voltage, RMS350.86 V
Switching-ripple current, RMS0.542 A
Estimated current THD (switching ripple)5.42 %
Switching loss / CPWM at base frequency1
Switching-loss reduction0 %
Actual carrier frequency8,000 Hz
Average switching frequency8,000 Hz
Displacement power factor0.866
HDF at actual carrier0.2705
HDF at base frequency0.2705
Carrier amplitude ratio (4 M_i / π)0.9549
Phase-voltage peak / DC-link voltage0.4775
SPWM linear limit, phase peak300 V
SVPWM linear limit, phase peak346.41 V
SVPWM linear voltage gain over SPWM15.47 %

Checked against sources

Each case below was calculated by this calc and agrees with the value from its source (within the tolerance where one is shown).

Published SPWM linear modulation limit

Source: Hava et al., PESC author copy, p. 9, section VII: SPWM linear range ends at approximately 0.785. The expected value is the paper’s rounded limit, not a result generated by this tool.

Inputs: Modulation method = SPWM; Modulation index, relative to six-step voltage = 0.7; the others as above.

ResultSourceThis calc
Linear modulation limit0.7850.7854

Published maximum linear modulation limit

Source: Hava et al., PESC author copy, p. 9, section VII: theoretical linear modulation limit approximately 0.907 for the zero-sequence methods. Paper’s rounded value.

Inputs: the default inputs above.

ResultSourceThis calc
Linear modulation limit0.9070.9069

DPWM1 unity-PF switching loss is one half

Source: Hava et al., APEC author copy, p. 3 identifies DPWM1’s minimum at unity PF; p. 6 states the minimum SLF is 0.5. This is a published limiting result, independent of the implementation.

Inputs: Modulation method = DPWM1; Current displacement angle (+ lagging, − leading) = 0 deg; the others as above.

ResultSourceThis calc
Switching-loss function, fixed carrier0.50.5
Switching loss / CPWM at base frequency0.50.5

DPWM2 at 30° lag gives one-half fixed-carrier loss

Source: Hava et al., APEC author copy, p. 3 identifies DPWM2’s minimum at 30° lagging; p. 6 gives the minimum SLF of 0.5. Carrier frequency is held fixed.

Inputs: Modulation method = DPWM2; the others as above.

ResultSourceThis calc
Switching-loss function, fixed carrier0.50.5
Switching loss / CPWM at base frequency0.50.5

DPWM carrier multiplier at equal average switching

Source: Hava et al., APEC author copy p. 5 Fig. 7 explicitly uses a DPWM carrier of 1.5 times the continuous-PWM carrier for equal average switching frequency. The reciprocal 2/3 is the active fraction from 120° clamping in 360°.

Inputs: Modulation method = DPWM2; Comparison basis = Equal average switching frequency; the others as above.

ResultSourceThis calc
Carrier multiplier for comparison basis1.51.5
Fraction of time each leg modulates0.66670.6667

SVPWM HDF from published graph at M_i = 0.4

Source: Hava et al., PESC author copy p. 8, Fig. 13 curve 2. The plot at M_i = 0.4 reads approximately 0.165; tolerance 0.01 covers graphical reading. The APEC p. 4 manuscript prints π/4 instead of 4/π in the HDF argument; that is inconsistent with this plot and the six-step index definition, so the PESC normalization is retained.

Inputs: Modulation index, relative to six-step voltage = 0.4; the others as above.

ResultSourceThis calc
HDF at base frequency0.165 ± 0.010.1643

DPWM1 HDF from published graph at M_i = 0.9

Source: Hava et al., PESC author copy p. 8, Fig. 13 curve 6. At M_i = 0.9 the equal-average-switching-frequency graph (k_f = 2/3) reads approximately 0.18. Tolerance 0.01 covers reading the dashed curve. These are graph readings, not polynomial-generated expected values.

Inputs: Modulation method = DPWM1; Modulation index, relative to six-step voltage = 0.9; Comparison basis = Equal average switching frequency; the others as above.

ResultSourceThis calc
HDF at base frequency0.18 ± 0.010.18

Course numerical example reproduced from integrated SVPWM states

Source: DUTH course PDF p. 9 gives va/Vm=0.9511, vb/Vm=-0.208, vc/Vm=-0.743 at a sine phase of 108°. This tool uses cosine references, so theta_e=108°−90°=18°. Expected numbers are copied from the published example, rounded to its precision; calculated values come from integrating the seven switching states.

Inputs: Electrical angle · ▶ animate PWM = 18 deg; the others as above.

ResultSourceThis calc
Sequence-average phase voltages / reference peak [1]0.95110.9511
Sequence-average phase voltages / reference peak [2]-0.208-0.2079
Sequence-average phase voltages / reference peak [3]-0.743-0.7431

Published 15% extension of the linear voltage range

Source: DUTH course PDF p. 22 gives the SPWM phase-peak limit Vdc/2; pp. 16 and 23 give the SVPWM limit Vdc/√3 and a rounded increase of about 15%. At 600 V these published closed-form limits are 300 V and 346.41016 V. The 0.5 percentage-point tolerance checks the source's rounded 15% statement without replacing the exact 15.47005% physics.

Inputs: the default inputs above.

ResultSourceThis calc
SVPWM linear voltage gain over SPWM15 ± 0.5 %15.47 %
SPWM linear limit, phase peak300 V300 V
SVPWM linear limit, phase peak346.4 V346.4 V

Related Resources

Responses

Your email address will not be published. Required fields are marked *

L ading...