Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

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

Re: Old BMS Software Thread

Postby GregsGarage » Thu Nov 29, 2012 11:27 pm

Look for Serout, Serin and debug commands. They send and recieve the serial data.

Code: Select all

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


Code: Select all

DEFINE DEBUG_BAUD 9600      'Set Debug baud rate


Change all instances of T9600 to T2400 and DEBUG_BAUD TO 2400. This will set baud rate to 2400. They must all be the same in master and slave or you will have problems. Debug is only used in the master.
Greg Fordyce

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

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Fri Nov 30, 2012 2:13 am

changing the baud rate gave me different voltage readings, but still not correct voltage readings. changing the debug baudrate made the display garbled so i changed it back to 9600. i have a couple questions about a few code lines, for example this line in the master where it reads in voltages from the slave

serin MasterBus, N2400, TimeOut, DataError, BD[VarA1] 'Receive Cell Voltage Data


i'm curious what the timeout means. i'm also looking at this line in the slave code:

SERIN2 SlaveBusIn, 16468, 10000, TimeOut, [Command] 'Receive Command Byte on Slave Data Bus Timeout 10s


i guess i'm not entirely sure how it all functions still.

it seems like the master is accepting inputs but missing the first bits. i'll try adding a pause. i feel like i'm still doing something wrong though, cause i don't know why different optos would cause all this.

*edit*

added a 30ms pause in the slave code before sending voltage data, and it's still giving the same results. i guess it's time to change out the optos and see if it makes a difference.

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 Nov 30, 2012 6:45 am

The Debug baud rate in the master is used to drive the screen so leave that at 9600.

The timeouts are used to prevent the program hanging at that point if no data is being recd.

In the slave for instance in the abscence of any data it will still loop every ten seconds and take voltage readings and turn the load/on/off etc as reqd by the failsafe settings.

You need a scope on the masterbus so we can see the waveform at the input into the master pic. What value pull up/down have you got on the master bus pic input.
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 Nov 30, 2012 11:17 am

Ooops, forgot the debug was for the display, I am using degug in my 6802 slave software. :?

isaac_alaska1 wrote:SERIN2 SlaveBusIn, 16468, 10000, TimeOut, [Command] 'Receive Command Byte on Slave Data Bus Timeout 10s

i guess i'm not entirely sure how it all functions still.


A breakdown of this command;
    SlaveBusIn - is the pin number on the pic connected to the slave bus, defined at the start of program
    16468 - is the mode number. pbp defines some common mode numbers like N2400 but you can define your own, refer to the pbp manual for details
    10000 - Timeout period of 10 seconds
    Timeout - Think of this as "Goto program label Timeout after waiting here for 10 seconds"
    [Command] - Store received command in variable "Command"
http://melabs.com/resources/pbpmanual/

As Peter has said, we do need to see a scope pattern to really see what is going on.
Greg Fordyce

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

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Sun Dec 02, 2012 10:20 am

i took the following plots off the masterbus with three (i think, i forget now, i'll double check tomorrow, it may have been 4) cells attached. cell1 reads the correct voltage but cell2 and cell3 are reading false (low) voltages. they should all three read 4.02V but cell2 and cell3 are more like 3.2 volts (i can get the exact numbers if you want them)
scope divisions are seen in the plots. For starters, it looks like the masterbus needs a harder pullup resistor?

the pulses in the zoomed out view are numbered and correspond to the image numbers of the other six views.
Attachments
scope_2.png
scope_2.png (43.94 KiB) Viewed 9223 times
scope_1.png
scope_1.png (43.4 KiB) Viewed 9223 times
scope_0.png
scope_0.png (27.16 KiB) Viewed 9223 times

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Sun Dec 02, 2012 10:27 am

i can only attach three at a time, so here are the other views. 4, 5, and 6 are all identical so i didn't attach them all.
Attachments
scope_4.png
scope_4.png (24.08 KiB) Viewed 9223 times
scope_3.png
scope_3.png (24.25 KiB) Viewed 9223 times

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 Dec 02, 2012 6:01 pm

isaac_alaska1 wrote:For starters, it looks like the masterbus needs a harder pullup resistor?


Correct!
Change it to 1k max and check scope again.
Try 510R if it is still not much crisper.
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.

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Sun Dec 02, 2012 10:37 pm

There should be a slave pullup as well, right? Do you have a schematic of the current slave? The only one I know of Is an older version.

edit*

i dont' think i have the v2.00 master schematic either.

glyndwr1998
Posts: 112
Joined: Wed Mar 06, 2013 12:34 pm

Re: Old BMS Software Thread

Postby glyndwr1998 » Sat Nov 07, 2015 7:15 pm

Hi Greg,

Is there any chance anyone could point me in the right direction of setting up the master / cell boards.

I only intend using 1 16 cell slave board, got from Greg but of course this kit was being used by Greg in his ev.

So, I need to set up the bms for only 16 cells, and I have no idea how to wire up the switch or how to command or use the switch.
I have read through many many pages of the old and new bms pages plus software pages, I've found reference to the switch and a jpg of the switch built up on the switch board but not how to connect it to the master board, which pins the 3 wires from the switch connect to

Also, any reference how to use the switch.
Will the switch allow access to the program to alter the number of cells manually via the switch without having to reprogram the master board.
Any help greatly appreciated.
Anthony.

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

Re: Old BMS Software Thread

Postby martinwinlow » Sun Nov 08, 2015 12:30 pm

I assume you mean the switch(es) to interact with the BMS?

Do these help? The schematic shows discrete switches but I seem to remember Peter suggested using a 5 way switch (like a joystick - up, down, left, right and push) to effect much of the functionality in a much more compact/cheaper/easier to use way. MW

[img]
BVS%20BMSKeyMatrixLeds%20-schem.jpg
Master20082009%20-%20schem%20200k.jpg
[/img]
Attachments
BVS BMSKeyMatrixLeds -schem.jpg
BVS BMSKeyMatrixLeds -schem.jpg (228.69 KiB) Viewed 8027 times
Master20082009 - schem 200k.jpg
Master20082009 - schem 200k.jpg (141.87 KiB) Viewed 8027 times
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 3 guests