Flip Mode (Copter)
Executive Summary
Flip Mode is a pre-programmed aerobatic maneuver that makes the vehicle perform a 360-degree rotation on the Roll or Pitch axis. It is designed to be safe and reproducible, using a specific state machine to manage the rotation rate and throttle to minimize altitude loss.
Theory & Concepts
1. Rotational Momentum
Performing a 360-degree flip requires overcoming the Inertia of the battery and frame.
- The Rotation: The drone must rotate at a rate high enough to complete the circle before it hits the ground.
- The Math: 400 deg/sec is chosen because it is fast enough to look "snappy" but slow enough that most standard motors have enough torque to stop the rotation at exactly 360 degrees.
2. Thrust Management in Inversion
Gravity is always pulling the drone DOWN.
- Stage 1: Thrust is applied UP to gain momentum.
- Stage 2: When inverted, the props point DOWN. If you don't cut the throttle, you will accelerate into the ground at 20m/s/s.
- The Solution: ArduPilot's flip logic performs an automated Throttle Cut during the inverted phase of the maneuver.
Hardware Dependency Matrix
Like Acro, Flip mode relies on high-speed rate control.
| Sensor | Requirement | Code Implementation Notes |
|---|---|---|
| Gyroscope | CRITICAL | Required for the 400 deg/sec rate controller. |
| Accelerometer | CRITICAL | Required for the "Recovery" phase to return the vehicle to a level attitude after the flip completes. |
| GPS | NONE | Not used. |
| Barometer | NONE | Altitude control is open-loop (hardcoded throttle boosts) during the maneuver. |
Control Architecture (Engineer's View)
Flip Mode is implemented as a rigid State Machine in mode_flip.cpp.
- Stage 1: Start (Nose Up)
- The vehicle rotates until it reaches 45 degrees.
- Throttle: Boosted by
FLIP_THR_INC(+20%) to gain vertical momentum.
- Stage 2: Inversion (The Flip)
- The vehicle commands a hard rotation rate (
FLIP_ROTATION_RATE= 400 deg/s). - Throttle: Reduced by
FLIP_THR_DEC(-24%) to prevent accelerating into the ground while inverted.
- The vehicle commands a hard rotation rate (
- Stage 3: Recovery (Leveling)
- Once the vehicle passes the inverted point and approaches level (< 45 deg error), it switches to the
Recoverstate. - It uses the Earth-Frame Angle Controller (Stabilize) to lock level.
- Throttle: Boosted again (
FLIP_THR_INC) to catch the fall.
- Once the vehicle passes the inverted point and approaches level (< 45 deg error), it switches to the
- Stage 4: Complete
- The mode exits and returns to the previous flight mode (usually Stabilize or AltHold) or stays in Stabilize.
Pilot Interaction
- Trigger: The mode is engaged via a switch.
- Direction Selection: Once engaged, the pilot moves the Roll or Pitch stick to "command" the direction of the flip.
- Abort: If the pilot moves the sticks significantly during the flip (> 40 degrees equivalent), the mode aborts and returns manual control to prevent fighting the pilot.
Failsafe Logic
- Timeout: If the flip takes longer than 2.5 seconds (
FLIP_TIMEOUT_MS), the mode abandons the maneuver and switches to a Stabilize-like recovery to prevent an infinite tumbling state.
Key Parameters
There are NO user-configurable parameters for Flip Mode in the standard parameter list. The behavior is hardcoded in the source.
| Constant (Hardcoded) | Value | Description |
|---|---|---|
FLIP_ROTATION_RATE |
40000 | (centi-deg/s) 400 degrees per second rotation target. |
FLIP_THR_INC |
0.20 | 20% throttle boost during start/recovery. |
FLIP_THR_DEC |
0.24 | 24% throttle cut during inversion. |
Source Code Reference
- Mode Logic:
ardupilot/ArduCopter/mode_flip.cpp - State Machine:
ModeFlip::run()