PDA

View Full Version : BMS based on ltc 6804 and arduino



tomdb
15 September 2015, 1259
This thread will document my progress on my personal project for creating a BMS system based on a LTC6804 in combination with an atmega328p-au

Current Status: Beta testing/ Onhold

6737

Schematic

Microcontroller, the atmega328p-au, This one is chosen because of its possibly to be programmed via the arduino language. Right now I feel the most comfortable programming in this, plus its very well documented. However in future iteration I would like to look into having a micro with integrated canbus controller.

Can controller, MCP2515, this one is chosen because of its proven track record and ease of use with the arduino language.

Cell voltage readout, here i chose for a dedicated chip the ltc6804-1, this removes the complex circuits needed for high voltage isolation and accuracy maintenance. This however this comes at a price of 1.3 euros per cell, seeing the added ability this is taken for granted. The biggest downside however is the availability of this chip, I have 4 chips to test with, one is already in use. Once one circuit is proven to work I will have to look into sourcing them direct from Linear.

Power , using the LTC6804 chip there is a choice to convert the measured voltage down to a stable 5 volts for powering the micorcontroller side of things. However this option is not chosen, it brings with it a higher current draw during sleep mode (or power off), instead the power is fed in via 12 volts and converted to 5 volts then isolated for the microcontroller side. This allows the 12 volts to be removed, by and external microcontroller, in case of system shutdown. This gives you a high voltage drain of below 3 micro amps, which is ideal for projects that remain stationary for along time.

Communication, For the communication between the slaves and the rest of the system I chose for a can bus system due to its robustness and ease of programming and use. Plus the ability to use off the shelf components to read out data.

Price Looking at my bom list setup for amounts of 25 I get a cost of around 27 euro per board, 2,25 euro per cell, which is very acceptable this level of monitoring.

PCB design

6739

This is my first pcb design I am having made for me. So i hope this goes well. there are two high voltage connectors, one for the cell voltages (single row) and one for the balance board add-on (dual row). This is done so the size for the balance resistors and transistors can be decided dependent on the battery pack.

6740

Software As a basis i will be using the library written by linear themselves, this has proven to work on my breadboard.

The LTC6804-1 provides the following variables for the micro over an SPI bus;



12 16 bit cell voltages
5 12 bit auxiliary voltages
12 cell discharge controls


These will be used to manage the cells on the slave board, according to the set parameters.

The LTC6804-1 does not automatically switch on or off the discharge resistors, these will be controller by the bms slave board micro. This will allow the programming of balance set points.

Once the bms micro has gotten the data from the LTC6804 it places the following information on the canbus, after boot up.

Cell voltages
Aux voltages
Discharge switches
Status, containing opmode and errors


The following op-modes have been defined;

Boot, during initialization after power on checks all cell levels on discharge possible
Standby, nearly no system discharge; charge and drivetrain off
Drive, drivetrain engaged, main task is to monitor high and low voltage errors and temperatures (aux voltages)
Charge, monitor overvoltage and cell drift and temperature


Right now I am planning on spacing the canbus messages from the BMS-slaves in such a way I could have 25 boards on one bus without causing message conflicts, this would give me room for 300 cells in whatever configuration desired. Also the message latency will be minimal.

The "Master" micro will collect the data from all the slave boards and monitor the complete pack variance, under/over voltage signals. These trigger points will be set via can messages dictating charge balance voltage (so you can balance at any desired voltage), under/over voltage (in order to protect the cells). Also these variables can be set for the aux voltage to trigger over temp signals. However the canbus transmitted data will be as raw as possible so any sensors can be used without reprogramming the slaves. My goal is to get the slaves running with as low a calculation load as possible, just total voltage and voltage delta and error handling.

PCB's should arrive this week, which means I can start ordering parts and compiling some code. :eek:

If you have any idea's that you would like to contribute please do.
Note: this is not meant as a discussion about having a bms or not...

Jonny Panic
15 September 2015, 1742
Fun! Keeping a keen eye on this one.

tomdb
17 September 2015, 0852
PCB's arrived, time to get testing the boards. Also a good excuse to build up my reflow oven with ofcourse an arduino brain.

6743

Also orders placed for the components I do not have on hand. Now its waiting time.

kingr
27 September 2015, 2244
Good project to tackle! Will keep my eyes on this one

tomdb
06 October 2015, 1244
Got the it reflowed, now time for testing and the programming. ;)

6761

tomdb
07 October 2015, 1341
Update 7 oct. 2015

Found two flaws, one "broken" trace, turned out to be my own dumb fault accidentally deleted a signal in the schematic, so the board isolated the trace from the pad. Fixed with a lil scratching and solder.

Bootloader burned after a few attempts, due to inexperience. However once the bootloader was on the chip seemed dead. Turns out that the ATmega328 require VccA to be hooked to 5v olts for it to work with the bootloader,

Updated my pcb in eagle, botched the board and it works. This means with a simple serial connection and ftdi-usb I am able to program. Got to finish soldering on the canbus connectors and the DC-DC converters and then the real testing can start.

tomdb
12 October 2015, 1322
Had some set backs, got alot of noise on the SPI bus, I will have to rebuild the whole pcb. Rerouted the SPI bus for noise reduction and got some pads for pull up resistors and probing.

So kind of disappointing, however a very great experience in pcb design and trouble shooting.

tomdb
12 October 2015, 2316
New PCB's ordered. Now i can cannibalize the built pcb to test the separate parts .

Update 13-10-15 : Got the SDO SDI, MOSI, MOSI, SO, SI messed up on the LTC6804, this is why i was seeing the strange behavior.

Lesson learned, always look over you schematic after a week of doing something else before commencing a pcb. Lucky pcb order was not processed so updated the board en resent.

Guess this will teach me to think it all works, now some software making with a breadboard build up.

tomdb
16 October 2015, 1355
My code is coming along nicely on my bread board setup.

The "slave" arduino setup nicely listens to the "master" arduino over the canbus and tells him the voltages when requested. ;)

Now its just down to setting up and programming a state machine for both.

tomdb
08 November 2015, 1534
Got my new pcb's last week. Built it up to working with the isolated can-bus section. some solder connections were not the best, so some troubleshooting was required.

However this means, i can finish populating the board with my second to last LTC6804, lets hope this goes well. Then i can flash my program from the bread board setup and get to some real testing.

If all goes well, I will have to put an order in for the LTC6804's at something like 13 euro's a piece. So stay tuned for some updates this week.

PFox84
08 November 2015, 1557
I'm very interested in your arduino code for CANbus. I have some familiarity with the Arduino environment, but haven't yet started integrating CAN into it yet.

tomdb
09 November 2015, 1506
Some progress, got the ltc6804 part of the board working fine.

The canbus however is somewhat intermittent, got to be a gremlin somewhere near the opto-couplers. Tomorrow i am going to setup my scope to dig deeper.

tomdb
10 November 2015, 1441
Got it working for a brief period, something is quite funky in the canbus region. Some more searching required. However you guys might be interested in my current test setup; Got an arduino function as BMS master with an nextion display from itead function as interface.

The serial output displayed is from the bms slave, so each of the cell values. However soon after the canbus did not work again.


https://www.youtube.com/watch?v=70oL30spqMA

Nuts & Volts
11 November 2015, 1748
Looks great. Following with interest. The display looks very nice


Sent from my iPhone using Tapatalk

tomdb
14 November 2015, 0915
Done some more diagnostics, both software and hardware. It works :D

I can send the command from the touch screen over canbus to the bms slave and get my voltages back.

Now time to start building the true software, using a state machine. This will be done to implement different operating mode with different tasks/frequencies.

tomdb
23 November 2015, 1248
Two updates:

Software: The "master" arduino now runs as a state machine calling up tasks according to a scheduler. This means realtime refreshing of the touchscreen (the output for now) and calculating all pack values.

Hardware: Was building up too many vacation days at my day job, so took today off and backed another slave board. In one go this time, flashed in one go also. So I am quite pleased how it is all going so far. This means two can run in series for a 24s test system.


To-do

Software: Implement the state system for the BMS slave software;

Create checks
Temperature probes readouts
Define operating states and tasks
Decide on node ID assignment strategy


Hardware: I salvaged the LTC6804 off my first pcb, need to clean it up and see if i can build another slave board with it. This would help quite alot, with a 36s system I can run my a123 amp20 packs two in series (17x2 = 34) And then do some real testing (possible vehicle build)

Order something like 20 new ltc6804's will cost me around 350 dollars, so a big step but well worth it believe. Right now in small quantities my total pcb runs at 30 euro's, that means 2.5 euro's per cell. If i do start my purchase for the LTC's I will get a new run of PCB's with room for serial numbers and a paste stencil.

68146815

tomdb
01 December 2015, 1347
My bank account got alil lighter. Purchases so far:

-12 more mainboard pcb's
-12 balance boards (new design, just two resistors and a mosfet per cell)
-SMD stencil for the mainboard, got so tired of doing it by hand

-20 more LTC6804's this was the biggest expense lets hope they arrive soon. :cool: confirmation on shipping 1-12-2015

Update:

Better get more of my software sorted and my a123 packs prepped now that I know my LTC6804's are going to be here this week.

tomdb
14 December 2015, 1455
Got some parts in.
The ltc6804's are in got hit with an import tax tough. :( forgot about that bastard.
Also got my stencil in, will probably try it out next week. Should right now have enough parts to build one more board.

Currently hard at work on programming this puppy. Got my "BMS master" running with two screens and a few simple extra info parameters.

Highest cell
Lowest cell


This way I can monitor my test setup with one pack.

On the slave side;

Serial setup commands
Real time operating system
Can bus definition
Can command


This now allows me to flash all the boards with the same software and later change their ID's using a simple serial command, plus read out the current set parameters.
Also all the canbus messages are programmed in. (if anyone is interested in the programming or canbus message build up message me, forum wont allow pdf's above 20 kb.)

Still pondering on what other parameters to set on the fly beside high and low voltage limits. (the high voltage limit will also work as the balancing set point, so set point below the high voltage limit as the balancing target.)

Skahle
02 January 2016, 2109
My bank account got alil lighter. Purchases so far:

-12 more mainboard pcb's
-12 balance boards (new design, just two resistors and a mosfet per cell)
-SMD stencil for the mainboard, got so tired of doing it by hand

-20 more LTC6804's this was the biggest expense lets hope they arrive soon. :cool: confirmation on shipping 1-12-2015

Update:

Better get more of my software sorted and my a123 packs prepped now that I know my LTC6804's are going to be here this week.

Why did you buy so many 6804's? Seems like 3 would do.

I used a pair of Freescale MC33771's (14 cells each) with a MC33664 isolated comms board which could plug onto an Arduino in a pinch, but I chose the FRDM25Z dev board to get an ARM processor. Then added a STM32F4 dev board with a plug-on 3.2" TFT color LCD as a display head. RS-232 between FRDM25Z and the ST display head in ASCII for easy eavesdropping. Similar idea to what you've created but I used all eval boards so I did not have to spend the time and money to spin one.

I've used a ton of Atmegas in products, but I do like the flexibility and performance of the M4's and I don't like the dev environment of the Arduino sketches.

You are doing great and you've learned a lot!

tomdb
03 January 2016, 0519
I bought that many IC's because I right now have 12 modoules of 17s cells, this would give me 204 cells to monitor (in two packs that is). Plus I have enough plans for multiple conversions/packs so I need a few slave boards. With the boards I can make now I could theoretically monitor 264 cells.

Still working on all the software/ components. Designing a Vehicle master/BMS master with 3 canbus lines HV monitoring and contactor control.
The three canbuses for; The BMS slaves, Charging (Onboard / Chademo) and the last for vehicle interface.

Got something I want to try out for contactor control and precharging, will post some more once I made a few boards and tested it.

tomdb
29 February 2016, 1133
Another set back, this time again pcb troubles. Turns out they want the Vref1, not allowed to be used still to be capacitieve coupled outside the chip. Need to add two caps to solve this.

However the software works, but gives wrong values due to the missing caps.

update: new boards order, loss of 30 dollars worth of pcb, plus some components. I will salvage as much as is reasonable from the three old pcb's. Made the changes in a way that I can still use the solder stencil.

Lets hope this is the last design revision before a installation on a actual battery pack.
Good thing I view this as a learning experience so the few bucks here and there do not bother me too much.

Spoonman
01 March 2016, 0713
Tough break, but sounds like great progess on the whole. Good job.

tomdb
01 March 2016, 1050
Been a little distracted working on cracking oem inverters and getting a brushless motor from a hybrid working. Also got a charger from a Opel Ampera/Chevy Volt, which I can canbus control.

So got myself nearly a complete vehicle with canbus control. :D Now just the vehicle.

tomdb
05 April 2016, 1348
An update:

Got my time per board now down to roughly 1.5 hours for the total soldering time. Due to my stencil.

It flashed the bootloader fine, then uploaded the software.

All thats is left to check is the canbus side of things and then to test out the additional caps. This should be done tomorrow. If all goes well I know what im doing this weekend.
Got roughly enough stock of components to make atleast 5 more boards.

Besides making progress on the boards I got distracted by my DIY inverter build, have to get the test motor ready for mounting on a small self build electric moped. Besides this build im also working on an even larger BLDC motor for which I have to make a casing so a long term project. Also got a little carried away and am now building an semi automated spotwelder using my diy transformer spotwelder using pneumatics to control the force.

As for the BMS side of things, if the testing goes well I will build my first test pack of 68 cells with 6 slaves monitoring them (due to module sizes). This way I can write bms master software that can control the charger and balancing.
This is due to the fact that the Volt/Ampera charger will need atleast a set point of 200V to have a self shut-off feature.

tomdb
07 April 2016, 1017
Update;

Its alive and well. Yesterday I only had 30 minutes of tinker time. Resulted in a slight depression, the isolated canbus side did not work however the LTC6804 was working perfectly. Only component that was from a different vender or exchanged were the optocouplers. Scoured the datasheets turns out there is a slight difference in voltage reaction. So that should not be the problem. Pondered quite sometime at work, ordered some just incase optocouplers.

Turns out after some more troubleshooting, measuring the working canbus on the old board with the not working on the new one. Signals correct everywhere except the TX pin on my transceiver was a cold joint. Even my digital multimeter measured no connection. Little solder application and she chooches like never before.

So tommorow evening Ill get all my parts sorted and organized so I can decided how many board I can make/want to make now. Should have enough parts for 5-6 units. Will get some video once I get one more board made and a little test setup.

tomdb
10 April 2016, 1110
Batch of 3 more boards is done.

I believe that doing them more then 3 at once will result in a too long worktime for the solderpaste. Towards the end of component placement it was already becoming quite dry. However my turn-around time per board is now roughly one hour, starting with solderpaste application through component placement smd reflow, mounting the through-holes and finally troubleshooting and programming the chips.

6949

This means I can start testing of two of my 17s A123 amp20 modules in series. I will start with writing some code for the temporary arduino master to control the "balancing" (point of shunting) voltage and will use the internal transistors of the ltc6804 to start by driving some leds. Got add-on boards made that can shunt more current with separate transistor per cell.

During testing I might start to run into the issue of an Arduino Uno has too small of an overhead to function as a master. Will be switching to a Teensy 3.1 later but might need to rig up a temporary board to get through testing the slaves.

tomdb
11 April 2016, 1042
Regrettably one of the boards is quite dead on the canbus side, very strange. Will hook up my oscilloscope tonight to measure the spi bus and the canbus signals. Lucky I got three working boards which are the number needed for 2 series 17s modules. So i can start to do some 100v+ testing.

Update:
Scoped the board, after ofcourse trying to rush it using my multimeter and guessing. Turns out after replacing the canbus controller mpc2515 and the transciever (wrongly so) nothing was fixed. Got bummed out, it was late yesterday. So said screw that ill look at it tommorow.

Got my scope out checked the spi bus, thaught i saw capacitance, so to double check it check a known working board. Same rise time. Damm not it.Checked the crystals, not it.

Started checking the optocouplers. Transmit side not it, was seeing signals on the canbus so yea go figure. Measuring the recieving side opto, transiever to opto measured fine. Opto to controller, nothing.

Shit, it was the opto all along, maybe i fried it during reflow.

So the leason here is, have fait in your layout if some boards work and some dont.
But most import, a multi meter is good for voltages, but for signal always use a scope. (best 400 euros spent so far on electronics)

tomdb
14 April 2016, 1359
Update.

It looks like i got a winner this time. Messed around with my code some more. Wrote an dumb program to blast the control can message that the master generates on the canbus. Built a setup using an arduino with canbus shield, measuring a potiometer converting the value to my desired shunting voltage and inserting it in to my control message.

Then tweaked the slave code with some more debugging lines and some fine tuning of the states. Inserted a led and resistor between the headers ment for the balancing add-onboards. And turning the pot made leds turn on and off. The test pack is not exactly balanced so this was a good scenario to test. Now I can populate the balance add-on boards and have a slave board run to balance a 12s section of the pack. With me monitoring the serial data ofcourse.

Seems that I will be needing a compentant bms master soon, then comes the fun part of writing a suitable coulomb counter / voltage curve SOC algorithm. Planning on making it three step;

Threshold voltage for low range (so reset to a fixed low value once number of cells dip below this voltage, and then decline with the voltage)
Mid section above the threshold voltage in which coulomb counting is used to derive the SOC (need to figure out if an inductive sensor is good enough for this)
High section above a set threshold (same as the low section, once certain amount of cells pass this voltage SOC is reset to a value and then rises with the voltage)

Guess im at the stage where I am willing to share my pcb's and code if anyone is interested. However no guarantees on fault free functioning and ofcourse some assembly required.

SplinterOz
14 April 2016, 1446
...
Seems that I will be needing a compentant bms master soon, then comes the fun part of writing a suitable coulomb counter / voltage curve SOC algorithm. Planning on making it three step;

Threshold voltage for low range (so reset to a fixed low value once number of cells dip below this voltage, and then decline with the voltage)
Mid section above the threshold voltage in which coulomb counting is used to derive the SOC (need to figure out if an inductive sensor is good enough for this)
High section above a set threshold (same as the low section, once certain amount of cells pass this voltage SOC is reset to a value and then rises with the voltage)


Great news. I know I for one would like to have a look at the coulomb counting code and logic, I would also be really happy to help test and debug that part o f the project.

tomdb
14 April 2016, 2331
You built any kind of coulomb counter before? Right now just doing some research into how accurate do i need it. Plus looking into what current measurement would be the easiest/safest/accurate.

The biggest problem I foresee is that if the pack is not charged to the top or " compeletly" discharged large drifts may occur, however I believe that worries like these will most likely never happen in real life use. Who does not charge their vehicle when done with riding it ;)

SplinterOz
15 April 2016, 0025
I wish... like you I am doing research. I have a Hall effect current sensor and a small test setup but not really enough to confirm what I am doing.
I think the detecting a full charge can help prevent the drifting, I don't think we should rely on full discharge to trigger anything as it should happen very infrequently.

I know the guy that develops the Zeva BMS so I might see if he wants to share his high level logic.

tomdb
15 April 2016, 0904
http://liionbms.com/php/wp_soc_estimate.php

Some great info here, sums up mostly the way I would go about it. Ordered a few ACS758 both the 50 amp and 200 amp versions, should be quite accurate for inductive sensors.

Low is only used as a reset, wil only happen if you really go below lets say 10% soc.

tomdb
15 April 2016, 1346
Made a balance add on board. It will balance at 50mA per cell, forgot to add some nice leds when designing the boards (wont be seen anyway in a battery box however they give you the nice techy look).

Tommorow Ill build three slave boards into a series configuration in order to monitor 2 modules of 17s. This will also involve writing some code to give me some accurate information to look at, still debating about using the ITEAD nextion or the serial port. This is due to the large overhead of the Nextion over the serial port.

Eventually this will have to expand to 4 modules in series with 6 slave boards in order to get into the range of the cut-off voltage of the Opel Ampera (chevy volt) charger. Not too keen on running the charger without its own internal voltage limit, should be possible but have still to find a proper way of testing its current limit. Im currently unsure if the current limit you set via canbus is the AC current or the DC out current (word plays :D, most likely the AC in current due to the way charging protocols are structured). If I find the time Im rigging up a space heater on the DC bus for testing purposes.

tomdb
16 April 2016, 1232
Done some testing with the Chevy Volt/Opel Ampera charger.

Just a few connections and two can messages is all it take to control it. Charger has a max output of 450 volt and max current of 13.5 amps, total can never be more then 3.3KW (untested as of yet).

Rigged up my arduino with canbus shield that was functioning as master for the bms to accept serial commands from a laptop to set the voltage and current. Once a pin got connected to 5volt the arduino transmits the voltage and current along with a command over the canbus to the charger, which will switch on if 12volts are present and mains. Then it checks the output for plausibility and turns that on if all is good.

Had the space heater acting as a load, this way I could send a voltage and current command and check the Constant Current mode and the Constant Voltage mode. Both work fine.

My conslusion so far is;
This is a cheap setup, charger cost me 300 euros all in. (canbus microcontroller needed for control so figure in 100 euros for wiring plugs and micro)
Set and forget setup, once the correct current and voltage are programmed its all good.*
Oem quality hardware

*Voltage below 200 volts not set-able however using a micro voltage measurement can be done to "manualy" reduce current as you approach cut-off voltage.

Spoonman
21 April 2016, 0552
Starting to look like a job well done dude - nice work!

tomdb
02 May 2016, 1449
Got to testing the balancing board. Might have messed up some current calculations, will measure the current draw tomorrow. During testing the add-on board got quite hot. Go figure with 12 x 50mA (possibly more like 100mA)

Now its time to start to tinker with some BMS master code to control the charging and balancing voltage. The charging scheme im thinking of;

1. Get all voltages, check for overvoltage or above charge threshold, 3.6 volt or something like that for a LifePo.
2a. If some cells above, but not all bleed the high ones to below.
2b. If all cells above do not charge, report full battery
2c. If no cells are above, or cells been discharged initiate charging

3. start charge at a current dependent on highest cell voltage, so below 3.4 volts allow a large current (dependent on pack and charger, lets say 1C)
3a. This current shalled be ramped up quickly, 1A /second or so mean while checking if no cells shoot into the balancing limit. This limit will be set at some where around 3.5V plus cell drift will be monitored.
3b. When too many cells hit the limit, current shall rampback to spare the balancing circuitry plus it would also mean the pack is reaching full charge. The knee of an Lifepo pack is roughly around 3.4V

For the balancing aspect you need to choose a voltage above the knee of the charing curve (at the top ofcourse) so that you do not get false readings, plus balancing around nominal voltage is not possible anyway. Thinking about implementing an out of balance charge abort, because I do not want to be shunting for ages to get an imbalance of more then roughly 200mV out of the pack. This would most likely kill my balance circuitry or take ages anyway, plus indicate a bigger issue.

One big doubt I have right now is the packs ill be testing on are used A123 AMP20 cell that might be Abused, so fingers crossed with some light cycling I can get them working together. However I believe i need to swap out my balance resistor not to burn up my connectors, they started smelling and become hot to the touch after less then a full minute.

Will see if I got time this long weekend to hook-up one module to the Chevy volt charger with the bms master software monitoring High Voltage Cut-off and some current throttling. (picked my bms slave / bms master Canbus-ID's low for a reason, as not to interfere with a Charger on the same bus)

Spoonman
03 May 2016, 0128
Agree on the balance abort point - if this whole process is happening on an ongoing bases then there's no reason for that sort of imbalance to arise at the top end of the pack.

tomdb
03 May 2016, 0853
Will ofcourse build in an override function. However that will most likely only be available through the serial port, like other diagnose functions and maintenance read outs/controls.

For the master I am still working on what kind of communication im going to use. Got a bluetooth module, so the Torque app or a custom app might be the way to go. Currently the Nextion gives a big overhead.

tomdb
04 May 2016, 1343
my 18 ohm balance resistor was indeed to small, even for testing. PCB is designed for 1206 smd resistors at 33 ohms which can be had in 1/2 watt package. At 3.65 volts that is 110 mA which results in roughly 400 mW which would be inspec.
The 18 watt resistor gives you a balance current of 202mA and 740 mW which gets the small resistors 0805 smd quite hot quickly. The mosfets are speced at 3.2 A so and roughly and 85mOhm at an Vgs voltage of 2.5V, so well with in limits. Plus the Power disapation of these mosfets is rated at 1 watt, I would have to push them hard to even get near that rating.

So I built up one more balance board with the 0805 resistors rated at 33 ohm, this way the current will be around the 110ma I was aiming for. This will be very low however I made the balancing circuit an add-on on purpose so I is possible to switch out the balancing levels. But as we all know only small balancing current are needed with a quality pack that is balanced at the start.

tomdb
28 May 2016, 0318
An update, I got an opportunity to go do some work in Sweden for NEVS (Owns Saab). This means that all my EV projects are on hold for now. I have had some guys, work on university projects ask for my help with some code and schematics, So do not hesitate if you are work with or planning to with an ltc6804 and want some advice or just to swap ideas.

tomdb
30 September 2016, 1639
Gentlemen (and the occasional lady of-course), my last post stated I had taken a position in Sweden. This has unfortunately not worked out, miscommunication between the parties involved. However during this period I got some great news that I could go for a job interview in England. I am glad to say that now I am working in England as a Automotive (mechanical and electrical) Engineering Contractor, having moved all my things over and started to settle down it looks like more time and room for projects.

Enough about life, decided to kick it into a little higher gear. Did testing on the charger (from a Opel/Vauxhall Ampera or Chevy Volt) to gather some data and figure out the control strategy I would require. Respun some balancing boards, its all good not having leds to show you what is going on, however more importantly I upgraded the balancing resistor to a 1206 package. So I ordered my missing components and soldered up a board, quickly discovered that I should invest in a good soldering iron for myself (was using my dads one plus im running out of tin). Then did some testing, this did not go too well all the balancing channels would blink on and off depending on the setting of the reference. Two beers some hardware troubleshooting later I came to the discovery that when testing the last time (in Holland) I did not use my new laptop (as I did not have it then). I had changed the formatting of the can message that dictates the balance voltage in order to correct a mistake, should probably keep a detailed project-log for myself.

In the end all worked out well, I have included a video of my findings/results so far. I am hoping to cobble together a setup with around three boards and 2 packs of 17s cells to test with the Chevy volt charger. This can be easily done in my current code structure as the control and the status messages to and from the charger are well outside my chosen message id's for the bms :cool: (go figure). This should allow me to charge the cells to a set voltage and ramp the current back as the balancing kicks in, and all controlled and monitored via canbus.


https://www.youtube.com/watch?v=DtWKcg2kuPk

tomdb
07 October 2016, 0848
Been busy soldering the other two balance boards, because the multi meter I had currently was a cheap one I decided to reward myself with a fluke 115 and a unitek clamp meter. This way I got some measurement I can trust.
Created the bms leads, did some testing and found out that the adapter boards I have made for the a123 17s packs are quite sensitive to loose connections. I hope this is solved when my pcb's arrive from china. These will also be made to directly connect to a slave in stead of the cable.
Once these connection issues were sorted I tested all the boards one by one, found out some of my slave boards were running the 1.0v firmware so these were upgraded. This allowed them all to talk together. The master arduino did not show all the data fast enough, so I had the loop for the can bus decoding running at a higher rate. This solved it, my determination of the lowest voltage gave me some headaches, in the end I solved this by implementing a lower cut-off of 10mv (so it ignores the unconnected cells). I also had not foreseen the fact that in code in an array 0,0 is the first cell of slave 1 so my loop looked at cell 0,12 which is cell 13 (always a random number due to not being assigned. Once that was fixed all the data showed proper on my serial debugging output.

Made a small tweak of two lines of code to the slave firmware 1.1v;
lower voltage ignore (lv), this ignores any measurements below the set value I chose to set it at 10mv to compensate for some possible bad connections.
the only time this value is used, is in checking for an undervoltage condition, which allows not used inputs to be pulled up to the highest cell voltage and thus be ignored. Without ignoring these my firmware dictated that an undervoltage condition was present and stopped the balancing and flagged an error.

Below a video of all of this in action, looks like I can do some charging soon just need to make some proper leads for the charger to battery.


https://www.youtube.com/watch?v=bJmNkCsHaC4

tomdb
10 October 2016, 1122
Running an endurance test right now unfortunately the weakest link is still the tiny headers which interface with the 71s packs. these are three 2x5 headers with a pitch of 1.27mm. If this remains a problem I am wiring up a simple eyelet per cell.

Balancing down to 3.3008 volts as we speak (the 8 is there because I have not set it in code and reused my old code which has a potiometer to dial in the balance target.

One small issue, not all slaves have a constant discharge pattern, some blink and some stay on. Need to do more investigation, however the balancing is taking place and stops when the target is reached.

V1.1 of firmware does not contain any fancy overshoot, this will be programmed in later. This will be done to compensate for the voltage loss in the connections and wires to keep the on/off switching with the voltage sag to a minimum.

Update: Measured my total voltage using my Fluke, it came to 111.71v and my serial data output gives a total of 111.41v which equates to a difference of 0.27% which is quite acceptable at this stage. Since Im balancing currently and not averaging over some samples.

IzaakKuze
08 November 2016, 1048
Hi..i am a new user here. In my case Bootloader burned after a few attempts, due to inexperience. However once the bootloader was on the chip seemed dead. Turns out that the ATmega328 require VccA to be hooked to 5v olts for it to work with the bootloader.

printed circuit board assembly (http://www.7pcb.com/PCB-Assembly-Service.php)

tomdb
08 November 2016, 1134
Of course it does, I would say look at the way the arduino boards (or breadboard arduino's) are designed and copy that.
Are you attempting to make a BMS based on the LTC6804 too?

tmath250
13 November 2016, 1803
Please give us an update. I am also wanting to purchase one of your boards for a 54S1P string I am making of LTO cells.

4dollarjoe
16 March 2017, 0839
Let me know if I can be of any help. I am considering building my own bms.

Minibms is basically off the market right now. The world needs a cheap and open BMS system.

tomdb
16 March 2017, 1024
Currently working on a simple master bms board. Will build a test setup once that is complete.

mamuti
13 May 2017, 1925
Hello

I'm going to start working on a similar project. I'm not focused on balancing and the ultimate goal is SOC estimation. However, I'm asked to use LTC6804-1 to measure voltage of the Li-ion cells and send them via SPI to a local microcontroller. Because, now I am in R&D phase, therefore, cost is not a very important issue and I'm using demo board for LTC 6804-1. Therefore, I will connect SPI port A of LTC6804-1 to the ARDUINO UNO.
Then, voltage & current must be sent by CAN bus for longer distances to the main microcontroller on which, SOC estimation algorithm is running.
For local microcontroller, I'm going to use ARDUINO UNO because it seems easier and I don't have much experience in programming. However, it doesn't have a built-in CAN support and I'm going to use CAN bus shield (https://learn.sparkfun.com/tutorials/can-bus-shield-hookup-guide?_ga=2.167896421.532549955.1494283128-1045345018.1493832521)
The main microcontroller is chosen Raspberry Pi 3 which is more powerful in terms of computational power. A CAN shield for RPi3 is in charge of converting back data into SPI format.
So, do you think this is a feasible idea?

tomdb
14 May 2017, 0309
You need to isolate the ltc6804 and uno from the other ltc6804's otherwise you can have shorts.
Anything is possible, Take it one step at a time.

mamuti
14 May 2017, 0715
Thanks for your advice; right now, I'm not going to make a daisy chain and only using one LTC6804-1. So, I don't need isolating; am I correct?

tomdb
14 May 2017, 0835
Yes/no. this means that you battery negative will be the only negative, so no isolation of you hv battery.

It will work but depending on what you want to do this might cause issues.

methods
17 May 2017, 1424
Nice thread. Skimmed it - good luck in your ventures.
I signed up just to see your pics ;-)

I started a similar effort based around the LTC6811 (https://endless-sphere.com/forums/viewtopic.php?f=14&t=88358) (drop in for 6804, found this thread searching for an Eagle Footprint). I need to brush up on my 0-60 skills (nothing to something) so I am going to forge ahead with a fresh design that has some risk boiled into it.

One of the targets is to manage 28S Zero cell boxes that lost their BMS (or came without one)
First iteration will be for a 6S electric Kayak.

-methods

P.S. If anyone wants to talk Sevcon, DLD, DCF, Zero... stuff like that... lets engage in another thread. Been doing a lot of that over at Calfee Design.

tomdb
30 May 2017, 1425
Want to know a secret. :cool:

This was my first smd board I ever designed. And only my third pcb design, other two were single sided etched ones. That is why it took me 3 tries.
Is the SPI control roughly the same? I could possibly look at just dropping in the newer and cheaper chip.

Actually havent touched my boards in a while due to the fact I got so many projects going on. Tesla bms decoding, BMS master and inverters.

NoellEagan
04 October 2017, 1053
Hi...i am a new user here. In my case i used a pair of Freescale MC33771's (14 cells each) with a MC33664 isolated comms board which could plug onto an Arduino in a pinch, but I chose the FRDM25Z dev board to get an ARM processor. Then added a STM32F4 dev board with a plug-on 3.2" TFT color LCD as a display head. RS-232 between FRDM25Z and the ST display head in ASCII for easy eavesdropping. Similar idea to what you've created but I used all eval boards so I did not have to spend the time and money to spin one.

smt assembly (https://www.7pcb.ca/smt-assembly/)