Useful tools & notes / Open source

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

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.

Scope: This is an experimental source-level extension, not a built-in PX4 feature or a universal firmware image. Other controller/ESC combinations require their own verification. Restore-command counters show commands sent; they don't establish ESC acknowledgement.

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.

Source: BENSHLOMO/px4-fpv-extensions · PX4 discussion: Issue #16890 (2021) · Development: AI-assisted software, directed and hardware-tested by Yisrael Ben-Shlomo.