Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

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

Re: Old BMS Software Thread

Postby retepsnikrep » Fri Jul 16, 2010 6:20 pm

Martin

I havent had a chance to look at your link yet.

I've been tweaking the Master and Slave PBP code trying to get a final version ready before I install my pack in the car and access to the slaves becomes difficult.

Some earlier code is working fine in the bench.

The experimental code I am working on has a few new features for the slaves.

The new command list is below and i have tried to group the commands together so it is easier to understand. I'll explain the less obvious ones below.

'************** Slave Commands *********************

' Command 01 = Send Cell Voltage on Master Bus (0.1ms pulse)
' Command 02 = Turn Off Loads (Multi Slave Mode Only) (0.2ms pulse)
' Command 03 = Turn On Loads as Reqd (Multi Slave Mode Only) (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 (Flash Led) (0.9ms pulse)

' Command 10 = Set Baud rate to 9600bps (Default) (1.0ms pulse)
' Command 11 = Set Baud rate to 2400bps (1.1ms pulse)

' Command 12 = Report Slave Software Version Number (1.2ms pulse)

' Command 13 = Set to Multi Slave (Multi Slave Mode) Default (1.3ms pulse)
' Command 14 = Set to Single Slave (Single Slave Mode) (1.4ms pulse)

' Command 15 = Increase Command Delay Time by 1ms (Max 10ms) (1.5ms pulse)
' Command 16 = Decrease Command Delay Time by 1ms (Min 0ms) (1.6ms pulse)
' Command 17 = Set Default Command Delay Time (3ms) (1.7ms pulse)

' Command 18 = Increase FailLow Cut Off Voltage by 5mv (1.8ms pulse)
' Command 19 = Decrease FailLow Cut Off Voltage by 5mv (1.9ms pulse)
' Command 20 = Set FailLow Cut Off Voltage to Default 3.35V (2.0ms pulse)

' Command 21 = Set ADC Output Voltage to 3.70V (Test Mode) (2.1ms pulse)
' Command 22 = Set ADC Output Voltage to Cell Voltage (Default) (2.2ms pulse)

' Command 23 = Increase FailHigh Cut in Voltage by 5mv (2.3ms pulse)
' Command 24 = Decrease FailHigh Cut in Voltage by 5mv (2.4ms pulse)
' Command 25 = Set FailHigh Cut in Voltage to Default 3.85V (2.5ms pulse)

' Command 26 = Set Slave to Super (No command echo) (2.6ms pulse)
' Command 27 = Set Slave to Normal (command echo) Default (2.7ms pulse)


The slaves can now operate in several modes. The first 12 commands are fairly self explanatory. So starting with

Command 13. This sets the slaves to Multi Slave board mode, and the slaves then respond to Commands 2 & 3 to control the Loads, which avoids the voltage drop issue and adjacent slave interference. This should be used for all multi slave boards

Command 14. This sets the slaves to Single Slave board mode, and the slaves will ignore commands 2 & 3 and will control the loads themselves.

Command 15 - 17 These control the Slave command propagation delay time, it is adjustable between 0-10ms. A shorter delays means faster slave response, but if you go too low the slaves may miss commands. If you jam then with this command and get the command error when updating, then powering them down and back up will reset them to the defaults.

Command 18 - 20 These control the fail safe low voltage load cut off point to stop cell overdischarge. This overides the cell load on/off control and is especially relevant when the slaves are operating in the multi slave mode, as in this mode the slave load on/off depends upon commands 2 & 3 being sent by the master. The fail safe point can be adjusted up or down. Default is 3.35v which is around the resting voltage for lifep04 cells. The load will always be turned off if the cell voltage falls below this point.

Command 21 - 22 These control the Cell Voltage detection routine and allow the ADC to report the actual cell voltage or a simulated test voltage of 3.70V. This must always be set to report the actual cell voltage in use. The simulated test mode 3.70V is useful to ensure the slave loads respond correctly and come on etc.

Command 23 - 25 These control the fail safe high voltage load cut in point to stop cell overcharge. This overides the cell load on/off control and is especially relevant when the slaves are operating in the multi slave mode, as in this mode the slave load on/off depends upon commands 2 & 3 being sent by the master. The fail safe point can be adjusted up or down. Default is 3.85v which is around the maximum voltage for lifep04 cells. The load will always be turned on if the cell voltage rises above this point.

Command 26 - 27 These control the Super slaves mode. The default is normal mode in which the commands (Except No 1) are all echoed back on the Master Bus. In super mode commands 1,2 & 3 are not echoed back and this allows a faster master/slave response time in normal multi slave board operation.

Some other enhancements are

Slave Code. Improvements in the slave code to detect if a slave or the master is stuck at the command reception/transmission point. This means if a slave is stuck with the slave bus ouput low (calling the next slave) the following slave will be stuck waiting for a command that never arrives. The reception loop now times, out at least allowing the receiving slave to continue with the basic housekeeping and control of the fail safe cell voltages.

I hope to use the internal watchdog timer at some point to implement better slave lock up prevention.

Master Code. Minor changes to prevent unsupported commands being sent to the slaves

I'll publish these versions when all tested and OK.
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.

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

Re: Old BMS Software Thread

Postby GregsGarage » Fri Jul 16, 2010 10:49 pm

martinwinlow wrote:Peter et al,

Re connecting the Master to a PC for data-logging/alternative display/internet access/SMS-ing/GPS etc etc I found this on eBay just now. http://cgi.ebay.co.uk/USB-TTL-Serial-Ca ... _738wt_987 Would it work and if so how would one communicate with it (using VB6)? Anyone got any ideas? I gather it would be Mcudogs' 'RS232 chip (Max232) then to a USB - serial converter ' from an earlier post on page 19 all-in-one??

MW


Martin,

That should work, the driver for the cable should provide a serial port on the PC, it may be different each time you use it so watch out for that. Use a terminal program to make sure you are getting good data from the master to the pc. HyperTerminal is found on all editions of windows up to XP. For vista and 7 you will need to either download it or copy the executable and dll from a XP installation, see the internet for instructions on this. Connect your terminal program to the serial port provided by the USB-ttl cable and see if you get a data stream. I can't help you with the rest but I did see this project a while back, http://sourceforge.net/projects/cantop/ You might be able to get some ideas from it.
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

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

Re: Old BMS Software Thread

Postby retepsnikrep » Sat Jul 17, 2010 1:11 pm

OK this is the working PBP software i have loaded into my BMS.

Slaves.

http://www.solarvan.co.uk/bms/PBP_SLAVE ... ersion.hex

Note this is multislave board software only and supports the first 12 commands from a few posts above.

Master

http://www.solarvan.co.uk/bms/PBP_MASTE ... ersion.hex

Good luck

On loading and running this for the first time you will get a cell 1 error,as it does not know what type of slaves you have or how many there are of them.

Go into the master menus and

1) Set the number of cells to how many you have.

2) Toggle off the super slave mode.

Then it should work fine.
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.

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Jul 18, 2010 12:09 am

Peter,

Hi - tried the 2 new hex files - I can't get the cell number changes to stick - they always get reverted to 50...

How do you know if you have 'super slave' mode on or off?

Do you find your buttons are a bit tetchy? Slecting one option sometimes triggers a second unwanted one? I do - and I found that after a button press, the voltage on C12 took about 200ms to decay, which gives enough time for the ADC to sample another valid voltage level and thus unwittingly 'select another button'. I have replaced c12 with a 10nf cap rather than the 100nf which reduces the ramp to a mere 20ms (ish).

I also did a double sampling version of Menubuttons which only acepts a valid button press if it gets the same VarD/VarC2 value twice in a row...

I changed the default cell no in Master V130710 to 1 to save me having to change the cell numbers and I'm still getting a Cell Error - tho the voltage reading on submenu 2 gives 1.75V...?

I'm about tomorrow if you fancy a chat - PM is best and I probably won't be by the puter, so you'll have to call 1st by landline.

Regards, Martin.
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

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

Re: Old BMS Software Thread

Postby retepsnikrep » Sun Jul 18, 2010 6:24 am

After you highlight the cell number you want using the up and down button, then press the centre button to save it.

Sorry you can't tell if master is in super mode at present just toggle the option until it works.

Have you checked your master against my high res picture.

Have you got the polarity of the slave and master bus connections correct?

Have you tried sending command 9 to the slaves? Do the leds come on and is it acknowledged correctly?

Yes the buttons can be a bit touchy.

Try the master hex file i posted not a modified version of an earlier one.
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.

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Jul 18, 2010 9:21 am

P - Just checked your Master jpg and compared it with mine for components and (Doh!) I see I put in R26, R18, C11, C7 AND C9. I gather R18 just alters the screen brightness (I suspect with my current set up - using the USB video adaptor - this wont affect things much). I'll take out the others and see if that makes any difference.

R, M.
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

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

Re: Old BMS Software Thread

Postby retepsnikrep » Sun Jul 18, 2010 9:37 am

Those capacitors C7 & C9 will def cause it to not work. They will not be included in master V3 :roll:
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.

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Jul 18, 2010 10:21 am

Peter, That's fixed it! All seems to be as it should.

2 things... Would I be right in thinking that if you press a dash button accidentally that eventually the watchdog alarm will sound as there is no pulses going from Master to Watchdog when in programming (submenu) mode?

Is there a way of silencing the watchdog alarm without disconnecting the power?

Is the Eeprom needed for general use if I'm logging the data elsewhere?

My I2C sensors arrived to day (at last). I'll try them out too and with 5 slaves with AA cells next.

Regards, MW.
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

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

Re: Old BMS Software Thread

Postby retepsnikrep » Sun Jul 18, 2010 12:32 pm

martinwinlow wrote:Peter, That's fixed it! All seems to be as it should.

Excellent welcome to the BMS club!

Would I be right in thinking that if you press a dash button accidentally that eventually the watchdog alarm will sound as there is no pulses going from Master to Watchdog when in programming (submenu) mode?

Correct. If you go into the menu mode or away from the main screen for more than a minute then the watchdog will trigger and reset the Master (Remember to ensure the reset jumper is on)

Is there a way of silencing the watchdog alarm without disconnecting the power?

No. That way if you go away and the watchdog has been triggered you know due to the led and alarm sounding when you come back, even though the Master has been reset and may now be back to normal and apparently working.

Is the Eeprom needed for general use if I'm logging the data elsewhere?

Yes as it is being used with the I2C sensors

My I2C sensors arrived to day (at last). I'll try them out too and with 5 slaves with AA cells next.

You need to use the "Temp Rom" mode in the master menu to get the sensor codes and then let me have the data as the Master program will have to be recompilied for your sensors to include this. Or you can have a go at doing it. Do not connect the sensors the wrong way round (Like I did :shock: ) even for a few ms or they will be damaged.

Look at the I2C Temp part of the code and see how it works and you will see sensor data. There are several occurences of data like [$55,$28,$B9,$11,$16,$01,$00,$00,$A4,$BE] in the program. The middle 8 hex values have to be changed to match your sensors in each line that this occurs.

Remember the software supports two sensors.
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.

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Jul 18, 2010 3:39 pm

P, Thanks for that.

... so how do you silence the watchdog alarm?

The thought occurs... could I not use the AXE027 picaxe programming cable to connect the Master to my carputer? From the cables data-sheet... 'The PICAXE USB download cable connects via the computer’s USB port. However the cable contains a tiny circuit board, moulded into the compact USB connector. This circuit contains a USB to serial convertor chip, and so the actual data transfer to the PICAXE chip is via a 5V logic level serial connection. ' ... more here http://www.rev-ed.co.uk/docs/AXE027.pdf icluding circuit diagram. Indeed, could I not just use the existing programming jack - perhaps with a bit of code re-jig?

When I connect my USB cable to export data to my carputer, I assume the info aialable will be the same as the display is showing and I'll have to decode the serial data (chars) as they arrive at the com port?

Regards, Martin.
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 24 guests