Ebike Battery Monitoring and Control System

I have no balancing so no "artificial" heat. I placed the temp sensor and it's ground connection by the negative pad of the board. That pad will connect to the Cell- through a very short and large conductor for good heat transfer.

At around 40mA per pin port and 200mA per port and chip you (didn't check the exact values on these AVR versions), that's a maximum of 5 pins you can use at max dissipation. If you have extra pins, you can distribute the load using more pins at lower current, so that less heat is dissipated at the chip and more on the external resistors. Nevertheless, the heat is going up.

In a cheaper version of the monitor it maybe good enough to use a roughly calibrated temp sensor on the AVR. Instead of having an exact temp monitoring, you would have a rough value just to use as an alarm. However, when balancing, readings are probably screwed anyways, and I would want to monitor cell temp closely during charge.
 
Alan B said:
Nice. Do you apply balance loads to the half of the cells above the average, or what is the algorithm?

The algorithm is pretty simple. You just keep the higher reading cells down to the lowest cell. It's much quicker to "early" balance then waiting for the first cell to reach HVC and keep it from overcharging while the slower cells come up to HVC. You monitor the rate of charge, i.e. dV/dT for each cell and apply a balancing shunt via a PWM to keep the rate the same. I use a thermistor stuffed in between the cells, such as this:

thumb_jt_thermistors.gif


You mentioned that your BOM is under $3 per cell. That's still $15 for 5 cells. My BOM is under $10 in reasoable quantities (~100), excluding the PCB. I did look into the "one micro per cell" approach, and see the attraction to it. I mainly chose the 5 cell grouping because of packaging reasons, i.e. one 5S brick. I've built the "bricks" from individual HobbyKing cells into 5S2P with paralleling at the cell level, so 2P first and then 5S. All in, it cost me just under $100 for a complete 5S 10Ah brick with self-balancing BMS. I use three of these packs in series for my e-bike, so nominal voltage 55V at 10Ah.
 
2moto said:
Alan B said:
Nice. Do you apply balance loads to the half of the cells above the average, or what is the algorithm?

The algorithm is pretty simple. You just keep the higher reading cells down to the lowest cell. It's much quicker to "early" balance then waiting for the first cell to reach HVC and keep it from overcharging while the slower cells come up to HVC. You monitor the rate of charge, i.e. dV/dT for each cell and apply a balancing shunt via a PWM to keep the rate the same. I use a thermistor stuffed in between the cells, such as this:

thumb_jt_thermistors.gif


You mentioned that your BOM is under $3 per cell. That's still $15 for 5 cells. My BOM is under $10 in reasonable quantities (~100), excluding the PCB. I did look into the "one micro per cell" approach, and see the attraction to it. I mainly chose the 5 cell grouping because of packaging reasons, i.e. one 5S brick. I've built the "bricks" from individual HobbyKing cells into 5S2P with paralleling at the cell level, so 2P first and then 5S. All in, it cost me just under $100 for a complete 5S 10Ah brick with self-balancing BMS. I use three of these packs in series for my e-bike, so nominal voltage 55V at 10Ah.

Sounds good, very reasonable costs. How do you sample the cell voltages? What current do the sampling circuits draw?
 
It wasn't my first choice and I experimented with power enables with cheaper opamps, but couldn't get it to work satisfactorily. It did work, but created other issues. In the end, this was the best solution (for me). I wish it was cheaper, though!
 
Did more exploration of the AVR parts available. Looks like the Tiny44 is the low price leader for a 4K part. There are some 512 and 1K parts but that's a bit tight for codespace, though it gets the cost down a bit. Some have only 6 pins, tough to squeeze into, but interesting!

Started some experimenting with board layout to see what might fit 6-up on a small PC board. I like the simplicity of using the same layout for each cell over and over.

I think I'll play with the Tiny44 design I started awhile back and see where that leads, and how I might minimize the component count just to simplify construction and layout.
 
My current cell monitor pcb is single sided with no jumpers. This means I can have 2 monitors on the same pcb space, which could be nice for a centralized version (no per cell temp monitoring, though).

0bpt.jpg


I also see tiny44 as the best quality/price point.
 
Nice small PCB. I'm probably going to have a few vias and some through hole parts.

I think I'm going to leave out per cell temp monitoring, hard to get those sensors into the packs anyway, and when it heats up a smoke alarm is probably indicated rather than a temp sensor. Might put one sensor per 6S4P group, but that's very few sensors.

Today I installed a dual mode smoke detector above the ebike. I'd like to put a small one onboard the bike but haven't seen one small enough.
 
Made some progress on the PCB layout, a draft version of one cell, and the JST / DB9 array. I was able to get six of the 9 pin JST-XH connectors on the board as well as a DB9 socket, so the board will do up to 8S6P. The DB9 is a diagnostic port and can be used to check balance with a different meter or display, and it can be used to balance charge the pack from a separate charger when desired.

The per cell section is 12 parts and costs under $2 per section. 8 of them will fit on the 2.5 by 3.8 pc board, along with the JST-XH and DB9 plus serial link in and out connections. No resonators, will have to deal with serial data sync one way or another.

There is more work to do, matching the schematic for the pin choices and verifying the PCB design, then the part I really like about a micro per cell design - make the Cell section a 'component' and copy/place all eight of them on the board, then hook them up. It is so nice to do one small design and then re-use it a bunch of times.

I've packed in the cell electronics pretty tight, a QFN surface mount CPU 4mm by 4mm, 0805 resistors and caps, 1206 for the two balance load resistors. I decided two was enough. There are micro pins left for future ideas. Each cell electronics is about 15x20mm on double sided pc board.
 
In thinking about the RC oscillator calibration, it should be possible to have a 'calibration cycle' and have all the slaves calibrate and adjust their RC clocks in-situ. Could do it at bike start and anytime the responses are not coming, or the checksums are bad. Make sure to use checksums so bad data is never used.

Progress - synched the schematic and pcb layout, need to check the zener diode pad setup and review micro pinout to make sure no transcription errors crept in. Want to get the cell exactly right before duplication.

Anyone thought about "open hardware", publishing the design with license to duplicate?
 
Njay said:
My current cell monitor pcb is single sided with no jumpers. This means I can have 2 monitors on the same pcb space, which could be nice for a centralized version (no per cell temp monitoring, though).

0bpt.jpg


I also see tiny44 as the best quality/price point.

Nice work! What functionality does that provide? Does it include any kind of balancing?
 
I think Njay said earlier he was not doing balancing with it, that he wanted to keep that external and separate.

OK, selected an SOT-23 zener and fixed the layout. Looks like even less zener leakage than the through hole part I was looking at earlier.

The ATTiny44 is hard to beat at 0.94 in QFN, but the ATTiny24 is only 0.61. There are even cheaper packages but they are much larger. The SOIC is worth a look at 30 cents cheaper in tiny44. It might not be too much larger, and is easier to solder.

Though for 1.008 The ATTiny1634 was far more capable yet, may have to reconsider that at only 7 cents more in QFN compared to the tiny44. Darn, always something to consider.
 
Alan B said:
In thinking about the RC oscillator calibration, it should be possible to have a 'calibration cycle' and have all the slaves calibrate and adjust their RC clocks in-situ.
Hmmm - have you considered using differential Manchester phase encoding? This should only require that xmit/rcv clocks are within 25% of one another. A quick Google turned up this PDF which actually has a some sample xmit/rcv pseudocode although the actual description of the encoding format is not stellar. You could keep all your byte or frame level encoding and just change the line level bit routines. DME syncs at the bit level so accuracy requirements do not increase with increasing byte/frame length. Just a thought....
 
I have thought about those types of encoding. Would rather use the hardware in the chip, but that is a possibility for certain.

I see that the tiny1634 can be had with 2% calibration from the factory for a few cents more. Many choices.

Think I'll give a shot at cramming the SOIC into my layout and see how much it expands.
 
Well, the SOIC fits, it is tight but looks like it will do. And that cuts another 30 cents off the per cell cost, making it well under $2 per cell. The PC board may cost more than the parts. Plus the SOIC is easier to solder, probably could do the whole board with a soldering pencil (though there are better ways to go).

It grew slightly, but is still well under one square inch, 0.7 by 0.8 inches. This is just the cell electronics and balancing resistors, not including connectors.
 
With regards to the internal R-C oscillator, it's not just the initial accuracy but its temperature coefficient. I haven't looked at the specs of the ATtiny parts but uneven oscillator frequency drift due to temperature fluctuations could have a significant impact on comms reliability, especially since you'll have a fair number of devices communicating with each other. Comms reliability really needs to be rock solid for the entire system to work well.
 
Back
Top