Inverter Harmonics, THD, Dead-Time Effects and Multilevel Inverters
The earlier inverter lessons gave the fundamental: how many volts a bus can deliver with sine or space-vector PWM. Everything else in the output is a harmonic, and harmonics cost you: extra copper and core loss in the motor, torque ripple and acoustic noise, filter size in a grid inverter, and limits set by standards. This lesson measures them with total harmonic distortion (THD) and its weighted form, shows why the dead time between the two switches of a leg creates low-order harmonics that no carrier frequency can remove, and introduces multilevel inverters, which add voltage steps to cut the harmonics and the voltage stress at their source.
Measuring distortion
For a periodic waveform with rms harmonics :
The voltage THD of any PWM waveform is large (the bridge output is a train of rectangular pulses), and it says little about what the load feels. An inductive load divides each harmonic voltage by . The weighted THD (WTHD) divides each harmonic voltage by its order, so it is proportional to the current distortion in an inductive load. It is the fair figure for comparing modulation schemes. Grid-connected inverters are judged on their current harmonics against limits in IEEE 1547-2018 and IEEE 519-2022 (5 % is the familiar number: total rated-current distortion in IEEE 1547, total demand distortion in IEEE 519 where ), while motor drives care about harmonic losses and torque ripple (Grid-Tied Inverters, Power Quality).
Dead time: a voltage error that follows the current
During the dead time both switches of a leg are off, and an inductive load current must still flow. It takes the antiparallel diode that its direction allows. If the current flows out of the leg (), the lower diode conducts and the pole voltage stays low until the upper switch turns on: each pulse is shortened by . If the current flows into the leg, the upper diode conducts and each pulse is lengthened by . Averaged over a switching period, the error is:
Over a fundamental period that is a square wave of amplitude , in phase with the current and opposing it. Its harmonics are at . The triplens cancel between the phases of a three-wire load; the 5th, 7th, 11th and 13th reach the motor. The fundamental component acts like an extra resistance, and the error is fixed in volts, so it hurts most at low output voltage, which means low speed. Switch drops (, times the current, diode forward voltage) add a similar error. Remedies: shorter dead time (faster gate drive, GaN), dead-time compensation (add to the reference, which needs a reliable current-sign estimate near zero crossings), and closed-loop current control, which suppresses the error inside its bandwidth (Clarke and Park Transforms).
Worked example
Given: a three-phase inverter on , , dead time , star load , per phase. Two operating points: at , and at (low speed).
Find: and the 5th-harmonic current at both points.
Solve:
Check: is 2.5 % of the commanded peak at , but 20 % of the commanded at . The code iterates the fundamental (the error's phase depends on the current's phase) and adds the higher harmonics. A time-domain simulation of the same averaged circuit gives the same fundamental to three digits.
import numpy as np
# Dead time adds to each pole voltage a square wave -dV*sign(i): a voltage error in phase with the current.
Vdc, fsw, R, L = 48.0, 10e3, 1.0, 2e-3
def deadtime(ma, f1, td):
dV = Vdc * td * fsw # mean volt-seconds lost per period, per leg
w = 2 * np.pi * f1
Vref = ma * Vdc / 2 # commanded phase peak (real axis)
I1 = Vref / (R + 1j * w * L) # first guess: no dead time
for _ in range(50): # the error square wave follows the current's phase
V1 = Vref - 4 * dV / np.pi * np.exp(1j * np.angle(I1))
I1 = V1 / (R + 1j * w * L)
harm = {}
for n in (5, 7, 11, 13): # triplens vanish in a 3-wire load
Vn = 4 * dV / (n * np.pi)
harm[n] = Vn / abs(R + 1j * n * w * L)
thd = np.sqrt(sum(x * x for x in harm.values())) / abs(I1)
return dV, abs(V1), abs(I1), harm, thd
for ma, f1 in ((0.8, 50.0), (0.1, 5.0)):
for td in (0.0, 1e-6, 2e-6):
dV, V1, I1, h, thd = deadtime(ma, f1, td)
print(f"ma = {ma:.1f}, {f1:2.0f} Hz, td = {td*1e6:.0f} us: dV = {dV:.2f} V, V1 = {V1:5.2f} V "
f"(ideal {ma*Vdc/2:5.2f}), I1 = {I1:6.3f} A, I5 = {h[5]*1e3:5.1f} mA, I7 = {h[7]*1e3:5.1f} mA, "
f"THD(5..13) = {100*thd:5.2f} %")ma = 0.8, 50 Hz, td = 0 us: dV = 0.00 V, V1 = 19.20 V (ideal 19.20), I1 = 16.257 A, I5 = 0.0 mA, I7 = 0.0 mA, THD(5..13) = 0.00 %
ma = 0.8, 50 Hz, td = 1 us: dV = 0.48 V, V1 = 18.68 V (ideal 19.20), I1 = 15.817 A, I5 = 37.1 mA, I7 = 19.4 mA, THD(5..13) = 0.27 %
ma = 0.8, 50 Hz, td = 2 us: dV = 0.96 V, V1 = 18.15 V (ideal 19.20), I1 = 15.372 A, I5 = 74.1 mA, I7 = 38.7 mA, THD(5..13) = 0.56 %
ma = 0.1, 5 Hz, td = 0 us: dV = 0.00 V, V1 = 2.40 V (ideal 2.40), I1 = 2.395 A, I5 = 0.0 mA, I7 = 0.0 mA, THD(5..13) = 0.00 %
ma = 0.1, 5 Hz, td = 1 us: dV = 0.48 V, V1 = 1.79 V (ideal 2.40), I1 = 1.786 A, I5 = 116.6 mA, I7 = 79.9 mA, THD(5..13) = 8.56 %
ma = 0.1, 5 Hz, td = 2 us: dV = 0.96 V, V1 = 1.19 V (ideal 2.40), I1 = 1.186 A, I5 = 233.2 mA, I7 = 159.8 mA, THD(5..13) = 25.79 %
At the dead time costs half a volt of fundamental and a current THD of 0.27 %. At the same removes a quarter of the voltage and causes 8.6 % current distortion; with it is half the voltage and 26 % distortion. This is why a drive without compensation runs roughly at low speed and why a sensorless drive needs a good voltage model.
Multilevel inverters
A two-level leg switches the full bus in every transition. At high voltage (medium-voltage drives, grid converters, traction) that means device voltage ratings beyond what a single switch can do efficiently, very high , and large harmonics. Multilevel legs produce more voltage levels:
| Topology | How it adds levels | Notes |
|---|---|---|
| Neutral-point clamped (NPC), 3-level | two series switches per half-leg, clamp diodes to the bus midpoint | each switch blocks ; the midpoint must be balanced by the modulator; the T-type variant suits 400 to 800 V systems |
| Flying capacitor | capacitors between the series switches set intermediate levels | no clamp diodes, but many capacitors to pre-charge and balance |
| Cascaded H-bridge | isolated DC sources, one H-bridge each, outputs in series | modular, any number of levels; needs isolated sources (multi-winding transformer, PV strings, batteries) |
| Modular multilevel converter (MMC) | many half-bridge submodules with their own capacitors per arm | the standard for VSC-HVDC (HVDC and FACTS) |
With levels per leg, each step is , the falls in proportion, and the line voltage approaches a sine wave. The second code cell compares a two-level and a three-level (NPC, phase-disposition carriers) leg at the same carrier frequency.
import numpy as np
Vdc, f1, mf, ma = 48.0, 50.0, 39, 0.9 # carrier 1950 Hz
N = mf * 1000
t = np.arange(N) / (N * f1)
tri = 2 * np.abs(2 * ((mf * f1 * t + 0.25) % 1.0) - 1) - 1 # triangle -1..1
def poles(levels):
out = []
for k in range(3):
ref = ma * np.sin(2 * np.pi * f1 * t - 2 * np.pi * k / 3)
if levels == 2:
out.append(np.where(ref > tri, Vdc / 2, -Vdc / 2))
else: # 3-level NPC: two stacked carriers (phase disposition)
up, lo = (tri + 1) / 2, (tri - 1) / 2
out.append(Vdc / 2 * ((ref > up).astype(float) - (ref < lo).astype(float)))
return out
for lv in (2, 3):
va, vb, vc = poles(lv)
V = np.abs(np.fft.rfft(va - vb)) * 2 / N
n = np.arange(len(V))
thd = np.sqrt(np.sum(V[2:] ** 2)) / V[1]
wthd = np.sqrt(np.sum((V[2:] / n[2:]) ** 2)) / V[1]
steps = np.unique(np.round(va - vb, 6)).size
print(f"{lv}-level: line V1 = {V[1]/np.sqrt(2):5.2f} V rms, line levels = {steps}, "
f"THD = {100*thd:5.1f} %, WTHD = {100*wthd:5.2f} %, largest harmonic n = {int(np.argmax(V[2:]) + 2)}")2-level: line V1 = 26.45 V rms, line levels = 3, THD = 79.7 %, WTHD = 1.24 %, largest harmonic n = 37
3-level: line V1 = 26.45 V rms, line levels = 5, THD = 39.2 %, WTHD = 0.57 %, largest harmonic n = 73
Same fundamental, but the three-level line voltage has five levels instead of three. Its THD and WTHD are halved, and its largest harmonic has moved from the sidebands of to those of . For the same current ripple, a three-level inverter can switch at roughly half the frequency, or use half the filter.
Guided lab: dead time on a low-voltage bridge
Hand calculation. For your board's bus voltage, PWM frequency and dead time (in the firmware or the driver's datasheet), compute and compare it with the voltage you command at low speed.
Simulation. Use the first cell with your values; find the at which the 5th-harmonic current reaches 5 % of the fundamental.
What you would measure. On a three-phase or H-bridge evaluation board at 24 V or less, current-limited, with three power resistors and inductors (or a small motor held stalled at low current), command a low-frequency sine (a few hertz) at small amplitude. With a current probe you see a flattened step near each current zero crossing (zero-current clamping): the current lingers near zero because the voltage error reverses with it. Raise the dead time in firmware from to and the flat spots grow; turn on dead-time compensation, if the firmware has it, and they shrink. Scope measurements of the flat-spot width are good to about 10 %.
Hazards and safe setup. Never set the dead time to zero or below the driver's minimum: shoot-through destroys the bridge. Keep the supply at or less with a current limit, keep motors clamped, and expect warm inductors and resistors. Medium-voltage multilevel drives and grid converters are calculation and simulation only.
Pitfalls
- Judging a modulator by voltage THD. Use WTHD or the current spectrum.
- Tuning dead time at full speed only. Its effect is worst at low speed and light load.
- Compensating dead time with a noisy current sign. Near zero current the compensation itself flips randomly; blend it smoothly.
- Forgetting the NPC midpoint. Unbalanced capacitor voltages distort the output and overstress switches.
Practice
- , , (calculation only). Find .
- What amplitude does the 7th harmonic of a dead-time square wave have?
- A five-level cascaded H-bridge uses how many H-bridges per phase, and what is each step if the total peak is ?
Answer
- .
- peak.
- Two H-bridges per phase (levels ), each step .
Test yourself
Why is weighted THD (WTHD) a better figure than voltage THD for comparing PWM methods on a motor?
- It ignores the fundamental
- Dividing each harmonic by its order mimics the inductive load, so WTHD is proportional to current distortion
- It only counts even harmonics
- It is required by IEEE 1547
During the dead time, a positive load current (out of the leg) flows through…
- the upper switch
- the lower antiparallel diode, so the pole voltage is low and the pulse is shortened
- the DC-link capacitor only
- nothing; it stops
The dead-time error matters most when…
- the motor runs at full speed and full voltage
- the commanded voltage is small (low speed), because the error is a fixed number of volts
- the switching frequency is low
- the load is resistive
Compared with a two-level leg, a three-level NPC leg…
- needs switches rated for twice the bus
- has switches that each block half the bus and produces smaller voltage steps with lower harmonics
- cannot make a sinusoidal output
- does not need a modulator