AUTO Mode (Plane)
Executive Summary
AUTO mode is the primary autonomous flight mode for fixed-wing aircraft. It executes a pre-planned mission uploaded to the flight controller. Unlike multicopters which can stop at waypoints, fixed-wing AUTO mode focuses on continuous path following, using banking turns and energy management to navigate efficiently.
Theory & Concepts
1. Total Energy Control (TECS)
Autonomous fixed-wing flight is an energy-management problem.
- The Physics: Altitude is Potential Energy. Airspeed is Kinetic Energy.
- The Controller (TECS): Instead of controlling Pitch and Throttle separately, ArduPilot treats them as two sides of the same coin.
- To gain Energy: Increase Throttle.
- To distribute Energy: Use the Elevator to trade Speed for Height (or vice-versa).
- The Benefit: This prevents the "Phugoid Oscillation" (roller-coastering) where a plane over-climbs, loses speed, dives to gain speed, and repeats.
2. The L1 Navigation Algorithm
How do you make a plane fly a perfectly straight line in a crosswind?
- The Concept: L1 is a "non-linear" guidance law. It places a virtual point on the path ahead of the plane and calculates the lateral acceleration required to reach that point.
- The Crabbing: Because it follows the ground track, the plane will automatically "crab" (point its nose into the wind) to ensure the path over the ground is a straight line.
Hardware Dependency Matrix
Fixed-wing autonomous flight has specific requirements for airspeed and attitude estimation.
| Sensor | Requirement | Code Implementation Notes |
|---|---|---|
| GPS | CRITICAL | Required for position and ground speed estimation. |
| Compass | CRITICAL | Required for heading. Unlike Copter, planes cannot simply "yaw" to fix heading; they must bank. Accurate heading is essential for L1 navigation. |
| Airspeed | RECOMMENDED | While synthetic airspeed (calculated from GPS/IMU) works, a physical pitot tube drastically improves TECS (Throttle/Pitch) performance, preventing stalls during climbs or turns. |
| Barometer | REQUIRED | Primary source for altitude control. |
Control Architecture (Engineer's View)
Plane AUTO mode relies on two major controllers working in parallel:
- Lateral Control (L1 Controller):
- Goal: Follow the line between two waypoints.
- Mechanism: It calculates a "Lateral Acceleration" required to get back on the line. It converts this into a Bank Angle.
- Behavior: It accounts for ground speed and turn radius. It will "cut corners" (turn early) at waypoints to maintain momentum.
- Reference:
AP_L1_Controllibrary.
- Longitudinal Control (TECS):
- Goal: Manage Altitude and Airspeed.
- Mechanism: Total Energy Control System (TECS). It trades Kinetic Energy (Speed) for Potential Energy (Altitude).
- Logic:
- To go UP and FAST: Increase Throttle.
- To go DOWN and SLOW: Decrease Throttle + Pitch Up (drag).
- To go UP and SLOW: Pitch Up (trade speed for height).
Pilot Interaction
In AUTO, the pilot is usually a passenger, but Stick Mixing allows intervention.
- Stick Mixing (
STICK_MIXING= 1):- If you move the sticks, your input is added to the autopilot's command.
- Example: If the plane is banking right to follow a waypoint, and you hold Left Stick, you can cancel out the bank or force it left.
- Danger: You are fighting the autopilot. When you let go, it snaps back to the mission path.
- Throttle: Usually ignored (controlled by TECS), unless
THR_PASS_STABis enabled or specific parameters allow nudging.
Failsafe Logic
- GPS Loss: The L1 controller fails. The plane will likely switch to a non-GPS mode (like Stabilize or AltHold) or trigger a "Dead Reckoning" failsafe.
- Stall Prevention: Even in AUTO, the stall prevention logic is active. If airspeed drops too low, the controller will pitch down to regain speed, even if it means losing altitude (violating the waypoint altitude target).
Key Parameters
| Parameter | Default | Description |
|---|---|---|
NAVL1_PERIOD |
20 | (s) Aggressiveness of the L1 controller. Lower = tighter tracking (more weaving). Higher = smoother (sloppier). |
TECS_CLMB_MAX |
5 | (m/s) Max climb rate allowed. |
MIN_GNDSPD_CM |
0 | Minimum ground speed. Prevents the plane from stopping in high winds (flying backwards relative to ground). |
STICK_MIXING |
1 | 0=Disabled (Pilot locked out), 1=Enabled (Fly-Through). |
Source Code Reference
- Mode Logic:
ardupilot/ArduPlane/mode_auto.cpp - Stick Mixing:
Plane::stabilize_stick_mixing_fbw()