One-minute frequency disturbances from synchronization in power systems
nature.com
nature.com
In this instance, one fix is to fire the timer every 59.XXX seconds, so it will naturally drift out of phase with the minute hand of the clock.
If work needs to be done exactly every 60 seconds, this is fixed by having a WAIT(RAND(60e6)) microseconds during the first timer initialization, so if 10,000 units start simultaneously they don't try all at once. This is good practice in most (all?) systems. Hint: test power and infra outage/reconnect, which can unintentionally sync timers.
This is why many software will do automated updates every 17 hours: 17 is coprime with 24.
Classic "thundering herd" mitigation tactics.
Edit: Tempting to blame IoT, but (since this is news) I don't think anyone knew there was something to fix here. We have the tools however.
But yeah, as soon as you start using Rand most people make all sorts of mistakes. And if you’re using C Rand, don’t. It has other statistical problems.
The other thing to watch out for is you’ve still got 1/60 of the thundering herd at the second level. If the tasks are <1s and you have enough of them (as you probably do at grid scale), then doing it finer grained is warranted like offsetting the timer by a millisecond sleep of 10 * uniform_distribution<int> between 0 and 6000. That then gives you 10ms granularity, distributing the workload by two more orders of magnitude.
I should have said, you almost always want to use the randomly staggered timers on initialization, not just when the exact timer interval matters! It's also important to test electricity or backend outages, which can unintentionally synchronize all the timers.
A common aggregation is about 10ms although most OSes can give you finer granularity accuracy if you ask for it and have permissions. It really depends on how long the task takes and whether there’s any non-uniformity in its processing to make finer granularity helpful or harmful.
Unfortunately some people do read advice like it’s mana from the gods instead of thinking through the implication on their specific problem.
You want your jitter to be significantly >> than the time your task takes as otherwise you get non intuitive degradation that can reintroduce the problem you’re trying to solve. It’s a balancing act picking the jitter that drops off the thundering herd enough and one that is still greater than the time your work takes.
Secondly, the amplitude drops. Events that were concentrated on the xx:xx:00 times are now distributed into xx:xx:xx times. If the overall number of events is the same, each :xx time slot now receives 1/60th of the events that were concentrated on the :00 time. If power decibels are relevant here (20 log 10 x), that's a 35 dB reduction in amplitude of the driving signal.
35 dB less amplitude, shifted to a 6 octave higher frequency that the grid doesn't react to very well can be expected to basically make the problem vanish.
This is much like the situation of soldiers avoiding rythmic marching when crossing a bridge to randomize their footstrikes.
It's sort of a solved problem - the ones I'm aware of are things like LynTec sequenced panels built exactly for this, and Siemens' SENTRON semiconductor CBs where you can control then curve to your spec.
Convincing stakeholders though, is almost a job of its own.
The vendor did get the hint, and the second iteration of the device did slowly warm up the pumps so this process would no longer be required.
https://onccy.com/how-to-choose-between-type-a-b-c-and-d-min...
Notoriously a crescent wrench makes an excellent 1000A slow blow fuse
You can observe this with a speed control knob/ESP32 where a running fan will happily run forever with the knob turned down to e.g. a 30% duty cycle. But after turning to 0% and waiting for the blades to fully stop, if set back to the same 30% they won't move at all or you'll maybe hear a sketchy clicking/whine sound with the blades intermittently twitching.
My mind goes somewhere completely unrelated to the comment though: cicadas!
I believe it is a mystery why some species of cicada have have a 17-year life-cycle. Theories have included avoiding predation etc.
However, I wonder if the 17-year cycle (prime) avoids "even wear patterns" somehow in their DNA??
This type of scheduling should be randomized at the seconds level, perhaps. Unfortunately, it would require a massively coordinated effort across numerous operating system and application stacks.
The article says as much:
> The identified synchronization mechanism is not specific to UPSs or battery systems, but reflects a general property of digitally controlled devices operating with external timing signals or periodic software routines
Like TV pickup, where advert breaks in television cause surges in power demand.
The classic example is everyone making a cup of tea at the same time during the World Cup half time break.
Something as common as predictable as every minute should be simple to model in.
Are we talking soccer? I can't even imagine the british drinking tea while watching :)
I just checked the power meter dashboard of the building and can see small peaks in the minute range.
In this case it's not counting in too much on the grid level as there's a periodically charged batterie in between.
It also made me think about how many GitHub Actions I have that kick off on Sunday morning at a specific time. I try to vary the time/day for those jobs but I'm guessing there are enough things that kick off at specific time intervals to make an impact at the top of an hour, or at :15, :30, :45...
If enough people used that, with a high enough value of N (say 1800 for jobs that really don't have to start at any particular time), it would greatly spread out the spikes in accidentally-coordinated usage.
The FFT indicates this is a periodic signal, not a once a day or week thing. It's happening continuously all day every day. I don't know of any UPS systems that perform tests with this kind of regularity.
In any case, I refuse to believe an external sync signal is causing this. The more likely explanation is that the active elements are pulling each other to a common mode due to being physically coupled on the same grid. This is like how clocks on the same beam will synchronize.
From the article:
> The origin of these current peaks was independently confirmed by the manufacturer to be periodic self-tests executed by the battery EMS, confirming our interpretation. Similar minute-scale diagnostic routines are also documented for other commercial UPS systems (cf. Supplementary Note 8).
https://www.snaptec.com.au/akkutec-4801-din-user-manual.pdf
> battery circuit testing 1 x per minute for 1 sec
https://adelsystem.com/hubfs/PDF%20DC-UPS/Instruction%20Manu...
> The battery testing is carried out automatically every 60 sec.
Their testing on the enterprise-class equipment shows the difference that NTP makes, and with enterprise-class equipment comes wider deployment and more powerful models.
But most of the consumer units would not have this stuff. Surely, the manuals would describe how to set it up.
When the power goes out on the grid, everything is turned off at the same time. When the power comes back on, everything turns back on at the same time. Every machine that had a 60 second timer is now operating from the same starting time.
Whether it's by buying and using a trillion tokens strategically or by inserting synchronized malicious jobs it should be possible to find some resonant frequencies in the line frequency control system. By loading and unloading multi-megawatts of draw you could get the local supply throttling up and down enough desynchronize from the larger grid. If you could get real time measurements of the line frequency you could use that to tune your malicious load and do the whole 'pushing a kid at the peak of their swing' thing.
To mitigate you would have to put dummy loads or some kind of minute-scale power storage onsite or nearby to compute loads.
Further, there is no single resonant frequency, only the particular resonance of that exact moment in time. The grid is composed of many generating units, many transmission lines, many transformers. The resonant frequency of the grid is changing moment to moment as those things come online, get loaded partially, go offline, heat up, etc.
This is not a child on a swing set problem.
And you're not aiming for some physical resonant frequency of the entire grid, just the controller on your local generator, getting it to ramp up and down chasing just behind your changing load.
I live in Ontario and in the past week the difference between our highest and lowest demand was ~4.5GW, but those changes take place over hours. If you can ramp up and down a 0.1GW load over minutes there is going to be a point where some control loop can't keep up. Generators have physical inertia but compute loads do not.
I agree that it's not trivial, not cheap, and not efficient but with the state of the world it would not be a surprise if some nation thought it would be useful to burn resources in order to disrupt an important event, maybe elections?
In any case, a 4.5gw load imbalance from moment to moment is not a difficult problem to solve. This is why all utilities are required to have 'spinning reserve' available to serve new load at very short notice. In the meantime the grid would just drop frequency very slightly (like 0.1 hz would be an enormous instantaneous deviation)
(By the way, the article is in Nature Energy, not Nature which the URL suggests.)
Thankfully, usenet usage is way down, so we won't need to worry about this. ;p