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:

Postby GregsGarage » Mon Dec 14, 2009 10:56 am

I was thinking of the tracking code being in the Master software. My idea is this, when charging all the cells stay around 3.3 - 3.4 volts until nearly finished. Then they start climbing rapidly after hitting 3.5 volts. If you had 1 or 2 cells that got to 3.5 volts before the rest you can set the load voltage at 3.5 volts. Once you get a certain number of cells to 3.5 volts then the master starts to increase the load voltage level of the slaves so that only the lead cells load are on. Keep doing this until you get to some upper limit, 3.65 volts or whatever. At this point you finish the charge as normal, but the lead cells have had some extra balancing. But this can all be added to the master at a later time, once the slaves are working properly.

I would still keep all 4 commands. You only need 2 but if you wanted to increase the difference between CutInV and CutOutV you will need all 4 commands. Normally though you should only need to increase CutOutV and decrease CutInV.
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 » Mon Dec 14, 2009 11:01 am

Some new code today. 8)

This use varying length pulses on the slave bus for the commands and avoids the risk of the slaves ever getting stuck in the serial in command.

Seems to work fine with my three test slaves.

www.solarvan.co.uk/bms/MASTER_8mhz_1412 ... 00BAUD.txt
www.solarvan.co.uk/bms/SERSLA13.HEX
www.solarvan.co.uk/bms/SerSla13.pbp

Commands have been revised slightly as per Greg suggestion and baud rate change function now works.

Command 0 = Send Cell Voltage on Master Bus (1ms pulse)
Command 1 = Increase Load Operation Voltage by 10mv (2ms pulse)
Command 2 = Decrease Load Operation Voltage by 10mv (3ms pulse)
Command 3 = Set Slave Load Defaults (4ms pulse)
Command 4 = Turn On Slave Load for one second (Flashes Led) (5ms pulse)
Command 5 = Set Baud rate to 9600bps (6ms pulse)
Command 6 = Set Baud rate to 2400bps (7ms pulse)

Missed Gregs post above but noted his comments, though I'm only going to implement the two load commands.

The tracking idea may be useful later but can be implemented in the Master without any further changes to the slaves.
Last edited by retepsnikrep on Mon Dec 14, 2009 7:53 pm, edited 2 times 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:

Postby retepsnikrep » Mon Dec 14, 2009 6:45 pm

I've noticed a few things with my cells over the year I have had them in and running.

1) I had one cell failure from an unknown cause.

2) The cell with the highest internal resistance is not the cell with the least capacity, not in my pack anyway. (Cell 26) is my high IR cell, it sags more under load and rises to a higher voltage under charge/regen, however when I drive the pack to 100% discharge it is not the first cell to fall below minium voltage.

It's quite interesting watching the highest and lowest cells, you get a feel for the pack quite quickly.

3) Temperature does effect them and they work best at about 20-35C

4) I still do the odd 250ma manual balancing charge to keep them super balanced. This only takes a few hours indicating they don't get far out of line in routine use.

5) They are not all equal capacity and probably vary by about 5% and this is usually 5% more rather than less capacity.
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:

Controller cutback

Postby GregsGarage » Tue Dec 29, 2009 10:20 am

I need to decide how to implement the controller cutback on my vehicle. The BMS at the moment activates the opto on J7. The question is what do we do with this? On Cedric's cell protectors he would connect this to the throttle potentiometer so that the low warning gradually slows the vehicle down. But his devices are analog and so automatically give a gradual reduction in output. For our digital output, we would need to simulate this using a PWM output on J7. That requires a bit of work on the software. I have thought of another possible way that the controller cutback could be implemented.

I have ordered one of these controller kits. It has some nice features, one of which is a rpm limiter that is completely done in software, no rpm sensor connected to the motor! 8) Another thing this controller has is a serial port that allows parameters to be viewed and/or updated on the fly. One of the parameters is a battery amp limit.

So when the cells get close to empty the internal resistance starts to go up. The effect of this is a larger voltage drop under load. So if we get a low cell warning at say 200 amps then we could adjust the controller so the max battery amps is say 180 amps. And when we get the warning at 180 amp, then lower it to 160 amps, etc, all the way till we get to 1 amp (setting the battery amp limit to 0 disables the feature). By continually reducing the max battery amps in the controller we gradually slow the vehicle down till it won't move any more and save our cells from destruction.

Originally I was thinking of having the bms master directly connected to the controller and sending a serial command to the controller. But maybe it would be better to have another module, maybe an Arduino, that can interface with the controller and adjust the battery amp limit anytime it gets a warning from J7 on the master. I have some other plans for this Arduino as well, but am open to any other ideas and/or comments about this plan.
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 » Tue Dec 29, 2009 11:43 am

Interesting link, good luck with that.

We can soon send a serial signal out of the controller cutback opto. That seems easiest. we can do upto 9600 baud 8,N,1 if required.

Have you any blurb on the way the new controller kit deals with the serial signal? specs etc.

I don't like the idea of another board inbetween as that's just another possible failure point in the system. But up to you.
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 Dec 29, 2009 1:17 pm

Thanks to Night Train for the original link to the controller. He posted it a while ago in the introduction section. I hope to have the kit near the end of January.

I like the idea of using the cutback opto for serial comms. I will have to find out the exact command, format and data rate to send. For the software I would guess we need a controller cutback routine that we can call whenever we get a warning. It would look at the amps value and then send to the controller a value that is maybe 10 or 20 amps less, just making sure the value is never less than 1.
Greg Fordyce

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

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Tue Dec 29, 2009 3:51 pm

Greg,

Is the controller kit you are referring to the one by Paul?

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

Postby GregsGarage » Tue Dec 29, 2009 8:15 pm

Rick, yes that is the one, I see you also have found Paul's controller.

Peter, the command needed to send to the controller is "bat-amps-lim 200\r" where \r is carriage return (0x0d). This would set the limit to 200 amps. Substitute 200 for whatever variable you want. The default baud rate for the controller is 19200 8-n-1 but it can be set to 9600 easily (so I am told). I will have a go at a simple routine to do this. I will probably need some help with setting up the actual comms, but I'll do what I can. Thinking about this, I don't think it is necessary to know what the battery current is. When we get a warning set the bat-amps-lim to some value, say 200 amps and then start decreasing maybe 10 amps at a time until the warning goes off. This would be much simpler to do. The initial current limit would slow you down quite a bit and lets you know you have a problem, and if you keep driving power keeps getting reduced as the batteries deplete.
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 » Tue Dec 29, 2009 8:58 pm

OK. Does the controller sit listening on this serial port all the time?

I assume the controller has an initial limit set (550A?) are we going to set this with the Master on BMS start up? We could vary this depending on the cell temperature as well to set a lower limit for cold days.

We only check the cell voltages once a second and depending on the variable (AlarmActivate) it can be several cycles before an alarm is triggered. (I have it set to 3, so three consecutive alarms have to occur before an alarm is triggered, that takes three seconds)

The master could look at the last current before the alarm, and then set the current limit to 50% of that.

If the cell V is still low on the next cycle it would set current to 50% of the previous level. This drops the current down very quickly.

Going down 10A at a time may take many cycles before the current draw drops suffciently to allow the cell voltage to recover to > min value.

You will also have the audible and visual alarm anyway and can simply ease off on the pedal!
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 Dec 29, 2009 9:48 pm

retepsnikrep wrote:OK. Does the controller sit listening on this serial port all the time?


Yes, it also can send data, but we don't care about that.

I assume the controller has an initial limit set (550A?) are we going to set this with the Master on BMS start up? We could vary this depending on the cell temperature as well to set a lower limit for cold days.


It actually has 3 current limits, software motor and battery current limits and hardware motor current limit as a failsafe. It only actually measures motor current, battery current is calculated from motor current*pwm%. The command I gave sets the battery current in ram. It is also possible to store the values in eeprom so they are saved after power off. Yes we could set values for cold days, valet mode, etc.

We only check the cell voltages once a second and depending on the variable (AlarmActivate) it can be several cycles before an alarm is triggered. (I have it set to 3, so three consecutive alarms have to occur before an alarm is triggered, that takes three seconds)

The master could look at the last current before the alarm, and then set the current limit to 50% of that.

If the cell V is still low on the next cycle it would set current to 50% of the previous level. This drops the current down very quickly.


That was what I was originally thinking, but then I thought, make it simple to start with and see if that works.

Going down 10A at a time may take many cycles before the current draw drops suffciently to allow the cell voltage to recover to > min value.


O.K. so 10 amps might not be enough, maybe 40A, but a bit of trial and error should sort it out. A lot will also depend on the vehicle and driver preferences, how aggressive they want it to limit current.
Greg Fordyce

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


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 4 guests