MAVLINKHUD

THERMAL Mode (Plane)

Executive Summary

THERMAL Mode (Soaring) allows a fixed-wing aircraft (typically a glider) to autonomously detect, track, and utilize updrafts (thermals) to gain altitude without using motor power. It uses an advanced estimation filter to center the aircraft in the lift, potentially extending flight times indefinitely.

Theory & Concepts

1. The Physics of Lift (Thermals)

Thermals are rising columns of air heated by the ground.

  • The Problem: You cannot "see" a thermal. You can only feel it as a vertical acceleration.
  • The Math: By comparing the drone's energy state (Speed + Height) against the predicted drag, the EKF can mathematically "extract" the rising air's velocity.
  • The Strategy: Once lift is detected, the plane turns into it. It "centers" the thermal by tightening the turn where the lift is strongest and widening where it is weakest.

2. Cross-Country (XC) Soaring

Thermals drift with the wind.

  • In THERMAL mode, the plane orbits a moving point in space. This is a 4D problem: Latitude, Longitude, Altitude, and Time.
  • ArduPilot's thermal EKF treats the rising air mass as a moving "Body," allowing the plane to "climb the elevator" while drifting downwind toward the mission goal.

3. Detection (Netto Variometer)

The AP_Soaring library continuously calculates the Netto Climb Rate.

  • Netto = Measured_Climb - Theoretical_Sink.
  • Theoretical Sink: Calculated from the aircraft's Polar Curve (POLAR_CD0, POLAR_B) and current airspeed/bank angle.
  • If Netto > SOAR_VSPEED, a thermal is detected.

Hardware Dependency Matrix

Effective soaring requires precise energy measurement.

Sensor Requirement Code Implementation Notes
Barometer CRITICAL Primary source for vertical speed (Climb Rate).
Airspeed CRITICAL Required to calculate the aircraft's theoretical sink rate (Polar Curve). Without airspeed, the flight controller cannot distinguish between "climbing because I pulled up" (stick thermal) and "climbing because the air is rising" (true thermal).
GPS CRITICAL Required for position tracking and wind estimation.

Control Architecture (Engineer's View)

The Soaring feature acts as a high-level supervisor.

  1. Detection (Netto Variometer):
    • The AP_Soaring library continuously calculates the Netto Climb Rate.
    • Netto = Measured_Climb - Theoretical_Sink.
    • Theoretical Sink: Calculated from the aircraft's Polar Curve (POLAR_CD0, POLAR_B) and current airspeed/bank angle.
    • If Netto > SOAR_VSPEED, a thermal is detected.
  2. Engagement:
    • If SOAR_ENABLE is active, the autopilot can automatically pause the current mode (e.g., AUTO, CRUISE, FBWB) and switch to THERMAL.
  3. Tracking (The Thermal EKF):
    • The controller uses an Extended Kalman Filter to estimate the Center Position, Radius, and Strength of the thermal.
    • It flies a Loiter path that constantly adjusts its center to match the estimated thermal core.
  4. Exit Strategy:
    • The mode exits if:
      • Altitude > SOAR_ALT_MAX.
      • Thermal Strength < SOAR_VSPEED.
      • Distance drifted from flight path > SOAR_MAX_DRIFT.
    • Code Path: ModeThermal::restore_mode().

Pilot Interaction

  • Automatic: In most cases, the pilot does nothing. The plane thermals itself.
  • Manual Trigger: You can manually switch to THERMAL mode if you suspect lift.
  • Suppression: Toggle the SOAR_ENABLE switch low to force the plane back to its previous task.

Key Parameters

Parameter Default Description
SOAR_ENABLE 0 Master switch.
SOAR_VSPEED 0.7 (m/s) Minimum rising air speed to trigger thermal mode.
SOAR_ALT_MAX 350 (m) Ceiling. Stop thermalling above this.
SOAR_ALT_MIN 50 (m) Floor. Don't thermal below this.
POLAR_CD0 0.027 Drag coefficient (Zero lift). Critical for accurate detection.

Source Code Reference