-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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: make battery states not sticky when vehicle is not armed #13470
Conversation
We shouldn't be adding more parameters to the system, in particular not for important stuff like this. So we need to have decent defaults. I think we're a point in complexity where parameters must be taken away and any addition needs to be carefully justified. It makes testing impossible and makes it impossible to make PX4 easy to work with. |
I don't think each "Battery" should have any knowledge of the vehicle arming state. Why does the Battery warning level need to latch? In commander the battery failsafe is triggered on severity increase and only when armed. Couldn't the Battery warning level simply be allowed to reset to BATTERY_WARNING_NONE? |
@dagar Yeah that might be good as well. Let me look at it and update this. |
e81b38a
to
814a13d
Compare
@dagar I updated the PR. |
@PX4/testflights Could you please test the following on a multicopter:
Please fly the vehicle and make sure that the failsafe behavior is correct, e.g.
Thanks! |
Tested on Pixhawk 4 v5 f-450 Battery threshold warning at 40%, RTL 35%, LAND 30% Battery warn level: 40%: Battery warning alert log: Tested on PixRacer v4 F-450 battery warn level: 40% log: |
Tested on NXP FMUK66 v3
Tested on Pixhawk Pro v4
|
Tested on PixRacer V4 Master Branch Log ComparisonModes Tested Procedure Master Branch Log: Master Branch Log: |
814a13d
to
3711b76
Compare
@PX4/testflights Thanks for testing guys! @bkueng @dagar I noticed in the logs from the test team that the battery warning state was toggling between two states (now that it's not sticky anymore) which caused the commander spamming battery warning / RTL messages (see figure below). |
Signed-off-by: RomanBapst <bapstroman@gmail.com>
Signed-off-by: RomanBapst <bapstroman@gmail.com>
@PX4/testflights Yould you please give this another test flight? You don't necessary need to fly this on all platforms, it's sufficient if you test on Pixhawk 4 v5 f-450. Thanks! |
Tested on Pixhawk 4 v5
|
Problem solved this this PR:
Hot swapping the battery was not supported until now if the battery was already in a state <= warning.
Furthermore, hot swapping using a battery with a lower voltage always lead to the system being in the emergency battery states.
This PR removes the stickiness of the battery levels when the vehicle is NOT armed.
Open Question:
If folks think this is a safety issue then we could make this a parameter. By default the battery warning levels could be sticky always (current state). Then we can introduce to have them sticky only when armed and as a third option to never have them sticky.
I'm saying this because it's not the first time I hear somebody complaining about battery states being sticky.