Barron Greig's MAX14920 Based Perfboard BMS

Batteries, Chargers, and Battery Management Systems.
Post Reply
User avatar
battman   1 W

1 W
Posts: 54
Joined: Jan 13 2010 10:27pm
Location: Tempe, Arizona, USA

Barron Greig's MAX14920 Based Perfboard BMS

Post by battman » Jan 25 2015 5:36pm

Hi Folks,

Motivation for this project was similar to the MAX11081 BMS I put together last year (http://www.endless-sphere.com/forums/vi ... 81#p849127), namely bad experience with commercial BMS and looking for something simple enough that I could build and tinker with.

The MAX14920 based BMS presented here is cheap (about $50 in parts for a 12 cell implementation), relatively simple to build and has the following features:
  • HVC (accuracy 0.01V)
  • LVC (accuracy 0.01V)
  • Open-wire detection
  • Balancing
  • Stackable
  • Semi-automatic configuration
  • BMS Data Uploader
Since it's controlled by a Picaxe, behavior is highly customizable. Current draw is 0.22mA quiescent and 1.2mA during discharge, i.e. vehicle operational.

The BMS Data Uploader displays BMS configuration and cell voltages on a PC via the Picaxe serial cable. WARNING!!! Not isolated!!!

Corrections, suggested improvements etc. all welcome. I'm a software engineer, so input from electrical engineers would be good, especially if there are safety related concerns with any aspects of the project.



Main Board
main_board (800 x 450).jpg
Main board
main_board (800 x 450).jpg (124.5 KiB) Viewed 2442 times
Mouser Project:

http://www.mouser.com/ProjectManager/Pr ... dc4e5c0df4

In addition to the parts listed in the Mouser project, you will need:
  • Picaxe 18m2+. I used Sparkfun
  • 64 Pin .5 mm (10x10) QFP to 600 mil DIP Adapter. I used ezprototypes.com
  • N.O. momentary pushbutton switch. I used Radio Shack
  • 3.5mm stereo phone jack. I used Radio Shack
and if you don't have one, then you'll need to beg, borrow or steal an AXE027 USB-to-serial Picaxe programming cable. Since I built this BMS, I have noticed an apparently better QFP adapter from SchmartBoard (part number 872-204-0018-01) available through Mouser. It's several dollars cheaper than the one I used, it has a hole in the middle that should allow decent heatsinking (important for being able to balance as many cells as possible simultaneously), and will also save on shipping costs if the other parts are being ordered from Mouser at the same time.

Picaxe Source Code:

http://sourceforge.net/projects/max1492 ... upervisor/

Perfboard Layout:
cad_max_14920_bms_main_v1.2.pdf
Main Board Perfboard Layout
(126.03 KiB) Downloaded 180 times
Schematic:
_max14920_BMS.jpg
Main Board Schematic
Configuration:

Pressing the USER_CMD momentary switch for more than four seconds, then releasing puts the BMS into configuration mode. It auto-detects the number of connected cells and auto-selects cell chemistry (and hence suitable LVC and HVC values) from average cell voltage. I was just playing around with this idea and might just change this to manual selection at a later date. Then it flashes the user to manually select the charge mode; terminate charge on first cell HVC, or balance cells at end of charge. Then open wire detection is performed. The full sequence of interactions goes like this:
  • Press USER_CMD for > 4 seconds.
  • CHG LED flashes N times for N connected cells. If no cells are detected (could happen if end connections are OK but intermediate taps are messed up), solid CHG and BAL LEDs are displayed for 8 seconds.
  • 4 second pause.
  • Balance LED flashes rapidly indicating user must select charge mode.
  • Press USER_CMD for <= 4 seconds to select first cell HVC mode, > 4 seconds to select balance mode.
  • If first cell HVC mode is selected, then CHG LED is displayed solid for 1 second. If balance mode is selected then BAL LED is displayed solid for 1 second.
  • Open wire detection is performed. If an open wire is detected, then CHG and BAL LEDs are flashed together X times, where X is the number of the cell where an open wire was detected. This flashing occurs at 15 second intervals until USER_CMD is pressed to continue. After this is pressed, or no open wire was detected, configuration is considered complete.
Notes:

The two main sources error on reading a cell voltage are the 10 bit accuracy of the Picaxe ADC and the MCP606-I/P voltage divider/ voltage buffer circuit. If a maximum of 4.05V is sufficient for a particular implementation, for example, if only using LiFePO4 cells, then the voltage divider circuit may be eliminated. The K_CELL_V*** voltage constants in the Picaxe code will then need to be adjusted along with the Cell.adcToVoltageScaling constant in the BMS Data Uploader Cell.cs C# file.

The MAX14920 flows an internal balancing current of 10mA per cell that is being balanced. I had been unable to successfully heatsink the MAX14920 using the EZPrototypes QFP adapter in this perfboard implementation, so I have limited balancing to a maximum of 4 cells simultaneously. Balancing current is about 0.25A with the BS170 mosfet and 15R resistor combination. Higher balance currents are possible with different transistor and resistor selection. The transistor should be a logic level N-channel FET. Higher balance currents may warrant reduction of the Picaxe constant K_BLEED_CHARGE_SECONDS. If balancing is not required then the balancing resistors and transistors can be eliminated from the build. Note that since I did this build, I found a better adapter from SchmartBoard that is both cheaper and makes decent provision for heatsinking. The EZPrototypes adapter can't even be drilled under the location of the chip's ground pad because they placed traces right at that location on the underside of the adapter - bad design.

The MAX14921 chip could be substituted for the MAX14920, an appropriate 600mil adapter obtained for it, and the perfboard extended a bit and then 16 cells could be managed by a single board ... with two important caveats; a) both chips have a maximum voltage rating of 65V, so it would be tough supporting LiPo since 16 of those cells in series would exceed 65V unless you were prepared to be very conservative with maximum cell voltage, and b) maximum power dissipation of the MAX14921 is curiously lower than the MAX14920, so you'd be able to balance even fewer of them simultaneously!

With the Picaxe clock speed at default 4Mhz and 12 connected cells, then LVC is checked for all cells about 4 times per second. If this isn't fast enough, then the Picaxe clock speed may be increased, but note that some timing values in the code will need to be altered (any related to 'pause' or 'time' in the code) and that power consumption will increase. Doubling clock speed to 8Mhz sees an almost doubling of current consumption from 1.2mA to 2.3mA but does also allow 8 checks per second. Increasing clock speed massively, e.g. to 32Mhz, may result in other unwanted effects showing up, possibly due to parasitic capacitance in circuit or additional timing requirements in the code such as when switching between sample and hold phase on the MAX14920.

Building and Testing:

Start by adding the Picaxe and associated 10K, 22K resistors and 3.5mm stereo phone jack. Temporarily power this from a supply somewhere between 3 and 5 volts. Now verify correct Picaxe operation by attempting to download a short program to it, e.g. Just a single line “b0=0”.

Add the QFP to 600 mil DIP Adapter to the board and solder the MAX14920 chip to it. Make sure none of the chips pins are bent. One of the chips I received had one corner pin bent and touching another. This tiny SMD part, bristling with pins, looks a little daunting to solder at first. There are good videos on youtube on how to solder SMD parts and it really isn't that bad. Tools I found helped were a magnifying glass, a flux pen and solder braid to clean up any solder bridges. Go over each pin with a multimeter and make sure adjacent pins aren't shorted and that all pins are electrically connected to the corresponding adapter pins. If you are using an adapter from a source other than EZ prototypes, the chip to adapter pin layout could be completely different!

Now add parts to allow minimal operation of the MAX14920. Do not add balancing circuitry yet. Do not add connections between the MAX14920 and the Picaxe yet. Add all the cell taps. Connect cells to the lowest 3 taps and short all the other cell taps together and then short that group to the +ve of the 3rd cell. The MAX14920 should now power up correctly. If it does, there will be 5V at the VA pin.

Add the MCP606-I/P and voltage divider resistors. Do not connect the 5.62K divider resistor to the AOUT pin yet. Connect the CHG and BAL LEDs and the USER_CMD button to the Picaxe. Upload the supplied test_voltage_measurement.bas code to the Picaxe. Connect a known voltage to the AOUT end of the 5.62K pin and connect the ground of that voltage to the AGND side of the 100K resistor. Follow the instructions in the Picaxe basic file and verify voltage measurements are read correctly.

Add all remaining parts except the cell balancing resistors and transistors. Ensure the SPI connections have been made between the Picaxe and the MAX14920. Use the supplied test_input.bas and test_output.bas to verify correct opto-isolator operation.

Add the balancing circuitry and cells to the remaining cell taps so the BMS is operating at full voltage. Upload the test_balancing.bas program. Run the BMS Data Uploader program on the PC, ensure the Picaxe AXE027 serial cable is connected between the PC and BMS and set it to upload data from the Picaxe. Press the USER_CMD button and verify cell balancing is occurring on the cell that is displayed yellow in the BMS Data Uploader. If a cell is balancing correctly, then there will be an approximately 0.5V drop across the balance resistor. An alternative measurement that avoids placing voltmeter leads near the live circuitry and causing an accidental short is to use an IR thermometer placed close to the balance resistor. There should be a temperature rise of several degrees Fahrenheit.



Charge Control
charge_control (800 x 450).jpg
Charge Control
charge_control (800 x 450).jpg (80.11 KiB) Viewed 2442 times
Mouser Project:

http://www.mouser.com/ProjectManager/Pr ... f2f9ad0c8f

Perfboard Layout:
cad_max_14920_chg_control.pdf
Charge Control Perfboard Layout
(228.45 KiB) Downloaded 93 times
Schematic:
ChargeControlSchematic.jpg
Charge Control Schematic
ChargeControlSchematic.jpg (56.67 KiB) Viewed 2386 times
Notes:

Charging currents of up to 15A are possible with no additional heatsinking on the PSMN5R0-80PS. The circuit is good for 12V-72V as-is. Different mosfets and resistances will be required for charging at higher voltages than that.

PSMN5R0-80PS are configured in an "SSR" like configuration to ensure that current cannot flow from the battery back towards the charger when charging is disabled. Zener D1 and R3 ensure that a maximum of 18V is applied to the PSMN5R0-80PS gates when CHG_EN is enabled. Maximum will actually be a little less than 18V anyways due to the voltage drop across the CHG_EN LDA111 opto-coupler output. When ALL_CELL_BAL is enabled, this overrides CHG_EN and disables charging. The selection of resistor R2, R3 and R4 values ensures this strong pulldown behavior. CHG_EN could be used to control charging without ALL_CELL_BAL (with some changes to the Picaxe code) if only a single BMS board (no stacking) is used, or if the charge mode is set to stop when the first cell hits HVC. But for a stacked configuration with balancing, individual boards cannot disable charging completely. Their ALL_CELL_BAL outputs are 'anded' together to only completely disable charging when every module has finished balancing all it's cells.

Testing:

To test the charge control circuit, connect a power supply of between 24 and 72 volts to the charger inputs. Connect a voltmeter to the charge control circuit outputs. Call the power supply voltage V+ and call a low floating voltage somewhere in the sub 1V range, Vfloat. A correctly functioning charge control circuit will conform to the following table.
ChargeControlValidation (456 x 224).jpg
Charge Control Validation
ChargeControlValidation (456 x 224).jpg (18.85 KiB) Viewed 2386 times


BMS Data Uploader
DataUploader.png
Data Uploader
DataUploader.png (40.15 KiB) Viewed 2353 times
Warning!!!! There is no voltage isolation between the BMS main board and the PC when connected by the AXE027 USB-to-serial cable in this implementation.

The traffic light icons have tooltips describing the associated color. A hollow white circle is in-active/ not charging. Red is charging. Yellow is balancing and green is fully charged.

To upload data, connect the Picaxe serial cable to the PC and BMS. Start the program, select the serial port and press 'Upload'. Then either press the USER_CMD momentary pushbutton for less than 4 seconds. A single dataset will be uploaded. Alternatively, connect a charger and start charging. Uploads will be sent continually to the PC indicating charging progress.

C# Source Code:

http://sourceforge.net/projects/max1492 ... aUploader/

The free version of Microsoft Visual Studio, Visual Studio Express, may be used to build the BMS Data Uploader. I used Visual Studio Express 2013.



Stacking
cad_max_14920_bms_stacking.pdf
Stacking
(70.83 KiB) Downloaded 116 times
Let me first get off my chest that I haven't had a chance to test the stacking capability yet. Whew, feel better now. Modules are stacked by:
  • ANDing ALL_CELL_BAL outputs
  • ANDing CHG_EN outputs
  • ANDing CHG_CON
  • Oring LVC SIG outputs
  • ORing LVC 5V inputs
How many modules can be stacked?
I think there are at least three limiting factors involved:
  • LVC 5V current that is available.
  • "Diode" voltage drop from ANDed CHG_EN outputs.
  • Isolation voltage of LDA111 and LTV817 opto-isolators.
Often, the LVC 5V current will be taken from the controller 5V throttle output (which is actually 4.4V if an Infineon controller is used). Your mileage may vary on this one. If we assume that we don't want the base voltage of the turned on charging mosfets to be less than 10V, then that would lead to a stack limit of 11 modules. The optos have isolation voltages in the multiple thousands of volts, so this appears not to be a factor here.

These are just some initial thoughts, my electrical knowledge is feeble enough that there are likely other factors. At some point I'll get round to building a small stack just to make sure the basic operation matches what I designed.
Last edited by battman on May 02 2015 3:27pm, edited 25 times in total.
Ninja 250: http://www.evalbum.com/3433
Giant Sedona DX Mountain Bike: http://www.evalbum.com/4640

User avatar
mwkeefer   10 MW

10 MW
Posts: 2263
Joined: Jun 14 2009 8:47am
Location: Malvern, PA USA

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by mwkeefer » Jan 25 2015 5:38pm

Ugly as SIN but with a bit of work, you have something there - heck functional BMS on Perfboard alone is impressive.

Let me know if you want any assistance with either the windows or MCU side of the coding, or if you want some help in CAD designing an appropriate and much more compact design now that you have the working basis perftotype.

-Mike
Regards,
Mike

{My Rides]
2010 Dahon Jack - GNG v1 - LYEN 6FET - 20/40A - 18S2P10AH - Nom:66.6v,1332w
2004 Hard Rock Pro Disc - Recumpence ms eDrive v4 - Astro 3220 4T - 12S2P16AH - HV110 - Left Side Drive - Gearing: 38mph
Nominal Peak Power @ 60 seconds: 5328 watts - Maximum Power: 49.8v, 120A, 5872w
2010 Downtube 8FH - Stock GNG v1 Stock Controller - EB809XC - 12-16S
2012 Downtube Nova 7spd - Stock GNG v2 - 12S2P10AH - EB809 - 12S-16S - 20A/30A,Nom VCC: 44.4, 888w

User avatar
battman   1 W

1 W
Posts: 54
Joined: Jan 13 2010 10:27pm
Location: Tempe, Arizona, USA

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by battman » Jan 25 2015 5:56pm

mwkeefer wrote:Ugly as SIN but with a bit of work, you have something there - heck functional BMS on Perfboard alone is impressive.

Let me know if you want any assistance with either the windows or MCU side of the coding, or if you want some help in CAD designing an appropriate and much more compact design now that you have the working basis perftotype.

-Mike
Ha, yes it is ugly. Maybe a coat of paint would help? :lol:

I'm done with the initial version of the windows and MCU coding, links to the source code for both are in the post. But I'm still open to bug fixes/ improvements of course.

I may take you up on your very kind offer of help developing a more compact design, particularly if there is sufficient interest in this BMS. I'm not looking to make any money on this, it would just be nice to see it used in something other than my own projects. I'll wait and see if any feedback comes through on things that need fixed and if/ when the design seems stable enough, a proper compact board would be good to see. Thanks again for your offer of help.
Ninja 250: http://www.evalbum.com/3433
Giant Sedona DX Mountain Bike: http://www.evalbum.com/4640

User avatar
mwkeefer   10 MW

10 MW
Posts: 2263
Joined: Jun 14 2009 8:47am
Location: Malvern, PA USA

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by mwkeefer » Jan 25 2015 7:21pm

battman wrote:
Ha, yes it is ugly. Maybe a coat of paint would help? :lol:
Paint, how about Duct Tape :) 1004 uses and counting :)

No really if it's a functional design you should be proud... once the roadworthyness and any further hw/sw bugs are addressed and it's 100% stable, sure I'll cad up some PCBs and BOMs for various cell counts and if I have any manufactured (PCBs) - I'd offer them at cost to everyone obviously...


Still there may be a few features I'd like to plumb into that code base - I've not had a ton of time today so I will pull down your code and go through it later this evening.

-Mike
Regards,
Mike

{My Rides]
2010 Dahon Jack - GNG v1 - LYEN 6FET - 20/40A - 18S2P10AH - Nom:66.6v,1332w
2004 Hard Rock Pro Disc - Recumpence ms eDrive v4 - Astro 3220 4T - 12S2P16AH - HV110 - Left Side Drive - Gearing: 38mph
Nominal Peak Power @ 60 seconds: 5328 watts - Maximum Power: 49.8v, 120A, 5872w
2010 Downtube 8FH - Stock GNG v1 Stock Controller - EB809XC - 12-16S
2012 Downtube Nova 7spd - Stock GNG v2 - 12S2P10AH - EB809 - 12S-16S - 20A/30A,Nom VCC: 44.4, 888w

ChrisPRoberts   1 µW

1 µW
Posts: 2
Joined: Apr 29 2016 1:38pm

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by ChrisPRoberts » Apr 29 2016 1:55pm

Hi Barron,
I'm new to the forum, in fact I registered after a lot of reading and coming across your project made me register to comment.
I want to say how fantastic it is that you built such versatile BMS in such a simple no fuss way.

My hat off to you sir!

Edited for correct name

2alexsky   1 µW

1 µW
Posts: 3
Joined: Apr 05 2015 3:58pm

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by 2alexsky » Jul 31 2016 1:49pm

Hi Barron,

First off, I'd like to say wow! This is really amazing! You inspire me to document my projects for other people to try to replicate as best as possible.

I really want to start by recreating your project, but with a MAX14921, just because I'm using 16 Lifepo4 at 3.3v a piece. I had a couple of thoughts that I wasn't able to find any answers to.
Due to the size of my battery pack, I would like to make a bms stack. Have you had a chance to try it out?
The other question relates to the charging current. I want to be able to charge at least at 10amps continuously per stack. Do you think that would work here?

Also, any thoughts on using an Arduino instead of the Picaxe? I can't seem to find anybody that has tried the MAX14920/1 with any Arduino.

I'm in the process of ordering everything, and hopefully start assembling and troubleshooting everything soon. Again, thanks so much for taking the time to post this.

-Alex

User avatar
flangefrog   1 kW

1 kW
Posts: 368
Joined: Jun 26 2013 10:21pm
Location: Auckland, New Zealand

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by flangefrog » Jul 31 2016 7:46pm

2alexsky wrote:Also, any thoughts on using an Arduino instead of the Picaxe? I can't seem to find anybody that has tried the MAX14920/1 with any Arduino.
I've used the MAX14921 with an Arduino - see here: https://endless-sphere.com/forums/viewt ... 14&t=79389 I can post the code I used if you want.

User avatar
endlessly_ending   10 W

10 W
Posts: 82
Joined: Apr 27 2013 3:17pm

Re: Barron Greig's MAX14920 Based Perfboard BMS

Post by endlessly_ending » Dec 02 2016 2:00pm

flangefrog wrote:
2alexsky wrote: I've used the MAX14921 with an Arduino - see here: https://endless-sphere.com/forums/viewt ... 14&t=79389 I can post the code I used if you want.
I for one would highly appreciate that!

Post Reply