MAVLINKHUD

Overview

The RLL parameter group (often appearing as RLL_ or RLL2SRV_) configures the Roll Attitude Controller for ArduPlane.

This library is responsible for maintaining the requested bank angle (e.g., "Bank 30 degrees left") and managing the rotation rate of the aircraft by driving the aileron servos.

Key Concepts

1. Roll-to-Servo (RLL2SRV_...)

The core PID controller for fixed-wing roll.

  • RLL2SRV_P/I/D: Standard PID gains.
  • RLL2SRV_TCONST: The time constant (seconds) for the roll response. Defines how long it takes to reach 63% of the target angle.

2. Rate Limits (RLL2SRV_RMAX)

Defines the maximum physical roll rate (deg/s) the autopilot is allowed to request. This protects the airframe from over-stress and ensures the pilot stays within safe maneuvering limits.

Parameter Breakdown

  • RLL2SRV_P: Proportional gain.
  • RLL2SRV_TCONST: Speed of response (typically 0.4s to 0.7s).
  • RLL_RATE_P: (If present) Direct gyro-rate feedback gain.

Integration Guide

  • Tuning: Use AUTOTUNE in ArduPlane. It will automatically find the best RLL2SRV_P, I, and D values by performing a series of controlled rolls.
  • Oscillation: If the plane "waggles" its wings rapidly in FBWA mode, reduce RLL2SRV_P or increase RLL2SRV_TCONST.

Developer Notes

  • Library: libraries/APM_Control/AP_RollController.cpp.

RLL2SRV_RMAX

deg/s
Default 0
Range 0 180

Maximum Roll Rate (RLL2SRV_RMAX)

Description

RLL2SRV_RMAX acts as a "Speed Limit" for roll.

Even if the TCONST gain demands a roll rate of 300 $deg/s$ to fix an error, this parameter caps the request.

  • 0: Disabled (No limit).
  • 60: Cap at 60 $deg/s$.

Tuning & Behavior

  • Default Value: 0.
  • Recommendation: Set to match the physical capabilities of your airframe. If you ask for more than the plane can do, the integrator will wind up.

RLL2SRV_TCONST

s
Default 0.5
Range 0.4 1.0

Roll Time Constant (RLL2SRV_TCONST)

Description

RLL2SRV_TCONST defines the "Lag" between demanding a bank angle and achieving it.

It converts the Angle Error into a Desired Rate.
$$ \text{Rate}{cmd} = \frac{\text{Angle}{error}}{\text{TCONST}} $$

  • Small Value (0.4): High Gain. The plane tries to snap to the angle instantly. Can cause oscillation.
  • Large Value (0.8): Low Gain. The plane rolls lazily to the angle.

Tuning & Behavior

  • Default Value: 0.5 seconds.
  • Recommendation:
    • Aerobatic Plane: 0.3 - 0.4.
    • Large UAV / Glider: 0.6 - 0.8.

RLL_RATE_D

Default 0.004
Range 0.001 0.03

Roll Rate D Gain (RLL_RATE_D)

Description

RLL_RATE_D acts as a "Shock Absorber" for the roll axis.

When the plane rolls quickly to the target angle, it has momentum. D predicts that the error is closing fast and applies "Counter-Steer" to stop the roll smoothly without overshooting.

Tuning & Behavior

  • Default Value: 0.004.
  • Too High: You will see rapid, jittery oscillations or hear the servos chattering.
  • Too Low: The plane will bounce or "Wag" when you stop a roll.

RLL_RATE_D_FF

Default 0
Range 0 0.03

Roll Derivative Feed-Forward (RLL_RATE_D_FF)

Description

RLL_RATE_D_FF acts like an "Inertia Override."

When you flick the stick quickly, the autopilot sees a rapid change in your command. This parameter injects extra power immediately to overcome the drone's inertia and start the roll faster than a standard PID loop could.

RLL_RATE_FF

Default 0.345
Range 0 3.0

Roll Rate Feed-Forward (RLL_RATE_FF)

Description

RLL_RATE_FF is the most important gain for Fixed Wing aircraft.

It tells the autopilot: "If I want 30 degrees/sec roll rate, I know I need to move the ailerons to 15 degrees." It provides the bulk of the control surface movement directly from the stick input, bypassing the error-correction loop.

The Mathematics

$$ \text{Output} = k\_{FF} \cdot \text{Rate}\_{target} $$

Tuning & Behavior

  • Default Value: 0.345.
  • Recommendation: Tune this first (or use Autotune). If FF is correct, the P and I terms have very little work to do.

RLL_RATE_FLTD

Hz
Default 0
Range 0 50

Roll Rate Derivative Filter (RLL_RATE_FLTD)

Description

RLL_RATE_FLTD cleans up the gyro signal before the D-term calculates the rate of change.

The Derivative term amplifies noise. Without this filter, engine vibrations would cause the D-term to command erratic servo movements, leading to "Jitter" and hot servos.

Tuning & Behavior

  • Default Value: 0 (Disabled).
  • Recommendation: Always set this if using D-gain.
    • Large Plane: 5 - 10 Hz.
    • Small Plane: 10 - 20 Hz.

RLL_RATE_FLTE

Hz
Default 0
Range 0 50

Roll Rate Error Filter (RLL_RATE_FLTE)

Description

RLL_RATE_FLTE smooths out the "Error" signal (the difference between desired and actual rate). This helps prevent high-frequency noise from triggering jerky control surface movements.

RLL_RATE_FLTT

Hz
Default 0
Range 0 50

Roll Rate Target Filter (RLL_RATE_FLTT)

Description

RLL_RATE_FLTT smooths the pilot's stick inputs before they reach the PID controller.

  • 0: Disabled.
  • 5 Hz: Very smooth, "cinematic" feel.
  • 20 Hz: Sharp, responsive feel.

Tuning & Behavior

  • Default Value: 0 (Disabled).
  • Recommendation: Use 3 - 5 Hz if you want to fly smooth lines.

RLL_RATE_I

Default 0.15
Range 0.01 0.6

Roll Rate I Gain (RLL_RATE_I)

Description

RLL_RATE_I handles "Drift" and "Trim" on the roll axis.

If one wing is heavier than the other, or if your ailerons are slightly warped, the plane will constantly want to roll to one side. The I-term builds up aileron pressure over time to cancel out this bias and keep the roll rate at zero (level flight).

Tuning & Behavior

  • Default Value: 0.15.
  • Recommendation: Usually set equal to RLL_RATE_FF or found via Autotune.

RLL_RATE_IMAX

Default 0.666
Range 0 1

Roll Rate I Max (RLL_RATE_IMAX)

Description

RLL_RATE_IMAX limits how far the autopilot can move the ailerons to correct for a persistent error (like a bent wing or extreme crosswind).

  • Default (0.666): Allows the I-term to use up to 66% of the servo travel.

Tuning & Behavior

  • Recommendation: Leave at default. If set too low, the plane might not be able to hold level flight if it is badly out of trim.

RLL_RATE_P

Default 0.15
Range 0.08 0.35

Roll Rate P Gain (RLL_RATE_P)

Description

RLL_P is the "Instant Reaction" gain for your plane's roll axis.

When you move the aileron stick, you are commanding a roll rate (degrees per second). If the plane isn't rolling fast enough, P adds more aileron deflection immediately.

  • Too Low: The plane feels sluggish and disconnected. It takes a moment to start rolling.
  • Too High: The plane oscillates (wobbles) quickly in roll.

The Mathematics

$$ \text{Output} = k\_P \cdot (\text{Rate}{target} - \text{Rate}{actual}) $$

Tuning & Behavior

  • Default Value: 0.15.
  • Recommendation: Use Autotune to find the perfect value for your airframe.
  • Manual Tuning: Increase P until you see oscillations, then reduce by 30%.

RLL_RATE_PDMX

Default 0
Range 0 1.0

Roll Rate PD Max (RLL_RATE_PDMX)

Description

RLL_RATE_PDMX limits the total effort of the P and D terms.

It ensures that the high-speed portion of the PID loop (which reacts to quick movement) doesn't over-saturate the servos, leaving room for the slower, long-term I-term to do its job of keeping the plane level.

  • 0 (Default): Disabled (No limit).
  • 0.5: Limits the PD sum to 50% of the total servo travel.

RLL_RATE_SMAX

Default 0
Range 0 200

Roll Slew Rate Limit (RLL_RATE_SMAX)

Description

RLL_RATE_SMAX prevents the servos from moving too fast.

If the PID loop commands a jump from 0% to 100% aileron in 1 millisecond, this limiter slows it down to a more reasonable speed.

  • 0: Disabled (Unlimited).
  • Value: Maximum percentage change per second.

Tuning & Behavior

  • Recommendation: Usually left at 0 for planes. Can be used if you have very slow servos or fragile linkages.