Ebike Battery Monitoring and Control System

Batteries, Chargers, and Battery Management Systems.
2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 16 2013 5:36am

BTW, I meant to post this earlier. Here is an excellent dissertation on this subject. Well worth a read. Link is to pdf.

http://www.google.co.uk/url?sa=t&rct=j& ... myfO7p9obQ

Njay   10 kW

10 kW
Posts: 836
Joined: Sep 09 2010 10:43am
Location: Portugal

Re: Battery Data Acquisition and Charge Control System

Post by Njay » Sep 16 2013 9:35am

As Alan mentioned, only does monitoring (voltage and temp).

I'll have to look later at the PFDs posted,looking promising. The protocol I implemented is this:

Image

b0 & b1 define the 0 and 1 times (thus clock synchronizes here), P is parity and S is stop. I'll probably have to add one extra "parity" bit.
I'm not worried at clock variations. The synch is done on every message, so as long as the clock in the transmitter and receiver doesn't change much in a ~1ms window, it's ok. This does, however, take up a nice chunk of the available code space on the micro.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 9:38am

Thanks for the info. I'll review it. I'm thinking about making software that can recalibrate the clock via the serial in-situ anytime the error rate kicks up. Optimize it for the current temperature and voltage. The trigger for the recalibration cycle will be 2-3 bits so it will work even when the calibration is way off.

I adjusted the board to 6S4P and it is under 2" by 4". So it fits along a pack or at the end of 2 or more packs. This takes a lot less wiring than the remote monitoring/balancing I'm doing now, just 4 conductors to the master board, daisy chained through the boards. Love to reduce that wiring!

Still tuning the board for the SOIC, need to re-check everything twice. Maybe more.

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 16 2013 9:59am

Not meaning to confuse the issues further, I've just come across this analog front-end chip from Intersil: http://www.intersil.com/en/products/pow ... 94208.html

I has a level shifter, analog mux, and built 200 mA FET cell balancers for up to 6 cells in a 32 pin QFN package. Standby current of 1uA max.

With this you'd only need a micro with one analog input and I2C pins to connect to it. Mouser says US$3.66 in qty 1 and $2.51 in qty 100.

You'd essentially have a 2 chip solution for 5 or 6 cell BMS. Pretty attractive...

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 11:19am

2moto wrote:Not meaning to confuse the issues further, I've just come across this analog front-end chip from Intersil: http://www.intersil.com/en/products/pow ... 94208.html

I has a level shifter, analog mux, and built 200 mA FET cell balancers for up to 6 cells in a 32 pin QFN package. Standby current of 1uA max.

With this you'd only need a micro with one analog input and I2C pins to connect to it. Mouser says US$3.66 in qty 1 and $2.51 in qty 100.

You'd essentially have a 2 chip solution for 5 or 6 cell BMS. Pretty attractive...
That is interesting. Always pays to look around.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 4:16pm

I like how this Intersil chip just does the part of the job that the micro can't easily do. No attempt to "do everything" and make the chip complicated (and the documentation massive), just do the part to enable the micro. Price is good. Availability is iffy, not many in stock anywhere. Tempting to buy a few, but then they might be unobtanium when you wanted them. That's one problem with these special parts.

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 16 2013 4:34pm

Yes, I think you interpreted that exactly right. Availability, especially longer term, is always a worry with these special purpose chips. Hard to beat the function versus cost, though.

The analog accuracy is not stellar. Maximum error is 30mV on a signal of 2.1V for a fully charged LiPo, as it halves the cell voltage. So, if you use a 3.3V micro with the common 10 bit resolution, you'd only get about 650 bits, unless you use a external ADC reference, i.e. 3.3 mV resolution. I suppose you could calibrate each cell voltage input but that would tedious and expensive. I could find no spec on accuracy drift due to temperature.

Just ordered a couple of sample, anyway. Might rig up a bread board and do some basic testing.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 6:02pm

Just to do my own ebikes would take 70 chips plus spares, and I plan to have more bikes and batteries in the future. :(

Wrong, that's not correct, was thinking per cell, 12 would do it. :D

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 11:22pm

Intersil has some other chips also, including the ISL94212, which was briefly mentioned in another thread here. It appears to be more complicated, you have to sign up just to get a datasheet which is annoying. It also costs about four times as much but does handle 12S and is extensible with a simple 2 conductor capacitively coupled cable.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 16 2013 11:27pm

Some folks are determined to balance to a couple millivolts, but the real important thing is to prevent significant overcharging, so 30mV worst case, and 4mV typical accuracy is probably fine. It would not be too hard to calibrate better, calibration of the micro's ADC is required anyway. So I would plan on that.

That data sheet is pretty brief, wonder if they have more. Probably another sign up to get more info deal.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 12:00am

Here is a Micro Per Cell 2x4 inch PCBoard with 6S4P layout, minus the final traces. (In Express PCB Schematic program).

Image
Last edited by Alan B on Sep 30 2013 3:53pm, edited 1 time in total.

Njay   10 kW

10 kW
Posts: 836
Joined: Sep 09 2010 10:43am
Location: Portugal

Re: Battery Data Acquisition and Charge Control System

Post by Njay » Sep 17 2013 1:59am

Niice. What's the TH component on the bottom right, an opto?

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 17 2013 2:20am

Reduction of wiring is definitely high on my agenda, and I think you're right about not needing to balance to the last millivolt, so to speak. Nice layout, btw. Strange, it didn't ask me to sign up on the Intersil site to download anything. I did have to sign up to get a couple free samples, which I'd expect. The 94212 is too complex for what I want. It's the analog front end that's the tricky bit and the 94208 would address is nicely. I'll have a play with it once I get the samples.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 8:14am

Njay wrote:Niice. What's the TH component on the bottom right, an opto?
Yes, the body shape on the library part isn't quite right but the hole pattern is okay. It needs another step and repeat, one of the patterns is refined and the other five were stepped already so they are an earlier version.


Here is the result after stepping and laying in the connecting traces. It needs a thorough checking, but it should be close to complete. It could be tightened vertically by a few mm.

Image

This version has the series connected optical isolation, so each stage feeds the next, and the two pin connectors feed into the first and out of the last. Some type of clock sync or calibration may be needed as there is no resonator. Cost of parts per cell is under a dollar and a half since it uses the lower cost SOIC version of the ATTiny44. The P1 column of through hole pads are the programming pads, no jack needed just use a pogo pin programmer adapter like the one from Sparkfun (except pogo pins in one row instead of the 2x3 array), hold it against the pads to program the chip.

There's extra space on this pc board (below what is shown above) so perhaps I'll put a programmer adapter on there (and mill it off after fab). :D

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 4:45pm

Intersil ISL94208

This chip was mentioned above, and it looks interesting. So how big would a 6S4P board made with this chip be?

I'll probably do a rough layout to see, but it is likely that it could fit into 2x2 inches, or half the size of the above board. :D

The parts count would be about half. This reduces assembly cost.

The per cell cost would also be lower, probably less than a dollar per cell (just for parts costs). The smaller circuit board would cut PCB costs as well.

It would require soldering a QFN package for the Intersil chip. These have pins and a pad under the chip, they must be soldered with hot air or similar soldering setup.

It could possibly be made directly Arduino compatible, so just add an Arduino master and a few of the Battery Interface boards, and you have BMS Hardware!

Might be worth trying. :D
Last edited by Alan B on Sep 17 2013 4:57pm, edited 1 time in total.

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 17 2013 4:52pm

I've already re-done the layout of my design, just to see the effects. And, the difference is indeed staggering. Parts count is one fifth, for my 5S or 6S design, the hardware cost (excluding PCB) is less than $6. I've posted a few questions to Intersil, so will be interesting how they respond.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 5:02pm

Nice!

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 17 2013 5:26pm

I think I've pretty much decided to give this chip a thorough testing. If it lives up to its billing, I might well switch. It solves quite a few problems:
- standby current (< 10 uA)
- level shifting for cell voltage measurement
- cell balancing (though limited to 200mA)
- minimal microcontroller requirement
- low parts count
- low overall cost

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 6:25pm

2moto wrote:I think I've pretty much decided to give this chip a thorough testing. If it lives up to its billing, I might well switch. It solves quite a few problems:
- standby current (< 10 uA)
- level shifting for cell voltage measurement
- cell balancing (though limited to 200mA)
- minimal microcontroller requirement
- low parts count
- low overall cost
I agree.

How much balance current do you plan to use?

Which Microprocessor are you using?

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 17 2013 9:28pm

Here is a very rough layout for the Intersil ISL94208 chip with an AVR Micro on a 2x2 board set up for 6S4P.

Image

Looks like it can be made to fit on this board as long as the balance current is low to avoid heat buildup.

2moto   100 W

100 W
Posts: 170
Joined: Jan 30 2012 5:48pm
Location: North Yorkshire, UK

Re: Battery Data Acquisition and Charge Control System

Post by 2moto » Sep 18 2013 1:41am

Alan, our designs seem to converge at an alarming rate! LOL.

Planning on using as much balancing current as I can. Clearly some thermal management will be needed. The chip has a thermal pad, so hopefully that can be used to good effect. This is one of the things I want to test in an actual setup to verify the thermal model. Thermal modeling is one of the things I do in my day job. Worst case would be to use external FETs and larger resistors, which my current design uses anyway. It would be nice to have to, though, for cost reasons.

If you balance a pack during every charge, only minimal balancing is required anyway, assuming you have a good pack. The balancing history quickly identifies a duff cell and is flagged to the user.

Njay   10 kW

10 kW
Posts: 836
Joined: Sep 09 2010 10:43am
Location: Portugal

Re: Battery Data Acquisition and Charge Control System

Post by Njay » Sep 18 2013 4:58am

Definitely shrinking!... Maybe you'll want to use this smaller opto for a little less space, don't know if the one you have is cheaper: http://pt.mouser.com/Search/ProductDeta ... 12-HMHA281

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 18 2013 8:23am

Njay wrote:Definitely shrinking!... Maybe you'll want to use this smaller opto for a little less space, don't know if the one you have is cheaper: http://pt.mouser.com/Search/ProductDeta ... 12-HMHA281
Nice opto Njay, thanks for the suggestion.

I haven't looked too hard at optos since I have a few hundred new old stock, but that is a nice small one and the cost is fine.
Last edited by Alan B on Sep 18 2013 11:05am, edited 1 time in total.

User avatar
Alan B   100 GW

100 GW
Posts: 7740
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: Battery Data Acquisition and Charge Control System

Post by Alan B » Sep 18 2013 8:36am

2moto wrote:Alan, our designs seem to converge at an alarming rate! LOL.

Planning on using as much balancing current as I can. Clearly some thermal management will be needed. The chip has a thermal pad, so hopefully that can be used to good effect. This is one of the things I want to test in an actual setup to verify the thermal model. Thermal modeling is one of the things I do in my day job. Worst case would be to use external FETs and larger resistors, which my current design uses anyway. It would be nice to have to, though, for cost reasons.

If you balance a pack during every charge, only minimal balancing is required anyway, assuming you have a good pack. The balancing history quickly identifies a duff cell and is flagged to the user.
Nice! Always fun to use the professional skills on a personal project. How large will the board need to be to dissipate the heat?

That's what I was thinking on balancing. Do it often and gently.

My ebike is run for about 30-45 minutes twice a day, the rest of the time it can be plugged in charging and balancing. So lets say it can be plugged in for 20 hours a day, and charging takes say 2 hours each time, that leaves more than 16 hours for balancing. If 50mA is used for balancing for a total of 800 mA Hours per day, or more than 5 amp hours per week.

So I'm thinking, make it small and minimize the heat near the batteries. If lots of balance current was needed I would want to put the balance resisters remote from the battery which is a wiring job and not so easy on an ebike.

I have hundreds of cycles on this pack, and thousands of miles commuting, and I have not balanced, just checking every few days, and it is within about 20 mV.

That's my current plan, subject to change. :D

Teh Stork   1 kW

1 kW
Posts: 461
Joined: May 25 2011 8:02am

Re: Battery Data Acquisition and Charge Control System

Post by Teh Stork » Sep 18 2013 11:47am

Came to think about it; regarding your concerns with SPI/serial comm. Implement a checksum algorithm. This drastically increase EMI, but errors in transmission are easily dealt with.
2013 VW E-UP!
Kona mtb: Cromotor, Kelly KEB, ~6kW peak, 1,4kWh 90V battery 29E cells, 38 kg

Post Reply