4-channel BMS with daisychain bus

Topics concerning OEM and open source BMSes
Post Reply
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

4-channel BMS with daisychain bus

Post by johu »

So once again, here is my BMS design that I intend to use in Polo and Touran and if it works well, I will sell it.
It is a 3-level system:
  • cell level: 4-channel module with bit length coded serial communication
  • module level: isolator module with text based communication (similar to inverter) over RS485
  • module level: isolator module with CAN bus, current sensor input, relay and fuel gauge simulator
  • Top level: Linux computer (beagleboard, raspberry etc.)
  • Alternatively I will try to squeeze BMS software into the isolator
  • Current sense/IO-module also on RS485 bus
The cell modules have 1mV resolution around the typical cell voltage (3-3.4V for LFP, 3.6-4V for NMC). Outside these windows the resolution is 5mV, still good enough for LVC/HVC cutoff.
They do balancing via a resistor and a LED in series. That way even a faulty balancing transistor cannot completely discharge a cell but it stops at the LED forward voltage. Designed balancing current is 20mA. Balancing takes place when the pack is idle i.e. 1h after charge or discharge and then over several hours.
The bus only uses one wire. Even though it is daisy-chained it is failsafe, i.e. if one module does not work it will not interrupt the bus. The modules are self-addressing in order of wiring.

At the beginning of the string the isolator is connected to B+ and Data-In, and the same isolator connects to B+ and Data-Out at the end of the string.

So that's the theory, today I did some practical tests. I mounted 3 modules in Polo and little surprise they worked. But now I switched on the inverter and let it run in creep-mode (i.e. spinning the motor at 200rpm). Instantly communication collapsed, there were quite prolonged pulses (2µs) even behind the opto. I also experienced the famous EMC paradox: as I increased load on the motor communication picked up again. Fortunately there were no issues in charge mode (same inverter, same pulse frequency). So in that discipline, the infrared system wins.
The modules still understood their commands as they were flashing.
Update May 19: Communication is pretty much sorted by now.
Update February 20: Communication protocol changed to 10kbaud UART - now runs fine while charging and driving

So next I will try coax cable between the last module and the isolator. More extensive low-pass filtering is not an option as the cutoff-frequency is getting close to the baud rate.
Attachments
Schematic
Schematic
Isolator module
Isolator module
4-cell module
4-cell module
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Did another test today. As usual shielded cable fixes the problem.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by Jack Bauer »

Nice work :)
I'm going to need a hacksaw
tom91
Posts: 1272
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: 4-channel BMS with daisychain bus

Post by tom91 »

Nice compact unit, have you worked out the rough costs of such a 4 cell monitoring slave?

What sort of data rate are you using on the serial bus? What sort of through put time do you see from requesting voltages and getting them back?
Founder Volt Influx https://www.voltinflux.com/
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: 4-channel BMS with daisychain bus

Post by nailgg »

Looks very nice.

Do you plan to integrate state of charge and state of health estimation?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

tom91 wrote: Sun Mar 03, 2019 2:36 pm Nice compact unit, have you worked out the rough costs of such a 4 cell monitoring slave?

What sort of data rate are you using on the serial bus? What sort of through put time do you see from requesting voltages and getting them back?
The BOM cost is like 3€ /w PCB. The manufacturing cost at low volume is rather high, 10€ a piece, so I'm doing the prototypes manually with stencil, solder paste and a vacuum placing tool.
Data acquisition takes about 25ms, so 40 modules per second. Data rate on the RS485 is 115k. So the fewer cell modules per isolator, the higher the throughput.
nailgg wrote: Sun Mar 03, 2019 3:00 pm Looks very nice.

Do you plan to integrate state of charge and state of health estimation?
Yes that is the plan. Number crunching is done with python scripts. I will certainly open that part of the software so anyone more knowledgeable than myself can step in.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

More testing today with 25 modules installed on the rear pack. All works nicely when idle. But now with all modules installed even charging disturbs communication, let alone driving. Cables still unshielded though. I will order some shielded cable and will tweak the low passes a bit more.
It still looks like the modules receive their commands ok but their response is lost in noise. The response has to travel over all remaining modules and the unshielded cable back to the isolator. The latter is like 1m long.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: 4-channel BMS with daisychain bus

Post by nailgg »

I don't think that the implementation of the state of charge would be too hard. There are many papers out there covering coulomb counting algorithms. The community might help when it comes to that point.

I'm guessing you are using a Linux computer at the top level for keeping logs. Also, being able to write the code on Python is a good advantage. All other operations could also be done on a STM32F103.

What's the baud rate for the communication?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Yes coulomb counting I already do. It would be interesting to calculate the actual state of charge for each cell and how it differs from the coulomb counted SoC. That way you could determine SoH for each cell.
Yes top level computer is Linux. Beaglebone or Pi.
Took a picture of the setup this morning.

Baud rate is a bit variable because of bit length coding. 1=200µs, 0=100µs. So on average 150µs per bit, so 6kbit/s
Attachments
IMG_20190307_073629.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

A highly informative video on manual pick and place and reflow. Tada

EDIT: sorry Arber for abusing your boards ;)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by arber333 »

johu wrote: Sun Mar 17, 2019 11:33 pm EDIT: sorry Arber for abusing your boards ;)
Ha ha! I noticed now, i still havent tried them if they work though- So at least they are good for something.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Up'n'downs today. I have fully migrated the Polo to the new BMS. It still drops out on driving and becomes a little disturbed on charging (funky inverter charging, that is).
Now for tracking it down I scope the the data return signal. Since I was all in prototyping mode I left battery terminals uncovered... you might see it coming.
I moved the laptop over a bit to have better access to some pins. It touched one of the terminals - GFCI tripped. End result: Laptop still works but all USBs are gone, Analog Discovery is blown (it was the 3rd), isolator blown, beaglebone blown.

Last thing I saw on the scope was a very clean signal. So not sure why comms drop it. Will investigate further when my equipment is replaced... Luckily the laptops main board is split and I only need to replace the smaller one - 40€ with shipping from Aussieland.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by arber333 »

johu wrote: Wed Mar 20, 2019 5:40 pm Up'n'downs today. I have fully migrated the Polo to the new BMS. It still drops out on driving and becomes a little disturbed on charging (funky inverter charging, that is).
Now for tracking it down I scope the the data return signal. Since I was all in prototyping mode I left battery terminals uncovered... you might see it coming.
I moved the laptop over a bit to have better access to some pins. It touched one of the terminals - GFCI tripped. End result: Laptop still works but all USBs are gone, Analog Discovery is blown (it was the 3rd), isolator blown, beaglebone blown.

Last thing I saw on the scope was a very clean signal. So not sure why comms drop it. Will investigate further when my equipment is replaced... Luckily the laptops main board is split and I only need to replace the smaller one - 40€ with shipping from Aussieland.
Hm, sorry to hear that. It seems we damaged one Ampera IGBT by driving motor way beyond weakening. DCswitch tripped on OClimit and i guess motor unloaded dV into poor IGBT.

I had similar experience with my BMS. On start I got good signal for second or two, but then it went off the ledge. I eventually traced it to incorrect RC filter before opto receiver. I put more capacitance in and it worked. Until i got 102 cells in, then it started tripping all over again.
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: 4-channel BMS with daisychain bus

Post by nailgg »

johu wrote: Wed Mar 20, 2019 5:40 pm I moved the laptop over a bit to have better access to some pins. It touched one of the terminals - GFCI tripped. End result: Laptop still works but all USBs are gone, Analog Discovery is blown (it was the 3rd), isolator blown, beaglebone blown.
That's the saddest thing I heard recently. :cry:
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Finally its starting to come good. I now get almost flawless reception while charging and rather intermittent reception while driving. I added short pulse suppression to the software, if it sees a pulse < 50µs (1/2 of the value for a logic 0) it is just ignored and the counter keeps running till the next pulse.
I'm also no longer getting false triggers for firmware upgrade or address reset - a problem I had earlier. Suddenly a few modules went into firmware upgrade mode and sat there forever.

I also added a shunting script to the main unit. It takes all voltages and programs the minimum + 20mV as shunt voltage. So if the lowest cell voltage is 3300mV it programs a shunt voltage of 3320mV and thus all cells with a voltage higher than 3320mV will get the 20mA shunt current applied. If max-min > 50mV I do not shunting at all. I also plan to only activate shunting when there has been no current flow for x minutes. Otherwise the dielectric effects present a voltage that is not the "core" cell voltage.

I'm now confident to build the rest of the modules and use them in Touran. And some will go to Mr Bauer for testing :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom91
Posts: 1272
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: 4-channel BMS with daisychain bus

Post by tom91 »

Would you not consider while charging to use the shunts to somewhat pull the top cells down towards the end of charge?
Or are you planning on running a charge till one hits full and the stop charging balance and then restart charge when cells are under a certain value?
Founder Volt Influx https://www.voltinflux.com/
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Hi Tom,
the shunt current is only 20mA so no good for charge end balancing.
tom91 wrote: Fri Mar 22, 2019 11:17 pm Or are you planning on running a charge till one hits full and the stop charging balance and then restart charge when cells are under a certain value?
Almost. Charge until first cell hits full. Wait (about 1h). Start balancing. If car is still plugged in, start charging again. In fact whenever the pack is idling (i.e. not charging or discharging) I will start the balancing process. The reason being that only the floating voltage after about 1h of rest is the real cell voltage.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Have tested the balancing for a few days now and so far it looks nice. I started out with 70mV between topmost and bottom-most cell now I'm down to 30mV. Next test will of course be whether I have done something useful in evening out the voltages. So will charge to full and see how the pack behaves as I approach empty. On my last test 1 cell hit bottom at 25% SoC. That we don't want.
Attachments
cell voltages.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
JSJFIN
Posts: 11
Joined: Thu Mar 21, 2019 3:30 pm

Re: 4-channel BMS with daisychain bus

Post by JSJFIN »

Seems that i need one of thease too 😁 this was renault Influenza bms. Battery module connectors were same, but they are not wired all same. Big bang and smoke when switched main switch on..
IMG_20190410_152133.jpg
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Wow, looks like the magic coal escaped! Thats why I was reluctant to just test out the Nissan BMS because I have no idea in which order the 4 inputs groups must be connected.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Been using the system in Polo since March now and it has pretty much come good. I have added more low pass filtering and am using unshielded cable again.
During charging and driving communication is still somewhat disturbed but it only results in slower update rates, no complete breakdown.
So if enough people are interested it would be worthwhile to do a batch.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
sonachan1
Posts: 64
Joined: Sat Dec 15, 2018 5:46 pm
Location: Cheshire, UK

Re: 4-channel BMS with daisychain bus

Post by sonachan1 »

Hey johu,

I'd like to help you move this forwards and would be interested in getting some boards made either by (my) hand or in a batch.

At the beginning of the the thread you mentioned 4 components: 4 channel battery module, isolator module, current / IO module and supervisory computer (like RPi).

What have you got working so far? Is the plan to control / read from the system over CAN?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Yes thanks for bringing it up. The system is fully functional as it stands. There is Coulomb counting via the current sense module, charger activation via relay on current/IO module, gauge drive via PWM on current/IO module, SoC/SoH estimation, shunting.
No CAN comms but I know how to use CAN on the BeagleBone and drive it via Python. So thats an easy addition.

How many boards would you like of each kind?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
sonachan1
Posts: 64
Joined: Sat Dec 15, 2018 5:46 pm
Location: Cheshire, UK

Re: 4-channel BMS with daisychain bus

Post by sonachan1 »

So I'm planning to install a leaf pack divided in half, with each half in different locations in the car. So I think I need 2 isolator modules, one for each half of the pack.

Then each half has 24 modules which has 4 cells in a 2S2P configuration, which is effectively 48 cells to monitor, so 12 4-channel monitor PCBs for each half.

So in total, 2 isolator modules and 24 4-channel monitor PCBs I think! Does this sound right based on this description?

Another question. How do you plan to fix the boards mechanically in position?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: 4-channel BMS with daisychain bus

Post by johu »

Yes that sounds right.
I've posted the files on github: https://github.com/jsphuebner/bms-hardware
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply