Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 12-02-2020, 22:47   #1
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Designing yet another BMS (yaBMS)

So I decided to design a BMS specifically for a sailboat house bank. It will not try to balance (plug in a balancer for that if ever needed) but is smart on protection measures (shut down charging sources or discharging loads and only disconnect the battery if that shutdown fails or is not enough). Another advanced feature will be a storage mode (where it disconnects from the bus except when it needs a bit of charge.

The difficulty is measuring cell voltages safely, without discharging cells too much or, even worse, disturbing the balance of the cells.

BMSís available on eBay use a special chip and lack features. The expensive BMSís can do everything but their programming often needs customization for which the manufacturer is needed.

The reason for this thread is to get input on features and implementation. Iíll throw in my initial ideas:

- a small PCB for each cell (or group of parallel cells) which connects to both terminals of the cell. The only components are a temperature sensor and an Ethernet socket for the cable to the main PCB.

- a central PCB with Ethernet sockets for the cables from the cells. In the cable, 3 pairs of conductors are used. One pair for the temperature sensor, one for sensing the voltage and one for supplying the power for the microcontroller, an Atmel ATTiny85. It runs off the cell it connects to and will mostly sleep to save power (0.1 uA) but periodically wake up to report voltage and temperature via an isolator (optocoupler or maybe I2C isolator) to an arduino-type microcontroller that makes the decisions.

- outputs for stopping charging and stopping discharging as latching relay contacts. These would connect (direct or via extra relay) to alternator regulators, solar controllers, chargers, inverters etc. I checked and found that all a Victron gear supports this, as well as the external alternator regulators I checked.

- outputs & inputs (input to check switch position) for Blue Sea Systems ML series 500A remote battery switches. Support for separate charge and discharge busses.

- a small OLED display that wakes up when a button is pressed and shows status, voltages, temperatures etc.

This should be easy to implement but Iím sure you will have other ideas so please comment

The picture is a Tiny85 running off a single LiFePO4 400mAh cell
Attached Thumbnails
Click image for larger version

Name:	75035AE4-A5D5-4899-8862-37F3C76FB568.jpeg
Views:	83
Size:	98.9 KB
ID:	208628  
__________________

s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 04:58   #2
Senior Cruiser
 
Steve_C's Avatar

Cruisers Forum Supporter

Join Date: Apr 2009
Location: Bulverde, Texas
Boat: Shopping for a Cat
Posts: 427
Re: Designing yet another BMS (yaBMS)

I would suggest that the control circuits for all the contactors have the ability to be either

Momentary +

or

relay with Com-NC-NO

Or simply output signal to CAN bus.

Ease of setting the thresholds is a big deal, as is support for 4,8 or 16 cells and the multiple voltages that go along with it.
__________________

__________________
_________________
_____________
Steve
Steve_C is offline   Reply With Quote
Old 13-02-2020, 05:22   #3
Registered User

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 4,912
Re: Designing yet another BMS (yaBMS)

One way would be get a board made up from jlcpcb with sensors (voltage & temperature in your case) attached then send all the data to a raspberry pi running openplotter/signalk. SigK does the rest, send all the data to influxDB for plotting - essential IMHO to see the trends in the data.

This is a little way there but needs improvement, 8 x very accurate voltage, 20A & 3.2A current sensors & headers for barometer/humidity & headers for ds18B20 thermometers. Wifi has been solid for data for well over a year so far, 24/7.

https://github.com/boatybits/boatymonpy

https://raw.githubusercontent.com/bo...0209152710.png
conachair is offline   Reply With Quote
Old 13-02-2020, 06:42   #4
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by Steve_C View Post
I would suggest that the control circuits for all the contactors have the ability to be either

Momentary +

or

relay with Com-NC-NO

Or simply output signal to CAN bus.

Ease of setting the thresholds is a big deal, as is support for 4,8 or 16 cells and the multiple voltages that go along with it.
Besides the Blue Sea Systems ML series, what other contractors do you have in mind? Would someone really want to use a solenoid, wasting battery power? I think Victron also has latching contractors but did not yet check how they are controlled.
For sending out signals to charging sources and loads, I can see that both momentary and relay contact is used. Youíre probably right that itís easiest to just support both for everything.

CAN bus: now that nnea2000 has been reverse engineered this isnít too hard. But it does require a much more powerful uController so more energy used. Also, I canít find nmea 2000 pgnís for lithium cells. It may be better to let a Victron BMV do this as it can send the pgnís for the whole battery than can be displayed on plotters, displays etc.
Or do you mean to create a private message protocol on CANbus? for controlling remote pcbís that switch loads and chargers?

The nice thing with a dedicated controller per cell is that it can be any number of cells. When using I2C to communicate with the central uController, itís just about replicating the same galvanic isolation of the individual cells from the central uController. The total battery voltage wouldnít matter except that a 3.3V or 5V power source for the central uController needs to be found/created.
Also, I wonder if people have 48V house banks. I think today these are boats that use it for propulsion as well, so those need active balancing chargers etc.
The only thing that keeps me away from a 48V house bank is the cost of rewinding the windlass and electric winches. Hmmm how much would that cost...

Setting thresholds: these will be simple constants in the software. I could create a couple of profiles like ďconservative, balanced, aggressiveĒ which can be set by jumpers and choose fitting ranges of cell voltages?
s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 06:59   #5
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by conachair View Post
One way would be get a board made up from jlcpcb with sensors (voltage & temperature in your case) attached then send all the data to a raspberry pi running openplotter/signalk. SigK does the rest, send all the data to influxDB for plotting - essential IMHO to see the trends in the data.

This is a little way there but needs improvement, 8 x very accurate voltage, 20A & 3.2A current sensors & headers for barometer/humidity & headers for ds18B20 thermometers. Wifi has been solid for data for well over a year so far, 24/7.

https://github.com/boatybits/boatymonpy

https://raw.githubusercontent.com/bo...0209152710.png
Iíll probably use jlpcb once it is finalized but Iím really gonna try to do the measuring with just a $2.- Tiny85 controller. I think it can do the precision required for the protection without external support chips and it can be powered from a single cell, even when that is down to 2.7V or less. This is important for isolation of cells and maintaining their balance.

For a boat monitor project: wouldnít it be easier to just output all that sensor data straight to nmea 2000? A simple esp32 board like the Teensy 3.2 (which is similar to what used in the project files you linked to) only needs a CANbus transceiver chip after which it can do it directly without the need for raspberry pi, SignalK etc. For cell voltages there are no pgnís defined I think?
s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 07:10   #6
Registered User

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 4,912
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by s/v Jedi View Post
For a boat monitor project: wouldnít it be easier to just output all that sensor data straight to nmea 2000? A simple esp32 board like the Teensy 3.2 (which is similar to what used in the project files you linked to) only needs a CANbus transceiver chip after which it can do it directly without the need for raspberry pi, SignalK etc. For cell voltages there are no pgnís defined I think?
Siganlk is so powerful it's well worth it even without monitoring. Plus any kind of monitoring is not coming close to useful without logging it all to a database so you can plot the data against time, signalk just makes anything & everything you can think you might want to do so much easier. Plus simple to set up on a Pi.
JLCPCB will solder a esp8266 or esp32 straight to the board so no extra parts needed apart from terminals, headers etc.
ads1115 is great for voltage, differential input option so no worry about earth loops. Ad internal reference so the readings don't drift with Vcc on the board.
INA219 very accurate ammeter which can piggy back on a BMS shunt, accurate down to about 100mA on a 200A/50mV shunt.
Plus barometer chip costs next to nothing, plotted pressure gets you so much more interested in the weather forecasts
conachair is offline   Reply With Quote
Old 13-02-2020, 07:25   #7
Senior Cruiser
 
Steve_C's Avatar

Cruisers Forum Supporter

Join Date: Apr 2009
Location: Bulverde, Texas
Boat: Shopping for a Cat
Posts: 427
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by s/v Jedi View Post
Besides the Blue Sea Systems ML series, what other contractors do you have in mind? Would someone really want to use a solenoid, wasting battery power? I think Victron also has latching contractors but did not yet check how they are controlled.
For sending out signals to charging sources and loads, I can see that both momentary and relay contact is used. You’re probably right that it’s easiest to just support both for everything.

CAN bus: now that nnea2000 has been reverse engineered this isn’t too hard. But it does require a much more powerful uController so more energy used. Also, I can’t find nmea 2000 pgn’s for lithium cells. It may be better to let a Victron BMV do this as it can send the pgn’s for the whole battery than can be displayed on plotters, displays etc.
Or do you mean to create a private message protocol on CANbus? for controlling remote pcb’s that switch loads and chargers?

The nice thing with a dedicated controller per cell is that it can be any number of cells. When using I2C to communicate with the central uController, it’s just about replicating the same galvanic isolation of the individual cells from the central uController. The total battery voltage wouldn’t matter except that a 3.3V or 5V power source for the central uController needs to be found/created.
Also, I wonder if people have 48V house banks. I think today these are boats that use it for propulsion as well, so those need active balancing chargers etc.
The only thing that keeps me away from a 48V house bank is the cost of rewinding the windlass and electric winches. Hmmm how much would that cost...

Setting thresholds: these will be simple constants in the software. I could create a couple of profiles like “conservative, balanced, aggressive” which can be set by jumpers and choose fitting ranges of cell voltages?
I have seen quite a few latching relays out there that people are using that still require a constant input, I think that's why every BMS I see uses constant signal rather than pulse. I think that with a pulse they would feel a need to monitor the status of the switch?? not sure really? At least with a NC NO COM relay they can choose behavior and voltage + or -. The momentary option would just be a really nice option for the Blue Sea

I've been really curious myself how much it would cost to rewind a Winch or Windlass motor from 12 to 24 or 48 Volts? Anyone have an idea how much??
__________________
_________________
_____________
Steve
Steve_C is offline   Reply With Quote
Old 13-02-2020, 07:44   #8
Registered User

Join Date: May 2011
Location: Toronto
Boat: Sandpiper 565
Posts: 4,568
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by s/v Jedi View Post
So I decided to design a BMS specifically for a sailboat house bank....
The difficulty is measuring cell voltages safely, without discharging cells too much or, even worse, disturbing the balance of the cells.
Interesting project.

Question - what sort of batteries permit you to access the terminals of individual cells?

Many micros have multiplexed A/D inputs, so you wouldn't need to have separate chips per cell; just measure at the positive end of each cell, then arithmetic gives you the individual cell voltages.

Also, you can put several DS18B20 temp sensors on the same bus.

So that would get you down to just 1 microcontroller per battery.
Lake-Effect is offline   Reply With Quote
Old 13-02-2020, 08:44   #9
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by conachair View Post
Siganlk is so powerful it's well worth it even without monitoring. Plus any kind of monitoring is not coming close to useful without logging it all to a database so you can plot the data against time, signalk just makes anything & everything you can think you might want to do so much easier. Plus simple to set up on a Pi.
JLCPCB will solder a esp8266 or esp32 straight to the board so no extra parts needed apart from terminals, headers etc.
ads1115 is great for voltage, differential input option so no worry about earth loops. Ad internal reference so the readings don't drift with Vcc on the board.
INA219 very accurate ammeter which can piggy back on a BMS shunt, accurate down to about 100mA on a 200A/50mV shunt.
Plus barometer chip costs next to nothing, plotted pressure gets you so much more interested in the weather forecasts
I agree about the usefulness of that except that it is becoming too integrated for the kind of BMS I have in mind. Itís very easy to add a cell monitor that can be as simple as a $20 display to as advanced as a SignalK database logging device. Things that are sent out onto nmea2000 can be plotted over time by things like Maretron displays, web gauges on wifi gateways etc. A SignalK server isnít the only option, plus it can grab all that data from the nmea 2000 bus as well. Itís a shame that there are no BMS pgnís.

About my measuring: I plan on 10mV and 1degree accuracy without using any supporting chips. The Tiny85 does have a 1.1V internal reference (that requires one time calibration in software) and two (or 3?) 10-bit ADCís. It should be enough.

About using one chip: you canít unless you use a specialized BMS chip. The reason is that the ADCís only support sampling up to the reference voltage. This means a voltage divider is needed and the negative of the second cell is the positive of the first cell so youíre shorting out. The flawed method of measuring between main negative and the positive of each cell, subtracting values to get to individual cell voltages, disturbs the balance of the cells (cell one is loaded by every voltage divider, cell one by every one but the first and so on).
In contrast, a dedicated Tiny85 per cell can do a trick where it can directly sample cell voltage, without using any voltage divider, but still calibrated by itís internal reference, pretty spiff
s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 09:33   #10
Registered User

Join Date: Dec 2019
Posts: 4
Re: Designing yet another BMS (yaBMS)

Interesting!

Please post details as you implement this.
ikanode is offline   Reply With Quote
Old 13-02-2020, 09:45   #11
Registered User

Join Date: Jan 2017
Location: San Diego
Boat: Kelly Peterson 46
Posts: 63
Re: Designing yet another BMS (yaBMS)

Sounds like a great project. I agree with the idea of simplicity that in the BMS. I am a huge fan and user of signalk, but believe it’s better implemented off the bms for reliability and flexibility. I would hat something crashing in my rpi to disable the bms.
bradfordharley is offline   Reply With Quote
Old 13-02-2020, 10:16   #12
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Re: Designing yet another BMS (yaBMS)

Quote:
Originally Posted by Steve_C View Post
I have seen quite a few latching relays out there that people are using that still require a constant input, I think that's why every BMS I see uses constant signal rather than pulse. I think that with a pulse they would feel a need to monitor the status of the switch?? not sure really? At least with a NC NO COM relay they can choose behavior and voltage + or -. The momentary option would just be a really nice option for the Blue Sea

I've been really curious myself how much it would cost to rewind a Winch or Windlass motor from 12 to 24 or 48 Volts? Anyone have an idea how much??
The problem is knowing the state of the contactor. It will stay in itís current position even when power is removed. If there is no feedback, then a controller must switch it to make sure. If it is a type dat only has one input, then the polarity must be reversed which is a pain as it requires additional components. There are also types that alternate on the same signal which are really only suitable for manual operation.
I will make support for specific contactors that are suited for the application and of course anyone can hack whatever code they like instead of that.
s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 10:28   #13
Senior Cruiser
 
ronstory's Avatar

Cruisers Forum Supporter

Join Date: Sep 2015
Location: Portland, OR USA
Boat: C&C 35 MK-II
Posts: 336
Re: Designing yet another BMS (yaBMS)

A suggestion to consider RJ11 connectors versus the RJ45 or for ethernet if you are not using the differential voltage function of the ether cable. The phone wire routes really easily, easy to find, and takes less space, but limits expandability and noise immunity.
__________________
Thanks,
Ron
ronstory is offline   Reply With Quote
Old 13-02-2020, 10:35   #14
DoÖ or do not
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 10,220
Re: Designing yet another BMS (yaBMS)

About rewinding motors for winches, windlass etc.: I donít think this is still done in the US (throw away society) but in Latin America for sure.

Thereís more: we have two extra alternators on the engine for charging the house bank: those need rewinding as well, plus a specialized or adapted regulator. I plan to build that myself as well, but thereís only so much one can do

Then the (solar) chargers, inverters etc. all need replacing as well. Itís a big change.
s/v Jedi is offline   Reply With Quote
Old 13-02-2020, 10:42   #15
Registered User

Join Date: Oct 2011
Location: East Coast, Canada
Boat: Big C Marine, 15 metre Catamaran
Posts: 631
Images: 2
Re: Designing yet another BMS (yaBMS)

Have you already thought of a cold temp shutdown? My Rec BMS now has that feature, with a two degree Hysterisis (if that's the right term) When the temp is two degrees above the "off" temp, the unit re-engages the charge solenoids. Or at least that's the theory, I've not yet uploaded the new firmware.

My charge cutoff setup is rather simple, just now, as the only charge comes from the 1.1kw worth of solar panels. I have a manual switch hooked up to my alternator, so I can energize the alternator when I want to charge with it, but otherwise, the alt is isolated from the positive side of the system.

My Blue Sea solenoids are a constant draw from the system, there are three in total: one for charging, and two for the draw. With the BMS and solenoids, we use a constant .7 amps. It's a 720AH lithium system, and so far, the longest I've been away from the boat is 11 days. My cold temp cutoff will be nice, once installed; but in the meantime, I disconnect the solar while I'm away.

We're still learning, as we've only had the system hooked up for a year, and have only been "in the wild" for the last 5 months.

Cheers.
Paul.
__________________

GRIT is offline   Reply With Quote
Reply

Tags
Arduino, BMS, lifepo4

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modern Yet Cheap - Bluewater Worthy Yet Fast ? kman07 Dollars & Cents 21 31-05-2019 10:10
Yet another LFP and BMS build tanglewood Lithium Power Systems 0 19-11-2018 08:40
LiFe(Y)PO4 BMS Dessign - good reading for DIY BMS developers CatNewBee Lithium Power Systems 10 20-09-2018 00:15
yet another cyclone Alan Wheeler General Sailing Forum 3 04-03-2005 05:51
yet another new guy undrsol Meets & Greets 10 06-02-2004 09:17

Advertise Here


All times are GMT -7. The time now is 00:27.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.