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:

Data Logging

Postby retepsnikrep » Mon Sep 07, 2009 5:55 pm

Got Data Logging directly to an Excel Spreadsheet working now over remote link.

You need Microsoft Excel installed. You also need the PLX-DAQ installed from here. http://www.parallax.com/Portals/0/Downl ... nstall.zip

You need the Pixcaxe USB programming lead from the remote to your PC.

This modified Excel spreadsheet logs all the data into simple columns.

www.solarvan.co.uk/bms/EXCELBMS.xls

This example from a few minutes charging of my own car shows the data.

www.solarvan.co.uk/bms/EXCELBMSEXAMPLE.xls

You can see at 18:43:41 I turned on the charger and then current tailed off within seconds as voltage rose as battery was charged anyway.

Edit

Here is the working remote display code for the Picaxe 08M for the above data logging.

www.solarvan.co.uk/bms/RemoteDisplay100909_v16.txt

The below version of the Master also works better at 8mhz in conjunction with the above. My display also works properly when cold without fiddling with the resonator/crystal. :roll: The long term data is also written to eeprom once every ten sconds instead of once a minute as before.

www.solarvan.co.uk/bms/MASTER_8mhz_1209 ... 00BAUD.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.

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

End of charge detection.

Postby retepsnikrep » Sun Sep 13, 2009 10:29 pm

Still bearing in mind Greg's horrible experience I have added some end of charge and/or battery fault detection.

When the charger mains relay is operative the Master keeps a record of the highest pack voltage reached.

The pack voltage slowly increases during charge as we know, my Zivan NG3 charger operates in CC mode initially then CV mode later on, rising to a max of about 176V for my pack.

The battery voltage should therefore never fall significantly during charging unless >

1) The charger cycle has finished and the charger has terminated charging using it's own system. The pack voltage will then slowly fall to it's resting voltage. This is what happens most of the time in my setup, the BMS rarely intervenes.

2) A battery has developed a short or some other problem causing the terminal voltage to drop.

Now as soon as a pack voltage drop of more than 250mv is detected during charging the charger relay is turned off. If that is too sensitive/not sensitive enough I can change it to another value as it is stored in the constant "VoltageDrop". (25 being 250mv)

This also helps reduce the load on the 12v car battery as the charger relay (powered by the bms) is now turned off once charge is completed. I'll test this tomorrow and post the updated code.

I also made some small changes to the SOC code so it never goes over 100% or below 0% now, which was causing an issue with the whmile calculation between different journeys :roll:
Last edited by retepsnikrep on Tue Sep 15, 2009 1:16 pm, edited 1 time in total.
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:

End Charge/Battery Fault Detection

Postby retepsnikrep » Tue Sep 15, 2009 1:03 pm

Here are the working software updates.

Master 1.66 now includes End Charge/BatteryFault detection which turns off the charger mains relay if the pack voltages drops by more than 250mv during a charging cycle.

This also sets an Alarm (6) which is sent to the remote, which signals an Alarm and sounds a short tone before stopping. So you know in the house when the Charge has ended :wink:

The End Charge remote alarm tone is short and distinguishes it from the normal errors which sound a continious tone.

Tried it today and it correctly identified when my Zivan had completed it's cycle and turned off after about 20 seconds, switching off the charger relay and updating the remote.

www.solarvan.co.uk/bms/MASTER_8mhz_1409 ... 00BAUD.txt

www.solarvan.co.uk/bms/RemoteDisplay140909_v18.txt

Also added Chg status flag to BMS Master screen so you can see if the charger relay is active.
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:

Postby GregsGarage » Tue Sep 15, 2009 8:48 pm

Good work Peter, definitely like the charge fault detection and switching off the charger relay after it has finished so it can't come back on again.

P.S. The new master pcb looks good as well, haven't had time to give it a good look though.
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:

It's easy to make mistakes!

Postby retepsnikrep » Tue Sep 29, 2009 6:33 am

A classic error from me in Master Software.

I was wondering why Wh/mile was giving very odd results :oops:

Code: Select all


symbol TripStore = 254      ;EEprom address Word data [Trip]     (Dec 254 + 255) Stored every 10 seconds
symbol PrevOdo   = 256      ;EEprom address Word data [PrevOdo]  (Dec 256 + 257)
symbol PrevSoc   = 258      ;EEprom address Word data [PrevSoc]  (Dec 258 + 259)



Spot the error in the above :roll:


Get it?

The picaxe EEprom only extends to 256 bytes (0-255) I was busy storing stuff in an immaginary place!!!! at locations 256 upwards :shock:

I've now corrected that and will report back tonight when I get a chance to try it.

Edit

Phew! The wh/mile code works now. :wink:

www.solarvan.co.uk/bms/MASTER_8mhz_2909 ... 00BAUD.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:

Postby GregsGarage » Tue Nov 17, 2009 9:07 pm

I have been looking at the master software because some of the parameters will require changing for my pack. Namely;
    symbol Cells = 45 ;Number of cells in the battery pack (45) (Max is 128 cells for 28X1 Picaxe)
    symbol MaxPackVoltage = 16200 ;Maximum pack voltage = 162v (16,200 as 16 bit value) Res 10mv (Max 650v)
    symbol MinPackVoltage = 10800 ;Minimum pack voltage = 108v (10,800 as 16 bit value) Res 10mv
    symbol SocUnit = 120 ;SocUnit constant for Soc calculations. for 120ah cells (1 Unit = 120)
It might be better to group these first in a section called "Main Constants" and the rest "Other Constants". The Main constants would be the ones that require changing, number of cells and capacity, for different packs. The other constants can be considered advanced settings, only change these if you know what you are doing. Also in Main Constants I would add;
    symbol SpeedConstant = 7908 ;Value suitable for Insight VSS
    symbol CurrentConstant = 3 ;Value suitable for Allegro 100a current sensor
These last two would need to replace the values in the code. this makes it easier to customize the program for different vehicles. I haven't given the current sensor much thought yet, but for the speed sensor I am thinking that a small program could be loaded onto the master to help calibrate the speed sensor. My idea is that you drive the car at 30mph and then press one of the buttons. The display will then show the pulsin value and calculate the value required for SpeedConstant. It could take five readings on a continuous loop and average them for better accuracy. Each button press steps stores the next value, when you get to value five, the next press replaces value 1 and so on until you are happy with the results. Write down the final value for SpeedConstant, adjust the master software with the value and upload the program to the master. Also for those who may want km/h instead, just drive the car at 30km/h and change all references from mph to km/h. Any comments, suggestions?
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:

Postby retepsnikrep » Wed Nov 18, 2009 6:51 am

Good Ideas Greg.

Be my guest and have a fiddle about, send me copies of the modified software and I'll keep them in a seperate folder, if you break it at any point I can then help. I'm still snowed under with Insight stuff for at least another couple of weeks.

I think there is a discussion earlier on the hardware thread about the current sensors, the new Master V2 board does have options for the 500A one you are considering.

The master software still has a couple of issues.

It's messy!

The wh mile / miles remaining code throws a wobbler every now and then, I'm still not happy with that and although some of the problem is probably interference related in my application the code is a bit suspect.

My Master board V1 operates now 99% of the time glitch free. It will occasionally reset itself losing the soc under particular conditions in my car related to heavy use of assist and mega EMI!!! I live with it.

Master V2 hopefully may be a bit more resistant to emi as it has more filtering built in and a slightly different layout.

If it works in an Insight IPU compartment then it will work anywhere!! :shock:

Re mph/pulsin

There is some test software and I have just added a very short untested section to get the speed sensor pulse value :wink:

Have a play with that.

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

Postby GregsGarage » Wed Nov 18, 2009 12:02 pm

Thanks, I will have a look at that.
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:

Cheap as chips?

Postby retepsnikrep » Mon Nov 23, 2009 2:35 am

I've been thinking about making a picbasic pro version of the Digital slave software which would avoid the need for the Picaxe chips at a considerable saving. I appreciate updating them would be more difficult but I haven't touched the digital slaves in my car for nearly a year. That's not to say there won't be further software developments though!

I'm currently using a cheapo pickit programmer for my other projects and it can do ICSP or uses a zif socket adapter. It's bloody good.

http://www.piccircuit.com/product.php?id_product=26

Rick did a lot of ground work on a picbasic pro version of the software but struggled with the comms (I don't think he finished it) I may revist that in the next few weeks and hopefully get it working! Comments?
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:

Postby GregsGarage » Mon Nov 23, 2009 11:30 am

Peter, Do you have a copy of Rick's code so far? Maybe you could put up a link so others can have a look at it as well. I won't order any picaxe chips yet, will put sockets on the newly arrived boards instead.

Greg
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