Keeping the lights on

Ever since the blackout that affected much of Spain, I've been wondering how it's going to work when renewable power starts to approach 100% of the power supplied by the grid.  That blackout may have been caused by a number of different factors, but the forces of evil were quick to point out that one thing that may have caused it was that there was too much renewable energy in the grid at the time.

Renewable energy such as solar comes naturally in DC whereas the grid supplies AC at 50Hz (in Europe anyway).  This means that before it can be fed into the grid it has to be passed through an "inverter" to turn it into AC.  This is typically done by phase-locking to the grid signal, which is fine until the supply approaches 100% renewable at which point the question becomes: but who is setting the frequency?  I'm not sure whether or not this really was an issue in Spanish blackout, but it's a reasonable question to ask.

A pretty good answer was provided by an episode of the Just Have a Think youtube channel that I watched recently.  They pointed out that not all renewable power generators simply phase-lock to an existing grid frequency.  Some of them use what's known as Grid Forming Inverters, and these help maintain the frequency at a stable 50Hz.  This got me wondering if I could understand it at a deeper level.

The first step is to understand how traditional  generators - the sort where the power comes from thermal energy from fossil fuels - maintain a stable grid.  Then all that is needed to build a Grid Forming Inverter is to model in software the waveform that one of these would generate.

We will be using the  model above.  The generator supplies a voltage $V_g$ and is connected to a bus at voltage $V_b$ via an inductive impedance of $jX$.  (Where $X>0$ is implied by it being inductive.)  However, before that we need a reminder about complex current, voltage, impedance, and power.

Electrical engineering interlude

Complex impedances $Z = R + jX$ are multiplied by complex currents $I = I_0e^{\phi + j\omega t}$ to produce complex voltages, which have the same frequency but different magnitude and phase.  To switch between a complex current or voltage and something you might see on a scope, you just take the real part.

To calculate the instantaneous power $p$ for a voltage $V = V_0 e^{\theta + j \omega t}$ and current $I = I_0 e^{\phi + j\omega t}$ you just multiply together their real parts and simplify with the aid of a bit of trig.  Once you've done that here's what you get

$$
\begin{align}
p &= P + P cos(2\omega t) + Q sin(2\omega t)  \\
\text{where,} & \\
P &= \frac{V_0 I_0}{2} cos(\theta-\phi) \\
Q &= \frac{V_0 I_0}{2} sin(\theta-\phi) \\
\end{align}
$$ 

Or to put it another way, the average power is the real part of $V I^* /2$.  This is also known as the complex power: the product of the RMS (root mean square) complex voltage and the RMS complex conjugate current.  But the key fact here is that the average power depends on the phase by which the voltage leads the current, and it can be positive or negative.

Back to our generator

What we really want in our case is not $p$ in terms of complex current and voltage, but $p$ in terms of $V_g$, $V_b$ (the generator and "bus" RMS voltage amplitudes) and $X$.  To obtain this relation all we need to do is replace $I$ in the formula for $p$ with $(\sqrt 2 V_g e^{\delta + j \omega t} - \sqrt 2 V_b e^{j \omega t})/ jX$ and simplify.  When we do this we get the following formula

$$
p = \frac{V_g V_b}{X} sin \delta
$$ 

where $\delta$ is the phase by which the generator voltage leads the bus voltage.  This is interesting: if the generator leads the bus then it supplies power to the grid; if the bus leads the generator then the grid supplies power to the generator.  In real terms this means that the grid can either slow down or speed up the massive flywheel that whizzes round at bus frequency, and which provides a buffer of kinetic energy.  We can now build a feedback model:

 Going from left to right we have a governor mechanism that compares the frequency of the flywheel to a setpoint; this determines how much thermal power is supplied to speed up the flywheel; the flywheel is also slowed down by an amount proportional to the phase by which $V_g$ leads $V_b$; the net power input can then be integrated to give the kinetic energy in the flywheel; the square root of the K.E. can be scaled to get the angular frequency of the flywheel; we can then compare this with the bus frequency to get a frequency offset; this can be integrated to get the phase by which the generator leads the bus.  Phew.

The upshot here is that the feedback loops ensure that the generator frequency will match the bus frequency.  But it also works the other way round.

Suppose you have multiple generators connected to the bus.  We know that the total power going in will match the power going out.  Let's assume that none of governors are saturated, so that we're in the linear part of each governor response function.  Then, 

$$
p_{grid} = \sum_i \alpha_i (\omega_{s,i} - \omega_b) + \beta_i
$$ 

And since all the $\alpha_i$ and $\beta_i$ are positive we have

$$
p_{grid} = \beta - \alpha \omega_b
$$

for some positive $\alpha$ and $\beta$.  This says that as users draw more power from the grid the frequency of the grid voltage starts to drop, which in turn tells the operator they need to put more generators online or request the existing generators adjust their frequency setpoints upwards.

Once this mechanism is understood it becomes completely obvious that is should be possible to keep the lights on even if 100% of suppliers to the grid are renewable.  All we need are Grid Forming Inverters running a software model of a flywheel and a governor, and using that to shape their output waveforms.

Next objection please. 

Comments

Popular posts from this blog

The GHZ experiment cartoon

Is "scale insensitivity" destroying climate activism?

FSM library