Battery: default to electrical current based load compensation #19429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by this pull request
A lot of users get to the conclusion that the default compensation based on the normalized throttle is very unprecise to not say completely wrong in most cases. The default value also often overcompensates and makes the battery look more charged than it actually is already in hover conditions. As a result batteries get deeply discharged and degrade quickly.
Describe your solution
I'm suggesting to already by default compensate using electrical current if it's available. As a default value for the internal resistance of a battery I took a conservatively low value of 5mOhm which will be correct for a good healthy battery and needs to be adjusted for an older or less efficient battery.
Test data / coverage
Based on feedback from our testing team the lower load compensation based on throttle is pretty important because the overcompensation leads to most deep-discharged battery cases. The current based compensation we know it works but it wasn't enabled by default because some users don't calibrate their current sensing and the internal resistance wasn't even accurately configurable. But to be honest I still think they get a better result if we enable a small compensation by default which then works nicely for users with proper current sensing.
As further improvement steps it would be even better to only use current sensing if it's also known to be accurate/calibrated and estimate the internal resistance of the battery (@RomanBapst had a prototype for that).