MAVLINKHUD

Fly By Wire B (Plane)

Executive Summary

Fly By Wire B (FBWB) is an advanced assisted flight mode that builds upon FBWA. While FBWA stabilizes attitude, FBWB stabilizes Altitude and Airspeed. It feels like flying a plane with cruise control and an autopilot-managed throttle.

Theory & Concepts

1. Energy Conservation in Glides

FBWB is an "Energy Management" mode.

  • The Physics: Every plane has a "Best Glide" speed (ARSPD_CRUISE).
  • The Logic: If you pull back on the elevator in FBWB, the plane climbs. To climb, it needs energy. The TECS controller will either increase the throttle (adding energy) or decrease the airspeed (trading kinetic for potential energy).
  • The Benefit: You don't have to worry about the throttle. You just point the plane at the altitude you want, and the computer manages the "Engine" to get you there safely.

2. Terrain Awareness

Since FBWB is an altitude-locked mode, it is the safest mode for low-altitude cruising.

  • If you fly over a hill, the plane will maintain its Height Relative to Takeoff.
  • Advanced: If you have a Rangefinder or Terrain Database enabled, FBWB can automatically "Terrain Follow," keeping a constant distance from the dirt rather than a constant distance from the ocean.

Hardware Dependency Matrix

FBWB relies on the energy management system (TECS).

Sensor Requirement Code Implementation Notes
Airspeed RECOMMENDED While FBWB can fly with synthetic airspeed, a real Pitot tube provides the TECS controller with accurate energy data, preventing stalls and overspeeds much more reliably.
Barometer REQUIRED Required for altitude hold.
GPS REQUIRED Required for ground speed estimation (if no airspeed sensor) and position data.

Control Architecture (Engineer's View)

FBWB delegates pitch and throttle control to the Total Energy Control System (TECS).

  1. Elevator Logic (Climb Rate):
    • Unlike FBWA (where Elevator = Pitch Angle), in FBWB, Elevator = Target Climb Rate.
    • Center Stick: Maintain current altitude.
    • Pull Back: Climb at FBWB_CLIMB_RATE (m/s).
    • Push Forward: Descend.
    • Code Path: Plane::update_fbwb_speed_height().
  2. Throttle Logic (Airspeed):
    • The throttle stick does not control the motor directly. It sets the Target Airspeed.
    • Stick Low: Target ARSPD_FBW_MIN.
    • Stick High: Target ARSPD_FBW_MAX.
  3. TECS Mixer:
    • The TECS controller calculates the necessary Pitch Angle and Throttle % to achieve the requested Climb Rate and Airspeed simultaneously.
    • Example: If you demand a climb but low speed, TECS will pitch up and cut throttle. If you demand a climb and high speed, TECS will pitch up and floor the throttle.

Pilot Interaction

  • Cruising: Get to your desired altitude, release the elevator stick. The plane locks that altitude.
  • Turning: Use ailerons to turn (same as FBWA). The controller automatically adds back-pressure (pitch up) to maintain altitude in the turn.
  • Wind: Because the throttle manages Airspeed, the plane will automatically throttle up when flying upwind and throttle down when flying downwind to maintain consistent lift.

Failsafe Logic

  • Stall Prevention: TECS prioritizes speed over altitude. If you try to climb too steep and run out of power, TECS will nose-down to prevent a stall, even if it means losing altitude.

Key Parameters

Parameter Default Description
FBWB_CLIMB_RATE 2.0 (m/s) Climb rate at full stick deflection.
ARSPD_FBW_MIN 9 (m/s) Min target airspeed (Stick Low).
ARSPD_FBW_MAX 22 (m/s) Max target airspeed (Stick High).
FBWB_ELEV_REV 0 Reverse elevator response in FBWB (Up stick = Down).

Source Code Reference