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 » Mon Sep 13, 2010 8:50 am

Ref that new slave software having checked the serial receive commands I find I had it waiting the wrong way up and with even parity :roll: No wonder it didn't work. I hope to re complie and test it later this week.
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 » Mon Sep 13, 2010 9:32 am

Peter, will the master software also have the same issue? It seemed the slave commands from the master where also inverted. Send me a copy when you have made the changes and I'll give it a go.

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:

Re: Old BMS Software Thread

Postby retepsnikrep » Mon Sep 20, 2010 11:20 am

Still testing

The slaves are now receiving the serial commands correctly and acknowledging them. 8)

The slave alive toggle is working correctly every five seconds as the serin timesout. So the loads get turned off.

i can make the load led come on and get the software version etc

The master is sending, receiving and acknowledging the commands in the slave update mode. 8)

But the master it is still giving a data error in the normal get the cell voltage routine, which implies one or all of the three commands sent in this part of the program is having a problem :? Nearly there :?:

Anything obvious?

www.solarvan.co.uk/bms/PBP_SERIAL_SLAVE_V06_130910.txt
www.solarvan.co.uk/bms/PBP_SERIAL_MASTER_V14_050910.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:

Re: Old BMS Software Thread

Postby GregsGarage » Mon Sep 20, 2010 1:34 pm

I haven't had the time to look at the code yet, but have you tried commenting out the load on and off commands to see if the voltage data can get through. Once that is working add in the other commands.

EDIT: Peter, nothing jumps out at me after looking at the software. I am guessing that your testing was with a single slave (master set to 1 slave). Could you send me the hex files and I will try on my setup and make sure multiple slaves can receive commands, turn on leds, ect.
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 » Tue Sep 21, 2010 8:59 am

Sorted now 8)

It needed a delay between the master sending the three commands in sequence of 2ms per command.

Scoped it and worked it out.

The Master sent command 2, turn off loads and this was echoed back fine. Master then sent command 1 and this failed with data timeout error. The reason being that the slave was not ready to recieve the command 1 because it was still sending the previous command to the next slave :roll:

The slave code has two serial out commands in sequence.

Code: Select all

serout MasterBus,T9600,[VData]   'Send VData or echo command to Master at Baud9600 (MasterBus)
serout SlaveBusOut,T9600, [Command]     'Send Slave command at Baud9600 (SlaveBus) to next slave


The master gets the commands back on the master bus and because it had got the first command back it immediately began transmitting the next command whilst the slave was still in the second serout above talking to the next slave!!
The delay may not be required when using a larger number of slaves. I think this issue was peculiar to a single slave on test.

Tested the Master lock up function, and killing the master whilst the slave has a load energised cause the load to turn off after the slave serin command timesout after 5 seconds. The slave fail safe high and low V continue to work even when master is not active 8)

The only real issue to solve with the master now is the timing routine to get the soc working correctly.

http://www.solarvan.co.uk/bms/PBP_SERIA ... 210910.txt
http://www.solarvan.co.uk/bms/PBP_SERIA ... 210910.hex

http://www.solarvan.co.uk/bms/PBP_SERIA ... 210910.txt
http://www.solarvan.co.uk/bms/PBP_SERIA ... 210910.hex

Note this code has only been tested on a single slave. After programming the Master now defaults to 1 cell.

Note this code also requires the button PCB I supply.
Switch2.jpg
Switch2.jpg (46.71 KiB) Viewed 13875 times
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 » Tue Sep 21, 2010 9:47 am

I will try it on my 7 cell setup and see how it works. Might not be today, work is busy at the moment.

retepsnikrep wrote:Note this code also requires the button PCB I supply.

http://www.insightcentral.net/forums/at ... witch2.jpg


Peter, that link only works for registered users of the insight forum. I know registration is free, but could you post the pic so it is more easily accessible?
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 » Tue Sep 21, 2010 10:38 am

See above.

I'll send the switch, resistors and pcb FOC to master board owners if they send me their postal addresses.
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 » Tue Sep 21, 2010 3:54 pm

Peter,

Tried with one slave connected and it is o.k. Then tried with 7 slaves connected and it is not working. :( Sending comand 7 turns on led 1 and 2, they stay on constantly, led 3 flashes once followed by led 4. Sending comand 8 gets back random values for each cell, different each time. Only 1st cell voltage is reported accurately. I suspect that the problem is on the slave bus. The master is sending o.k. and the first slave receives o.k., but I don't think the serout on the slave is correct (just for the slave bus). Why does the slave use the command serout SlaveBusOut, T9600, [Command] 'Send Slave command at Baud9600 (SlaveBus) to next slave and the master uses the command serout SlaveBus,N9600, [1] 'Send Command 1 (Report Cell Voltages)? Could this be the problem?

P.S. could you send me one of the button pcbs, thanks.
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 » Tue Sep 21, 2010 4:10 pm

I had suspected that may be a problem but we have never used serial comms to this point so i wasnt sure.

I agree the slavebus out in the slave software should probably be N9600 not T9600.

I'll have a tinker tomorrow
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 » Tue Sep 21, 2010 9:41 pm

retepsnikrep wrote:The only real issue to solve with the master now is the timing routine to get the soc working correctly.


If I understand the soc routine, you are directly converting battery current into soc. Maybe it would be easier to calculate ah used and compare that to battery capacity to calculate soc. This may also make wh/mile easier to calculate as well.

For example, the program loops once a second, so every second you add or subtract the amp value to the total giving you a running amp/second value. Store pack capacity as a amp/second value (100ah = 360,000 amp/seconds) and you can directly compare the 2 values. Hope that makes sense, what do you think?
Greg Fordyce

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


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 51 guests