MAVLINKHUD

Overview

The SCALING parameter group (specifically SCALING_SPEED) is a fundamental configuration for ArduPlane (Fixed-Wing).

Aerodynamics are highly speed-dependent. As a plane flies faster, the same amount of control surface movement (e.g., 5 degrees of aileron) produces significantly more roll force. To maintain stable flight across a wide speed range, the autopilot must automatically scale (reduce) its servo movements as airspeed increases.

Key Concepts

1. Speed Scaling

  • SCALING_SPEED: The "Reference Speed" (m/s) at which your tuned PID gains are exactly 100% effective.
    • Cruise: Usually set to your typical cruise speed.
    • Autotune: Automatically set by the Autotune process to the speed at which the tune was performed.

2. The Inverse Relationship

The autopilot calculates a multiplier: Scaler = SCALING_SPEED / Current_Airspeed.

  • Faster: If the plane flies twice as fast as SCALING_SPEED, the control movements are cut in half.
  • Slower: If the plane flies slower, the control movements increase to maintain authority.

Developer Notes

  • Library: ArduPlane/Attitude.cpp.
  • Fallback: If no airspeed sensor is present, the system uses a throttle-based estimation of speed scaling.

SCALING_SPEED

m/s
Default 15.0
Range 0 50

Speed scaling reference speed (SCALING_SPEED)

Description

This parameter sets the "Baseline Airspeed" for the control surface scaling system.

As a fixed-wing aircraft flies faster, its control surfaces (ailerons, elevator, rudder) become more effective, generating more force for the same amount of movement. To prevent the aircraft from becoming twitchy or oscillating at high speeds, ArduPilot automatically reduces the control surface movement as speed increases.

SCALING_SPEED is the speed at which your tuned PID gains are applied exactly as written (Multiplier = 1.0).

  • Faster than SCALING_SPEED: Surfaces move LESS than the PID requests (Multiplier < 1.0).
  • Slower than SCALING_SPEED: Surfaces move MORE than the PID requests (Multiplier > 1.0).

Critical: This value is typically set to your Cruise Speed or the speed at which you performed Autotune.

The Mathematics

The system calculates a scaling factor ($K\_{scale}$) that is applied to the P, I, and D terms of the attitude controllers.

$$ K\_{scale} = \frac{SCALING\_SPEED}{V\_{true}} $$

Where $V\_{true}$ is the current True Airspeed (TAS).

  • If $V\_{true} = SCALING\_SPEED$, $K\_{scale} = 1.0$
  • If $V\_{true} = 2 \times SCALING\_SPEED$, $K\_{scale} = 0.5$ (Half deflection for same error).

This inverse-linear relationship is derived from the physics of steady-state rate control, where the required deflection for a given turn rate scales inversely with velocity ($\delta \propto \frac{p}{V}$).

The Engineer's View

In Plane::calc_speed_scaler() (ArduPlane/Attitude.cpp), this scaler is computed and then constrained.

  • Upper Limit: The scaler is capped at roughly 2.0 (or calculated based on AIRSPEED_MIN) to prevent excessive surface throw at stall speeds.
  • Lower Limit: The scaler is floored at 0.5 (or calculated based on AIRSPEED_MAX) to prevent loss of control at high speeds.
  • No Airspeed Sensor: If no airspeed sensor is present, the system estimates speed scaling using THROTTLE_CRUISE vs actual Throttle, applying a square root approximation: $Scale = \sqrt{\frac{THROTTLE\_CRUISE}{Throttle\_{out}}}$.

Tuning & Behavior

  • Default Value: 15.0 m/s
  • Range: 5 to 50 m/s
  • Effect of Changing:
    • Increasing SCALING_SPEED: Makes the surfaces move more at all speeds (higher effective gain).
    • Decreasing SCALING_SPEED: Makes the surfaces move less at all speeds (lower effective gain).
  • Golden Rule: If you change SCALING_SPEED after tuning, you invalidate your tune. You must re-tune (Autotune) or manually scale your P/I/D gains by the ratio of the change.