* fix(failure_detector): check altitude loss without a height setpoint The altitude loss check only ran when an altitude setpoint was present. While the pilot moves the throttle stick in Altitude/Position mode the setpoint is NaN, so a failure during a manual climb or manual descent was never detected. When there is no height setpoint but a vertical velocity setpoint is available, keep a reference that remembers the highest altitude reached and only moves down at the commanded descent rate. Climb or hold commands therefore protect the best height, and a commanded descent is compared against the expected one with FD_ALT_LOSS as margin. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * fix(failure_detector): ignore stale descent setpoint in altitude loss check Without a height setpoint the reference is lowered by the commanded descent rate. If position control stopped publishing while a descent was commanded, the last vz was integrated indefinitely, lowering the reference and masking the altitude loss the detector should catch. Only integrate the commanded descent while the setpoint is fresh (within 500 ms of the position estimate); otherwise the reference is held at the best altitude reached. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * docs(safety): describe altitude loss reference for manual commands The altitude loss trigger is no longer measured only against an altitude setpoint. Explain that manual climbs and descents are covered and how a commanded descent lowers the reference. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * fix(commander): Add a margin to avoid small error accumulation * fix(failure_detector): keep the altitude loss reference when the setpoint follows the vehicle In auto modes emergency braking keeps the altitude setpoint on the vehicle while it falls. The setpoint dragged the reference down with it, and every time it ended up just below the vehicle the reference was reset, so a free fall during a mission was not detected. The reference now only moves down at the commanded descent rate, and it is kept while the vehicle falls faster than allowed even if it is above the setpoint. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * style(failure_detector): shorten altitude loss reference comment Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * style(failure_detector): name altitude loss constants as constants Also document the 2 m/s descent rate margin. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> * fix(failure_detector): apply the descent rate margin once The commanded descent rate already includes the margin, adding it again meant a fall up to 2 m/s faster than the reference moves down, with the setpoint kept on the vehicle, reset the reference instead of being detected. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com> --------- Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
6.6 KiB
Parachute
PX4 can be configured to trigger a parachute during flight termination.
The parachute can be connected to a free PWM output or via MAVLink.
::: info During flight termination PX4 turns off all controllers and sets all PWM outputs to their failsafe values (including those connected to PWM outputs) and triggers any connected MAVLink parachutes.
You can therefore use this feature to activate multiple complementary safety devices connected to different outputs. For more information see Flight Termination Configuration. :::
Using Parachutes
Below are a few considerations when using parachutes:
- A parachute does not guarantee that the vehicle will not be destroyed or cause harm! You must always fly with safety in mind.
- Parachutes require careful usage to be effective. For example, they must be folded correctly.
- Parachutes have a minimum effective altitude.
- A parachute may trigger while the vehicle is upside down. This will increase the time required to slow, and may result in the drone collapsing the parachute.
- The parachute will only deploy if the flight controller is powered and PX4 is running properly (unless it is triggered independently of PX4). It will not deploy if something causes the flight stack to crash.
Parachute Setup
Flight termination (and hence parachute deployment) may be triggered by safety checks such as RC Loss, geofence violation, and so on, from attitude triggers and other failure detector checks, or by a command from a ground station. During flight termination PX4 sets PWM outputs to their "failsafe" values (failsafe values turn off motors, but may be used to turn on/trigger the parachute). If a MAVLink parachute is connected and healthy, a command will be sent to activate it.
Parachute setup therefore involves:
- Configuring flight termination as the appropriate action for those safety and failure cases where the parachute should be deployed.
- Configure PX4 to deploy the parachute during flight termination (set PWM output levels appropriately or send the MAVLink parachute deploy command).
- Configure PX4 output levels to disable motors on failsafe. This is the default so usually nothing is required (for servos it's the center value).
Enable Flight Termination
To enable flight termination:
- Set Safety action to Flight termination for checks where you want the parachute to trigger.
- Set Failure Detector pitch angles, roll angles and time triggers for crash/flip detection, and disable the failure/IMU timeout circuit breaker (i.e. set CBRK_FLIGHTTERM=0).
- Set FD_ALT_LOSS to enable flight termination if a rotary-wing vehicle loses too much altitude, including during manual climbs and descents (see Altitude Loss Trigger).
::: info You can also configure an external Automatic Trigger System (ATS) for failure detection. :::
Parachute Output Bus Setup
If the parachute is triggered by a PWM or CAN output then it must first be connected to an unused output. You will probably also need to separately power the parachute servo. This is might be done by connecting a 5V BEC to the Flight Controller servo rail, and powering the parachute from it.
You then need to ensure that the parachute pin will be set to a value that will trigger the parachute when a failsafe occurs:
-
Open Actuators in QGroundControl
-
Assign the Parachute function to any unused output (below we set the
AUX6output): -
Set appropriate PWM values for your parachute. The output is automatically set to the maximum PWM value when a failsafe is triggered.
::: info For the spring-loaded launcher from Fruity Chutes the minimum PWM value should be between 700 and 1000ms, and the maximum value between 1800 and 2200ms. :::
MAVLink Parachute Setup
PX4 will trigger a connected and healthy parachute on failsafe by sending the command MAV_CMD_DO_PARACHUTE with the PARACHUTE_RELEASE action.
MAVLink parachute support is enabled by setting the parameter COM_PARACHUTE to a non-zero value. The parameter also configures the arming check and in-flight failsafe action when the parachute system is missing or unhealthy, see Parachute Health Failsafe.
PX4 will then indicate parachute status using the MAV_SYS_STATUS_RECOVERY_SYSTEM bit in the SYS_STATUS extended onboard control sensors fields:
SYS_STATUS.onboard_control_sensors_present_extended: MAVLink parachute present (based on heartbeat detection).SYS_STATUS.onboard_control_sensors_enabled_extended: MAVLink parachute is enabled (COM_PARACHUTE > 0).SYS_STATUS.onboard_control_sensors_health_extended: MAVLink parachute healthy (based on heartbeat detection).
A MAVLink parachute is required to emit a HEARTBEAT with HEARTBEAT.type of MAV_TYPE_PARACHUTE.
Parachute Testing
:::warning For the first test, try on the bench, without the props and with an unloaded parachute device! :::
::: info There is no way to recover from a Termination state! You will need to reboot/power cycle the vehicle for subsequent tests. :::
The parachute will trigger during flight termination.
The easiest way to test a (real) parachute is to enable the failure detector attitude trigger and tip the vehicle over.
You can also simulate a parachute/flight termination: Gazebo Classic > Simulated Parachute/Flight Termination.
