Estimating the battery capacity using current power consumption and battery percentage

I want to estimate the current maximum capacity (in kWh) having the current power consumption (in kWh) and the state of charge of the battery (in %) available in a time series.

I do not have a full battery charge circle recorded but only a snippet with the state of charge going from ~95% to ~35% in a 1 second data recording interval.

At first, i cumulated the current power consumption and noticed that the progression between cumulated power consumption and state of charge was almost the same (see figure 1 and 2).

progression of state of charge vs. cumulated power consumption So i tried to use a linear regression model to predict two values of cumulated power consumption at 0% and 100% state of charge. In my assumption the delta of these two leaves me with the current maximum capacity of the battery.

Ideally i want to monitor the capacity during the data recording. Which means i only have data of a few percent of state of charge. In figure 3 and 4 you can see my attempt of trying to create a linear regression model for every 2% state of charge. As you can see in the right plot, the estimated capacity has a very high variance.

LEFT: regression lines (green) of every 2% state of charge; RIGHT: estimated capacity of every 2% state of charge Since i am not an expert in neither the matter of regression nor batteries/physics, my questions are:

• Is there a much simple or more exact way (or both) to estimate the current maximum capacity of the battery?

• If yes, is there a good way to estimate an sufficiently exact capacity with an even smaller snippet in an ongoing process, lets say every 2% state of charge? (maybe using a characteristic curve of the discharge process)

• In the regression lines figure, how many values did you use for regression on each 2% step? My guess is that you used only the 2 or three most recent, which explains why you get large variance on the estimated capacity. – rmhleo Jan 27 '16 at 14:36
• Usually i would use all recorded values during the loss of 2% state of charge. Since i cannot control the count of samples in one of the bins (because they are of course power consumption intensity over time), i also tried to use only the first and the last sample in a bin to build the prediction model. Both attempts are leading to the same outcome (see figure 3 and 4). The sample size of each bin varies between 200 and 3000 samples (mean ~1300). – R. Doe Jan 27 '16 at 15:00
• To first order and for fairly constant load temperature your assumption is fairly correct. The problem is that for most battery technologies such a slope estimation algorithm doesn't do much good for the lifetime of the battery, since you have to run it between 100% and near 0% charge to get the absolute charge at the beginning and end of the measurement. To maximize battery lifetime one has to stay between roughly 70%-30% and this method will inevitably drift cell by cell and lead to early defects. If you don't care about battery lifetime, it's fine for the estimation of remaining charge. – CuriousOne Jan 27 '16 at 15:38
• Well, battery lifetime (as in charge cycles) is not directly what i am after. I want to get the real maximum capacity during use, which could be different from the original maximum capacity stated by the manufacturer because of factors such as temperature or battery health. – R. Doe Jan 27 '16 at 16:06