Jump to content

Another Lithium battery thread


Dr Bob

Featured Posts

42 minutes ago, WotEver said:

At the end of the day isn’t this all you actually require?  If you’re using the voltage measurement to ‘correct’ the calculated SoC why can’t you simply use the voltage measurement as the final arbiter?

At the end of the day, there are those people who like to faff and those people who dont.

Lithium's give you a great opportunity to faff.

As Sea Dog said earlier, its a whole new hobby.

I'll be doing what you said. A simple voltage to SoC graph. Just take a voltage reading with little load/charge and I'm your uncle.

Link to comment
Share on other sites

7 hours ago, Dr Bob said:

Yes, good work.

 Can you expand on section 3? I guess this is to account for the increased or decreased voltage at load or charge for each voltage measurement. Is it possible to derive a simple relationship between voltage and Amps in/out for a given SoC from you voltage function in 3?

 

Also I guess this was all done at around 14-15 deg C. Any ideas on if this will change at the height of summer when it gets to 25 under the bed? I'm struggling to find voltage vs temp data.

 

Which bit of section 3? The voltage measurement is done by linear regression over a 20-minute sliding window of terminal voltage and current measurements. The cells are modelled as a perfect cell in series with a small (fractions of a milli-ohm) resistor. The terminal voltage is therefore the cell voltage, reduced by the voltage drop over the resistance. Vt = Vc - IR. Plot the values for Vt and I and you get something like a straight line with voltage decreasing as the current increases. Do linear regression to find the best fit line over the points, and the constant gives you cell voltage and the factor gives you cell resistance. Both can vary for individual cells, so I do this for all four series cells. The voltage used to estimate SOC in section three is just the sum of the four cell voltages from the regressions. Because of the line-fitting, this is already an "average" over the last 20 minutes. I don't use data points during charging, and need 20 minutes of continuous data, so it also excludes charging and 20 minutes after charging ends. The regression process also removes much of the effect of load. The function from voltage to current I used was very simple: the lowest voltage I see (at -400Ah discharge) was 12,6v and the highest I see (at fully charged) was 13.3v. I just mapped linearly between those two fixed points. This is very rough and ready, but as input to a recursive filter that doesn't seem to matter. 

 

I looked for temperature/voltage coefficients and couldn't find anything except vague handwaving that it's quite low. Easy to incorporate if you know what they are.

 

MP.

 

Link to comment
Share on other sites

6 hours ago, Dr Bob said:

At the end of the day, there are those people who like to faff and those people who dont.

Lithium's give you a great opportunity to faff.

As Sea Dog said earlier, its a whole new hobby.

I'll be doing what you said. A simple voltage to SoC graph. Just take a voltage reading with little load/charge and I'm your uncle.

 

If I may chuck a spanner in your works, the terminal voltage for a given state of charge changes with LiFeP04, and depends on whether the last work the battery did was delivering a charge or receiving a charge. Apparently.

 

I've mentioned this a couple of times on here but no-one so far has picked up on it. 

 

http://nordkyndesign.com/practical-characteristics-of-lithium-iron-phosphate-battery-cells/

 

Unless I'm misinterpreting what Mr Nordkyn is saying.

 

 

 

image.png.19094d32cac292de55098c833c2171c9.png

Link to comment
Share on other sites

7 hours ago, WotEver said:

At the end of the day isn’t this all you actually require?  If you’re using the voltage measurement to ‘correct’ the calculated SoC why can’t you simply use the voltage measurement as the final arbiter?

 

Look at the blue line in the graph above, which is the difference between the SOC calculated form voltage and the output from the adaptive filter. It's noisy as hell and the amplitude of the noise is rather large.  If you want an estimate with error bars of plus/minus 15% of battery capacity, it's OK. I'm trying to do better.

 

I'm not sure if the filter I've built is actually a Kalman filter. It's certainly a recursive filter, as are Kalman filters, but not all recursive filters are Kalman filters. In any case, the principle is that the filter maintains internal state which tracks the physical variable(s) of interest, and uses external measurements to update that internal state, depending on the accuracy of the measurements. The coulomb measurements are very accurate  over short term. If you count x coulombs over a period, you know to high accuracy that the state has changed by that amount, so that data is used direct. The SOC estimate from voltage is very inaccurate - you can't sensibly update the SOC estimate using one sample, but over many samples it produces valid information that can be used to update the state, and that information is not subject to integration drift since it doesn't depend on previous state. The third source of information is the hard reset when the cells hit fully charged based on voltage and charge current.

 

It would be very interesting to know how the EV makers do this, but I suspect the NDA would need to be signed in blood.

 

MP.

 

 

 

Link to comment
Share on other sites

5 minutes ago, Mike the Boilerman said:

 

If I may chuck a spanner in your works, the terminal voltage for a given state of charge changes with LiFeP04, and depends on whether the last work the battery did was delivering a charge or receiving a charge. Apparently.

 

I've mentioned this a couple of times on here but no-one so far has picked up on it. 

 

http://nordkyndesign.com/practical-characteristics-of-lithium-iron-phosphate-battery-cells/

 

Unless I'm misinterpreting what Mr Nordkyn is saying.

 

 

 

image.png.19094d32cac292de55098c833c2171c9.png

 

This is the reason I ignore voltage data during charging and for 20 minutes after charging ends. As boat batteries spend far more time discharging than they spend charging, that's not a big problem.

 

MP.

 

Link to comment
Share on other sites

1 hour ago, MoominPapa said:

I'm not sure if the filter I've built is actually a Kalman filter. It's certainly a recursive filter, as are Kalman filters, but not all recursive filters are Kalman filters.

Have you read this...?

https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python

Link to comment
Share on other sites

1 hour ago, Mike the Boilerman said:

 

If I may chuck a spanner in your works, the terminal voltage for a given state of charge changes with LiFeP04, and depends on whether the last work the battery did was delivering a charge or receiving a charge. Apparently.

 

I've mentioned this a couple of times on here but no-one so far has picked up on it. 

 

http://nordkyndesign.com/practical-characteristics-of-lithium-iron-phosphate-battery-cells/

 

Unless I'm misinterpreting what Mr Nordkyn is saying.

 

 

 

image.png.19094d32cac292de55098c833c2171c9.png

 

 

This is for cell voltage on a big charge or a big discharge. I dont recognise the shape as I have not yet plotted cell voltage with SoC. If however you just look at total bank voltage you see a different picture. I will try and find time next week to plot what I am getting but it seems from just looking (not graphed it yet) the data that it is a straight line from 12.8V to 13.3V from 40% to 90% SoC - IF you are not charging or discharging over 10A.  Loads of 1A to 10A give a drop in voltage of say 0.01-0.05V only. Solar at 1A to 10A charge gives increase in voltage of the same amount. Charging at 50A increases an at rest voltage of say 13.3V to 13.8V so as MP says, ignore voltage when charging (other than to see the voltage termination point) or give it a 10 mins or so to drop. It will be easy just to eyeball the voltage as long as the load isnt too high and estimate SoC. I will do a graph next week once I have had chance to look at the data.

Link to comment
Share on other sites

1 hour ago, MoominPapa said:

 

Which bit of section 3? The voltage measurement is done by linear regression over a 20-minute sliding window of terminal voltage and current measurements. The cells are modelled as a perfect cell in series with a small (fractions of a milli-ohm) resistor. The terminal voltage is therefore the cell voltage, reduced by the voltage drop over the resistance. Vt = Vc - IR. Plot the values for Vt and I and you get something like a straight line with voltage decreasing as the current increases. Do linear regression to find the best fit line over the points, and the constant gives you cell voltage and the factor gives you cell resistance. Both can vary for individual cells, so I do this for all four series cells. The voltage used to estimate SOC in section three is just the sum of the four cell voltages from the regressions. Because of the line-fitting, this is already an "average" over the last 20 minutes. I don't use data points during charging, and need 20 minutes of continuous data, so it also excludes charging and 20 minutes after charging ends. The regression process also removes much of the effect of load. The function from voltage to current I used was very simple: the lowest voltage I see (at -400Ah discharge) was 12,6v and the highest I see (at fully charged) was 13.3v. I just mapped linearly between those two fixed points. This is very rough and ready, but as input to a recursive filter that doesn't seem to matter. 

 

I looked for temperature/voltage coefficients and couldn't find anything except vague handwaving that it's quite low. Easy to incorporate if you know what they are.

 

MP.

 

Thankyou MP. I now understand what you are doing. Yes, quite complex. Your system is good for this as you can measure and record the individual cell data and then pick and choose which data you want to use to compute - unlike mine where I am stuck with recording just overall voltage data but perhaps slightly more accurate current and amp hours used - but then cant use it in real time. I am going to try and graph my data and produce a set of volts v SoC at varying small loads/charging and then see over the next few months how that lines up with the SoC prediction from the BMV.

Link to comment
Share on other sites

  • 3 weeks later...

Short update on the SOC calculation.

 

I checked over the software and found one possible problem in the numerical integration, where some calculations were rounding towards minus infinity, so that discharging currents (which are negative by convention) were always rounded to a slightly larger discharge than reality whilst charging currents were always rounded to a slightly smaller current than reality. This bias might have been enough to cause some of the drift downwards in the SOC value.

 

The batteries hit charge termination again yesterday, after a few weeks, and at the time of charge termination the SOC based on coulomb counting was -50Ah, which is an improvement on last time. The SOC calculated by the filter which includes voltage information was  -8Ah, so the SOC display was reading 98% just before charge termination when it reset to 100%. If that's turns out to be a consistent result for drift over periods of weeks, I'm quite happy

 

 

MP.

 

Link to comment
Share on other sites

2 hours ago, MoominPapa said:

Short update on the SOC calculation.

 

I checked over the software and found one possible problem in the numerical integration, where some calculations were rounding towards minus infinity, so that discharging currents (which are negative by convention) were always rounded to a slightly larger discharge than reality whilst charging currents were always rounded to a slightly smaller current than reality. This bias might have been enough to cause some of the drift downwards in the SOC value.

 

The batteries hit charge termination again yesterday, after a few weeks, and at the time of charge termination the SOC based on coulomb counting was -50Ah, which is an improvement on last time. The SOC calculated by the filter which includes voltage information was  -8Ah, so the SOC display was reading 98% just before charge termination when it reset to 100%. If that's turns out to be a consistent result for drift over periods of weeks, I'm quite happy

 

 

MP.

 

Mine must be charged because the solar charger says zero amps going in, until the fridge kicks in then for a short time it reads a couple of amps ?

I am playing with the drive batteries at the moment after realising that I have to go up to 72 volts, I have two choices, either add two more of my Valence 12 volt batteries or fit a whole new bank of 36 volt valence batteries. As I can get the 36 volt ones cheap, I am erring towards those and they will fit in the battery box better as well, it will also simplify the wiring, and allow me to sell my 12 volt valence batteries as well. Anyway I have 3 weeks to make up my mind as my supplier is on holiday

Link to comment
Share on other sites

On 27/02/2019 at 17:28, Dr Bob said:

They do sound really good ......which is why I am fitting them.....but they do need a lot of looking after. Mine are under the bed so each night I can read them a bed time story and tuck them up. They do need that. Peeps should not underestimate the level of knowledge needed to care for them. MP, T&B and Peterboat are experts on this type of electronics and know what they are doing. I'm initially going to run them in parallel with my lead acids so will just isolate them every time we leave the boat and maybe not even use them with the alternator in the first 1-6 months (the solar can charge them) until I know how they charge with all my different charge sources. One screw up and you could kill them. If you want an idiot proof system with little operator input then maybe these are not the answer, or you can pay Victron £6K for a system. I dont think these are for everybody.

Oh what a difference 6 weeks makes. Boy was I wrong!

.....a lot of looking after?????  Rubbish. Who posted that!

 

Honestly, with now a month of use, these Lithiums are simple. The majority of posts on this thread are all about over charging and what happens when you get to 13.98673V. In real life you never see that unless you want to do an 'every 8 week' BMV synchronisation to reset the meter. For the past 4 weeks I have meandered around 20% SoC to 90% SoC without going near the dreaded 13.9V (apart from one planned excursion up there to check the cells were still balanced...they were). You could just check them once per day to read  voltage and/or Ahrs used and then either turn them off if too high  or plan for a longer run tomorrow - which we have not had to do. None of this 'are we up to 100% yet! The solar is just great. The Lithiums just lap up all the power thrown at them. None of these low tail currents throtling back the panels.

 

Very, very impressed.

  • Greenie 1
Link to comment
Share on other sites

3 hours ago, MoominPapa said:

Short update on the SOC calculation.

 

I checked over the software and found one possible problem in the numerical integration, where some calculations were rounding towards minus infinity, so that discharging currents (which are negative by convention) were always rounded to a slightly larger discharge than reality whilst charging currents were always rounded to a slightly smaller current than reality. This bias might have been enough to cause some of the drift downwards in the SOC value.

 

The batteries hit charge termination again yesterday, after a few weeks, and at the time of charge termination the SOC based on coulomb counting was -50Ah, which is an improvement on last time. The SOC calculated by the filter which includes voltage information was  -8Ah, so the SOC display was reading 98% just before charge termination when it reset to 100%. If that's turns out to be a consistent result for drift over periods of weeks, I'm quite happy

 

 

MP.

 

MP. After 2 weeks of cycling 20-80% SoC, I took ours up to 'full' and found our BMV was -20Ahr out - so that was then reset.

I am finding that just looking at voltage on low discharge is pretty accurate to predict SoC, far easier than it ever was on LA's. I've got a rough Voltage vs SoC graph and it seems to predict very well. Ours are just cycling up and down between 12.7 and 13.1V

1 hour ago, peterboat said:

Mine must be charged because the solar charger says zero amps going in, until the fridge kicks in then for a short time it reads a couple of amps ?

 

.....Eeeeek!

I thought that was what we were not suppossed to be doing? I'm just isolating my bank for the day when the sun is out and we are up over 13.3V and not going anywhere.

Link to comment
Share on other sites

40 minutes ago, Dr Bob said:

MP. After 2 weeks of cycling 20-80% SoC, I took ours up to 'full' and found our BMV was -20Ahr out - so that was then reset.

I am finding that just looking at voltage on low discharge is pretty accurate to predict SoC, far easier than it ever was on LA's. I've got a rough Voltage vs SoC graph and it seems to predict very well. Ours are just cycling up and down between 12.7 and 13.1V

.....Eeeeek!

I thought that was what we were not suppossed to be doing? I'm just isolating my bank for the day when the sun is out and we are up over 13.3V and not going anywhere.

Its fine voltage set at 13.8 volts absorb float at 13.6 works great batteries all balanced..............I think or they were last time I checked

Edited by peterboat
Link to comment
Share on other sites

1 hour ago, Dr Bob said:

I've got a rough Voltage vs SoC graph and it seems to predict very well. Ours are just cycling up and down between 12.7 and 13.1V

Be interested to see that. I'm just using a linear graph between 12.7 and 13.3 for the Kalman filter estimator, and I think it could be improved.

 

MP.

 

Link to comment
Share on other sites

1 hour ago, MoominPapa said:

Be interested to see that. I'm just using a linear graph between 12.7 and 13.3 for the Kalman filter estimator, and I think it could be improved.

 

MP.

 

I'll add a reading from today and post it after the rugby (on BT sport).

Link to comment
Share on other sites

Just popped in to say hello and remind myself how little I understand what's going on here. :)

 

I have to say there's been some serious levelling up recently, I recon there's at least a few level 25 lawful good sorcerers, possibly moomin has reached level 30 paladin.

 

I am in awe

  • Greenie 1
Link to comment
Share on other sites

3 minutes ago, tree monkey said:

Just popped in to say hello and remind myself how little I understand what's going on here. :)

 

I have to say there's been some serious levelling up recently, I recon there's at least a few level 25 lawful good sorcerers, possibly moomin has reached level 30 paladin.

 

I am in awe

Hello.

  • Greenie 1
Link to comment
Share on other sites

40 minutes ago, tree monkey said:

Just popped in to say hello and remind myself how little I understand what's going on here. :)

 

I have to say there's been some serious levelling up recently, I recon there's at least a few level 25 lawful good sorcerers, possibly moomin has reached level 30 paladin.

 

I am in awe

I just leave mine to their own devices and they work and work well, you dont have to do all the stuff that people do, Bob and MP freely admit they like to faff me I like to leave them to it

  • Happy 1
Link to comment
Share on other sites

3 hours ago, MoominPapa said:

Be interested to see that. I'm just using a linear graph between 12.7 and 13.3 for the Kalman filter estimator, and I think it could be improved.

 

MP.

 

MP, here is my rough graph of voltage on the x axis and the Ahrs out on the y axis. I've not bothered taking any readings lower than 12.8V as I have 660Ahrs of lead acid so once the voltage drops below 12.8V, it doesnt drop much as it starts taking power from the LA's.  I need to look back at the data and see if I can populate the lower discharge points. I seem to watch it more as it gets above 13.2V.

The voltage is the number recorded on my BMV which matches the cell monitoring box. Not checked it against my multimeter which I did calibrate against yours.

I think most of the results were taken after isolating the lithium bank and leaving for 30 mins. Not sure why I have a big spread at 13.2V. It isnt time dependent (ie a drift in Ahrs out due to BMV drift).

Screen Shot 2019-04-06 at 18.34.18.png

Link to comment
Share on other sites

5 hours ago, Dr Bob said:

MP, here is my rough graph of voltage on the x axis and the Ahrs out on the y axis. I've not bothered taking any readings lower than 12.8V as I have 660Ahrs of lead acid so once the voltage drops below 12.8V, it doesnt drop much as it starts taking power from the LA's.  I need to look back at the data and see if I can populate the lower discharge points. I seem to watch it more as it gets above 13.2V.

The voltage is the number recorded on my BMV which matches the cell monitoring box. Not checked it against my multimeter which I did calibrate against yours.

I think most of the results were taken after isolating the lithium bank and leaving for 30 mins. Not sure why I have a big spread at 13.2V. It isnt time dependent (ie a drift in Ahrs out due to BMV drift).

Screen Shot 2019-04-06 at 18.34.18.png

It looks like a straight line between 12.7 and 13.3 is pretty much as good as it gets.

 

I just checked, and 36 hours since last engine run, the estimate of discharge using voltage is -106Ah, the one from coulomb counting is -110Ah and the filtered combination of the two is -108Ah, so not much argument at all.

 

MP.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.