Warning, long text

Power Outage in Spain – An Analysis

Solar energy comes out of your panels as direct current (DC). That’s all well and good, but homes and grids run on alternating current (AC). Enter the inverter – the humble box that turns solar wizardry into household juice.

Now, inverters aren’t just fancy plug adapters. They have to sync up with the grid – which means they generate exactly the same frequency as the rest of the system. No grid? No syncing. In that case, the inverter goes into what’s called island mode and produces power only for local use. So, if my solar system isn’t connected to the external grid, it can’t run the house – but it can still power two little emergency sockets. Cheers, I guess.

Normally, the grid runs at 50 Hz – that’s hertz, not some obscure Scandinavian metal band. But this frequency can wobble a bit. Physically and technically speaking, it rises when there’s too much power and not enough consumption, and falls when there’s a hungry grid and not enough electricity to feed it.

To keep the grid safe, inverters have an emergency shutdown feature: if the frequency goes over a set limit (apparently around 50.2 Hz), they also jump ship and go into island mode.

Spain’s energy mix is a bit unusual: lots of nuclear, lots of renewables – and a large chunk of those renewables are solar. Makes perfect sense in a country where “cloudy” means three fluffy cotton balls drifted by.

Now, nuclear energy comes with two charming quirks. First, you can’t change its output quickly – it’s not a dimmer switch, more like a cruise ship rudder. Second, nuclear plants cost nearly the same to run at half speed as they do at full throttle. So, naturally, you want to keep them purring along at max capacity.

Then came Monday, with weather conditions perfect enough to make a solar engineer weep with joy: loads of sun, plenty of wind. By 9 a.m., Spain’s energy needs were entirely met by nuclear and renewables. In fact, they had surplus electricity and began exporting it by the bucketload. They shut down everything easy to shut down – but nuclear? No chance. It stayed full steam ahead.

Then, two unfortunate things happened: one transmission line to France caught fire (as you do), and another developed resonances due to meteorological oddities.

So far, this is all well documented. Now we step into speculation territory.

These instabilities meant Spain couldn’t get rid of its excess electricity. The grid frequency rose past that critical 50.2 Hz mark – and boom: many solar systems switched to island mode. At that moment, they were providing nearly 15 gigawatts – around 60% of the national supply. And just like that, poof – they were gone.

Suddenly, two-thirds of the electricity vanished. Wind, nukes, and batteries couldn’t keep up – quite the opposite, in fact. To prevent damage, the nuclear plants initiated emergency shutdowns. Not great. (More on why that’s bad in a bit.) Within seconds, the entire grid collapsed. The solar systems were poised to help – but there was no grid left to sync with.

Everything went dark.

Portugal and southern France were also knocked offline, as they’d been happily sipping from Spain’s excess power. The European grid wasn’t amused and unceremoniously kicked Spain out of the club. France, with a bit of backup and a stiff upper lip, restored its network fairly quickly. My home automation system even picked up the moment the frequency dipped and France cranked up its own generation.

Portugal got the rough end of the stick. With fewer reserves and being smaller in size, they couldn’t help themselves – and no one else could help either, since Spain’s their only neighbour.

Rebooting the Grid – Why It’s a Right Pain

Restarting a collapsed grid isn’t just a matter of flipping a giant switch. It’s tricky for two reasons:

  • Generation and consumption have to be in perfect balance. If not, we’re back to square one.
  • Nuclear power plants can’t just be turned back on. After an emergency shutdown, they suffer from something called xenon poisoning (yes, one of the very same issues that made Chernobyl a household name). You’ve got to wait for that to wear off – which means the reactors were still offline two days later.

The fix? You split the grid into smaller bits. For each chunk, you build up some capacity, bring it online, then move on to the next. Rinse and repeat. This takes hours. Meanwhile, the sun moves across the sky – and even if you do reconnect the solar arrays, they won’t produce nearly as much as before. Come 8 p.m., they’re more or less useless.

So Spain needed outside help. They were gradually reconnected to the European grid – in small, careful steps. Without that assistance, large parts of Spain would probably still be in the dark. That’s why electricity came back first in places like Barcelona, close to the French border, while Portugal endured the longest wait.

Notes & Musings

  • Considering the scale of the event, the recovery was impressively quick. In San Sebastian, power was back within 2 hours. (For comparison: Wismar in Germany had a 45-minute outage last year because one substation had a wobble.) Portugal got its power back after 23 hours. I had expected one to two days.
  • This was the largest blackout in Europe in 40 years. If, as suspected, climate-related factors helped spark (pun intended) the situation, then modernising the grid to better handle volatility is absolutely essential. That includes implementing the long-debated power zones in Germany.

@masek
"Then, two unfortunate things happened: one transmission line to France caught fire (as you do), and another developed resonances due to meteorological oddities.

So far, this is all well documented."

Weren't both of these things later dismissed as fakes?

RNE definitely put out a statement in Portuguese saying they'd never informed of any meteorological oddities and I see here the fire in France theory was also dismissed:

https://www.rtve.es/noticias/20250429/desinformacion-apagon-masivo-teorias-conspiracion-contenidos-descontextualizados/16558963.shtml

Desinformación apagón masivo: de teorías de la conspiración a contenidos descontextualizados

De teorías de la conspiración acerca de las causas a imágenes descontextualizadas: recopilamos los bulos que han circulado sobre el apagón masivo en España

RTVE.es
@Veza85UE they seemed to be credible at least. I really would love to be a fly on the wall in the debriefing room (I love incident debriefs to bits) @masek
@oliof @masek I love the idea that someone's special interest is incident debriefs, excellent "frikada" as the Spanish say.🙂 But every phishing incident debrief starts with: "They seemed to be credible at least" and we're kind of under attack from multiple hostile actors, one of whom spends billions every year to bury Europeans under a deluge of disinformation until nobody believes anything anymore. So people who write good, clickable infotainment should be a bit more diligent factchecking, imo.
Very interesting, thanks!
@masek @janl Facinating. I wonder if it would be a good idea to have Solar inverters set their cutoff frequency to a random amount <50.1 Hz >50.05 hz so that the effect would dampend. A bit like random back off in networking.

@mrtoto @masek @janl Gemäss DW dürfte das bereits gelöst sein (aber ich kann das nicht verifizieren, dafür habe ich zu wenig Ahnung): „Dass sich die PV-Anlagen abrupt abschalten, dürfte eigentlich nicht passieren. Denn seit 2016 gelten in der EU einheitliche Vorschriften für Stromerzeuger. Diese sehen vor, dass PV-Anlagen nach und nach ihre Einspeisung reduzieren müssen, wenn die Netzfrequenz aufgrund eines Stromüberhangs den Grenzwert von 50,2 Hertz übersteigt.“

https://www.dw.com/de/faktencheck-hat-zu-viel-solarstrom-den-blackout-ausgel%C3%B6st/a-72399436

Faktencheck: Hat zu viel Solarstrom den Blackout ausgelöst?

Mehr als einen Tag brauchten die iberischen Netzbetreiber, um die Stromversorgung in Spanien und Portugal vollständig wiederherzustellen. Eine der Thesen: Zu viel PV-Strom habe den Stromausfall verursacht. Stimmt das?

Deutsche Welle
@markusr @mrtoto @masek
Yup. This should not happen, unless there was widespread use of non-conforming inverters maybe? The German regulation that preceded the EU one came via VDE-AR-N 4105, producer regulation starts at §5.7.4.3 and is surprisingly readable for a tech standard.
Some english-language context from 2012 when that was new: https://www.nsenergybusiness.com/analysis/featuredealing-with-the-50-2-hz-problem/
Dealing with the 50.2 Hz problem

By Michael Döring, Ecofys, Berlin, Germany On 26 July a new ordinance entered into force in Germany requiring existing photovoltaic…

NS Energy
@markusr
Are you telling me that cheap products from the Far East may not implement safety functions in full detail? Incredible!
@mrtoto @masek @janl
@masek I spoke with some energy people today, and they said that normally the frequence skew between different locations should be large enought that not all solar goes down at the same time b/ of too much power. So this needs further explanation (which we will get at some point). And BTW, both solar and atom power should be steerable, i.e. you could reduce the power generation by atom (at least in the normal zone, which was the case here). Will be interesting but the easy answers won't fit
@masek @kuriko Thank your for this really nice explanation; even if some of it (as you mentioned) is speculation, it does sound reasonable.

@masek

„Now we step into speculation territory.“

Exactly …

@masek Amazing little writeup!

It's worth noting that grid forming inverters do exist, which would have potentially avoided this. Instead of just following the grid, they can actively vary the voltage and frequency to keep it stable. However, they're expensive and complicated and new, so it makes sense that most solar installations don't have them yet. They are absolutely the solution here though, so don't let any fossil fuel shills trick you into thinking we don't have the technology to move to 100% zero emission power.
What keeps alternating current in sync when large power generators go offline?

Traditional large-scale power generators ensure a stable frequency of alternating current in the European power grid. Now, researchers from ETH Zurich have found a solution so that wind and solar power plants can take over – paving the way for the energy transition.

ETH Zurich
@masek thank you, interesting read
@masek
Nuclear power: slow and expensive to build, slow to steer and catastrophic to all life when it goes wrong but still it has its diehard advocates. 🙃
@adritheonly @masek
You forgot expensive as fuck both to build and to decommission.
@leeloo @masek I also forgot the land it occupies that cannot be utilized for anything like farming. Solar and wind , on the other hand, quite happily co-exist and in the case of solar, actually aid farming. The only reason nuclear is still popular is that a few guys are making a lot of money conning others into adopting it.
@adritheonly @masek Depends, the new generations are extremely expensive (for a combo of political, technical and financial reasons), but the previous one weren't (e.g. this allowed France's electricity to be and remain cheaper than its neighbors for years). As for the safety, it clearly has its risks, but they are fairly well mitigated and burning coal is far worse (it kills *a lot* of people every year due to pollution and - ironically - natural radioactivity of coal ash).
1/
@adritheonly @masek So in hindsight, the choice to build nuclear plants decades ago (where the alternative was oil and coal) is IMHO the good one. That said, I'm unsure of the best choice for *future* construction.
Another aspect that you didn't mention is that nuclear reactors (and coal/gas plants, and hydroelectric stations) have turbines, which is good to maintain and stabilize the network frequency.
As for the "slow to steer" argument, that's undoubtedly true, but not a problem
2/
@adritheonly @masek as long as you use it for baseload.
In addition, some plants actually do load-following (France does for example, because they have too much nuclear power to do without). Cf. https://en.wikipedia.org/wiki/Load-following_power_plan: «Modern nuclear plants with light water reactors are designed to have maneuvering capabilities in the 30-100% range with 5%/minute slope, up to 140 MW/minute.»
@adritheonly @masek I say all this not to defend nuclear power (my opinion won't change the choices that my government makes either way), but to say that electricity generation is a tradeoff between solutions that each have advantages and problems.
And that I believe 50 years ago that choice made total sense. Today, I don't know, there is so many parameters and renewables are making progress very fast, so I am holding my judgment on that one :)
@nightmared @masek Sure. Humanity has come a long way since happily spraying DDT on school kids. The trick is to keep up and adopt what is better, decommission what proves disastrous in the long run. France could easily slowly change from nuclear to other sources of power, it has the money and tech.
@adritheonly @masek Well, I don't know about the money part (that a hot topic currently in the country, because our debt is deemed too high), but we clearly do not have the technical ability to do so: I'm fairly sure the PV cells we buy all come for Asia, and I doubt we have the industry or the financial capacity to bootstrap our own supply chain.
@nightmared @masek China started somewhere. If I remember correctly, it was by turning other countries' rubbish into cheap consumer products and focusing heavily on tech education. It can be done.
@adritheonly @masek We live in a short-term, profit oriented society. I doubt there is enough goodwill to develop the technology, and China were able to do so because they have a lot of cheap energy, a strong industry (because of that manufacturing you mentioned) and the desire to finance for years on end the development of technology in the hope that it proves usable later. I'm too pessimistic to believe private companies will behave like that. I'm sure we will deploy a lot of renewables, I am
@adritheonly @masek happy about that, but I'm also certain these renewables (at least for PV) will come from Asia. I have accepted that, even if I'm unhappy about it.
@nightmared @masek Perhaps then, it is time for society to realize it has a problem and change? From where I'm residing at the very South, Europe appears stagnant. Very dangerous, stagnation usually leads to death.
@adritheonly @masek I deeply agree, but I don't make decisions: I'm but a lowly computer engineer, the decisions regarding energy policies or supply chains are kilometers above my "pay grade"
@adritheonly @masek Also: that is my opinion, but I'm not at all an expert in the matter, and I may well be wrong. So take everything I say with a grain of salt.
@adritheonly @masek Also, what I was trying to say is that I understand that some may dislike nuclear power, but it was the correct choice back in the 70's, that did not prove disastrous at all: the difference of CO2 emitted in the atmosphere in the last 50 years by Germany vs. France is ridiculously high. Had we succeeded at launching a new plant generation a decade ago (technically, we have, but the cost was far too high to say it is a viable model), it could have been a good choice.
@nightmared @masek It worked at the time, now it is time for change.
@adritheonly @masek I deeply regret the political choice to abandon research and industrial ventures for the 4G of nuclear plants, that aimed at "closing the cycle" (which would have made us both more energy-independent and allowed to reduce our existing nuclear waste). This, in my opinion, mad no technical sense and actually ensure that nuclear is not a technology for the future generations (that it could have been, and perhaps could still be if we look at the current developments in Asia).
@nightmared @masek Oh yes, nuclear waste. The problem no-one wants to discuss... Ours keep piling up on a large piece of land that cannot be used for, well, forever and we only have the one plant. Where does France dump its nuclear waste?
@adritheonly @masek The amount of nuclear waste is actually not that high in volume or weight (we even store and treat nuclear waste from foreign countries) when you look at the fact that it's the result of >2000 years of reactor operation (50 reactors * 40 years).
The current plan is to store long-lived waste in a stable (hopefully), deep underground storage facility: https://en.wikipedia.org/wiki/Cig%C3%A9o
Cigéo - Wikipedia

@adritheonly @masek This is a very political subject in France indeed, and the fact that France has a partnership with Rosatom (which, like most significant nuclear companies, also have military ties) doesn't help.
@nightmared @masek Oh dear, Rosatom! The company that tried to sell us a nuclear plant until we, the people, put a stop to it.
Ha yes, the topic of the nuclear waste where everyone "forget" that every project to solve the issue are sabotaged by anti-nuke activists. I wonder why...
@nightmared @masek Quite agree. Everything is better than coal. Incidentally, a recent discovery claims there are a lot of vital e-minerals in coal ash. Hopefully this means that instead of being dumped into rivers and left to float into lungs it will actually be used better.
@masek thank for this - best written piece I’ve read about what actually happened

@bgergely0 @masek except for that part where the causes it confidently identifies as "well-documented" never happened.

Here is the French grid operator RTE dismissing Fake News 1: "one transmission line to France caught fire"

https://www.ladepeche.fr/2025/04/28/vrai-ou-faux-coupure-delectricite-massive-en-espagne-la-panne-geante-causee-par-un-incendie-qui-a-eu-lieu-entre-narbonne-et-perpignan-12664449.php

Here is the Portuguese grid operator REN debunking Fake News 2: "atmospheric oddities":

https://sicnoticias.pt/pais/2025-04-28-e-falso-que-fenomeno-atmosferico-raro-tenha-estado-na-origem-do-apagao-1a078544#:~:text=la%20propia%20REN%20ha%20negado%20dichas%20reclamaciones%20ante%20la%20SIC

I'm no longer the only one pointing this out to @masek plenty of time by now to maybe edit the two posts?...

VRAI OU FAUX. Coupure d’électricité "massive" en Espagne : la panne géante causée par un incendie entre Narbonne et Perpignan ?

Selon la compagnie nationale d’électricité du Portugal (REN), la coupure de courant qui impacte en ce moment la péninsule ibérique pourrait être liée à un incendie qui aurait eu lieu entre Narbonne et Perpignan. Selon...

ladepeche.fr
@masek very interesting theory. I’m not sure if losing the connection to France should have lead to an unmanageable frequency spike though. According to the entso-e dashboard physical power flows to France we’re ~1GW between 12:15 and 12:30 CEST. That’s on the scale of a single nuclear reactor. I’m no expert on these things but I would expect grids to have to occasionally handle single events of that size. https://transparency.entsoe.eu/transmission-domain/physicalFlow/show?name=&defaultValue=false&viewType=TABLE&areaType=BORDER_BZN&atch=false&dateTime.dateTime=28.04.2025+00:00%7CCET%7CDAY&border.values=CTY%7C10YES-REE------0!BZN_BZN%7C10YES-REE------0_BZN_BZN%7C10YFR-RTE------C&dateTime.timezone=CET_CEST&dateTime.timezone_input=CET+(UTC+1)+/+CEST+(UTC+2)
Data view

@florian @masek

Large inverters should be back in power and not in island mode

@masek Everybody knows was Nacho Vigalondo with is time travel experiments...
@masek : writes interesting technical explainer of otherwise opaque incident.
Other social networks: tl;dr
Fedi: Yes, but did you consider…
@masek Very intersting analysis. Sounds plausible, waiting for more official readings.

@masek

In that case, the inverter goes into what’s called island mode and produces power only for local use. So, if my solar system isn’t connected to the external grid, it can’t run the house – but it can still power two little emergency sockets. Cheers, I guess.

Why’s that? Couldn’t it disconnect from the external grid and keep generating electricity for your entire house in island mode (as long as you’re using less energy than it’s generating, ofc, but you probably are)?

@luana @masek Yes, if you have a hybrid system, the controller can go into safe island mode (cut the grid connection) and start charging a battery instead, and run the house off the battery. But this requires having a whole-house battery.

(You can run household solar in island mode without a battery, but it's trickier, and so usually the fallback is "hey, grid's down, plug your fridge into this special emergency outlet instead".)

@varx @luana @masek And this technology, to automatically island your household power, is very new. I had one installed when i lived in the US.. The two times the power went out i didn't even notice.
@masek Fantastic, Martin Seeger: thank you for the very thorough explanation and comments on the outage in Spain!

@FMarquardtGroup @masek Parts of it are fantastic in more ways than one. Here is the French grid operator debunking the "well documented" transmission line to France that caught fire (no, it didn't):

https://www.ladepeche.fr/2025/04/28/vrai-ou-faux-coupure-delectricite-massive-en-espagne-la-panne-geante-causee-par-un-incendie-qui-a-eu-lieu-entre-narbonne-et-perpignan-12664449.php

And here is the Portuguese grid operator REN debunking "atmospheric oddities" (which was a fake propagated by Reuters, one of many).

https://sicnoticias.pt/pais/2025-04-28-e-falso-que-fenomeno-atmosferico-raro-tenha-estado-na-origem-do-apagao-1a078544#:~:text=la%20propia%20REN%20ha%20negado%20dichas%20reclamaciones%20ante%20la%20SIC

VRAI OU FAUX. Coupure d’électricité "massive" en Espagne : la panne géante causée par un incendie entre Narbonne et Perpignan ?

Selon la compagnie nationale d’électricité du Portugal (REN), la coupure de courant qui impacte en ce moment la péninsule ibérique pourrait être liée à un incendie qui aurait eu lieu entre Narbonne et Perpignan. Selon...

ladepeche.fr
@masek @Veza85UE @FMarquardtGroup
@dictatriz
For whatever serious engineering analysis purposes it may serve, here is the flow between ES & FR that Monday:
@Veza85UE @FMarquardtGroup @masek The notes about Portugal are also wrong: 23h was the time it took for Spain, according to BBC. Portugal restored it much sooner: Algarve (one of the last places to get power, if not the last) got power around 1am, around 13-14h after the event started. Where I live (near Lisbon), power was restored around 22:30, 11h in. We bootstrapped the grid, and later in the process had additional help from Spain when they were stable enough to do so.
@arroz @FMarquardtGroup @masek *insert guy knocking on temple meme* You don't have any plot holes in your cool "explainer" article if you don't factcheck. The German version of this post has been shared over 500 times... the comments even here are full of people going: "Some of it might be bullshit, but I LIKE it!" We're enshittifying our societies back into authoritarianism because the easily digestible Narrative is too *satisfying* to factcheck. 💆‍♀️

@masek @miawgogo Most grid relays will open contractors at frequency deviations as well though, even for conventional generation

All the ABB gear we used defaults to a 60.2 grid trip, although our New England ISO gives it more margin I think. The same thing can happen with natural gas plants or anything else. Unless there’s a subtlety I’m missing, I don’t see how this is particularly related the region having a heavy solar portion

@masek The theory of fire in France has already been dismissed by the authorities (https://en.wikipedia.org/wiki/2025_Iberian_Peninsula_blackout#Fire_in_Southern_France).

The current, most plausible theory of what happened is that the blackout was the result of an extremely rare event where two power generation stations dropped off the grid with less than 2 seconds of difference, as explained in this thread (in Spanish, sorry) by someone highly knowledgeable on the matter of energy: https://mstdn.games/@dictatriz@paquita.masto.host/114421261780833937

2025 Iberian Peninsula blackout - Wikipedia

@masek Thank you for writing this up 

@masek It definirely sounds like sync issues.

But I'm not totally sure I follow the inverter explanation. I know that generators of old would spin up when the load decreased (except the grid would then serve as a brake), but are inverters really so slow they can't detect a frequency drift and get back in line before disaster strikes?

@masek
I've seen references to, but no description of, the "meteoroligical oddities". Have you come across an explanation of that part you would reccomend?
@masek whether this turns out to be the scenario or not, it was very well written and explained. I really enjoyed reading it. Thanks.