TExcelTAD
Home › Power Electronics & Motor Drives › Inverter Harmonics, THD, Dead-Time Effects and Multilevel Inverters

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 X1,X2,…X_1, X_2, \dots:

THD=∑n≥2Xn2X1,WTHD=∑n≥2(Vn/n)2V1\text{THD} = \frac{\sqrt{\sum_{n \ge 2} X_n^2}}{X_1}, \qquad \text{WTHD} = \frac{\sqrt{\sum_{n \ge 2} (V_n/n)^2}}{V_1}

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 nωLn\omega L. 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 Isc/IL<20I_{sc}/I_L < 20), while motor drives care about harmonic losses and torque ripple (Grid-Tied Inverters, Power Quality).

Dead time: a voltage error that follows the current

commandupper gate lower gatevaN, i > 0vaN, i < 0 tdtd t1t2 pulse shortened by tdpulse lengthened by td

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 (i>0i > 0), the lower diode conducts and the pole voltage stays low until the upper switch turns on: each pulse is shortened by tdt_d. If the current flows into the leg, the upper diode conducts and each pulse is lengthened by tdt_d. Averaged over a switching period, the error is:

Δv=−sign⁡(i)  Vdc td fsw\Delta v = -\operatorname{sign}(i)\; V_{dc}\, t_d\, f_{sw}

Over a fundamental period that is a square wave of amplitude Δv\Delta v, in phase with the current and opposing it. Its harmonics are 4Δvnπ\frac{4\Delta v}{n\pi} at n=1,3,5,7,…n = 1, 3, 5, 7, \dots. 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 (VCE,satV_{CE,sat}, RDS(on)R_{DS(on)} times the current, diode forward voltage) add a similar error. Remedies: shorter dead time (faster gate drive, GaN), dead-time compensation (add +sign⁡(i) Δv+\operatorname{sign}(i)\,\Delta v 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 48 V48\ \text{V}, fsw=10 kHzf_{sw} = 10\ \text{kHz}, dead time td=1 μst_d = 1\ \mu\text{s}, star load R=1 ΩR = 1\ \Omega, L=2 mHL = 2\ \text{mH} per phase. Two operating points: ma=0.8m_a = 0.8 at 50 Hz50\ \text{Hz}, and ma=0.1m_a = 0.1 at 5 Hz5\ \text{Hz} (low speed).

Find: Δv\Delta v and the 5th-harmonic current at both points.

Solve:

Δv=48 V⋅1 μs⋅10 kHz=0.48 V,V5=4⋅0.48 V5π=0.122 VI5(50 Hz)=0.122 V∣1+j 2π⋅250⋅0.002∣ Ω=0.1223.30 A=37.1 mAI5(5 Hz)=0.122 V∣1+j 2π⋅25⋅0.002∣ Ω=0.1221.048 A=116.6 mA\begin{aligned} \Delta v &= 48\ \text{V} \cdot 1\ \mu\text{s} \cdot 10\ \text{kHz} = 0.48\ \text{V}, \qquad V_5 = \frac{4 \cdot 0.48\ \text{V}}{5\pi} = 0.122\ \text{V} \\ I_5(50\ \text{Hz}) &= \frac{0.122\ \text{V}}{\lvert 1 + j\,2\pi \cdot 250 \cdot 0.002 \rvert\ \Omega} = \frac{0.122}{3.30}\ \text{A} = 37.1\ \text{mA} \\ I_5(5\ \text{Hz}) &= \frac{0.122\ \text{V}}{\lvert 1 + j\,2\pi \cdot 25 \cdot 0.002 \rvert\ \Omega} = \frac{0.122}{1.048}\ \text{A} = 116.6\ \text{mA} \end{aligned}

Check: 0.48 V0.48\ \text{V} is 2.5 % of the 19.2 V19.2\ \text{V} commanded peak at ma=0.8m_a = 0.8, but 20 % of the 2.4 V2.4\ \text{V} commanded at ma=0.1m_a = 0.1. 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.

python · try it yourself
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 50 Hz50\ \text{Hz} the dead time costs half a volt of fundamental and a current THD of 0.27 %. At 5 Hz5\ \text{Hz} the same 1 μs1\ \mu\text{s} removes a quarter of the voltage and causes 8.6 % current distortion; with 2 μs2\ \mu\text{s} 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 dv/dtdv/dt, 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 Vdc/2V_{dc}/2; 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 kk levels per leg, each step is Vdc/(k−1)V_{dc}/(k - 1), the dv/dtdv/dt 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.

python · try it yourself
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 mf=39m_f = 39 to those of 2mf2m_f. 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 Δv\Delta v and compare it with the voltage you command at low speed.

Simulation. Use the first cell with your values; find the mam_a 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 0.50.5 to 2 μs2\ \mu\text{s} 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 24 V24\ \text{V} 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

  1. Vdc=600 VV_{dc} = 600\ \text{V}, fsw=8 kHzf_{sw} = 8\ \text{kHz}, td=2 μst_d = 2\ \mu\text{s} (calculation only). Find Δv\Delta v.
  2. What amplitude does the 7th harmonic of a Δv=1 V\Delta v = 1\ \text{V} dead-time square wave have?
  3. A five-level cascaded H-bridge uses how many H-bridges per phase, and what is each step if the total peak is 400 V400\ \text{V}?
Answer
  1. Δv=600⋅2×10−6⋅8000=9.6 V\Delta v = 600 \cdot 2 \times 10^{-6} \cdot 8000 = 9.6\ \text{V}.
  2. 4⋅1/(7π)=0.182 V4 \cdot 1/(7\pi) = 0.182\ \text{V} peak.
  3. Two H-bridges per phase (levels −2,−1,0,+1,+2-2, -1, 0, +1, +2), each step 200 V200\ \text{V}.

Test yourself

Why is weighted THD (WTHD) a better figure than voltage THD for comparing PWM methods on a motor?

  1. It ignores the fundamental
  2. Dividing each harmonic by its order mimics the inductive load, so WTHD is proportional to current distortion
  3. It only counts even harmonics
  4. It is required by IEEE 1547

During the dead time, a positive load current (out of the leg) flows through…

  1. the upper switch
  2. the lower antiparallel diode, so the pole voltage is low and the pulse is shortened
  3. the DC-link capacitor only
  4. nothing; it stops

The dead-time error matters most when…

  1. the motor runs at full speed and full voltage
  2. the commanded voltage is small (low speed), because the error is a fixed number of volts
  3. the switching frequency is low
  4. the load is resistive

Compared with a two-level leg, a three-level NPC leg…

  1. needs switches rated for twice the bus
  2. has switches that each block half the bus and produces smaller voltage steps with lower harmonics
  3. cannot make a sinusoidal output
  4. does not need a modulator