Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

mcudogs
Posts: 16
Joined: Sat Jan 09, 2010 8:31 am

Re: BMS Software

Postby mcudogs » Mon Feb 22, 2010 2:48 am

I will try it again with .1mS timing when I have finished wiring the car.

I have done some hardware changes in my system. Instead of the LCD display for the master I am using an ASUS EEE PC. I have connected the serial output that normally goes to the SV2000 chip to an RS232 chip (Max232) then to a USB - serial converter on the PC.

The idea is the PC will be the display for the BMS and the motor controller and also entertainment, GPS, Bluetooth hands free etc etc.

It means I have to change the command codes for the SV2000 to a PC friendly format so that the screen is cleared etc. Eventually I will do a GUI for it.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Mon Feb 22, 2010 7:35 am

Sounds good please post all the details so we can see how it works etc.
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Sun Mar 14, 2010 6:49 am

Cell Capacity difference calculation.

Drove 200 miles today in one journey and exhausted pack just as I arrived at destination managing 127mpg for the trip + 6kwh of power. Anyway as I was nearing destination watching bms screen I could see cell 1 was going to go under V first and wondered how much capacity the others had left? There is no real easy way to tell. So I have decided to add some new stuff to the picaxe version of the slave software. That's what my phev uses 50 x picaxe slave boards with 250ma load resistor fitted.

I'm going to add some of the commands from the non picaxe slaves and selectable speed 2400 or 4800 baud program space permitting.

In particular I will add the bottom balancing function coupled with a an extra bit in the master software to corelate/display the remaining capacity for each cell. So when the pack is exhausted engage the bottom balancing routine and it will discharge all the cells to the cut off point and with time x current we can work out how much each cell had left. It might take a few hours of course but should give a pretty accurate display of how the cells compare. This allows much weaker ones to be swapped out early.

Anyway just food for thought.
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Wed Apr 07, 2010 7:48 am

I might have cracked the problem with the multi cell slave boards and the voltage reading errors encountered when the loads are active. So hopefully we can use the 10R resistors and thin wires again. :D

I have two new versions of the master/slave software i'll post tonight.

The new Slave non picaxe software has half as many commands, but an additional one to turn off the loads on the slave.

This turn off load command is sent each time the master requests a cell voltage reading from the slaves.

So in the cell Voltage routine of the Master we now send Command 2 first which turns off all the loads.
The master then waits 100ms whilst the slaves respond and they continue to accumulate no load Cell Voltage data as the voltage measuring loop in the slaves continues running very fast.

The master then sends the normal Command 1, which sends the cell voltage on the master bus, but also then tells the slave to turn on/off the loads in response to the stored voltage readings taken whilst the loads where off.

I hope that makes sense. The loads cannot be on 100% of the time any more but we can probably manage 90% of the time if required.

This should avoid the voltage drop problems as only cell voltage readings taken when all the slave loads are off will be acted upon (Loads turned on or off in response to choosen settings) or reported back to the Master.

The new command format list is below.

' Command 1 = Send Cell Voltage on Master Bus & Manage Loads (0.1ms pulse)
' Command 2 = Turn Off Slave Loads (0.2ms pulse)
' Command 3 = Increase Load CutIn Voltage by 10mv (0.3ms pulse)
' Command 4 = Decrease Load CutIn Voltage by 10mv (0.4ms pulse)
' Command 5 = Increase Load CutOut Voltage by 10mv (0.5ms pulse)
' Command 6 = Decrease Load CutOut Voltage by 10mv (0.6ms pulse)
' Command 7 = Set Slave Load CutIn/CutOut Voltage Defaults (0.7ms pulse)
' Command 8 = Turn On Slave Load for 0.5 seconds (Flashes Led) (0.8ms pulse)
' Command 9 = Set Baud rate to 9600bps (0.9ms pulse)
' Command 10 = Set Baud rate to 2400bps (1.0ms pulse)
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Wed Apr 07, 2010 3:06 pm

OK here are three new bits of untested software. They compile correctly and pass the syntax tests. I don't have time to test them at present. Please try them.

For the Master Board V2 28x1 Picaxe
www.solarvan.co.uk/bms/MASTER_8MHZ_0604 ... UD_I2C.txt

For the Multi Slave board Pic Slaves
www.solarvan.co.uk/bms/PicMultiSlaveV24_070410.txt
www.solarvan.co.uk/bms/PicMultiSlaveV24_070410.hex

For the Picaxe Watchdog chip on the Master board a new pic variant.
www.solarvan.co.uk/bms/Watchdog12F683_060410_V01.txt
www.solarvan.co.uk/bms/Watchdog12F683_060410_V01.hex

Note once you overwrite a picaxe 08M chip with compiler code for the pic 12F683 variant it can't go back to being a picaxe chip!
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Re: BMS Software

Postby steiner » Sun Apr 11, 2010 1:26 am

Peter,

I am trying to better understand the new slave software. I might be missing something but it seems like when the slave receives "command 10", the routine checks for the cell voltage being above DHigh or below DLow. If the value doesn't meet this criteria, it then subtract DLow from CellV to convert CellV to a byte value. What I don't understand is it then compares CellV to both the CutInV and the CutOutV. It would seem as though it would always be below these two values since previously we subtracted DLow from CellV.

On a seperate note, why do you set "VData=2" for command 2, set "VData=3" for command 3, ect....?

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Sun Apr 11, 2010 4:59 am

Your right that is a mistake in the logic !! I did say it was untested.
I'll look at that again in next few days well spotted.

Re the other point about vdata. I set this to the command the slave thinks it has just received, it then sends it back on the master bus, and this is checked by the master program to make sure that each slave has received the correct command. Any discrepancy between the command sent and the command received back on the master bus triggers an error for most commands. If for instance you sent the command to raise the cutin voltage to the slaves, but one or more get the wrong message you at least know about it, and can send the default voltage command and then try again.
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Re: BMS Software

Postby steiner » Sun Apr 11, 2010 9:01 pm

Peter,

That makes sense...your error checking the data.

I may have found another issue. In the master software you are sending command 2 to turn off the load resistors. You then send command 1 to tell the slaves to transmit their cell voltage data. However, when I look at the slave software routine for command 2 it potentially turns the load resistors back on.

I'm thinking we might want to send the current command 2 to turn off the load resistors. Then we can modify command 1 to only transmit the cell data. Then we send them a new command 3 which will potentially turn the load resistors back on as necessary. This would require a new command 11 rountine and shift the current commands 3 thru 10 down one.

If I get a chance, I will try some of this today and let you know what I find.

Rick

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Sun Apr 11, 2010 11:46 pm

Rick

I have modified the Master & Slave to hopefully overcome the problems we are discussing.

The new command list is

' Command 01 = Send Cell Voltage on Master Bus (0.1ms pulse)
' Command 02 = Turn Off Slave Load (0.2ms pulse)
' Command 03 = Turn On Slave Loads as Required (0.3ms pulse)
' Command 04 = Increase Load CutIn Voltage by 10mv (0.4ms pulse)
' Command 05 = Decrease Load CutIn Voltage by 10mv (0.5ms pulse)
' Command 06 = Increase Load CutOut Voltage by 10mv (0.6ms pulse)
' Command 07 = Decrease Load CutOut Voltage by 10mv (0.7ms pulse)
' Command 08 = Set Slave Load CutIn/CutOut Voltage Defaults (0.8ms pulse)
' Command 09 = Turn On Slave Load for 0.5 seconds (Flashes Led) (0.9ms pulse)
' Command 10 = Set Baud rate to 9600bps (1.0ms pulse)
' Command 11 = Set Baud rate to 2400bps (1.1ms pulse)

So the sequence now is.

Master sends Command 2 to turn off slave loads.

Master sends Command 1 to read cell voltage data, which also now stores the cell voltage in the new Slave Word variable (CellS).

Master sends Command 3 to activate loads as per unloaded cell voltage readings taken when no loads were active. This uses the cell voltage value stored when Command 1 was received in the new variable (CellS).

This new sequence means the slaves should be able to operate with out interfering with each others voltage readings, as voltage readings are only taken when all the slave loads are off. This voltage is stored and used by the slaves to decide if the loads should be turned one when Command 3 is received shorlty afterwards! It remains to be seen how much overhead this will add to the Load on/off percentage time. Hopefully people can now retain the specified 350ma 10R load resistor and use thin wires for the BMS connections without problems.

I have also added a fail safe load cut off routine (Constant FailSafeV) to the slave software which will cut off the load if the cell voltage falls below 2.5v irrespective of what the Master is requesting. This precludes the low voltage balancing stuff which I was investigating and I think I will dump the LVB idea anyway as it is not something I would have used.

The error checking of the sent commands only applies to the commands sent manually at present via the Commands menu. I might also try and do some command checking for Commands 1-3 sent automatically by the main program loop later.

I'll post the code tomorrow when I have compilied it. Thanks for your help.
Last edited by retepsnikrep on Wed Apr 14, 2010 3:40 am, edited 1 time in total.
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: BMS Software

Postby retepsnikrep » Wed Apr 14, 2010 3:39 am

Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 36 guests