[ltp] Measuring battery health (was: Suggestions for battery sources)

Stefan Monnier linux-thinkpad@linux-thinkpad.org
Tue, 25 May 2010 13:29:45 -0400

> My T61 is 2.5 years old, and by that time I bought a noname 6 cells
> battery “for every day use”, saving my lenovo 6 and 9 cells for when I
> really need them (I keep them mid-charged, and use them from time to
> time). The noname one is always kept in my ThinkPad, using smapi
> controls to keep it between 30% and 70%.

> At that time, it's still pretty fine:

> corsac@hidalgo: acpitool -B
>   Battery #1     : present
>     Remaining capacity : 21550 mWh, 43.28%
>     Design capacity    : 56160 mWh
>     Last full capacity : 49790 mWh, 88.66% of design capacity
>     Capacity loss      : 11.34%

BTW, this reminds me of a question I've had for a while:

Is this 11.34% estimate reliable if the battery never reaches a full
charge (thanks for tp-smapi's setting of 70% in your case)?

More generally: how is the "last full capacity" computed?
My impression is that it can only be modified when:
- the battery reaches a full charge (in that case
  it can do last_full_capacity = remaining_capacity).
- the battery becomes completely empty (in which case it can do:
  last_full_capacity -= remaining_capacity; remaining_capacity = 0).

So unless there are other ways to adjust the estimate of
remaining_capacity and last_full_capacity, that means that
last_full_capacity will be too optimistic if you never charge the
battery fully (e.g. via tp-smapi settings) and never discharge it fully
either.  More specifically it will pretty much only notice that the
capacity has changed when the capacity gets below tp-smapi's max
threshold (in which case the battery gets accidentally fully charged).

Since such a use-case seems highly likely (after all, it's recommended
if you want to maximize your battery's lifetime), I'd guess that there
are other ways to adjust the estimate.  What are they?