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:

Postby retepsnikrep » Sat Jan 09, 2010 9:18 am

All good stuff Greg I'll ponder on the problem.

Could just open up the gap betwen CutinV & CutoutV to 100mv or so.

So say cutin is 3.65, cutout is 3.55 and voltage drop when load is on is 70 mv that effectively makes the gap 30mv not 100mv.

Just add 70mv to cell V before sending it to the Master

I might add some sort of initial load voltage drop calibration command so that when sent, the slaves work out there respective voltage drops and store them for later use.
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 » Sat Jan 09, 2010 10:05 am

OK Here is a test version

Hope you are not superstitious? This has 13 commands. :shock:

; Command 1 = Send Cell Voltage on Master Bus (1ms pulse)
; Command 2 = Increase Load CutIn Voltage by 10mv (2ms pulse)
; Command 3 = Decrease Load CutIn Voltage by 10mv (3ms pulse)
; Command 4 = Increase Load CutOut Voltage by 10mv (4ms pulse)
; Command 5 = Decrease Load CutOut Voltage by 10mv (5ms pulse)
; Command 6 = Set Slave Load Defaults (6ms pulse)
; Command 7 = Turn On Slave Load for 0.5 seconds (Flashes Led) (7ms pulse)
; Command 8 = Set Baud rate to 9600bps (8ms pulse)
; Command 9 = Set Baud rate to 2400bps (9ms pulse)
; Command 10 = Increase Load On Compensation Voltage by 10mv (10ms pulse)
; Command 11 = Decrease Load On Compensation Voltage by 10mv (11ms pulse)
; Command 12 = Set Load On Compensation Voltage to 0mv (Zero) (12ms pulse)
; Command 13 = Calculate Load On Compensation Voltage (13ms pulse)

No 13 calculates the load on compensation voltage.

www.solarvan.co.uk/bms/SerSla17.pbp
www.solarvan.co.uk/bms/MASTER_8MHZ_0801 ... UD_I2C.TXT

I'll try it later, I need to test if having the load turned on on adjacent cells effects the voltage of a cell next door. As the load current for the adjacent cell will be travelling through the sense wire for the other cell :roll:

If it has any significant effect might start to struggle :(

I don't want to have to compensate for loads on adjacent cells as well!!
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 » Sat Jan 09, 2010 10:48 am

Or maybe a thicker gauge of wire? :shock:
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 » Sat Jan 09, 2010 11:47 am

GregsGarage wrote:Or maybe a thicker gauge of wire? :shock:


Yes, don't make the mistake I made please. I used that ribbon cable which was nice and easy to work with but has some voltage drop at 350ma.

Testing this morning the above software seems to work, but when I connect a 350ma load on the next cell the voltage rises by 20mv on the previous cell. Why? So that is a bit of a pain as well.

Looks like I will have to accept a lesser degre of accuracy with remote slaves in my setup. Probably about +/- 75mv

So I will set my load on/off points to be 100mv apart I think. I'll also use voltage compensation and cross my fingers.
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 » Sat Jan 09, 2010 12:11 pm

If you can brave the cold of your garage, maybe you could temporarily wire 2 or 3 adjacent cells with some larger wire. It would be nice to know what the ideal wire size is for a minimal voltage drop.
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 » Sat Jan 09, 2010 2:53 pm

From Don

Peter,

I was going to post this on the forum but for some reason when I registered I didn’t receive a confirmation email and therefore can’t post.

I have looked through the 16 slave code and have the following comment
ANSEL is currently set to %00110010. This sets the ADC clock source to FRC. The spec sheet says “When the device frequency is greater than 1 MHz, the FRC clock source is only recommended if the
conversion will be performed during Sleep. “They recommend %01010010 for active conversions.

In the spec sheet they say “Source impedance of the analog signal should not be greater than 10K” and R5 is 100K in your circuit. I know you said something about dropping this to a lower resistance but I am not sure what you settled on. It should be below 10K.

The problem you currently have with the load switching causing other circuits to switch on can be caused by the fast rise time of the switching. The ringing on the leads caused by their inductance will be coupled between adjacent circuits. I.e. if cell 2 operates it’s load, the lead from + on cell 2 will ring as well as the lead from + on cell 1. This means that circuit 1’s VDD is ringing as well, which could cause it to switch. To overcome this you can take multiple samples as you do now, but instead of averaging them you identify the true average by removing anomalies (switching or noise). You could look for a number of samples that are within a set amount of each other. One way is to check the difference between the highest and lowest samples if the difference is greater than a preset value remove the highest and lowest values and start again with the remaining samples until the difference is within your preset value and then you do an average to get the true result. I will try to put this into code.

I have also done some bread boarding to check the circuit. I was pleasantly surprised to find that the PIC reliably starts up from about 1.6 volts. I was a bit worried as my batteries operate right down to 2.0 V so I need the PIC to work reliably below 2V. I also injected some EMC pulses on the battery leads but couldn’t get it to lock up. It’s a robust little processor.

I read that there was some concern regarding the failure of the load transistor short circuit. To check whether this has happened you could connect the junction of Q1 collector and R2 to pin 2 of the PIC and then read the GP5 input to confirm that the transistor is off when it’s supposed to be.

I am looking forward to receiving the boards so I can start further testing.

Regards
Don


Don care to explain the FRC clock thing in laymans terms :oops:

The next slave board upgrade will almost certainly incorporate ICSP programming for the non picaxe slaves. We can add other functions like the monitoring of the slave load if we have any spare pins ;)

R5 below 10k means the slave draw too much power just sitting there IMO. I used 22k. 100k also works but may be less resistant to interference.
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
timpootle
Posts: 1362
Joined: Wed Mar 14, 2007 12:13 pm
Location: Chorlton-cum-Hardy, UK

Postby timpootle » Sat Jan 09, 2010 4:12 pm

Peter,

I was going to post this on the forum but for some reason when I registered I didn’t receive a confirmation email and therefore can’t post.
Regards
Don


Peter, who is Don? Does he need assistance getting onto the forum?

Also sent by PM
Tim Crumpton

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

Postby GregsGarage » Sat Jan 09, 2010 8:43 pm

Hi Don,

Glad to have you on board with the project. I also don't understand the FRC clock thing, but it always helps to have extra eyes to spot any mistakes. :D

Despite the spec sheet suggesting R5 should be less than 10k, we have had good results with the 100k resistors. So the 22k that Peter is using would be fine. I just realized that I built mine with 100k so we'll see how that works. :shock:

The problem Peter is having with the loads switching on and causing interference/ringing could probably be solved or greatly reduced with larger wiring. I am not an electrical engineer but it seems to me that if we reduce the difference of the voltage between the load being on and off it should reduce the ringing and or interference. Does that make sense? If Peter can get acceptable results with his smaller wiring through software tweeks, then it should work even better with some larger wiring. 8)

When operating down to below 2.0 volts keep in mind that the lowest voltage the slaves can report is 1.75 volts. I am not sure what happens if you go below this.
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 » Sun Jan 10, 2010 8:56 am

GregsGarage wrote:When operating down to below 2.0 volts keep in mind that the lowest voltage the slaves can report is 1.75 volts. I am not sure what happens if you go below this.


Not sure how reliable the opto's will be at that low voltage either.

The reported voltage can be adjusted up or down but the working cell voltage range must fit into a single byte 0-2.55v.

With a mimimum of 1.6 volts then maximum voltage would be 4.15v
With a minimum voltage of 2.00 volts then maximum would be 4.55v

Outside the 2.55v range you would get an error as 0 is sent by the slave.

Bear in mind that if you lock up a slave pic due to low voltage the supply to it may have to be interrupted for it to be re-enabled :shock: You don't want to do that as there are no jumpers on the board. My Highpower & Lifebatt cells are rated down to 2.00V but in reality there is no useable capacity down at that voltage so my absolute minimum cell voltage is set in the Master at 2.40v. Pushing the cells until completely exhausted just increases the risk of problems especially if you are not able to recharge immediately afterwards :(

Lesson 1. How to kill lithium cells?

Answer. Leave them exhausted and with parasitic drain which drags voltage below minimum!

Here endeth the first lesson! I've been there and have the tee shirt/dead cells to prove it.

RE Slave

I've now increased cell voltage oversampling x10 to 100 samples which should reduce the influence of spikes etc by a corresponding amount.

The slave remembers the cell voltage value from the previous complete x100 loop, so if the current adc loop is interrupted due to a command request it always uses the previous stored voltage. This ensure a complete and accurate cell voltage evaluation is used.

I've changed 'ansel' as suggested by Don and corrected a couple of errors.

I'll try it today and post later if it works.

PS I agree bigger wires would be better however it's a compromise, as the 50 way dsub bms connecter i'm using would be a pain to assemble if wires were much bigger. A higher value load resistor would also help say limiting load current to 100ma. I went for quite a low value as I have a nice 350ma CC supply for balancing.

PS The three boards (48 cells) I have stacked give out a nice amount of heat when all balancing at 350ma, great for this cold weather! About 65w in total! Def need to be on their sides so the heat can escape between the boards. Otherwise the top board might get fried!!

PS Greg eeproms have arrived I'll post stuff Monday
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 » Sun Jan 10, 2010 6:39 pm

This the latest slave code with the 13 commands and 100x adc oversampling. You can adjust almost everything so this is about as good as it will get.

Works fine on bench but the voltage drop issue cannot be corrected by software alone as the slaves are unaware of the slaves either side load condition (on/off).

This software with my lower current loads will hopefully sort it.

www.solarvan.co.uk/bms/SerSla20.pbp
www.solarvan.co.uk/bms/SERSLA20.HEX

Once I have sorted the Master bug i'll post that tomorrow with luck.
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.


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 3 guests