Sunday, 15 November 2015

Battery disasters

Long time between posts - mostly because I've spent the last couple of months struggling away trying to get the battery pack working properly. In classic Stu fashion, I designed the pack without properly consulting the wealth of information online, and figured my design would be totally awesome.

So, once I got the bike back from T-Whites, I hooked everything up, and pulled the throttle. The wheel spun with no load (no-one sitting on the bike), but as soon as I sat on the bike, the controller would cut out and turn off. What followed were endless lunchtimes fiddling around trying to work out why my completely awesomely complicated prototype battery pack wasn't working.

In short, while the battery pack design was certainly complicated, it was far from awesome. In-fact it was completely ineffectual. It was difficult to implement without making mistakes, and the pack layout, combined with in-built cell protection circuitry would cut the thing out with relatively small loads.

Here's what I originally had made up.



There's a few things going on here conspiring to stop the pack running. First the long series strings. If one cell in those strings stops going, immediately the power available at the pack drops by a third. Secondly the in-built cell protection. If too much current or voltage over a cell is seen by the protection circuit, it cuts the cell out, hence the whole string, as per problem one. I've tried to describe it in the diagram below.


I'm pretty sure my attempts at over-voltage protection (see previous posts) with zener diodes blew up pretty early in the piece, further complicating things.

So the solution:


Industry practice is to connect the cells in large parallel groups, and have in effect a single series string. Protection is then managed by a purpose-built BMS (Battery Management System), which monitors the entire pack for over-voltage, under-voltage, and unbalanced charging. Fortunately I didn't have to re-invent the wheel here, and ordered an off-the-shelf unit, along with a proper lithium-ion battery charger on from this seller on Aliexpress.com.

I went ahead and stripped off the individual battery protection circuits from the cells, and soldered up the battery pack as per the diagram above.

Removing the protection circuits

Soldered up battery pack, with new BMS.

The only extra thing I added was a fuse on the battery pack output, to further protect it from over-current events (i.e. shorting). It was a revelation on plugging the thing back onto the controller. The bike came alive, delivering 500W without a problem. Success!

Jenna and I both ran a few test rides, and managed to get around central Auckland without any electrical problems (running out of charge, smoking electronics).

The next missions are coming up with some kind of battery enclosure, and upgrading the bike's brakes.


Wednesday, 9 September 2015

Component sourcing

Been a bit of a long time between blogs, as I've been held back waiting for my next batch of components to arrive.

I've had on order from MXUS, my supplier in China:

- A motor
- Controller
- Accessories (throttles, e-brakes, displays, etc.)

And from T-Whites Bikes in Auckland:

- Wheel rims

The first problem I ran into was actually with YouShop in China. They were claiming that my package had never arrived in their warehouse. After a bit of back and forth with customer support (and sending them an electronic copy of their own acceptance signature), they "found" my parcel. Immediately afterwards I was made to pay ($17) for a magnetic goods inspection report, a requirement for electric motors leaving Chinese ports.

After that was all sorted, it didn't take for the parcel to turn up in NZ.


Immediately I plugged the system in, and checked the motor spinned.


The observant will notice that the speedometer doesn't change when the motor is going (hopefully this video starts working).

I ended up had a bit of drama getting the right controller from MXUS. First the sent me a system which didn't have "regen braking" (allows charging of the battery while braking), then they sent me a system which was the wrong voltage (36, rather than 48). Fortunately they sent me the extra bits free of charge, and via FedEx, which was great.

T-White's distributor/importer ended up bringing in the wrong (i.e. more expensive) rims, but thankfully they agreed to sell me the fancy ones for the price we originally agreed. Here they are, sitting in the shop, about to be threaded up.


All things going well, the next post will be of a moving e-bike!

Monday, 13 July 2015

Battery charging circuitry part 2 - Relay driver & protection

To get the relays to automagically energise on connection with the battery charger, a small switching circuit needed to be drafted up. 

Below is the switching schematic, jiggled around a bit for simulation.


There's probably no point getting too carried away explaining how the thing works in detail. However basically if no power is connected (V1), the FET is off, nothing can energise the relays, and the battery holds in the normal "serial" state. Once power is connected, there's a small delay/debounce, and the relays flick the battery pack into "parallel charging mode".

I soldered the thing up from bits and bobs lying around the lab. It's pretty bloody rough.



While this set-up tested fine on the bench-top supply, I ran into trouble with actual batteries. It turns out that the order in which the relays are connected (SW1 and SW2) is critical. If connected the wrong way around, the bottom battery pack shorts, the internal battery pack protection kicks in, and the SW1 relay doesn't have enough energy to break. 

The scribbling above is an attempt to explain what happens when SW2 turns off first. 
Protection is as crucial for safe circuit operation as is it is for safe sex with a stranger. Without it, all sorts of bad things can happen (usually fires) - especially when lithium battery packs are involved. There's a few types of protection schemes which are common in low-medium voltage electronics: Over-current, over-voltage, reverse polarity, and ESD.

Over-current protection on the battery pack is provided by fuses. These are really simple devices that simply burn out, and cut the circuit if the current through them exceeds their rating. On the battery pack there is a fuse on the charging input, and one of the motor output. 


The charge and motor side fuse ratings are rough guesses at the moment. The motor side fuse protection is in addition to the internal over-current protection provided by the individuals cells. It's like the electronic equivalent of "double bagging".

Over-voltage protection is also provided by the individual cells in the pack. Additionally I have also fitted 27V zener diodes on both halves of the pack. These things basically start conducting (and limiting the voltage) once the voltage across them goes over their rated threshold.


The zener diode can be seen hanging out on top of the taped bit of veroboard.

If the individual cells didn't have their own over-voltage protection, I'd use something more robust such as a crowbar circuit. The other (and probably more important) function these diodes serve is to suppress the voltage spikes which occur the the relays are released, and are otherwise known as flyback diodes. I mentioned this problem in the previous post, but in short:

Before flyback diode added
After flyback diode added
As can be seen there's no nasty spike on the top of the waveform.

While I'm still unsure of the final pack configuration, I rigged up some preliminary battery looms out of veroboard and terminal headers. This allows me to fiddle around the the pack configuration without getting out the soldering iron as much. Once that's nailed down I'll get rid of the veroboard and direct solder the packs up.


The finished (for now) prototype power pack
So that's it for now. My motor and controller have recently arrived, so I'll publish a post on part sourcing once everything is sorted. 

Till next time!


Tuesday, 30 June 2015

Battery charging circuitry part 1

Because the battery voltages in the e-bike are going to be around the 44-50V range, buying a charger/power supply to charge this thing is likely to be expensive.* So after consulting my semi-partner in crime Jared at work, we came up with an idea to upon connection, automagically "break" the battery pack in half for charging. This is explained below...




On the left hand side is the normal configuration of the battery pack when riding the bike. Each one of the battery symbols represents a "pack" of 18 batteries, in 6S3P configuration (a series string of 6 packs, in parallel 3 times). These two packs are connected in series, combining for a total voltage of ~50V. The right hand side shows the charging configuration. Pack one and pack two are now in parallel, effectively halving the required charge voltage to ~25V.

So how to achieve this?


Shown above is my switching scheme, using two single pole, double throw relays (SW1 and SW2). The diagram shows the relays in their "normal" mode, connecting the two packs in series. When energised, the relays will swing to their alternate position, connecting the packs in parallel.

I went ahead and bought a couple of relays from element14.com. I chose Durakool automotive relays (DG85B-8011-76-1012-DR), because can handle the currents and voltages I expect to pump into the motor.  After they arrived, I connected them up to a power supply and a scope, and tested the design.


I simulated two battery packs using a dual-channel benchtop power supply at work. This way I could set the current limits really low, just in case I stuffed something up. As can be seen below, this likely happened multiple times.


The relays connected up with alligator clips.
Sure enough, the relay circuit appeared to work in principle. The packs were reconfiguring from series to parallel on energising the relays, and reverting back again upon disconnecting the power.

Jared warned me about current spikes across the batteries when disconnecting the relays. These come as a result of the coils in the relays wanting to discharge upon the rapid change in current during disconnection. These spikes could potentially damage the battery packs, so I needed to quantify the effect, in order to determine the scale of protection necessary for mitigation.



I connected a scope across the battery packs, and activated and deactivated the relays. As can be seen, a spike of ~4V is present during the switching, though not for long. This will most likely be dealt with by fitting 25V zener diodes across the packs. More on that, along with the rest of the switching circuit, later.


*This statement is not based on any research/facts. Look, I just wanna play around with relays alright?

Sunday, 14 June 2015

Bike frame


Behold, the Leichtsport "Senori". This will provide the skeleton for the build. One of the main requirements for the bike build was not having to need to change clothes to ride the thing. Hence, I made sure the bike had a step-through frame, and a chain guard allowing Jenna to be able to ride in a dress. It also doesn't look too dorky (unless I ride it), which was another requirement.

One thing I'm a little concerned about with the bike is the tyre size. Printed on the tyres is:
28x1-3/8x1-5/8. According to http://biketiresize.com/ this is the same as 700 x 35C - but I'm not going to believe it till some new tyres are fitted.

The frame is a bit rustier than what it looks like in the picture (and the picture I saw on Trademe) - so I may end up completely stripping the frame and re-painting it.  However all this stuff will happen after I've installed the motor and gotten things running.

Tuesday, 9 June 2015

Battery testing





Here are the 42 battery cells I'm re-homing from the scrap pile at work. They're 4,400 mAh, 3.7V, Li-Ion batteries, with a protection circuit built in. They're not the fanciest battery in the world, but at the price I got them at (free), they're pretty unbeatable!

The first thing to do was to find out the maximum current they could put out. The protection circuit in these units effectively limits the amount of current the battery can discharge. The reason being, if these things let out too much current, they will heat up, and become quite dangerous. The downside is the current limiting circuit chokes the maximum power limit of the bike.

According to the battery datasheet, the maximum discharge current is 2.4~4.5A. I decided I better test this out, and see how much juice I could pull out of these suckers. I bought some high current load resistors from Trademe for a few bucks, connected them to a few batteries, and started measuring the current with a multi-meter, and an oscilloscope.

High current resistors (3 and 5 ohm)

Turns out the current limit kicks in at 3.6A. Now I understand the current limit of these things, I can go ahead and tailor the battery pack for the power output I want. I could potentially disassemble the battery pack, and remove the protection circuit, but as the pack will be sitting quite close to my girlfriend's butt, I figure I'll leave it connected for now, until I understand the system better.

Battery specs:

Manufacturer: Golden Cel Battery Co. Ltd.
Model: CELALB18650-PCM
Max discharge current output: 3.6A
Nominal voltage: 3.7V
Capacity: 4400mAh

Saturday, 6 June 2015

Jenna's bike

It's been awhile since I've posted anything on here. Been too darn busy releasing records with my pals in Proton Beast and Anthonie Tonnon and the Successors. Somewhere in there I also built a TR-808 drum machine, but since it was just from a kit I didn't think it was blog-worthy.

Anyways in other news, I've decided my next project is putting together an E-bike for my girlfriend Jenna. It's worthwhile me doing it, as I can get some of the more expensive bits (i.e. the battery) for free from work, and liberally plunder the senior dudes for advice.

In terms of requirements, the bike has to:

  • be really easy to ride;
  • not look dorky;
  • not require a change of clothes;
  • be breakdown-proof;
  • be able to carry a reasonable amount of cargo;
  • be powerful enough to deal with Auckland hills; and
  • have a range long enough for a return trip to work plus some.
Anyways, I'll try to post my progress up here, as the project moves along.




Peace!