MAVLINKHUD

Overview

The SPD parameter group (specifically SPD_SCA_BASE or MOT_SPD_SCA_BASE) configures speed-based scaling for the attitude controllers.

Key Concepts

1. Dynamic Scaling

On high-speed vehicles, the effectiveness of the control surfaces (or motor differential) increases with speed. At high speeds, the drone may become "twitchy" or oscillate if the PID gains remain the same as they are at a hover.

  • SPD_SCA_BASE: Defines the ground speed (m/s) at which the attitude PID gains are at their nominal value. As speed increases above this, the autopilot automatically "detunes" (reduces) the gains to maintain stability.

Developer Notes

  • Library: libraries/AP_Motors.
  • Context: Most common on Tailsitters and high-speed multirotors.

SPD_SCA_BASE

m/s
Default 1.0
Range 0 10

Motor speed scaling base speed (SPD_SCA_BASE)

Description

This parameter is used on Ground Vehicles (Rovers/Boats) with "Regular" steering (e.g., a front-wheel steering car). It defines the "Safe Speed" threshold for full steering authority.

As a rover drives faster, small steering inputs cause much more aggressive cornering, which can lead to rollovers or loss of traction. To prevent this, ArduPilot automatically scales down the steering output as the vehicle's speed increases. SPD_SCA_BASE is the speed at which this reduction begins.

The Mathematics

The steering command is scaled linearly based on the ratio of the base speed to the current ground speed ($V\_{ground}$):

$$ \text{IF } |V\_{ground}| > SPD\_SCA\_BASE: $$
$$ \text{Steering}{eff} = \text{Steering}{cmd} \times \left( \frac{SPD\_SCA\_BASE}{|V\_{ground}|} \right) $$

If the vehicle is moving slower than the base speed, the multiplier is 1.0 (no reduction).

The Engineer's View

In AP_MotorsUGV::output_regular() (libraries/AR_Motors/AP_MotorsUGV.cpp):

  1. The code checks if _speed_scale_base is positive.
  2. It compares the current ground speed to this base.
  3. The inverse scaling is applied to the steering term.
  4. This implementation is essentially an "Electronic Steering Rack" that becomes slower and more stable at high speeds, mirroring the behavior of modern high-performance automobiles.

Tuning & Behavior

  • Default Value: 1.0 m/s.
  • Effect of Increasing: The vehicle maintains full steering sensitivity at higher speeds. Useful for slow, high-torque crawlers.
  • Effect of Decreasing: The steering becomes "stiffer" (less sensitive) sooner as you accelerate. Recommended for fast on-road rovers to prevent high-speed flipping.
  • 0: Disables speed scaling entirely. Use with caution on fast vehicles.