Saturday, September 20, 2014

Some existing works.

Very few ideas are truly new or unique.  Often they are re-application of work done elsewhere, or more often - ideas and concepts independently developed (it is, after all, a very big world out there).  There are two kind of key concepts for this line of BMS / CAN charging systems:
  • Ability to communicate battery status and needs out to many charging sources.
  • System enforced coordination of those multiple charging sources.

The benefits of these two include:  Elimination of individual sensing wires from each charging source to the battery (We have  6x sets of voltage sensing wires attached to our house battery, 5x temperature senders..).  And the other benefit is to allow charging resources to work together in a unified way; eliminating the not uncommon teeter-tottering back and force fight between two or more independent sources as they play 'King of the Mountain'.  It also opens up the potential for more intelligent deployment of resources, ala - let the Solar panels do the final finishing charges, as opposed to keeping the generator running under a light load...


Here are a couple of examples of prior work that touches on these concepts:

The 1st illustrates the idea of using the CAN bus to inform remote devices of the battery's voltage/current/temperature status: "Distributed Power Supply Control Using CAN-Bus":
    www.ixs04.aps.anl.gov/News/Conferences/1997/icalepcs/paper97/p155.pdf


And here is a high end Solar MPPT controller who advertises a value of "Don’t waste solar power: all chargers will always be in the same state.." and more:
 

http://www.victronenergy.com/blog/2013/11/15/synchronizing-multiple-mppt-15070-charge-controllers-2/


Both of these are existing examples of the key goals of this 'systems' project, and highlight why selecting a CAN protocol is a bit difficult.  Note that the Victron MPPT controller uses its internal VE.connect protocol extensions to enable the coordinator, not NMEA-2000 - that is just used to report out the aggregated results.



Refinement of draft Schematics - BMS + a draft CAN Alternator Regulator

Along with looking at CAN standards, I have been refining the draft schematics for the BMS, and crafted up an initial cut at a simplified CAN Alternator Regulator.   Here are a couple of snap-shots; higher resolution .pdf files can be found under the Schematics resource tab above.


Click for larger, or see .PDF file in Schematics resource tab above

Major changes to the BMS include:
  • Addition of small Switching PS for better energy usage.
  • Revised USB chip for more widely supported (driver wise) component.  Is also simpler to solder, and lower cost!
  • Improved CAN electronics, considering 'system wide' deployment.  There likely will be some additional enhancements / changes here - open to input from anyone with experience in this area.
I considered changing out the CPU for an integrated CPU/CAN device (ala, the 90CAN32), but am staying with the current solution as it appears to be able to provide lower power consumption.   In addition to more consideration on the CAN interface, I want to consider the optional BMS Cell loop - currently it is a Yes/No design in support of the Clean Power Auto cell monitors (http://www.cleanpowerauto.com/).  I want to consider how a simple protocol can be transferred over this same line to gain perhaps individual cell voltage status.  Maybe even enabling the OneWire standard - Or reusing the Auto industries LIN protocol (a kind of CAN lite) ??





I also drafted up a potential Alternator Regulator for use with the CAN system.  It is based on the Arduino Alternator Regulator (http://ArduinoAlternatorRegulator.blogspot.com/) with several key differences:
  • Battery measurements are utilize the BMS
    • There is no on-board remote battery voltage connectors..
    • Same of battery Amps, and Temperature
  • Eliminated Charge Pump (May add back), will cap max field drive to a duty cycle of 99.6%

Click for larger, or see .PDF file in Schematics resource tab above


 Some new features include:
  • Isolated CAN Bus interface
  • USB built in, just as the BMS is.

 It still supports 12v .. 48v batteries and fields, independent of each other.  It also includes local voltage sampling (at the Alternator) for the purpose of early detection of load-dumps, as well as fall back modes in the case of a failure in the BMS CAN bus communications.

Note that it has an isolated CAN bus, I will be key for any high current device (ala, charging sources) - as the voltage drop over even large cables can be significant.  And when paralleling the small signal gauge wires using in CAN wiring, one could end up trying to carry several amps of ground loop current.  Isolation prevents this situation.

Going forward I may look again at the Power Supply - perhaps also changing out of a switching mode PS. - one of the challenges is there is a need to pass though voltages under 12v to allow the FET driver to work.  So, and power supply design has to work in two modes:  Buck as well as pass-though....




Thursday, September 18, 2014

Reviewing potential CAN protocols

CAN is largely the hardware used to connected different nodes.  On top of that there are oh so many 'protocols' which can be carried, Wikipedia has a few nicely listed here:  http://en.wikipedia.org/wiki/CAN_bus#Higher_layer_implementations


From a higher level protocol I am looking for the ability for the BMS to broadly do two things:
  1. Effectively communicate the current status and health of the battery it is managing.
  2. Provide information useful to external charging sources for better coordination.
#1 is the classic:  Volts, Amps, temp, Ah, SOC, etc.  But for some battery types, notably LiFePO4, would include High Voltage and Low Voltage warnings as well as alarms and cut-off / faults.  #2 contains some of the same items as #1, but extends to include desired charge states, target charge voltages and currents, etc.   There needs to be some way to address multiple charging sources, ones of different capabilities and a way to prioritize them (ala, let Solar do the final top-off charging as opposed to running the generator).   And these need to be usable for batteries deployed in a house-bank usage, contrasting directly to those deployed in Electric Vehicles.

Of the ones I have looked at (not totally in depth), here is what I have found out so far:

SAE J1939-xx

  •  Set of industry specific standard developed for many segments:  Transportation, industrial, etc.
  • Special interest J1939/75: Generator and Industrial
    • Portions of this have been adopted by NMEA-2000.
    • Includes some concepts of battery instance and Charger Instance
    • Support 10mV / 100mA resolution
  • Strong / well developed standard
  • Closed, and costly.

OBD-II Mode#22 (aka: SAE J2190)

  • Variation of J1939 / OBD-II designed for EVs.  
  • Widely adopted by EV community for their BMS / Charger communications
  • Includes concept of BMS directed charging sources! 
  • Vbat resolution is 100mV, way too coarse for house battery usage.
  • Closed, and costly.

NMEA-2000

  • Built upon J1939, DeviceNet, and others - with marine specific extensions.
  • Implemented by some marine equipment suppliers (notable Victron)
  • Very fred DC/Battery PIDs defined - Most venders augment heavly via priority extensions..
    • There is a LiFePO4 working group that has been established.
  • Closed, costly.

RV-C

  • Open standard, targeting RV industry
  • Includes house battery and charger concepts.
  • Also included Generator, Autogen functions.. 
  • 50mV battery voltage resolution. . . .
  • Has many characteristics inline with J1939, but not a related standard. 
  • May be open to accepting extensions as needed
  • Open and Free!

 

CiA  / CANopen

  • Wide support and deployment, mainly in industrial applications.
  • Includes modules targeting Batteries (CiA-418) and Chargers (CiA-419)
  • Support for 1mV resolution!
  • Can not locate any Generator functions...
  • Semi-open/closed:  Free to use spec, membership needed for changes.




Each spec brings somethings, from BMS coordinated charging, cabling specs, generator integration, etc.  But some common problems include insufficient battery voltage resolution, closed / expensive standards to support.  Of them, my current thinking is along these lines:
  • J1939:  May have all that is needed, but clearly not open-sourced. 
    • using it would likely pick up to a large part NMEA-2000 compatibility.
  • J2190: Has key concepts for BMS directed charging sources, but some problems:
    • Grossly insufficient voltage resolution for House battery voltages (designed around 70-300v banks)
    • Assumes simple charge then discharge usage.  Does not support simultaneous use/charge modes.
    • Does not support different sized chargers.
  • NMEA-2000:  really just a repackaged J1939 spec with DeviceNet connectors.
  • CiA:  Promising.  May need some 'hacked in' extensions to fully support needs - lacks Generator support and not sure how would do different charging source coordination.
  • RV-C:   IF changes are accepted, can have what is needed.  Plus free licensing / usage.

At this point, I am going to continue to dig into information around the J1939-75 spec, I have started working with the RV-C team on some ideas for proposed changes, and I will keep in mind CiA as well. 

Does anyone out there have any thoughts / insights into this topic???



Sunday, August 17, 2014

Initial draft hardware design

I have posted into the Schematic resource tab above a .pdf file with an initial cut of a hardware design for a battery monitor.  Here is a low resolution photo as well (Look to the .pdf file to be able to see it better).


Refer to .pdf file in Schematics tab above for higher resolution view





Some highlights of the design:
  • Based on the Arduino Uno - compatible with its boot-loader, IDE, etc.:
  • Embedded USB controller vs. using external Service Port attachment
    • Initial layout also has service port, as no way am I hand soldering a QFN28 package)
  • CAN controller w/parallel hardware ports - allows easy Daisey chaining of devices on the CAN bus.
  • Measured Volts with a 1.25mV resolution, and Amps to 25mA depending on external shunt value
  • DIP switches to select battery ID as well as preferred default charge profile
  • Two feature out ports which can drive cutout relays, cooling fans, etc.  Able to do PWM control for verifiable speed.
  • Usable for 12v, 24v, or 48v batteries w/no hardware change.
  •  Connects to external Amp Shunt, max 80mV - and external battery temperate 10K NTC probe
  • PCB is 50x100mm in size
There are two additional pins left on the ATmega uC, trying to decide if there is a use for a feature-in port...

The PCB is laid out to support horizontal connectors as shown, but can also be populated with vertical connects as well.  Much will depend on how the mechanical case plays out.  Another option is to just solder wires directly to the PCB.

As this will be powered 24x7, also want to pay attention to power down modes.  Might be a challenge in keeping the Arduino environment, but as firmware is looked at will see.  I am thinking of drafting up some firmware, perhaps based off the Arduino Alternator Regulator's code - and mocking up a unit using a Uno + proof board.  but will not be able to play with this until next month as I will be traveling back to our boat to attend some long needed maintenance of her.







Saturday, August 16, 2014

Installation

Goals

The Arduino Battery Management System is intended to act as the 'voice of the battery' in part of a complete system.  It will provide to anyone who is interested the following information via the CAN network:
  1. Current battery Voltage
  2. Current battery Current (in or out)
  3. Current battery Temperature
  4. High Priority messages when battery reaches high voltage limit, or from a high dV/dT event.
  5. Guidance to charging sources:  Target Voltage and Amp limit for battery charging
  6. SOC estimate, likely based on coulomb counting with reset at full SOC.

Features 1..4 are intended to reduce wiring clustering from multiple charging sources to the battery.

Feature #5 is the foundation that can be used to build a systems approach with all charging sources working well together in a coordinated fashion.

Feature #6 is kind of  a free-be, given the Arduino BMS will be doing most of this work anyway.

Other capabilities of the BMS will be based on optional wiring and attachments, including:
  • Cell based BMS fault loop - allows cell based BMS modules to indicate a limit of an individual cell has been reached.
  • Two 'Feature Out' ports which could be used for:
    • PWM variable speed cooling fan control
    • Last chance safety cutoff - disconnecting battery from bus if needed for protection.
  • 'Feature in' port which can be used for ????  (Just have an extra pin left over on the ATmega uC)

As this device will be action 24x7, care should be taken with power usage.  Example:  Placing CPU into various sleep modes between sample periods.



Hardware Overview

Software Overview

Ordering & Costs

Assembly