Earth Notes: Hey Siri, Flatten the Duck! (2017)Updated 2022-05-03.
Summary Questions and Answers
What MacBook change would help the grid?
Avoid charging to 100% or at full rate, when the local grid is under strain or at high carbon intensity. This is known as Demand Side Response (DSR) or virtual power plant (VPP). Allow an easy override for when the user really needs the laptop full, fast.
What MacBook change would help off-grid?
Limit charging power, since off-grid sources may be more sensitive to the initial aggressive charging power when a MacBook battery is low. Allow an easy override for when the user really needs the laptop full, fast.
Can other devices with storage help the grid and off-grid?
Yes, the same techniques to limit maximum charge percentage and maximum charging power at the right moments will make a difference. Phone batteries are smaller but there are lots more of them for example.
Flattening The Duck?
California invents lots of things, including cute names for shared problems! To quote "We have come to flatten the duck":
In California, fossil fuel power plants have been complaining that solar panels steal their business during the day, and stop producing when the sun goes down. This happens exactly when everyone gets home and switches on air con, cookers, TVs etc.
So a massive ramp up in production is the result. [and results in a load curve that looks like a duck[PDF]]
The shape of the curve is very California-specific, but the problem is similar across the globe.
Solar may be part of the answer, storage and demand response the other part.
More directly Flatten the Duck says:
Energy Storage has emerged as a leading solution for smoothing out the duck curve. By absorbing some of the excess energy generated by solar during the daytime and supplying it to building loads or feeding back into the grid in the afternoon and evening, it creates a flatter demand curve that will make it possible to accelerate the acceptance of renewable energy resources.
So how can Apple help, at home in sunny CA, and elsewhere in the world?
There seems not to be "an app for that" yet, possibly because the right controls are not made available by the operating system.
Some slight cleverness injected into its operating systems (and Apple lives by that, yes?) would turn its legions of battery-powered devices into virtual storage helping the grid avoid dirty and expensive fuels and use more renewables, at zero cost.
As Upside says "The electricity grid is under stress. At peak times, it is forced to use its oldest, dirtiest, most expensive power stations to meet demand."
Furthermore, the grid has to be sized to cope with peak demand, in terms of pylons, generators, etc, building in higher costs that appear on bills and waste embodied energy too.
So What Tweaks Are Needed?
(I tried to find ways to engineer solutions myself, for my MacBook Air, but haven't yet found out how to. I think that some may only require a software tweak by Apple to make possible; others may require some hardware tweaks too. Exposing and documenting features to make these things possible would allow Apple or third parties to quietly make things "just work" better by "flattening the duck", and help save the planet!)
The operating systems (MacOS/iOS) already have a notion of where the machine is in the world from location services, eg used to automatically set the timezone for the clock.
From that location (and the season) it is easy to know roughly when peak demand happens, eg winter evenings 4pm to 9pm in the UK, from a built-in database that would be easy to maintain.
In many cases it will be possible to work out which grid the machine is likely connected to. And also to discover dynamically over the Internet (when available) when the grid is under stress, eg from tools such as the live display on this site using CO2 intensity as a proxy, or from live stats from organisations such as ENTSO-E for Europe, or the ISOs in the US. Possibly behind a server run by Apple to avoid flinging millions of extra queries at these third-party systems.
Other openADR service providers and aggregators may be happy to oblige, being paid to manage this free demand response.
Upside itself co-ordinates UPSes (Uninteruptable Power Supplies) for companies' computers to provide exactly this kind of service.
The algorithm to provide virtual storage to the grid might look like:
- When on mains power rather than internal battery:
- Don't attempt to charge the battery beyond (say) 80% (which would possibly prolong battery life too).
- If possible limit the rate of charge when below that threshold (which would possibly prolong battery life too).
- Switch on some or all of the energy-saving features as if on battery, such as dimming the screen a little and blanking it sooner.
- Put a grid-status warning in the menu bar; this could be helpful for uses beyond the device itself!
(An even more grid-friendly version might not charge beyond ~90% unless the grid had too much generation, in which case it would help absorb that excess by allowing charging to 100%.)
All of this is only needed when the device (laptop, phone, etc) is accepting power from what it thinks is an AC mains adapter.
All of this could be overridden by settings in "Energy Saver" System Preferences "Power Adapter" panel.
Bingo: 1 million laptops deferring 20% of their 50Wh battery charge would defer 10MWh of demand on the grid until it was in better shape. No pain, no cost, can be turned off by the user easily, and unlikely to cause any major pain in any case.
Note that even relatively small amounts of storage are valuable both to contribute to a large pool, and depending on how fast that storage can respond. Typical grid managers use a range of services with response times from the order of seconds to hours. The laptop virtual storage pool can be at the faster end of that.
Further, see off-grid section below, in may be reasonable to expect to curtail each laptop's peak consumption by 50% by carefully controlling charging, which might be 30W per laptop or 30MW, which represents a chunky expensive emergency diesel generator that does not need to be fired up.
Available Virtual Storage Capacity Estimate
This is an initial estimate, for which I would welcome better values for different grid catchment areas.
In the UK (for the GB grid) at least one million laptops plugged in to AC mains at times when they could make a difference, with (say) 10Wh deferrable charging/capacity each out of a 50Wh battery (so 20%, eg not charging beyond 80% full when the grid is stressed) for 10MWh of aggregate virtual storage.
Worldwide Apple sold more than 5 million Macs in Q1 2017, ie ~20m/year. Only 5% of those have to be in the UK and be in use for at least one year (and typical lifetime is probably several years) to support the above.
(Note that smartphones and tablets, while containing much less battery than laptops, are much more numerous, so may make a similar virtual storage contribution if plugged in at peak times and/or when the grid needs emergency support such as when a major generator trips off the grid unexpectedly.)
Gross grid demand in peak hours for (say) the GB grid in winter is of the order of 5h * 45GW = 225GWh, so the 10MWh of virtual storage is clearly in 'balancing' territory, as part of a wider pool of grid services and support.
I have a modest off-grid solar PV system with batteries, that supplies some light loads, separate from the grid-tie system on my roof. What I describe would apply just as much to someone living and working off-grid in a solar-powered cabin in the woods or van on the road, etc!
In the battery use/charging graph below, just before noon, my Internet connection hardware (eg router) automatically switched off-grid taking ~16W. A little later I plugged my MacBook Air into the off-grid system with the MBA's battery at about 20%. Whoomph! Another 60W from my off-grid system! If the sun had not been out some of that would have had to come from storage, wasting energy in the round trip and eating a little of its cycle life. And 60W is quite hard on various off-grid system components, considering that the average MBA load (see about 16h00) is more like 10--20W.
I was in no particular hurry to recharge my MBA at that point, and indeed I am usually not hugely time limited in my access to a charging source. (Maybe I am, just occasionally, when in a café on business.)
It would be good if we could tell our Apple devices in software to cap their additional charging demand to something like the typical non-charging demand to reduce the stress on upstream devices, or even not charge at all temporarily or unless below some low-water mark such as 80%. These could be advanced controls on the "Energy Saver" System Preferences panel, and indeed overlap with the grid-friendly features mentioned above. The only penalty is a slower charge, but the battery life could well be extended by the more gentle management.
NUT / APCUPSD
One way to achieve some of this may be to use a tool such as NUT (Network UPS Tools) and install a client side on the Mac (eg MacBook Air) that sensibly polls a server indicating when the grid (or local storage) is under strain and reduces power demand (eg blanking the screen sooner).
With a little bit of nudging (2018-09-01) I got
brew install nut to do something, but it didn't add any UPS controls to the the system "Energy Saver" GUI.
This superuser.com item How to Automatically Launch NUT Client at Boot on MacOS seems promising to indicate how to complete setup.
Another route may be APCUPSD, though again, simply installing that (without config edits) did not magically make any UPS options appear in the "Energy Saver" control.
The key elements of the
/etc/apcupsd/apcupsd.conf config file to be edited may be:
UPSCABLE ether UPSTYPE net DEVICE grid-distress-server:port
Though this is not enouraging: "Note: None of these settings are observed on a system with support for an internal battery, such as a laptop. UPS emergency shutdown settings are for desktop and server only."
pmset when run as root allows manipulation of power management settings. Without root it can display them:
% pmset -g System-wide power settings: Currently in use: standbydelay 10800 standby 1 womp 0 halfdim 1 hibernatefile /var/vm/sleepimage powernap 0 gpuswitch 2 networkoversleep 0 disksleep 10 sleep 9 autopoweroffdelay 28800 hibernatemode 3 autopoweroff 1 ttyskeepawake 1 displaysleep 9 acwake 0 lidwake 1
Interestingly, in macOS High Sierra (10.13.6) "Energy Saver", adjusting the "Turn display off after" control adjusts both "sleep" and "displaysleep". Adjusting "sleep" does not show in the control. So it may be possible to keep a monitoring process (for grid carbon, etc) that forces (say) "sleep" to something like battery values to save power, and restore it to the "displaysleep" value when the grid (etc) is happy again. A bit crude, but may be OK for a first pass...
I have just installed the free version of "AlDente". It prevents a MacBook battery from being 'overcooked', ie overcharged.
By default AlDente limits charge to 80%, which should prolong battery life.
It may be possible to fiddle with this to adjust the maximum charge level to respond to grid state, or to off-grid conditions when approproiate. This might even be possible by observing which charger ID is plugged in. I logged two issues/suggestions. See the info available from
ioreg -w 0 -f -r -c AppleSmartBattery.