In spring 2022, after having been in one too many discussions about batteries, energy storage, and renewable share in energy grids, I decided to write a Twitter 🧵 on the subject, trying to collect what I have learned in the decade before that. I think it's high time I transferred this to mastodon, as long as I still can at least read Twitter.
Also, there are a few things I wanted to improve on that thread, so this is my chance.
The TL;DR:
i) Due the need to do primary control (frequency response), a 100% renewable grid is impossible. You need either combustion engines or batteries to run your grid.
ii) Batteries are not great for storing significant amounts of energy, but they are very well suited for frequency response.

Disclaimer: While I have been writing code in this domain for a decade, I am not an electrical engineer and mostly only learned what I needed on the job. Electrical engineering is complicated, people spend years studying it, and there is no way I could cram everything needed into this thread even if I knew it all—which I absolutely do not. So I have to oversimplify things.
Dear electrical engineers, reading this might physically hurt you. I am sorry.

Now let's get started!

Traditionally, electrical power is provided by big rotating masses. Steam, oil, diesel, or gas generators turn coils in magnetic fields, which creates an AC current in the coils. Their turning speed determines the grid's frequency.
If too much energy is drawn from them, they slow down, if it is too little, they speed up. But machines have used centrifugal governors to regulate their speed at least since Watt invented his steam engine, so controlling rotation speed is a solved problem:
Increase fuel usage when the frequency is going down, reduce it if it is going up, so you always provide exactly the power needed. This is generally called primary control (or frequency response): an immediate response to demand fluctuations, fast enough to be practically instantaneous. What's more, communicating this throughout the grid by means of frequency allows generators to orchestrate power distribution: All producers see how it changes and can contribute to the best of their abilities.
Now let's add a bunch of photo-voltaic (PV) panels with AC inverters to the mix. Those are *variable* power providers: Their output changes according to *supply*, not to *demand*. Supply depends on latitude, time of day/year, cloud cover, and other factors. PV inverters (usually) cannot *create* a grid. Other ("grid-forming") generators need to have done this first. ("Grid-following") PV inverters can then sync to that existing grid, adapting their frequency and phasing to it.
The PV panels provide as much power as they can and leave the rotating masses to sort out the rest. But this is fine only if you have a relatively small amount of this unregulated power in your grid, and the rotating fossil fuel generators can compensate for any fluctuations in consumption *and* PV supply.
If your PV supply varies between, say, 20% and 60% of your demand, then your generators need to provide between 40–80% of the energy. Things might get complicated then.
On a sunny day, only 40% of your fossil fuel generator capacity is needed, but if some dark clouds come by, you might suddenly need 80% of it. And you need to be prepared, because cloud cover changes within minutes or seconds.
However, rotating generators might need considerable time to startup and shutdown, so in order for a generator to quickly take over, it needs to already be running. But they usually have a minimum power output, and that might be considerable.
The minimum power of all your generators might well be higher than 40% of your demand.
You could curtail the output of your PV panels so that they can never produce more than what your idling generators do not provide for the current demand. But then you throw away power provided by the sun for free ("excess renewables") and use fossil fuel instead.
Or you could turn off some of the generators, thereby risking not having enough generators running in standby to compensate for sudden fluctuations.
And combustion engines have their ideal operating point. You usually want to run them close to where they are most efficient, and stress and wear is lowest, to minimize their costs. And there's more complications…
So you need to balance a lot of variables and the solution depends on many factors: What are the exact numbers we are talking here? What risks can we take? Is this the power supply for a weekend home? Or for a whole metropolitan area, with hospitals, traffic lights, and subways?
Enter batteries. Here, we use the term for electro-chemical assets which can both consume (charging) and produce (discharging) power. But they charge/discharge DC, so, like with PV power, you need to connect a string of batteries to your (AC) grid through an inverter which converts between AC/DC. The combination of a string of batteries and an inverter is often called an "AC battery" and usually controlled as a singular asset.
Like combustion generators, battery inverters are grid-forming.
Important properties are their lifetime (energy capacity decrease after a number of charging/discharging cycles), the amount of energy they can store, the power they can charge/discharge with, and their power/energy ratio, the C rate. The properties of the inverter and the battery chemistry are responsible for all these factors. Currently, mostly Lithium ion batteries are connected to grids. They provide high C rates and less energy capacity decrease per charge cycle than other batteries.
As long as batteries have capacity to charge or discharge, they can do either with any power (up to their maximum power) you need, so they can actually replace your generators, create and maintain a grid, and control their power according to demand. So you can actually turn off those fossil fuel monsters!
And by charging, batteries can provide "negative power". Your minimum idling power is now negative, which means you can suck up excess PV power, and feed it back into the grid later!
But you cannot charge a fully charged 5MWh battery any further and will only ever get <5MWh out of it. And once discharged, you need electricity to charge it again, rather than just refilling a tank. Plus, batteries have a much lower energy density than fossil fuel. The latter is why most batteries are not well suited for storing considerable amounts of energy: A 10MWh battery plant is the size of a school's gym, while a 1MW diesel generator and 10h worth of fuel easily fit into 1–2 containers.
So you need to keep some of your generators as backup because fossil fuel can be stored cheaply and almost without losses. But you get to turn them off for long stretches, significantly reducing fossil fuel use and mechanical wear on them. Hence, by using batteries, you can increase the renewable share in your grid, thereby helping to save this planet. And to top it all off you also save money!
In fact, there are many companies making a profit by selling this technology to other companies.
Let me reiterate: By putting up wind and PV farms, and hooking up battery power plants to our grid, we could significantly reduce our fossil fuel usage *at a profit* within just a few years. This is proven technology, which has been in the field for *many* years, and comes at a relatively low safety risk. (Compare this to nuclear power plants, which are rather expensive, take a decade or two to build, and take whole nations as backup to get insured because of the risk of a meltdown.)
For the last 10 years I have been paid for writing code which controls AC batteries (DC batteries plus inverter) or whole grids with fossil fuel, wind, PV, and batteries. I have seen small containers with a single 100kWh battery and 500MWh battery power plants. Some of them support tiny microgrids, like the (backup) power for a single hospital, others are cutting diesel consumption on certain islands down to 20%, and yet others provide primary control to Europe's biggest national power grids.
Addendum: I simplified things to the point where electrical engineers and battery chemists might feel physical pain. I have not talked about generator and battery chemistry inertia, active/reactive/apparent power, inverters being able to do both grid-forming or -following, genset synchronization, the dark art of black-starting grids, and lots of other stuff. I skipped this partly because I deemed it unnecessary to get the big picture, and partly because I know too little about it.
I apologize.

Thanks for reading all the way down here!

I am looking for a better job, BTW: https://toot.berlin/@sbi/110491545613352166

sbi (@[email protected])

Yet more stupid management decisions. *sigh* I think I've had enough by now. The nice little startup I once joined was bought 3 years ago, and apparently I'm not cut out for big corporations and their stupidity. It drives me up the wall and makes management resent having to talk to me. I am officially back on the job market now. If you need an experienced C++ programmer please give me a shout. I don't mind coming to a Berlin office once a month, but purely remote is also fine. (Please boost.)

toot.BERLIN
Because nuclear power keeps being brought up in the replies:
Technically, I know very little about NPPs. AFAIK, they can change their output power only slowly and hence cannot provide primary control. So in this regard they are not different from renewables.
More important, though: nuclear power installation is *way* too slow to compete with renewables. ATM, the PV power installed globally rises more than twice as fast as everything else *combined*. Nuclear is minuscule compared to that.

@sbi I'm planning to shape my life around understanding, installing, and maintaining renewable power.

The true benefit of renewables is not in the large scale, but in the small scale.

Renewables can massively improve community energy resilience.

Renewable energy systems can be deployed at any scale, personal, household, community, state, and improve energy resilience.

@sbi The greatest power of renewable energy is the ability to bring energy use and production into the realm of the personal, comprehensible, and controllable.

Who gives a shit how much energy you consume when it all comes from the grid and always costs the same?

But if you've got household solar and a battery system, you can track your own energy production and consumption, and plan your energy usage around efficiency.

@sbi I wish you the best. Can relate to being fed up with crazy bosses.

I hope I always listened well enough to my people in the past. but a few times in my career I initiated the move, when it became nevessary due to organizational/leadership issues.

@sbi Great thread! I've become somewhat convinced that a certain amount of overbuilding of renewables is inevitable in the energy transition (https://www.pv-magazine.com/2023/02/15/curtailment-is-not-the-enemy/) but this is an important piece of the puzzle.

Not sure if the available roles would be up your alley, but fwiw my current employer (DERs aka demand response) is hiring for some engineering positions: https://www.voltus.co/jobs -- primarily North America-based but we have some Europeans.

Curtailment is not the enemy

A new report by IEA-PVPS Task 16 looks at the use of "implicit storage" to transform intermittent renewable sources such as solar and wind into firm power generation. It shows that the total cost of the electricity system transformation could be lowered with the optimal use of capacity overbuilding and dynamic curtailment.

pv magazine International

@wlach Yes, you need to have some overcapacity in renewables if you want a higher penetration. And curtailing is necessary in order to protect your grid. Interesting article!

Thanks for pointing out that job. However, this is all about DB's and financial stuff, whereas I love tweaking dispatch algorithms to get the maximum out of the available assets in a microgrid. :-(

@sbi Hey yep, I figured they might not be up your alley but thought I'd send the link just in case. Good luck with the search!
@sbi
Maybe https://sma.jobs/job/Kassel-Hybrid-C-C%2B%2B-Entwickler-in/1024374301/
I'm happy there
(Sorry for the late reply. Hopefully it isn't needed any more)
C/ C++ Entwickler :in

C/ C++ Entwickler :in

@sbi
Nicely explained
Good luck with a role too !
@sbi Super interesting thread, thank you!
@sbi one minor quibble. You use "fossil fuel" as a synonym for all fuels. Excess electricity can be used to create synthetic liquid or gaseous fuels for long term storage and feeding turbines.
@SkipHuffman Yeah, this could be done. ATM, these are mostly concepts, though. The amount of "green hydrogen" available right now it nothing to write home about. It's a future thing. Hopefully.
Primary control with batteries can be done *now*, allows a much higher renewable penetration in existing grids, and significantly reduces the carbon footprint of energy production.
@sbi understood. And I avoided "hydrogen" since it's kind of terrible as a fuel. Sabatier process methane is a lot easier to handle and store. Batteries for first line load balance certainly seem like the best choice.
@sbi if for no other reason than they scale really well. House scale battery backup is so well proven that I personally think it should be a code requirement for new construction.
@sbi Is there any benefit to using capacitors as well?
@baishen I dunno. What for?
(As I understand it, capacitors are interesting things in DC, but in AC, there mostly like short-circuiting wires. Am I missing something here?)
@sbi EE isn't my area of expertise. I had just wondered if they could help with the energy storage and grid smoothing.
@sbi Well then, dive into this episode of @TransitionShow and worry about many of the issues in your thread no more. https://pca.st/episode/40f90684-ae24-4850-8c77-f6170bfef05a
Grid-forming Inverters - The Energy Transition Show with Chris Nelder (Full Episodes)

How can inverter-based resources integrate with synchronous generators as renewables become dominant on power grids? And is system inertia even necessary?

Getting to a 100% Clean Grid - The Energy Transition Show with Chris Nelder (Full Episodes)

What are some of the pathways to a 100% clean power grid, and how can we meet the last 10% of the need even through winter weeks of low solar and wind output?

@chrisnelder @TransitionShow Read the blurb again! It says "through _grid-forming_ inverters". Battery inverters are grid-forming, but PV inverters aren't, they are _grid-following_. So this seems to say exactly what I am saying: stabilize your grid without rotating masses by using batteries.

@sbi but you are not apologizing for your gigantic anti-nuclear bias which is very visible. That is disappointing.

Edit: ah you're from Germany that explains things. Meh.

@sbi hmh to be fair nuclear power has also been here for decades. And with battery density also come higher risks of electrical fire, which is pretty scary.
@corsac I'd rather have a hundred local fires where lithium batteries burn indistinguishably, than one more Fukushima.
That, however, is irrelevant since we cannot install enough nuclear power in time anyway. Building a NPP from scratch takes 20 years nowadays. Until we will have increased the current amount of installed nuclear power by a significant factor (thereby increasing the chance of another disastrous incident, BTW), it will be too late to avert the catastrophe we are heading into.
@sbi except it’s not an either: nuclear power and batteries don't really play the same role in the grid, are they? Anyway I wasn’t trying to convince you, and if we’re on the "what I prefer" trend we’re out of the engineering thread and I don’t think arguing there makes much sense.

@sbi I think this is really underrated.

Batteries can adjust for 200% of rated power, a gas turbine for 90%, and a local coal plant for ~60%.

@hruske Yes! (Note that, according to what I know, gas turbines are too slow in stepping up and down to do primary response beyond of what their inertia provides.)
@sbi There's also this which can be used https://en.wikipedia.org/wiki/Pumped-storage_hydroelectricity
Which is a "battery" that stores the potential energy which can be converted back to electricity when needed
Pumped-storage hydroelectricity - Wikipedia

@albonycal Yeah, there's been several discussions of pumped storage already. Please see my replies there!
@sbi Sorry, didn't realise this thread was 10months old, I read it as "10mins" 😅
@albonycal Yeah, some high-profile account boosted it two days ago, and I've been getting two dozen likes and boosts per hour ever since. Plus lots of replies.
Sorry, I didn't mean to be unfriendly, but I've become a bit terse as I have a very hard time keeping up.
@sbi
This is super interesting. My town had a municipal electric service with a strong commitment to providing renewable power and several existing solar installations, and I was just reading an article about how they are proposing to build battery banks to absorb excess solar production, and this thread explains some of the reasons why very well. Thanks!
@tetron Great to hear! I suppose they want to use batteries as short-time storage, in the hours range, to store daytime energy for the evening power spike. That is something batteries can do, but as I described, their ability to do primary control is even more important for energy grids with lots of renewables.

@sbi
Here's the quote from the municipal power CTO about why they we need batteries: "if we go above a certain threshold with solar, when we don't have enough load, current power power protection devices will not work correctly, that can lead to damage to the grid"

I don't know what threshold that becomes a problem but I found a chart that says the town gets about 6% of electricity from solar and had about 12 MW installed in 2022, with a strong political mandate to be carbon free by 2030.

@tetron Sorry, but I cannot decipher that statement. "Power protection device" is a rather generic term and I don't know what this refers to here. And 6% doesn't seem a lot to me, but then I don't know the other parameters of this grid.
FWIW, as I wrote in my thread, you can always _curtail_ solar power to protect your grid. You throw away free energy by doing so, but safety has its costs.
@sbi
I think I'm conflating two numbers, the 6% is probably year-round total contribution from solar, but there is 12 MW solar installed out of ~30-40 MW of demand (this is just a guess based on ~9000 households and businesses) so solar contribution is presumably much higher on sunny summer days, which as I understand from your thread, these primary control issues start to become significant.
@tetron Ah, 12 out of 40MW sounds way better! Yes, the problem with PV is that you need way more of their nominal power, because you rarely have their peak power, and when you have it, it's usually too much. This naturally leads to you wanting to keep that excess energy to cover for when you do not have enough.
And, yes, batteries are great for that. They can gobble up excess power, and later discharge it, and switch between the two in milliseconds.
@sbi excellent thread, very eye opening. what about physical energy storage, like pumped hydro, gravity batteries or spinning flyweels?
@mdione The first two are about tertiary control, flywheels are about primary control. So far, I have not yet come into contact with any of those.
The main objective of this thread was to explain that batteries, while problematic for large-scale storage due to their low energy density, still play a key role in the transition to renewables because they can replace fossil fuel generators for primary control, and that they can do this *now*, and at a profit.
@sbi right, thanks for the clarification. it just seemed that the focus on fossil fuel was deliberately leaving out other alternatives.
@mdione After a few days of thinking about this: You are correct, of course, I focused on fossil fuel generators, PV, and batteries, and left out lots of other alternatives.
Part of this was that I wanted to keep it simple, and wanted to get my point across.
Another part, however, is that I simply do not know much about those alternatives, and I do not like talking about stuff that I do not feel well-informed about.
@sbi
In Luxembourg for many years there has been a plant where water is pumped up a hill into a reservoir when energy demand is low and it can be released when demand surges. I think that's a pretty good route for the frequency control problem