Skip to content
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

Battery remaining inversed when compensating for load #8198

Closed
sanderux opened this issue Oct 26, 2017 · 9 comments
Closed

Battery remaining inversed when compensating for load #8198

sanderux opened this issue Oct 26, 2017 · 9 comments

Comments

@sanderux
Copy link
Member

The battery remaining function is broken on today's master.
It increases drastically when under load (if anything it should decrease). Tested with and without setting internal resistance, both behave the same. The voltage reading does read as expected.

image

Log from other flight same behavior:
https://logs.px4.io/plot_app?log=7f323da0-8f75-46f1-aba9-f0a68150b691

ping @LorenzMeier @dagar

@sanderux
Copy link
Member Author

ping @davids5

@dagar
Copy link
Member

dagar commented Oct 27, 2017

For VTOL this would make sense if you're relying on the normalized throttle usage (https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/battery.cpp#L179), but I see you have BAT_R_INTERNAL set.

image

@LorenzMeier
Copy link
Member

@sanderux This is still persisting, right?

@sanderux
Copy link
Member Author

sanderux commented Oct 31, 2017

@LorenzMeier yes, it was on 4 day old master. later i dont know yet. did anything change?

@sanderux
Copy link
Member Author

@dagar it happens with with and without r_internal

@MaEtUgR
Copy link
Member

MaEtUgR commented Oct 31, 2017

@sanderux I'm currently revising the battery estimation here #8153.
It's currently broken in several ways according to my opinion. Not sure if your case is covered in my fixes, let's investigeate.

On the first glance it looks to me as if your battery estimation is always corrected using the thrust and for the factor of how much this is done you can use the parameter BAT_V_LOAD_DROP. You even say it does not change when setting an internal resistance.

What you should also know is that the current estimation always adjusts the empty cell voltage for any load which results in rescaling the whole calculation. I correct the voltage measurement itself (only for the remaining capacity estimation) in my pr... If you feel like and have time you can test my pr as soon as I fixed the CI stuff and pushed the newest enhancements today. EDIT: I made my changes

@sanderux
Copy link
Member Author

sanderux commented Nov 3, 2017

I re-checked all the math and found that it was indeed related to internal resistance that was likely wrong for this lipo. Initially i thought it was not related as it exhibited the same behavior when bat_IR was disabled. but on the bench test it did not (perhaps param didnt save in field test).

Closing for now.

@sanderux sanderux closed this as completed Nov 3, 2017
@nskjoung
Copy link

@sanderux i'm be in a same situation. how does it clear?

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 15, 2017

@nskjoung I think his conclusion was that the internal resistance parameter was not set correctly and hence the measurement got overcompensated. If you want to try supposedly better battery estimation please try #8153 . It will likely just not be in 1.7 because it requires a lot of testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants