Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

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

Re: Old BMS Software Thread

Postby martinwinlow » Thu Jul 08, 2010 9:27 pm

Hi Peter,

Re-programmed master, watchdog and slaves with the 3 diferent programs you gave me above and all that happens after 2 mins is alarm piezo comes on and yellow dash LED lights - watchdog error? None of the buttons work and even the display doesn't give a splash screen - just goes straight to the noinal display.

I'll have another go tomorrow. 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 » Fri Jul 09, 2010 11:36 am

Martin

You will have to hang on, i'm on nights.

My bench system is not working yet either, once i have that going i'll get back to you.

You will almost certainly have to reprogram your slaves once I have it working correctly.

I added 2 more commands and tried again today.

' 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)


Commands 21 forces the Cell voltage to 3.70V and in theory the loads should come on and the voltages returned to the Master should be 3.70V

When tested today the commands are recongnised and acknowledged via the master bus so data transmission is working correctly however the loads did not come on and the voltgae returned to the Master was all over the place.

The lm385 diodes are providing the right reference voltage at the pic pin.

Very odd i'll keep looking.
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 » Fri Jul 09, 2010 3:45 pm

Peter, I only found the new BMS forum thread last night at... viewforum.php?f=53. I had been relying on my old links. Now it's all a lot more digestible. 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 » Fri Jul 09, 2010 8:42 pm

Just found the Pbpro compiler had a glitch with serin/serout in ver 2.60 which is hopefully the reason for my recent issues. From the PbPro forum today!

If you have PBP 2.60 and are using SEROUT, you should apply the "A" patch that was released last week.
http://melabs.com/support/patches.htm

It fixes the SEROUT/IN baud rate.


Hopefully when re-compiied and i have reflashed my 50 slaves we may be OK again!!
Appologies for that. Might get to try it sorted Monday!
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: Old BMS Software Thread

Postby retepsnikrep » Sun Jul 11, 2010 3:36 pm

I have found the software issue :lol:

There was nothing wrong with the hardware it was a fault in the logic :roll:

So i probably did not need to fit the 100k resistor or the tantalum capacitor which i did in an effort to find the problem!!

Anyway the issue is the commands sent and the delay between them!

The commands 1,2,3 are the core of the system with the multislave boards.

' Command 01 = Send Cell Voltage on Master Bus (0.1ms pulse)
' Command 02 = Turn Off Slave Load (Enhanced Mode Only) (0.2ms pulse)
' Command 03 = Turn On Slave Loads as Reqd (Enhanced Mode Only) (0.3ms pulse)


Command 2 is sent first and is echoed back on the master Bus.

Command 1 is then sent and sends voltage back on master bus.

Command 3 is then sent to and again is echoed back on the master bus.

The issue was that after command 2 had been sent, command 1 was sent before command 2 had made it's way around the 50 slaves and was still being echoed back on the Master bus, this then collided with the voltage data which had begun to be transmitted on the master bus by the first slaves. Also command 3 was sent before the voltages had all been recieved and also caused a collision!! :shock:

If you only have a small number of slaves you don't get the problem as the delays i had in the software were suffcient to mask the potential issue. This is probably why rick has not experienced the problem.

There are a number of fixes.

1) Introduce longer delays into the master code to ensure one command has finished before the next is sent. This is a cludge and cuts down on load balancing on time to around 50%

2) introduce checks into the master code which count the commands back on the master bus, and waits until correct number have been recieved before sending the next one. This would ensure reasonable but not optimum performance.

3) Modify the slave code to remove the echoing of the commands 2 & 3 back on the slave bus. This would give best performance but means reprogramming my 50 slaves again :roll:

I'll probably go for 3 as this then allows me to upload the latest slave software.

I'll think about that and post some updated code 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 » Sun Jul 11, 2010 4:35 pm

Glad you found the issue Peter, I was looking at the slave software and couldn't see anything.

An idea for version 3 of the master, have the slave bus loop back to the master, then the master will get a confirmation that all the slaves received the correct command.
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 » Sun Jul 11, 2010 4:45 pm

GregsGarage wrote:Glad you found the issue Peter, I was looking at the slave software and couldn't see anything.

An idea for version 3 of the master, have the slave bus loop back to the master, then the master will get a confirmation that all the slaves received the correct command.


Might be able to add that easily with a single opto and resistor on a daughter board and feed input into the interlock input :wink: def reqd for V3
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: Old BMS Software Thread

Postby retepsnikrep » Tue Jul 13, 2010 8:26 am

OK try these Pic versions of the software new Master & Slave

www.solarvan.co.uk/bms/PBP_MASTER_8MHZ_ ... UD_I2C.txt
www.solarvan.co.uk/bms/PBP_MASTER_8MHZ_ ... UD_I2C.hex

www.solarvan.co.uk/bms/PBP_SLAVE_Pulse_V10_100710.txt
www.solarvan.co.uk/bms/PBP_SLAVE_Pulse_V10_100710.hex

What's new?

Lots in Master including option to select your own number of cells on the fly. Default is 50 cells.

I2C temp sensors can now be detected and configured/info saved by software into external eeprom chip. This almost works perfectly just a little bit more to do.

Explore the menus to see what is available.

The current slave command list is

' Command 01 = Send Cell Voltage on Master Bus (0.1ms pulse)
' Command 02 = Turn Off Slave Load (Enhanced Mode Only) (0.2ms pulse)
' Command 03 = Turn On Slave Loads as Reqd (Enhanced 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 (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 Slave to Normal mode (1.3ms pulse)
' Command 14 = Set Slave to Enhanced mode (1.4ms pulse)
' Command 15 = Increase Delay Time by 1ms (Max 10ms) (1.5ms pulse)
' Command 16 = Decrease Delay Time by 1ms (Min 0ms) (1.6ms pulse)
' Command 17 = Set Default Delay Time (5ms) (1.7ms pulse)
' Command 18 = Increase FailSafe Cut Off Voltage by 5mv (1.8ms pulse)
' Command 19 = Decrease FailSafe Cut Off Voltage by 5mv (1.9ms pulse)
' Command 20 = Set FailSafe Cut Off Voltage to Default 3.40V (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)
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 » Tue Jul 13, 2010 10:48 am

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
Last edited by martinwinlow on Tue Jul 13, 2010 12:39 pm, edited 1 time in total.
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 » Tue Jul 13, 2010 11:03 am

Link?
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 7 guests