MAVLINKHUD

Fly By Wire A (Plane)

Executive Summary

Fly By Wire A (FBWA) is the most popular stabilized flight mode for fixed-wing aircraft. It provides "Angle Control" for Roll and Pitch, meaning the stick position corresponds directly to the aircraft's bank/pitch angle. It is heavily safety-limited, preventing the pilot from rolling inverted or stalling the aircraft (if configured).

Theory & Concepts

1. Fly-By-Wire Architecture

In a standard plane, the cables move the surfaces. In a Fly-By-Wire system, the computer interprets your request and moves the surfaces for you.

  • Angle Limiting: The autopilot knows the Critical Bank Angle where a plane will lose lift. It forbids you from exceeding that angle, making it impossible to "Death Spiral" the aircraft in a turn.
  • Self-Leveling: It is a "Low Pass Filter" for human error. If you jerk the stick, the autopilot smoothens the move. If you let go, it returns to center.

2. Stall Prevention Theory

A stall happens when the Angle of Attack (the angle between the wing and the oncoming air) is too high.

  • The Problem: Most pilots pull "UP" on the elevator when they are scared. This increases the Angle of Attack and causes the stall.
  • The Solution: ArduPilot's FBWA monitors the airspeed. If you are flying too slow, it limits your elevator authority. You can pull full back, and the plane will only pitch up a few degrees, forcing it to keep enough speed to stay in the air.

Hardware Dependency Matrix

FBWA requires accurate attitude estimation.

Sensor Requirement Code Implementation Notes
Gyroscope CRITICAL Required for rate stabilization.
Accelerometer CRITICAL Required to determine "Level" and apply bank/pitch limits.
Airspeed RECOMMENDED Critical for Stall Prevention. Without airspeed, the controller cannot know if a high pitch angle is safe.
GPS NONE Not used.

Control Architecture (Engineer's View)

FBWA operates as an Angle Controller with hard limits.

  1. Angle Mapping:
    • Roll Stick: Maps to Bank Angle (ROLL_LIMIT).
      • Full Left = -ROLL_LIMIT (e.g., -45 deg).
      • Center = 0 deg (Level).
    • Pitch Stick: Maps to Pitch Angle.
      • Full Back = PITCH_LIMIT_MAX (e.g., +20 deg).
      • Full Forward = PITCH_LIMIT_MIN (e.g., -25 deg).
    • Self-Leveling: Because center stick maps to 0 degrees, the plane automatically levels itself when you let go.
  2. Throttle Passthrough:
    • Throttle is manual but constrained.
    • Range is clamped between THR_MIN and THR_MAX.
  3. Stall Prevention:
    • If STALL_PREVENTION is enabled and an Airspeed sensor is present:
    • If airspeed drops below safe limits, the controller overrides the pilot's pitch input to lower the nose, maintaining flying speed. This happens even if you hold full back stick.

Pilot Interaction

  • Turning: Hold the aileron stick to the side. The plane banks to ROLL_LIMIT and turns. To stop turning, center the stick.
    • Note: You may need to pull back on the elevator to maintain altitude in a steep turn, just like a real plane.
  • Climbing: Pull back. The plane climbs at a fixed angle. It does not maintain a specific climb rate (m/s), just a specific nose-up angle.

Failsafe Logic

  • Attitude Loss: If the AHRS fails (bad accel calibration or vibration), FBWA cannot determine level and may roll the plane upside down thinking it is flat.
  • Sensor Failure: If the Airspeed sensor fails, Stall Prevention may misbehave.

Key Parameters

Parameter Default Description
ROLL_LIMIT_DEG 45 Max bank angle (degrees).
PITCH_LIMIT_MAX 20 Max pitch up angle (degrees).
PITCH_LIMIT_MIN -25 Max pitch down angle (degrees).
STALL_PREVENTION 1 0=Disabled, 1=Enabled.
RLL2SRV_P ... Roll Angle P-gain. Determines how aggressively it seeks the target angle.

Source Code Reference