---
title: Grid-tied inverters
heading: Inverters that feed the grid: current control synchronized by a PLL, real and reactive power from the current's phase, the DC link voltage the filter inductance demands, LCL filters and their resonance
eyebrow: S11 · Lesson 36 · Grid-tied inverters
xp: 50
---

::: hook
A solar inverter, a battery's grid converter and a wind turbine's line-side converter all push current into a grid whose voltage they don't control. They lock to the grid's phase with a phase-locked loop and regulate the current they inject: in phase with the voltage for real power, a quarter-cycle off for reactive power. Between the switching bridge and the grid sits a filter that must remove the switching ripple without ringing, and the bridge must have enough DC voltage to push current through it.
:::

::: play
- The curve is the attenuation an LCL filter adds over a single inductor of the same total inductance, $|(f/f_\text{res})^2 - 1|$ in decibels, against frequency, for L₁ = 2 mH, L₂ = 0.5 mH and the capacitance on the slider.
- Below the resonance the filter behaves like one inductor; above it the extra attenuation grows at 40 dB per decade.
- At the resonance itself the undamped filter would amplify, which is why LCL filters need passive or active damping.
:::

```sim plot
view: graph
x: f = 0.5..50 log
y: A = -10..60
slider: C = 2..40 = 10
plot: 20*log(abs((f*1e3/(1/(2*pi)*sqrt(2.5e-3/(2e-3*0.5e-3*C*1e-6))))^2 - 1)) | label: extra attenuation, dB, against kHz
```

::: predict
## A grid inverter on a 480 V, 60 Hz line delivers 10 kW at unity power factor through 5 mH per phase. How much higher than the grid voltage must its own output be?

- [ ] About 8%, the inductor's full drop
- [x] Only about 0.3%: the 22.7 V inductor drop is at right angles to the grid voltage
- [ ] It must be lower
- [ ] About 50%

::: reveal
The current, 12.0 A, is in phase with the 277 V phase voltage, and the inductor's drop $j\omega LI$ = 22.7 V is 90° ahead of it, so the inverter's voltage is $\sqrt{277^2 + 22.7^2}$ = 278.1 V: only 0.3% more, though turned by 4.7°. Supplying reactive power changes that: the drop then adds almost in phase and the inverter needs more DC voltage.
:::
:::

::: nameit
## Current control

A grid-following inverter measures the grid voltage's angle with a PLL and regulates its output current, usually in a rotating dq frame aligned with the voltage, where the d-axis current carries real power and the q-axis current reactive power. Per phase, with grid voltage $V_g$ (RMS) and current I at angle φ:
$$P = 3V_gI\cos\phi, \qquad Q = 3V_gI\sin\phi, \qquad S = \sqrt{P^2 + Q^2} \le S_\text{rated}$$
so an inverter rated S can supply up to $\sqrt{S^2 - P^2}$ of vars alongside P.

## The bridge voltage

Between the bridge and the grid, the filter inductance L drops $j\omega LI$. The bridge must produce $V_i = V_g + j\omega LI$ per phase, and with space-vector modulation (lesson 35) its DC link must satisfy $V_{dc} \ge \sqrt2\sqrt3|V_i|$, with margin for grid overvoltage and control headroom.

## LCL filters

A single inductor large enough to meet grid harmonic limits at the switching frequency is heavy. Splitting it into $L_1$ (bridge side) and $L_2$ (grid side) with a capacitor C between gives third-order attenuation above the resonance
$$f_\text{res} = \frac{1}{2\pi}\sqrt{\frac{L_1 + L_2}{L_1L_2C}}$$
exactly $|(f/f_\text{res})^2 - 1|$ times better than an inductor of the same total when the grid is stiff, close to $(f/f_\text{res})^2$ well above the resonance. The resonance is placed between about ten times the grid frequency and half the switching frequency, and damped by a resistor in series with C or by feedback of the capacitor current.

## Grid support

Modern interconnection rules require inverters to ride through faults, to inject reactive current during voltage sags, and to adjust their real power with frequency, behaving more like the synchronous machines they replace (S10 lesson 46).
:::

::: example
## A 10 kW inverter on a 480 V, 60 Hz grid at unity power factor has 5 mH per phase. Find its current, its bridge voltage and the DC link it needs with space-vector modulation.

::: solution
1. **Current.**
   $$\begin{aligned} I &= \frac{10\,000}{\sqrt3 \times 480} \\ &= 12.0\ \text{A} \end{aligned}$$
2. **Inductor drop.** With ω = 377 rad/s and L = 5 mH:
   $$\begin{aligned} V_L &= \omega LI \\ &= 22.7\ \text{V} \end{aligned}$$
   at right angles to the 277 V phase voltage.
3. **Bridge voltage.** Per phase:
   $$\begin{aligned} V_b &= \sqrt{277.13^2 + 22.68^2} \\ &= 278.1\ \text{V} \end{aligned}$$
4. **DC link.**
   $$\begin{aligned} V_{dc} &\ge \sqrt2\sqrt3 \times 278.1 \\ &= 681\ \text{V} \end{aligned}$$
   before margins; designs typically use 750 to 800 V.

**Answer:** 12.0 A, a bridge voltage of 278.1 V per phase, and a DC link of at least 681 V.
:::
:::

::: example
## An LCL filter has $L_1$ = 2 mH, $L_2$ = 0.5 mH and C = 10 µF. Where is its resonance, and how much extra does it attenuate a 10 kHz switching harmonic?

::: solution
1. **Resonance.** With $L_1 + L_2$ = 2.5 mH:
   $$\begin{aligned} f_\text{res} &= \frac{1}{2\pi}\sqrt{\frac{L_1 + L_2}{L_1L_2C}} \\ &= 2.52\ \text{kHz} \end{aligned}$$
   between 600 Hz (ten times the grid frequency) and 5 kHz (half the switching frequency).
2. **Extra attenuation at 10 kHz.**
   $$\begin{aligned} A &= (f/f_\text{res})^2 - 1 \\ &= 14.8 \\ &= 23.4\ \text{dB} \end{aligned}$$
   more than a 2.5 mH inductor alone.

**Answer:** it resonates at 2.52 kHz and attenuates a 10 kHz harmonic 14.8 times (23.4 dB) more than a 2.5 mH inductor alone.
:::
:::

::: example
## A 10 kVA inverter is delivering 8 kW. How much reactive power can it supply for voltage support?

::: solution
1. **Reactive capability.** The inverter's current rating sets its apparent power:
   $$\begin{aligned} Q_\max &= \sqrt{10^2 - 8^2}\ \text{kvar} \\ &= 6\ \text{kvar} \end{aligned}$$
2. **In practice.** Grid codes that require reactive support often oversize inverters by 10 to 20% so they can supply vars even at full real power, or curtail real power when vars are needed.

**Answer:** up to 6 kvar.
:::
:::

::: check
kind: parts
given: P = 5 | 20 | 100; V = 400 | 480; L = 2 | 5 | 10; f = 50 | 60

## A {P} kW grid inverter at unity power factor feeds a {V} V, {f} Hz line through {L} mH per phase.

::: part
answer: P*1e3/(sqrt(3)*V)
unit: A
tolerance: 0.5%

### What current does it inject?

::: misses
- [any] $P/(\sqrt3V_{LL})$.
:::
:::

::: part
answer: sqrt((V/sqrt(3))^2 + (2*pi*f*L*1e-3*P*1e3/(sqrt(3)*V))^2)
unit: V
tolerance: 0.5%

### What phase voltage must its bridge produce?

::: misses
- [V/sqrt(3) + 2*pi*f*L*1e-3*P*1e3/(sqrt(3)*V)] At unity power factor the inductor drop is at right angles.
- [any] $|V_g + j\omega LI|$.
:::
:::
:::

::: check
kind: parts
given: a = 1 | 2 | 4; b = 0.25 | 0.5 | 1; C = 5 | 10 | 20; s = 8 | 16

## An LCL filter has $L_1$ = {a} mH, $L_2$ = {b} mH and C = {C} µF; the inverter switches at {s} kHz.

::: part
answer: 1/(2*pi)*sqrt((a + b)*1e-3/(a*1e-3*b*1e-3*C*1e-6))/1e3
unit: kHz
tolerance: 0.5%

### Where is its resonance?

::: misses
- [1/(2*pi*sqrt(a*1e-3*C*1e-6))/1e3] Both inductors set it: $\sqrt{(L_1 + L_2)/(L_1L_2C)}$.
- [any] $\frac{1}{2\pi}\sqrt{(L_1 + L_2)/(L_1L_2C)}$.
:::
:::

::: part
answer: 20*log(abs((s/(1/(2*pi)*sqrt((a + b)*1e-3/(a*1e-3*b*1e-3*C*1e-6))/1e3))^2 - 1))
unit: dB
tolerance: 1%

### How much more does it attenuate the switching frequency than a single inductor of the same total, with a stiff grid?

::: misses
- [any] $|(f_s/f_\text{res})^2 - 1|$ in dB.
:::
:::
:::

::: check
kind: parts
given: S = 5 | 10 | 50; p = 0.6 | 0.8 | 0.95

## An inverter rated {S} kVA delivers {p} of that as real power.

::: part
answer: S*sqrt(1 - p^2)
unit: kvar
tolerance: 0.5%

### How much reactive power can it add?

::: misses
- [S*(1 - p)] Apparent power adds in quadrature.
- [any] $\sqrt{S^2 - P^2}$.
:::
:::
:::

::: check
kind: parts
given: V = 208 | 400 | 480 | 690; m = 5 | 10

## A grid inverter for a {V} V line needs a {m}% margin over the minimum DC link with space-vector modulation, ignoring the filter drop.

::: part
answer: V*sqrt(2)*(1 + m/100)
unit: V
tolerance: 0.5%

### What DC link voltage?

::: misses
- [any] $\sqrt2V_{LL}$ plus margin.
:::
:::
:::

::: check
kind: parts
given: V = 230 | 277; I = 10 | 40; p = 0 | 30 | 60

## Each phase of a grid inverter carries {I} A RMS at {p}° from its {V} V phase voltage.

::: part
answer: 3*V*I*cos(p*pi/180)/1e3
unit: kW
tolerance: 0.5%

### What real power?

::: misses
- [any] $3V_gI\cos\phi$.
:::
:::

::: part
answer: 3*V*I*sin(p*pi/180)/1e3
unit: kvar
tolerance: 0.5%

### What reactive power?

::: misses
- [any] $3V_gI\sin\phi$.
:::
:::
:::

::: check
kind: parts
given: g = 50 | 60; s = 4 | 10 | 20

## An LCL filter's resonance should sit between ten times the {g} Hz grid frequency and half the {s} kHz switching frequency.

::: part
answer: sqrt(10*g*s*1e3/2)
unit: Hz
tolerance: 0.5%

### What resonance is at the geometric middle of that range?

::: misses
- [any] $\sqrt{10f_g \cdot f_s/2}$.
:::
:::
:::

::: check
kind: choice

## Why does an LCL filter need damping, when a single inductor doesn't?

- [ ] The capacitor leaks current
- [x] The LC section forms an undamped resonance; any harmonic or control action near it would be amplified, and the current loop could go unstable there, so a series resistor or feedback of the capacitor's current must damp it
- [ ] The grid's frequency drifts
- [ ] Inductors need damping too

::: misses
- [1] Leakage isn't the issue.
- [3] Frequency drift is small and irrelevant to the resonance.
- [4] A lone inductor has no resonance to damp.
:::
:::

::: check
kind: derivation
vars: V = 100..400, I = 1..200, w = 300..400, L = 0.0001..0.02, a = 0.0001..0.01, b = 0.00005..0.005, C = 0.000001..0.00005

## A grid inverter injects I in phase with phase voltage V through L at angular frequency w; separately, an LCL filter has $L_1$ = a, $L_2$ = b and capacitance C.

::: step
answer: sqrt(V^2 + (w*L*I)^2)

### What bridge phase voltage is needed?
:::

::: step
answer: 1/(2*pi)*sqrt((a + b)/(a*b*C))

### Where does the LCL filter resonate?
:::

::: right
Right. At unity power factor the inductor costs angle, not much voltage; the filter's resonance must be kept away from both the grid and the switching frequency.
:::
:::

::: check
kind: python

## Write `bridge_voltage(Vg, P, Q, L, f)`: the complex per-phase bridge voltage (grid phase voltage Vg RMS at 0°) for three-phase real power P and reactive power Q (positive Q supplied to the grid), through L at frequency f.

```python starter
def bridge_voltage(Vg, P, Q, L, f):
    return complex(Vg)
```

```python solution
import math

def bridge_voltage(Vg, P, Q, L, f):
    I = (P - 1j * Q) / (3 * Vg)
    return Vg + 1j * 2 * math.pi * f * L * I
```

```python tests
import cmath, math
V = bridge_voltage(480 / math.sqrt(3), 10e3, 0, 5e-3, 60)
assert abs(abs(V) - 278.05) < 0.05 and abs(math.degrees(cmath.phase(V)) - 4.68) < 0.05, "Unity power factor: 278.1 V at 4.7°."
Vq = bridge_voltage(480 / math.sqrt(3), 0, 10e3, 5e-3, 60)
assert abs(abs(Vq) - (480 / math.sqrt(3) + 2 * math.pi * 60 * 5e-3 * 10e3 / (3 * 480 / math.sqrt(3)))) < 0.01, "Supplying 10 kvar: the 22.7 V drop adds in phase, to 299.8 V."
```

::: right
Right. Supplying vars puts the inductor's drop in phase with the grid voltage, so reactive support costs DC link voltage.
:::
:::

::: explain
## Why do grid-following inverters need a phase-locked loop, and what problem can it cause on weak grids?

::: model
A grid-following inverter controls the current it injects relative to the grid voltage's angle, so it must know that angle at every instant; the phase-locked loop estimates it from the measured voltage. On a stiff grid the voltage hardly responds to the inverter's own current, so the PLL tracks a steady reference. On a weak grid, with high impedance, the injected current itself moves the local voltage, so the PLL partly follows the inverter's own effect, which can create a feedback loop that oscillates or loses synchronism. That's why weak grids call for slower PLLs, grid-forming control, or added short-circuit strength such as synchronous condensers.
:::
:::

::: practice
::: check
given: P = 3 | 30; V = 208 | 480
answer: P*1e3/(sqrt(3)*V)
unit: A
tolerance: 0.5%

## Current for {P} kW at unity pf on {V} V?

::: misses
- [any] $P/(\sqrt3V_{LL})$.
:::
:::

::: check
given: a = 1.5 | 3; b = 0.3 | 0.8; C = 4.7 | 15
answer: 1/(2*pi)*sqrt((a + b)*1e-3/(a*1e-3*b*1e-3*C*1e-6))/1e3
unit: kHz
tolerance: 0.5%

## LCL resonance: {a} mH, {b} mH, {C} µF?

::: misses
- [any] $\frac{1}{2\pi}\sqrt{(L_1 + L_2)/(L_1L_2C)}$.
:::
:::

::: check
given: S = 8 | 25; p = 0.7 | 0.9
answer: S*sqrt(1 - p^2)
unit: kvar
tolerance: 0.5%

## Reactive capacity of a {S} kVA inverter at {p} real loading?

::: misses
- [any] $\sqrt{S^2 - P^2}$.
:::
:::
:::
