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 » Wed Sep 22, 2010 6:23 am

Re SOC. That's a good idea but lets get it working as is for now then consider that. I need a timing routine for an other project so must get to grips with timer1 :roll:

Did you remember to change the pull down resistors on your slaves?

We have to remember the slaves operate the optos using sink driven outputs. They idle high.
So when the slave pic ouputs are high the optos are off. This is used as it works better at lower cell voltages.

The master is not the same and uses source drving i.e. Output low opto off.

I'll try and look again at this today with my multi slave board and half a dozen cell. Peter
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 » Wed Sep 22, 2010 8:45 am

I tried this this morning with 8 cells on bench no problems at all. Used same sofware i uploaded yesterday.
Seems to work very well 8) Current consumption per slave is <1ma

I like the fail safe way it cuts the load if Master dies but can still bring it back on if cell V goes over 3.85V.

BMS.jpg
BMS.jpg (90.75 KiB) Viewed 13779 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 » Wed Sep 22, 2010 11:16 am

Problem is on my end then. :(

I did change the pull down resistors and they worked with the pulse software. I'll reprogram the slaves again, maybe one of them didn't program correctly. Don't know if I will have time to do it today.
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 » Wed Sep 22, 2010 1:35 pm

OK try these, cosmetic changes mainly, but i did remove the Master pauses as they are not reqd as long as you have at least two or more slaves. :shock:

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

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

Greg I have sent your button kit.

My Master and 8 slaves is still sitting there happily on the bench chugging away :lol:

This master has no sort of timing routine in it now for the main loop. In the short term it will be easiest to just scope the master watchdog pulses once you have all your cells attached/running and calculate how much of a pause we need to add to make the main loop execute once per second. Not rocket science but good enough.
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 » Wed Sep 22, 2010 3:52 pm

retepsnikrep wrote:OK try these, cosmetic changes mainly, but i did remove the Master pauses as they are not reqd as long as you have at least two or more slaves.

I will try the version you have working first. My plan is to pull all the pics and insert them one at a time, testing each one as I go.

Greg I have sent your button kit.
Thanks. :D

This master has no sort of timing routine in it now for the main loop. In the short term it will be easiest to just scope the master watchdog pulses once you have all your cells attached/running and calculate how much of a pause we need to add to make the main loop execute once per second. Not rocket science but good enough.


I suspect that it would take the same time to do a quick and dirty solution as to code in some sort of timing routine. We need to start a timer and pause the loop until 1 second has passed since the last time through. This is how the amp hour calculations are done in my motor controller, except that they force the loop to run at 1000hz so it actually counts amp/milliseconds! :shock: I might have a look tonight and see what is available for timing in the pic.
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 » Wed Sep 22, 2010 4:12 pm

Just time the watchdog stay alive pulses and add a pause so we get one a second.

It's not that easy to implement a 1s timer in PBPRO as the chip is running at 8mhz and max time period for Timer1 is less than half a second. Plus I suspect timer1 is being used in the background my some of the pcbpro commands so we could corrupt it!
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 » Wed Sep 22, 2010 8:24 pm

Was looking on the pbp forums for some timer ideas and found these. The first one is a clock routine that you include in the program and the second one had an idea using timer2 near the bottom of the post.

http://www.picbasic.co.uk/forum/showthread.php?t=190&highlight=elasped+time
http://www.picbasic.co.uk/forum/showthread.php?t=10571

I think the timer2 solution might have merit, will have to look a little closer at it.
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 » Thu Sep 23, 2010 4:31 am

Greg you are welcome to look at the timer ideas. I've spent (wasted) quite a bit of time getting my head round it and just breaking the code so I'll be going for a pause added to make the loop once a second :oops: Unless you come up with a working routine that is. Also there is not much code space left and a pause will only take two bytes 8) leaving some spare for any other tweaks.
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 » Thu Sep 23, 2010 10:28 am

GregsGarage wrote:I suspect that it would take the same time to do a quick and dirty solution as to code in some sort of timing routine.
I can see now that I was wrong, it is indeed a bit more complicated than it looks. :shock:

The simple pause will be the way to go. I would expect that the number of slave will affect this value. What do you think about making this adjustable in one of the menus?

Got the buttons today, thanks Peter.
Greg Fordyce

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

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

Re: Old BMS Software Thread

Postby GregsGarage » Thu Sep 23, 2010 8:35 pm

I found the problem with my slaves, one of the pics wasn't programmed correctly. So the question is which version should I use? At the moment I have version 15 of the master and version 6 in 7 of the slaves. Should I go for the newer version 16 for the master and version 7 for the slaves?
Greg Fordyce

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


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 19 guests