MAVLINKHUD

Overview

The FSTRATE parameter group configures the Fast-Rate Threading architecture of the autopilot. This is an advanced performance feature for modern flight controllers (STM32F7 and H7).

Key Concepts

1. Multi-Threaded Control

Standard autopilots run all tasks in a single loop. If a slow task (like writing to the SD card) takes too long, it can "starve" the critical attitude control loop, causing a jittery flight.

  • Fast Rate Enable: By setting FSTRATE_ENABLE = 1, the autopilot creates a separate, high-priority CPU thread dedicated only to the high-frequency control loops (Gyro -> PID -> Motors).

2. Stability

This ensures that no matter how busy the autopilot gets with telemetry or missions, the motors always receive their updates at a perfect, jitter-free frequency (e.g., exactly 400Hz or 800Hz).

Parameter Breakdown

  • FSTRATE_ENABLE:
    • 0: Disabled (Single-threaded).
    • 1: Enabled (Dedicated high-priority loop).

Developer Notes

  • Library: AP_Scheduler.
  • Recommendation: Highly recommended for all modern H7 boards (Orange Cube, Pixhawk 6X, etc.) to achieve the best possible flight feel.

FSTRATE_ENABLE

Option
Default 0
Range 0 1

Fast Rate Thread Enable (FSTRATE_ENABLE)

Description

This parameter enables a dedicated, high-priority thread for the main attitude control loop.

By offloading the critical "Fast Loop" (typically 400Hz or higher) to its own thread, ArduPilot can ensure that attitude stabilization is prioritized above all other tasks (like logging, telemetry, or mission logic). This reduces "jitter" in the control loop timing and allows the vehicle to fly smoother and more locked-in.

The Mathematics

When enabled, the scheduler splits the workload:

  • Main Thread: Handles 10Hz to 50Hz tasks (Navigation, GPS, Logging).
  • Fast Thread: Handles 400Hz+ tasks (Gyro sampling, Rate PID loops, Motor output).

The update rate of this thread is controlled by FSTRATE_DIV, which divides the raw gyro sample rate.

The Engineer's View

In ArduCopter/Copter.cpp (and the scheduler logic), this flag triggers the creation of the FastLoop thread.

  • 0: Disabled. All code runs in a single main loop. This is safer for very low-end boards but less performant.
  • 1: Enabled. The rate controller runs in parallel with the rest of the code.

Tuning & Behavior

  • Default Value: 0 (Disabled) on older firmware/boards. Often 1 on modern H7 boards.
  • Recommendation: Enable this on any modern flight controller (STM32F7/H7). It significantly improves flight performance.
  • Note: If you see "Scheduler Overrun" errors after enabling this, your loop rate might be set too high for the processor.