-
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
Failure detector / Failsafe (Parachute) triggering #10179
Conversation
@@ -113,7 +113,7 @@ PARAM_DEFINE_INT32(CBRK_AIRSPD_CHK, 0); | |||
* @category Developer | |||
* @group Circuit Breaker | |||
*/ | |||
PARAM_DEFINE_INT32(CBRK_FLIGHTTERM, 121212); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. the termination should always be available by default. At the moment, if someone sets "Terminate" in the drop-down menu of the "Safety" tab of QGC, flight termination will not be triggered. Flight termination was disabled by default "for now", 4 years ago, because "it wasn't safe" but the objective of this PR is also to review and test the flight termination logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds fine as long as we're sure of the implications system wide and document it clearly. Especially within the px4io firmware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This circuit breaker is now again enabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try to wrap my head around this:
- Setting this parameter to 121212 will disable the flight termination action.
Ok, I understand that flight termination is enabled given the param is 0 by default, so far so good.
WARNING: ENABLING THIS CIRCUIT BREAKER IS AT OWN RISK
Hm, what risk? So enabling the circuit breaker means no termination is possible which is risky, ok got it. Although having the termination enabled seems risky in its own way.
Ok, I think I get it and it's correct.
This is looking better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. I remarked a few things, but didn't look at the mixer changes in-depth.
bdb7391
to
93e0735
Compare
Now IO sets failsafe PWM values if FMU is not responding but was initialized and armed. This action can be disabled by the flight termination circuit breaker. |
23962bb
to
8f266ec
Compare
I've rebased my local branch cleanly on master (now that the safe version has been merged). I'll do some bench tests before pushing again. |
8f266ec
to
ed38641
Compare
@dagar I added a check in Preflight Checks so it will reject arming if a failure is already detected on ground. Did I do it the correct way? |
Do you only want it to block arming with a message, or potentially complain periodically preflight? |
Block arming only. |
Then I would do it in the state machine helper prearm check. What's the intended use case? Blocking rearming after a real failure or preventing a tipped vehicle from arming? Does the failure ever clear? |
The intended use case is to prevent arming a vehicle if it would directly enter the flight termination state after arming. The failure flags are always updated and can freely be set and cleared by the Failure Detector. The termination (no return) is only active when the vehicle is armed. |
Makes sense, prearm_check in state machine helper sounds appropriate. |
ed38641
to
e29f7de
Compare
e29f7de
to
4229d2d
Compare
Rebased on master and tested on a bench setup with a Pixhawk4. Works as expected:
@PX4/testflights Can you fly this PR with a quad with your standard parameters (don't enable flight termination!) to confirm that there is no regression? Thanks! |
87b1333
to
30968e4
Compare
…AIL parameters description
…uit breaker. The circuit breaker is used inside IO to decide if it has to go into failsafe if FMU dies and also controls is the FailureDetector sets the force_failsafe flag. The other sources of flight termination (rc loss, geo fence, ...) are not disabled by the circuit breaker
…; the user does not need to check the bitmask
…nge its type to bool since circuit_breaker_enabled returns a boolean
vehicle_status as const type. Also use FAILURE_NONE enum to check for a failure
…ighttermination".
This is required because otherwise, IO would output disarmed values if FMU goes into a disarmed state.
9075825
to
c850c75
Compare
Rebased on master, ready for merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this then
Replaces #10091
Warning
This has never been tested in flight and could potentially kill the vehicle in air.
This PR enables flight termination by disabling the corresponding circuit breaker (reverts ab40008)Description
This PR enables failsafe parachute triggering capabilities for an autopilot with or without IO processor by the use of
disarmed
andfailsafe
values.Any kind of failure detection can be made using the FailureDetector class, which is instantiated in Commander. At the moment, a simple attitude check is made and sets its internal flags to true if roll or pitch exceed some defined parameters (
FD_FAIL_R/P
). On each axis, an hysteresis can be configured using the parametersFD_FAIL_R/P_TTRI
.Commander then sets the
force_failsafe
flag (actuator_armed
message) that goes to the FMU driver and to the IO chip (if available).If the autopilot has an IO chip, one can set a parachute (or other failsafe device) pin to an IO pin and IO will also then be able to trigger it if FMU dies (through a timeout check - 0.5s).
The objective is also to do different check and to have different behaviors if the vehicle is a fixed-wing, a multicopter, a VTOL or a rover. FailureDetector will then be a base class for FWFailureDetector, MCFailureDetector, etc.
How to use it
PWM_MAIN/AUX_DISx
parameterPWM_MAIN/AUX_FAILx
parameterFD_FAIL_R/P_TTRI
hysteresis if neededMainly useful for
TODO
force_failsafe
flag is reset when FMU reboots (remove https://github.com/PX4/Firmware/blob/81f0b64ad32ffaf446ad9e3f937986711f353ac2/src/drivers/px4io/px4io.cpp#L1393 ?)CBRK_FLIGHTTERM = 121212
). The flagforce_failsafe
is set even if the logic is disabled but doesn't trigger the parachute.FYI @LorenzMeier @bkueng @RomanBapst @dagar
@dagar This now prevents issues where a mixer could output some values to the parachute channel (a NullMixer has to be set to that specific output and it outputs NANs which are translated to disarmed or failsafe values only).
Flight termination logic diagram: