Virtual Lab · Power Electronics

SPWM Inverter.

Aim: simulate a single-phase full-bridge inverter driven by sinusoidal PWM, and study how the modulation index, the frequency ratio and the switching scheme shape its output voltage, load current and harmonics.

Learning outcomes

  • Generate SPWM gate signals by comparing a sine reference with a triangular carrier.
  • Verify that the fundamental output voltage equals ma·Vdc in the linear region.
  • Trace the current path through switches and diodes at every switching edge.
  • Compare the harmonic spectra of bipolar and unipolar switching.
  • Observe how an LC filter and an inductive load reduce THD.

Apparatus

  • DC source, 12–800 V
  • Four ideal switches S1–S4 with anti-parallel diodes
  • SPWM controller with natural sampling
  • Selectable R, RL, RC, RLC or RLE load, optional Lf–Cf filter
  • Virtual oscilloscope, switching analyser and spectrum analyser

Procedure

Seven steps.

  1. Start from the defaults: Vdc = 400 V, ma = 0.8, f1 = 50 Hz, mf = 21, bipolar, R = 20 Ω, L = 30 mH.
  2. Press Play and watch each gate pulse start and end where the sine crosses the carrier.
  3. In the Switching analyser, choose Slower and step edge by edge. Note when current flows through a diode instead of a switch.
  4. Click Record. Vary ma from 0.2 to 1.2 in steps of 0.2 and record each reading.
  5. Switch to Unipolar and repeat step 4. Compare V1 and THD.
  6. Try mf = 9, 21 and 51. Watch the harmonic clusters move in the spectrum.
  7. Turn on the LC filter, record the load-voltage THD, and plot V1 against ma.

Simulation

The full bridge, live.

Every control re-runs the circuit equations at about 360 steps per carrier period. The schematic shows which device conducts at the cursor.

Power stage

+ 400 V S1 S2 S3 S4 A B Lf L R Cf i₀ v_AB

Reference and carrier

vref = ma·sin(ωt)−vref (leg B)triangular carrier

Gate signals

Bridge voltage vAB

vAB (PWM)fundamental component

Load current

io load current (right axis)vo filtered load voltage (left axis)

Harmonic spectrum

Switching analyser

Slow every edge down.

Play one carrier period over as long as 30 seconds, or jump straight from one switching edge to the next. The window follows the cursor, so the event you are studying stays in the middle.

Switching events in this carrier period

TimeEventvAB afterConducting after

Keyboard: ← → jump between edges, Space play or pause.

Theory

What the waveforms mean.

How SPWM works

A sine reference is compared with a high-frequency triangle carrier. When v_ref > v_tri the leg's top switch turns on. The pulse widths follow the sine, so the average bridge voltage over each carrier period traces a sine wave.

Bipolar vs unipolar

Bipolar: S1/S4 and S2/S3 switch as pairs, so vAB jumps between +Vdc and −Vdc, with harmonics around mf. Unipolar: each leg has its own reference (+vref, −vref), so vAB steps through 0 and the first harmonic cluster moves to 2mf.

Key equations

V1,peak = ma · Vdc for ma ≤ 1
fc = mf · f1
THD = √(Vrms² − V1rms²) / V1rms
Above ma = 1 the inverter overmodulates and low-order harmonics appear.

Model assumptions

Ideal switches and diodes, no dead time, a stiff DC link, natural sampling. The circuit equations are integrated at about 360 steps per carrier period, starting from the phasor steady state.

Observations

Your readings.

Each reading saves the current settings and the measured results. Readings stay in this browser only.

#SchemeLoadVdc (V)mamff1 (Hz)FilterV1 peak (V)ma·Vdc (V)THD vAB (%)THD vo (%)Io rms (A)THD io (%)