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.
@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.