4-channel BMS with daisychain bus

Topics concerning OEM and open source BMSes
Post Reply
User avatar
johu
Site Admin
Posts: 5683
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 »

It is intended as a 3V reference still. It would probably be easier to route a temp sensor back to the master board. Do you think the sensor integrated in the attiny is insufficient?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
arturk
Posts: 146
Joined: Wed Oct 02, 2019 3:58 am
Location: United States, MD
Has thanked: 1 time
Been thanked: 2 times

Re: 4-channel BMS with daisychain bus

Post by arturk »

Johannes, thank for quick response.

I think internal sensor is fine in most cases however for my application I would like to use sensors which are built into battery modules.

I will be using it with BMW modules for which I do not have OEM BMS. In my case those are 8s modules with 3 thermistor type sensors built in (see attached photo).
Because of the size, orientation, wire harness and other factors using of the internal sensors is problematic. The best I could do is to attach board on the side ensuring some good thermal connection but I could only do it on one short end of the battery which would not be accurate representation of the module temperature.

I would like to leverage one or all battery sensors and do it ideally with minimal development effort so here are two ideas I came up with:

1) If we could use one of the pins in creative way to feed signal from external sensors into ATtiny it would be one option. This is why I was thinking about PA3, could you use VCC 3.3V as reference instead? I understand that some external circuit would have to be designed to accomplish that and I can take care of it. Just focusing on interface with your system for now.

2) Design new cell module which would be dedicated to measure temperatures. It would be very similar to your current module sharing core architecture but with redesigned battery side interface to use ADC to measure temperatures from 1 to 3 or even more sensors. These modules could be placed on the serial (1-Wire) bus between "regular" cell modules and they would just report temperatures. I could design hardware for this and probably most of the software for the module (with little help perhaps). I think your master module software could easily accommodate this new Temp Module similar way you handle Cell Modules with less then 4 cells connected, in this case it would show as cell module with no batteries. For simplicity it could only show single temperature that would be figured out by Temp Module based on design or internal algorithm. For example if module detected bigger than usual difference between three sensors in case of problem with one or group of cells then it could report the highest temp for entire battery module rather than average. Or it could report all temp and have Master Module figure out what to do with it. There would be a lot of flexibility here.

While #1 would be relatively simple "hack" to get it working, #2 seems like more elegant solution with much more flexibility to accommodate different scenarios. Perhaps there will be need for other types of "specialized" modules on your 1-Wire bus like controlling contactors or monitor other parameters.

The way I like to implement it is by designing battery module "base" board into which I would plug in your v5.2 (or newer) Cell Modules and newly designed Temperature module. Base board would link all of them together and provide interface to connect original battery balancing leads and temperature sensors as well as connections to daisy-chain for additional battery modules.
In my build I will have total of 24 battery modules each with dedicated BMS module composed of 2 regular Cell Modules and one Temp Module.

Well, let me know your thought, I am willing to put necessary effort into it but will definitely need support. In the end I think that others will be able to benefit as well.
Attachments
BMW_8S_Module.jpg
1998 Jaguar XJR, GS450h drivetrain, 48kWh/96s BMW battery
User avatar
victor_norberg
Posts: 13
Joined: Wed Mar 11, 2020 7:07 am
Location: Stockholm, Sweden
Contact:

Re: 4-channel BMS with daisychain bus

Post by victor_norberg »

Hello.

Is this BMS available for purchase as of now?

Victor in Sweden
Building foiling boats in Stockholm. Elcat Electric Car & Other projects.
User avatar
johu
Site Admin
Posts: 5683
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 »

No, sorry. Progress to set up production is painfully slow. Somehow connectors that are common in "the west" are not common in China. So it took really long to find some. Next the manufacturer we picked totally screwed up and delivered like 10% non-working boards. So we had to find a new one. Also communication has become more difficult as my "Chinese connection" can no longer travel there but we have to make instruction videos, translate them etc.
Last but not least I have the "too many projects" problem with occasional project fatigue. At least some progress today, we started making 10 more automatic programmers/calibrators that will be sent to China so they can program 10 boards at once. I've given up on estimating time frames.

You can still order boards from JLC, calibrate and program them yourself. If things stretch out longer maybe I'll get some boards myself and sell them calibrated on the shop. Just to get something going.
Attachments
IMG_20201216_191122.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: 5683
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 »

About the temp sensors. Like said I'm currently struggling already, so I really don't want to spend time in auxiliary tasks and I do not deem accurate temperature sensing very important. If you want you can open a new thread on a temperature sense module and I might occasionally pass by.

Now, something else. As it got colder I noticed communication problems. It turns out the resistor that limits opto coupler current (R15) is too high value, it should better be 120R or so.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
ChazFisher
Posts: 53
Joined: Wed Jul 03, 2019 1:32 am
Location: Central Virginia, USA

Re: 4-channel BMS with daisychain bus

Post by ChazFisher »

Hey, Johannes, I've got a question for you. I have a set of ver 5.3 slave boards built by JLCPCB. I just had them leave off the diodes, since the BOM still has the Zeners in there. Here's the last discussion I picked up about them:
johu wrote: Wed Dec 04, 2019 9:56 am <snip>
Now lies some work ahead. Unfortunately the Zeners fitted to all board need to be replaced by normal diodes as they cause a vampire drain. With that done it's time for software flashing and calibration. Prior to that I need to clean up my desk :twisted:
I will also send out an isolator. Time to make the first software and wait for the PCBs to show up.
<snip>
Looking at the schematic, it seems the purpose of that diode was to protect the voltage regulator (IC2) from an overvoltage. I guess this could be caused by connecting to the cells incorrectly. But if I'm willing to accept that risk, is there any other reason to have the diode there at all? And if so, what have you been using for the "normal" diodes?

Thanks.
Chaz Fisher
Slowly creeping up on that e-motorcycle.
User avatar
johu
Site Admin
Posts: 5683
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 »

The above quote was about diode D3. This used to be a 3V6 Zener that would limit the voltage when the opto fired up to 16V into the comms input. Problem was, on the boards with pull-ups (all but first) the Zener was constantly draining about 1 mA from the cells which kind of makes the µA standby mode useless. So that needed removing. The Zener (or in fact any diode) would also made sure the voltage didn't drop below GND.

This has been changed in the latest revision, the opto only switches the 3V3 rail onto the comms bus.

The TVS D1 is there to protect the board from over voltage. Of course the board will work fine without it but you may find some boards roasted some day because a regen surge kicked into a loose cell interconnect and caused the voltage to shoot up beyond the 3V3 regulator maximum limit.

Reverse polarity protection is done by D2.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
ChazFisher
Posts: 53
Joined: Wed Jul 03, 2019 1:32 am
Location: Central Virginia, USA

Re: 4-channel BMS with daisychain bus

Post by ChazFisher »

johu wrote: Mon Jan 04, 2021 10:18 am The above quote was about diode D3. This used to be a 3V6 Zener that would limit the voltage when the opto fired up to 16V into the comms input. Problem was, on the boards with pull-ups (all but first) the Zener was constantly draining about 1 mA from the cells which kind of makes the µA standby mode useless. So that needed removing. The Zener (or in fact any diode) would also made sure the voltage didn't drop below GND.

This has been changed in the latest revision, the opto only switches the 3V3 rail onto the comms bus.

The TVS D1 is there to protect the board from over voltage. Of course the board will work fine without it but you may find some boards roasted some day because a regen surge kicked into a loose cell interconnect and caused the voltage to shoot up beyond the 3V3 regulator maximum limit.

Reverse polarity protection is done by D2.
Thanks. I hadn't thought about what could happen during regen. I bought a batch of the 20V zeners, so I'll install them as I'm putting on the connectors. Large parts, so not hard to hand solder.
Chaz Fisher
Slowly creeping up on that e-motorcycle.
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: 4-channel BMS with daisychain bus

Post by m.art.y »

johu wrote: Wed Dec 16, 2020 6:18 pm You can still order boards from JLC, calibrate and program them yourself. If things stretch out longer maybe I'll get some boards myself and sell them calibrated on the shop. Just to get something going.
Hi, have a few questions:
Does the web interface alow to see voltages of every cell or just most high and most low?
Also is it possible to set custom target voltage for balancing say at 3.95 v?
Also would it be possible to up the balancing current by putting a larger resistor on the board in case that would turn out to be needed?
It is a bit unclear which model of diode you now recommend for D3? Thank you 🙂
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: 4-channel BMS with daisychain bus

Post by m.art.y »

Can the STM32F105RBTx chip on the CAN SMT V2 isolator be substituted with a different chip? These are not in stock at JLCPCB and they say they have very little demand for these chips..
User avatar
johu
Site Admin
Posts: 5683
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 »

Still only on my phone. So my answers: yes, yes, no. Not sure what D3 was.
I ordered a small batch with the ominous GigaDevices ripoff, will see if it works. So GD32F105RBT6
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: 4-channel BMS with daisychain bus

Post by m.art.y »

johu wrote: Wed Aug 05, 2020 5:09 pm I will tune up the JLCPCB BOM a bit so that you will be able to just buy the boards yourself. Issue here is that the cell boards need quite a lot of calibration done as they won't measure accurately otherwise.
Johannes would you be willing to share the detailed calibration procedure and how to build a calibration hardware? Or would you be willing to sell calibrators if that would be feasible? Also do you have any idea on the price range you intend to charge for the final master firmware when it's ready?
User avatar
johu
Site Admin
Posts: 5683
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, see here: https://github.com/jsphuebner/bms-software/ (README)

Selling calibrators is maybe not a bad idea.
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: 5683
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 »

Hmm, it doesn't seem like that GigaDevices processor is drop-in compatible. Just flashed the chip and the alive LED blinks super slow. Maybe they didn't rip off the clock logic correctly.

EDIT: actually it kept getting watchdog reset. Turns out to be something with the ADC. With that disabled it blinks ok.

Turns out the ADC did not like waiting for some flag:

Code: Select all

 void adc_start_conversion_regular(uint32_t adc)
 {
         /* Start conversion on regular channels. */
         ADC_CR2(adc) |= ADC_CR2_SWSTART;
  
         /* Wait until the ADC starts the conversion. */
         while (ADC_CR2(adc) & ADC_CR2_SWSTART);
 }
 
It waits indefinitely in the while loop. I omitted the call altogether and the ADC still runs. Will need to test CAN, then I'd say the GD32 is not so bad.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: 4-channel BMS with daisychain bus

Post by m.art.y »

Johannes, does your BMS measure internal resistance of the cells and would this be important in the following case: I have 192 cells that I plan to group every 2 cells in paralel and I will have 96 groups that I will connect in series. Would it be ok for your BMS to be used in that manner? So instead of 1 cell there would be 2 in paralel so 24 slave boards for entire 192 cell pack?
User avatar
johu
Site Admin
Posts: 5683
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, the BMS doesn't care how many cells are in parallel.
Current firmware will not calculate internal resistance but I plan to implement that.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
arturk
Posts: 146
Joined: Wed Oct 02, 2019 3:58 am
Location: United States, MD
Has thanked: 1 time
Been thanked: 2 times

Re: 4-channel BMS with daisychain bus

Post by arturk »

Johannes, I am trying to get my calibrator with sequencer working properly and I was wondering if you could clarify how it should operate.

From documentation I gathered that signals: 2kHz clock and 100mV reference are applied to PA6, which one is determined by state of PA5.
By looking at the calibration code I see that after everything is setup and initial values are read from EEPROM then:
1) PA5 is set to LOW to initiate clock calibration and 2kHz clock should be applied to PA6 at this time
2) Once clock is calibrated, PA5 is set to HIGH to apply 100mV reference on PA6
4) 10s delay is initiated (to quiet things down before ADC calibration?)
3) After 10s delay things are getting ready for ADC calibration but then PA5 is pulled down again to LOW!? which turns sequencer back into clock calibration mode. This means 100mV reference to calibrate "differential gain correction" is not present when it is needed as PA5 is not changed back to HIGH until the very end, right before flashing LED2-LED4 to signal completion of the process. I am little bit puzzled by this because calibration could not be completed this way.

How does your sequencer operate?
Do you have logic to prevent switching it back into clock calibration mode?

Also, I see you are sending some debug messaged during calibration through SendWord(uint16_t word), which pin is being used? Is it PA7?
1998 Jaguar XJR, GS450h drivetrain, 48kWh/96s BMW battery
User avatar
johu
Site Admin
Posts: 5683
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 »

I'm using a shell script for calibration, so that goes to the next step whenever PA5 toggles. You can modify the code if that doesn't suit your sequencer. Data may be sent out on PA7, but that is disabled. You need to uncomment TX_DDR |= TX_PIN; down at the bottom for it to work.
It is a strange format, I used to interpret it with my logic analyzer: 9600 16N2
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
arturk
Posts: 146
Joined: Wed Oct 02, 2019 3:58 am
Location: United States, MD
Has thanked: 1 time
Been thanked: 2 times

Re: 4-channel BMS with daisychain bus

Post by arturk »

Johannes, thanks for very helpful the tips. I am making good progress on calibration. Now that I got sequencer fully figured out it appears that calibration sort of getting stuck on "differential_gain_corr" and/or "differential_gains". But from looking at the code I start to suspect that this process may actually take a while since increments are very small (+/-1) and we are taking decent number of samples every time and this is multiplied by number of channels.
Based on your experience, what are the expect calibration times for those boards?
1998 Jaguar XJR, GS450h drivetrain, 48kWh/96s BMW battery
User avatar
johu
Site Admin
Posts: 5683
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 »

It can take up to 30s.
Of course it is possible to speed up by taking just one measurement and calculating new gain. But somehow that never came out right and I stuck with the small increments.
Some research wouldn't hurt...
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: 4-channel BMS with daisychain bus

Post by m.art.y »

Johannes which version of your slave boards you recommend to use 5.2 or 5.3? How is the first board set in case of a 5.2? Regarding that diode you mentioned caused a 'vampire' drain do we now use a non Zener diode (were you talking about D3)? Because D2 and D3 are a same diode in the BOM. Also does it matter which type of diode to use for D1? Thanks
User avatar
johu
Site Admin
Posts: 5683
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 »

5.3 has better "first board" selection I think. A jumper on what is otherwise the programming header. D3 is a normal diode, not Zener. D1 is a TVS type diode to protect the board from voltage spikes > 20V
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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: 4-channel BMS with daisychain bus

Post by EV_Builder »

@Johu; how difficult would it be, as in could i do it, to make the board not 4cells but 6cells? Is the main chip capable? Sadly i don't have the calibration tools.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
johu
Site Admin
Posts: 5683
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 »

I used to have a 6 channel variant but without balancing because of lacking pins. And of course resolution keeps dropping
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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: 4-channel BMS with daisychain bus

Post by EV_Builder »

johu wrote: Wed Apr 14, 2021 6:50 pm I used to have a 6 channel variant but without balancing because of lacking pins. And of course resolution keeps dropping
Mhhh we need another approach then. Why is resolution dropping?

The ATTiny26 (20pins) could be the way togo then?
ATTINY25.PNG
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
Post Reply