Wednesday, 29 May 2013

Calculating State of Charge from Terminal Voltage

So now I have some data, I need to calculate the state of charge from the terminal voltage. My plan is to watch the current and voltage readings over time and try and take a voltage reading once the battery has been 'at rest' for a period of time. In reality the battery is always in use in some way, as seen by the graph in the previous post. However overnight there is no charging as the solar panel produces no output. The fridge cycles on and off, but I hope to be able to take the highest voltage reading before the voltage drop in the cycle happens.

Once I get that voltage reading I need to convert it into an estimation of the state of charge of the battery. I managed to find a good table that lists state of charge versus voltage and that is temperature compensated. I have a temperature probe on the battery terminal to measure the temperature. As I use the van all-year-round and live in the UK and sometimes go to France, this means the battery temperature could vary from 0 to 30 degrees C.

The table I found is on Battery FAQ and has a spreadsheet that lists no only voltages for normal lead acid batteries, but also those with calcium in. The penny has now dropped that my Lucas LX31MF batteries are calcium batteries. This explains why they settle at 12.80V instead of 12.65V. Also why they seem to need a higher charging voltage. I think for the past few years I have been charging them at too low a voltage and hence their poor performance.

I took the tables in the spreadsheet and ran them through some curve-fitting software to work out an equation that best fits the values. This makes is much easier for me to calculate the temperature compensated voltage and the SoC. The equations I came up with in the end for a calcium battery are:

# Given voltage and temperature return a corrected voltage
def tempcomp(v, t):
    return v + (4.775e-05 * t ** 2 + -0.0034 * t + 0.0581)

# Given voltage return an estimate of the state of charge of battery
def vtosoc(v):
    return (v - 11.76) / 0.0104

Of course these are approximations  Even worse they are approximations taken from random data on the internet, and not from data specific to my battery. But then, my battery manufacturer  Lucas, doesn't publish battery data. Given that most battery monitors out there don't allow you to input any parameters other than just the battery bank capacity, I think I'm doing at least as good as they are.

1 comment:

  1. I want to bring 2 url's to your attention.

    and a link from that thread to:

    It seems that one might choose to keep charging (even when the voltage goes up quite a bit) until the voltage raise is just a little compares to the AMPS put in. (Zero Delta Voltage).

    With your setup (solar, arduino, relais, voltage divider and Ammeter on shunt) the coding should be easy. (I'm building such a solution at the moment.

    You already mention your batteries die of being undercharged.

    Make sure this doesn't happen again, rather have them thrown away of gassing to much and to trough a new learning cycle (or get it right and don't throw them away.

    You stick with the 14.4 and 14.8 volt measurements. Why? I've got 170 Wp (will generate aprox 6 Amps on an summer day in the sun) charging my batteries with only a relay to open the circuit. At the moment (don't have a shunt yet) I open them up at 15.1 Volts and close them again at 12.5 Volts (just to make sure I don't start recharging when they are just at rest.

    At the moment I'm working on a 80Amps Sime Traction Lead Acid bettery (NOT maintenance free). Costed my 80 Euro's and will likely work fine for a while.