Switched ADC BMS

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

Re: Switched ADC BMS

Post by johu »

This morning I made the decision :) I will just add around 10 Ohm series resistance on each input. Then even if there is a glitch it will be limited to a few 100 mA. It's a rather pragmatic solution but as it seems to only be a power-on problem I think it is appropriate.
I might also lower the gate resistors somewhat.
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

And just discovered another issue:
grafik.png
This is the voltages of my 40Ah ESS pack. When I installed the BMS 7 weeks ago, the delta was 5 mV. Now it is more like 50 mV.

I think this is caused by the resistive dividers of the mux being on there 24/7. The lower the cell, the more often will it see the little drain. Would be less pronounced in a car with less uptime but still, a BMS should never contribute to disbalance. Amazing what many 10k of resistance can draw over time.

Argh

EDIT: makes we wonder, could the mux control also be floating... gotta think about this.
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

I'm redoing the topology now. Each P-FET pair will have its own opto coupler controlled from the LV side. The STM32 is directly connected to the 3-to-8 decoders. Adds the optos (5 cts each) but makes 3 74HC chips and 18 N-Fets redundant. I'm keeping the decoders to have a degree of hardware protection against SW bugs.
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

This would be the new mux design:
image.png
The two lower channels are NFETs and when turned on are connected to the cell 2 above it to always have sufficient gate voltage. The upper channels keep the PFETs that are pulled to the cell 2 below again fur sufficient gate voltage. This will draw an equal amount of current from all cells when doing a mux sweep, except the lower 3 cells. They deliver twice as much. I think I will compensate for that with lower pull down resistors on the upper channels.

And the according layout
image.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Jacobsmess
Posts: 441
Joined: Thu Mar 02, 2023 1:30 pm
Has thanked: 226 times
Been thanked: 55 times

Re: Switched ADC BMS

Post by Jacobsmess »

Apologies for my ignorance on BMS type things, but will this be a flexible option to manage any homebrew battery packs up to certain cell amounts? Thanks
User avatar
uhi22
Posts: 554
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 83 times
Been thanked: 392 times

Re: Switched ADC BMS

Post by uhi22 »

Bipolar optos, with 10k load, can be quite slowly turn off, this needs to be considered for the blanking time. And maybe series resistors on the outp/outn would avoid smoke. And is it possible to place parts on the bottom side, to reduce the PCB size?
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Jacobsmess wrote: Tue May 09, 2023 5:14 pm Apologies for my ignorance on BMS type things, but will this be a flexible option to manage any homebrew battery packs up to certain cell amounts? Thanks
Yes, I already use it in that application (see my ESS thread under renewables)

uhi22 wrote: Tue May 09, 2023 6:23 pm Bipolar optos, with 10k load, can be quite slowly turn off, this needs to be considered for the blanking time. And maybe series resistors on the outp/outn would avoid smoke. And is it possible to place parts on the bottom side, to reduce the PCB size?
Yes, will make sure to insert like 50-100us of blanking time, not a lot compared to the 25ms sampling time per channel.
JLCPCB only allow one sided population, double sided should indeed make the board a lot smaller.
I'm SO sure that I will no longer have glitches now that I omitted the resistors - will regret later ;)

I have also now gone over all mux states and calculated the total current draw through the pull-up resistors. The very first and very last channel see the least draw, also the 2nd one sees a bit less and the middle ones all have the same. I have changed the resistors to compensate for that, the upper-most channel needed an extra 2k4 resistor switched in to be on par. Now I'm at 54mAh/year between the cell that sees the least and the most draw (assuming 24/7 ontime)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Jacobsmess
Posts: 441
Joined: Thu Mar 02, 2023 1:30 pm
Has thanked: 226 times
Been thanked: 55 times

Re: Switched ADC BMS

Post by Jacobsmess »

johu wrote: Thu May 11, 2023 1:23 pm Yes, I already use it in that application (see my ESS thread under renewables)
Thanks, would it be possible to setup to manage a 96s pack? I need a BMS system for my planned pack of 32 IPace modules (3S4P)
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Alright, alright, series resistors added :)
image.png
Jacobsmess wrote: Thu May 11, 2023 4:44 pm Thanks, would it be possible to setup to manage a 96s pack? I need a BMS system for my planned pack of 32 IPace modules (3S4P)
Yes, it is stackable. Gotta do a bit of testing with the latest revision to make sure it no longer blows up, then it's ready for sale.
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Took 5 days to put the cells back in balance:
image.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Proton
Posts: 137
Joined: Sat May 06, 2023 2:23 am
Location: Georgia/US
Has thanked: 104 times
Been thanked: 18 times

Re: Switched ADC BMS

Post by Proton »

@Johu

are you continuously balancing the cells? because that will imbalance the cells. For my solar system I have an active balance that can be setup when to start balancing. my cells are LiFePO4 3.2v and I setup the balance to start balancing only when cells reach 3.40v.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

I also start balancing above 3.8V, in that region soc/voltage curve is steep
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Proton
Posts: 137
Joined: Sat May 06, 2023 2:23 am
Location: Georgia/US
Has thanked: 104 times
Been thanked: 18 times

Re: Switched ADC BMS

Post by Proton »

LiFePo4 are full at 3.43V. but they can go to 3.65V. 3.4V / 3.65V = 93% charge.

Li-Ion 3.8V / 4.2V = 90% I think you can start at 3.9. But again, I only have experience with LiFe batteries.

Is this BMS going to work with LiFe Batteries ? I do not intend to ever use Li-Ion Batteries. The new Mercedes Sprinter coming this summer is going to use LiFe batteries.
chentron
Posts: 103
Joined: Mon Feb 22, 2021 3:25 pm
Location: Spain
Has thanked: 41 times
Been thanked: 4 times

Re: Switched ADC BMS

Post by chentron »

johu, how much time for the birth ? days , weeks , months ?
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Switched ADC BMS

Post by EV_Builder »

johu wrote: Wed May 17, 2023 3:12 pm I also start balancing above 3.8V, in that region soc/voltage curve is steep
No so steep you mean?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Proton wrote: Wed May 17, 2023 8:57 pm Is this BMS going to work with LiFe Batteries ? I do not intend to ever use Li-Ion Batteries. The new Mercedes Sprinter coming this summer is going to use LiFe batteries.
That is software-defined really. The ADC accuracy is high enough to do an open voltage estimate of SoC even for LFP batteries.
chentron wrote: Thu May 18, 2023 8:15 am johu, how much time for the birth ? days , weeks , months ?
weeks, I think. New revision is currently on its way. If it's stable I could start selling boards. Software is not 100% there but good enough for tracking min/max cell voltage (and individual cell voltages of course) and Coulomb counting. Software is 100% open source so others can chime in
https://github.com/jsphuebner/FlyingAdcBms
EV_Builder wrote: Thu May 18, 2023 1:35 pm No so steep you mean?
What I mean is at 3.6V recent NMC chemistry has a plateau, so 30% is 3.6V and 40% is 3.65V or something so 5 mV/%. Above 3.8V this becomes steeper, say 3.8V is 70% then 3.9V is 80% i.e. 10mV/%. So differences in top balancing are more visible in the upper voltage range.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
janosch
Posts: 306
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK
Has thanked: 67 times
Been thanked: 54 times
Contact:

Re: Switched ADC BMS

Post by janosch »

I hope I will have time to contribute to the software side.

It will be a version of the chglim/dislim, built upon my thoughts here from December:
viewtopic.php?t=2861
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Yes, that would be great. Will come up with a list of things that I can think of.

I have received the new boards and hooked one up. Worked out of the box this time.
Next I will assemble a test battery to test two modules in cooperation. The thing that didn't work back in London.

STM32 had a little surprise for me: PB4 is tied to JRST (jtag reset). So you need to turn jtag off. But in order to do that you need to enable the AFIO clock. Took me a few moments to figure out...
Attachments
signal-2023-05-22-190317.jpeg
1684757301000.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Proton
Posts: 137
Joined: Sat May 06, 2023 2:23 am
Location: Georgia/US
Has thanked: 104 times
Been thanked: 18 times

Re: Switched ADC BMS

Post by Proton »

I would love to buy and test one of those on my solar system. My current BMS is working perfectly but it has Bluetooth and I always have to use a phone with GPS enabled to see what is going one. Would be nice to replace that.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Proton wrote: Mon May 22, 2023 6:10 pm I would love to buy and test one of those on my solar system. My current BMS is working perfectly but it has Bluetooth and I always have to use a phone with GPS enabled to see what is going one. Would be nice to replace that.
Sure, did you say you were going to order something anyway? Can just throw one in. WIP as always but certainly sufficient for obtaining min/max cell voltage over CAN
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

Thought I'd just summarize current state of affairs and plans

EDIT: this will be maintained in the opening post viewtopic.php?t=2338
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Proton
Posts: 137
Joined: Sat May 06, 2023 2:23 am
Location: Georgia/US
Has thanked: 104 times
Been thanked: 18 times

Re: Switched ADC BMS

Post by Proton »

johu wrote: Mon May 22, 2023 7:39 pm Sure, did you say you were going to order something anyway? Can just throw one in. WIP as always but certainly sufficient for obtaining min/max cell voltage over CAN
Unfortunately my order is already on the way.
User avatar
mackoffgrid
Posts: 93
Joined: Thu Jan 02, 2020 10:18 am
Location: Brisbane Australia
Has thanked: 4 times

Re: Switched ADC BMS

Post by mackoffgrid »

johu wrote: Sun May 07, 2023 7:22 am And just discovered another issue:
grafik.png

This is the voltages of my 40Ah ESS pack. When I installed the BMS 7 weeks ago, the delta was 5 mV. Now it is more like 50 mV.

I think this is caused by the resistive dividers of the mux being on there 24/7. The lower the cell, the more often will it see the little drain. Would be less pronounced in a car with less uptime but still, a BMS should never contribute to disbalance. Amazing what many 10k of resistance can draw over time.

Argh

EDIT: makes we wonder, could the mux control also be floating... gotta think about this.
I don't see how this could be the problem unless your control mosfet is not off fully?
https://github.com/mackelec/SolarUte
meFDCAN Arduino Library 3 FDCAN port stm32G4xx
meCAN Arduino Library 2023 version 2/3 CAN port stm32F0xx, stm32F1xx, stm32F4xx, stm32L4xx
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Switched ADC BMS

Post by johu »

mackoffgrid wrote: Sat May 27, 2023 2:28 am I don't see how this could be the problem unless your control mosfet is not off fully?
The gates of the P-FETs are pulled to the voltage they are switching with a 10k pull-up resistor. E.g. gate of FET for V7 is pulled to V7. To turn on the gate is pulled to V0 by its N-FET companion via another resistor, say another 10k. So now current is circulating through two resistors pulling like 1mA from cells 0-7. It means cell 0 sees all turn-on currents, cell 1 sees 15 out of 16 and cell 15 sees just 1. You could say cell 0 sees a constant draw of 1 mA and cell 15 of just 1/16 mA. That's how they get disbalanced.

With the new topology that is mitigated.

Apart from that I just checked the displayed cell voltages against my multimeter and found cell 1 always reads 10 mV low. The others are correct.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mackoffgrid
Posts: 93
Joined: Thu Jan 02, 2020 10:18 am
Location: Brisbane Australia
Has thanked: 4 times

Re: Switched ADC BMS

Post by mackoffgrid »

johu wrote: Tue May 30, 2023 10:38 am The gates of the P-FETs are pulled to the voltage they are switching with a 10k pull-up resistor. E.g. gate of FET for V7 is pulled to V7. To turn on the gate is pulled to V0 by its N-FET companion via another resistor, say another 10k. So now current is circulating through two resistors pulling like 1mA from cells 0-7. It means cell 0 sees all turn-on currents, cell 1 sees 15 out of 16 and cell 15 sees just 1. You could say cell 0 sees a constant draw of 1 mA and cell 15 of just 1/16 mA. That's how they get disbalanced.

With the new topology that is mitigated.

Apart from that I just checked the displayed cell voltages against my multimeter and found cell 1 always reads 10 mV low. The others are correct.
Thanks, I misunderstood. The imbalance is not happening while the circuit is shutdown. :)
https://github.com/mackelec/SolarUte
meFDCAN Arduino Library 3 FDCAN port stm32G4xx
meCAN Arduino Library 2023 version 2/3 CAN port stm32F0xx, stm32F1xx, stm32F4xx, stm32L4xx
Post Reply