MAVLINKHUD

CRUISE Mode (Plane)

Executive Summary

CRUISE Mode is the long-range pilot's best friend. It acts like Fly-By-Wire B (FBWB) for altitude and speed control but adds a Ground Course Lock. When you release the aileron stick, the plane locks onto its current compass heading and flies a perfectly straight line, correcting for wind drift.

Theory & Concepts

1. The Heading-Hold Logic

CRUISE mode is essentially "Autopilot with a Compass."

  • The Problem: In manual flight, you are constantly making small corrections to stay on path.
  • The Solution: The Heading-Hold controller. When you let go of the aileron stick, the EKF captures the current GPS Ground Course. It then uses the L1 controller to build a virtual path along that course.
  • The Benefit: This is the most efficient way to fly long distances. You can literally let go of the sticks for 10 miles and the plane will stay on its track.

2. Relative Airspeed management

In CRUISE, your throttle controls Airspeed, not motor power.

  • Physics: If you are flying into a 10 m/s headwind, your ground speed will be slow. If you turn and fly downwind, your ground speed will be fast.
  • Autopilot: The plane manages the throttle to keep the Airspeed constant. This is safer because it ensures you always have enough lift over the wings to stay in the air, regardless of the wind.

Hardware Dependency Matrix

Unlike FBWA, CRUISE is a navigation mode.

Sensor Requirement Code Implementation Notes
GPS CRITICAL Required for Ground Course tracking. Without GPS, it cannot correct for wind drift or calculate the L1 trajectory.
Compass CRITICAL Required for heading.
Airspeed RECOMMENDED Improves the throttle/pitch management (TECS) significantly.

Control Architecture (Engineer's View)

CRUISE is a hybrid controller merging FBWB and L1 Navigation.

  1. Heading Lock Logic:
    • State: When the pilot releases the Roll/Rudder sticks for > 0.5s.
    • Action: The code projects a Virtual Waypoint 1km ahead of the vehicle along its current Ground Course vector.
    • Tracking: It engages the L1 Controller to fly to that waypoint. This ensures the plane flies a "Track", not just a "Heading" (it crabs into the wind to fly straight over the ground).
    • Code Path: ModeCruise::navigate().
  2. Altitude & Speed Logic (TECS):
    • Identical to FBWB.
    • Elevator Stick: Commands Climb/Descent Rate (m/s).
    • Throttle Stick: Commands Target Airspeed (m/s).
    • Mechanism: The TECS controller manages pitch and throttle to achieve these targets.

Pilot Interaction

  • Turning: Simply roll the plane with the aileron stick. The Heading Lock disengages, and the plane flies in "FBWA" roll mode (Angle control).
  • Locking: Release the stick. After 0.5 seconds, the new heading is captured, and the lock re-engages.
  • Climbing/Descending: Pull back or push forward. The plane climbs/descends at a controlled rate while maintaining speed and heading.

Failsafe Logic

  • GPS Loss: If GPS is lost, the L1 controller fails. The mode effectively degrades to FBWB (holding attitude but drifting with wind).

Key Parameters

Parameter Default Description
FBWB_CLIMB_RATE 2.0 (m/s) Climb rate at full back stick.
ARSPD_FBW_MIN 9 (m/s) Minimum target airspeed (throttle stick down).
ARSPD_FBW_MAX 22 (m/s) Maximum target airspeed (throttle stick up).

Source Code Reference