PX4 Turtle Mode (Crash-Flip Recovery)
We needed turtle mode while building a small PX4 drone. It wasn't available in the build we were using, so we implemented it, tested it through real recoveries, and released the source for other builders.
Source code & release ↗Installation notes ↗
What is turtle mode?
Turtle mode, sometimes called flip-over-after-crash, lets a quadcopter roll itself upright after coming to rest inverted. Instead of a normal takeoff, the pilot selects motors that temporarily run in reverse, producing a turning moment around an edge of the frame or propeller guards.
It's particularly useful on small FPV and indoor drones. Flying beside shelving, walls, doorways or other obstacles means even a minor collision can turn a fully functioning aircraft upside down. In a difficult-to-reach space, recovery can otherwise mean ending the flight and physically retrieving the drone.
Why we built it
We were working on Project Dragonfly, a low, wide 2.5-inch Quad-X running PX4. We wanted the same basic recovery capability familiar from Betaflight. The PX4 community had raised the idea in a feature request on February 18, 2021. The request had no linked implementation, and turtle mode was not available in the build we were using.
We needed it for our own quad, so we built it. The first versions identified the switch and orientation, then selected the motors. Later revisions dealt with PX4 arming and DShot command handling, repeatable attempts, return to normal direction, and the recovery power needed for Dragonfly's low, wide frame.
We released the patch so other PX4 builders can use it, adapt it to their aircraft, and contribute improvements.
What we released
- Configurable Quad-X motor mapping, rather than fixed wiring.
- Temporary DShot direction reversal for compatible ESC firmware.
- Stick-selected recovery motors, adjustable entry and exit angles, and repeated attempts.
- Twenty-one native
TRTL_*parameters in QGroundControl covering motor mapping, radio channel, recovery timing and power. - Recovery/flight arming coordination, stop and direction-restoration sequencing.
- A pinned PX4 source patch, installation documentation, and automated host tests.
Tested hardware
We compiled and tested the implementation on Dragonfly: MicoAir H743 V2, custom PX4 v1.16.1, AM32 ESC firmware, RadioMaster TX16S and a 2.5-inch prop-guarded Quad-X. The aircraft performed a successful physical turtle recovery using the short-name TRTL_* build.
Get the patch
Everything is in the public BENSHLOMO PX4 FPV Extensions repository. Start with the experimental release, and consult the hardware matrix before trying it on another build.