-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Fix possibility of deep discharge when battery inserted and USB connected #9278
Conversation
fd0ce1f
to
98c240f
Compare
d4d3eb5
to
c52fefb
Compare
Battery warning gets only fired if a battery is inserted.
c52fefb
to
543479e
Compare
Any review for the rebase? Nothing changed since the beginning. |
I think this makes sense in the context of a real vehicle, but I'm wondering if it was added to prevent triggering these when powered by USB only? |
Nevermind, I went through it again. |
A bench test of the USB only case still wouldn't hurt. |
Tested, works fine! Merging. |
@MaEtUgR Would I be correct in thinking that this has no documentation impact (following our recent battery calibration updates)? |
@hamishwillee correct :) |
@hamishwillee Yes, it is expected behaviour and was just a bug. |
The autopilot system shuts down automatically with a dangerously low battery level if the drone isn't currently flying. This prevents deep discharge when forgetting to turn it off or unplug the battery. This feature currently doesn't work when the board is simultaneously connected via USB. Benchtesting sometimes requires usb connection and connected battery (of course propellers removed for safety) and if you then forget to look at the battery level it goes to deep discharge voltages (happened to me while I was in the last PX4 dev call).
The removed check is according to our understanding not needed (anymore) because the battery level is anyways only updated if there is a connected battery detected. See: https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/battery.cpp#L207
commander: Remove usb_ connected flag on battery warnings
Battery warning gets only fired if a battery is inserted.