🌐 Smart Grid Frequency Control

Swing equation M·df/dt = P_mech − P_elec − D·Δf governs grid frequency. See primary (droop) and secondary (AGC) control respond to load steps and renewable intermittency.

EnergyInteractive
Yellow: frequency · Teal: mechanical power · Amber: electrical load · P pause · R reset

How it Works

The simulation integrates the swing equation in real time. When a load step occurs (click "Apply Load Step"), electrical demand P_elec suddenly increases. The inertia M initially keeps frequency from dropping instantly, but frequency falls at RoCoF = ΔP/(2M). Primary droop control quickly ramps up generator output (ΔP_gov = −Δf/R), arresting the fall. Secondary AGC then slowly restores frequency to exactly 50 Hz by integrating the error.

Renewable noise adds random power fluctuations to P_elec, simulating wind/solar intermittency. Reduce inertia M to see how modern low-inertia grids are harder to control. Increase AGC gain K_i for faster frequency restoration (but risk oscillation).

M·df/dt = P_mech − P_elec − D·Δf [swing equation]
ΔP_gov = −Δf / R [droop control]
ΔP_AGC = K_i × ∫Δf dt [AGC integral]
RoCoF = ΔP / (2M) [initial rate]

Frequently Asked Questions

What is grid frequency and why must it be controlled?

Grid frequency (50 Hz in Europe/UK, 60 Hz in North America) must match the synchronous speed of generators. If generation and load are imbalanced, frequency deviates. Too low risks generator tripping and blackouts; too high risks equipment damage.

What is the swing equation?

The swing equation M·df/dt = P_mech − P_elec − D·Δf describes how generator rotor speed (and thus frequency) responds to power imbalances. M is the inertia constant, D is the damping coefficient.

What is primary frequency control (droop control)?

Primary control is the fast automatic response of generators to frequency deviations: ΔP = −Δf/R where R is the droop setting (~4-5%). This arrests the frequency fall within seconds but leaves a steady-state error from the nominal frequency.

What is secondary frequency control (AGC)?

Secondary control (AGC) is a slower integral action that restores frequency to exactly 50/60 Hz after a disturbance, eliminating the steady-state error left by droop. AGC acts over minutes and also controls area control error in interconnected systems.

What is grid inertia and why does it matter for renewables?

Grid inertia (M) is the stored kinetic energy of rotating generators. Higher inertia means slower frequency response, giving control systems more time to react. Renewable sources traditionally have no inertia, so increasing renewable penetration reduces system inertia and makes frequency harder to control.

What is the Rate of Change of Frequency (RoCoF)?

RoCoF = df/dt is the initial rate at which frequency changes after a generation loss event: RoCoF = ΔP/(2H). Low-inertia systems (high renewables) have high RoCoF, which can trigger protective relays and cascade into wider blackouts.

What is virtual inertia in smart grids?

Virtual inertia uses power electronics (battery storage, grid-forming inverters) to emulate the inertial response of synchronous generators. By rapidly adjusting power output proportional to df/dt, virtual synchronous generators help stabilize frequency in low-inertia grids.

What is Load Frequency Control (LFC)?

LFC is the coordinated primary and secondary control of generators to maintain frequency at the setpoint. It includes governor action (primary), AGC (secondary), and in some cases tertiary control (economic dispatch).

How do interconnected grids share frequency control?

In interconnected grids (like ENTSO-E), all generators share the frequency response. AGC for each control area monitors Area Control Error (ACE = Δf × B + ΔP_tie) to restore both frequency and tie-line power flows.

What are under-frequency load shedding schemes?

UFLS automatically disconnects blocks of load when frequency drops below preset thresholds (e.g., 49.0 Hz, 48.8 Hz). It is the last line of defense before a cascading blackout, arresting frequency decline by reducing load to match generation.

About this simulation

This simulation integrates the swing equation M·df/dt = P_mech − P_elec − D·Δf live, driving a scrolling chart of grid frequency, mechanical power, and electrical load. Click Apply Load Step to inject a sudden demand jump and watch primary droop control catch the fall within seconds, while secondary AGC slowly integrates the error back to exactly 50 Hz — with a shaded UFLS zone marking where load-shedding would kick in.

🔬 What it shows

Live-integrated grid frequency (yellow), mechanical generation power (teal), and electrical load including renewable noise (amber), plotted against a dashed 50 Hz reference and a shaded under-frequency load-shedding (UFLS) danger zone below 49 Hz.

🎮 How to use

Set Inertia M, Damping D, Droop R (%), AGC Gain K_i, and Renewable Noise, then click Apply Load Step to inject a demand disturbance of size Load Step ΔP. Watch Frequency, Δf, RoCoF, and ΔP_mech respond live. Pause with P, reset with R.

💡 Did you know?

As grids add more wind and solar, which spin no heavy synchronous rotor, overall system inertia M falls — meaning the same size load step now causes a faster, sharper frequency drop (RoCoF = ΔP/2M), which is why grid operators are racing to deploy "virtual inertia" from batteries and grid-forming inverters.

Frequently asked questions

Why does frequency dip sharply right after I click Apply Load Step, then partially recover?

The sudden jump in P_elec creates an instantaneous power imbalance that the swing equation converts into a falling frequency; within seconds, droop control (ΔP_gov = −Δf/R) ramps up mechanical power to arrest the fall, producing the classic dip-and-partial-recovery shape.

Why does frequency only fully return to 50 Hz after a long delay, not immediately?

Droop control alone leaves a permanent steady-state frequency error because it only responds proportionally to Δf. Secondary AGC integrates that error over time (ΔP_AGC = K_i∫Δf dt), slowly nudging mechanical power until the error is driven to exactly zero — a much slower process than the initial droop response.

Why does lowering Inertia M make the frequency dip deeper and faster?

RoCoF = ΔP/(2M) shows inertia directly resists rapid frequency change — lower M means the same load step produces a steeper initial slope and a lower minimum frequency before droop control has time to respond, which mirrors the real challenge of low-inertia renewable-heavy grids.

What happens if I push AGC Gain K_i very high?

A very aggressive integral gain can overshoot and oscillate around the 50 Hz setpoint instead of settling smoothly, since it keeps correcting based on an error that itself is changing — this mirrors the real engineering tradeoff between fast frequency restoration and stability in secondary control loops.

Why does the frequency line touch the shaded red UFLS zone at high Renewable Noise?

Renewable Noise injects random power fluctuations into P_elec simulating wind/solar intermittency; combined with low inertia or aggressive load steps, these fluctuations can push frequency below 49 Hz into the zone where under-frequency load shedding would automatically disconnect blocks of demand in a real grid.