Sunday, October 15, 2017

Paying People Not To Use Electricity - A Beautiful Scam

Paying people not to use electricity is not on the scale of the WMD claim that justified invading Iraq but more exciting for me because I was there when the idea was born, just after that war. It started small and I expected it to die young but it has grown in stature to the point that it gets a mention by Sarah Hanson-Young on QandA, praise everywhere you look and the prime minister is promoting it as part of the solution to Australia's electricity problems. Now that it's public policy, there's an option for the man in the street to climb on the bandwagon and win some pocket money extracted from the pockets of those that ignore the opportunity. Those that take advantage will be paid to help the wider community understand the fatal flaw, but anyone interested should do so fast as surely this one can't last long.

We are a nation blessed with an abundance of sun, wind, coal and gas and back in 2004 this was reflected in Australia having close to the worlds cheapest electricity. That was when a CSIRO team started work on the idea of paying people not to consume electricity. I was part of that team and for a short while shared in the excitement. Nobody is penalised or coerced into contributing to reductions in peak electricity demand but those that make the effort benefit. People can generate value by not doing something and get paid. What could be better than that? After a light bulb moment though, I could never view the idea this way again, it was so obviously daft. I pointed out the fatal flaw to colleagues and suggested we should try other approaches to demand side response. Other approaches though were boring, incrementalist and difficult to make cost effective at the low power prices of the time. I'd never have predicted that weaknesses in electricity industry oversight would be exploited so successfully that Australia now has close to the worlds most expensive electricity.

Growth in electricity prices over 10 years. Source: Rod Sims - National Press Club Speech, 20 September 2017. For a more complete analysis see a comparison of Australian and US electricity prices over time.

My colleagues were more prescient, the fashion for developing novel methods of extracting funds from electricity consumers was at its dawn. Electricity had been a boring industry for many years until that time. My suggestions got some support from my boss, who'd also been drafted into the project, but outright hostility from those in charge. They wouldn't confront the fundamental problem and when the project plan was prepared for the following financial year I was no longer allocated to the project. I couldn't understand the hostility, I thought I was helping the team by suggesting we adjust our goals to avoid inevitable failure but in retrospect I realise my colleagues were far wiser, they were pursuing a more useful truth, which has paid off big.

A truth can be harnessed to achieve useful outcomes. A truth doesn't have to be absolute, true in particular circumstances is sufficient, even if that truth becomes untrue outside the relevant domain. We may scoff today, but Ptolemy's geocentric model for planetary motion was used to prepare astrological and astronomical charts for over 1500 years. No one scoffs at Newtons law of universal gravitation. It is a useful truth with continuing practical application but in Einstein's general relativity, gravitational force is a fictitious force arising from the curvature of spacetime. The most favourable outcome a research team can hope for in CSIRO is to be well funded and that requires exciting novel ideas. Boring incrementalist approaches will not be funded, researchers must promise something grander than anyone else. This is a fundamental truth, but everyone's proposals are grand so it's also impossibly hard. When there are many excellent weavers how does a weaver win the contract to supply clothes for the emperor. He must promise something others can not, the finest, best suit of clothes from a fabric invisible to anyone who is either unfit for his position or hopelessly stupid should do it. As a child I hated this story because I thought it ridiculous. I couldn't understand the desirability of keeping up the pretense. As I age, I find the truth it reveals to be profound. In the circumstances of the courtiers it truly was a beautiful suit, the quality of which contributed to their good standing with the emperor and continued well being. There can be no greater success in CSIRO than a world leading project that has managed to grow for thirteen years and become a major public policy initiative. It is a truly excellent project.
This is a great yarn which is often interpreted in different ways. A short and seemingly simple tale that's really quite deep.

The emperor looked a bit of a dill after the boy revealed a greater truth but he carried on with the parade. The weavers kept their fee and the emperor kept his throne, so no harm was done. Similarly when Hans Blix was urging caution, the best insider response was to ignore the doubts and discredit him. Those urging war would get to enjoy the spoils, so the existence of WMD was a useful truth even if it would eventually be mocked, much like the fate that befell Ptolemy's geocentric model. To maximise income from reducing electricity consumption in times of peak demand consumers must first shift as much of their consumption as possible to times of peak demand. This is the opposite of the purported aim. Paying people not to consume electricity will eventually lose favour but the emperor will carry on and the CSIRO heroes will keep their honors and promotions. Australians will pay a bit more for electricity but in truth, that doesn't really matter much.

Sunday, September 17, 2017

Electric Unicycle Batteries And The Design Flaw That Makes Wheels Dangerous

Figure 1 - An Airwheel X8 in action


Electric unicycles are mostly safe but an instantaneous loss of power results in rider injury. Most wheels have a design flaw that causes this dangerous situation to occur as they age. A rider is likely to experience a rare and mysterious shut down on a wheel that was for a long time safe.

This study explains the problem and details investigations into two particular models, an unbranded el cheapo and an Airwheel X8. Both these wheels were flawed with the el cheapo failing quickly. It is possible to avoid shutdowns with the X8 by replacing the battery before it gets old and modifying the electronics can completely avoid low voltage shutdowns.

An interesting observation arising from the study was that adding a second battery in parallel should increase range by a factor of about three.


Wheels at low speed are generally pretty safe as you can easily step off. The foot platform striking an obstacle is difficult because the riders body continues forward without the wheel underneath. Some quick foot work is required to get the rider's feet back under their centre of gravity but as they can push off the wheel platform it usually ends well. Motor shutdown on the other hand is dangerous and I'm not the first to observe this. I've experienced it four times and it always hurts.

Why Is Motor Shutdown Catastrophic?

Figure 2 -A shutdown looks similar to this
When the motor is driving forward, the riders weight must be forward of the wheel centre so that the torque produced by the rider matches the torque produced from the horizontal ground reaction as shown in Figure 3 .
Figure 3 - Stable forward motion
If that ground reaction is lost the rider will be hanging in space without a force to oppose gravity and will therefore descend face first as shown in figure 4.
Figure 4 - What happens when the motor stops.
It is worse than tripping over while walking as the rider can not push against anything to try and recover or reduce their rate of descent. No horizontal reaction force is possible. An exclusively vertical force through the feet, which is all that is possible, serves only to increase the riders rate of rotation about a centre of gravity which moves further forward of their feet as they approach the ground. Only hands can be used to break the fall. Hands, knees and sometimes the face will hit hard and suffer injury. The only chance is to pull the knees toward the chest faster than the rider is falling and throw the feet forward. I know its been done but I've never pulled it off. I find I'm already on the ground before I've realised what was occurring.

In this video a rider dismounts gracefully from an unpowered wheel by pulling one knee upwards as he is falling, planting his foot in front of his body and relying on forward momentum to lift his centre of mass above his foot. He is undoubtedly a talented rider but his starting point is one of balance rather than hanging in space and he doesn't have to realise during the fall that he needs to do the opposite of what he would normally do when tipping forward, as is required on a powered wheel.
Figure 5 - This minor scrape was from catching the foot plate and stumbling on the dismount. The shutdown injuries were much worse.

My Four Shutdowns

The first was on a wheel only two weeks old that had a cell in the battery pack fail suddenly, dropping the cell voltage below the shutdown voltage. If you buy the cheapest wheel possible, it will almost certainly have low quality batteries as they are a large proportion of the sellers total expense making battery skimping the easiest way to achieve low prices. This is what led to the hover board failures that made the news a while back.
Figure 6 - Low quality batteries can fail without warning and even catch fire. 

Stupidly, I replaced the failed cell with a cell that had protection which tripped out in use and that was the second shutdown. The wheel seller sent me another battery but took the el cheapo wheel back before the battery arrived. Next I went up market with an Airwheel X8 and had 18 months of trouble free wheeling. Oh what joy! I sensed the battery was aging, removed it to test and fitted the generic pack I'd been sent previously. First time I rode with the new battery it lasted well but the ride ended with a shutdown. I put back the aging battery which had tested as worn and had another shutdown early in the ride. This exacerbated the injuries from shutdown three that hadn't yet had time to heal. Shutdowns three and four were a mystery so some investigation was required.

How Are Wheel Batteries Managed?

The batteries are built from lithium 18650 cells connected in series and packaged with a battery management system (BMS) like that shown in figure 7 and listed on Aliexpress with the specifications in the appendix.
Figure 7 - A Battery Management System (BMS) for a wheel is packaged together with the 18650 cells. Note the 4 FET switches in the top left. Three of these are used to switch off power to the wheel when over current or under voltage is detected and the fourth switches off the charging current when the cells are fully charged.

The BMS manages cell balancing, charging and supplies power to the wheel through switches (FETs) that are switched off in the case of over current or under voltage.

On an X8 wheel there are four battery indicator lights. The number lit reduce as the battery discharges until, at the minimum acceptable voltage the wheel beeps a lot, flashes all four lights and goes into tilt back making it hard to ride.

The battery charger is not smart. It supplies a constant voltage up to its maximum current and shows a red light to indicate charging. The light turns green when the current falls low enough to indicate a full charge. The actual charging current is controlled by the BMS, not the charger. I hadn't realised this at first and, when the wheel was disassembled, ended up damaging the original X8 battery and the generic wheel replacement battery by charging through the discharge cable. This bypassed the BMS charge control and caused overcharging.

What Went Wrong?

It is under voltage that caused all my shutdowns and most other people's as well. The primary problem is a design flaw. Sure, we want to protect batteries from under voltage that will wreck them but it shouldn't be by injuring a rider. This flaw lurks always but will not be triggered by most usage scenarios. Normally the wheel goes into tilt back and the rider dismounts before low voltage shutdown occurs, however under certain circumstances shutdown will occur without tilt back. How this can happen is investigated in the following testing.


The batteries were discharged at a low 0.2 amps rate and the voltage periodically measured. This data was overlaid on published test data for the Panasonic NCR18650PF cells, these being the type fitted to the  Airwheel X8. The voltage at which each battery indicator light changed state was measured and the voltage at tilt back and shutdown was measured.


Figure 8 shows battery discharge data for the X8 battery before overcharging, after over charging and for the generic battery after overcharging. It also shows the per cell voltages for shutdown etc.
Figure 8 - Published test data overlaid with testing data of an aging cell X (black), aging cell after overcharging X (grey) and generic cell after overcharging X (blue). The discharge rate for the X tests was 0.2 amps.

The aged X8 battery is shown to be, as suspected, of significantly reduced capacity and was made worse by a single overcharge. The generic battery after one overcharge is shown to be of much lower capacity than the X8 battery after over charging. The shutdown voltage of the generic BMS was 3.56 volts which was higher than the tilt back voltage of 3.39 volts per cell.


When the generic battery was fitted, the long first ride suggests the unbranded cells were quite reasonable. However that first ride was, from the outset, doomed to end in pain as the shutdown voltage was above the tilt back voltage. There would never be a warning before shutdown three. The generic pack had a shutdown voltage of 3.56 volts, the X8 pack was 3.22 volts and the AliExpress BMS advertises 2.1 volts which shows BMS specifications vary, so that even a pack of the correct voltage can't be safely fitted on any wheel. They must be matched. Also, the generic cells were ruined by a single overcharge.

Shutdown four is more problematical because the implication is that all X8s and probably most other wheels will become dangerous as the battery ages. The immediate cause of shutdown four is the damage sustained by overcharging, leading, under heavy load, to an instantaneous voltage drop from above tilt back voltage to below shutdown voltage. While this battery was prematurely aged by overcharging, all batteries will eventually suffer similar deterioration and battery capacity is also reduced when cold e.g in winter. In use this deterioration will happen slowly so shutdowns will be rare, occurring at first when climbing a bump late in a ride on a cold day, as the battery approaches tilt back voltage and becoming more common as the battery ages further. A rider is only likely to be aware of a rare and mysterious catastrophic failure on a wheel that was for a long time safe. All wheels with this design will eventually become dangerous.

Increasing Wheel Range

Another observation from Figure 8 is how little of the available battery capacity is actually used in the X8. At a likely occasional peak of 7 amps draw the wheel goes into tilt back at 1.25 AH which is less than half of the total energy available. Adding a second battery in parallel would reduce the current draw by half and avoid tilt back until about 1.8 AH. So changing out a battery when flat would double the range, but running a second battery in parallel will increase range by nearly a factor of three. With a single battery, I've always found range insufficient but two batteries in parallel would equate to about three hours riding time, by which time the rider is likely to be fatigued anyway.

Why Are Wheel Designs Flawed?

A BMS is used in most lithium battery installations for battery protection and the same logic is ideal for nearly all scenarios, excepting wheels. A battery control chip is required for every cell and the chips to do it are abundant. Ideally a wheel wouldn't do low voltage shutdown but that is what the available chips do. I guess wheel manufacturers have just gone with a standard BMS design. What they haven't done, in the X8 at least, is try and work around this limitation in the wheel control logic and they should have.

What Can Manufacturers Do?

The goal is to try to always get tilt back before shutdown and shut down slowly enough for a rider to react and step off. If there is to be a shutdown voltage, setting it lower, at the minimum cell voltage would help as it makes tilt back more likely to occur before shutdown. This would be 2.5 volts for the Panasonic NCR18650PF cells in the X8 rather than the current 3.2 volts. The 2.1 volt cutoff in the AliExpress controller meets this requirement but if 2.1 volts ever occurred in use it would damage the cells. What they really should do is, not allow battery cells to reach minimum cell voltage during riding without shutting down.

Avoiding minimum cell voltage can be done by reducing current sufficiently to maintain another voltage level below the tilt back voltage. For the X8 controller with the shutdown voltage already reduced to 2.5 volts, perhaps 2.9 volts would make a good minimum.  This only has to occur for a second or two as tilt back will already have been triggered. What the rider will experience is a reduction in torque, probably when it is most needed climbing an obstacle, followed by tilt back. This is far better than shutting down. The wheel will go from rigid to spongy but loss of power will be gradual enough for the rider to react and they will still be able to push horizontally against the wheel, making it possible to dismount.

What Can A Rider Do?

A careful rider can stay in the safe zone. Use quality cells and test a new pack before fitting as there are a lot of dodgy lithium batteries for sale. Store the wheel inside in winter and don't stop for too long in freezing conditions.Then monitor the cells as they degrade and replace them early. Replacing a battery prematurely is wasteful but better than suffering a shutdown.  Alternatively a rider could modify the BMS to bypass the FET switches so that the battery remains connected when the FETs switch off or connect the gate to the drain on the FET switches so that they can't switch off. This will eliminate shutdowns but also over current and under voltage protection for the batteries.

For the X8 wheel the battery capacity lights can be used to measure battery aging. From figure 8 it can be seen that, when new, the 4-3 indicator light transition occurs at 0.5 AH of discharge and the 3-2 transition occurs at 1.1 AH of discharge so there should be about the same ride time between
the two transitions. As the battery ages the 4-3 transition happens earlier but the next 3-2 transition remains about the same amount of time after the previous. This is what I'd observed in practice, 4-3 battery indicator transition was happening earlier in a ride as the battery aged and on the overcharged battery the 4-3 transition occurred immediately on commencing riding. Using data from the graph and the knowledge that I hadn't yet had a shutdown with the aging battery, it looks like a ratio of up to five in ride time between the 4-3 and 3-2 transitions is safe. At some point beyond that it becomes dangerous.

Buying Replacement Batteries Is Difficult

Replacement batteries are hard to locate so most people probably don't replace them. That would suggest there are a lot of old wheels around with dangerously aged batteries that will hurt their riders.

I've found only one supplier on Aliexpress. They don't specify which cells you will get which is annoying but at least they offer a low shutdown voltage of 2.75 volts per cell which improves on the 3.21 volts of the original Airwheel X8.

Figure 9 - Wheels can traverse fairly rough terrain


Specifications of a wheel battery management system (BMS) listed on Aliexpress.