Skip to content

Motor Failure Recovery

main (PX4 v2.0) Multicopter

PX4 can reconfigure control allocation (mixing) in flight when a motor failure is detected, so that the vehicle can keep flying on the motors that are left.

The failure action is selected with CA_FAILURE_MODE. This can be set to 0 (the default) to simply warn the user, or 1 to remove the failed motor from allocation. Hexarotor frames provide additional recovery options, which are outlined in the following sections.

WARNING

A vehicle flying with a failed motor has less control authority and thrust margin than a healthy one. Fly gently and land as soon as it is safe to do so.

Hexarotor

Stop or Reverse the Opposite Motor

Modes 1 and 2 only differ on a hexarotor; on any other airframe both simply remove the failed motor.

On a hexarotor the rotor opposite the failed one is the rotor that used to cancel its drag (yaw) torque, so what happens to it decides how much yaw authority is left:

  • Mode 1 stops it, leaving four symmetric rotors and no yaw bias to trim, but a third of the thrust is gone and the heading can still drift.
  • Mode 2 keeps it in the allocation and lets it spin backwards. Driving a rotor in reverse inverts both its thrust and its drag torque, so it can still generate yaw torque. This needs an ESC that can actually reverse the motor.

The opposite motor is taken from the configured geometry: it is the counter-rotating rotor closest to the failed rotor's antipode, and it is only computed for a 6-rotor multirotor geometry.

Reverse Thrust Fraction

A propeller spun backwards produces less thrust than it does forwards, and CA_REV_THR_FRAC tells the allocator what fraction to expect (default 0.4, i.e. 40%, which is representative of a standard multicopter propeller). A symmetric (3D) propeller produces almost the same thrust either way, so it should be set closer to 1.0.

A value in the right region is best, but it is not critical: a hexarotor still recovers with 1.0 set on a propeller whose real fraction is 0.4.

ESC Requirements for Reversing

Mode 2 reverses whichever motor sits opposite the one that failed, and any of the six can fail, so every motor on the vehicle has to be able to reverse (not just one of them).

Reversing needs all of the following:

  1. Motors and ESCs that can be driven backwards.
  2. Reversal enabled in the ESC configuration. This is set in the ESC (PX4 does not set it for you).
  3. CA_FAILURE_MODE = 2.
  4. For DShot ESCs only: DSHOT_3D_ENABLE = 1.

Nothing else is required, in particular the motors do not have to be marked as bidirectional (CA_R_REV). PX4 makes the recovery motor reversible by itself while handling the failure, and returns it to forward-only if the failure clears.

DroneCAN

Reverse is part of the protocol: PX4 sends the recovery motor a negative RawCommand, and an ESC configured for bidirectional operation spins it backwards. No additional PX4 parameter is needed. See Reversible motors in DroneCAN ESCs.

DShot

A reversible output is encoded using the DShot 3D split range, where neutral sits in the middle of the range The ESC has to be running in 3D mode, which is a persistent ESC setting (see ESC Commands), and PX4 has to be told about it with DSHOT_3D_ENABLE. DSHOT_3D_ENABLE puts every motor on the matching encoding. This has nothing to do with Bidirectional DShot, which is about eRPM telemetry rather than reversing a motor.

WARNING

DSHOT_3D_ENABLE and the 3D setting in the ESCs must always agree, whether or not a motor has failed. If the ESCs run in 3D mode while DSHOT_3D_ENABLE is 0, the lower part of the throttle range is sent in the range those ESCs read as reverse, and the vehicle is not flyable.

PWM, OneShot, and Other Protocols

These cannot reverse a motor, so CA_FAILURE_MODE has to be 1 or 0. With mode 2 the recovery motor would sit at around half throttle forwards instead of reversing, which is worse than stopping it.

WARNING

PX4 does not check whether an ESC can reverse, and a reverse command sent to an ESC that is not set up for it comes out as forward thrust. Before flying with mode 2, confirm on the bench that each motor really does spin backwards, for example from the sign of the reported RPM.

Failure Detection

Recovery reacts to the motor failure flag raised by the failure detector, which is set when either:

  • an ESC stops sending telemetry, or reports a fault. This requires COM_ARM_CHK_ESCS to be enabled.
  • the current reported by an ESC is outside the band expected for its commanded thrust. This requires FD_ACT_EN to be enabled, and the MOTFAIL_* thresholds to be tuned for the vehicle.

Either path needs ESC telemetry, so recovery is only possible with telemetry-capable ESCs (such as DroneCAN or DShot with telemetry). Note that the two are gated by different parameters: an ESC that goes silent triggers recovery with FD_ACT_EN disabled, as long as COM_ARM_CHK_ESCS is enabled.

The current-based check latches: once a motor is flagged it stays flagged until the vehicle disarms. This is deliberate, because the recovery stops the failed motor, which would otherwise make it look healthy again and clear the failure. The ESC offline/fault check does clear if the ESC starts reporting again, in which case all motors are restored to the allocation and any runtime reverse is removed.

To exercise the whole chain you can take an ESC offline with failure injection: failure esc off -i <n>.

Parameters

ParameterDescription
CA_FAILURE_MODEWhat to do on a single motor failure.
0 (default): Ignore and report failure.
1: Remove failed motor from allocation. Hexarotor: also stop the opposite motor.
2: Remove failed motor from allocation. Hexarotor: also reverse the opposite motor.
CA_REV_THR_FRACFraction of forward thrust that the recovery motor is expected to produce in reverse (default 0.4). Only used by mode 2.

See Also