TExcelTAD
Home › Power Electronics & Motor Drives › Grid-Tied Inverters: Synchronisation, Current Control and IEEE 1547

Grid-Tied Inverters: Synchronisation, Current Control and IEEE 1547

A rooftop PV system, a home battery and a wind turbine's converter all end in the same box: an inverter that pushes current into a grid it does not control. It must make its current sinusoidal and in step with a voltage that wanders in frequency, jumps in phase during faults and is distorted by everyone else's loads. It must deliver exactly the power its DC side offers, supply or absorb reactive power on command, keep running through grid disturbances that the rules say it must ride through, and stop within two seconds when the grid disappears so that it never energises a line a worker believes is dead. This lesson builds that controller from parts the course already has: the inverter and SVPWM (Space-Vector PWM), the Park transform and dq current loops (Clarke and Park Transforms and FOC), and a phase-locked loop.

Safety: calculation and simulation only. Grid-tied inverters are mains equipment with DC links of several hundred volts. Never connect anything you build to the grid or to a socket, not even through a small transformer, and never back-feed a building's wiring. The bench part of this lesson locks a PLL onto a signal generator.

The structure

PV +boost Cdc, 700 V 3-phaseinverter L 5 mH relay grid400 V, 50 Hz PI on Vdc dq currentPI + ff inv Park, SVPWM PLL protection,anti-islanding id*Q* gives iq*theta, vd (feed-forward) Vdc

The inverter is a current source towards the grid: a filter inductor sits between the bridge's PWM voltage and the grid voltage, and the controller sets the current through it. Two cascaded loops do the work. The outer loop holds the DC-link voltage: if the PV stage delivers more power than the inverter exports, VdcV_{dc} rises and the loop raises the active current reference id∗i_d^*; so the inverter always exports what the DC side supplies. The inner loops regulate the currents in a frame aligned with the grid voltage, where with amplitude-invariant transforms and vq=0v_q = 0

P=32 vd id,Q=−32 vd iqP = \tfrac{3}{2}\, v_d\, i_d, \qquad Q = -\tfrac{3}{2}\, v_d\, i_q

so idi_d sets active power and iqi_q reactive power (with this sign, a negative iqi_q injects reactive power, like an over-excited generator). The plant of each axis is the filter, L di/dt=vinv−Ri−vgridL\,di/dt = v_\text{inv} - Ri - v_\text{grid} plus the cross-coupling ±ωLi\pm\omega L i; the controller adds the measured grid voltage and the coupling terms as feed-forward, and the PI gains are those of the FOC lesson, Kp=ωcLK_p = \omega_c L, Ki=ωcRK_i = \omega_c R. Single-phase inverters cannot form a dq frame from one voltage directly; they either build an orthogonal signal (a second-order generalised integrator) or use a proportional-resonant controller, which has infinite gain at 50 Hz50\ \text{Hz} the way an integrator has at DC.

The filter. A plain inductor needs many millihenries to keep the switching ripple within the harmonic limits. Most inverters use an LCL filter (L1L_1 on the bridge, CC, L2L_2 towards the grid), whose third-order roll-off does more with less inductance but adds a resonance at fres=12π(L1+L2)/(L1L2C)f_\text{res} = \frac{1}{2\pi}\sqrt{(L_1 + L_2)/(L_1 L_2 C)} that must be damped, passively with a resistor in series with CC or actively in the control; for L1=2 mHL_1 = 2\ \text{mH}, L2=1 mHL_2 = 1\ \text{mH}, C=10 μFC = 10\ \mu\text{F} it lies at 1.95 kHz1.95\ \text{kHz}, between the line frequency and a 10 kHz10\ \text{kHz} carrier, as it should.

Synchronisation: the phase-locked loop

The synchronous-reference-frame PLL applies the Park transform to the grid voltages with its own angle estimate θ^\hat\theta. If θ^\hat\theta is right, vq=0v_q = 0; if it lags by a small angle, vq≈Vm(θ−θ^)v_q \approx V_m(\theta - \hat\theta). A PI controller turns vqv_q into a frequency, which integrates to θ^\hat\theta. Linearised, the loop is second order:

ωn=VmKi,ζ=Kp2VmKi\omega_n = \sqrt{V_m K_i}, \qquad \zeta = \frac{K_p}{2}\sqrt{\frac{V_m}{K_i}}

A fast PLL follows phase jumps quickly but passes harmonics and unbalance into its angle; a slow one is smooth but lags during disturbances. Bandwidths of 1010 to 30 Hz30\ \text{Hz} are common; weak grids need care, because the inverter's own current then moves the voltage the PLL measures.

python · try it yourself
import numpy as np

# Synchronous-reference-frame PLL on a 400 V, 50 Hz grid (phase peak 326.6 V), sampled at 10 kHz
Vm, h = 400 / np.sqrt(3) * np.sqrt(2), 1e-4
wn, zeta = 2 * np.pi * 20, 0.707                 # loop natural frequency 20 Hz
Kp, Ki = 2 * zeta * wn / Vm, wn**2 / Vm          # linearised loop: vq = Vm (theta - theta_hat)
print(f"Kp = {Kp:.4f} rad/(V s), Ki = {Ki:.2f} rad/(V s^2)")

def grid(t):
    """Grid angle: 50 Hz, a 20 degree phase jump at 0.10 s, then 50.5 Hz from 0.20 s."""
    th = 2 * np.pi * 50 * t + (np.radians(20) if t >= 0.10 else 0.0)
    if t >= 0.20:
        th += 2 * np.pi * 0.5 * (t - 0.20)
    return th

th_hat, integ = 0.0, 2 * np.pi * 50              # start locked at nominal frequency
marks = {0.0999, 0.1000, 0.1050, 0.1200, 0.1500, 0.2100, 0.2500, 0.4000}
print("   t (s)   angle error (deg)   f estimate (Hz)")
for n in range(4001):
    t = n * h
    th = grid(t)
    va, vb, vc = (Vm * np.cos(th - k * 2 * np.pi / 3) for k in range(3))
    al = (2 / 3) * (va - 0.5 * vb - 0.5 * vc)
    be = (vb - vc) / np.sqrt(3)
    vq = -al * np.sin(th_hat) + be * np.cos(th_hat)   # Park with the estimated angle
    integ += Ki * vq * h
    w = integ + Kp * vq
    if round(t, 4) in marks:
        err = round(float(np.degrees((th - th_hat + np.pi) % (2 * np.pi) - np.pi)), 3) + 0.0
        print(f"  {t:6.4f}      {err:8.3f}            {w / (2 * np.pi):7.3f}")
    th_hat += w * h
Kp = 0.5441 rad/(V s), Ki = 48.35 rad/(V s^2)
   t (s)   angle error (deg)   f estimate (Hz)
  0.0999         0.000             50.000
  0.1000        20.000             59.758
  0.1050         6.027             55.717
  0.1200        -4.004             49.637
  0.1500         0.162             49.972
  0.2100         0.647             50.532
  0.2500        -0.022             50.496
  0.4000         0.000             50.500

With a 20 Hz20\ \text{Hz} loop the 20∘20^\circ phase jump is down to 6∘6^\circ after 5 ms5\ \text{ms} and below 0.2∘0.2^\circ after 50 ms50\ \text{ms}, and the PI's integrator follows the frequency step to 50.5 Hz50.5\ \text{Hz} with no steady angle error (two integrators in the loop track a ramp in phase). Note the frequency estimate: for a moment the phase jump looks like 59.8 Hz59.8\ \text{Hz}. A protection function that trusted this raw estimate would trip on every nearby fault, which is why frequency and rate-of-change-of-frequency (RoCoF) measurements are filtered and why ride-through requirements specify phase jumps explicitly.

Worked example: a 10 kW three-phase inverter

Given: 10 kW10\ \text{kW} into a 400 V400\ \text{V}, 50 Hz50\ \text{Hz} grid at unity power factor, then with 4.9 kvar4.9\ \text{kvar} injected; filter L=5 mHL = 5\ \text{mH}, R=0.1 ΩR = 0.1\ \Omega per phase; DC link 700 V700\ \text{V}; current-loop bandwidth 1 kHz1\ \text{kHz}.

Find: id∗i_d^*, the inverter voltage needed, the minimum DC-link voltage, and the PI gains.

Solve:

vd=2⋅230.9 V=326.6 V,id∗=2⋅10 kW3⋅326.6 V=20.41 A (14.43 A rms)unity pf: vinv=(326.6+0.1⋅20.41)2+(1.571 Ω⋅20.41 A)2=330.2 Viq=−10 A: vinv=(326.6+2.04+15.71)2+(−1.0+32.06)2=345.7 V,Vdc≥3⋅345.7 V=599 VKp=2π⋅1000⋅5 mH=31.42 V/A,Ki=2π⋅1000⋅0.1 Ω=628.3 V/(A s)\begin{aligned} v_d &= \sqrt 2 \cdot 230.9\ \text{V} = 326.6\ \text{V}, \qquad i_d^* = \frac{2 \cdot 10\ \text{kW}}{3 \cdot 326.6\ \text{V}} = 20.41\ \text{A}\ (14.43\ \text{A rms}) \\ \text{unity pf: } v_\text{inv} &= \sqrt{(326.6 + 0.1 \cdot 20.41)^2 + (1.571\ \Omega \cdot 20.41\ \text{A})^2} = 330.2\ \text{V} \\ i_q = -10\ \text{A}: \ v_\text{inv} &= \sqrt{(326.6 + 2.04 + 15.71)^2 + (-1.0 + 32.06)^2} = 345.7\ \text{V}, \qquad V_{dc} \ge \sqrt 3 \cdot 345.7\ \text{V} = 599\ \text{V} \\ K_p &= 2\pi \cdot 1000 \cdot 5\ \text{mH} = 31.42\ \text{V/A}, \qquad K_i = 2\pi \cdot 1000 \cdot 0.1\ \Omega = 628.3\ \text{V/(A s)} \end{aligned}

Check: Q=1.5⋅326.6⋅10=4.90 kvarQ = 1.5 \cdot 326.6 \cdot 10 = 4.90\ \text{kvar}. Injecting reactive power raises the voltage the bridge must make; 700 V700\ \text{V} leaves 100 V100\ \text{V} of margin for grid overvoltage (at 1.10 pu1.10\ \text{pu} the unity-pf point alone needs about 630 V630\ \text{V}) and for current transients. The simulation ramps id∗i_d^* over 10 ms10\ \text{ms} (stepping it would saturate the bridge), then steps iq∗i_q^*.

python · try it yourself
import numpy as np

# 10 kW three-phase grid-tied inverter, 400 V 50 Hz, L filter 5 mH with 0.1 ohm, DC link 700 V
Vd, L, R, Vdc = 400 / np.sqrt(3) * np.sqrt(2), 5e-3, 0.1, 700.0
w = 2 * np.pi * 50
wc = 2 * np.pi * 1000                              # current-loop bandwidth 1 kHz
Kp, Ki = wc * L, wc * R
Ts, sub = 1e-4, 20                                 # 10 kHz control, plant in 20 sub-steps
emax = Vdc / np.sqrt(3)                            # SVPWM linear limit (phase peak)
P_ref = 10e3
id_ref = 2 * P_ref / (3 * Vd)
print(f"grid vd = {Vd:.1f} V peak, id* for 10 kW = {id_ref:.2f} A, Kp = {Kp:.2f} V/A, Ki = {Ki:.1f} V/(A s)")

i_d = i_q = s_d = s_q = 0.0
for n in range(400):                               # 40 ms
    t = n * Ts
    idr = id_ref * min(t / 0.01, 1.0)             # ramp active power up over 10 ms
    iqr = -10.0 if t >= 0.02 else 0.0              # inject reactive power from 20 ms
    ed, eq = idr - i_d, iqr - i_q
    vd = Kp * ed + s_d + Vd - w * L * i_q          # PI + grid feed-forward + decoupling
    vq = Kp * eq + s_q + w * L * i_d
    m = np.hypot(vd, vq)
    if m > emax:                                   # saturate, and stop integrating (anti-windup)
        vd, vq, m = vd * emax / m, vq * emax / m, emax
    else:
        s_d += Ki * ed * Ts
        s_q += Ki * eq * Ts
    h = Ts / sub
    for _ in range(sub):                           # L di/dt = v_inv - R i - v_grid -/+ w L i (dq frame)
        dd = (vd - R * i_d - Vd + w * L * i_q) / L
        dq = (vq - R * i_q - w * L * i_d) / L
        i_d += dd * h
        i_q += dq * h
    if n + 1 in (50, 100, 120, 200, 202, 205, 210, 400):
        P = 1.5 * Vd * i_d
        Q = -1.5 * Vd * i_q
        print(f"t = {(n+1)*Ts*1e3:5.1f} ms: id = {i_d:6.2f} A, iq = {round(i_q, 2) + 0.0:6.2f} A, "
              f"P = {P/1e3:6.3f} kW, Q = {round(Q/1e3, 3) + 0.0:6.3f} kvar, |v_inv| = {m:5.1f} V")
print(f"SVPWM limit Vdc/sqrt(3) = {emax:.1f} V peak; minimum Vdc for the last point = {np.sqrt(3)*m:.0f} V")
grid vd = 326.6 V peak, id* for 10 kW = 20.41 A, Kp = 31.42 V/A, Ki = 628.3 V/(A s)
t =   5.0 ms: id =   9.88 A, iq =   0.00 A, P =  4.841 kW, Q =  0.002 kvar, |v_inv| = 338.1 V
t =  10.0 ms: id =  20.09 A, iq =   0.00 A, P =  9.841 kW, Q =  0.002 kvar, |v_inv| = 340.3 V
t =  12.0 ms: id =  20.41 A, iq =   0.00 A, P = 10.000 kW, Q =  0.000 kvar, |v_inv| = 330.2 V
t =  20.0 ms: id =  20.41 A, iq =   0.00 A, P = 10.000 kW, Q =  0.000 kvar, |v_inv| = 330.2 V
t =  20.2 ms: id =  20.18 A, iq =  -8.46 A, P =  9.886 kW, Q =  4.146 kvar, |v_inv| = 367.7 V
t =  20.5 ms: id =  20.40 A, iq =  -9.90 A, P =  9.992 kW, Q =  4.852 kvar, |v_inv| = 346.2 V
t =  21.0 ms: id =  20.41 A, iq =  -9.98 A, P = 10.001 kW, Q =  4.889 kvar, |v_inv| = 345.7 V
t =  40.0 ms: id =  20.41 A, iq =  -9.99 A, P = 10.001 kW, Q =  4.893 kvar, |v_inv| = 345.7 V
SVPWM limit Vdc/sqrt(3) = 404.1 V peak; minimum Vdc for the last point = 599 V

The active current follows its ramp, the reactive step settles within about 0.5 ms0.5\ \text{ms} (a 1 kHz1\ \text{kHz} first-order loop has τ=0.16 ms\tau = 0.16\ \text{ms}), and idi_d dips by only 0.23 A0.23\ \text{A} during the iqi_q step thanks to the decoupling.

Interactive: one phase, as phasors (calculation only)

The netlist lab holds one phase of the worked example: the bridge's fundamental VINVV_\text{INV} (233.48 V233.48\ \text{V} rms at 5.572∘5.572^\circ), the filter's 0.1 Ω0.1\ \Omega and 5 mH5\ \text{mH}, and the grid (230.94 V230.94\ \text{V} at 0∘0^\circ). It reads I(L1)=14.43 AI(L1) = 14.43\ \text{A} at 0.0∘0.0^\circ: unity power factor, 3.33 kW3.33\ \text{kW} per phase. Raise the inverter magnitude to 240 V240\ \text{V} at the same angle: the current becomes 15.64 A15.64\ \text{A} at −15.1∘-15.1^\circ, about 10.5 kW10.5\ \text{kW} and 2.8 kvar2.8\ \text{kvar} injected in total. Voltage magnitude moves mainly reactive power, angle mainly active power, as for a generator on the grid (Power-Angle Characteristic); the current controller hides this by choosing both at once.

0100200100m1101001k10kf (Hz)|V| (V)0 A100 A200 A|I| (A)|V(a)||V(g)||I(L1)|phasors at f = 50.00 Hz (magnitude @ phase)V(a)233 V @ 5.6 degV(b)232 V @ 5.6 degV(g)231 V @ 0.0 degI(VINV)14.4 A @ -180.0 degI(R1)14.4 A @ 0.0 degI(L1)14.4 A @ 0.0 degI(VG)14.4 A @ 0.0 deg

Anti-islanding

An unintentional island forms when a breaker upstream opens and the inverters on that section keep feeding its loads. If the load happens to match the inverters' output, voltage and frequency barely move and nothing seems wrong, while the line is live. Passive methods watch for the change: under- and overvoltage, under- and overfrequency, RoCoF, a phase jump, a rise in voltage harmonics. Each has a non-detection zone (NDZ). For a parallel RLC load with quality factor QfQ_f and voltage and frequency windows Vmin⁡…Vmax⁡V_{\min} \dots V_{\max}, fmin⁡…fmax⁡f_{\min} \dots f_{\max}, an island stays undetected if the power the grid was supplying, ΔP\Delta P and ΔQ\Delta Q, satisfies

(VVmax⁡)2−1≤ΔPP≤(VVmin⁡)2−1,Qf[1−(ffmin⁡)2]≤ΔQP≤Qf[1−(ffmax⁡)2]\left(\frac{V}{V_{\max}}\right)^2 - 1 \le \frac{\Delta P}{P} \le \left(\frac{V}{V_{\min}}\right)^2 - 1, \qquad Q_f\left[1 - \left(\frac{f}{f_{\min}}\right)^2\right] \le \frac{\Delta Q}{P} \le Q_f\left[1 - \left(\frac{f}{f_{\max}}\right)^2\right]

With a 0.880.88 to 1.10 pu1.10\ \text{pu} voltage window, 49.549.5 to 50.5 Hz50.5\ \text{Hz} and Qf=1Q_f = 1 (the test load of the islanding test standards), that is −17.4 %-17.4\ \% to +29.1 %+29.1\ \% in active power and −2.0 %-2.0\ \% to +2.0 %+2.0\ \% in reactive power: a balanced island is easily missed. Active methods therefore push the system out of balance on purpose: they shift the current's frequency slightly in the direction the frequency is already drifting (Sandia frequency shift, slip-mode), or inject small reactive-power or impedance-measuring disturbances; on a stiff grid these do nothing, in an island they drive voltage or frequency out of the window. The test is standardised with a tuned RLC load (Qf=1Q_f = 1) in IEEE 1547.1-2020 and IEC 62116 (2014 edition).

The rules: IEEE 1547-2018 and its amendment

In North America the interconnection requirements are IEEE 1547-2018, amended by IEEE 1547a-2020, tested to IEEE 1547.1-2020; inverters in the United States are listed to UL 1741, whose Supplement SB (2021) applies the 2018 requirements (as of 2026-11 these are current; a revision of IEEE 1547 is in progress). The Smart Grid lesson of the power-systems course covers the grid side; for the inverter designer, the requirements translate into control functions (as of 2026):

Requirement What the inverter must do
reactive power, Category A or B inject up to 44 %44\ \% of nameplate apparent power and absorb up to 25 %25\ \% (Category A) or 44 %44\ \% (Category B); constant pf, volt–var, watt–var and constant var modes, plus volt–watt for active power
ride-through, Category I, II or III stay connected, and keep exporting current, through specified voltage and frequency excursions, including phase jumps
frequency response frequency–droop (frequency–watt)
trip cease to energise when voltage or frequency stay outside adjustable limits for adjustable times; for example the fast overvoltage trip clears at 1.20 pu1.20\ \text{pu} within 0.16 s0.16\ \text{s} by default
unintentional islanding detect it and cease to energise within 2 s2\ \text{s}
power quality DC current injection at most 0.5 %0.5\ \% of rated current; current distortion limits (a total rated-current distortion of 5 %5\ \%)
enter service wait for the grid to be within limits for a set time, then ramp power up
interoperability a communication interface (IEEE 2030.5, IEEE 1815, or SunSpec Modbus)

In Europe the same functions come from the network code Requirements for Generators (Regulation (EU) 2016/631, still in force; a revised "RfG 2.0" that would repeal it was published as a draft in July 2026 and was not yet adopted as of 2026-11), EN 50549-1:2019 with Amendment A1:2023 for low-voltage connection, and national codes. Ride-through and anti-islanding pull in opposite directions: the inverter must not trip on a disturbance, yet must trip on an island within seconds. Active anti-islanding methods are what reconcile them.

Guided lab: a PLL on a signal generator

Hand calculation. For a PLL sampling at 10 kHz10\ \text{kHz} on a 1 V1\ \text{V} peak test signal (so Vm=1 VV_m = 1\ \text{V} in the gain formulas), compute KpK_p and KiK_i for ωn=2π⋅20 Hz\omega_n = 2\pi \cdot 20\ \text{Hz}, ζ=0.707\zeta = 0.707: Kp=177.7 rad/(V s)K_p = 177.7\ \text{rad/(V s)}, Ki=15 791 rad/(V s2)K_i = 15\,791\ \text{rad/(V s}^2).

Simulation. Set Vm = 1.0 in the PLL cell (the gains scale with it, so the response is identical) and try ωn=2π⋅5 Hz\omega_n = 2\pi \cdot 5\ \text{Hz} and 2π⋅50 Hz2\pi \cdot 50\ \text{Hz}; note the settling time after the phase jump and the peak frequency estimate.

What you would measure. A microcontroller board (USB-powered) runs a single-phase PLL (a second-order generalised integrator to make the quadrature signal, then the same PI) on an ADC input biased to mid-supply, fed from a function generator at 1 V1\ \text{V} peak, 50 Hz50\ \text{Hz}. Output the estimated angle as a sine on a DAC pin and compare it with the input on a two-channel scope. Step the generator to 50.5 Hz50.5\ \text{Hz}, or switch between two synchronised channels with a phase offset: expect lock within 5050 to 100 ms100\ \text{ms} for a 20 Hz20\ \text{Hz} loop and a steady phase error within ±1∘\pm 1^\circ (limited by the ADC and the sample timing).

Hazards and safe setup. Signal levels only, from a function generator; keep the input within the ADC's range with the bias network. No connection to the mains in any form, including small "safe" transformers: the lesson's inverter is simulated only.

Pitfalls

  • Exporting before synchronising. Closing the relay with the bridge out of phase produces a current surge; inverters wait for the PLL to lock and the grid to be within limits.
  • A PLL too fast for a weak grid. The inverter's current moves the measured voltage, and the PLL and current loop can interact and oscillate.
  • An undamped LCL resonance. It shows up as a growing oscillation near fresf_\text{res} as soon as the current loop closes.
  • Trusting passive anti-islanding alone. A matched island can sit inside its non-detection zone indefinitely.

Practice

  1. A 5 kW5\ \text{kW} three-phase inverter on 400 V400\ \text{V}: find id∗i_d^* for unity power factor.
  2. What iqi_q injects 3 kvar3\ \text{kvar} into the same grid?
  3. With voltage limits 0.850.85 to 1.10 pu1.10\ \text{pu}, what is the active-power NDZ of a passive scheme?
Answer
  1. id∗=2⋅5000/(3⋅326.6)=10.21 Ai_d^* = 2 \cdot 5000/(3 \cdot 326.6) = 10.21\ \text{A} (peak, amplitude-invariant).
  2. iq=−2Q/(3vd)=−2⋅3000/(3⋅326.6)=−6.12 Ai_q = -2Q/(3v_d) = -2 \cdot 3000/(3 \cdot 326.6) = -6.12\ \text{A}.
  3. (1/1.10)2−1=−17.4 %(1/1.10)^2 - 1 = -17.4\ \% to (1/0.85)2−1=+38.4 %(1/0.85)^2 - 1 = +38.4\ \%.

Test yourself

In the grid-voltage-oriented dq frame (vq=0v_q = 0), active power is set by…

  1. iqi_q
  2. idi_d, through P=32vdidP = \frac{3}{2}v_d i_d
  3. the PLL bandwidth
  4. the DC-link capacitor

The outer loop of a PV grid-tied inverter typically regulates…

  1. the grid frequency
  2. the DC-link voltage, so the inverter exports whatever power the DC side delivers
  3. the module temperature
  4. the relay

Why do grid-tied inverters need active anti-islanding methods?

  1. passive methods are forbidden
  2. when the island's load matches the inverter's output, voltage and frequency stay inside the trip windows (the non-detection zone)
  3. to improve efficiency
  4. to synchronise the PLL

Under IEEE 1547-2018, after an unintentional island forms the DER must cease to energise it within…

  1. 0.02 s
  2. 2 s
  3. 60 s
  4. never: it must ride through