-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve kchal_get_bat_pct() estimation #15
Comments
Also would be a good idea to smooth the reading of the voltage to begin with. |
To cheaply map V to a rough battery %, I did some curve fitting trial and error and eventually came up with these two curves, using a piecewise. I'm content with these, and they certainly hit the goal of being within ~5%.
Full list of mapped values: |
As mentioned above, we also need to stabilize A good example of lowpass filter which we could mimic: https://github.com/JonHub/Filters/blob/master/FilterOnePole.cpp |
Improve kchal_get_bat_pct() state of charge estimation.
Right now we assume a linear relationship between voltage and state of charge.
LiPo batteries follow somewhat predictable curve, based on the rate of discharge.
We should compare the recorded rough average rate of discharge, to determine the C rating for average use, then update the kchal_get_bat_pct() to approximate this curve.
Absolutely accuracy is not the goal, just something roughly within 5% should be good enough, I think.
The text was updated successfully, but these errors were encountered: