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:

Postby retepsnikrep » Wed Dec 02, 2009 12:42 pm

I've started tinkering with some remote command software for the slaves, comms at 9600 baud from and to Master. Master just sends a high signal on slave data bus then waits until slave ready say 2-5ms then it sends one serial command byte 0-255 (commands) this propogates through slaves in exactly same was as now.

Sending a 1 causes slaves to dump cell voltage on Master Bus
Sending a 2 increases load cut in voltage my 10 mv
etc etc.

Nothing tested yet just writing.

For the next generation Master & multi Slave boardsI would like to include one further opto so the slave bus returns to the Master and the Master can compare the data (command) it sent out, to the data (command) the last slave sends it back. Just good for data integrity. We know then that each slave has received and passed on the correct byte/command.
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:

Postby retepsnikrep » Thu Dec 03, 2009 1:45 am

Still writing but hope to release some new software for V2 master boards and non picaxe slaves very shortly.

I've added the serial command system and it also includes some safety checks.

The Master can send 6 commands now to the slaves.

1) Report cell voltage (This is the standard system)

2) Increase Load resistor cut in voltage by 10mv
3) Decrease Load resistor cut in voltage by 10mv
4) Increase Load resistor cut out voltage by 10mv
5) Decrease Load resistor cut out voltage by 10mv

6) Set Load resistor cut in/out voltage to slave defaults

The Master sends the serial data commands on the SlaveData Bus which cascades from slave to slave. Each slave also dumps the command it receives onto the MasterData bus (just like the cell voltage) and the Master checks that each slave echoes back the correct command value.

Any command error confusion or serial data timeouts should show up.

If an error occurs and the slaves get out of sync with one perhaps having a higher load cut in volatge than the others due to a failed transmission then Command 6 can be used to reset them all and you can start again.

I might add the option to change baud rates between 2400 and 9600 later. So people with really noisy systems or only a few slaves can go for slower comms if required.
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:

Postby retepsnikrep » Sat Dec 05, 2009 9:26 am

The new non picaxe slave software is comming on. The update code seems to work on the bench.

Important.

The Master code V1.73 onwards is for the Master Pcb V2 and the non Picaxe slaves only!

It won't work with picaxe slaves due to incorrect data baud rates. Nor will it work correctly with the Master board V1 as some of the inputs/outputs have been changed.

The non picaxe slave software will be available in two versions.

1) Standard with exactly the same features as the current picaxe digital slaves but working at 9600 or 2400 baud, but not 4800 baud. They only need a simple high signal on the slave bus to start transmission of the cell voltage. The load cut in out V etc is set in the slave software as now and is not adjustable on the fly. You could have some other Master listening to the Master bus say a pc or whatever.

2) Advanced with serial comms to and from the slaves at 9600 or 2400 baud, and the ability to adjust various slave parameters by sending commands.

Edit

Short Video Showing developments.

http://www.youtube.com/watch?v=z0pgUEU15Io

Latest Software

Master V2 Pcb

www.solarvan.co.uk/bms/MASTER_8mhz_0412 ... 00BAUD.txt

Non Picaxe Slave Software

Standard Slaves

www.solarvan.co.uk/bms/PBPSLA05.HEX
www.solarvan.co.uk/bms/pbpsla05.txt

Slaves with command function

www.solarvan.co.uk/bms/SERSLA07.HEX
www.solarvan.co.uk/bms/SerSla07.txt
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:

Postby GregsGarage » Sun Dec 06, 2009 12:33 am

Looks like you have been busy. Had a quick look at the slave software and looks good.

Someone by the name of Jos on the EV Tech list was wondering if anyone had done a 144V 40ah insight conversion, I replyed with your website address, he may be in touch.
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:

Slave Alive

Postby retepsnikrep » Mon Dec 07, 2009 9:44 am

We now have a spare unconnected pin (7) on the non picaxe slaves that was used for the picaxe programming input.

I've designated it an output in the new code and it is now used as a Pic alive test point. It toggles high/low every time through the main program loop. I can also use it to time the loop and then work out minimum delays reqd to ensure an interupt is detected on the Slave bus input pin. This should improve performance of a number of slaves. If we suspected a slave was stuck we can scope this pin, if it is toggling high/low then the slave is running.
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:

Testing OK

Postby retepsnikrep » Mon Dec 07, 2009 6:34 pm

Tested the first three slaves on my multislave board with the latest code. Works well and the remote updating function works fine 8)

I timed the main loop section of the non picaxe slaves, and it takes about 1.6ms per iteration. So a 2ms pulse on the interupt pin should do it instead of the 5ms pulse I am using at the moment. That's a useful time saving I can implement later.

www.solarvan.co.uk/bms/SerSla07.txt
www.solarvan.co.uk/bms/SERSLA07.HEX
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:

Postby retepsnikrep » Tue Dec 08, 2009 6:07 pm

More loop timing. The Picaxe Master voltage loop takes 5ms to evaluate the data from each cell as it arrives on the Master Bus, so data bytes must not arrive at faster than 5ms intervals. I have therefore decreased the delay constant in the slaves to get a bit nearer that, the master was waiting a bit before.

This should bring slave to master comms down to about 10ms per cell. Giving 100 cells per second max scan rate. About 100 bytes a second

I'm thinking of writing a cut down Master software for a single PIC12F683 driving a simple two line lcd and doing all the work itself. This could be assembled on a piece of veroboard. 8)

This would also be a lot quicker!! Nearer 960 cells/bytes a second but no fancy controls.

Simple Slave bus out.
Master bus in.
Lcd Out
Button in
Alarm Out
Charger Out

Edit

Tested with 2ms delay instead of 5ms and the three test slaves work fine.

I note the current consumption of the slaves is about 500ua when running at 4mhz and being polled by the Master. That's fine by me but I might add some low power or sleep code later to reduce that when not operating (Being polled).

2000hrs per ah consumed. (80 days)
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:

More Commands

Postby retepsnikrep » Sun Dec 13, 2009 1:25 am

There are now 9 commands that can be sent to the slaves.

Command 0 = Send Cell Voltage on Master Bus (Normal Operation)
Command 1 = Increase Load CutInV by 10mv
Command 2 = Decrease Load CutInV by 10mv
Command 3 = Increase Load CutOutV by 10mv
Command 4 = Decrease Load CutOutV by 10mv
Command 5 = Set Slave Load Defaults
Command 6 = Turn On Slave Load for one second (Flashes Load Led)
Command 7 = Set Baud rate to 9600bps
Command 8 = Set Baud rate to 2400bps

I've got three days off now so hope to finish the code testing and program my 48 slave pics!! :shock:

The one thing that worries me is slaves hanging waiting for a serial command (I am using the serial timeout function to avoid this) or slaves getting out of sync due to an error resulting in some being set at different baud rates to the others. I might still have to use pulsin and time the command pulses to make this work.

It is imperative that slave commands 1 - 8 are only sent when the vehicle is not in use. (driving) A glitch on the communication buses caused by emi noise could cause an issue otherwise.

The Master will tell you if there is a problem with any sent commands due to a timeout or wrong command being sent back by the slave, but then correcting it is quite complicated if the baud rates get out of sync.
: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.

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

Postby GregsGarage » Sun Dec 13, 2009 10:19 pm

Peter,

I like the idea of being able to adjust load voltages. It could help reduce balancing time. You could start the cut in voltage at say 3.5 volts so that you start bleeding current from the lead cell and then track upwards as the voltage climbs until you get to say 3.7 volts. How about adding to the slave software some logic so that the CutInV is always 5mv (or greater) than CutOutV. This would prevent the possibility of setting the CutInV lower than CutOutV, but it also means you can adjust both with one command. If you want to decrease the load thresholds then just reduce CutInV and CutOutV will follow and vice versa.

Keep up the good work.

Greg
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:

Postby retepsnikrep » Mon Dec 14, 2009 4:55 am

That's an excellent, sensible and logical idea which is why I didn't think of it! :roll: Saves two commands as well. I'll implement that.

I don't think the tracking is possible though easily. So i'll leave that.
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 4 guests