Low cost BMS

How do you store and manage your electricity?
Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Thu, 06 Jun 2013, 14:17

I guess the o/p would be saturated with your optos and they may be a lot slower, its hard to tell without looking at the signal waveforms. Anyway, working is the main criterion!
The accuracy of the bms voltage measurements depends on the accuracy of the voltage reference and also the resolution which varies with voltage ie 12 mV at 4V and 4 mV at 2.2V.
The nature of the comms is such that it won't introduce errors as you either receive data or you don't! You can get errors with corrupt data, but they will generally be values of 3.99 V or 2.21 V. I decided way back not to include the extra complexity of error checking as I didn't think data corruption would be a problem and it isn't with my set up. I suppose it would be possible to ad a 16 bit CRC, but that's a lot of extra calculation and each and every module would have to do it.

The master adds up all the cell voltages to calculate the total battery voltage and I would expect errors due to resolution to cancel out over the fairly large number of cells in the battery, so its down to the accuracy of the voltage references which TI quote as 1% or 2%, depending on whether you use the "B" series or not. One would hope that the spread in tolerances over the number of cells would tend to cancel out, but if your LM385s are all from the same batch its possible they could all be 1 or 2 % out in the same direction. That means that if you are unlucky, the battery voltage could be 2% out. I forget how many cells you are using, but I have 45 giving 45 x 3.2 = 144V and 2% is 2.88V. But I used the 1% ones, so my worst error would only be 1.44V. My digital multimeter is only rated at 1% accuracy too, so I reckon that if the bms and the meter read within a volt or so of each other, that's pretty good! My Digitech meter reads .5V more than the bms shows and my RadioShack meter (don't ask!) reads 1V more than the bms. Both meters are 4 1/2 digits with 1% accuracy - according to their specs.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Thu, 06 Jun 2013, 14:43

Nevilleh wrote:
The nature of the comms is such that it won't introduce errors as you either receive data or you don't! You can get errors with corrupt data, but they will generally be values of 3.99 V or 2.21 V.


That is exactly what i see. Comms is stable troughout the envelope. I see 3,99V now and then mostly at the beggining of regen. I havent seen 2,21V since i put a cap across R1.

I only have to sort out the charger glitch. Sometimes charger starts to cycle and resets the master trough output ground i think. I have to redo the relay connection with optocoupler or diode. That way there will be no backlash from the relay coil. Or it may just be poor connection in the AC relay contacts....

A

Renard
Groupie
Posts: 219
Joined: Sun, 29 Aug 2010, 18:55
Real Name: Robert Fox
Location: Cobargo NSW

Low cost BMS

Post by Renard » Thu, 06 Jun 2013, 15:46

Nevilleh wrote:

The master adds up all the cell voltages to calculate the total battery voltage and I would expect errors due to resolution to cancel out over the fairly large number of cells in the battery,


For what it's worth, My Fluke multimeter reports a voltage only half a volt different from the BMS at 400V.

I'd like to know a bit more about the addition of a capacitor to the Master R1 -- what value, and what effect it has?
Renard

Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Thu, 06 Jun 2013, 16:19

When I first got mine going in the car, I experienced some corrupt data packets when accelerating at full throttle and I fitted a .01 uF cap across R1 which got rid of some high frequency noise on the data signals. I connected my 'scope across R1 and chose the value by the amount of rounding it caused on the pulse edges and corners - .01 uF was barely noticeable on the bench. I put it back in the car and now very rarely do I get any corrupt data. Because it samples a couple of times per second, I don't worry about the odd corrupted value which only occurs at full throttle and I'm usually too busy looking at the road under those conditions to spare a glance at the bms.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Sat, 22 Jun 2013, 11:57

OK now we re talking. I made the RC filter, and connected the charger-off O/P as failsafe. So it trew charger off in case of 12V fault. But now i got constant glitches while driving. Once every 2 seconds, regular. I tried to disconnect the charger-off line and sure enough - no glitches. I then went on and layed a new cable trough the cabin so the charger off line is totally independent from comm lines. I guess it was 12V that was buzzing the comms while driving. Now that i have done this i had no glitches in two rides to work at 140A and it is the first time i fully trust BMS to work independently.
I will transition now to top balancing with shunts 3R3 5W and PMV30UN mosfet instead of DNBT bipolar transistor. It will drain 1A insted of only 0.6A that DNBT allowed. I guess there was not enough drive current from PIC port to open bipolar fully. That mosfet is tested with the batteries and can be a direct replacement on the board. In theory it could drain 2A, but that would require 2R 7W resistor and the heat is already a lot.
Optical comms are not required anymore...

Neville, i didnt have to look at the LCD either, but i could hear the charger-off relay (under the dashboard) click off and on when something happened. Not anymore though...Image


A
Last edited by arber333 on Sat, 22 Jun 2013, 02:05, edited 1 time in total.

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

Low cost BMS

Post by weber » Sat, 22 Jun 2013, 16:28

arber333 wrote:I guess it was 12V that was buzzing the comms while driving.
Do you use Kilovac EV200 contactors? We found massive PWM hash on 12 V, coming from their economiser circuits, that caused interference with an early version of our BMS, as you can read here:
viewtopic.php?title=weber-and-coulombs- ... 840#p34840

Or just go straight to our solution, here:
viewtopic.php?title=weber-and-coulombs- ... 914#p34914

Neville, I tried to find an up-to-date schematic for your BMS (or link to same) in this thread, and failed. I wanted to see where R1 was. I assume it is the optocoupler output pullup. In any case, I note that a cap across the phototransistor's collector and emitter, or across its pullup resistor, will filter out spikes that would cause a spurious turn-off, but will not be so effective with spurious turn-ons. Its effectiveness with the latter would require the opto's LED-drive and CTR to be such that the phototransistor barely saturates when turned on, and this would not be a safe design anyway, due to the typically large variation in CTR. So we also add a capacitor across the optocoupler's LED to filter spurious turn-ons. One cap mostly rounds off one corner while the other cap mostly rounds off the other corner.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Sat, 22 Jun 2013, 18:41

Yes, R1 is the phototransistor collector load. I didn't bother trying a cap across the diode emitter as I never really had an interference problem after I re-routed the comms wires properly. The only reason for trying a cap across R1 was because I occasionally received a bad packet or two and it was easy enough to try that. The longest comms wires I have are from the battery box in the boot to the control unit in the dash.
Arber seems to pick up stuff from all over!
I've even turned off the RS-232 error detection in the s/w now.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Sat, 22 Jun 2013, 23:18

Nevilleh wrote:
I've even turned off the RS-232 error detection in the s/w now.


Maybe that would be the problem... I connected the bluetooth module to serial O/P and connected it with my PC. At first the data was streaming ok but i noticed a lot of FF operators too close apart. Not on the display... Then after a while my terminal program locked. You think errors in o/p line....?

I admit i never tried to connect by cable. My dash doesnt have space for DB9 connector. I will try to prepare cable for connection to PC.

On the EMI
I am positive now most of the glitches were because i connected charger gnd to chassis. Now that i disconnected there are close to zero glitches.

@weber: i do use Tyco Kilovac EV200 and i am very pleased with it.
That would actually explain the surge of EMI in the beginning, but after i powered my circuit trough isolated 12-12 2W converter those are gone now. In any case i went to great lengths to keep my 12V isolated from sensors.
I even figured the accelerator throttle was carrying some Esmog and i put 12V to 5V regulator between hall pedal and controller. That did it.

I can drive now watching the voltage as it rises/falls with regen/draw... hypnotizing and dangerous at 110km/h. I am now thinking that one LCD with Vmin/Vmax data is enough for normal user and the thought watching Android tab while i go off the road at 110km/h is scarry. Maybe i could try and prepare some Arduino Nano circuit to download data on SD card while driving and after the drive i can prepare the data as i see fit. Safer that way....i think.

A

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Sat, 29 Jun 2013, 11:52

To anyone it might concern

In preparation for top balancing BMS software change i got the batteries out the car and balanced them in parallel so they shared potential for 2 days. I then tested all PCBs with mosfet and 3R3 5W resistor. 1,1A is drained for cca 30min so in the end i was sure the PCB will withstand the heat from resistor. I guess 2mm of air gap helps since air is the best isolator. I wont be adding 1mm sheet plate under resistor then, since heat gets dissipated just fine. If you used 2R 7W resistor for 1,8A shunting that may be necessary. Mosfet is capable of shunting close to 4A when fully loaded, so the shunt still has some margin.


For now the mosfet shunt works only in on/off mode. I was thinking of software PMW switching it smoothly from 50% at 3,6V to 100% at 3,8V. Control loop would simply be voltage measurement and PIC12F can output PWM signal at 30 - 50khz.
I just dont know if the control circuit could last, since it is a direct replacement from bipolar, eg.: PIC output - 330R resistor - mosfet gate. No fancy gate protection diode or 10k connection from gate to gnd.

Would it be better if i replaced 330R with 1k resistor for PWM?


Image
Last edited by arber333 on Mon, 05 Aug 2013, 02:51, edited 1 time in total.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Wed, 23 Oct 2013, 04:17

Anyone willing to make their own BMS, but not fiddle with design... I prepared my iteration of files and documentation on Nevillehs BMS on my website. Files are meaningfully named, though user manual is still written in Slovenian language. For english speakers i suggest you check Nevillehs original manual. I should translate mine anytime soon.

http://mazdamx3ev.files.wordpress.com/2 ... bms_r3.pdf

File is named .pdf due to server restriction with .rar files.
Download the file, rename it to .rar and browse. You should get idea of purpose from the file names .
There are gerber files for pcb manufacture as well as .pcb files for designing your own board dimension.

Regarding functionality, all works. You have to be precise with BOM. Specially optocouplers are critical. Now the 3.6V/cell charger cutoff works good and comms are stable. I also added failsafe loop to cutoff the charger if any cell goes beyond 3.8V and if comms fall off.

I am now working on communication with PC or Android device. So you could perform a sort of regular servicing, checking each cell value and spot irregularities. Shouldnt be too complicated... :).

Have a great time constructing...

A
Last edited by arber333 on Wed, 23 Oct 2013, 10:39, edited 1 time in total.

User avatar
Richo
Senior Member
Posts: 3737
Joined: Mon, 16 Jun 2008, 00:19
Real Name: Richard
Location: Perth, WA

Low cost BMS

Post by Richo » Wed, 23 Oct 2013, 21:14

Very good.
I would suggest a small amount of Dowcorning 744 to hold the resistor in place.
Nothing worse than having it fall off from vibration and roll around your battery tops.

330R should be ok ~15mA cont is within spec for a PIC?!?
So the short answer is NO but the long answer is YES.
Help prevent road rage - get outta my way!

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Thu, 24 Oct 2013, 08:10

I will try to glue them at the next regular maintenance in about 5000km.
That should be in about two months. I make abou 140km/day. I will check then for any damage due to vibration.

I must say i am very pleased with the system now. Neville has done wonderfully simple design. No unnecessary stuff. I had a lot of learning to do. Also my car is a high current AC drive and there is a lot of EMI.
Cells are now so balanced that charger stops right after first cell starts to balance. I use only one o/p to cutoff charger when all cells are full, it never cuts in though. The other o/p i use only for RS232.

I am now learning basics of the android coding to be able to make some sort of user interface to visually check batteries status while in operation and possibly record a time graph in excell csv file.
I found RS232 bluetooth repeater that could transmit data to a PC or android device.
Such program would be usable for periodical battery check only, since i consider even existing LCD dangerous to look at while driving at 100km/h.

A


User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Fri, 25 Oct 2013, 01:22

Well done Arber, and well done too for making it available for all!

I am also making a custom version of Neville's BMS. I'm pretty happy with it now on the bench, I need to buy some cells and a charger to test it properly.

That bluetooth repeater sounds interesting, keep us informed on how you go. I could potentially use my android phone to log data, then take it back to my PC to view it.

Hmm, now I'm thinking about it, if I could talk with the phone, I could use it as a remote control! So when I am finished work for the day, I could get on the internet and tell my car to start up the heater. Then the car would be nice and warm by the time I got there.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Fri, 25 Oct 2013, 02:10

Yes i know. But the complexity... The sensors. You could just use RTC module and program it to cycle at predetermined time.

I thought more of regular maintenance tool. I would come close to my car with the phone and connect. It would show the batteries graph and i could press record button and leave my phone in the car. After some hours i would download and make some graphs vs time in excel. The same goes for driving stress. That history would tell which cell is damaged or faulty.

It is still in development though. If someone knows how to do it, please by all means step up. For now i have a list of what to do and an idea. I am still learning.

tnx

A

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Tue, 05 Nov 2013, 01:41

As per the discussion on Zeva's thread here, I'm thinking about changing my BMS module board to shunt less current.
My existing circuit uses six 1W 10 Ohm resistors to shunt about 0.5A @ 3.6V. I have bought the components, but haven't assembled them (waiting on cells to arrive for final fit test). So now I'm thinking that I could use just two of the resistors, in series, to give 20 Ohms, or about 0.2A max. It seems that once balanced, a smaller shunt current is sufficient to maintain balance, as long as balancing is performed frequently. I'm intending to balance during every charge.
With 48 boards to assemble, four less resistors would be welcome!

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Tue, 05 Nov 2013, 04:18

Well my own observation have history of bottom balancing. So from the start with top balancing i had to convince 200A cells to match on the upper side of the curve. Finally i did it by making my BMS balance at 2A and connect my charger at 2A. This held higher cells at bay while the rest had to catch up.

Now 10 months after that i dont really see the need to balance with 2A. It is a lot of waste heat to remove. Probably i will go back to 1A the first time i get to service my cells. Probably next year.

First I set my cell modules for 1A with 3R3 5W resistor and later i just soldered another one over it. Together they can handle cca 9W of heat with 1R6 for 2A. Now my charger comes to balancing at 30A but modules go on "balancing 15...24...32..40..42" the end in cca 30s! Charger shuts off. Then i notice cells drift back down to 3.45V! It must be the 30A charge. I have to convince the charger to go into balancing at cca 5A so they will fill more gradually, since i intend to charge at 60A when i get water cooling plate.

Check this: http://liionbms.com/php/wp_balance_current.php They say 0,1A is enough, i am not sure...

Bottom line, i would use SMD resistors for 0,5A as designed, or if possible upgrade to single 3R3 5W one (maybe 4R7 3W would be enough for 0,8A). The sheer ohm rating is keeping mosfet in check at 1A even at higher voltages. Your decesion...

A

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Tue, 05 Nov 2013, 04:47

I read the post you mentioned. That is different BMS, working under different conditions. The conditions set in the code of this BMS are to always balance when over the preset value, until a cell is under this. That would mean your pack would fill to some 3,7V average and BMS would need couple of hours to bring it down to 3.6V per cell... that is if the cells are well balanced. However it wouldnt protect you against overcharge as is. Also i dont use balancing all the time. Maybe once a week.

The version of code i am using shuts off the charger if one cell goes over 3,8V! over all other conditions. However i see the trend cells reach balancing well before highest cell reaches 3,7V and shut the charger off. So its safe to say 1A would be good and 0,5A is OK.

A

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Wed, 06 Nov 2013, 02:42

Arber wrote: That is different BMS, working under different conditions.
I have written my own code for Neville's BMS. So I should be able to experiment! The charger I am using can also reduce the current. The good thing about Neville's design is that all of the voltages etc. are controlled from the master unit. So I only need to change the code for that to change my system.

So my plan is to balance every charge by a small amount. If I need to I will put in code to turn down the current at the end of the charge, once the first cell has started to shunt. Although from what Matt said, I'll try to avoid this if I can. (at least I should avoid turning the current down too far - perhaps turn it down to 2A or so)
If I find that the cells are not balanced when I first buy them, I can write code to balance the cells when the charger has turned off. The shunt(s) could then be on for quite a few hours if needed, or even days as Zeva said.
Or I could do a combination, where the shunts that are on when the charger is turned off are then left on for a while afterwards.
The possibilities are endless!
I imagine that I will need to experiment to find what works for me. My cells will be in different places in the car, and will no doubt be different temperatures. So some may need more shunting than others...


arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Thu, 07 Nov 2013, 01:50

Would you mind sending me your version of code? I am still modifying mine and would like to see some different solutions, maybe i am too fixed on my goals.

Specially i would like to make PWM cell balancers. Like i said i am still experimenting...

tnx

A

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 07 Nov 2013, 02:30

arber333 wrote: Would you mind sending me your version of code? I am still modifying mine and would like to see some different solutions, maybe i am too fixed on my goals.

Specially i would like to make PWM cell balancers. Like i said i am still experimenting...

Happy to do so, have sent you a PM.
Once all tested and complete I will try to post it somewhere for anyone to use.
I think that PWM would be possible, but I'm not sure what frequency would be best for your hardware?
A slow frequency could be controlled from the master. It would be interesting if you knew how long it takes a data stream to complete a circuit? I reckon you could get a few Hertz this way?
If you wanted a faster frequency then it would have to be done by the cell module. I could imagine that instead of sending an on/off command, it could send a value between (say) 1 and 10. The module could vary the frequency based on the value sent by the master.

Just thinking aloud - I'm sure you have thought these thoughts!

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Thu, 07 Nov 2013, 03:14

I was thinking of coding PIC12F with independent PWM. What do you know, the port to control the mosfet is by chance PWM port :). Coincidence?

I intend to use cca 50kHz switching freq. Maybe set a few steps controlled by ADC cell voltage data: 3,45V 30% duy, 3,5V 50% duty, 3,6V 70% duty, 3,7V 99% duty!

After that at 3,8V master turns charger off as safety!
Master would be programmed to only give modules command ON. The rest will be their own function. They will only check for presence of master signal and send data, similarly to Nevilles. I like centrally commanded system - i work in the military after all :).

A

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Fri, 08 Nov 2013, 00:35

arber333 wrote:Master would be programmed to only give modules command ON. The rest will be their own function.
Maybe set a few steps controlled by ADC cell voltage data: 3,45V 30% duy, 3,5V 50% duty, 3,6V 70% duty, 3,7V 99% duty!

If you put these voltages into the module then it is difficult to change later. If you put it into the master then you can easily adjust the voltages later on to fine-tune the system.
So rather than sending the ON command, send ON30%, ON50% etc.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Fri, 08 Nov 2013, 01:49

Wery well!

This could be done with xx command Neville uses. 01 is used to command balancing, so i could change it to 11, 12, 13 etc... so cell could read command and perform. Excellent thought, i like simple solutions :).

A

User avatar
Richo
Senior Member
Posts: 3737
Joined: Mon, 16 Jun 2008, 00:19
Real Name: Richard
Location: Perth, WA

Low cost BMS

Post by Richo » Fri, 08 Nov 2013, 20:25

You aren't going to hear the switching in a resistor.
It's unlikely you will need to switch at 50kHz.
So even 1kHz would be fine.
So the short answer is NO but the long answer is YES.
Help prevent road rage - get outta my way!

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 26 Dec 2013, 02:19

I am hooking up my cells and BMS, and I have a problem which involves smoke.
I have six cells wired up as shown in the diagram.
Image
The cells are the blue boxes, the BMS modules are the green boxes. The thick black lines are the cell interconnectors, and the thin purple lines are the communication lines between the BMS modules (running from output on one module to input on the next).

My problem goes like this:
At first I had all cells interconnected, but no comms lines connected.
I tested each BMS module individually by plugging it into the BMS master, and each one worked.
I hooked up the comms lines for cells 1, 2, 3, 4 & 6. I did not hook up 5 yet. I tested the comms and it all worked.
I then plugged into cell 5, so that the comms lines were connected as in the diagram. This is when I saw the smoke. I could not trace where it came from. I quickly unplugged and felt components, but I could not find the hot one.

Module 3 now has no comms output, although I can program it (so it isn't completely dead).
Modules 5 & 6 have output but no input (they transmit a "no comms" code).

This is the second time that the module on cell 5 has smoked. The first time I decided that maybe I had connected two outputs to each other. But this time I am sure I have the connectors the right way around.
Could this be something to do with the fact that I am connecting modules in a different order than the cells? I'm no expert on optocouplers, but I thought that I could connect them in any order, since they should be isolated from each other?

Here is the circuit diagram for the module:
Image
I was hoping that the process of setting it all out here might help me see what the problem was, but nope... Can anyone see anything that I'm doing wrong?

Post Reply