Page 28 of 61

Re: Old BMS Software Thread

Posted: Thu Jul 08, 2010 9:27 pm
by martinwinlow
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

Re: Old BMS Software Thread

Posted: Fri Jul 09, 2010 11:36 am
by retepsnikrep
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.

Re: Old BMS Software Thread

Posted: Fri Jul 09, 2010 3:45 pm
by martinwinlow
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

Re: Old BMS Software Thread

Posted: Fri Jul 09, 2010 8:42 pm
by retepsnikrep
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!

Re: Old BMS Software Thread

Posted: Sun Jul 11, 2010 3:36 pm
by retepsnikrep
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.

Re: Old BMS Software Thread

Posted: Sun Jul 11, 2010 4:35 pm
by GregsGarage
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.

Re: Old BMS Software Thread

Posted: Sun Jul 11, 2010 4:45 pm
by retepsnikrep
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

Re: Old BMS Software Thread

Posted: Tue Jul 13, 2010 8:26 am
by retepsnikrep
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)

Re: Old BMS Software Thread

Posted: Tue Jul 13, 2010 10:48 am
by martinwinlow
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

Re: Old BMS Software Thread

Posted: Tue Jul 13, 2010 11:03 am
by retepsnikrep
Link?