S11 · Lesson 38 · Inverter lab
Generating sinusoidal PWM and measuring its spectrum, leg duty cycles for space-vector modulation, an LCL filter's exact attenuation and the damping trade-off, and a cascaded H-bridge's phase-shifted carriers
Lessons 33 to 37 claimed a lot about inverters: that sinusoidal PWM puts no low-order harmonics in the output, that space-vector modulation is the same as adding a common-mode offset, that an LCL filter attenuates as the square of frequency above its resonance, that phase-shifted cells push the ripple up by a factor of 2k. Each claim is easy to test numerically. In this lab you'll generate the switching waveforms sample by sample and measure them.
- The curve is an LCL filter's grid current against the bridge voltage, relative to a single inductor of the same total, in decibels: L₁ = 2 mH, L₂ = 0.5 mH, C = 10 µF, with a damping resistor in series with C on the slider.
- With no damping the response spikes at 2.52 kHz; a few ohms flattens the spike.
- Damping costs attenuation at high frequency: at 10 kHz, 23.4 dB with none, 19.0 dB with 2.1 Ω.
Predict
Adding a damping resistor equal to a third of the capacitor's reactance at resonance (2.1 Ω here) tames the LCL filter's peak. What does it cost at the 10 kHz switching frequency?
Above the resonance the resistor's impedance competes with the capacitor's falling reactance, so the capacitor no longer shunts the ripple as well: attenuation falls from 23.4 to 19.0 dB at 10 kHz, and the resistor dissipates the ripple current flowing through it. That's why active damping, feeding back the capacitor current, is preferred in larger inverters. Task 3 computes both numbers.
Name it
What the lab computes
- Sinusoidal PWM: a leg is high when the reference exceeds a triangle carrier at times the fundamental. Sampled finely over one period, the output's DFT shows the fundamental at m (in units of ) up to m = 1, and harmonics only around multiples of .
- Space-vector duties: for phase references in units of , the leg duties center the zero vectors exactly as lesson 35's dwell times do.
- LCL filter: with and the grid as a short,
which for = 0 is exactly times smaller than one inductor's response.
- Cascaded H-bridges: each cell compares and with its carrier (unipolar); cell j's carrier is shifted by j/(2k) of a carrier period.
Check
Write spwm(m, mf, N): N samples (at the midpoints of N equal steps) of one fundamental period of a half-bridge leg's output, ±1 (in units of ), comparing with a triangle carrier that is +1 at θ = 0 and has periods per fundamental period.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write svm_duties(m, theta_deg): the three leg duty cycles for space-vector modulation with centered zero vectors.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write lcl_ratio(L1, L2, C, Rd, f): the magnitude of times , so that 1 means "the same as one inductor", and lcl_peak(L1, L2, C, Rd): the largest ratio over a log sweep from 100 Hz to 100 kHz.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write chb(k, mf, m, N): N samples (at step midpoints) of one fundamental period of a cascaded H-bridge phase with k cells, in units of one cell's DC voltage, using unipolar PWM against triangle carriers with periods per fundamental period, cell j's carrier shifted by j/(2k) of a carrier period.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why do phase-shifted carriers move a cascaded H-bridge's ripple to times the carrier frequency?
Each unipolar cell's output contains ripple groups around twice its carrier frequency and its multiples. Shifting cell j's carrier by j/(2k) of a carrier period shifts that cell's ripple at twice the carrier frequency by j/k of a full cycle, so the k cells' ripple components at that frequency are spread evenly around the circle and sum to zero. The same happens at every multiple of twice the carrier frequency except multiples of 2k, where the shifts become whole cycles and the components add. The fundamental is unaffected because every cell follows the same reference, so the output keeps the full voltage with ripple only near 2k times the carrier frequency.