∆ charge (via coulomb counting) = capacity * ∆ state-of-charge (via estimation, e. g. Estimating State of Charge with Kalman Filter)

SoC is X axis, charge is Y axis, use linear regression.

Don't use simple least squares method or weighted least squares method: it produces biased results because there is an uncertainly not only in the Y, charge (due to sensor noise, bias: Hall effect-based current sensors are prone to DC bias) but also in the X, state-of-charge (the uncertainty of the estimation).

In applications which regularly reach 100% SoC (e. g. overnight charging), we can reduce the SoC uncertainty if we use these moments as either beginning or the end of the interval.

When choosing the minimum threshold amount of charge to compute deltas, there is a tradeoff: small charge delta means higher uncertainty (noise factor), large delta might be rarely reached in applications which often switch between charging and discharging (e. g., due to regenerative charging), and also allows for more DC bias to creep in if the current sensor is poorly calibrated.

Contra:

References

‣, 4.2-4.4