You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find the battery percentage to be still not a good predictor of capacity, and I had a thought that it might be possible to get a slightly better battery percentage from a cubic equation. I have had a dig through the source and see that a lookup table is currently used in power.h.
I worked with the input of (x,y) 100,4.2; 80,3.8; 20,3.6; 0,3.2. It should be possible to do this with other chemistries as well, as most follow a similar curve. There could also be a config file option for the user to specify points, four seem to make sense in most cases.
I think the only concern would be the cost of cpu cycles, having to find the best fit formula on boot, and then calculating a cubic equation with floating point numbers to get the battery percent.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I find the battery percentage to be still not a good predictor of capacity, and I had a thought that it might be possible to get a slightly better battery percentage from a cubic equation. I have had a dig through the source and see that a lookup table is currently used in power.h.
This site gives a live example and explanation of how to solve for x/y pairs: https://www.omnicalculator.com/statistics/cubic-regression
I worked with the input of (x,y) 100,4.2; 80,3.8; 20,3.6; 0,3.2. It should be possible to do this with other chemistries as well, as most follow a similar curve. There could also be a config file option for the user to specify points, four seem to make sense in most cases.
I think the only concern would be the cost of cpu cycles, having to find the best fit formula on boot, and then calculating a cubic equation with floating point numbers to get the battery percent.
Beta Was this translation helpful? Give feedback.
All reactions