PID Control for Frequency

PID frequency control grid frequency governor AGC inverter and VFD frequency control

PID Control for Frequency: Grid Frequency and VFD Output Frequency Are Two Different Problems

The term frequency control is used for at least two very different engineering problems.

The first is:

maintaining the frequency of an AC power system near its nominal 50 Hz or 60 Hz value.

The second is:

changing the electrical output frequency of a variable-frequency drive - VFD in order to control a motor.

Both use the unit hertz, but their physics and control architecture are completely different.

Grid frequency is a system-wide consequence of the real-time balance between active-power production and consumption.

VFD output frequency is a local motor-control variable generated by an inverter.

Grid-frequency control is fundamentally an active-power balancing problem. VFD frequency control is fundamentally a motor-control problem. The common unit “Hz” does not make them the same control loop.

For the general feedback concept, see What Is PID?.

What Does Grid Frequency Tell Us?

In a synchronous AC power system, frequency provides important information about the balance between active-power generation and active-power demand.

In simplified form:

Generation = Load + Losses

corresponds to a balanced operating condition.

If a large generator suddenly disconnects:

generation < demand

and system frequency tends to fall.

If a large block of load disappears:

generation > demand

and frequency tends to rise.

Frequency is therefore closely connected to active-power control.

Generator Speed and Electrical Frequency

For a synchronous generator:

f = P × n / 120

where:

f is electrical frequency,

P is the number of poles,

n is rotor speed in rpm.

A four-pole synchronous machine therefore rotates at:

1500 rpm at 50 Hz

or:

1800 rpm at 60 Hz.

This direct electromechanical relationship is one reason large synchronous rotating machines have historically played such an important role in system-frequency behaviour.

Why Does Frequency Fall After a Generation Loss?

If a generator trips, the electrical load does not disappear at the same instant.

For a short period, the remaining synchronous machines release part of the kinetic energy stored in their rotating masses.

The rotors slow slightly.

Because rotor speed and synchronous electrical frequency are linked, system frequency begins to fall.

This immediate physical effect is associated with inertial response.

Inertia is not a PID controller that restores frequency. It is a physical energy buffer that initially resists rapid frequency change after a power imbalance.

What Is ROCOF?

ROCOF - Rate of Change of Frequency describes how rapidly frequency is changing with time.

For example, a change from:

50.00 Hz to 49.70 Hz

over a short interval represents a significant negative ROCOF.

ROCOF is influenced by factors such as:

the size of the generation-load imbalance,

the amount of synchronous inertia online,

frequency-sensitive load behaviour,

fast inverter-based power response.

A lower-inertia system can experience a faster frequency change for the same disturbance.

Frequency Control Is Not One Large PID Loop

Following a major disturbance, power-system frequency control can be viewed as several layers operating over different time scales.

Immediately: synchronous inertia and other very fast physical or electronic responses act.

Within the following seconds: primary frequency response or frequency-containment action changes active power.

Over tens of seconds to minutes: frequency-restoration control and AGC redistribute generation.

Later: replacement reserves, redispatch and scheduling move the system to a sustainable operating point.

Large power systems are not frequency-controlled by one PID block. Inertia, droop governors, FCR, AGC, aFRR, mFRR, replacement reserves and dispatch all perform different jobs.

This layered structure is an important real-world example of PID and other control strategies.

Primary Frequency Response

The generator governor is one of the classic front-line frequency-control mechanisms.

When frequency falls, the governor can increase mechanical input to the turbine or prime mover.

When frequency rises, mechanical-power demand can be reduced.

The immediate purpose is primarily to:

oppose the frequency excursion and stabilize the system.

Primary control does not necessarily restore the system exactly to nominal frequency on its own.

What Is Governor Droop?

Governor droop defines a relationship between frequency deviation and active-power response.

The simplified logic is:

Frequency decreases → Increase mechanical power.

Frequency increases → Reduce mechanical power.

The response has a finite slope rather than infinite gain.

A smaller droop percentage generally means stronger power response to a given frequency deviation.

But droop cannot simply be reduced without limit.

It affects:

load sharing,

unit interaction,

available reserve,

system stability.

Governor tuning therefore belongs to the total plant and grid-control problem, not merely to a local “Kp” setting.

Why Not Give Every Generator Integral Action to Force Exactly 50 Hz?

This question gets directly to the structure of power-system frequency control.

If many parallel generators independently used strong integral control to force the same common frequency error to zero, they could interfere with one another and produce poor active-power sharing.

Droop allows several units to respond proportionally to the same frequency event and share the required change in output.

A small steady-state frequency deviation can therefore remain after primary response.

A higher-level secondary controller later removes that residual deviation.

The power system deliberately separates primary droop behaviour from secondary integral restoration.

This is a large-scale example of the principles described in P, I and D control components.

Frequency Containment Does Not Necessarily Restore Nominal Frequency

After a generation outage, frequency may:

fall from 50 Hz,

reach a minimum point,

then stabilize at a value still slightly below 50 Hz.

The first objective is to stop the continuing decline.

In European balancing terminology, Frequency Containment Reserve - FCR is used to stabilize frequency after an imbalance.

Frequency Restoration Reserve - FRR then moves frequency toward the setpoint and replaces activated FCR.

Containment stops the excursion. Restoration brings the system back toward its normal operating target.

Secondary Frequency Control and AGC

Once the initial frequency excursion has been contained, the system still needs to restore:

nominal frequency,

scheduled interchange between control areas,

primary reserves for the next disturbance.

This is where secondary frequency control and Automatic Generation Control - AGC become important.

AGC can send new active-power commands to selected generators, batteries or other controllable resources.

The response is normally slower than primary governor action.

AGC Is Not Just “50 Hz Error Into a PID”

A simplified textbook picture might show:

50 Hz - measured frequency → PID → generator power

but interconnected power systems are more complex.

A balancing authority may need to consider:

frequency deviation,

actual tie-line power,

scheduled tie-line power,

frequency bias.

These quantities can be combined into an Area Control Error - ACE.

AGC then works to correct the balancing area's contribution to the overall interconnection error rather than merely forcing one local frequency measurement to its setpoint.

AGC is a balancing-area control function. Its job is broader than regulating one local frequency sensor to exactly 50.000 Hz.

Why Frequency Bias Matters in AGC

Imagine a generator trip occurs in another balancing area.

Your generators respond through governor droop and export additional power to help support the shared interconnection frequency.

A badly designed interchange controller could interpret that additional export as an error and immediately reduce generation again.

Frequency bias in ACE helps prevent AGC from cancelling useful primary frequency response.

This shows why frequency control, interchange control and governor response have to be designed together.

Integral Action in Frequency Restoration

After primary droop has stabilized the frequency, a steady frequency error may remain.

Secondary control can use integral-like action to drive that persistent error toward zero while restoring scheduled interchange.

This is where the classic PID principle of eliminating persistent offset becomes useful.

However, the integral function is applied at the appropriate supervisory level rather than simply being inserted aggressively into every governor.

Derivative Is Not the Main Universal Frequency-Control Term

The derivative of frequency is related to ROCOF, so it is tempting to assume that adding D action automatically improves frequency response.

But frequency estimates can contain:

measurement noise,

PLL estimation ripple,

waveform distortion,

local switching disturbances.

Derivative can amplify these fast components.

Real grid-control systems therefore use combinations of:

droop,

PI or integral restoration,

frequency-watt control,

fast frequency response,

specialized dynamic control.

Full three-term PID is not automatically the correct controller simply because the controlled variable is frequency.

Governor Deadband

A governor does not necessarily need to respond strongly to every tiny measurement fluctuation around nominal frequency.

A deadband can define a small range in which little or no governor response occurs.

This can reduce:

unnecessary actuator movement,

valve wear,

response to measurement noise.

But an excessively wide deadband delays useful frequency response.

Deadband and droop therefore have to be coordinated.

Governor and AVR Do Different Jobs

Two control systems are often confused in synchronous-generator applications.

Governor: mechanical power, active-power response and frequency behaviour.

AVR - Automatic Voltage Regulator: excitation, terminal voltage and reactive-power behaviour.

The governor changes prime-mover input.

The AVR changes excitation.

Frequency/active-power control and voltage/reactive-power control are related but different problems. Increasing AVR gain is not a substitute for governor frequency response.

For the active-power side, see PID power control.

A Grid-Connected Generator Cannot Set Interconnection Frequency by Itself

A generator connected to a strong synchronous grid is effectively locked to the grid's electrical frequency.

If its governor input increases, the machine does not simply accelerate from 50 Hz operation to 52 Hz while remaining synchronously connected.

Instead, its mechanical input and rotor angle change so the generator delivers more active power into the grid.

The frequency of the interconnection is determined by the aggregate power balance and dynamic response of the whole synchronous system.

For a grid-connected unit, governor action primarily changes active-power contribution, not its independent steady-state electrical frequency.

Islanded Operation Is Different

When a generator or microgrid disconnects from a large grid, the external frequency reference disappears.

The islanded system must establish its own voltage and frequency.

In this case, local:

governors,

grid-forming inverters,

microgrid controllers

have a much more direct role in creating and regulating frequency.

Control settings suitable for grid-connected operation may therefore not be appropriate for island operation.

What Is Isochronous Governor Control?

In a small islanded system, one generator may operate in isochronous mode and attempt to maintain nominal frequency with little steady-state error.

This can be appropriate when one unit establishes the frequency reference.

But operating several parallel generators with independent stiff isochronous controllers and no coordinated load-sharing architecture can make the units fight one another.

Multi-generator systems therefore require intentional load-sharing design.

Why Droop Is Useful with Parallel Generators

When several generators operate in parallel, active load needs to be shared in a stable manner.

Droop gives each unit a defined frequency-power relationship.

Each generator then contributes part of the required response instead of independently trying to seize the entire load correction.

Depending on the system architecture, plants may use:

droop operation,

isochronous load sharing,

master/follower control,

plant-level supervisory control.

Giving two governors the same nominal frequency reference does not automatically produce correct load sharing.

Restoring Reserves After the Event

Fast frequency reserves should not remain permanently exhausted after every disturbance.

After frequency is restored, slower mechanisms may:

redispatch generators,

activate replacement reserves,

change unit schedules,

restore battery state of charge.

The objective is to return the power system to a sustainable state with adequate reserve available for the next event.

Generator Ramp Rate Limits Frequency-Control Response

An AGC command requesting:

+100 MW immediately

does not mean the generating unit can physically increase output by 100 MW instantaneously.

The response can be limited by:

turbine ramp rate,

boiler dynamics,

hydro gate movement,

fuel system limits,

inverter current limits.

AGC and secondary control therefore operate within:

maximum output,

minimum output,

ramp-up limit,

ramp-down limit,

available reserve.

Controller demand and physical generating capability are not the same thing.

Output Saturation and Integral Windup

A generator may already be operating at maximum permitted output while frequency is still below nominal.

The controller cannot obtain additional power from that unit.

If integral action continues accumulating error, integral windup can occur.

When the system later recovers, this accumulated integral can delay or distort the return to normal output.

Proper control therefore requires:

output limits,

anti-windup,

tracking,

reserve-availability logic.

This is the same physical limitation discussed in PID troubleshooting.

Under-Frequency Load Shedding Is Protection, Not PID

If the generation deficit is too large and available frequency response is insufficient, frequency can continue falling toward dangerous values.

Automatic load shedding may then disconnect selected loads to prevent wider collapse.

This is the role of functions such as Under-Frequency Load Shedding - UFLS.

UFLS is not another term in the frequency PID controller.

It is an emergency protection layer.

Normal frequency regulation does not replace under-frequency, over-frequency, generator-protection or islanding protection functions.

Renewable Integration and the “Low-Inertia” Problem

Traditional synchronous generators have rotating mass directly coupled to electrical frequency.

Solar PV and many modern wind or battery systems are connected through power-electronic inverters.

Their energy source is electrically decoupled from the AC grid by the converter.

As a result, a conventional grid-following inverter does not automatically provide synchronous-machine inertia simply because energy exists behind the inverter.

However, advanced inverter controls can respond very quickly to frequency deviations.

Fast Frequency Response - FFR

Battery systems and other inverter-based resources can change active-power output very quickly.

A battery may detect falling frequency and increase active-power injection within a much shorter time than a conventional turbine-governor response.

This can provide valuable Fast Frequency Response.

But the resource is still limited by:

inverter current,

available MW capacity,

state of charge,

stored energy,

DC-side source capability.

Fast response does not mean unlimited frequency reserve.

Why Solar PV Needs Headroom to Increase Power

If a solar inverter is already extracting all available power from the PV array, it cannot suddenly provide substantial additional active power during an under-frequency event unless additional energy is available.

Upward reserve can be created by:

operating the PV plant below maximum available output,

adding battery storage,

using another controllable energy source.

This connects frequency support directly with power-control capability and headroom.

Grid-Following and Grid-Forming Inverters

A grid-following inverter normally measures an existing grid voltage waveform and synchronizes its current injection to that external reference.

A grid-forming inverter is controlled differently.

It can contribute to establishing a local voltage and frequency reference rather than merely following one.

Grid-forming capability becomes increasingly important in systems where conventional synchronous generation is reduced.

“An inverter follows grid frequency” describes conventional grid-following operation. A grid-forming inverter can instead participate in creating the voltage-frequency reference itself.

Frequency-Watt Droop in Inverters

An inverter can implement a frequency-power characteristic similar in concept to governor droop.

For example:

frequency falls → increase active power if headroom is available,

frequency rises → reduce active power.

This is often referred to as frequency-watt behaviour.

The actual response is limited by:

power-electronic current capability,

available source energy,

control configuration.

Why Batteries Are Powerful Frequency-Control Actuators

A Battery Energy Storage System can rapidly move between charging and discharging states.

It can therefore contribute to:

frequency containment,

fast frequency response,

AGC / automatic frequency restoration,

balancing.

However, State of Charge - SOC must be managed.

A nearly empty battery has limited discharge reserve.

A completely full battery has limited ability to absorb additional power.

This means frequency control becomes partly an energy-management problem rather than only a gain-tuning problem.

Frequency Measurement Is Also a Control Problem

Grid frequency can be estimated using techniques such as:

zero-crossing detection,

PLL - Phase Locked Loop,

phasor measurement,

digital signal processing.

There is always a compromise between:

fast response

and

noise rejection.

Long averaging windows produce smooth readings but increase measurement delay.

Very short windows respond quickly but can become more sensitive to waveform distortion and noise.

This connects frequency control directly with time delay and system dynamics.

Can a PLC Control Grid Frequency?

A PLC can perform useful local functions in a generator plant or microgrid.

It may:

read frequency measurements,

send governor or power references,

sequence generators,

control battery MW setpoints,

perform load-management logic.

But the frequency-control architecture of a large interconnected grid cannot realistically be reduced to one PLC PID loop.

Governor controls, inverter controls, protection relays, plant controllers, AGC and system-operator functions act at different time scales.

This layered control philosophy is consistent with PID control with PLCs.

What Is SCADA's Role?

A SCADA or energy-management system can monitor:

system frequency,

generator MW,

tie-line power,

reserve availability,

battery SOC,

AGC status,

alarms.

It can also distribute supervisory setpoints and dispatch commands.

But high-speed primary response and protection should not depend on ordinary SCADA refresh rates.

Fast frequency regulation belongs in deterministic local controllers; supervisory coordination belongs at SCADA/EMS level.

Frequency Control Is a Real-Time Problem

A major frequency event begins developing immediately after the disturbance.

Relevant delays include:

measurement latency,

controller execution time,

communication delay,

resource activation time.

For fast frequency functions, timing becomes part of stability itself.

This is one of the largest-scale applications of the principles described in real-time PID control.

VFD Output Frequency Is a Completely Different Subject

Now consider a motor drive.

A VFD rectifies its input supply to form a DC bus, then uses an inverter stage to generate a new variable-frequency output for the motor.

The output might be:

5 Hz,

20 Hz,

35 Hz,

50 Hz,

60 Hz.

This value is a local motor-control variable.

It is not the system frequency of the utility grid.

A drive display showing “Output Frequency = 35 Hz” and a power-system monitor showing “Grid Frequency = 50 Hz” refer to physically different quantities.

Frequency and Motor Speed

For an induction motor, synchronous speed is approximately:

Ns = 120 × f / P

where:

Ns is synchronous speed,

f is motor electrical frequency,

P is pole count.

However, actual rotor speed differs because of slip and load.

That is why VFD output frequency and actual motor rpm are not identical control variables.

See PID speed control for the motor-side control structure.

A VFD at 50 Hz Does Not Mean It Is Controlling Grid Frequency

A VFD may receive 50 Hz from the utility supply.

After rectification, the input frequency no longer directly determines the instantaneous motor output waveform.

The inverter stage creates the motor-side frequency according to its control command.

So a 50 Hz utility system can feed a drive that produces:

10 Hz to one motor,

37 Hz to another operating point,

60 Hz when overspeed operation is permitted.

This has no direct meaning for the utility's system-frequency control.

Process PID Can Generate a VFD Frequency Reference

Consider a pressure-controlled pump.

The architecture may be:

Pressure SP → Pressure sensor → Process PID → VFD speed/frequency reference → Motor → Pump

Here, the PID is not controlling frequency as the final process variable.

It is controlling pressure.

Motor frequency is simply the manipulated variable used to change pump output.

This is the structure discussed in PID control with VFDs.

Frequency, Speed, Current and Torque Are Coupled in Modern Drives

Advanced vector-control drives do more than generate a frequency command.

They also estimate or regulate:

motor flux,

motor current,

motor torque,

actual or estimated speed.

This is why advanced motor control should not be reduced to:

“increase Hz to make the motor go faster.”

Common Frequency-Control Misunderstandings

“The grid fell to 49.8 Hz, so one generator should simply force itself to 50 Hz.” A grid-connected unit participates in the shared frequency-power response of the synchronous system.

“Primary governor response must return frequency exactly to 50 Hz.” Its first job is to arrest and stabilize the excursion; secondary control performs restoration.

“AGC is just a frequency PID.” In interconnected systems it can also consider tie-line interchange and ACE.

“Renewables cannot provide frequency response