mcewans wrote:
Since I am a programmer with PLCs my intrest is more general knowledge as opposed to the specific algorithm used. I know there are different ways to measure battery llife. I know that the internal resistance is one of the factors. I have the third party “battery life” app on my phone and the weird thing it does whenever I reboot the phone usually due to an IOS upgrade, it will stay around 97% for a day or two and then shoot up to 100% and stay there. The Apple Battery Life Indicator has been steady at 97% since I installed IOS 11.3 back in February. I like to keep my phone fully charged as much as I can. I mostly use the phone for Netflix and Apple Music and rarely let the battery below 80%. I don’t know if I have just been lucky for the battery life to stay at 97% for such a long period of time or if it’s because I keep the battery charged. Hopefully I can get some answers just to satisfy my curiosity.
I get that with Battery Life and with coconutBattery. I believe it's more of a "real time" up to date estimate that may go all over the map. I believe temperature may also affect the reading. In coconutBattery I might see it display 92% battery health, but as the phone warms up I'll see it jump as high as 97% in a half hour.
If you're kind of curious, there are lots of articles on lithium-ion batteries at BatteryUniversity.com from Cadex. They're a supplier of battery testing equipment and their articles are reasonably easy for most people to understand.
Battery capacity estimates are of course just estimates. There really is no way to definitively know how much total capacity there is in a battery as it ages. All that can be done is monitor what going on and try to apply that to an estimate. One of the things that might be done is simply count the amount of total charge (Coulomb counting) going in and out, but it doesn't necessarily work that well when charging and discharging at random times. I believe this is one of the reasons why some device/battery makers recommended what was called a "calibration" cycle where a battery was discharged from 100% to 0%
However, one of the things that we have in modern lithium-ion batteries is a smart battery system. Parameters are monitored directly by electronics on the battery and stored on the battery. Not that I'd recommend it, but a salvage battery placed in another device would read out with exactly the same number of cycles and battery health, as that's stored somewhere in the battery's electronics. But back to estimates - this section on battery testing sort of says something about the difficulty:
http://batteryuniversity.com/learn/article/battery_rapid_test_methods
A battery resembles a living organism that cannot be measured; only estimated by diagnostics similar to a doctor examining a patient.
** **
Estimating the capacity of the chemical battery on the fly is most complex. This involves algorithms and matrices that serve as lookup tables similar to letter or face recognition. Modern rapid-test methods move towards advanced machine learning in capturing the many moods of a battery.