Thursday, January 14, 2021

Total rewire and 1KW-hour LiFePO4 battery conversion

While the blog might have been idle, life hasn't stood still. My dear old Bakfiets is still going, even if it got a break for a year when we were living in the middle of the Outback, where you just needed to look at the ground to get a puncture.  

Its done well over 25,000km now, and after the third battery pack dying, I got sick of this happening, and decided that I wouldn't buy another one of the standard packs. Also, they are no longer made, as Bakfiets switched from the Azor electric kits to the Shimano electric systems. I looked at replacing the dead cells in the packs, but that's also a pain, as it requires un-spot-welding and re-spot-welding an awful lot, and I don't own a spot-welding machine.

But with COVID19 messing with importing bikes, the Australian dollar being low again and all that, I figured I didn't want to fork out a pile of cash on a new e-Bakfiets, either.  So I decided that I would completely replace the battery pack with something custom, and fix several annoying problems that always annoyed me:

1. The standard battery pack was only ~400W hours, which means <2 hours of full boost.  Church is close to an hours ride away, so a return trip would typically result in a flat battery, and that was before the batteries start losing their capacity, which they would do quite quickly when used every day, because...

2. ... the official battery packs were LiPo-based, which while lovely and small and light, are not the most long-lived chemistry. Also, I don't really like having a battery system that can go critical easily if I have an accident.  I much prefer LiFePO4 batteries for their much longer useful life and intrinsic safety.  The weight and size are not really an issue when you are talking about an e-Bakfiets, since I have this 100L box on the front, and the kids are now too big to ride in it, so I rarely need the full volume.

3. The original battery packs have to be removed to be plugged into charged.  This is just plain annoying, especially as the sled can be a bit sticky at times, and is just a bit fiddly to move when you get home in the cold rain in winter etc.  So I wanted an approach that would be as simple as possible to plug into charge.

4. The original charger is also as slow as a wet week: 6 hours of charging for <2 hours of riding.

5. After adding an airhorn, front flood-light and rear super bright red LED light, the wiring was a mess, with everything having to connect back to the battery tray on the rear carrier.

So I looked around at what batteries I could order directly from China, and found a nice 40A 7S (~27V) LiFePO4 battery pack, i.e., 1,080W hours, for less than the list price of the original ~400Wh LiPo packs.  In fact, the LiFePO4 battery itself was about 1/3 the price, but then air freight to Australia for a single battery doubled that. This more or less matches the 8S LiPo for voltage, so can be used without an adapter. For another US$90 they included a 20 Amp charger: That's right, I can recharge this 1KW hour monster in 1/3 the time of the original.  At 250W maximum power I should get around 4 hours of full-assist riding, for only 2 hours of charging.  Much more civilised.

It took a while with COVID and postal hilarities caused by ordering while we were living in the middle of the Outback, but the battery and charger finally arrived last week, and today I finally had the time to start stripping everything down, and rebuilding with the new wiring.  I decided that I wanted to put as much as I could in the cargo box at the front, and have only the bare minimum wiring visible externally. I ended up being able to reuse almost exclusively the existing holes in the cargo box, including a couple of the drain holes that don't get much use, now that the kids don't ride in it.

The whole episode only took about half a day, including remembering how I had the various things connected together, including those add-ons I mentioned earlier, which are controlled using a cheap motor-bike handle-bar control which has a momentary horn button and click-on-click-off headlight button.  In the process I also discovered that the old airhorn had given up the ghost, so I replaced that as well (I had a spare on hand, as I had suspected that the old one was dying). 

The only thing that isn't working perfectly is the battery level indication on the Azor handle-bar display.  I assume that this gets the voltage from 3-pin connector that came from the original battery, and which I haven't connected.  Alternatively, it might determine it from the primary battery voltage.  Either way, it is showing empty. But then, it has been doing that with the original battery packs for years, as soon as they drop a single cell, thus lowering the maximum voltage. So that's not really a big inconvenience. That said, I have ask Dutch Cargo Bike if they can get me some more information on that 3-pin connector, to see if I can find a way to get the battery level showing on the handle bars. The big LiFePO4 pack does have a display, but you have to press a button on the battery to activate that, and it goes off again after a few seconds.  Also, with my setup, that's inside a battery box under the flat tarp cover of the Bakfiets, so not accessible while riding.  Anyway, if I charge it up every night, I shouldn't ever have a problem with it going flat on me.  And if it does, I can now recharge about 8x faster than the original charger.  

So, in short, I'm pretty happy with the result.  Here is the battery pack and wiring after all the work:


The battery is in the big black metal box, to make sure nothing falls across the big fat terminals of the battery, since fully charged it does contain enough energy to boil about 30L of water... The black box to the left of that is the charger, which fits conveniently in the gap. The relay screwed into one of the hold seat-belt harness holes is for the airhorn, which draws 20A at 24V, i.e., almost half a kW -- it is really loud --  because the handle bar switch can't carry that much current.  The handle bar switch comes in through the other hole.  At the moment there is one cable that just comes in over the top edge, which I would like to tidy up further, which is the cable to the absurdly bright rear light (its the same type you put on portable antennae to ward of low-flying aircraft).  But all up, I'm pretty happy, and it is miles better than it was before.

And now the pictorial journal of the process I went through...


First, remove seat and original battery, so that I can get to the little electronics enclosure: 

Here is that insanely bright rear LED light.  It draws 10W on average, with a 25% duty cycle or so, so has a peak power consumption of around 40W of LED.  Cars now leave a nice gap behind me when stopping at the lights at night.

Then under the battery compartment, we have the actual motor controller:

This doesn't need to go there, since the motor is at the front of the bike. So if I move that into the box, we can avoid having a lot of wiring going to the rear carrier and back again.

Next step, sit the battery in the bike and think about where everything will go:

Here is the nice little integrated display on the battery. If I could make it stay on, it would be really useful.

Now, originally, I was going to use these big fat leads to hook everything up, since we have to deal with peak currents of up to 50A (full boost plus that 20A air-horn). But in the end I didn't need to.

So here is the 20A charger with its nice big fat alligator clamp fittings.  I removed those later and put eyelets on that I found in the shed, and hard-wired it onto the battery, as you will see later:

Again, a quick fit test and further think with the cover for the battery box in place. The battery box is there to avoid problems if a bit of water gets in under the cover.

Now, speaking of the old ugly wiring, here is where that relay has been sitting for the past three years:

Completely function, but completely ugly. You can also get a hint of the general mess of the wiring prior to today's work.

Now, back to pulling apart the wiring loom for the original battery system. Most of it is hidden in that little compartment behind the seat-post, and connected to that little black controller box we saw earlier:

Its a bit of a pain to get out through the hole in the bottom, but its just a case of fiddling with it for a while. I also had to start removing the 5 connectors to the big battery interface terminal. This blessedly used spade-connectors, which I was able to just slide off, and make mating connectors for, later:
After all that. I had the controller box out and alone:
And the rear carrier was now looking like this: The metal plate and wire running on the top are for the rear light:
One of the enduring mysteries is what this brown-yellow-blue 3-pin part of the battery connection interface do.  It has a 2A fuse inline on the blue, and connects to the Azor luxury display on the handle bars.  Is it backup power? Is it battery level indication? Both? Or something completely different? I'll let you know when I find out:
Next I removed the key lock that cuts the power from the battery to the controller.  I like the idea of having a key-interlock for the power, especially since I have a 139dB airhorn switch on the handle bars that kids love to press if they figure out it is live. So I decided I would keep that, and hook it up with the new battery. Unfortunately it can't stay on the carrier, because the battery is not there, so I will need to have two separate keyrings with me in future. A bit of an inconvenience, but nothing major:
Then we have a bunch of wiring modifications I made when I hooked up the airhorn and bright lights.  I used vampiric crimp connectors, so that the result would still fit in that tiny electronics compartment:

However, with the new setup, that wasn't a problem, and they were both ugly and a pain to work with, so after I removed them to be able to disassemble the wiring loom, I re-wired without them.  The Deutsch connectors at the top of the picture above I added when adding the lights and airhorn, to make the loom easier to disconnect, which I was rather thankful of today.

And here are more pictures I made so that I could make sure I ended up with functionally equivalent wiring at the end:

So now I was more or less at the point of having a bunch of suspiciously similar looking cable ends, that I had to start matching back up, to reassemble:

So more gazing in the box to think about how I would hook things up, and removing the bench seat and seat belts to make more space:
This was when I had the brain-wave to use the holes from the strap mounts to hold the relay in place, and to feed one of the cables through:
So now that ugly patch of wiring with the relay etc, is no longer visible from the rear:

Around by the front-wheel, there was also a mass of wiring, which I was able to shorten and simplify, feeding it through one of the front drain holes. The other front drain-hole is taken by the mounting bolt for the airhorn. The airhorn itself can be seen in the lower-right of this image:

From the other side at the front we can see the flood-light, and how I did still have to feed one of the cables over the top of the front of the box. This goes over a slightly damaged part of the box, that was roughed up by carrying the kids bikes on top of the cargo box every day for three years. I might file a small notch in this area in the future to let the cable sit out of harms way.

So now the wiring was starting to get joined up, but was still unsettled in the cargo box, and I had to come up with a plan for how and where to mount the controller box:

The controller is the heart of the rats-nest of wiring, and eventually should probably get a nice tidy box to conceal the rats nest:
But for now, I used one of the bench seat supports, and just put the rats nest of wiring on the floor below it. It can't really go anywhere else, unless I want to cut and lengthen the speedometer and pedal crank sensor cables, which were really made assuming the controller would be right next to the crank and rear wheel. We can also see the eyelets being used to connect the wiring to the battery. I salvaged one of the 30A fuse holders from one of my dead original battery packs to protect against short-circuit:
So now its all really starting to come together. The lid can fit on the battery while it is connected, and I have decided on using the spare space to fit the charger:
The charger is, as I mentioned, hard-wired to the battery as well, via another pair of eyelets. These also act as spacers to enable the screw terminals to hold solid.  Writing this now, I just realised I should put another fuse block on the charger leads for complete safety...
And finally, with everything hooked up, and a retainer strap over the battery, using the bench seat supports as anchor points.
So apart from a couple of odd wires, from the outside, when the cover is on the cargo box, there is not really anything to give away that the wiring and battery system has been completely re-built using a custom battery and charger solution.

Let's see how it goes over the coming months. But for now, I'm just glad to have lights and a horn again for safely traversing city traffic, and a battery that works to let me use the motor when the need arises.

Tuesday, March 10, 2015

Rebuilding the back wheel in a hurry

A few months ago I had my back wheel rebuilt by a local bike shop.  At the time, they were unable to get the thick Dutch spokes, so they kindly did what they were able, and fit the thinner Australian spokes, and to accommodate those spokes, put a normal rim on.

However, the thinner spokes just aren't up to the ~250kg gross vehicle mass of the Bakfiets when fully loaded, and so I have been popping spokes and really just fire-fighting on the back wheel since then while I ordered new Dutch spokes, which took a little while longer than hoped to get here.

However, this morning they arrived, which turned out to be not a moment too soon, as I had popped another couple of spokes in the last few days, and was faced with the prospect of pulling the back wheel out again, just to keep it going.

This afternoon at work, however, I noticed that I had a completely flat back wheel, which I had presumed was due to a spoke-head poking a hole in it, since the thin spokes have to be tightened quite hard just to keep the wheel reasonably straight.

Thus I was faced with absolutely having to pull the back wheel out and sorting it all out again. I was much happier to do this going back to the 10 or 11 gauge Dutch spokes rather than persevering with 12 - 14 gauge Australian spokes.

My tyre was very flat, and I couldn't pump it up faster than it was going down, so I assumed a spoke had pierced from the inside.  (I later found the problem was, ironically, the rim tape that is supposed to protect against flat tyres caused by spokes had split, and the sharp edges of the rim tape had made the hole.)

Spot the broken spoke in this image:

And in this one:

After I pushed the bike home, it was time to dive in and start removing the hub from the Australian rim:

Once removed, it was able to stand on its spokes, looking like the Martian battle machines out of War Of The Worlds, emerging after they, too, had extracted themselves from their transportation:

After spraying for martians, the hub was all nice and alone:

I then set about lacing the new wheel up using this really helpful video as my guide.  It was the first time I had actually laced up a wheel, and although I had to back-track a couple of times, it wasn't that hard. It probably helped that I have been changing a lot of spokes recently, but even so, it just isn't that hard.

The next challenge was to true the wheel.  With the bakfiets you can't really sit the bike upside-down and pedal to see how the wheel is wobbling and then fix it.  But I also don't have one of those really nice wheel truing stations.  So I built one out of half a dozen bricks.  After all, you only need something to hold the axle of the wheel, and then something to act as a reference so that you can see how the wheel is wobbling all about.

For the reference, I strategically placed one of the bricks on the ground, so that I could see how the wheel was moving.  Here it is wobbled to one side ...

... and to the other.

Once I had it roughly right, I put bricks more closely on both sides to see if the wheel stayed in line.

Then it was time to put the tube and tyre on, and put it all back together:

I then had to spend another 15 minutes or so tweaking the tension on the spokes because it was sitting a bit too far to the left and rubbing.  But after about five hours, I have managed to rebuild the back-wheel, so that I am not bakfiets-less for the school and work run in the morning.

Thursday, February 26, 2015

One of those days ...

Yesterday was one of those days.

I had a few errands to run, including dropping an old carpet off at the dump on the way to collect some gear for work.

The cargo bike was great for taking the carpet to the dump, and cost only $5, whereas the minimum charge when dumping from a car is $15, so my bargain centre was happy.  Also, it is always fun to see the reactions of the staff at the dump when you arrive on a bicycle carrying a large load.

However, this and other recent heavy work, and hopping down a few too many gutters had caused a problem.

Well, actually, me needing to replace spokes in the back wheel a few months ago was the real problem.  I couldn't find the strong dutch spokes at the time, and so the bike shop rebuilt the back wheel using thinner Australian spokes, and so the back wheel hasn't been as strong as it should.

Anyway, when I got back from running the errands, it was obvious that a few spokes had broken and a few more were on the way out.

So after work I went to the local bike shop, who fortunately are open until 9pm on Thursdays and got a set of new spokes, so that I could fit them at home overnight, and have the bike ready for this morning.  This is the only problem with using the bike 7 days a week, every week, there is no convenient down time to leave it with a bike shop for a few days to do the work for me. That said, the work isn't usually too hard to do myself, and it is cheaper to do ones own bike maintenance, if you have the skills.

With some trouble we measured the length of the spokes, and for $1 a spoke, I had a spare set of 36.

I got home, started disassembling the wheel, and realised that I had forgotten to pick up the spoke nipples.  So another trip back to the bike shop (this time on my mountain bike since the cargo-bike was in pieces by now).  Then I realised that the spokes were too short, we hadn't been able to measure them exactly while they were still in the wheel.  So a third trip to the bikes hop ensued.  Finally I had all the components.

I am getting reasonably practiced at removing the back wheel now, but today for some reason when I removed the roller-brake, which is supposed to be impossible to disassemble, fell apart in my hands when I removed it.  It took me nearly an hour to get it back together, during which time I had a scheduled international call for work.  It was kind of fun and slightly surreal pottering on the bike talking to a guy in the UK while I worked, and completely unthinkable 20 years ago.

What is really odd is that one of the large roller bearings is missing from the inside of the brake.  This is a big thing, and there is no big hole for it to fall out.  It would be like dismantling your engine only to discover that one of the pistons had fallen out somewhere some time in the past.  Very odd.

Once I had dealt with the above frustrations, replacing the spokes was as easy as I had remembered, and I was very surprised to discover that I had got the wheel almost exactly true first time.

Now all I need to do is actually get around to ordering the strong Dutch spokes so that this doesn't happen again.

Friday, December 26, 2014

Electric conversion - part 4

In the last post I left finished up staring blankly at the strange (to me) bottom bracket fittings, like these.

So I had a look through my tools for anything that could possibly fit into a ~40mm disc with semi-circular notches.  I found the following, which I have no idea whether it is the right tool or not, but after using a screw-driver and hammer to tap them loose, I was able with some effort to use said mystery tool to get them the rest of the way off.

The information I had suggested putting the pedal sensor on the right-hand side.  However, that would involve heavy modification to the chain case.  I figured it would just be easier to install the sensor on the left-hand side, where there was nothing to obstruct it.  Installation of the sensor was pretty easy.

Then it was time to put the little wheel of magnets that the sensor uses, and refit the crank.  Again, all fairly painless.

Now that I had the pedal sensor and the electric motor fitted, it was time to turn to the spaghetti of wiring and hook everything up. This largely boils down to matching colours and sizes of connectors.  The only mystery was the purple and black connector, which turns out to be for a brake sensor if you want to immediately cut power when brakes are applied.  This isn't really necessary with a 250W motor and 180mm hydraulic disc brake on the front!

I then attached the controller onto the bottom of the rack where it goes, and fed all the cables through the appropriate feed-holes.

The controller slots in under two tabs, and then a tab is screwed on at the other end, as shown here (sorry for the fuzzy shot):

Then I attached the U-shaped thing that connects to the frame, and slots through a couple of adjustable holes in the rack. 

I already knew that these arms would be too long, so I measured up the length I needed, and cut the first one.  I also gave my rear fender a bit of a clean while it was easy to do with no rack on the back:

After cutting the 2nd arm, and a little fiddling, I had the rack installed on the back:

Here you can see the trimmed arm from the side:

And closer again:

Finally the back wheel could go back in, and the bike was starting to look more or less back together again:

Well, except for the mess of wiring that still had to be routed through:

So I installed the display and power control interfaces onto the handle bars:

Connected the wiring to the motor:

Put the battery into the rack:

Now the backend was looking pretty much right:

But I did notice a minor issue:  Like August Gorman in Superman 3, I realised I now have two keys in separate locations that both need to be in the on position.  Fortunately, I won't need to resort to the same convoluted method as him, but I might need to get one of those retractable key fob things to hang the battery pack key on so that I don't need two key rings.

With everything hooked up, I turned the power on, and was very happy to see that it all seemed to be working:

However, I soon discovered that the motor would only run when I pedalled backwards.  The solution was to flip the wheel of magnets around the other way, as the polarity of the magnets is used to detect the direction of rotation.  Now the motor kicks in when pedalling forwards, but not backwards.

So now it is all working, and a quick test ride confirmed that it is going to be very effective.  The result is that I have a factory-like electric assist install on the bakfiets, and confidence that it will all work well, and that it will be well supported.  Indeed, Dutch Cargo Bikes have been great answering all my questions as I have proceeded through installing this kit over the last couple of days, including emailing photos of bits and pieces of the factory-fitted electric bakfiets they have there to help me work out what goes where.

The only frustration now is that I need to wait before going on any serious rides with it while I wait for the charger to arrive (it was supposed to be in the box, but didn't make it for some reason), and also I need to get a new lower crown race for the new forks, which was never part of the kit.  Both are very minor things, and I hope to be all set by New Years Eve.