MAVLINKHUD

Overview

The ATC parameter group contains the core PID (Proportional-Integral-Derivative) tuning parameters for ArduCopter and QuadPlane (in VTOL modes).

This library is the "muscle" of the flight controller. It is responsible for taking the pilot's desire (e.g., "Lean 30 degrees right") and converting it into precise motor commands to achieve and maintain that attitude against wind and disturbances.

Key Concepts: The Control Loop

The attitude control logic works in a cascaded (nested) structure:

1. Angle Controller (Outer Loop)

  • Input: Desired Angle (from Pilot stick or Navigation).
  • Action: Calculates how fast the vehicle needs to rotate to reach that angle.
  • Output: Target Rate (deg/s).
  • Parameters: ATC_ANG_RLL_P, ATC_ANG_PIT_P, ATC_ANG_YAW_P.
  • Logic: Target_Rate = Error_Angle * P_Gain.

2. Rate Controller (Inner Loop)

  • Input: Target Rate (from Angle Controller) vs. Actual Rate (from Gyro).
  • Action: Calculates the necessary motor power adjustments.
  • Output: Motor Mixer Command (-1 to +1).
  • Parameters: ATC_RAT_RLL_P/I/D/FF.
  • Logic:
    • FF (FeedForward): Immediate output proportional to the target. Primary driver for sharp handling.
    • P (Proportional): Immediate correction based on error.
    • I (Integral): Long-term correction for imbalances/wind.
    • D (Derivative): Dampening to prevent overshoot.

3. Acceleration Limits

  • ATC_ACCEL_R_MAX / P_MAX / Y_MAX: Limits how quickly the Angle Controller can request a change in rate. This limits the "jerkiness" or physical aggression of the drone.

Parameter Breakdown

Rate Loops (The most critical tuning)

  • ATC_RAT_RLL_P, I, D, FF: Roll axis tuning.
  • ATC_RAT_PIT_P, I, D, FF: Pitch axis tuning.
  • ATC_RAT_YAW_P, I, D, FF: Yaw axis tuning.

Angle Loops (Feel & Stability)

  • ATC_ANG_RLL_P: Roll angle stiffness (typically 4.5 - 10.0).
  • ATC_ANG_PIT_P: Pitch angle stiffness.

Filters

  • ATC_RAT_RLL_FLTT: Target filter frequency (smooths inputs).
  • ATC_RAT_RLL_FLTE: Error filter frequency (smooths D-term noise).

Integration Guide

Basic Tuning Workflow

  1. AutoTune: The best way to tune ATC parameters is to use the AutoTune flight mode. It automatically tests the vehicle's response and calculates optimal P, I, D, and Angle P values.
  2. Manual Adjustment:
    • Oscillation (Fast Wobble): Reduce P and D terms.
    • Sluggishness: Increase P and FF.
    • Drift/Angle Hold Failure: Increase I.
    • Overshoot (Bounce back): Increase D or Reduce P.

Developer Notes

  • Library: libraries/AC_AttitudeControl
  • Vehicle: ArduCopter, ArduPlane (QuadPlane), ArduSub.
  • Evolution: Modern ArduPilot relies heavily on FeedForward (FF) for responsiveness, whereas older versions relied more on P.

ATC_ACCEL_MAX

$m/s^2$
Default 1.0
Range 0 10

Speed Control Acceleration Max (ATC_ACCEL_MAX)

Description

ATC_ACCEL_MAX is the "Launch Control."

It limits how fast the rover tries to speed up.

  • Low Value (e.g. 0.5): Slow, smooth starts. No wheelspin.
  • High Value (e.g. 5.0): Drag race mode.

Tuning & Behavior

  • Default Value: 1.0 $m/s^2$.
  • Recommendation: Set slightly lower than the physical limit of your traction to prevent wheelspin.

ATC_ACCEL_P_MAX

cdeg/s/s
Default 0.0
Range 0 180000

Pitch Acceleration Max (ATC_ACCEL_P_MAX)

Description

ATC_ACCEL_P_MAX defines the maximum "torque authority" allowed around the pitch axis (tilting forward or backward). It limits the intensity of the drone's longitudinal rotation changes.

Think of it as the drone's "pitch throttle." If you command a sudden dive, ATC_ACCEL_P_MAX ensures the drone doesn't flip into that dive so violently that it stalls its props or causes a brown-out. It provides the "softness" or "sharpness" of the start and stop of a pitch maneuver.

  • Low Value: Pitch changes are smooth and gradual. The drone will tilt forward or backward like a heavy ship.
  • High Value: Pitch changes are sharp and aggressive. The drone snaps into forward flight instantly.
  • Disabled (0): No limit is applied; the drone will rotate as fast as the motors can physically push the frame.

The Mathematics

This parameter limits the rate of change of the pitch angular velocity ($\omega\_{pitch}$):

$$ \left| \frac{\omega\_{pitch}(t) - \omega\_{pitch}(t-dt)}{dt} \right| \leq \text{ACCEL\_P\_MAX} $$

Where:

  • $\text{ACCEL\_P\_MAX}$ is in centidegrees/sec².
  • Example: A value of 36000 means the drone can increase its pitch rotation by 360 degrees per second, every second.

On frames like "Dead Cats," where the mass is distributed longitudinally, ACCEL_P_MAX often needs to be lower than ACCEL_R_MAX because the airframe has more inertia along the pitch axis.

The Engineer's View

This parameter is the _accel_pitch_max member in AC_AttitudeControl.

It is used in the Input Shaper for all pitch-related attitude commands:

// AC_AttitudeControl.cpp
_ang_vel_target.y = input_shaping_angle(error, _input_tc, get_accel_pitch_max_radss(), ...);

By constraining the input before it reaches the PID loop, ArduPilot ensures that the inner Rate Loop never receives a "step" command that it can't physically follow. This prevents P-gain "overshoot" and motor saturation during high-authority pitch changes.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 180,000
  • Effect of Increasing: Snappier pitch response. Better for high-speed tracking and stopping.
  • Effect of Decreasing: Smoother cinematic movement. Reduces the risk of "pitch bobbing" during aggressive flight.

Use Case Recommendations

  • Cinematography: Set to 36000. Provides a very professional, weighted feel to forward flight starts and stops.
  • Long-Range Flying: Set to 20000. High pitch accelerations are inefficient and increase drag; a lower limit keeps the drone in its "sweet spot" for cruise efficiency.
  • Racing / Acro: Keep at 0.0. Racers need the absolute maximum pitch authority to perform "power loops" and clear sharp turns.

Troubleshooting

  • Scenario: Drone nose "dips" or "bobs" when you release the stick after flying forward.
    • Diagnosis: ATC_ACCEL_P_MAX is likely set too high, allowing the drone to stop rotating faster than the PID loop can stabilize.
    • Fix: Reduce ATC_ACCEL_P_MAX to 40000 and re-test.

ATC_ACCEL_R_MAX

cdeg/s/s
Default 0.0
Range 0 180000

Roll Acceleration Max (ATC_ACCEL_R_MAX)

Description

ATC_ACCEL_R_MAX defines the "maximum torque" the flight controller is allowed to request around the roll axis. While ATC_RAT_RLL_P determines how much authority the drone has, ATC_ACCEL_R_MAX determines how much authority it is allowed to use to start or stop a rotation.

Think of it as the "traction control" for your drone's rotation. If this value is too high, the drone will try to snap into a roll so fast that the motors saturated or the battery voltage drops. If it is too low, the drone will feel "heavy" and slow to start moving, even if your PID gains are high.

  • Low Value: Flight feels very smooth, stable, and "heavy." Rotations start and stop with a noticeable ramp-up.
  • High Value: Rotations feel instant and sharp.
  • Disabled (0): The software does not limit angular acceleration (limited only by physical motor power).

The Mathematics

This parameter limits the rate of change of the target angular velocity ($\omega\_{target}$):

$$ \left| \frac{\omega\_{target}(t) - \omega\_{target}(t-dt)}{dt} \right| \leq \text{ACCEL\_R\_MAX} $$

Where:

  • $\text{ACCEL\_R\_MAX}$ is in centidegrees/sec².
  • Example: A value of 72000 means the drone can increase its rotation speed by 720 degrees per second, every second.

The Engineer's View

This parameter is the _accel_roll_max member in AC_AttitudeControl.

It is used in the Input Shaper logic inside AC_AttitudeControl::input_shaping_angle() and input_shaping_ang_vel().
These functions ensure that the setpoints sent to the PID loops are physically achievable by the drone, preventing the PID loops from "winding up" against impossible targets.

// AC_AttitudeControl.cpp
_ang_vel_target.x = input_shaping_angle(error, _input_tc, get_accel_roll_max_radss(), ...);

By keeping the target acceleration within this limit, ArduPilot ensures that the drone's attitude remains predictable and that the "Square Root Controller" (which handles large errors) doesn't over-command the motors.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 180,000 (0 to 1800 $deg/s^2$)
  • Effect of Increasing: Snappier, more immediate rotations. The drone feels "lighter."
  • Effect of Decreasing: Smoother, more cinematic rotations. Greatly reduces current spikes during aggressive flight.

Use Case Recommendations

  • Cinematography / Aerial Inspection: Set to 36000 - 54000. Limits the "jerkiness" of the drone, making it easier for the camera operator and reducing mechanical stress.
  • Large Professional Rig (>25 inch props): Set to 20000. Large props have enormous inertia; trying to accelerate them faster than 200 $deg/s^2$ usually results in wasted energy and heat.
  • High Performance / Racing: Keep at 0.0 or set >110000. Racers need the absolute maximum torque available to clear obstacles and make 180-degree turns.

Troubleshooting

  • Scenario: Drone feels "laggy" to start a roll, even though the PID gains are high.
    • Diagnosis: ATC_ACCEL_R_MAX is set too low, bottlenecking the command.
    • Fix: Increase ATC_ACCEL_R_MAX by 10000.

ATC_ACCEL_Y_MAX

cdeg/s/s
Default 0.0
Range 0 72000

Yaw Acceleration Max (ATC_ACCEL_Y_MAX)

Description

ATC_ACCEL_Y_MAX defines the maximum "spin authority" allowed around the vertical axis. It limits how fast the drone's heading can accelerate or decelerate.

Since multirotors yaw by changing torque, they have significantly less "grip" on the yaw axis than they do on roll or pitch. If you try to snap into a 360-degree spin too fast, the drone may lose its vertical lift (since motors are busy generating torque instead of lift). ATC_ACCEL_Y_MAX prevents this by forcing heading changes to be gradual and within the physical limits of the motors.

  • Low Value: Yaw turns are smooth and cinematic. The tail "glides" into and out of turns.
  • High Value: Yaw turns are sharp and robotic. The drone stops spinning instantly.
  • Disabled (0): The software does not limit heading acceleration.

The Mathematics

This parameter limits the rate of change of the yaw angular velocity ($\omega\_{yaw}$):

$$ \left| \frac{\omega\_{yaw}(t) - \omega\_{yaw}(t-dt)}{dt} \right| \leq \text{ACCEL\_Y\_MAX} $$

Where:

  • $\text{ACCEL\_Y\_MAX}$ is in centidegrees/sec².
  • Example: A value of 9000 means the drone can increase its spin rate by 90 degrees per second, every second.

Safety Limit: Yaw acceleration is typically set much lower than Roll/Pitch (e.g. 9,000 vs 50,000) because high yaw torque demands can "starve" the other axes, leading to a loss of control.

The Engineer's View

This parameter is the _accel_yaw_max member in AC_AttitudeControl.

It is used in the Input Shaper for heading commands:

// AC_AttitudeControl.cpp
_ang_vel_target.z = input_shaping_angle(error, _input_tc, get_accel_yaw_max_radss(), ...);

By keeping the heading command within this acceleration limit, ArduPilot ensures that the drone's vertical lift remains consistent during turns, preventing "altitude dip" that occurs when motors on one diagonal are spun up to their limit to provide yaw torque.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 72,000
  • Effect of Increasing: Snappier heading response. Better for high-speed tracking and sharp "Yaw Spins."
  • Effect of Decreasing: Smoother, more elegant yaw pans. Essential for professional videography.

Use Case Recommendations

  • Professional Cinematography: Set to 9000 - 18000. Creates perfectly smooth pans that don't look like they were made by a robot.
  • FPV Freestyle: Keep at 0.0 or set >54000. Required for maneuvers that rely on instant heading changes to change the drone's direction of momentum.
  • Mapping / Survey: Set to 18000. Ensures the drone turns at the end of each grid line smoothly without overshooting or causing gimbal vibrations.

Troubleshooting

  • Scenario: Drone loses 1-2 meters of altitude every time you perform a fast 360-degree spin.
    • Diagnosis: Yaw torque is starving the vertical lift (Saturation). ATC_ACCEL_Y_MAX is too high.
    • Fix: Reduce ATC_ACCEL_Y_MAX to 12000.

ATC_ANGLE_BOOST

Default 1
Range 0 1

Angle Boost (ATC_ANGLE_BOOST)

Description

ATC_ANGLE_BOOST is the "Auto-Altitude" feature of ArduPilot.

When a drone tilts to move forward, some of its propeller force is redirected sideways. Because less force is now pointing straight down, the drone will naturally lose altitude and "sink" unless the pilot increases the throttle. ATC_ANGLE_BOOST automates this. It "boosts" the throttle command based on how steep the lean is, ensuring the drone maintains a consistent hover height whether it's sitting still or zooming forward.

  • Enabled (1): The drone stays at the same height automatically during turns and forward dashes.
  • Disabled (0): The drone will sink whenever it tilts. The pilot must manually manage altitude with the throttle stick.

The Mathematics

The boost factor is based on the trigonometry of the drone's tilt angle ($\theta$):

$$ \text{Throttle}{boosted} = \frac{\text{Throttle}{base}}{\cos(\theta)} $$

Where:

  • $\theta$ is the combined roll and pitch angle.
  • $\cos(\theta)$ represents the vertical component of the total thrust vector.

Example: If a drone tilts by 60 degrees, its vertical lift is cut in half ($\cos(60^\circ) = 0.5$). To stay level, it must double its total motor power. ATC_ANGLE_BOOST handles this math instantly.

The Engineer's View

This parameter is the _angle_boost_enabled member in AC_AttitudeControl.

It is applied in AC_AttitudeControl_Multi::get_throttle_boosted():

// AC_AttitudeControl_Multi.cpp
float cos_tilt = _ahrs.cos_pitch() * _ahrs.cos_roll();
float boost_factor = 1.0f / constrain_float(cos_tilt_target, 0.1f, 1.0f);
float throttle_out = throttle_in * inverted_factor * boost_factor;

Crucially, the code includes a Tilt-Limit Safeguard: As the drone approaches 90 degrees (vertical), the math would command "infinite" power. ArduPilot caps the boost factor to prevent motor saturation and ensures the drone maintains enough control authority to level itself out.

Tuning & Behavior

  • Default Value: 1 (Enabled)
  • Range: 0 (Off) or 1 (On)
  • Effect of Enabling: Much easier to fly in manual modes. Essential for AltHold and Loiter to work correctly.
  • Effect of Disabling: "Old school" flight feel. The drone will descend during any movement.

Use Case Recommendations

  • Standard Multirotor: Always Keep Enabled (1). There is almost no reason to turn this off for modern multirotor flight.
  • Acrobatic Training: Disable (0) occasionally. If you want to learn how full-sized helicopters fly (where you must manually coordinate throttle and cyclic), turning this off provides a realistic challenge.
  • Cinematography: Always Keep Enabled (1). Ensures perfectly level tracking shots.

Troubleshooting

  • Scenario: Drone "climbs" slightly every time I fly forward at speed.
    • Diagnosis: This is rare, but usually means your motor thrust is non-linear or you have extreme aerodynamic lift from the drone's body.
    • Fix: Check MOT_THST_EXPO. If the problem persists, you can't "tune" angle boost (it's binary), so look for mechanical or sensor issues.

ATC_ANG_LIM_TC

s
Default 1.0
Range 0.5 10.0

Angle Limit Time Constant (ATC_ANG_LIM_TC)

Description

ATC_ANG_LIM_TC is a specialized safety parameter that handles "low-power" situations.

Multirotors need vertical thrust to stay in the air. When they tilt (lean), some of that thrust is redirected sideways for movement. If you are carrying a heavy load or have a weak battery, the motors might reach 100% power just to stay level. If you then try to tilt by 30 degrees, the drone will lose lift and fall.

ArduPilot automatically calculates a "Safe Tilt Angle" based on how much throttle you have left. ATC_ANG_LIM_TC determines how fast that limit is applied. It ensures the drone prioritizes "not falling out of the sky" over "moving sideways."

  • Low Value: The drone will aggressively and instantly limit your tilt if it thinks it is about to lose altitude.
  • High Value: The drone will allow temporary "overshoots" of the tilt limit, relying on momentum before slowly enforcing the new safety limit.
  • Default (1.0): A slow, 1-second decay that provides a smooth transition when reaching power limits.

The Mathematics

The controller calculates the maximum tilt ($\theta\_{max}$) that can be sustained at the current throttle setting. This parameter smooths that limit:

$$ \theta\_{lim\_smoothed} = \theta\_{lim\_smoothed\_prev} + \frac{dt}{dt + \tau} \cdot (\theta\_{max\_calculated} - \theta\_{lim\_smoothed\_prev}) $$

Where:

  • $\tau$ is ATC_ANG_LIM_TC.
  • $\theta\_{max\_calculated}$ is the physical limit based on motor saturation.

Implication: If you punch the throttle to climb, your available tilt angle drops. This parameter determines how quickly that drop is enforced on your stick inputs.

The Engineer's View

This parameter is the _angle_limit_tc member in AC_AttitudeControl.

It is used in AC_AttitudeControl_Multi::update_althold_lean_angle_max():

// AC_AttitudeControl_Multi.cpp
float althold_lean_angle_max = acosf(constrain_float(throttle_in / (AC_ATTITUDE_CONTROL_ANGLE_LIMIT_THROTTLE_MAX * thr_max), 0.0f, 1.0f));
_althold_lean_angle_max = _althold_lean_angle_max + (_dt / (_dt + _angle_limit_tc)) * (althold_lean_angle_max - _althold_lean_angle_max);

This is a critical part of the Altitude Hold prioritization logic. By smoothing the limit, the drone prevents jerky "twitching" of the attitude when flying at the edge of its performance envelope.

Tuning & Behavior

  • Default Value: 1.0s
  • Range: 0.5 - 10.0s
  • Effect of Increasing: The drone will be more "brave"—it will allow you to tilt aggressively even if it means losing a little altitude temporarily.
  • Effect of Decreasing: The drone is very "cautious"—it will flatten itself out immediately if it feels the motors working too hard.

Use Case Recommendations

  • Heavy Cargo Drones: Decrease to 0.5. You want the safety limits to kick in instantly to prevent any vertical drop.
  • Underpowered / Battery-Saving builds: Decrease to 0.5. Helps keep the drone in a safe operating range.
  • Racing / Acro-Loiter: Increase to 2.0. Allows the pilot to "force" a tilt for a second to clear an obstacle, accepting a temporary loss in height.

Troubleshooting

  • Scenario: During a fast forward dash in AltHold, the drone suddenly "nods" its nose up and slows down, even though my stick is still forward.
    • Diagnosis: The drone hit its power limit and is enforcing the angle limit.
    • Fix: If you have motor headroom, increase ATC_ANG_LIM_TC to 2.0 to make the correction less jarring.

ATC_ANG_PIT_P

Default 4.5
Range 3.0 12.0

Pitch Axis Angle P Gain (ATC_ANG_PIT_P)

Description

ATC_ANG_PIT_P controls the "stiffness" of the drone's pitch attitude (tilting forward or backward). It is the outer control loop responsible for ensuring the drone reaches and holds the requested pitch angle.

If you push the stick forward to fly, ATC_ANG_PIT_P determines how quickly the drone tilts into that forward movement. A high value makes the drone snap into the tilt; a low value makes it tilt gracefully.

  • Low Value: Pitch response feels "soft." The drone may take a noticeable amount of time to start moving or stop.
  • High Value: Pitch response feels immediate and sharp.
  • Too High: The drone will oscillate (bob its nose up and down) during hover or when sticks are released.

The Mathematics

This is a Proportional ($k\_P$) controller that converts an Angle Error into a Target Angular Velocity ($\omega$):

$$ \omega\_{pitch\_target} = k\_P \cdot (\theta\_{desired} - \theta\_{actual}) $$

Where:

  • $\omega\_{pitch\_target}$ is the requested rotation speed (deg/s) for the Pitch axis.
  • $\theta\_{desired}$ is the angle requested by the sticks or autopilot.
  • $\theta\_{actual}$ is the current estimated pitch from the AHRS.
  • $k\_P$ is ATC_ANG_PIT_P.
  • Dimensionality: $1/s$ (Hertz).

Note on Symmetry: On most symmetric multirotors (X-quads), this value should be identical to ATC_ANG_RLL_P. On rectangular frames ("Dead Cat" or Long-Range frames), it may need to be slightly different to account for the different weight distribution.

The Engineer's View

This parameter is an instance of the AC_P class, member _p_angle_pitch, inside AC_AttitudeControl.

It is executed in AC_AttitudeControl::update_ang_vel_target_from_att_error():

// AC_AttitudeControl.cpp
const float angleP_pitch = _p_angle_pitch.kP() * _angle_P_scale.y;
rate_target_ang_vel.y = angleP_pitch * attitude_error_rot_vec_rad.y;

The output rate_target_ang_vel.y is the input setpoint for the inner Pitch Rate PID loop (ATC_RAT_PIT_*).

Tuning & Behavior

  • Default Value: 4.5 (Standard)
  • Range: 3.0 - 12.0
  • Effect of Increasing: Faster nose-up/nose-down response. Better adherence to the flight path in missions.
  • Effect of Decreasing: Smoother, less robotic pitching. Reduces landing gear stress during hard stops.

Use Case Recommendations

  • Cinematography: Decrease to 3.5 - 4.0. Creates very smooth "tilt-up" or "tilt-down" shots.
  • Racing / FPV: Increase to 6.0 - 10.0. Allows for the instant pitch changes required for high-speed maneuvering and gate navigation.
  • Long-Range Mapping: Keep Default (4.5). Reliable, stable tracking.

Troubleshooting

  • Scenario: Drone nose "bobs" up and down specifically when stopping after forward flight.
    • Diagnosis: ATC_ANG_PIT_P is too high (Angle loop overshoot).
    • Fix: Reduce ATC_ANG_PIT_P by 0.5.

ATC_ANG_RLL_P

Default 4.5
Range 3.0 12.0

Roll Axis Angle P Gain (ATC_ANG_RLL_P)

Description

ATC_ANG_RLL_P is the primary "stiffness" setting for the drone's horizontal attitude. It controls the Outer Loop of the flight controller, which is responsible for maintaining the requested roll angle.

This parameter defines how aggressively the drone should rotate to correct a mistake in its tilt. If the pilot (or autopilot) wants a 20-degree lean, but the drone is currently level, ATC_ANG_RLL_P determines how fast the drone should start rolling to reach that 20-degree target.

  • Low Value: The drone feels "soft" or "soupy." It may take a long time to reach the desired tilt, making it feel non-responsive to stick inputs.
  • High Value: The drone feels "locked-in" and very responsive. Stick inputs feel immediate.
  • Too High: The drone will oscillate (jitter) in the roll axis, specifically when the pilot releases the sticks or during a hover.

The Mathematics

This is a Proportional ($k\_P$) controller that generates a Target Angular Velocity ($\omega$):

$$ \omega\_{roll\_target} = k\_P \cdot (\theta\_{desired} - \theta\_{actual}) $$

Where:

  • $\omega\_{roll\_target}$ is the requested rotation speed (deg/s) sent to the inner Rate Loop.
  • $\theta\_{desired}$ is the angle requested by the pilot's sticks or the position controller.
  • $\theta\_{actual}$ is the current roll estimate from the AHRS/IMU.
  • $k\_P$ is ATC_ANG_RLL_P.
  • Dimensionality: Since it converts Angle (deg) to Angular Velocity (deg/s), the unit of $k\_P$ is $1/s$ (Hertz).

Example: If the drone is 10 degrees off-target and ATC_ANG_RLL_P is 4.5, it will demand a rotation rate of 45 $deg/s$ to fix the error.

The Engineer's View

This parameter is an instance of the AC_P class, instantiated as _p_angle_roll within the AC_AttitudeControl library.

It is executed inside AC_AttitudeControl::update_ang_vel_target_from_att_error():

// AC_AttitudeControl.cpp
const float angleP_roll = _p_angle_roll.kP() * _angle_P_scale.x;
rate_target_ang_vel.x = angleP_roll * attitude_error_rot_vec_rad.x;

Note that the result is often passed through a Square Root Controller logic if the error is large, which helps prevent overshooting during massive corrections.

Tuning & Behavior

  • Default Value: 4.5 (Standard Multirotor)
  • Range: 3.0 - 12.0
  • Effect of Increasing: Snappier response to stick inputs. Tighter attitude hold in wind.
  • Effect of Decreasing: Smoother, more organic flight feel. Reduces the "robotic" look of automated flight.

Use Case Recommendations

  • Cinematography: Decrease to 3.5 - 4.0.
    • Why: Creates smoother transitions when starting and stopping rolls, making the camera footage less jarring.
  • FPV Freestyle / Racing: Increase to 6.0 - 9.0.
    • Why: Provides the "instant" response needed for proximity flying and rapid gates.
  • Autonomous Survey / Mapping: Keep Default (4.5).
    • Why: Provides reliable tracking of the mission grid without exciting mechanical resonances.

Troubleshooting

  • Scenario: Drone hovers perfectly, but when you let go of the roll stick after a move, it "bounces" or wobbles 2-3 times before settling.
    • Diagnosis: ATC_ANG_RLL_P is too high (Angle loop oscillation).
    • Fix: Reduce ATC_ANG_RLL_P by 0.5.

ATC_ANG_YAW_P

Default 4.5
Range 3.0 12.0

Yaw Axis Angle P Gain (ATC_ANG_YAW_P)

Description

ATC_ANG_YAW_P controls the drone's "heading stiffness." It is responsible for making sure the nose of the drone stays pointed where you want it.

If the wind pushes the tail of the drone, or if you command a 90-degree turn, ATC_ANG_YAW_P determines how hard the drone should start spinning to align with that new heading.

  • Low Value: The drone feels "sloppy" in its heading. It may drift away from its heading when accelerating or in wind. The nose feels "vague" to the pilot.
  • High Value: Heading hold is very precise. The drone snaps to new headings instantly.
  • Too High: The drone will oscillate its tail (wagging) or make sharp, sudden yaw corrections that cause the whole frame to twitch.

The Mathematics

This Proportional ($k\_P$) gain converts heading error into a Rotation Rate:

$$ \omega\_{yaw\_target} = k\_P \cdot (\psi\_{desired} - \psi\_{actual}) $$

Where:

  • $\omega\_{yaw\_target}$ is the requested rotation speed around the vertical axis (deg/s).
  • $\psi\_{desired}$ is the target heading (0-360 deg).
  • $\psi\_{actual}$ is the current heading (from Compass/EKF).
  • $k\_P$ is ATC_ANG_YAW_P.
  • Dimensionality: $1/s$ (Hertz).

Yaw Constraint: Heading error is always calculated using "Shortest Path" logic (the drone will never spin more than 180 degrees to fix its heading).

The Engineer's View

This parameter is an instance of the AC_P class, member _p_angle_yaw, inside AC_AttitudeControl.

It is executed in AC_AttitudeControl::update_ang_vel_target_from_att_error():

// AC_AttitudeControl.cpp
const float angleP_yaw = _p_angle_yaw.kP() * _angle_P_scale.z;
rate_target_ang_vel.z = angleP_yaw * attitude_error_rot_vec_rad.z;

The output rate_target_ang_vel.z becomes the input setpoint for the inner Yaw Rate PID loop (ATC_RAT_YAW_*).

Tuning & Behavior

  • Default Value: 4.5 (Standard)
  • Range: 3.0 - 12.0
  • Effect of Increasing: Tighter heading hold. Better rejection of motor-induced yaw torque (yaw-dip).
  • Effect of Decreasing: Smoother yaw turns. More "drifty" heading feel.

Use Case Recommendations

  • Precision Photography / Survey: Keep Default (4.5). Heading accuracy is important for georeferencing, but too much gain can cause vibration in the gimbal.
  • Yaw-Heavy Freestyle: Increase to 6.0 - 8.0. Provides the crisp yaw stops needed for maneuvers like "Yaw Spins" or "Orbit" mode.
  • Large Professional Drones: Keep Default or decrease to 3.5. Large frames have high yaw-inertia (due to long arms); pushing them too hard with P-gain leads to "frame flex" and low-frequency oscillations.

Troubleshooting

  • Scenario: Drone hovers well, but its tail "wags" back and forth once every few seconds.
    • Diagnosis: ATC_ANG_YAW_P is too high (Angle loop resonance).
    • Fix: Reduce ATC_ANG_YAW_P by 0.5.

ATC_BAL_LIM_TC

s
Default 0.5
Range 0.0 5.0

Pitch control limit time constant (ATC_BAL_LIM_TC)

Description

ATC_BAL_LIM_TC is a safety parameter for Balance Bots (Segway-style rovers).

A balancing robot stays upright by moving its wheels to stay under its center of mass. If the motors reach 100% power (saturation), the robot can no longer accelerate fast enough to catch itself if it tilts further. This parameter defines how quickly the autopilot should "pull back" the maximum allowed tilt angle when it detects that the motors are working too hard.

  • Low Value (e.g. 0.1): The drone aggressively limits its lean angle the moment it feels underpowered. High safety, but might feel "weak."
  • High Value (e.g. 2.0): The drone allows for longer "pushes" near the limit, relying on momentum.

The Mathematics

The pitch limit ($\theta\_{lim}$) is dynamically adjusted based on throttle output:

$$ \dot{\theta}{lim} = \frac{1}{\text{ATC\_BAL\_LIM\_TC}} \cdot (\theta{max} - \theta\_{lim}) $$

When throttle exceeds ATC_BAL_LIM_THR, the limit is reduced. When throttle is low, the limit is "relaxed" back to its user-defined maximum.

Tuning & Behavior

  • Default Value: 0.5 seconds.
  • Recommendation: If your balance bot frequently "falls over" forward during hard acceleration, decrease this value to 0.2 to force it to stay more upright.

ATC_BAL_LIM_THR

Default 0.6
Range 0.0 1.0

Pitch control limit throttle threshold (ATC_BAL_LIM_THR)

Description

ATC_BAL_LIM_THR sets the "Power Safety Line" for balancing robots.

If the motors are using more than 60% (0.6) of their power just to maintain speed, they have very little "headroom" left to fix a balance error. This parameter tells the autopilot at what point it should start worrying and limit how far the robot is allowed to tilt.

Tuning & Behavior

  • Default Value: 0.6 (60% throttle).
  • Recommendation: If you have high-torque motors, you can increase this to 0.8. If your motors are weak, decrease to 0.4.

ATC_BAL_PIT_FF

Default 0
Range 0 1

Balance Bot Pitch Feed-Forward (ATC_BAL_PIT_FF)

Description

ATC_BAL_PIT_FF helps a Balance Bot (Segway-style) stay upright.

It adds throttle based on the current pitch angle. If the bot leans forward, it needs to accelerate forward to catch itself. This term provides the immediate response.

Tuning & Behavior

  • Default Value: 0.
  • Recommendation: Fundamental tuning parameter for Balance Bots. Increase until the bot resists falling over.

ATC_BRAKE

Default 1
Range 0 1

Speed Control Brake Enable (ATC_BRAKE)

Description

ATC_BRAKE allows the autopilot to put the car in "Reverse" to slow down.

  • 0: Disabled. The rover will coast to a stop (drag only).
  • 1: Enabled. The rover actively reverses the motor to brake.

Tuning & Behavior

  • Default Value: 1.
  • Boats: Be careful. Reversing the prop quickly can cause cavitation or unscrew the prop nut.

ATC_DECEL_MAX

$m/s^2$
Default 0
Range 0 10

Speed Control Deceleration Max (ATC_DECEL_MAX)

Description

ATC_DECEL_MAX is the "ABS" setting.

It limits how hard the rover brakes.

  • 0 (Default): Use the same value as ATC_ACCEL_MAX.
  • Value: Override braking limit.

Tuning & Behavior

  • Default Value: 0.
  • Recommendation: Rovers usually brake faster than they accelerate. Set this higher than ATC_ACCEL_MAX (e.g. 2.0).

ATC_HOVR_ROL_TRM

cdeg
Default 0
Range 0 1000

Hover Roll Trim (ATC_HOVR_ROL_TRM)

Description

ATC_HOVR_ROL_TRM is a helicopter-specific parameter. Traditional helicopters produce a side-force from their tail rotor while hovering. To stay in one spot, the helicopter must lean slightly (Roll) in the opposite direction of the tail thrust.

This parameter allows you to pre-set that lean angle so the autopilot doesn't have to "discover" it via the I-term every time you take off.

  • Units: Centi-degrees (100 = 1 degree).
  • Effect: Reduces horizontal drift immediately after takeoff in manual modes and improves position-hold performance in autonomous modes.

The Mathematics

The roll trim $\phi\_{trim}$ is added directly to the Euler roll target $\phi\_{target}$:
$$ \phi\_{final} = \phi\_{target} + \phi\_{trim} $$

In inverted flight, the sign is automatically flipped by the inverted_factor:
$$ \text{inverted\_factor} = \text{clamp}(2.0 \cdot \cos(\text{roll}), -1.0, 1.0) $$
$$ \phi\_{applied} = \phi\_{trim} \cdot \text{inverted\_factor} $$

The Engineer's View

This parameter is the _hover_roll_trim member in AC_AttitudeControl_Heli.
It is retrieved via get_roll_trim_rad() and added to the attitude target in the input_euler_angle_roll_pitch_euler_rate_yaw and input_euler_angle_roll_pitch_yaw functions.

Tuning & Behavior

  • Default Value: 0 (or board specific)
  • Range: 0 to 1000 cdeg (0 to 10 degrees).
  • Typical Value: Most helicopters require 3 to 5 degrees (300 to 500 cdeg) of roll trim to hover stationary.
  • Tuning Procedure:
    1. Hover in Stabilize or Acro mode.
    2. Observe which way the heli drifts horizontally.
    3. Adjust ATC_HOVR_ROL_TRM until the heli stays stationary with the roll stick centered.
    4. Verify that in Loiter, the heli doesn't "lean" excessively or drift when first engaged.

ATC_INPUT_TC

s
Default 0.15
Range 0 1.0

Attitude Control Input Time Constant (ATC_INPUT_TC)

Description

ATC_INPUT_TC is the "smoothness filter" for the pilot's fingers. It determines how fast the flight controller attempts to reach the attitude requested by your sticks.

Even if you move your stick instantly from 0 to 100%, the drone won't instantly command 100%. ATC_INPUT_TC defines the time it takes for the software target to catch up to your actual stick position. It removes the "jerkiness" from manual flight, making the drone feel like it has weight and momentum.

  • Low Value (e.g., 0.05): The drone feels very "twitchy" and responsive. It reacts to every tiny movement of your hand.
  • High Value (e.g., 0.5): The drone feels very "soft" or "delayed." It will take a long time to start and stop its movements.
  • Default (0.15): A "Medium" setting that feels natural for most multirotor pilots.

The Mathematics

This parameter acts as the time constant ($\tau$) for a first-order low-pass filter on the requested target:

$$ \theta\_{target}(t) = \theta\_{target}(t-dt) + \frac{dt}{\tau + dt} \cdot (\theta\_{pilot} - \theta\_{target}(t-dt)) $$

Where:

  • $\theta\_{pilot}$ is the raw angle requested by your stick position.
  • $\theta\_{target}$ is the smoothed value sent to the flight control loops.
  • $\tau$ is ATC_INPUT_TC.

Physical Meaning: A time constant of 0.15s means that if you hold the stick at a fixed position, the drone will reach 63% of that target angle in 150 milliseconds.

The Engineer's View

This parameter is the _input_tc member in AC_AttitudeControl.

It is used in the Input Shaper for all manual modes (Loiter, AltHold, Stabilize):

// AC_AttitudeControl.cpp
_euler_rate_target.x = input_shaping_angle(wrap_PI(euler_roll_angle - _euler_angle_target.x), _input_tc, euler_accel.x, _euler_rate_target.x, _dt);

By filtering the input rather than the output, ArduPilot ensures that the PID loops are always following a perfectly smooth, continuous path, which significantly reduces motor noise and frame stress compared to raw stick commands.

Tuning & Behavior

  • Default Value: 0.15s
  • Range: 0.0 - 1.0s
  • Effect of Increasing: Smoother, more professional cinematic look. Reduces battery sag during aggressive stick movements.
  • Effect of Decreasing: Tighter stick feel. Essential for racing or flying in tight spaces where you need immediate reaction.

Use Case Recommendations

  • Racing / FPV Freestyle: Decrease to 0.05 - 0.10. You want the drone to follow your brain with zero delay.
  • Cinematography: Increase to 0.20 - 0.50. This makes the drone feel "heavy," like a full-sized helicopter. It prevents small finger shakes from showing up on the camera.
  • Beginner Pilots: Set to 0.20. Makes the drone easier to control by slowing down its reactions to "panic" stick movements.

Troubleshooting

  • Scenario: The drone feels "delayed" or "disconnected." I move the stick, but I have to wait for the drone to react.
    • Diagnosis: ATC_INPUT_TC is set too high.
    • Fix: Reduce ATC_INPUT_TC to 0.10.

ATC_LAND_P_MULT

Default 1.0
Range 0.25 1.0

Landed Pitch Gain Multiplier (ATC_LAND_P_MULT)

Description

ATC_LAND_P_MULT manages the stability of your drone's nose and tail during the critical landing phase.

When your drone's landing gear hits the ground, the air resistance is replaced by solid mechanical contact. If your pitch gains are high, the drone might feel the impact of the ground and try to "stabilize" against it by pitching up or down. Because the ground is rigid, this creates a high-speed vibration loop that can cause the drone to "dance" or flip forward/backward on its gear.

This parameter allows you to automatically scale down the pitch authority the moment the landing detector is triggered.

  • Set to 1.0 (Default): No reduction. The drone maintains its full flight authority on the ground.
  • Set to 0.5: The drone's pitch gains are halved on touchdown. This makes the drone feel "heavy" and settled, preventing it from bobbing its head or flipping over.

The Mathematics

The effective pitch gains are scaled by this multiplier ($M$) during the landing transition:

$$ \text{Gain}{effective} = \text{Gain}{flight} \cdot M $$

Where $M$ is ATC_LAND_P_MULT.

Dynamic Transition: ArduPilot ramps the gain down over a short period of time (defined by the attitude shaper) to avoid a sudden "step" in motor power that could itself trigger a bounce.

The Engineer's View

This parameter is the _land_pitch_mult member in AC_AttitudeControl.

It is applied in AC_AttitudeControl::landed_gain_reduction():

// AC_AttitudeControl.cpp
Vector3f scale_mult = VECTORF_111 * (1.0 - _landed_gain_ratio) + Vector3f(_land_roll_mult, _land_pitch_mult, _land_yaw_mult) * _landed_gain_ratio;
set_PD_scale_mult(scale_mult);
set_angle_P_scale_mult(scale_mult);

This ensures that any nose-heavy or tail-heavy imbalances (which the I-term usually fights) don't result in a violent motor surge when the drone is physically constrained by the landing pad.

Tuning & Behavior

  • Default Value: 1.0 (No reduction)
  • Range: 0.25 - 1.0
  • Effect of Decreasing: Drone becomes much more stable on the ground. Prevents "nose-dives" during auto-landing.
  • Effect of Increasing: Maintains full authority. Useful for landing on inclines (like a boat deck) where you must fight the tilt until the moment of disarm.

Use Case Recommendations

  • Cinematography (Gimbal Safety): Decrease to 0.5. Ensures the drone stays perfectly flat and calm on the ground, protecting the gimbal from accidental "nose-bobs."
  • Speed / Freestyle Quads: Keep at Default. These frames are so light that they rarely suffer from ground resonance.
  • Large Hybrid/Fixed-Wing VTOL: Decrease to 0.4. High-inertia vehicles with large wings can catch the wind on the ground; reducing the gain prevents the motors from fighting that wind in a way that would over-stress the airframe.

Troubleshooting

  • Scenario: On auto-landing, the drone touches down and then immediately "pitches forward" and strikes its front propellers on the ground.
    • Diagnosis: Longitudinal Ground Resonance or I-term windup.
    • Fix: Reduce ATC_LAND_P_MULT to 0.5.
    • Also check: ATC_THR_MIX_MIN.

ATC_LAND_R_MULT

Default 1.0
Range 0.25 1.0

Landed Roll Gain Multiplier (ATC_LAND_R_MULT)

Description

ATC_LAND_R_MULT is a "de-tuning" parameter for the landing phase.

Your drone's PID gains are tuned for flight (where the drone is surrounded by air). When the drone touches the ground, the physics change instantly. The rigid ground acts like a massive spring. If your roll gains are high, the drone might feel a tiny vibration from the ground and try to "stabilize" against it. This creates a feedback loop known as Ground Resonance, where the drone starts shaking violently or "hopping" from side to side on its landing gear.

This parameter allows you to automatically lower your roll authority the moment the landing gear touches the earth.

  • Set to 1.0 (Default): No reduction. The drone stays at full authority. Use this if your drone is very heavy and rigid.
  • Set to 0.5: The drone's roll gains are cut in half on the ground. Makes for much "quieter," safer landings.

The Mathematics

The effective roll gains ($P$, $I$, $D$) are scaled by this multiplier ($M$) when the landing detector is active:

$$ \text{Gain}{effective} = \text{Gain}{flight} \cdot M $$

Where $M$ is ATC_LAND_R_MULT.

Interpolation: ArduPilot doesn't just "snap" the gain down. It uses a transition logic (tied to ATC_INPUT_TC) to smoothly ramp the gains down as the drone settles onto its gear.

The Engineer's View

This parameter is the _land_roll_mult member in AC_AttitudeControl.

It is applied in AC_AttitudeControl::landed_gain_reduction():

// AC_AttitudeControl.cpp
Vector3f scale_mult = VECTORF_111 * (1.0 - _landed_gain_ratio) + Vector3f(_land_roll_mult, _land_pitch_mult, _land_yaw_mult) * _landed_gain_ratio;
set_PD_scale_mult(scale_mult);
set_angle_P_scale_mult(scale_mult);

This logic ensures that both the Outer Angle Loop and the Inner Rate Loop are softened, preventing any software-driven oscillations from reaching the motors while the drone is physically constrained by the ground.

Tuning & Behavior

  • Default Value: 1.0 (Standard)
  • Range: 0.25 - 1.0
  • Effect of Decreasing: Drone becomes much "lazier" and more stable on the ground. Prevents tip-overs during auto-landings.
  • Effect of Increasing: Maximum authority on touchdown. Useful for "hard" landings on uneven or rocky terrain where you must fight to stay upright.

Use Case Recommendations

  • Lightweight Racers / Carbon Frames: Decrease to 0.5 - 0.7. These frames are very stiff and prone to ground resonance. Lowering the gain makes the drone "stick" to the ground.
  • Drones with Long, Springy Legs: Decrease to 0.4. Springy legs amplify vibrations; reducing the gain is essential to keep the drone from "pogo-sticking."
  • Heavy Industrial Drones: Keep at 1.0. High inertia usually dampens ground vibrations naturally.

Troubleshooting

  • Scenario: On every landing, the drone touches down and then starts a rapid "shiver" or vibration that won't stop until it disarms.
    • Diagnosis: Ground Resonance. The PID loops are too fast for the physical contact with the earth.
    • Fix: Reduce ATC_LAND_R_MULT and ATC_LAND_P_MULT to 0.6.

ATC_LAND_Y_MULT

Default 1.0
Range 0.25 1.0

Landed Yaw Gain Multiplier (ATC_LAND_Y_MULT)

Description

ATC_LAND_Y_MULT handles the drone's heading stability during the landing phase.

When a multirotor touches the ground, it often experiences "Yaw Torque" from friction between the legs and the earth. If your yaw gains are high, the drone will try to fight this friction to keep its nose straight. This can lead to a violent "spinning" or "twisting" vibration as the drone tries to yaw against the immovable ground.

This parameter allows the flight controller to automatically lower its yaw authority the moment the landing gear makes contact.

  • Set to 1.0 (Default): No reduction. The drone fights to maintain its heading even on the ground.
  • Set to 0.5: The drone's yaw authority is cut in half on the ground. This allows the drone to "relax" its heading slightly to match the ground friction, preventing mechanical stress on the frame and landing gear.

The Mathematics

The effective yaw gains are scaled by this multiplier ($M$) during the landing sequence:

$$ \text{Gain}{effective} = \text{Gain}{flight} \cdot M $$

Where $M$ is ATC_LAND_Y_MULT.

Safety Note: Unlike Roll and Pitch, where a loss of control means a flip, a loss of Yaw control on the ground usually just means the nose rotates by a few degrees. Therefore, ATC_LAND_Y_MULT can often be set lower than the other multipliers without significant risk.

The Engineer's View

This parameter is the _land_yaw_mult member in AC_AttitudeControl.

It is applied in AC_AttitudeControl::landed_gain_reduction():

// AC_AttitudeControl.cpp
Vector3f scale_mult = VECTORF_111 * (1.0 - _landed_gain_ratio) + Vector3f(_land_roll_mult, _land_pitch_mult, _land_yaw_mult) * _landed_gain_ratio;
set_PD_scale_mult(scale_mult);
set_angle_P_scale_mult(scale_mult);

This logic ensures that any motor torque imbalances don't cause the drone to "pivot" or "spin out" violently when one leg has more friction with the ground than the others.

Tuning & Behavior

  • Default Value: 1.0 (Standard)
  • Range: 0.25 - 1.0
  • Effect of Decreasing: Drone becomes much "lazier" in its heading on the ground. Prevents tail-induced vibrations during touchdown.
  • Effect of Increasing: Maintains full heading hold. Useful for landing on moving or slippery surfaces where the drone must maintain its heading relative to the vehicle below it.

Use Case Recommendations

  • Standard Multirotor: Set to 0.5 - 0.7. This is generally safer and reduces the "growling" sound often heard when multirotors land on concrete.
  • Landing on Moving Boats: Keep at 1.0. You want the drone to fight the friction and stay aligned with the boat's direction until it is fully disarmed.
  • Tricopters (Servo Yaw): Set to 0.4. Servos can easily strip their gears if they try to yaw against ground friction; reducing the gain is critical for mechanical protection.

Troubleshooting

  • Scenario: On landing, the drone "twists" its legs or frame violently just before the motors stop.
    • Diagnosis: Yaw ground resonance or motor torque spikes.
    • Fix: Reduce ATC_LAND_Y_MULT to 0.5.

ATC_PIRO_COMP

Default 0
Range 0 1

Pirouette Compensation Enable (ATC_PIRO_COMP)

Description

ATC_PIRO_COMP is a specialized feature for Traditional Helicopters. In physics, a helicopter spinning rapidly around its vertical axis (a pirouette) experiences intense cross-coupling between its roll and pitch axes.

Without compensation, if a helicopter is tilted forward and starts to spin, the tilt will appear to "wobble" or "cone" as the helicopter rotates, potentially leading to a crash. ATC_PIRO_COMP enables advanced math that keeps the tilt direction fixed relative to the earth, even while the airframe is spinning at extreme rates.

  • Enabled (1): The helicopter stays perfectly tilted in the desired direction regardless of its rotation speed. Essential for advanced 3D aerobatics.
  • Disabled (0): Standard flight mode. The pilot must manually correct for coning during spins.

Note: For Multirotors (Quads, Octos), this compensation is handled inherently by the Body-Frame controller architecture and this specific parameter is usually not present or needed.

The Mathematics

The compensation logic involves rotating the roll and pitch targets into the moving frame of the helicopter:

$$ \begin{bmatrix} \text{Roll}{comp} \ \text{Pitch}{comp} \end{bmatrix} = \mathbf{R}z(\psi) \cdot \begin{bmatrix} \text{Roll}{target} \ \text{Pitch}\_{target} \end{bmatrix} $$

Where $\mathbf{R}\_z(\psi)$ is the rotation matrix around the yaw axis ($\psi$). This ensures that the cyclic commands (the "tilt" instructions) stay aligned with the earth's horizon rather than spinning with the heli's nose.

The Engineer's View

This parameter is the _piro_comp_enabled member in AC_AttitudeControl_Heli.

It affects how the attitude error is calculated in AC_AttitudeControl_Heli::update_ang_vel_target_from_att_error():

// AC_AttitudeControl_Heli.cpp
if (_piro_comp_enabled) {
    // Perform frame rotation for cyclic commands
    // ...
}

This is particularly important for helicopters equipped with a Mechanical Flybar, as the physical flybar has its own gyroscopic inertia that must be accounted for by the software.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 0 (Off) or 1 (On)
  • Effect of Enabling: Much more stable heading-independent flight. The heli feels more like a multirotor during fast spins.
  • Effect of Disabling: "Classical" helicopter flight feel.

Use Case Recommendations

  • 3D Aerobatics (Smack flight): Always Enable (1). Instant heading-locked attitude is required for maneuvers like "Piro-flips."
  • Scale / Precision Helicopter: Enable (1). Makes the helicopter much more predictable in wind during turns.
  • Legacy Flybar Helicopters: Keep at 0. These rely on the physical stability of the mechanical flybar; software piro-comp can sometimes fight the mechanical stabilization.

Troubleshooting

  • Scenario: During a fast yaw spin, the helicopter starts to wobble in a circular motion (coning), eventually tilting further and further.
    • Diagnosis: Pirouette coupling. The controller isn't keeping up with the rotation.
    • Fix: Set ATC_PIRO_COMP to 1.

ATC_RATE_FF_ENAB

Default 1
Range 0 1

Rate Feedforward Enable (ATC_RATE_FF_ENAB)

Description

ATC_RATE_FF_ENAB is one of the most important architectural switches in ArduPilot. It determines how the drone's "brain" talks to its "muscles."

  • Enabled (1): The drone uses Body-Frame Feedforward. This means that when you move the stick, the command is instantly translated into a target rotation rate that the drone starts to follow immediately. This is the modern standard for all multirotors.
  • Disabled (0): The drone uses Euler-Angle Lead. This is a legacy method used in older flight controllers where the drone waits to see an error in its angle before it starts moving the motors.

WARNING: For almost all modern drones, this parameter MUST remain Enabled (1). Disabling it will make the drone feel incredibly sluggish, like it's flying in a thick liquid, and it will be unable to handle rapid maneuvers or high winds.

The Mathematics

When enabled, the controller bypasses the slow error-accumulation of the outer loop for stick inputs. The target rate ($\omega\_{target}$) is derived directly from the pilot's stick position and the shaper:

$$ \omega\_{target} = \text{Shaper}(\text{Stick\_Pos}, \dots) $$

When disabled, the target rate is purely a function of angle error:

$$ \omega\_{target} = k\_P \cdot (\text{Angle}{target} - \text{Angle}{actual}) $$

The Engineer's View

This parameter is the _rate_bf_ff_enabled member in AC_AttitudeControl.

It is a core conditional in every input function (e.g., input_euler_angle_roll_pitch_yaw):

// AC_AttitudeControl.cpp
if (_rate_bf_ff_enabled) {
    // Modern: Use input shaper and feedforward
    _euler_rate_target.x = input_shaping_angle(...);
    // ...
} else {
    // Legacy: Euler target is simple angle
    _euler_angle_target.x = euler_roll_angle;
    _euler_rate_target.zero();
}

By enabling feedforward, ArduPilot allows the Rate PID loops to operate with zero-lag on pilot commands, while still using the Angle Loop to correct for any deviations from that command. This "Parallel Path" architecture is what gives ArduPilot its legendary stability.

Tuning & Behavior

  • Default Value: 1 (Enabled)
  • Range: 0 (Legacy) or 1 (Modern)
  • Effect of Enabling: Tighter, more direct stick feel. Much better wind rejection. Required for AutoTune to work correctly.
  • Effect of Disabling: "Loose," "Elastic" feel. Drone may overshoot targets significantly.

Use Case Recommendations

  • Standard Drone: Keep Enabled (1).
  • Legacy Porting: If you are porting very old code that doesn't support body-frame FF, you might set this to 0, but this is highly discouraged for modern flight.
  • Debugging: Only disable (0) if you are trying to isolate a problem with the outer angle loop and want to remove all lead-authority for testing.

Troubleshooting

  • Scenario: I moved my sticks, but it takes nearly a full second for the drone to start leaning.
    • Diagnosis: ATC_RATE_FF_ENAB has accidentally been set to 0.
    • Fix: Set to 1.

ATC_RATE_P_MAX

deg/s
Default 0.0
Range 0 1080

Pitch Rate Max (ATC_RATE_P_MAX)

Description

ATC_RATE_P_MAX defines the "pitch speed limit" for your drone. It determines the maximum degrees per second the drone is allowed to tilt forward or backward.

This parameter is essential for keeping the drone within its physical flight envelope. If you pitch too fast, you risk motor saturation (where motors on one side hit 100% and cannot lift the drone anymore) or sensor loss. ATC_RATE_P_MAX acts as a safety governor, ensuring that even if you slam the stick forward, the drone will only accelerate its rotation up to this specific speed.

  • Low Value (e.g. 60 $deg/s$): The drone pitches very slowly. Ideal for heavy-lift commercial drones and passenger vehicles.
  • High Value (e.g. 360 $deg/s$): The drone can perform one full forward flip every second. Essential for high-performance flight.
  • Disabled (0): The software does not limit pitch rotation speed.

The Mathematics

This parameter caps the target angular velocity ($\omega\_{pitch}$) calculated by the flight controller:

$$ \omega\_{pitch\_target} = \text{constrain}(\omega\_{pitch\_calculated}, -\text{RATE\_P\_MAX}, \text{RATE\_P\_MAX}) $$

Where:

  • $\text{RATE\_P\_MAX}$ is in degrees per second.
  • $\omega\_{pitch\_calculated}$ is the desired rotation rate from stick input or the angle loop.

Combined Limits: ArduPilot enforces this limit in a way that respects the drone's total thrust. If you are at the limit of both Roll and Pitch, the controller will prioritize whichever axis has the larger error while keeping the total vector within safe bounds.

The Engineer's View

This parameter is the _ang_vel_pitch_max member in AC_AttitudeControl.

It is applied in AC_AttitudeControl::ang_vel_limit():

// AC_AttitudeControl.cpp
if (!is_zero(ang_vel_pitch_max)) {
    euler_rad.y = thrust_vector_ang_vel.y * ang_vel_pitch_max / thrust_vector_length;
}

This limit is particularly important during High Speed Braking. When the drone stops moving forward, it must pitch up aggressively. If RATE_P_MAX is too low, the drone may take too long to pitch up and could potentially overshoot its stopping point or strike an obstacle.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 1080 $deg/s$
  • Effect of Increasing: Allows for sharper, more immediate forward/backward maneuvers. Necessary for high-speed automated missions.
  • Effect of Decreasing: Smoother pitch transitions. Reduces landing gear stress during hard stops.

Use Case Recommendations

  • Large Professional Octocopters: Set to 60 - 90 $deg/s$. These large vehicles have massive inertia; attempting to pitch them faster than 90 $deg/s$ is inefficient and can cause structural fatigue.
  • Standard GPS Multirotor: Set to 180 $deg/s$. Provides a good balance of agility and safety.
  • Freestyle / Racing Quads: Keep at 0.0. Performance is the priority; the pilot is responsible for managing the rotation speed.

Troubleshooting

  • Scenario: During an Auto mission, the drone seems to "glide" through waypoints instead of turning sharply.
    • Diagnosis: ATC_RATE_P_MAX (and potentially ATC_RATE_R_MAX) is set too low, limiting the drone's ability to change its attitude quickly.
    • Fix: Increase ATC_RATE_P_MAX to 180.

ATC_RATE_R_MAX

deg/s
Default 0.0
Range 0 1080

Roll Rate Max (ATC_RATE_R_MAX)

Description

ATC_RATE_R_MAX is the "top speed" for your drone's rotation. It defines the maximum number of degrees per second the drone is allowed to roll.

If you are flying in a GPS mode (like Loiter) or a stabilized mode, the flight controller will never request a rotation faster than this limit, even if you push your stick to the limit. It ensures the drone remains controllable and doesn't rotate so fast that the EKF (position estimator) loses its orientation.

  • Low Value (e.g. 90 $deg/s$): The drone rotates very slowly and safely. Ideal for beginners and heavy cargo drones.
  • High Value (e.g. 360 $deg/s$): The drone rolls very quickly (one full circle per second). Essential for FPV and aggressive maneuvers.
  • Disabled (0): The software does not limit rotation speed. The drone will roll as fast as its motors can physically push it.

The Mathematics

This parameter acts as a hard "cap" on the requested angular velocity ($\omega$):

$$ \omega\_{roll\_target} = \text{constrain}(\omega\_{roll\_calculated}, -\text{RATE\_R\_MAX}, \text{RATE\_R\_MAX}) $$

Where:

  • $\text{RATE\_R\_MAX}$ is in degrees/second.
  • $\omega\_{roll\_calculated}$ is the output of the pilot's stick scaling or the outer angle loop.

Note: This limit is applied before the rate PID loop, ensuring the PID controller doesn't "wind up" trying to reach an impossible rotation speed.

The Engineer's View

This parameter is the _ang_vel_roll_max member in AC_AttitudeControl.

It is enforced in AC_AttitudeControl::ang_vel_limit():

// AC_AttitudeControl.cpp
if (!is_zero(ang_vel_roll_max)) {
    euler_rad.x = thrust_vector_ang_vel.x * ang_vel_roll_max / thrust_vector_length;
}

ArduPilot uses a Spherical Limit for Roll and Pitch combined. If both axes are at their limits, the controller doesn't just clip them; it scales them both down to ensure the "total" rotation speed remains within the drone's physical capabilities.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 1080 $deg/s$
  • Effect of Increasing: Allows for faster flips and sharper turns.
  • Effect of Decreasing: Limits how fast the drone can change its tilt. Makes the drone safer for novice pilots.

Use Case Recommendations

  • Cinematography / Inspection: Set to 60 - 90 $deg/s$. Limits any accidental "jerks" of the stick, ensuring the horizon always moves in a smooth, cinematic way.
  • Autonomous Search & Rescue: Set to 180 $deg/s$. Provides a good balance between scanning speed and stabilization accuracy.
  • Standard Multirotor: Keep at 0.0 or 360. Standard 360 $deg/s$ is common for most hobbyist flight.

Troubleshooting

  • Scenario: I am trying to do a flip, but the drone rolls extremely slowly, like it's fighting me.
    • Diagnosis: ATC_RATE_R_MAX is set too low.
    • Fix: Increase ATC_RATE_R_MAX to 360 or 0.
  • Scenario: During high-speed turns, the EKF loses its position and the drone enters "Land" mode.
    • Diagnosis: The drone is rotating faster than the sensors can accurately track.
    • Fix: Reduce ATC_RATE_R_MAX to 180.
    • Also check: ATC_RATE_P_MAX.

ATC_RATE_Y_MAX

deg/s
Default 0.0
Range 0 1080

Yaw Rate Max (ATC_RATE_Y_MAX)

Description

ATC_RATE_Y_MAX is the "rotation speed limiter" for your drone's heading. It determines the maximum speed (in degrees per second) that the drone is allowed to spin around its center.

Yaw is generally the weakest axis for a multirotor because it relies on torque reaction. If a drone spins too fast, it creates a massive amount of centrifugal force on the motor arms and can easily cause "vertical wash," where the drone drops out of the sky because the motors are busy spinning the drone instead of lifting it. ATC_RATE_Y_MAX ensures the drone stays in a safe speed range, even if the pilot pushes the yaw stick all the way to the side.

  • Low Value (e.g. 45 $deg/s$): Very slow, stately rotation. Perfect for smooth cinematic pans.
  • High Value (e.g. 180 $deg/s$): Fast rotation (one full circle every 2 seconds). Good for general flight and rapid target re-acquisition.
  • Disabled (0): The drone will spin as fast as its motor torque allows.

The Mathematics

This parameter acts as a hard ceiling on the requested heading rotation rate ($\omega\_{yaw}$):

$$ \omega\_{yaw\_target} = \text{constrain}(\omega\_{yaw\_calculated}, -\text{RATE\_Y\_MAX}, \text{RATE\_Y\_MAX}) $$

Where:

  • RATE_Y_MAX is in degrees per second.
  • $\omega\_{yaw\_calculated}$ is derived from the yaw stick or the heading controller.

Torque Prioritization: If the drone is at its RATE_Y_MAX limit, ArduPilot will often reduce the yaw torque slightly if more Roll or Pitch authority is needed to keep the drone level.

The Engineer's View

This parameter is the _ang_vel_yaw_max member in AC_AttitudeControl.

It is enforced in AC_AttitudeControl::ang_vel_limit():

// AC_AttitudeControl.cpp
if (!is_zero(ang_vel_yaw_max)) {
    euler_rad.z = constrain_float(euler_rad.z, -ang_vel_yaw_max, ang_vel_yaw_max);
}

Unlike Roll and Pitch, which are often scaled together, Yaw is limited independently. This prevents high yaw rates from "stealing" the power needed for roll and pitch stability.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0 - 1080 $deg/s$
  • Effect of Increasing: Allows for faster head-turns and "Yaw Spins." Necessary for tracking fast-moving objects.
  • Effect of Decreasing: Smoother pans and less vertical altitude loss during aggressive spinning.

Use Case Recommendations

  • Professional Cinematography: Set to 30 - 45 $deg/s$. This prevents accidental "jerky" heading moves from ruining a shot, ensuring every rotation is a smooth, high-quality pan.
  • Standard GPS Flying: Set to 90 - 120 $deg/s$. Provides a responsive tail without risking motor saturation.
  • FPV Freestyle: Keep at 0.0 or set >360. Pilots want the nose to follow their fingers with no artificial speed limits.

Troubleshooting

  • Scenario: Every time I spin the drone 360 degrees, it drops significantly in altitude.
    • Diagnosis: Yaw torque is starving the lift motors. The spin is too fast for the available motor power.
    • Fix: Reduce ATC_RATE_Y_MAX to 60 $deg/s$.
  • Scenario: My drone takes a very long time to turn its nose to the next waypoint in an Auto mission.
    • Diagnosis: ATC_RATE_Y_MAX is set too low.
    • Fix: Increase ATC_RATE_Y_MAX to 120.

ATC_RAT_PIT_D

Default 0.0036
Range 0.0 0.05

Pitch Axis Rate D Gain (ATC_RAT_PIT_D)

Description

ATC_RAT_PIT_D is the vertical "damper" for your drone's nose. In physics, the Derivative (D) term acts like a brake that only activates when the drone is moving too fast toward its target.

If you command the drone to level out after a fast forward dash, it has a lot of pitch momentum. Without D-gain, the nose would swing back up, shoot past the level point, and then "bob" (oscillate) several times before settling. The D-gain "senses" this rapid swing and adds pre-emptive resistance, ensuring the drone stops perfectly level on the first try.

  • Low Value: The drone will "bob its head" like a toy when you stop pitching. It feels loose and bouncy in the air.
  • High Value: The drone feels extremely stable and "robotic." Flips stop exactly where you want them.
  • Too High: The drone will emit a high-pitched "growl" or motor shriek. This is dangerous as it can overheat the motors and ESCs within seconds.

The Mathematics

The D-term is proportional to how fast the pitch error is changing:

$$ \text{Out}D = k\_D \cdot \frac{d(\omega{target} - \omega\_{actual})}{dt} $$

Where:

  • $k\_D$ is ATC_RAT_PIT_D.
  • The signal is passed through the ATC_RAT_PIT_FLTD filter to remove noise.

Intuition: The D-term opposes the speed of the rotation. If you are rotating too fast toward the target, the D-term pushes against the movement to slow it down before you overshoot.

The Engineer's View

This parameter is the _kd member of the _pid_rate_pitch object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    _derivative = filtered_derivative;
}
return ... + _derivative * _kd;

In multirotors, the Pitch axis often needs slightly different D-gain than the Roll axis because the weight of the drone (battery and camera) is usually distributed along the longitudinal axis, creating a different moment of inertia.

Tuning & Behavior

  • Default Value: 0.0036 (Highly sensitive)
  • Range: 0.0 - 0.05
  • Effect of Increasing: Crisper stops after forward flight. Less vertical altitude loss during hard braking.
  • Effect of Decreasing: Smoother, "softer" flight feel. Safer for older motors or low-quality propellers.

Use Case Recommendations

  • Large Professional Multirotors: Keep very low or set to 0.0. Large props cannot physically react fast enough for D-gain to be effective; it usually just causes wasted heat.
  • FPV Racing / Cinema Whoops: Increase to 0.006 - 0.008. High performance depends on the drone stopping its pitch exactly on command to maintain the correct forward speed.
  • Long-Range Mapping: Keep at Default. Provides a stable platform without motor stress.

Troubleshooting

  • Scenario: Drone nose "bobs" up and down 2-3 times every time you release the pitch stick.
    • Diagnosis: ATC_RAT_PIT_D is too low (Underdamped).
    • Fix: Increase ATC_RAT_PIT_D by 0.0005.
  • Scenario: Motors sound like they are "grinding" only when you are hovering in wind.
    • Diagnosis: ATC_RAT_PIT_D is too high, amplifying turbulence noise.
    • Fix: Reduce ATC_RAT_PIT_D immediately.

ATC_RAT_PIT_D_FF

Default 0.0
Range 0 0.02

Pitch Axis Rate Derivative Feed-Forward (ATC_RAT_PIT_D_FF)

Description

ATC_RAT_PIT_D_FF is an advanced predictive control term for your drone's forward and backward rotation. While standard Feed-Forward (ATC_RAT_PIT_FF) looks at your desired pitch speed, the Derivative Feed-Forward (D_FF) looks at how fast you are moving the stick.

If you suddenly slam the pitch stick forward to dodge an obstacle, the D_FF term instantly commands a surge of power to the rear motors to tilt the nose down. It provides the "kick" needed to overcome the longitudinal inertia of the drone's frame and battery. This results in a drone that follows your commands with zero perceived lag.

  • Low Value (0.0): Standard behavior. The drone relies on error-correction and base feed-forward.
  • High Value: Creates a sharp "snap" at the beginning of pitch moves.
  • Too High: Can cause "kickback" or jerky, non-linear movements in the pitch axis.

The Mathematics

The D_FF term is proportional to the rate of change of the pitch setpoint ($\omega\_{pit\_target}$):

$$ \text{Out}{D\_FF} = \frac{d(\omega{pit\_target})}{dt} \cdot k\_{D\_FF} $$

Where:

  • $k\_{D\_FF}$ is ATC_RAT_PIT_D_FF.
  • $\frac{d(\omega\_{pit\_target})}{dt}$ is the rate of change of the requested pitch speed.

Vibration Immunity: Because this term is derived from the Setpoint (pilot stick) rather than the Gyro (sensor), it does not amplify motor vibration. You can use D_FF to get a "stiff" response without the risk of motor heating associated with standard D-gains.

The Engineer's View

This parameter maps to _kdff in the _pid_rate_pitch object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float target_derivative = (target - _last_target) / dt;
    _pid_info.D_FF = target_derivative * _kdff;
}

In ArduPilot, D_FF is especially useful for "Dead Cat" or long-range frames where the Pitch axis has significantly more mass to move than the Roll axis. It helps "lead" the heavier longitudinal axis into maneuvers.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0.0 - 0.02
  • Effect of Increasing: Snappier longitudinal transitions. Reduced altitude loss during aggressive pitch maneuvers.
  • Effect of Decreasing: Smoother, more organic pitch behavior.

Use Case Recommendations

  • Speed Runs / Drag Racing: Increase to 0.01. Essential for performing the instant, aggressive tilts needed to maximize acceleration from a hover.
  • Cinematography: Keep at 0.0. High D_FF gains can make the horizon "snap" in a way that looks artificial on video.
  • Standard Multirotor: Keep at 0.0. Standard tuning is safer and easier to manage for most pilots.

Troubleshooting

  • Scenario: Drone nose "bobs" or twitches whenever I move the stick, even slightly.
    • Diagnosis: ATC_RAT_PIT_D_FF is likely too high, reacting to tiny finger twitches.
    • Fix: Reduce ATC_RAT_PIT_D_FF to 0.002 or set back to 0.

ATC_RAT_PIT_FF

Default 0.0
Range 0.0 0.5

Pitch Axis Rate Feed-Forward Gain (ATC_RAT_PIT_FF)

Description

ATC_RAT_PIT_FF is the "accelerator pedal" for your drone's pitch axis. While the P, I, and D terms wait for the drone to miss its target rotation speed before they correct it, the Feed-Forward (FF) term acts pre-emptively.

When you push the stick forward, the FF term instantly calculates how much power to send to the rear motors to tilt the drone forward at the same moment your finger moves. This eliminates the "mushy" or "laggy" feeling often associated with flight controllers and makes the drone feel like it is mechanically locked to your hands.

  • Low Value (0.0): The drone relies entirely on error-correction. There will be a slight delay as the drone "spools up" its rotation authority.
  • High Value: The drone feels extremely responsive. It starts and stops rotating the exact millisecond you move the sticks.
  • Too High: The drone will "over-snap" when you start a movement, potentially causing the nose to dip or rise too far before leveling out at the correct speed.

The Mathematics

The FF term is a simple multiplier of the target rotation rate:

$$ \text{Out}{FF} = \omega{target} \cdot k\_{FF} $$

Where:

  • $\omega\_{target}$ is the desired pitch rate (deg/s).
  • $k\_{FF}$ is ATC_RAT_PIT_FF.

The total output is the sum of PID and FF contributions.

The Engineer's View

This parameter is the _kff member of the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
_pid_info.FF = target * _kff;
// ...
return P + I + D + _pid_info.FF;

Feed-Forward is particularly important in autonomous flight (Auto missions) because it allows the drone to follow its planned path with much higher precision, as the controller doesn't need a large "error" to generate high motor power.

Tuning & Behavior

  • Default Value: 0.0 (Standard Multirotor)
  • Range: 0.0 - 0.5
  • Effect of Increasing: Snappier, more immediate pitch response. Better for high-speed tracking and sharp turns.
  • Effect of Decreasing: Smoother, softer pitch behavior.

Use Case Recommendations

  • Cinematography: Set to 0.05. Just enough to remove the initial "laziness" of the drone without making the footage look robotic or twitchy.
  • FPV Racing: Increase to 0.2 - 0.3. Essential for clearing gates and hitting gaps at high speed where any control lag is fatal.
  • Large Professional Drones: Keep at 0.0. Heavy vehicles should be moved with deliberate, error-checked power to avoid over-stressing the airframe.

Troubleshooting

  • Scenario: When you push the stick forward, the drone "jumps" forward too hard for a split second, then settles.
    • Diagnosis: ATC_RAT_PIT_FF is too high.
    • Fix: Reduce ATC_RAT_PIT_FF by 0.05.

ATC_RAT_PIT_FLTD

Hz
Default 0.0
Range 0 100

Pitch Axis Rate D-Term Filter (ATC_RAT_PIT_FLTD)

Description

ATC_RAT_PIT_FLTD is a specialized safety filter for your drone's pitch damping. In a PID loop, the Derivative (D) term is extremely sensitive to noise because it looks at the rate of change between gyro samples. High-frequency vibrations from the motors look like massive pitch rotation rates to the D-term.

Without this filter, the D-gain (ATC_RAT_PIT_D) would amplify that motor noise, causing the motors to "chirp," get hot, and potentially burn out. This filter specifically cleans up the signal before it gets multiplied by the D-gain, stripping out high-frequency "jitter" while leaving the actual movements of the drone intact.

  • Higher Frequency (e.g., 40Hz): Effective damping, prevents "nose-bobbing" at the end of maneuvers, but increases motor heat.
  • Lower Frequency (e.g., 10Hz): Safe for older or noisy frames, but the pitch damping will feel "laggy" and may not stop the drone from bouncing after a movement.
  • Disabled (0): Defaults to half of the main error filter or a safe internal value.

The Mathematics

The D-term calculates the derivative of the pitch error and then passes it through a low-pass filter:

$$ D\_{filtered} = D\_{prev} + \alpha \cdot \left( \frac{E - E\_{prev}}{dt} - D\_{prev} \right) $$

Where the filter coefficient $\alpha$ is derived from ATC_RAT_PIT_FLTD ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Engineer's Tip: In a stable tune, the D-filter frequency is almost always lower than the Error filter frequency (ATC_RAT_PIT_FLTE) because the derivative process is naturally "noisier."

The Engineer's View

This parameter maps to _filt_D_hz in the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    _derivative = _last_derivative + (dt / (_filt_D_hz + dt)) * (derivative - _last_derivative);
}
return ... + _derivative * _kd;

Modern ArduPilot versions run these calculations at the full loop rate, allowing for high-precision noise rejection that is specifically tuned for the resonant frequencies of the longitudinal frame.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Crisper pitch stops, less "bounce" when you let go of the stick.
  • Effect of Decreasing: Quieter motor operation, longer motor life, and less risk of "prop wash" jitters.

Use Case Recommendations

  • Clean Cinematic Drone: Set to 15.0 - 20.0 Hz. Provides excellent damping for the horizon without introducing high-frequency noise.
  • FPV Racing (Rigid Frame): Set to 30.0 - 40.0 Hz. Necessary for the "instant stop" handling required for racing.
  • Large Professional Rig (>18 inch props): Set to 5.0 - 10.0 Hz. Large props generate significant low-frequency noise; keeping the D-filter low prevents heating.

Troubleshooting

  • Scenario: Motors are getting warm and making a rhythmic "growling" sound specifically during vertical descent.
    • Diagnosis: D-term noise from the pitch axis.
    • Fix: Reduce ATC_RAT_PIT_FLTD by 5.0 Hz.

ATC_RAT_PIT_FLTE

Hz
Default 0.0
Range 0 100

Pitch Axis Rate Error Filter (ATC_RAT_PIT_FLTE)

Description

ATC_RAT_PIT_FLTE is the primary "noise cleaner" for your pitch controller.

The drone's gyroscope is extremely sensitive and picks up every mechanical vibration from the motors and frame. If the flight controller tried to react to every tiny vibration, the motors would work overtime, wasting battery and potentially burning out. This filter "washes out" that high-frequency noise, ensuring the PID loop only reacts to the drone's actual movements.

  • Higher Frequency (e.g., 40Hz): Faster control response. The drone feels more "locked-in," but motor noise and heat will increase.
  • Lower Frequency (e.g., 10Hz): Smoother flight and quieter motors, but the drone will feel slightly "loose" or "mushy" in its pitch.
  • Disabled (0): The software uses the main gyro sample rate. This is risky for all but the cleanest, most rigid racing frames.

The Mathematics

This is a single-pole low-pass filter applied to the pitch error signal ($E$):

$$ E\_{filtered} = E\_{prev} + \alpha \cdot (E\_{raw} - E\_{prev}) $$

Where $\alpha$ is derived from ATC_RAT_PIT_FLTE ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Trade-off: A lower $f\_c$ introduces "Phase Lag." If the lag becomes too great, the drone will develop a low-frequency vertical "nodding" or wobble because its pitch corrections are arriving too late.

The Engineer's View

This parameter maps to _filt_E_hz in the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_reset_filter) {
    _reset_filter = false;
    _error = target - measurement;
} else {
    _error += ((target - measurement) - _error) * get_filt_E_alpha(dt);
}

By filtering the error before the P, I, and D calculations, ArduPilot ensures that the entire rate loop is based on a smooth, consistent measurement of the vehicle's state.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Snappier pitch response. Tighter tracking during rapid forward flight.
  • Effect of Decreasing: Quieter motors, less "jello" in the camera gimbal. Essential for long-range frames with flexible motor arms.

Use Case Recommendations

  • Standard GPS Photography Drone: Set to 20.0 Hz. Provides a very smooth and quiet vertical hover.
  • FPV Freestyle Quad: Set to 30.0 - 40.0 Hz. High performance requires a high filter cutoff for instant response.
  • Heavy Lift Multirotors: Set to 10.0 Hz. Large props generate significant low-frequency noise; a lower filter keeps the system stable.

Troubleshooting

  • Scenario: Drone's nose "vibrates" or makes a growling sound during fast forward flight.
    • Diagnosis: Frame resonance passing through the PID loop.
    • Fix: Reduce ATC_RAT_PIT_FLTE by 5.0 Hz.

ATC_RAT_PIT_FLTT

Hz
Default 0.0
Range 0 100

Pitch Axis Rate Target Filter (ATC_RAT_PIT_FLTT)

Description

ATC_RAT_PIT_FLTT smooths the commands sent to the drone's pitch rate controller. While other filters (like FLTE) clean up noise from the Sensors, this filter cleans up "jumps" from the Software.

When a pilot moves the pitch stick or an autopilot changes the flight path, the target rotation rate might change in a sudden "step." These sharp edges can cause the drone to "kick" its nose up or down violently. This filter rounds off those corners, ensuring the drone accelerates into its pitch rotation gracefully rather than with a mechanical shock.

  • Low Frequency (e.g., 10Hz): Very smooth, "organic" flight feel. Pitch commands are softened.
  • High Frequency (e.g., 40Hz): Instant response. The drone follows every tiny pitch command perfectly.
  • Disabled (0): The target rate is unfiltered. Maximum responsiveness, but potential for mechanical "ringing."

The Mathematics

This is a single-pole low-pass filter applied to the target rate ($\omega\_{target}$):

$$ \omega\_{target\_filtered} = \omega\_{target\_prev} + \alpha \cdot (\omega\_{target\_raw} - \omega\_{target\_prev}) $$

Where $\alpha$ is derived from ATC_RAT_PIT_FLTT ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Effect: This acts as a "softener" for the pitch stick. A 20Hz filter frequency corresponds to a time constant of about 8 milliseconds—enough to save your drone from resonant frame vibrations during hard stops.

The Engineer's View

This parameter maps to _filt_T_hz in the _pid_rate_pitch object.

It is applied at the very beginning of the PID loop in AC_PID::update_all():

// AC_PID.cpp
_target += (target - _target) * get_filt_T_alpha(dt);

By filtering the target at the source, ArduPilot ensures that the Feed-Forward (RAT_PIT_FF) and P-terms don't produce a massive, discontinuous spike when the command changes.

Tuning & Behavior

  • Default Value: 0.0 (Disabled / Loop rate)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Snappier, more "direct" stick feel in the pitch axis.
  • Effect of Decreasing: Smoother cinematic forward/backward transitions. Essential for vehicles with long arms that can flex under sudden torque.

Use Case Recommendations

  • Standard Build: Keep at 0.0. ArduPilot's internal path planning handles most command smoothing automatically.
  • High-End Cinematography: Set to 15.0 Hz. Adds a professional "weighted" feel to the pitch axis, making forward moves look more like a heavy camera crane.
  • Racing / FPV: Keep at 0.0. Minimum latency is priority for high-speed maneuvering.

Troubleshooting

  • Scenario: Drone makes a "clunk" sound specifically when you suddenly release the pitch stick after a forward dash.
    • Diagnosis: Discontinuous target rate is causing a motor current spike (mechanical ringing).
    • Fix: Set ATC_RAT_PIT_FLTT to 20.0 Hz.

ATC_RAT_PIT_I

Default 0.135
Range 0.01 2.0

Pitch Axis Rate I Gain (ATC_RAT_PIT_I)

Description

ATC_RAT_PIT_I is the "automatic trim" for your drone's pitch axis. Its job is to remember and correct for persistent imbalances in the drone's weight distribution or aerodynamic drag.

If your drone is nose-heavy (e.g., you mounted a large camera on the front), the drone will naturally want to tilt forward. Without an I-term, you would have to constantly pull back on the stick to keep it level. The I-term "notices" that the drone keeps falling forward and slowly increases the power to the front motors until the drone stays level on its own.

  • Low Value: The drone will drift forward or backward in wind. It won't hold its pitch angle accurately during long movements.
  • High Value: The drone holds its pitch angle very strictly.
  • Too High: The drone will develop a slow "pitch wobble" as the integrator over-corrects and "hunts" for the perfect trim point.

The Mathematics

The I-term accumulates the pitch rate error over time:

$$ \text{Out}I += \int\_0^t (\omega{target} - \omega\_{actual}) \cdot k\_I \cdot dt $$

Where:

  • $k\_I$ is ATC_RAT_PIT_I.
  • The result is constrained by ATC_RAT_PIT_IMAX.

Longitudinal Stability: Because most drones have their battery mounted on top/bottom and payloads on the front/back, the Pitch I-term usually has to work much harder than the Roll I-term.

The Engineer's View

This parameter is the _ki member of the _pid_rate_pitch object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
_integrator += (error * _ki * dt);
_integrator = constrain_float(_integrator, -_kimax, _kimax);

ArduPilot's Leakiness logic ensures that the integrator doesn't stay wound up forever. When the drone is on the ground, the integrator is slowly decayed to zero to prevent a "jumpy" take-off.

Tuning & Behavior

  • Default Value: 0.135 (Matches P-gain)
  • Range: 0.01 - 2.0
  • Effect of Increasing: Better tracking of forward velocity, less pitch drift in wind.
  • Effect of Decreasing: Drone feels more "fluid," but may lose its pitch target over long distances.

Use Case Recommendations

  • Nose-Mounted Gimbal (Cinematic): Increase to 0.2. Heavier cameras on the nose require more I-term authority to maintain a stable, level horizon.
  • Speed Runs: Increase to 0.25. High aerodynamic drag at 60mph+ creates a massive torque trying to flip the drone; a strong I-term is required to fight this.
  • Small Whoops / Micros: Keep Default. Lightweight frames are usually well-balanced.

Troubleshooting

  • Scenario: When you stop flying forward, the drone levels out, but then its nose slowly sinks by 2-3 degrees over the next few seconds.
    • Diagnosis: ATC_RAT_PIT_I is too low. It isn't building up enough authority to fight the weight of the drone.
    • Fix: Increase ATC_RAT_PIT_I by 0.02.

ATC_RAT_PIT_ILMI

Default 0.02
Range 0 1.0

Pitch Axis Rate I-Leak Minimum (ATC_RAT_PIT_ILMI)

Description

ATC_RAT_PIT_ILMI is a "memory management" feature for the pitch axis of Traditional Helicopters.

Helicopter pitch control is complex because the rotor disc acts like a giant gyroscope. When you command the heli to tilt forward, the I-term builds up authority to achieve that tilt. On the ground or during slow takeoff, the I-term can build up "false" corrections.

"Leakiness" allows this software memory to slowly fade away over time. ATC_RAT_PIT_ILMI determines the speed of this fade. It ensures the helicopter always has a "fresh" sense of level and doesn't get stuck leaning forward or backward because of a correction that happened several seconds ago.

  • Higher Value: The pitch memory clears faster. The heli feels more reactive and "natural."
  • Lower Value: The pitch memory persists longer. Better for maintaining exact pitch angles during long, fast forward flight.

Note: This is an AC_HELI_PID specific parameter and is not used on standard Quads or Octocopters.

The Mathematics

The pitch integrator ($\text{Int}$) is decayed every time step ($dt$):

$$ \text{Int}{new} = \text{Int}{prev} \cdot (1.0 - \text{LeakRate} \cdot dt) $$

Where the Leak Rate is set by ATC_RAT_PIT_ILMI.

Physical Meaning: This acts as a "forgetting factor." It prevents the integrator from "stalling" at a fixed value, which is critical for the rotating physics of a mechanical rotor head.

The Engineer's View

This parameter is the _leak_min member in the AC_HELI_PID class.

Longitudinal (pitch) leakiness is especially important for helicopters because they are often physically nose-heavy or tail-heavy. The leak ensures that the software-learned "trim" doesn't become dangerous if the airframe's balance shifts (e.g., during high-speed forward flight).

Tuning & Behavior

  • Default Value: 0.02 (2% decay per second)
  • Range: 0.0 - 1.0
  • Effect of Increasing: The helicopter becomes more forgiving during "punchy" pitch moves. Less risk of the nose "jumping" after you center the stick.
  • Effect of Decreasing: Tighter pitch authority. Better for heavy helis that need constant correction to stay level.

Use Case Recommendations

  • 3D Smack Flight: Increase to 0.05. Prevents "longitudinal memory" from ruining rapid vertical/pitch transitions.
  • Heavy Cargo Heli: Decrease to 0.01. Ensures the heli stays perfectly level even with an off-center payload.
  • Scale Heli: Keep at 0.02.

Troubleshooting

  • Scenario: After stopping forward flight, the helicopter's nose "bobs" up and then stays slightly elevated for several seconds.
    • Diagnosis: Stale I-term memory (Windup).
    • Fix: Increase ATC_RAT_PIT_ILMI to 0.04.

ATC_RAT_PIT_IMAX

Default 0.5
Range 0 1.0

Pitch Axis Rate I-Term Maximum (ATC_RAT_PIT_IMAX)

Description

ATC_RAT_PIT_IMAX is a vital safety fuse specifically for the drone's longitudinal balance. It limits the maximum power the Integral (I) term is allowed to use to correct for pitch errors.

Because most drones carry their payloads (cameras) and batteries along the pitch axis, they are frequently slightly nose-heavy or tail-heavy. The I-term learns to compensate for this. However, if the drone is physically stuck (e.g., in a tree) or if a front motor has failed, the I-term will "wind up" to 100% power trying to level the drone. If the drone suddenly breaks free, this massive, stored-up correction will cause it to flip over instantly. ATC_RAT_PIT_IMAX prevents this by capping that "learned authority."

  • Low Value: Limits the drone's ability to fly if it is nose-heavy or tail-heavy.
  • High Value: Allows for great balance correction, but increase the risk of a flip-on-recovery.
  • Default (0.5): Allows the integrator to use up to 50% of motor range to fix pitch errors.

The Mathematics

The pitch integrator ($ ext{Int}$) is accumulated but clamped by this value:

$$ ext{Int}{new} = ext{constrain}( ext{Int}{prev} + ext{error}
k\_I
dt, - ext{IMAX}, ext{IMAX}) $$

Where:

  • $ ext{IMAX}$ is ATC_RAT_PIT_IMAX.
  • The output is a $0.0$ to $1.0$ value used in the motor mixer.

The Engineer's View

This parameter is the _kimax member of the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
_integrator = constrain_float(_integrator + (error * _ki * dt), -_kimax, _kimax);

ArduPilot's Saturation logic also stops the integrator from increasing if the drone's throttle is already at zero or full, preventing it from fighting the pilot's primary vertical control.

Tuning & Behavior

  • Default Value: 0.5 (Standard)
  • Range: 0.0 - 1.0
  • Effect of Increasing: Better ability to stabilize nose-heavy drones (like those with large DSLR gimbals on the front).
  • Effect of Decreasing: Safer for racing and testing; drone is less likely to flip after a minor collision.

Use Case Recommendations

  • Delivery Drones (Variable Payloads): Increase to 0.7 - 0.8. If the weight moves or is dropped, the drone needs high authority to find its new level point quickly.
  • Cinematography (Gimbal Protrusion): Keep at 0.5 or 0.6. Ensures the drone stays perfectly level despite the long lever arm of a heavy camera.
  • Standard FPV / Racing: Decrease to 0.4. Minimizes the "bobbing" after a crash or gate-strike.

Troubleshooting

  • Scenario: Drone flies level at hover, but as soon as you fly forward, it "sags" its nose and you have to constantly pull back.
    • Diagnosis: ATC_RAT_PIT_IMAX is being hit. The drone is nose-heavy, but the integrator is capped.
    • Fix: Increase ATC_RAT_PIT_IMAX to 0.7 or move the battery further back.

ATC_RAT_PIT_NEF

Default 0
Range 1 8

Pitch Axis Rate Error Notch Filter Index (ATC_RAT_PIT_NEF)

Description

ATC_RAT_PIT_NEF is a high-precision vibration filter for your drone's pitch axis.

Longitudinal vibrations (along the drone's spine) can be very different from lateral (roll) vibrations, especially if the drone has long, thin arms or a heavy battery mounted on a "pendulum" style mount. This parameter allows you to assign a specific Harmonic Notch Filter to the pitch axis to specifically "ignore" those mechanical ringing frequencies.

By surgically removing the noise generated by the propellers at their specific RPM, this filter allows the pitch PID loop to be much more aggressive, resulting in a drone that stops its pitch moves with robotic precision and has zero "growling" sounds during fast flight.

  • Set to 0: No notch filter is applied to the pitch rate error.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) is applied to the pitch error signal ($E\_{pit}$):

$$ \vec{E}{pit\_clean} = H{notch}( \omega\_{pit\_target} - \omega\_{pit\_actual} ) $$

The filter is dynamic, following the motor RPM:
$$ f\_{center} = \text{Base\_Freq} \cdot \frac{\text{Current\_RPM}}{\text{Ref\_RPM}} $$

This RPM-scaling ensures the "blind spot" of the filter always matches the noise generated by the props, regardless of throttle position.

The Engineer's View

This parameter maps to _notch_E_filter in the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_E_filter > 0) {
    // Passes the error through the INS library's harmonic notch pointer
    error = _notch_E_filter_ptr->apply(error);
}

Since the pitch axis often has a different moment of inertia than the roll axis, having an independent notch filter index allows for axis-specific tuning on non-symmetric (rectangular or "Dead Cat") frames.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Cleaner pitch stability. Allows for higher ATC_RAT_PIT_P and D gains without causing "shaking" or noise.
  • Effect of Disabling: Increased risk of longitudinal resonance. Pitch behavior may feel "sloppy" in high wind.

Use Case Recommendations

  • "Dead Cat" / Long Range Frames: Always Set to 1. These frames have asymmetric arms that vibrate at complex frequencies; a notch filter is mandatory for high-quality flight.
  • Cinematography Drones: Set to 1. Eliminates micro-vibrations in the pitch axis that can show up as "jello" or horizon-tilt in high-resolution video.
  • Racing Drones: Set to 1. Provides the cleanest possible signal for the D-term damping to work effectively.

Troubleshooting

  • Scenario: Drone nose "bobs" or oscillates rapidly when flying into a headwind.
    • Diagnosis: Wind-induced resonance is being amplified by the pitch controller.
    • Fix: Configure an RPM-based notch and set ATC_RAT_PIT_NEF to its index.

ATC_RAT_PIT_NTF

Default 0
Range 1 8

Pitch Axis Rate Target Notch Filter Index (ATC_RAT_PIT_NTF)

Description

ATC_RAT_PIT_NTF is a high-precision command filter for the drone's pitch axis.

In many industrial or cinematic drones, the pitch axis has a long lever arm (the "spine" of the drone). This structure can be prone to specific vibration frequencies. If your automated flight controller (the high-level software) commands pitch changes at a frequency that matches the frame's resonance, the drone will vibrate.

This parameter allows you to apply a Harmonic Notch Filter specifically to the command signal. It "scoops out" the problematic frequencies from your mission paths or GPS corrections before they are sent to the motors. This results in a drone that follows complex paths with much greater longitudinal stability and zero "growling" or ringing in the pitch axis.

  • Set to 0: No notch filter is applied to the pitch target rate.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) processes the target pitch rate ($\omega\_{pit\_target}$) before the PID loop sees it:

$$ \omega\_{pit\_clean} = H\_{notch}( \omega\_{pit\_raw} ) $$

The filter moves its rejection frequency dynamically to match the noise:
$$ f\_{center} \propto \text{Motor\_RPM} $$

The Engineer's View

This parameter maps to _notch_T_filter in the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_T_filter > 0) {
    // Passes the target through the dynamic notch filter
    target = _notch_T_filter_ptr->apply(target);
}

This is particularly useful when using Terrain Following or Object Avoidance, as those systems can sometimes generate high-frequency "jitter" in the pitch setpoint as they react to noisy environmental data.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Quieter flight during autonomous navigation. Reduces longitudinal "bobbing" caused by software setpoint jitter.
  • Effect of Disabling: Maximum pitch command responsiveness.

Use Case Recommendations

  • Agricultural Survey (Terrain Following): Set to 1. Helps smooth the drone's pitch corrections as it follows undulating hills at high speeds.
  • Lidar-Based Obstacle Avoidance: Set to 1. Prevents "software chatter" from the Lidar sensor from reaching the motors.
  • Standard Multirotor: Keep at 0. Standard low-pass filters are usually sufficient for command smoothing.

Troubleshooting

  • Scenario: Drone nose "jitters" specifically when obstacle avoidance is enabled, but is smooth in manual flight.
    • Diagnosis: High-level setpoint noise.
    • Fix: Assign a notch filter to the pitch target via ATC_RAT_PIT_NTF.

ATC_RAT_PIT_P

Default 0.135
Range 0.01 0.5

Pitch Axis Rate P Gain (ATC_RAT_PIT_P)

Description

ATC_RAT_PIT_P is the core stability parameter for the drone's forward and backward movement. It sits in the Innermost Loop of the pitch controller, managing the motor RPM differences between the front and rear of the drone to achieve a specific rotation rate.

  • Low Value: The drone feels "heavy" and slow to pitch. It may struggle to stop after a forward dash and will be easily pushed around by wind.
  • High Value: The drone feels very responsive and sharp.
  • Too High: The drone will oscillate (jitter) rapidly in the pitch axis (nose-up/nose-down). This is often audible as a "growl" or rapid motor pulsing.

The Mathematics

This is the Proportional ($k\_P$) term of the pitch rate controller:

$$ \text{Out}P = k\_P \cdot (\omega{target} - \omega\_{actual}) $$

Where:

  • $\omega\_{target}$ is the desired pitch rate (deg/s) from the outer Angle loop.
  • $\omega\_{actual}$ is the actual pitch rate measured by the Gyroscope.
  • $k\_P$ is ATC_RAT_PIT_P.

The Engineer's View

This parameter is the _kp member of the _pid_rate_pitch object (class AC_PID) inside AC_AttitudeControl_Multi.

It is executed in AC_AttitudeControl_Multi::rate_controller_run_dt():

// AC_AttitudeControl_Multi.cpp
_motors.set_pitch(get_rate_pitch_pid().update_all(ang_vel_body.y, gyro.y, dt, ...) + ...);

On most symmetric frames, ATC_RAT_PIT_P and ATC_RAT_PIT_P should be identical. However, on "Dead Cat" frames or those with long fore-aft arms, these values will often diverge during AutoTune to account for the difference in rotating mass.

Tuning & Behavior

  • Default Value: 0.135 (Standard Quad)
  • Range: 0.01 - 0.50
  • Effect of Increasing: Better tracking of forward speed commands. Drone stays level more accurately when punching the throttle.
  • Effect of Decreasing: Smoother, "lazier" pitch handling.

Use Case Recommendations

  • Long-Range / "Dead Cat" Frames: Rely on AutoTune. These frames often require a significantly higher Pitch P-gain than Roll P-gain because the rear motors are further from the center than the front motors.
  • Racing Drone: Decrease to 0.08 - 0.1. High-torque motors need lower gains to avoid over-correcting.
  • Heavy Cargo Drone: Increase to 0.18 - 0.22. Needed to overcome the high longitudinal inertia of the airframe.

Troubleshooting

  • Scenario: Drone nose "twitches" or bobs up and down rapidly when flying forward at high speed.
    • Diagnosis: ATC_RAT_PIT_P is too high (Aerodynamic resonance).
    • Fix: Reduce ATC_RAT_PIT_P by 0.01.

ATC_RAT_PIT_PDMX

Default 0
Range 0 1.0

Pitch Axis Rate PD Maximum (ATC_RAT_PIT_PDMX)

Description

ATC_RAT_PIT_PDMX is a safety clamp for your drone's longitudinal rotation authority.

In a pitch controller, the P and D terms are responsible for reacting to fast disturbances. If you hit an object or experience a massive headwind gust, the PD math might command an instantaneous motor power jump that exceeds the frame's mechanical limits.

This parameter sets a ceiling on the combined power of P and D. It ensures that the drone's immediate reaction to a pitch error is kept within a safe range, preventing extreme torque spikes that could damage ESCs or frame components.

  • Low Value: Limits the drone's "recovery snap" during extreme maneuvers.
  • High Value: Allows the drone to use its full potential motor torque for immediate pitch corrections.
  • Disabled (0): The PD sum is unlimited (limited only by the physical capabilities of the battery and motors).

The Mathematics

The P and D terms are summed and then constrained by this value:

$$ \text{PD}\_{output} = \text{constrain}(P + D, -\text{PDMX}, \text{PDMX}) $$

Where:

  • $P = k\_P \cdot \omega\_{pitch\_error}$
  • $D = k\_D \cdot \frac{d}{dt}\omega\_{pitch\_error}$
  • $\text{PDMX}$ is ATC_RAT_PIT_PDMX.

Note: The Integral (I) and Feed-Forward (FF) terms are added after this clamp. This is critical because it means the drone can still achieve full tilt authority via the I-term, but it won't react with a violent "kick" to high-frequency noise.

The Engineer's View

This parameter maps to _kpdmax in the _pid_rate_pitch object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_kpdmax)) {
    float pd_sum = P + D;
    pd_sum = constrain_float(pd_sum, -_kpdmax, _kpdmax);
}

By capping the PD sum, ArduPilot allows you to use very high D-gains (for tight damping) without the risk of those high gains creating destructive motor pulses if a sensor glitch occurs.

Tuning & Behavior

  • Default Value: 0 (Unlimited)
  • Range: 0 - 1.0 (0 to 100% motor authority)
  • Effect of Increasing: Better longitudinal recovery. The drone fights harder to stay level in turbulent air.
  • Effect of Decreasing: Smoother, safer pitch behavior. Limits the mechanical "mechanical shock" of the drone's reactions.

Use Case Recommendations

  • Large Professional Rig (>10kg): Set to 0.5. Protects the expensive long-arm structure from extreme torsional shocks during abrupt stops.
  • Cinematography Drone: Set to 0.4. Ensures that any software glitches or sensor spikes produce a limited "kick," keeping the video footage cleaner.
  • FPV Racing Quad: Keep at 0. You want every available ounce of motor torque for recovery during high-speed gate navigation.

Troubleshooting

  • Scenario: Drone is slow to level its nose after a fast dive, even with high P-gain.
    • Diagnosis: ATC_RAT_PIT_PDMX is set too low.
    • Fix: Increase ATC_RAT_PIT_PDMX or set it to 0.

ATC_RAT_PIT_SMAX

Default 0.0
Range 0 200

Pitch Axis Rate Slew Rate Limit (ATC_RAT_PIT_SMAX)

Description

ATC_RAT_PIT_SMAX is a protection mechanism for your drone's longitudinal stability. A Slew Rate is a limit on how fast a command signal can change over time.

In the pitch controller, if the PID loop calculates that it needs to jump from 20% motor power to 80% motor power instantly (due to a violent gust or a sensor spike), the ESCs and motors will experience a massive, potentially destructive surge in current. This parameter rounds off those spikes, ensuring that the motor command always increases or decreases at a rate your hardware can safely handle.

  • Low Value: Pitch response feels extremely smooth and "damped." Motors will sound very quiet.
  • High Value: Allows the pitch motors to reach their target power as fast as they physically can.
  • Too High: Risk of "motor chirping" or ESC failure due to extreme current transients during fast pitch changes.
  • Disabled (0): The software does not limit the rate of change of the pitch motor command.

The Mathematics

The slew limit acts as a "speed limit" for the change in the pitch motor command ($O\_{pit}$):

$$ |O\_{new} - O\_{prev}| \leq SMAX \cdot dt $$

If the calculated change in output exceeds $SMAX$, ArduPilot automatically reduces the P and D gains of the pitch rate loop for that specific cycle to keep the command within the limit:

$$ \text{Gain Scale Factor} = \frac{SMAX}{\text{Calculated Change}} $$

The Engineer's View

This parameter maps to _slew_rate_max in the _pid_rate_pitch object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_slew_rate_max)) {
    _pid_info.slew_rate = (P + D - _last_out_pd) / dt;
    if (fabsf(_pid_info.slew_rate) > _slew_rate_max) {
        // Dynamically lower authority for this loop cycle to prevent mechanical shock
        float scale = _slew_rate_max / fabsf(_pid_info.slew_rate);
        // ... apply scaling ...
    }
}

This Dynamic Gain Reduction allows the drone to remain stable while protecting the hardware from high-frequency resonant "shocks" that could otherwise break motor mounts or frames.

Tuning & Behavior

  • Default Value: 0.0 (Disabled)
  • Range: 0 - 200
  • Effect of Increasing: Sharper, more immediate pitch authority. Essential for high-speed tracking.
  • Effect of Decreasing: Smoother motor response, longer motor/ESC life, and quieter overall flight.

Use Case Recommendations

  • Large Prop Professional Drones (>18 inch): Set to 50 - 80. High rotating inertia makes instant speed changes impossible; the slew limit prevents wasted energy and heat.
  • Industrial VTOL: Set to 40. Reliability and mechanical longevity are prioritized over razor-sharp freestyle handling.
  • FPV Freestyle: Keep at 0.0. Pilots generally prefer the absolute minimum latency in their pitch response.

Troubleshooting

  • Scenario: Drone makes a high-pitched "scratching" sound during vertical punches or sharp stops.
    • Diagnosis: High-frequency pitch transients are exceeding the frame's rigidity or the ESC's update capability.
    • Fix: Set ATC_RAT_PIT_SMAX to 100 and re-test.

ATC_RAT_RLL_D

Default 0.0036
Range 0.0 0.05

Roll Axis Rate D Gain (ATC_RAT_RLL_D)

Description

ATC_RAT_RLL_D is the vertical "shock absorber" for your drone's rotation. In physics, the Derivative (D) term looks at how fast the error is changing.

If you command a sharp 180-degree roll and then stop the stick, the drone has a massive amount of rotating momentum. Without D-gain, the P-gain would try to stop the drone, but it would shoot past the target angle and then "bounce back." The D-gain "notices" that the drone is rotating very fast toward its target and applies the brakes early to ensure a perfectly smooth, non-bouncing stop.

  • Low Value: The drone will "bounce" or "wag" its wings when you stop a roll. It feels loose and imprecise during fast maneuvers.
  • High Value: The drone feels extremely rigid and "on rails." Stops are instantaneous.
  • Too High: The drone will emit a high-pitched "shriek" from the motors. This is caused by the D-term amplifying tiny sensor vibrations (noise) and trying to correct them hundreds of times per second. This can burn out your motors and ESCs in seconds.

The Mathematics

The D-term is proportional to the rate of change of the rate error:

$$ \text{Out}D = k\_D \cdot \frac{d(\omega{target} - \omega\_{actual})}{dt} $$

Where:

  • $k\_D$ is ATC_RAT_RLL_D.
  • The derivative is heavily filtered by ATC_RAT_RLL_FLTD to prevent noise amplification.

Intuition: If the error is getting smaller very quickly (you are nearly at your target rate), the derivative is negative. This causes the D-term to subtract from the total motor power, "braking" the rotation so you don't overshoot.

The Engineer's View

This parameter is the _kd member of the _pid_rate_roll object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    // ... filtering happens here ...
    _derivative = filtered_derivative;
}
return ... + _derivative * _kd;

Modern ArduPilot versions also feature D-Term Tapering, which reduces the D-gain at high throttle to prevent the increased motor noise at high RPM from causing "D-gain blowouts."

Tuning & Behavior

  • Default Value: 0.0036 (Very sensitive!)
  • Range: 0.0 - 0.05
  • Effect of Increasing: Crisper stops, less bounce-back after flips, "robotic" handling.
  • Effect of Decreasing: Softer handling, more "organic" movement, safer for motors on high-vibration frames.

Use Case Recommendations

  • FPV Freestyle: Increase to 0.005 - 0.008. Essential for "snappy" flips and rolls where the drone must stop perfectly level.
  • Large Professional Drones (>15 inch props): Keep very low or set to 0.0. Large props are too slow to react to derivative changes; D-gain here usually just creates heat and "prop wash" oscillations.
  • Cinematography: Keep at Default. Provides just enough damping for a stable horizon without introducing high-frequency jitters.

Troubleshooting

  • Scenario: You finish a roll, and the drone's wings "wobble" once or twice before settling.
    • Diagnosis: ATC_RAT_RLL_D is too low.
    • Fix: Increase ATC_RAT_RLL_D by 0.0005.
  • Scenario: Motors sound like they are "grinding" or "chirping" even in a hover.
    • Diagnosis: ATC_RAT_RLL_D is too high (Vibration amplification).
    • Fix: Reduce ATC_RAT_RLL_D immediately.

ATC_RAT_RLL_D_FF

Default 0.0
Range 0 0.02

Roll Axis Rate Derivative Feed-Forward (ATC_RAT_RLL_D_FF)

Description

ATC_RAT_RLL_D_FF is an advanced "predictive" term for roll control. While standard Feed-Forward (ATC_RAT_RLL_FF) looks at the target rotation speed, the Derivative Feed-Forward (D_FF) looks at how fast you are moving the stick.

Think of it as the "pre-acceleration" boost. If you slam the roll stick to the side, you are requesting a sudden jump in rotation speed. The D_FF term "senses" this rapid movement and instantly adds a massive burst of motor power to overcome the inertia of the propellers before the drone even starts to roll. It allows the drone to "lead" into a maneuver with zero lag.

  • Low Value (0.0): Standard behavior. The drone accelerates as fast as its P-gain and base FF allow.
  • High Value: Creates a very aggressive "snap" at the start of every roll.
  • Too High: Can cause the motors to "bark" or click, and potentially lead to over-snapping where the drone overshoots the initial rotation.

The Mathematics

The D_FF term is proportional to the derivative of the target rotation rate ($\omega\_{target}$):

$$ \text{Out}{D\_FF} = \frac{d(\omega{target})}{dt} \cdot k\_{D\_FF} $$

Where:

  • $k\_{D\_FF}$ is ATC_RAT_RLL_D_FF.
  • $\frac{d(\omega\_{target})}{dt}$ is the rate of change of your stick input (in $deg/s$²).

This is added to the total motor demand alongside the standard P, I, D, and FF terms.

The Engineer's View

This parameter maps to _kdff in the _pid_rate_roll object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float target_derivative = (target - _last_target) / dt;
    _pid_info.D_FF = target_derivative * _kdff;
}

Because it looks at the Target (software) rather than the Gyro (sensor), D_FF is immune to motor vibration noise. This makes it a much safer way to get "crisp" response than simply cranking up the standard D-gain.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0.0 - 0.02
  • Effect of Increasing: Snappier, more instantaneous roll response. Reduces the "initial sag" at the start of a flip.
  • Effect of Decreasing: Smoother, more natural-feeling rotations.

Use Case Recommendations

  • FPV Racing / Freestyle: Increase to 0.005 - 0.01. Essential for the "robotic" and instant feel required to navigate tight technical courses.
  • Standard GPS Flying: Keep at 0.0. The standard shaper and P-gain are sufficient for smooth flight.
  • High-Speed Tracking: Increase to 0.003. Helps the drone follow rapid movements of a subject without falling behind the "lead."

Troubleshooting

  • Scenario: Drone makes a loud "pop" or "snap" sound from the motors every time you move the stick.
    • Diagnosis: ATC_RAT_RLL_D_FF is too high.
    • Fix: Reduce to 0.0 or 0.002.

ATC_RAT_RLL_FF

Default 0.0
Range 0.0 0.5

Roll Axis Rate Feed-Forward Gain (ATC_RAT_RLL_FF)

Description

ATC_RAT_RLL_FF is the "direct drive" of the flight controller. While the P, I, and D terms in the PID loop wait for the drone to make a mistake before they act, the Feed-Forward (FF) term acts the moment you move the stick.

If you command a 180 $deg/s$ roll, the FF term instantly calculates a baseline motor power to start that rotation before the gyro even feels the movement. This removes the "mushy" feel found in many flight controllers and allows for a perfectly linear relationship between your stick position and the drone's rotation speed.

  • Low Value (0.0): The drone relies entirely on error-correction. There will be a slight, perceived lag as the PID loop builds up authority to start the rotation.
  • High Value: The drone feels "telepathic." It starts and stops rotating exactly when you move the sticks.
  • Too High: The drone will "snap" too hard, potentially overshooting its target rate before the PID loop can catch it.

The Mathematics

The FF term is a simple multiplier of the target rotation rate:

$$ \text{Out}{FF} = \omega{target} \cdot k\_{FF} $$

Where:

  • $\omega\_{target}$ is the desired roll rate (from the pilot or outer loop).
  • $k\_{FF}$ is ATC_RAT_RLL_FF.

The total output sent to the motor mixer is the sum of PID and FF:
$$ \text{Out}{total} = \text{Out}{P} + \text{Out}{I} + \text{Out}{D} + \text{Out}\_{FF} $$

The Engineer's View

This parameter is the _kff member of the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
_pid_info.FF = target * _kff;
// ...
return P + I + D + _pid_info.FF;

In the ArduPilot architecture, Feed-Forward is often the preferred way to get responsiveness on large frames because it does not create the high-frequency vibration risks associated with aggressive P and D gains.

Tuning & Behavior

  • Default Value: 0.0 (Traditional Multirotor)
  • Range: 0.0 - 0.5
  • Effect of Increasing: Snappier, more immediate rotations. Better adherence to rapid 3D maneuvers.
  • Effect of Decreasing: Smoother, softer handling.

Use Case Recommendations

  • FPV Racing / Freestyle: Increase to 0.15 - 0.25. Essential for the "instant" feel needed to navigate tight gates or perform technical acro.
  • Heavy Lift / Commercial: Keep at 0.0. Large drones are too heavy for instant rotation; the error-correction loops are safer for managing their massive inertia.
  • Cinematography: Set to 0.05. A tiny amount of FF can help the drone start moving with less "slop" without making it feel jumpy.

Troubleshooting

  • Scenario: When you start a roll, the drone "kicks" violently, but the rest of the rotation is smooth.
    • Diagnosis: ATC_RAT_RLL_FF is too high.
    • Fix: Reduce ATC_RAT_RLL_FF by 0.05.

ATC_RAT_RLL_FLTD

Hz
Default 0.0
Range 0 100

Roll Axis Rate D-Term Filter (ATC_RAT_RLL_FLTD)

Description

ATC_RAT_RLL_FLTD is arguably the most important safety filter on your drone. In a PID loop, the Derivative (D) term is exceptionally sensitive to noise because it looks at the rate of change between samples. Small high-frequency vibrations that the P-term ignores look like massive rotation rates to the D-term.

Without this filter, the D-gain would amplify motor noise so aggressively that your motors would "chirp," get hot, and potentially burn out within seconds of taking off. This filter specifically targets the signal used for D-gain, stripping out high-frequency "jitter" while leaving the drone's actual movements intact.

  • Higher Frequency (e.g., 40Hz): Effective damping, stops flips instantly, but high risk of motor heat.
  • Lower Frequency (e.g., 10Hz): Safe for noisy frames, but the D-gain will feel "laggy" and may not stop the drone from bouncing after a maneuver.
  • Disabled (0): Defaults to half of the main error filter or a safe internal value.

The Mathematics

The D-term calculates the derivative of the error, then passes it through a single-pole low-pass filter:

$$ D\_{filtered} = D\_{prev} + \alpha \cdot \left( \frac{E - E\_{prev}}{dt} - D\_{prev} \right) $$

Where the filter coefficient $\alpha$ is derived from ATC_RAT_RLL_FLTD ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Engineer's Tip: The D-filter frequency should almost always be lower than (or equal to) the Error filter frequency (ATC_RAT_RLL_FLTE) because the derivative process itself creates high-frequency noise.

The Engineer's View

This parameter maps to _filt_D_hz in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    _derivative = _last_derivative + (dt / (_filt_D_hz + dt)) * (derivative - _last_derivative);
}
return ... + _derivative * _kd;

Modern ArduPilot versions run these filters at the loop rate (e.g., 400Hz), which allows for very precise noise rejection without introducing excessive control lag.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection, usually 20-30Hz)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Better "snap" at the end of maneuvers. Tighter control.
  • Effect of Decreasing: Quieter motors, longer motor life, less susceptible to prop-wash oscillation.

Use Case Recommendations

  • FPV Racing (Rigid Frame): Set to 30.0 - 50.0 Hz. High performance requires a high D-cutoff to stop rotations instantly.
  • 10-inch Multirotor (Gimbal): Set to 15.0 - 20.0 Hz. Provides a smooth, non-vibrating base for photography.
  • Large Heavy Lift (>22 inch props): Set to 5.0 - 10.0 Hz. Low frequencies are required to avoid exciting the resonant "ringing" of long carbon fiber arms.

Troubleshooting

  • Scenario: Motors are making a high-pitched "grinding" sound and coming down hot to the touch.
    • Diagnosis: D-term noise amplification.
    • Fix: Reduce ATC_RAT_RLL_FLTD by 5.0 Hz increments until the motors are cool.

ATC_RAT_RLL_FLTE

Hz
Default 0.0
Range 0 100

Roll Axis Rate Error Filter (ATC_RAT_RLL_FLTE)

Description

ATC_RAT_RLL_FLTE is the primary "vibration shield" for your roll rate controller.

The Gyroscope on your drone is incredibly sensitive; it can feel every tiny vibration from the motors and every slight flex of the frame. If the flight controller tried to react to every single 100Hz vibration, the motors would be constantly surging, creating heat and noise without actually stabilizing the drone. This filter "washes out" that high-frequency noise, ensuring the PID loop only reacts to the "true" movement of the vehicle.

  • Higher Frequency (e.g., 40Hz): Faster control response. The drone feels more "connected," but motor noise and heat will increase.
  • Lower Frequency (e.g., 10Hz): Smoother flight and quieter motors, but the drone will feel slightly "loose" or "mushy."
  • Disabled (0): The software uses the main gyro sample rate (often 400Hz or 1kHz). Highly risky for larger drones.

The Mathematics

This is a single-pole low-pass filter applied to the error signal ($E = \omega\_{target} - \omega\_{gyro}$):

$$ E\_{filtered} = E\_{prev} + \alpha \cdot (E\_{raw} - E\_{prev}) $$

Where the smoothing factor $\alpha$ is derived from ATC_RAT_RLL_FLTE ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Trade-off: Lowering $f\_c$ increases "Phase Lag." If the lag becomes too great, the drone will start to wobble at a low frequency because its corrections are arriving too late.

The Engineer's View

This parameter maps to _filt_E_hz in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_reset_filter) {
    _reset_filter = false;
    _error = target - measurement;
} else {
    _error += ((target - measurement) - _error) * get_filt_E_alpha(dt);
}

By filtering the error before the P, I, and D calculations, ArduPilot ensures that the entire rate loop is synchronized on a consistent, clean signal.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Better stability in high winds. Drone feels more "locked" during flips.
  • Effect of Decreasing: Quieter motor sound, less "jello" in the camera gimbal. Essential for large, flexible frames.

Use Case Recommendations

  • 5-inch Racing Quad: Set to 30.0 - 40.0 Hz. High performance and rigid frames can handle a very high filter cutoff for instant response.
  • 10-15 inch Photography Drone: Set to 20.0 Hz. Good compromise between stability and motor heat.
  • Large Professional Rig (>15 inch props): Set to 10.0 Hz. Large props have high inertia; trying to control them with 30Hz data is pointless and inefficient.

Troubleshooting

  • Scenario: Drone oscillates rapidly (like a cell phone vibrating) when taking off.
    • Diagnosis: Frame resonance passing through the PID loop.
    • Fix: Reduce ATC_RAT_RLL_FLTE by 5.0 Hz increments until the vibration stops.

ATC_RAT_RLL_FLTT

Hz
Default 0.0
Range 0 100

Roll Axis Rate Target Filter (ATC_RAT_RLL_FLTT)

Description

ATC_RAT_RLL_FLTT smooths the commands sent to the drone's roll rate controller. While other filters (like FLTE) clean up noise from the Sensors, this filter cleans up "jumps" from the Software.

When a pilot moves the stick or an autopilot changes the flight path, the target rotation rate might change in a sudden "step" (e.g., from 0 $deg/s$ to 50 $deg/s$ in one loop). These sharp edges can cause the motors to kick violently. This filter rounds off those corners, ensuring the drone accelerates into its rotation gracefully rather than with a mechanical shock.

  • Low Frequency (e.g., 10Hz): Very smooth, "organic" flight feel. Commands are softened.
  • High Frequency (e.g., 40Hz): Instant response. The drone follows every tiny twitch of the pilot's fingers.
  • Disabled (0): The target rate is unfiltered. Maximum responsiveness, but potential for mechanical "ringing."

The Mathematics

This is a low-pass filter applied to the target rate ($\omega\_{target}$):

$$ \omega\_{target\_filtered} = \omega\_{target\_prev} + \alpha \cdot (\omega\_{target\_raw} - \omega\_{target\_prev}) $$

Where $\alpha$ is derived from ATC_RAT_RLL_FLTT ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Effect: This effectively acts as a "stick smoothing" parameter. A 20Hz filter frequency corresponds to a time constant of about 8 milliseconds—unnoticeable to most pilots but enough to save your frame from resonant vibration.

The Engineer's View

This parameter maps to _filt_T_hz in the _pid_rate_roll object.

It is applied at the entry point of the PID loop in AC_PID::update_all():

// AC_PID.cpp
_target += (target - _target) * get_filt_T_alpha(dt);

By filtering the target at the start of the loop, ArduPilot ensures that the Feed-Forward (RAT_RLL_FF) and P-terms don't produce a massive, discontinuous spike when the command changes.

Tuning & Behavior

  • Default Value: 0.0 (Disabled / Loop rate)
  • Range: 0.0 - 100.0 Hz
  • Effect of Increasing: Snappier, more "direct" stick feel. Better for racing.
  • Effect of Decreasing: Smoother cinematic transitions. Essential for vehicles with very large, high-torque motors that can be damaged by sudden "kicks."

Use Case Recommendations

  • Standard build: Keep at 0.0. The input shaping logic in ArduPilot usually handles command smoothing perfectly.
  • Heavy Lift / Long Endurance: Set to 10.0 Hz. Reduces the "impact" of stick commands on the frame and battery, potentially increasing flight time and frame longevity.
  • FPV Freestyle: Keep at 0.0. Pilots generally prefer the absolute minimum latency between their brain and the motors.

Troubleshooting

  • Scenario: Drone makes a "clunk" or "knock" sound specifically when you suddenly move the roll stick to its limit.
    • Diagnosis: Discontinuous target rate is causing a motor current spike.
    • Fix: Set ATC_RAT_RLL_FLTT to 20.0 Hz.

ATC_RAT_RLL_I

Default 0.135
Range 0.01 2.0

Roll Axis Rate I Gain (ATC_RAT_RLL_I)

Description

ATC_RAT_RLL_I is the "memory" of the roll controller. Its job is to fix persistent mistakes that the P-gain (ATC_RAT_RLL_P) isn't strong enough to handle.

If your drone is off-balance (e.g., the battery is mounted slightly to one side) or if there is a constant side-wind, the drone will naturally want to tilt. The I-term "notices" this persistent error and slowly builds up motor power on the weak side until the drone stays level. It is the parameter that ensures the drone actually stays where the sticks tell it to, rather than slowly drifting away.

  • Low Value: The drone will feel "drifty." It won't hold its angle precisely, especially when moving fast or in wind.
  • High Value: The drone holds its attitude very strictly.
  • Too High: The drone will develop a slow, rhythmic "wobble" (oscillation) as the integrator over-corrects and then has to unwind itself.

The Mathematics

The I-term accumulates the rate error over time:

$$ \text{Out}I += \int\_0^t (\omega{target} - \omega\_{actual}) \cdot k\_I \cdot dt $$

Where:

  • $k\_I$ is ATC_RAT_RLL_I.
  • The output is capped by ATC_RAT_RLL_IMAX to prevent "Runaway" throttle.

Anti-Windup: ArduPilot includes advanced logic to stop the integrator from building up if the motors are already at 100% power, preventing the drone from flipping over if it hits an obstacle.

The Engineer's View

This parameter is the _ki member of the _pid_rate_roll object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
_integrator += (error * _ki * dt);
_integrator = constrain_float(_integrator, -_kimax, _kimax);

In AC_AttitudeControl_Multi, the integrator is also affected by the Throttle Mix logic (ATC_THR_MIX_MAN), which determines how much priority the I-term gets compared to the pilot's throttle request.

Tuning & Behavior

  • Default Value: 0.135 (Matches P-gain usually)
  • Range: 0.01 - 2.0
  • Effect of Increasing: Better attitude hold, less drift in wind, drone feels "heavier" and more stable.
  • Effect of Decreasing: Drone feels more agile and "loose," but requires more manual correction from the pilot.

Use Case Recommendations

  • Long-Distance Autonomy: Increase to 0.2 - 0.3. Ensures the drone stays perfectly on its path for miles, even as weight changes (e.g., if carrying a liquid payload).
  • Cinematography: Keep Default. Standard values prevent the slow "integrator wobble" that can ruin a long tracking shot.
  • FPV Freestyle: Decrease to 0.08 - 0.1. Many freestyle pilots prefer a "looser" feel that allows the drone to follow its own momentum slightly more naturally during acrobatic flips.

Troubleshooting

  • Scenario: Drone oscillates slowly (about 1-2 times per second) in the roll axis.
    • Diagnosis: ATC_RAT_RLL_I is too high (Integrator oscillation).
    • Fix: Reduce ATC_RAT_RLL_I by 0.02 until the wobble stops.

ATC_RAT_RLL_ILMI

Default 0.02
Range 0 1.0

Roll Axis Rate I-Leak Minimum (ATC_RAT_RLL_ILMI)

Description

ATC_RAT_RLL_ILMI is a specialized "memory cleanup" feature for Traditional Helicopters.

In PID control, the Integral (I) term has a "memory"—it remembers past errors and builds up authority to fix them. On helicopters, this memory can be problematic. Because helis have complex mechanical linkagess and ground interactions, the I-term can build up "fake" authority while the heli is sitting on the ground or during a slow takeoff.

"Leakiness" allows this memory to slowly evaporate over time. ATC_RAT_RLL_ILMI sets the minimum speed of that evaporation. It ensures that the helicopter's attitude memory is always "fresh" and doesn't contain stale corrections from a maneuver you finished several seconds ago.

  • Higher Value: The I-term decays faster. The heli feels more "natural" and less "locked-in" by software memory.
  • Lower Value: The I-term stays around longer. Better for holding exact angles in steady-state hover.

Note: This parameter is unique to the AC_HELI_PID library and is not used by standard multirotors (Quads/Octos).

The Mathematics

The integrator ($\text{Int}$) is modified by a decay factor every time step ($dt$):

$$ \text{Int}{new} = \text{Int}{prev} \cdot (1.0 - \text{LeakRate} \cdot dt) $$

Where the Leak Rate is determined by ATC_RAT_RLL_ILMI.

This effectively acts as a "High-Pass Filter" on the integrator, ensuring that it only focuses on recent errors and ignores errors from the distant past.

The Engineer's View

This parameter is the _leak_min member in the AC_HELI_PID class.

Helicopters use a "Leaky PID" architecture because of the unique way their swashplates interact with the rotor head. Without a leak, the integrator would constantly fight the mechanical gyroscopic precession of the rotor, leading to "I-term stall" where the heli becomes unresponsive to small stick movements.

Tuning & Behavior

  • Default Value: 0.02 (2% decay per second)
  • Range: 0.0 - 1.0
  • Effect of Increasing: The helicopter feels more "loose." It will be less prone to "I-term kickback" after a hard stop.
  • Effect of Decreasing: Tighter attitude hold. The helicopter will hold its tilt angle more accurately in wind.

Use Case Recommendations

  • 3D Aerobatics: Increase to 0.05 - 0.10. Prevents the integrator from building up during rapid, repeating flips and rolls.
  • Scale / Civilian Helicopter: Keep at 0.02. Provides the best balance between stability and mechanical safety.
  • Large Gas Helicopters: Set to 0.01. Heavy rotor heads have massive inertia and need a very stable I-term to maintain level flight.

Troubleshooting

  • Scenario: After performing a sharp roll and stopping, the helicopter slowly "drifts" back a few degrees in the opposite direction.
    • Diagnosis: I-term Windup. The "memory" of the maneuver is still pushing the heli.
    • Fix: Increase ATC_RAT_RLL_ILMI to 0.04.

ATC_RAT_RLL_IMAX

Default 0.5
Range 0 1.0

Roll Axis Rate I-Term Maximum (ATC_RAT_RLL_IMAX)

Description

ATC_RAT_RLL_IMAX is a critical safety fuse for your drone's roll control. It limits the maximum power the Integral (I) term is allowed to accumulate.

The I-term is designed to "learn" offsets—like a heavy battery mounted to one side. However, if the drone is physically unable to roll (e.g., a prop is broken, or it's tangled in a branch), the I-term will keep increasing its demand until it reaches 100% motor power. This is called "windup." If the drone suddenly breaks free with a wound-up integrator, it will flip over instantly. ATC_RAT_RLL_IMAX prevents this by putting a hard ceiling on that "memory" authority.

  • Low Value: Limits the drone's ability to fly if it is significantly off-balance.
  • High Value: Allows for massive imbalance correction, but increases the risk of violent flips if the drone becomes stuck and then breaks free.
  • Default (0.5): Allows the integrator to use up to 50% of the motor's remaining authority to correct for roll errors.

The Mathematics

The integrator ($ ext{Int}$) is accumulated every time step but is clamped by this value:

$$ ext{Int}{new} = ext{constrain}( ext{Int}{prev} + ext{error}
k\_I
dt, - ext{IMAX}, ext{IMAX}) $$

Where:

  • $ ext{IMAX}$ is ATC_RAT_RLL_IMAX.
  • The output is a value between $0$ and $1.0$ representing motor mixer authority.

The Engineer's View

This parameter maps to _kimax in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
_integrator = constrain_float(_integrator + (error * _ki * dt), -_kimax, _kimax);

ArduPilot also uses Throttle-Limited Anti-Windup: If the pilot is already at 100% throttle, the integrator is not allowed to increase further in the positive direction. This ensures that the drone always prioritizes manual throttle commands over the integrator's "learned" corrections when the motors are saturated.

Tuning & Behavior

  • Default Value: 0.5 (50% authority)
  • Range: 0.0 - 1.0
  • Effect of Increasing: Greater ability to stabilize very off-balance drones (e.g., asymmetric payloads).
  • Effect of Decreasing: Safer; reduces the chance of the drone "darting" or flipping after a crash or entanglement.

Use Case Recommendations

  • Standard GPS Photography Drone: Keep Default (0.5). Balanced safety and stability.
  • Asymmetric Special Purpose Vehicles: Increase to 0.7 - 0.8. If your drone is carrying a heavy sensor off-center, it needs more I-term authority to hold a stable hover.
  • Indoor / Education / Micro Drones: Decrease to 0.3. Smaller drones have less inertia and flip faster; a lower IMAX makes them much safer for indoor mishaps.

Troubleshooting

  • Scenario: Drone hovers perfectly but stays tilted at 10 degrees for several seconds after a crash or being caught in a branch.
    • Diagnosis: Integrator Windup.
    • Fix: Reduce ATC_RAT_RLL_IMAX to 0.4.

ATC_RAT_RLL_NEF

Default 0
Range 1 8

Roll Axis Rate Error Notch Filter Index (ATC_RAT_RLL_NEF)

Description

ATC_RAT_RLL_NEF is a specialized "anti-vibration" setting. While standard filters (like RAT_RLL_FLTE) remove all high-frequency noise, a Notch Filter is like a surgical knife—it removes noise at one very specific, problematic frequency.

On multirotors, the motors and propellers create intense vibration at specific frequencies (linked to their RPM). If these vibrations happen to match the "ringing" frequency of your drone's carbon fiber arms, the arms will start to oscillate. If the flight controller tries to fix these oscillations, it creates a feedback loop that makes the motors shriek and can even cause the drone to explode mid-air.

By setting this index, you tell the roll controller to use one of your pre-configured Harmonic Notch filters (linked to motor RPM or an FFT) to specifically "ignore" those frame resonances.

  • Set to 0: No notch filter is applied to the roll rate error.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) is applied to the error signal ($E$) before it enters the PID logic:

$$ \vec{E}{clean} = H{notch}( \omega\_{target} - \omega\_{actual} ) $$

The center frequency of the notch ($f\_c$) is dynamic and moves with the motor speed:
$$ f\_c \propto \text{Motor\_RPM} $$

This ensures that no matter how fast you are flying, the "noise" from the propellers is always perfectly filtered out.

The Engineer's View

This parameter maps to _notch_E_filter in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_E_filter > 0) {
    // Passes the error through the INS library's harmonic notch pointer
    error = _notch_E_filter_ptr->apply(error);
}

By applying the notch to the Error signal (rather than the raw Gyro), ArduPilot ensures that the P, I, and D terms all receive the cleanest possible data, allowing for much higher gains and a "locked-in" feel.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Allows for much higher ATC_RAT_RLL_P and D gains. Makes the drone sound significantly quieter and smoother.
  • Effect of Disabling: Motors will be noisier and hotter. Increased risk of "D-gain blowouts."

Use Case Recommendations

  • High-Performance Multirotors: Always Set to 1 (after configuring INS_HNTCH). Modern flight performance depends entirely on good notch filtering.
  • Large Frames (>15 inch): Set to 1. Large arms are very prone to low-frequency resonance that standard filters can't catch without creating too much lag.
  • Small Whoops: Keep at 0. Resonances are usually high enough that standard filters handle them.

Troubleshooting

  • Scenario: I increased my D-gain and now the drone oscillates violently the moment I take off.
    • Diagnosis: Frame resonance is being amplified.
    • Fix: Ensure INS_HNTCH is configured and set ATC_RAT_RLL_NEF to 1.

ATC_RAT_RLL_NTF

Default 0
Range 1 8

Roll Axis Rate Target Notch Filter Index (ATC_RAT_RLL_NTF)

Description

ATC_RAT_RLL_NTF is the sister filter to the "Error Notch" filter. While the error notch cleans up noise from the Sensors (IMU), the target notch cleans up noise from the Commands (Software).

In a complex multi-layered control system, the "target rate" (how fast you want to roll) is the result of many calculations—GPS position planners, obstacle avoidance systems, and mission planners. Sometimes, these software processes can introduce rhythmic "ripples" or high-frequency pulses into the command. If these pulses happen to match the physical resonance of your drone's frame, they can cause the drone to vibrate or sound "grainy."

This parameter allows the flight controller to surgically remove those command-side frequencies before they ever reach the motors.

  • Set to 0: No notch filter is applied to the roll target rate.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) is applied to the target rate signal ($\omega\_{target}$) at the very beginning of the PID calculation:

$$ \omega\_{target\_clean} = H\_{notch}( \omega\_{target\_raw} ) $$

The clean target $\omega\_{target\_clean}$ is then used for the error calculation and the Feed-Forward path.

The Engineer's View

This parameter maps to _notch_T_filter in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_T_filter > 0) {
    // Passes the target through the INS library's harmonic notch pointer
    target = _notch_T_filter_ptr->apply(target);
}

This is rarely needed on standard multirotors, but is an essential tool for Heavy Lift or Experimental frames where software path-planning jitter can excite mechanical arm resonances.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Smoother motor sound during rapid maneuvers. Eliminates rhythmic vibrations caused by high-level software setpoints.
  • Effect of Disabling: Maximum responsiveness to command changes.

Use Case Recommendations

  • Standard Multirotor: Keep at 0. ArduPilot's standard input shapers provide plenty of smoothing for the command signal.
  • Flexible Wings / Long-Arm Octocopters: Consider setting to 1. Large frames can act like tuning forks; a command-side notch ensures the software never accidentally "plucks" the arm at its resonant frequency.
  • Precision Surveying (RTK): Set to 1. Very high-precision GPS position loops can sometimes introduce tiny high-frequency corrections that a notch filter can clean up.

Troubleshooting

  • Scenario: Drone makes a faint "ringing" or "humming" sound specifically during Auto missions or Loiter, but is perfectly quiet in manual Stabilize.
    • Diagnosis: Command-side resonance.
    • Fix: Apply a notch filter at the resonant frequency via ATC_RAT_RLL_NTF.

ATC_RAT_RLL_P

Default 0.135
Range 0.01 0.5

Roll Axis Rate P Gain (ATC_RAT_RLL_P)

Description

ATC_RAT_RLL_P is the single most important parameter for your drone's stability. It sits in the Innermost Loop of the flight controller, responsible for managing the actual RPM of your motors to achieve a specific rotation speed.

If the drone is rotating at 10 $deg/s$ but needs to be at 20 $deg/s$, ATC_RAT_RLL_P determines how much extra power is sent to the motors on one side to force that change.

  • Low Value: The drone feels "heavy," sluggish, and will not be able to stabilize itself against wind. It may slowly tilt over and crash because it lacks the authority to fix itself.
  • High Value: The drone feels very "tight" and precise.
  • Too High: The drone will oscillate (vibrate) rapidly in the roll axis. This is often heard as a high-pitched "shrieking" or "warbling" sound from the motors.

The Mathematics

This is the Proportional ($k\_P$) term of the rate controller. It calculates a motor demand ($ ext{Out}$) based on the Rate Error:

$$ \text{Out}P = k\_P \cdot (\omega{target} - \omega\_{actual}) $$

Where:

  • $\omega\_{target}$ is the desired roll rate (deg/s) from the outer Angle loop.
  • $\omega\_{actual}$ is the actual roll rate measured by the Gyroscope.
  • $k\_P$ is ATC_RAT_RLL_P.
  • Dimensionality: This gain converts Rotation Rate ($T^{-1}$) into a dimensionless motor command ($0.0$ to $1.0$).

The Engineer's View

This parameter is the _kp member of the _pid_rate_roll object (class AC_PID) inside AC_AttitudeControl_Multi.

It is executed hundreds of times per second (loop rate) in AC_AttitudeControl_Multi::rate_controller_run_dt():

// AC_AttitudeControl_Multi.cpp
_motors.set_roll(get_rate_roll_pid().update_all(ang_vel_body.x, gyro.x, dt, ...) + ...);

The output of this loop is sent directly to the motor mixer, where it is added to the throttle to determine the final PWM signal for each ESC.

Tuning & Behavior

  • Default Value: 0.135 (Varies by frame)
  • Range: 0.01 - 0.50
  • Effect of Increasing: Faster stabilization, tighter feel, better rejection of aerodynamic disturbances.
  • Effect of Decreasing: Smoother flight, but increased risk of "washout" (losing control during aggressive moves) and poor wind handling.

Use Case Recommendations

  • Standard Quadcopter: Default (0.135) or run AutoTune. Most modern 5-10 inch drones work well with values between 0.1 and 0.2.
  • Racing Drone (High Power-to-Weight): Decrease to 0.08 - 0.1. High-power motors provide so much torque that a smaller P-gain is required to prevent oscillation.
  • Heavy Industrial / Large Props: Increase to 0.18 - 0.25. Large props have high inertia and take longer to change speed; a higher P-gain is needed to force them to react.

Troubleshooting

  • Scenario: High-frequency vibration ("shaking") in the roll axis, especially when at high throttle.
    • Diagnosis: ATC_RAT_RLL_P is too high (Rate loop oscillation).
    • Fix: Reduce ATC_RAT_RLL_P by 15% and re-test.

ATC_RAT_RLL_RLL_PDMX

Default 0
Range 0 1.0

Roll Axis Rate PD Maximum (ATC_RAT_RLL_PDMX)

Description

ATC_RAT_RLL_PDMX is a safety clamp for the "active" parts of the roll controller.

In a PID loop, the P and D terms are responsible for reacting to fast changes and noise. If the drone is hit by a massive gust or experiences an extreme impact, the P and D terms might compute a requested motor power of 300%—which is physically impossible and can cause the control software to behave erratically.

This parameter sets a ceiling on the combined power of P and D. It ensures that no matter how big the mistake is, the immediate rotation torque requested by the drone is kept within a reasonable range.

  • Low Value: Limits the drone's "snap" or ability to fight hard against extreme turbulence.
  • High Value: Allows the drone to use its full motor torque for immediate corrections.
  • Disabled (0): The PD sum is unlimited (limited only by the physical constraints of the motors).

The Mathematics

The P and D terms are summed and then constrained by this value:

$$ \text{PD}\_{output} = \text{constrain}(P + D, -\text{PDMX}, \text{PDMX}) $$

Where:

  • $P$ is the proportional contribution ($k\_P \cdot \omega\_{error}$).
  • $D$ is the derivative contribution ($k\_D \cdot \frac{d}{dt}\omega\_{error}$).
  • $\text{PDMX}$ is ATC_RAT_RLL_PDMX.

Note: This limit is applied before the Integral (I) term and Feed-Forward (FF) are added. This ensures that even if P and D are clamped, the drone can still maintain its long-term attitude through the I-term.

The Engineer's View

This parameter maps to _kpdmax in the _pid_rate_roll object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_kpdmax)) {
    float pd_sum = P + D;
    pd_sum = constrain_float(pd_sum, -_kpdmax, _kpdmax);
    // ... use pd_sum ...
}

This is particularly useful for very high-performance drones where the D-gain is very aggressive. It prevents a single noisy gyro sample from commanding a full-power motor reversal.

Tuning & Behavior

  • Default Value: 0 (Unlimited)
  • Range: 0 - 1.0 (0 to 100% motor authority)
  • Effect of Increasing: Increases the drone's "recovery authority"—the ability to level itself after a massive disturbance.
  • Effect of Decreasing: Makes the flight feel "safer" and less likely to have sudden motor torque transients.

Use Case Recommendations

  • Standard Multirotor: Keep at 0.
  • Large Professional Rig (>10kg): Set to 0.5 (50%). Prevents extreme software-driven torque from snapping a motor arm or stripping a propeller hub during a shock.
  • Research / Prototype flight: Set to 0.3. A safe setting for testing experimental code where you want to limit how "hard" the controller can kick.

Troubleshooting

  • Scenario: Drone feels sluggish to recover from a steep bank, even though RAT_RLL_P is high.
    • Diagnosis: ATC_RAT_RLL_PDMX is set too low, capping the controller's authority.
    • Fix: Increase ATC_RAT_RLL_PDMX or set it to 0.

ATC_RAT_RLL_SMAX

Default 0.0
Range 0 200

Roll Axis Rate Slew Rate Limit (ATC_RAT_RLL_SMAX)

Description

ATC_RAT_RLL_SMAX is a protective "governor" for your drone's power delivery. A Slew Rate is a limit on how fast a signal can change over time.

In the roll controller, if the PID loop calculates that it needs to jump from 10% motor power to 100% motor power instantly (due to noise, a prop strike, or a violent gust), the motors and ESCs will experience a massive, destructive spike in current. This parameter rounds off those spikes, ensuring that the motor command always increases or decreases at a rate your hardware can safely handle.

  • Low Value: Flight feels extremely soft and "buttery." Motors will sound very smooth.
  • High Value: Allows the motors to reach their target power as fast as possible.
  • Too High: Risk of "motor chirping" or ESC failure due to extreme current transients.
  • Disabled (0): The software does not limit the rate of change of the motor command.

The Mathematics

The slew limit acts as a "speed limit" for the motor output signal ($O$):

$$ |O\_{new} - O\_{prev}| \leq SMAX \cdot dt $$

If the calculated change in output exceeds $SMAX$, ArduPilot automatically reduces the P and D gains of the rate loop for that specific cycle to keep the command within the limit:

$$ \text{Gain Reduction Factor} = \frac{SMAX}{\text{Calculated Rate}} $$

The Engineer's View

This parameter maps to _slew_rate_max in the _pid_rate_roll object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_slew_rate_max)) {
    _pid_info.slew_rate = (P + D - _last_out_pd) / dt;
    if (fabsf(_pid_info.slew_rate) > _slew_rate_max) {
        // Dynamically lower P and D for this loop cycle
        float scale = _slew_rate_max / fabsf(_pid_info.slew_rate);
        // ... apply scaling ...
    }
}

This Dynamic Gain Reduction is a sophisticated way to handle vibration. Instead of just clipping the output (which causes instability), it temporarily "softens" the drone until the vibration spike passes.

Tuning & Behavior

  • Default Value: 0.0 (Disabled)
  • Range: 0 - 200
  • Effect of Increasing: Snappier, more immediate roll authority.
  • Effect of Decreasing: Smoother motor response, longer motor/ESC life.

Use Case Recommendations

  • Standard build: Keep at 0.0. Modern DShot ESCs and rigid frames generally handle raw commands well.
  • Large Heavy Lift (>15 inch props): Set to 50 - 100. High rotating mass makes instant speed changes impossible; the slew limit prevents the ESCs from wasting energy and heat trying to fight physics.
  • Commercial VTOL: Set to 30. Comfort and reliability are more important than razor-sharp FPV handling.

Troubleshooting

  • Scenario: Motors make a high-pitched "chirp" or "screech" during fast maneuvers or in wind.
    • Diagnosis: High-frequency PID transients are exceeding the ESC's ability to sync.
    • Fix: Set ATC_RAT_RLL_SMAX to 100.

ATC_RAT_YAW_D

Default 0.0
Range 0.0 0.02

Yaw Axis Rate D Gain (ATC_RAT_YAW_D)

Description

ATC_RAT_YAW_D is the "brakes" for your drone's rotation. In physics, the Derivative (D) term looks at how fast the rotation is changing and provides a counter-force to slow it down as it approaches the target.

In the yaw axis, this parameter is very rarely used. Because multirotors yaw using torque reaction (which is relatively weak), the air itself provides enough natural damping to stop the drone from spinning. For most multirotors, this parameter is kept at 0.0. However, for specialized frames or vehicles with very high yaw authority (like Tricopters or single-motor helicopters), a small amount of D-gain can help stop a fast spin without any bounce-back.

  • Low Value (0.0): Standard behavior. The drone relies on natural air resistance and the P-gain to stop yawing.
  • High Value: The drone stops its yaw turns with mechanical precision. No overshoot.
  • Too High: The drone will emit high-frequency "chatter" or buzzing from the tail, as the D-term over-reacts to tiny gyro vibrations. This can damage motor bearings.

The Mathematics

The D-term is proportional to the rate of change of the yaw rate error:

$$ \text{Out}D = k\_D \cdot \frac{d(\omega{yaw\_target} - \omega\_{yaw\_actual})}{dt} $$

Where:

  • $k\_D$ is ATC_RAT_YAW_D.
  • The derivative is filtered by ATC_RAT_YAW_FLTD.

Intuition: If the tail is swinging very fast toward its heading, the D-term pushes against that speed to make the landing at the target heading as soft as possible.

The Engineer's View

This parameter is the _kd member of the _pid_rate_yaw object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    _derivative = filtered_derivative;
}
return ... + _derivative * _kd;

In AC_AttitudeControl_Multi, the yaw D-term is often bypassed entirely if the gain is set to 0, which saves precious CPU cycles for the more critical Roll and Pitch loops.

Tuning & Behavior

  • Default Value: 0.0 (Standard Quad)
  • Range: 0.0 - 0.02
  • Effect of Increasing: Crisper stops at the end of yaw turns. Better stability during high-speed forward flight.
  • Effect of Decreasing: Maximum smoothness. Lower risk of motor vibration.

Use Case Recommendations

  • Standard Multirotor: Keep at 0.0. It is almost never needed for basic stability.
  • Tricopters (Servo Yaw): Set to 0.005 - 0.01. Servos are much faster and more powerful than torque reaction; they need damping to prevent the mechanical tail from "wagging" during stops.
  • Heavy Lift Octocopter: Increase to 0.002. Massive frames have high yaw inertia and may "coast" past their heading; a tiny amount of D-gain helps bring them to a controlled stop.

Troubleshooting

  • Scenario: You perform a fast 360-degree spin, and when you let go of the stick, the tail "overshoots" and then bounces back by 5 degrees.
    • Diagnosis: Inadequate yaw damping.
    • Fix: Increase ATC_RAT_YAW_D by 0.001 (start very small!).

ATC_RAT_YAW_D_FF

Default 0.0
Range 0 0.02

Yaw Axis Rate Derivative Feed-Forward (ATC_RAT_YAW_D_FF)

Description

ATC_RAT_YAW_D_FF is an advanced "torque booster" for your drone's tail.

In multirotors, yaw is generated by motor torque reaction, which is a slow and weak physical force compared to the lift used for roll and pitch. If you want to perform a sudden, sharp heading change, the drone has to overcome the rotational inertia of its arms and motors.

Derivative Feed-Forward (D_FF) looks at how fast you are moving the yaw stick. If it sees a sudden command to spin, it instantly commands a massive differential torque to the motors at the start of the move. This provides the "snap" needed for high-speed heading changes and stops the tail from feeling like it's attached by a rubber band.

  • Low Value (0.0): Standard behavior. The drone turns as fast as its motor torque and P-gain allow.
  • High Value: The drone tail feels extremely "electric" and sharp. It starts and stops spinning instantly.
  • Too High: Can cause the frame to "kick" or twist violently, potentially causing low-frequency vibrations in the other axes.

The Mathematics

The D_FF term is proportional to the rate of change of the yaw target ($\omega\_{yaw\_target}$):

$$ \text{Out}{D\_FF} = \frac{d(\omega{yaw\_target})}{dt} \cdot k\_{D\_FF} $$

Where:

  • $k\_{D\_FF}$ is ATC_RAT_YAW_D_FF.
  • $\frac{d(\omega\_{yaw\_target})}{dt}$ is the acceleration of the yaw setpoint.

Benefit: Since this is calculated from the pilot's input, it doesn't amplify gyro noise. It is a "clean" way to get extreme tail performance without risking motor damage.

The Engineer's View

This parameter maps to _kdff in the _pid_rate_yaw object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float target_derivative = (target - _last_target) / dt;
    _pid_info.D_FF = target_derivative * _kdff;
}

On large multirotors (like Octocopters), D_FF is often more effective than high P-gains for starting turns, because P-gains can only react once the drone has already "failed" to start spinning, whereas D_FF starts the spin immediately.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0.0 - 0.02
  • Effect of Increasing: Snappier heading starts and stops. Tighter tracking during rapid 3D maneuvers.
  • Effect of Decreasing: Smoother, more relaxed heading behavior.

Use Case Recommendations

  • FPV Freestyle (Yaw Spins): Increase to 0.005 - 0.01. Essential for those "instant" yaw stops after a rapid rotation.
  • Tricopters (Servo Yaw): Set to 0.002. Helps the tail servo "lead" the maneuver without needing extreme P-gains that cause servo chatter.
  • Professional Video: Keep at 0.0. You want the tail to drift smoothly; any "snapping" from D_FF will be visible as a jerk in the camera gimbal.

Troubleshooting

  • Scenario: Drone tail "vibrates" for a split second every time you move the yaw stick.
    • Diagnosis: ATC_RAT_YAW_D_FF is too high, creating a torque pulse that excites the arm resonance.
    • Fix: Reduce to 0.0 or 0.002.

ATC_RAT_YAW_FF

Default 0.0
Range 0.0 0.5

Yaw Axis Rate Feed-Forward Gain (ATC_RAT_YAW_FF)

Description

ATC_RAT_YAW_FF is the "accelerator pedal" for the tail of your drone. While the P, I, and D terms wait for the drone to fail to reach a target rotation speed before they act, the Feed-Forward (FF) term acts pre-emptively.

When you push the yaw stick left or right, the FF term instantly calculates how much motor torque to add at that exact moment to start the turn. This removes the "elastic" or "mushy" feeling often found in the tail control of large drones, allowing for a perfectly linear relationship between your finger position and the drone's rotation rate.

  • Low Value (0.0): The drone relies entirely on error-correction. There will be a slight delay as the tail "spools up" into the turn.
  • High Value: The drone feels extremely sharp. It starts and stops spinning the exact millisecond you move the stick.
  • Too High: The drone will "over-spin" when you first move the stick, potentially causing a jerky, high-frequency "snap" that stresses the frame.

The Mathematics

The FF term is a simple multiplier of the target rotation rate:

$$ \text{Out}{FF} = \omega{target} \cdot k\_{FF} $$

Where:

  • $\omega\_{target}$ is the desired yaw rate (deg/s).
  • $k\_{FF}$ is ATC_RAT_YAW_FF.

The total output is the sum of PID and FF contributions.

The Engineer's View

This parameter is the _kff member of the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
_pid_info.FF = target * _kff;
// ...
return P + I + D + _pid_info.FF;

In the ArduPilot architecture, Yaw Feed-Forward is often crucial for Octocopters and other multi-rotor platforms where the torque reaction force is very small compared to the mass of the arms. It provides the "kick" needed to overcome the airframe's rotational inertia.

Tuning & Behavior

  • Default Value: 0.0 (Standard)
  • Range: 0.0 - 0.5
  • Effect of Increasing: Snappier heading changes. Tighter tracking during autonomous flight.
  • Effect of Decreasing: Smoother, more flowing yaw turns.

Use Case Recommendations

  • Cinematography (Pan Shots): Keep at 0.0. You want the tail to drift smoothly into its turn to avoid "robotic" camera movement.
  • Tricopters (Servo Yaw): Set to 0.1 - 0.2. Servos react instantly; adding FF allows the software to take full advantage of that mechanical speed.
  • FPV Freestyle / Racing: Increase to 0.2. Essential for sharp "Yaw Spins" and clearing tight racing corners without any control lag.

Troubleshooting

  • Scenario: When you start a yaw turn, the tail "snaps" or makes a loud motor sound for a fraction of a second before continuing smoothly.
    • Diagnosis: ATC_RAT_YAW_FF is too high.
    • Fix: Reduce ATC_RAT_YAW_FF by 0.05.

ATC_RAT_YAW_FLTD

Hz
Default 0.0
Range 5 50

Yaw Axis Rate D-Term Filter (ATC_RAT_YAW_FLTD)

Description

ATC_RAT_YAW_FLTD is a specialized filter for the drone's yaw damping. In a PID loop, the Derivative (D) term reacts to the rate of change of rotation. In the yaw axis, this is a very high-noise signal because the Z-axis of the gyroscope is directly exposed to the mechanical vibration of the entire frame twisting.

  • Note: Since most multirotors use a yaw D-gain (ATC_RAT_YAW_D) of 0.0, this filter is typically inactive.
  • Purpose: If you do use yaw damping (common on Tricopters), this filter prevents that damping from amplifying motor noise into a high-frequency "chatter."

The Mathematics

The D-term calculates the derivative of the yaw error and then passes it through this low-pass filter:

$$ D\_{filtered} = D\_{prev} + \alpha \cdot \left( \frac{E - E\_{prev}}{dt} - D\_{prev} \right) $$

Where the filter coefficient $\alpha$ is derived from ATC_RAT_YAW_FLTD ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

The Engineer's View

This parameter maps to _filt_D_hz in the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(dt)) {
    float derivative = (error - _last_error) / dt;
    _derivative = _last_derivative + (dt / (_filt_D_hz + dt)) * (derivative - _last_derivative);
}

Because yaw torque is inherently slow to develop in multirotors, this filter can be set very low (5-10Hz) to ensure absolute silence in the motor output without significantly affecting the control feel.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection, usually matching the error filter)
  • Range: 5.0 - 50.0 Hz
  • Effect of Increasing: Allows for more aggressive yaw damping (crisper turn stops).
  • Effect of Decreasing: Quieter motor operation, but the yaw damper will be less effective at stopping "bounces" after a spin.

Use Case Recommendations

  • Standard Multirotor: Keep at 0.0. No need to tune this if your yaw D-gain is 0.
  • Tricopters / Tilt-Rotors: Set to 10.0 - 15.0 Hz. Mechanical yaw systems are much more sensitive to noise; a low D-filter frequency is essential for servo longevity.
  • Racing Drones: Set to 20.0 Hz. If using yaw damping, racers prefer a higher filter frequency to keep the tail feeling "electric" and instant.

Troubleshooting

  • Scenario: You increased ATC_RAT_YAW_D and now the drone's motors sound like they are "scratching" or "grinding" during yaw turns.
    • Diagnosis: D-term noise from the vertical axis.
    • Fix: Reduce ATC_RAT_YAW_FLTD to 10.0 Hz.

ATC_RAT_YAW_FLTE

Hz
Default 0.0
Range 0 20

Yaw Axis Rate Error Filter (ATC_RAT_YAW_FLTE)

Description

ATC_RAT_YAW_FLTE is the primary "tail-vibration shield" for your drone.

While Roll and Pitch have to deal with intense vibrations from the motor arms flexing, the Yaw axis (the vertical axis) typically feels a different kind of noise. Because multirotors yaw by changing torque, any rapid "pulsing" in the motor RPM can look like a yaw rotation to the gyroscope. This filter "washes out" that high-frequency motor noise, ensuring the tail controller only reacts to the drone's actual heading changes.

  • Higher Frequency (e.g., 10Hz): Faster yaw response. The nose feels more "locked," but motor noise will increase.
  • Lower Frequency (e.g., 2Hz): Smoother heading hold and quieter tail, but the drone may feel slightly "mushy" or take longer to stop a fast turn.
  • Default (0): Internal auto-selection (usually very low, around 2-5Hz).

The Mathematics

This is a single-pole low-pass filter applied to the yaw error signal ($E = \omega\_{yaw\_target} - \omega\_{yaw\_gyro}$):

$$ E\_{filtered} = E\_{prev} + \alpha \cdot (E\_{raw} - E\_{prev}) $$

Where $\alpha$ is derived from ATC_RAT_YAW_FLTE ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Note: The yaw filter frequency is usually much lower than the roll/pitch filters because torque reaction is a slow physical process, and we want to avoid exciting the mechanical "twist" of the drone's frame.

The Engineer's View

This parameter maps to _filt_E_hz in the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_reset_filter) {
    _reset_filter = false;
    _error = target - measurement;
} else {
    _error += ((target - measurement) - _error) * get_filt_E_alpha(dt);
}

Filtering the error before it enters the PID loop ensures that the I-term (ATC_RAT_YAW_I) doesn't build up "learned corrections" based on momentary noise spikes.

Tuning & Behavior

  • Default Value: 0.0 (Internal auto-selection, usually 2.0 - 5.0 Hz)
  • Range: 0.0 - 20.0 Hz
  • Effect of Increasing: Snappier tail hold. Faster corrections for motor-torque dips.
  • Effect of Decreasing: Quieter motor operation, less "growling" sound from the propellers during hover.

Use Case Recommendations

  • Long Endurance Drones: Set to 2.0 Hz. Minimizes wasted motor current on correcting high-frequency yaw jitter, increasing battery life.
  • Racing / FPV Chase Drones: Increase to 10.0 - 15.0 Hz. Essential for the "instant tail" feel needed when tracking moving objects at high speeds.
  • Heavy Lift Multirotors: Set to 3.0 Hz. Prevents the long, heavy arms from oscillating at their resonant twisting frequency.

Troubleshooting

  • Scenario: Drone nose "shakes" rapidly from side to side in wind.
    • Diagnosis: Yaw loop resonance.
    • Fix: Reduce ATC_RAT_YAW_FLTE by 1.0 Hz increments.

ATC_RAT_YAW_FLTT

Hz
Default 0.0
Range 0 50

Yaw Axis Rate Target Filter (ATC_RAT_YAW_FLTT)

Description

ATC_RAT_YAW_FLTT smooths the yaw commands sent into the drone's rate controller. While other filters (like FLTE) clean up noise from the Sensors, this filter cleans up "jumps" from the Software.

When a pilot moves the yaw stick or an autopilot changes the heading during a mission, the target rotation rate might change in a sudden "step." Since yaw torque is relatively weak in multirotors, these sudden steps can cause the drone to "lurch" or create a noticeable jerk in the tail. This filter rounds off those corners, ensuring the drone accelerates into its turn gracefully rather than with a mechanical shock.

  • Low Frequency (e.g., 5Hz): Very smooth, "lazy" tail movement. Excellent for cinematography.
  • High Frequency (e.g., 20Hz): Instant response to stick inputs.
  • Disabled (0): The target rate is unfiltered. Maximum responsiveness, but potential for "robotic" and jerky tail movements.

The Mathematics

This is a single-pole low-pass filter applied to the target rate ($\omega\_{target}$):

$$ \omega\_{target\_filtered} = \omega\_{target\_prev} + \alpha \cdot (\omega\_{target\_raw} - \omega\_{target\_prev}) $$

Where $\alpha$ is derived from ATC_RAT_YAW_FLTT ($f\_c$):

$$ \alpha = \frac{dt}{dt + \frac{1}{2\pi f\_c}} $$

Effect: This filter effectively limits the "acceleration" of the yaw command. A 10Hz filter frequency corresponds to a time constant of about 16 milliseconds—enough to remove the perceived "jerk" from digital stick inputs.

The Engineer's View

This parameter maps to _filt_T_hz in the _pid_rate_yaw object.

It is applied at the very entry point of the PID loop in AC_PID::update_all():

// AC_PID.cpp
_target += (target - _target) * get_filt_T_alpha(dt);

By filtering the target at the start of the loop, ArduPilot ensures that the Feed-Forward (RAT_YAW_FF) doesn't produce a massive, discontinuous torque spike when the pilot's stick position changes.

Tuning & Behavior

  • Default Value: 0.0 (Disabled / Loop rate)
  • Range: 0.0 - 50.0 Hz
  • Effect of Increasing: Snappier, more "connected" feel to the yaw stick.
  • Effect of Decreasing: Smoother cinematic panning. Reduces mechanical stress on large vehicles.

Use Case Recommendations

  • Standard Build: Keep at 0.0. Standard ArduPilot input shaping handles this perfectly.
  • Professional Photography (Smooth Pans): Set to 5.0 - 10.0 Hz. Ensures that every camera pan starts and ends with a professional-looking "ease-in" and "ease-out" effect.
  • Heavy Industrial / Cargo Drone: Set to 5.0 Hz. Reduces the torsional stress on the long motor arms when initiating a turn.

Troubleshooting

  • Scenario: Drone makes a faint "chirp" sound every time you suddenly move the yaw stick.
    • Diagnosis: Discontinuous target rate is causing a torque transient.
    • Fix: Set ATC_RAT_YAW_FLTT to 10.0 Hz.

ATC_RAT_YAW_I

Default 0.018
Range 0.01 1.0

Yaw Axis Rate I Gain (ATC_RAT_YAW_I)

Description

ATC_RAT_YAW_I is the "heading anchor" for your drone. Its job is to fix persistent rotation errors that the P-gain (ATC_RAT_YAW_P) isn't strong enough to stop.

If your drone has motors that aren't perfectly aligned, or if you have a propeller that is slightly damaged, the drone will naturally want to spin (yaw) on its own. The I-term "notices" this constant drift and slowly increases the counter-torque until the rotation stops. It is the parameter that ensures the nose stays exactly where you pointed it, even during long flights or in heavy wind.

  • Low Value: The drone will have "Heading Creep." The nose will slowly drift left or right over several minutes. Turn completion will feel vague.
  • High Value: Heading is held very strictly. The tail feels "locked."
  • Too High: The drone will develop a slow tail oscillation or "hunting" behavior as the tail moves back and forth looking for the target heading.

The Mathematics

The I-term accumulates the yaw rate error over time:

$$ \text{Out}I += \int\_0^t (\omega{target} - \omega\_{actual}) \cdot k\_I \cdot dt $$

Where:

  • $k\_I$ is ATC_RAT_YAW_I.
  • The result is constrained by ATC_RAT_YAW_IMAX.

Torque Balance: In multirotors, yaw I-term is essential because any difference in motor performance directly creates a yaw torque. This integrator is the only way the drone can automatically find its internal "zero torque" point.

The Engineer's View

This parameter is the _ki member of the _pid_rate_yaw object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
_integrator += (error * _ki * dt);
_integrator = constrain_float(_integrator, -_kimax, _kimax);

ArduPilot's Yaw Re-centering logic often resets this integrator when the pilot makes a deliberate large yaw command, allowing the drone to "start fresh" after a big turn without carrying over the old trim authority.

Tuning & Behavior

  • Default Value: 0.018 (Standard)
  • Range: 0.01 - 1.0
  • Effect of Increasing: Better heading hold, especially at high speed or during vertical "punches."
  • Effect of Decreasing: Smoother, more relaxed heading behavior.

Use Case Recommendations

  • Cinematography: Keep Default or set to 0.015. You want the heading to be stable, but avoid any sudden "snapping" corrections that the gimbal might not be able to follow.
  • High Speed Racing: Increase to 0.05 - 0.1. At high speeds, the aerodynamic forces on the drone are massive; a strong I-term is required to keep the nose pointed down the track.
  • Long-Range Survey: Keep Default. Standard values provide a stable heading for mapping and navigation.

Troubleshooting

  • Scenario: After you finish a turn, the drone's heading continues to "creep" for 5-10 degrees before finally stopping.
    • Diagnosis: ATC_RAT_YAW_I is too low.
    • Fix: Increase ATC_RAT_YAW_I by 0.005.

ATC_RAT_YAW_ILMI

Default 0.02
Range 0 1.0

Yaw Axis Rate I-Leak Minimum (ATC_RAT_YAW_ILMI)

Description

ATC_RAT_YAW_ILMI is a specialized "memory cleanup" feature for the tail (yaw axis) of Traditional Helicopters.

Most helicopters use a mechanical tail rotor or a servo-driven system to control heading. These systems often experience "Tail Stiction" or ground interaction. The I-term learns to fight these forces to keep the tail straight. However, if the tail "sticks" and then suddenly releases, a wound-up I-term can cause the heli to spin violently.

"Leakiness" allows the tail controller to "forget" its old corrections over time. ATC_RAT_YAW_ILMI determines the minimum speed of this forgetting process. It ensures the tail always feels "current" and doesn't hold onto stale motor authority.

  • Higher Value: The tail memory clears faster. The heli feels more reactive.
  • Lower Value: The tail memory persists longer. Better for maintaining a rock-solid heading during long, slow maneuvers.

Note: This is an AC_HELI_PID specific parameter and is not used on standard Multirotors.

The Mathematics

The yaw integrator ($\text{Int}$) is decayed every time step ($dt$):

$$ \text{Int}{new} = \text{Int}{prev} \cdot (1.0 - \text{LeakRate} \cdot dt) $$

Where the Leak Rate is determined by ATC_RAT_YAW_ILMI.

This provides a "High-Pass" effect, filtering out the DC-offset (permanent bias) of the integrator so that it doesn't become a hard mechanical limit.

The Engineer's View

This parameter is the _leak_min member in the AC_HELI_PID class.

Yaw leakiness is particularly important for helicopters because as the main rotor RPM changes, the required tail rotor torque changes instantly. A leaky integrator allows the software to quickly "forget" the old torque requirement and adapt to the new one, preventing the tail from "jumping" during throttle changes.

Tuning & Behavior

  • Default Value: 0.02 (2% decay per second)
  • Range: 0.0 - 1.0
  • Effect of Increasing: Tail becomes more "relaxed." Better for learning scale-like turns.
  • Effect of Decreasing: Tighter tail authority. The nose stays exactly where it is pointed, even if you are changing throttle rapidly.

Use Case Recommendations

  • Scale Flying (Realism): Increase to 0.05. Allows the tail to drift slightly in a realistic way, requiring more pilot coordination.
  • Precision Industrial Mapping: Decrease to 0.01. Heading accuracy is the priority; the I-term must be as persistent as possible.
  • General Hobby Flight: Keep at 0.02.

Troubleshooting

  • Scenario: After finishing a yaw turn, the tail "overshoots" and then slowly (over 2-3 seconds) moves back to the target heading.
    • Diagnosis: Yaw I-term windup.
    • Fix: Increase ATC_RAT_YAW_ILMI to 0.05.

ATC_RAT_YAW_IMAX

Default 0.5
Range 0 1.0

Yaw Axis Rate I-Term Maximum (ATC_RAT_YAW_IMAX)

Description

ATC_RAT_YAW_IMAX is a critical safety fuse for your drone's heading stability. It limits the maximum amount of torque the Integral (I) term is allowed to apply to fix a yaw error.

The I-term is designed to learn how to keep the nose straight. If one motor is tilted by 2 degrees, the drone will naturally want to spin. The I-term learns this and applies a constant counter-torque to stay straight. However, if the drone is physically stuck or if a motor is failing, the I-term could "wind up" to 100% authority. If the drone suddenly breaks free, it will spin uncontrollably (death spin). ATC_RAT_YAW_IMAX prevents this by putting a hard ceiling on how much authority the "learned memory" has.

  • Low Value: Limits the drone's ability to fly if it has tilted motors or asymmetric aerodynamics.
  • High Value: Allows the drone to handle major motor misalignments, but increases the risk of a "spin-out" after an entanglement or crash.
  • Default (0.5): Allows the integrator to use up to 50% of the motor's counter-torque capacity to fix yaw.

The Mathematics

The yaw integrator ($\text{Int}$) is accumulated but clamped by this value:

$$ \text{Int}{new} = \text{constrain}(\text{Int}{prev} + \text{error} \cdot k\_I \cdot dt, -\text{IMAX}, \text{IMAX}) $$

Where:

  • $\text{IMAX}$ is ATC_RAT_YAW_IMAX.
  • The output is a $0.0$ to $1.0$ value sent to the motor torque mixer.

The Engineer's View

This parameter is the _kimax member of the _pid_rate_yaw object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
_integrator = constrain_float(_integrator + (error * _ki * dt), -_kimax, _kimax);

In AC_AttitudeControl_Multi, the yaw integrator has a unique safety feature: it is Priority-Limited. If the Roll or Pitch loops already require 100% of the motor power to stay level, the Yaw integrator will stop building up to avoid causing a crash.

Tuning & Behavior

  • Default Value: 0.5 (50% authority)
  • Range: 0.0 - 1.0
  • Effect of Increasing: Better ability to hold heading on frames with severely tilted motors or asymmetric drag (like a drone carrying a large, non-aerodynamic sign).
  • Effect of Decreasing: Safer; limits the force of a "death spin" if the drone's yaw system becomes saturated.

Use Case Recommendations

  • Standard Multirotor: Keep Default (0.5). This is a proven, safe ceiling.
  • Delivery Drones (Large Props): Increase to 0.7. Large propellers generate high yaw torque; if the weight is off-balance, the drone may need more than 50% authority to stay straight.
  • Indoor / Micro Drones: Decrease to 0.3. Lower authority makes the drone safer and more predictable during indoor collisions.

Troubleshooting

  • Scenario: Drone hovers well, but its tail constantly "creeps" to the left in wind, and increasing ATC_RAT_YAW_I doesn't help.
    • Diagnosis: ATC_RAT_YAW_IMAX is too low. The drone has reached its "correction limit."
    • Fix: Increase ATC_RAT_YAW_IMAX to 0.6 or 0.7.

ATC_RAT_YAW_NEF

Default 0
Range 1 8

Yaw Axis Rate Error Notch Filter Index (ATC_RAT_YAW_NEF)

Description

ATC_RAT_YAW_NEF is a vibration filter specifically for your drone's tail stability.

While Roll and Pitch filters deal with arm flexing, the Yaw axis filter deals with Torsional Resonance—the tendency of the whole drone frame to "twist" back and forth around its vertical center. On multirotors, yaw is generated by torque reaction, meaning any rapid change in motor speed causes a slight twisting force on the frame. If this twisting happens at the same frequency as your motors' RPM, the tail of the drone will start to wag or vibrate.

By applying a Harmonic Notch Filter to the yaw error, you tell the flight controller to ignore those twisting vibrations. This allows for a much more stable heading, especially in wind, and prevents the "yaw growl" sound often heard on large, high-torque octocopters.

  • Set to 0: No notch filter is applied to the yaw rate error.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) is applied to the yaw rate error ($E\_{yaw}$):

$$ \vec{E}{yaw\_clean} = H{notch}( \omega\_{yaw\_target} - \omega\_{yaw\_actual} ) $$

The filter moves its "rejection frequency" in real-time to track motor speed:
$$ f\_{center} \propto \text{Motor\_RPM} $$

This ensures the filter always targets the high-intensity noise produced by the propellers.

The Engineer's View

This parameter maps to _notch_E_filter in the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_E_filter > 0) {
    // Note: The actual filtering happens via a pointer to the 
    // INS harmonic notch library.
    error = _notch_E_filter_ptr->apply(error);
}

Since yaw torque is a relatively weak force, the yaw loop is often the first to fail when high-frequency noise is present. Applying the notch filter here is a low-CPU way to significantly improve overall heading authority.

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Much more stable heading in wind. Reduces vertical altitude loss during aggressive yaw turns (since lift motors aren't busy fighting yaw noise).
  • Effect of Disabling: Tail may wag or vibrate in wind. Heading hold feels "softer."

Use Case Recommendations

  • Large Multirotors (>15 inch props): Always Set to 1. Large props generate massive torque pulses; a notch filter is essential to keep the long motor arms from twisting at their resonant frequency.
  • Tricopters: Set to 1. Mechanical yaw servos are extremely prone to over-reacting to noise; a notch filter protects the servo from high-frequency chatter.
  • Standard 5-inch Racers: Keep at 0. These frames are so rigid that torsional resonance is rarely an issue.

Troubleshooting

  • Scenario: Drone tail "wags" rapidly (20-30Hz) during vertical punches.
    • Diagnosis: Torsional frame resonance is being amplified by the yaw controller.
    • Fix: Set ATC_RAT_YAW_NEF to 1 (after configuring the main notch).

ATC_RAT_YAW_NTF

Default 0
Range 1 8

Yaw Axis Rate Target Notch Filter Index (ATC_RAT_YAW_NTF)

Description

ATC_RAT_YAW_NTF is a surgical filter for your drone's tail commands.

In a multirotor, yaw is the most mechanically flexible axis because the drone has to "twist" the frame to spin. On large drones with long motor arms, this torsional flexibility creates a specific resonant frequency—if the tail moves at just the right speed, the whole frame starts to vibrate.

Sometimes, the high-level flight software (like the GPS heading hold or an automated survey grid) can request tiny, rapid yaw changes that accidentally hit this resonance. This filter "scoops out" those problematic command frequencies before they reach the motors, ensuring the tail always moves with professional smoothness.

  • Set to 0: No notch filter is applied to the yaw target.
  • Set to 1-8: Uses the corresponding Harmonic Notch filter (configured via INS_HNTCH_*).

The Mathematics

The notch filter ($H\_{notch}$) processes the target yaw rate ($\omega\_{yaw\_target}$) before it enters the control loop:

$$ \omega\_{yaw\_clean} = H\_{notch}( \omega\_{yaw\_target\_raw} ) $$

The clean target $\omega\_{yaw\_clean}$ is then used for the PID calculation. Because the filter is dynamic ($f\_c \propto \text{RPM}$), it perfectly ignores command noise that matches the physical propeller noise.

The Engineer's View

This parameter maps to _notch_T_filter in the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (_notch_T_filter > 0) {
    // Passes the target through the dynamic notch filter
    target = _notch_T_filter_ptr->apply(target);
}

This is an essential feature for Large Octocopters or Tethered Drones where the physical heading torque is low and command-side jitter can easily cause a resonant "tail wag."

Tuning & Behavior

  • Default Value: 0 (Disabled)
  • Range: 1 - 8 (Filter Index)
  • Effect of Enabling: Quieter motors during heading changes. Reduces the chance of "tail-induced" frame vibration during autonomous turns.
  • Effect of Disabling: Maximum heading responsiveness.

Use Case Recommendations

  • High-Value Aerial Cinematography: Set to 1. Ensures that every camera pan is perfectly clean and free from software-induced mikro-jitters.
  • Large Hybrid/Heavy Lift Drones: Set to 1. Prevents the high-leverage motors from exciting the torsional modes of the long frame arms.
  • Standard Quadcopter: Keep at 0. Standard low-pass filters are usually sufficient for command smoothing.

Troubleshooting

  • Scenario: Drone tail "vibrates" or makes a high-pitched growl only when rotating in an Auto mission.
    • Diagnosis: Command-side torsional resonance.
    • Fix: Assign a notch filter to the yaw target via ATC_RAT_YAW_NTF.

ATC_RAT_YAW_P

Default 0.18
Range 0.10 2.50

Yaw Axis Rate P Gain (ATC_RAT_YAW_P)

Description

ATC_RAT_YAW_P is the "tail hold" authority for your drone. It sits in the Innermost Loop of the yaw controller, managing the torque differences between clockwise and counter-clockwise spinning motors to achieve a specific rotation rate.

Unlike Roll and Pitch, which use powerful differential thrust, multirotors yaw by changing the balance of motor torque. This is a much weaker force. ATC_RAT_YAW_P determines how aggressively the flight controller fights to keep the nose pointed in the right direction.

  • Low Value: The tail will feel "vague" or "lazy." When you stop a turn, the drone might continue to drift (coast) for a few degrees. It will also be easily blown around by the wind.
  • High Value: The drone tracks heading commands precisely. Turns feel sharp and immediate.
  • Too High: The drone will develop "Tail Wag"—the nose will rapidly oscillate left and right. This can cause the entire frame to vibrate and potentially lose altitude.

The Mathematics

This is the Proportional ($k\_P$) term of the yaw rate controller:

$$ \text{Out}P = k\_P \cdot (\omega{target} - \omega\_{actual}) $$

Where:

  • $\omega\_{target}$ is the desired yaw rate (deg/s).
  • $\omega\_{actual}$ is the actual rotation rate measured by the Z-axis of the Gyroscope.
  • $k\_P$ is ATC_RAT_YAW_P.

Note: Yaw gains are typically much higher than Roll/Pitch gains (e.g., 0.5 to 1.0 vs 0.1) because the physical torque authority is so much lower.

The Engineer's View

This parameter is the _kp member of the _pid_rate_yaw object (class AC_PID) inside AC_AttitudeControl_Multi.

It is executed in AC_AttitudeControl_Multi::rate_controller_run_dt():

// AC_AttitudeControl_Multi.cpp
_motors.set_yaw(get_rate_yaw_pid().update_all(ang_vel_body.z, gyro.z, dt, ...) + ...);

On some frames, high yaw demands can "starve" the other axes for power. ArduPilot's motor mixer includes logic to prioritize Roll and Pitch over Yaw to ensure the drone doesn't flip over just to fix its heading.

Tuning & Behavior

  • Default Value: 0.18 (Standard)
  • Range: 0.10 - 2.50
  • Effect of Increasing: Sharper, more precise yaw response. Better "locking" of the heading in wind.
  • Effect of Decreasing: Smoother, more cinematic turns. Less stress on the motor bearings.

Use Case Recommendations

  • Professional Video (Smooth Pans): Decrease to 0.12 - 0.15. Creates very graceful, slow yaw movements that look great on camera.
  • Yaw-Heavy Freestyle (Yaw Spins): Increase to 0.5 - 1.0. Needed to stop extreme rotations instantly and provide the "locked" feel during technical maneuvers.
  • Tricopters: Rely on specific tuning. Tricopters use a servo for yaw, which provides much higher authority than torque reaction. Their ATC_RAT_YAW_P values are usually much lower.

Troubleshooting

  • Scenario: The drone's tail constantly "wags" left and right about 2-3 times per second during a hover.
    • Diagnosis: ATC_RAT_YAW_P is too high.
    • Fix: Reduce ATC_RAT_YAW_P by 0.05.

ATC_RAT_YAW_PDMX

Default 0
Range 0 1.0

Yaw Axis Rate PD Maximum (ATC_RAT_YAW_PDMX)

Description

ATC_RAT_YAW_PDMX is a safety governor for your drone's tail authority.

Because yaw is generated by torque reaction, it is the most limited axis on a multirotor. If the flight controller commands a 100% yaw torque change instantly, it creates a massive "torque shock" through the frame. This can cause the drone's arms to twist and can even destabilize the Roll and Pitch loops as the lift motors are suddenly prioritized for rotation.

ATC_RAT_YAW_PDMX sets a limit on the combined power of the P and D terms. It ensures that the instantaneous heading correction requested by the software never exceeds a certain percentage of motor power, protecting the airframe and preserving lift for the other axes.

  • Low Value: Limits the tail's "snap" or ability to stop spins instantly.
  • High Value: Allows the tail to use its full motor torque for immediate corrections.
  • Disabled (0): The PD sum is unlimited (limited only by motor saturation).

The Mathematics

The P and D terms for yaw are summed and then constrained:

$$ \text{PD}\_{yaw} = \text{constrain}(P + D, -\text{PDMX}, \text{PDMX}) $$

Where:

  • $P = k\_P \cdot \omega\_{yaw\_error}$
  • $D = k\_D \cdot \frac{d}{dt}\omega\_{yaw\_error}$
  • $\text{PDMX}$ is ATC_RAT_YAW_PDMX.

Note: The Yaw Integral (I) term and Feed-Forward (FF) are added after this clamp. This ensures the tail can still hold a steady heading (via the I-term) even if the "fast" reactions are clamped.

The Engineer's View

This parameter maps to _kpdmax in the _pid_rate_yaw object.

It is applied in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_kpdmax)) {
    float pd_sum = P + D;
    pd_sum = constrain_float(pd_sum, -_kpdmax, _kpdmax);
}

Since the yaw axis is often the most prone to torsional resonance, capping the PD sum is a powerful way to "quiet down" a noisy tail without sacrificing long-term heading hold accuracy.

Tuning & Behavior

  • Default Value: 0 (Unlimited)
  • Range: 0 - 1.0 (0 to 100% motor authority)
  • Effect of Increasing: Snappier heading corrections. Better "snap" at the end of a pirouette.
  • Effect of Decreasing: Smoother tail behavior. Reduces frame twisting and motor "chirp" during yaw maneuvers.

Use Case Recommendations

  • Large Octocopter / X8: Set to 0.4. High motor counts generate massive yaw torque; capping the PD sum prevents the drone from "twisting itself apart" during aggressive heading moves.
  • Precision Aerial Panning: Set to 0.2. Ensures that any software-induced heading correction is gentle and unnoticeable to the camera.
  • Tricopters: Keep at 0. Tricopters have high mechanical authority via a servo; capping the PD sum would only increase lag in their already-complex yaw physics.

Troubleshooting

  • Scenario: Drone heading "wavers" or is slow to stop spinning, but RAT_YAW_P is already high.
    • Diagnosis: ATC_RAT_YAW_PDMX is set too low, bottlenecking the yaw authority.
    • Fix: Increase ATC_RAT_YAW_PDMX or set it to 0.

ATC_RAT_YAW_SMAX

Default 0.0
Range 0 200

Yaw Axis Rate Slew Rate Limit (ATC_RAT_YAW_SMAX)

Description

ATC_RAT_YAW_SMAX is a protective mechanism for your drone's torsional stability. A Slew Rate is a limit on how fast a command signal can change over time.

In the yaw controller, if the PID loop calculates that it needs to jump from 10% motor torque to 90% motor torque instantly (due to a violent gust or a sensor spike), the ESCs and motors will experience a massive, potentially destructive surge in current. This parameter rounds off those spikes, ensuring that the motor command always increases or decreases at a rate your hardware can safely handle.

  • Low Value: Yaw response feels extremely smooth and "damped." Motors will sound very quiet.
  • High Value: Allows the yaw authority to reach its target power as fast as possible.
  • Too High: Risk of "motor chirping" or ESC failure due to extreme current transients during fast yaw turns.
  • Disabled (0): The software does not limit the rate of change of the yaw motor command.

The Mathematics

The slew limit acts as a "speed limit" for the change in the yaw motor command ($O\_{yaw}$):

$$ |O\_{new} - O\_{prev}| \leq SMAX \cdot dt $$

If the calculated change in output exceeds $SMAX$, ArduPilot automatically reduces the P and D gains of the yaw rate loop for that specific cycle to keep the command within the limit:

$$ \text{Gain Scale Factor} = \frac{SMAX}{\text{Calculated Change}} $$

The Engineer's View

This parameter maps to _slew_rate_max in the _pid_rate_yaw object.

It is executed in AC_PID::update_all():

// AC_PID.cpp
if (is_positive(_slew_rate_max)) {
    _pid_info.slew_rate = (P + D - _last_out_pd) / dt;
    if (fabsf(_pid_info.slew_rate) > _slew_rate_max) {
        // Dynamically lower authority for this loop cycle to prevent mechanical shock
        float scale = _slew_rate_max / fabsf(_pid_info.slew_rate);
        // ... apply scaling ...
    }
}

This Dynamic Gain Reduction is especially useful for preventing "Yaw Jumps" at the end of high-speed maneuvers, where aerodynamic forces can cause large momentary rate errors.

Tuning & Behavior

  • Default Value: 0.0 (Disabled)
  • Range: 0 - 200
  • Effect of Increasing: Snappier, more immediate yaw authority. Essential for high-speed tracking.
  • Effect of Decreasing: Smoother motor response, longer motor/ESC life.

Use Case Recommendations

  • Large Prop Drones (>18 inch): Set to 50 - 80. Large arms have low torsional rigidity; limiting the slew rate prevents the arms from "twisting" and vibrating.
  • Industrial VTOL: Set to 40. Heading precision is less important than reliability and mechanical longevity.
  • FPV Freestyle: Keep at 0.0. Pilots generally prefer the absolute minimum latency in their yaw response.

Troubleshooting

  • Scenario: Drone's tail makes a "snap" or "pop" sound during sharp turns.
    • Diagnosis: High-frequency yaw transients are exceeding the frame's torsional rigidity.
    • Fix: Set ATC_RAT_YAW_SMAX to 100.

ATC_SLEW_YAW

cdeg/s
Default 6000
Range 500 18000

Yaw Target Slew Rate (ATC_SLEW_YAW)

Description

ATC_SLEW_YAW is the "comfort setting" for your drone's tail during autonomous flight. While other parameters control how fast the drone can spin, this parameter controls how fast the software wants to change the goal heading.

When a drone reaches a waypoint and needs to turn 90 degrees to head to the next one, the software calculates a new heading target. Without a slew limit, the target would "jump" instantly, causing the drone to whip its tail around violently. ATC_SLEW_YAW forces that change to be gradual, making the drone turn smoothly and predictably.

  • Low Value (e.g. 1000): The drone turns very slowly and elegantly during missions.
  • High Value (e.g. 10000): The drone snaps to its new heading as fast as possible.
  • Default (6000): 60 degrees per second. A standard, safe value for general flight.

The Mathematics

This parameter acts as a rate limiter for the heading setpoint ($\psi\_{target}$):

$$ \left| \frac{\psi\_{target}(t) - \psi\_{target}(t-dt)}{dt} \right| \leq \text{SLEW\_YAW} $$

Where:

  • $\text{SLEW\_YAW}$ is in centidegrees per second (e.g., 6000 = 60 $deg/s$).

Note: This is an input slew limit. It is independent of the output limits like ATC_RATE_Y_MAX. Even if the drone is physically capable of spinning at 200 $deg/s$, this parameter will force it to follow a 60 $deg/s$ "ramp" during autonomous moves.

The Engineer's View

This parameter is the _slew_yaw member in AC_AttitudeControl.

It is applied in AC_AttitudeControl::get_slew_yaw_max_degs():

// AC_AttitudeControl.cpp
float AC_AttitudeControl::get_slew_yaw_max_degs() const
{
    if (!is_positive(_ang_vel_yaw_max)) {
        return _slew_yaw * 0.01;
    }
    return MIN(_ang_vel_yaw_max, _slew_yaw * 0.01);
}

By capping the "Slew" at the same value as the "Max Rate," ArduPilot ensures that the path planner never requests a turn that the physical motors can't track, resulting in zero-overshoot turns during Auto missions.

Tuning & Behavior

  • Default Value: 6000 cdeg/s (60 $deg/s$)
  • Range: 500 - 18,000
  • Effect of Increasing: Faster waypoint-to-waypoint transitions. Better for high-speed missions where every second counts.
  • Effect of Decreasing: Much smoother video during auto-missions. Reduces the "jerky tail" look of autonomous flight.

Use Case Recommendations

  • Cinematography (Auto-Paths): Decrease to 1500 - 3000. Ensures the tail move is so slow that it looks like a professional motion-control rig.
  • Industrial Survey / Mapping: Keep Default (6000). Standard turns are efficient and keep the camera stabilized.
  • Package Delivery: Increase to 10000. You want the drone to spend as little time as possible turning, to maximize forward flight time and battery life.

Troubleshooting

  • Scenario: During an Auto mission, the drone starts its forward flight to the next waypoint before it has finished turning its nose, resulting in a "banana-shaped" flight path.
    • Diagnosis: ATC_SLEW_YAW is too low for the drone's mission speed.
    • Fix: Increase ATC_SLEW_YAW to 8000.

ATC_SPEED_D

Default 0.0
Range 0.0 0.4

Speed Control D Gain (ATC_SPEED_D)

Description

ATC_SPEED_D stops the rover from overshooting its target speed.

Tuning & Behavior

  • Default Value: 0.0.
  • Recommendation: Usually left at 0 for rovers. Friction provides enough natural damping.

ATC_SPEED_I

Default 0.2
Range 0.0 2.0

Speed Control I Gain (ATC_SPEED_I)

Description

ATC_SPEED_I is the "Cruise Control."

If ATC_SPEED_P isn't enough to hold the speed (e.g., going up a steep hill), the I-term slowly increases the throttle until the error is gone.

Tuning & Behavior

  • Default Value: 0.20.
  • Recommendation: Set equal to ATC_SPEED_P.

ATC_SPEED_P

Default 0.2
Range 0.01 2.0

Speed Control P Gain (ATC_SPEED_P)

Description

ATC_SPEED_P is the main "Throttle" knob.

If the rover is driving 1 m/s slower than it should be, this parameter determines how much extra throttle to apply.

  • Low Value: Sluggish acceleration. The rover struggles to reach top speed uphill.
  • High Value: Aggressive acceleration. May oscillate (surge) speed.

The Mathematics

$$ \text{Throttle} = k\_P \cdot (\text{Speed}{target} - \text{Speed}{actual}) $$

Tuning & Behavior

  • Default Value: 0.20.
  • Tuning: Increase P until the rover surges/pulses speed, then back off by 20%.

ATC_STOP_SPEED

m/s
Default 0.1
Range 0 0.5

Speed Control Stop Speed (ATC_STOP_SPEED)

Description

ATC_STOP_SPEED is the "Zero Threshold."

When the rover slows down, at some point the autopilot has to decide "Okay, we are stopped now" and cut the throttle completely.

Tuning & Behavior

  • Default Value: 0.1 m/s.
  • Recommendation: If the rover creeps or jitters at a standstill, increase this to 0.2.

ATC_STR_ACC_MAX

$deg/s^2$
Default 120
Range 0 1000

Steering Control Angular Acceleration Maximum (ATC_STR_ACC_MAX)

Description

ATC_STR_ACC_MAX controls the "jerkiness" of the steering. It limits how fast the turn rate can change.

  • Low Value: The steering wheel turns slowly. The rover eases into turns.
  • High Value: The steering snaps to the desired angle.

Tuning & Behavior

  • Default Value: 120 $deg/s^2$.
  • Recommendation:
    • Cars: Set to 180-360 to ensure the servo moves fast enough to catch slides.
    • Large Tanks: Set lower (e.g. 60) to prevent current spikes when reversing the motors for a pivot turn.

ATC_STR_RAT_MAX

deg/s
Default 120
Range 0 1000

Steering Control Rotation Rate Maximum (ATC_STR_RAT_MAX)

Description

ATC_STR_RAT_MAX limits how fast your rover turns.

It acts as a speed governor for the yaw axis. Even if the navigation controller demands a sharp 90-degree turn, the steering controller will not command a rotation rate higher than this value.

  • Low Value (e.g. 60): The rover turns slowly and gracefully. Good for large, top-heavy vehicles to prevent rollovers.
  • High Value (e.g. 360): The rover turns instantly. Good for small, skid-steering bots.

The Mathematics

The desired turn rate $\omega\_{target}$ is constrained:
$$ \omega\_{target} = \text{constrain}(\omega\_{requested}, -\text{ATC\_STR\_RAT\_MAX}, \text{ATC\_STR\_RAT\_MAX}) $$

The Engineer's View

Defined in AR_AttitudeControl.cpp.
Used in get_steering_out_rate().
This limit is applied after the lateral acceleration limit (ATC_TURN_MAX_G). If the G-force limit allows a turn rate of 200 $deg/s$, but ATC_STR_RAT_MAX is 100 $deg/s$, the turn rate will be capped at 100 $deg/s$.

Tuning & Behavior

  • Default Value: 120 $deg/s$.
  • Recommendation:
    • Ackermann Steering (Car): Set to match the physical turning circle speed (usually 60-90 $deg/s$).
    • Skid Steering (Tank): Set to 180-360 $deg/s$ for snappy pivots.

ATC_THR_G_BOOST

Default 0.0
Range 0 1.0

Throttle-Gain Boost (ATC_THR_G_BOOST)

Description

ATC_THR_G_BOOST is a dynamic "authority booster" for high-performance flight.

Drones are most unstable when their motor speeds are changing rapidly—specifically during a sudden vertical "punch" (full throttle) or a rapid descent (low throttle). During these transients, the aerodynamics around the propellers are chaotic, and the drone needs extra "stiffness" to keep from wobbling.

ATC_THR_G_BOOST monitors how fast your throttle is changing and automatically "turns up the volume" on your Roll and Pitch PID gains for a few milliseconds to ensure the drone stays perfectly level through the shock.

  • Set to 0 (Default): No boosting is applied. Gains stay constant.
  • Set to 1.0: The drone will double its attitude authority during rapid throttle movements.

The Mathematics

The controller calculates the Throttle Slew Rate (how fast the PWM is changing). If the slew rate exceeds a threshold, the attitude gains are scaled:

$$ \text{Boost\_Scale} = 1.0 + (\text{ATC\_THR\_G\_BOOST} \cdot \text{Normalized\_Slew}) $$

Effect: If you have ATC_THR_G_BOOST set to 1.0 and you slam the throttle to 100%, your ATC_RAT_RLL_P and ATC_ANG_RLL_P might temporarily double in value to "lock" the drone's orientation during the acceleration.

The Engineer's View

This parameter is the _throttle_gain_boost member in AC_AttitudeControl_Multi.

It is applied in AC_AttitudeControl_Multi::update_throttle_gain_boost():

// AC_AttitudeControl_Multi.cpp
if (_motors.get_throttle_slew_rate() > AC_ATTITUDE_CONTROL_THR_G_BOOST_THRESH) {
    const float pd_boost = constrain_float(_throttle_gain_boost + 1.0f, 1.0, 2.0);
    set_PD_scale_mult(Vector3f(pd_boost, pd_boost, 1.0f));

    const float angle_p_boost = constrain_float((_throttle_gain_boost + 1.0f) * (_throttle_gain_boost + 1.0f), 1.0, 4.0);
    set_angle_P_scale_mult(Vector3f(angle_p_boost, angle_p_boost, 1.0f));
}

Notice the Quadratic Scaling on the Angle P-gain (angle_p_boost). This is designed to provide massive "restoring force" during vertical maneuvers, keeping the drone perfectly flat even when the air is extremely turbulent.

Tuning & Behavior

  • Default Value: 0.0 (Disabled)
  • Range: 0.0 - 1.0
  • Effect of Increasing: Much more stable "vertical punches." Reduced "nose-dipping" during rapid acceleration.
  • Effect of Decreasing: Smoother, more natural power transitions. Lower risk of high-frequency "chirping" during aggressive flight.

Use Case Recommendations

  • FPV Racing / Freestyle: Set to 0.5 - 1.0. Essential for maintaining attitude precision during rapid directional changes and "split-S" maneuvers.
  • Heavy Lift Multirotors: Set to 0.2. Large drones have sluggish motor response; a small boost helps them "dig in" when the pilot requests more power.
  • Cinematography: Keep at 0.0. You want the drone to be smooth; sudden gain increases can cause tiny visible twitches in the video.

Troubleshooting

  • Scenario: Drone "oscillates" or vibrates specifically during the first 0.5 seconds of a full-throttle climb.
    • Diagnosis: ATC_THR_G_BOOST is set too high, pushing the gains past the point of stability during the power-up.
    • Fix: Reduce ATC_THR_G_BOOST to 0.25 or 0.0.

ATC_THR_MIX_MAN

Default 0.1
Range 0.1 0.9

Throttle Mix Manual (ATC_THR_MIX_MAN)

Description

ATC_THR_MIX_MAN is the manual counterpart to ATC_THR_MIX_MAX. It defines how much authority the drone's stabilization loops have when you are flying in "Old School" manual modes like Stabilize or Acro.

In manual modes, the pilot is in direct control of the throttle. If you push the stick to 100%, you expect 100% power. However, the drone still needs to stay level. ATC_THR_MIX_MAN determines how much the drone should "ignore" your 100% throttle request to ensure it doesn't flip over.

  • Low Value (0.1): The drone prioritizes Pilot Intent. If you push 100% throttle, you get almost 100% throttle. This makes the drone feel extremely powerful, but it may "wash out" (lose control) during full-throttle climbs.
  • High Value (0.5+): The drone prioritizes Stability. It will automatically lower your effective throttle to ensure it has enough motor range to keep the attitude perfectly locked.

The Mathematics

The Mixing Ratio ($M$) for manual modes is directly set by this parameter:

$$ \text{Effective\_Throttle} = \text{constrain}(\text{Pilot\_Throttle}, \text{Min}, \text{Max} - \text{M} \cdot \text{Headroom}) $$

Physical Meaning: A value of 0.5 means that even if you hold full throttle, the drone will reduce its average lift by 50% if that's what it takes to stop it from tilting or tumbling.

The Engineer's View

This parameter is the _thr_mix_man member in AC_AttitudeControl_Multi.

It is particularly important for high-power-to-weight vehicles (like 5-inch racing quads). On these vehicles, the motors are so powerful that even a 10% torque difference can create a massive roll rate. If ATC_THR_MIX_MAN is too low, the drone will "torque roll" (unintentionally tilt) when you floor the throttle.

Tuning & Behavior

  • Default Value: 0.1 (10% reservation)
  • Range: 0.1 - 0.9
  • Effect of Increasing: Much more stable full-throttle climbs. Drone feels more "locked" during punch-outs.
  • Effect of Decreasing: Maximum vertical power. Drone feels "raw" and "unfiltered."

Use Case Recommendations

  • Racing Drone (Standard Setup): Increase to 0.5. Provides the best balance between speed and control during high-speed gate navigation.
  • FPV Freestyle: Keep at 0.1. Freestyle pilots often use "Air Mode" (which handles mixing differently) and prefer the raw power of the motors for maneuvers like "Matty Flips."
  • Heavy Cargo Drone (Manual Recovery): Increase to 0.5. If you ever have to switch to manual to save a heavy drone, you want it to prioritize staying level above all else.

Troubleshooting

  • Scenario: In Stabilize mode, if I punch the throttle, the drone "climbs" but also tilts violently to the right.
    • Diagnosis: Torque Roll. The motors on the left can't spin any faster to correct the roll because they are already at 100%.
    • Fix: Increase ATC_THR_MIX_MAN to 0.5.
  • Scenario: My drone feels "weak" in manual mode, even at 100% throttle.
    • Diagnosis: ATC_THR_MIX_MAN is too high, and the drone is excessively reserving power for stability.
    • Fix: Reduce ATC_THR_MIX_MAN to 0.2.

ATC_THR_MIX_MAX

Default 0.5
Range 0.5 0.9

Throttle Mix Maximum (ATC_THR_MIX_MAX)

Description

ATC_THR_MIX_MAX handles the most dangerous moment for a flight controller: Motor Saturation.

If you punch the throttle to 100% to avoid an obstacle, all your motors spin up to their absolute limit. At that moment, the drone has no "extra" power left to roll or pitch. If a gust of wind hits it, the drone will tilt over and crash because the motors can't spin any faster to correct the attitude.

ATC_THR_MIX_MAX solves this by forcing the drone to "sacrifice" some vertical lift to save its attitude. It caps the priority of throttle, ensuring that a certain percentage of motor power is always reserved for staying level, even if that means the drone doesn't climb as fast as you asked.

  • Low Value (0.5): Very safe. The drone will always keep 50% of its motor range available for attitude control. It will never flip over at full throttle, but its "vertical punch" will feel weak.
  • High Value (0.9): Maximum performance. The drone uses 90% of its power for climbing. It will have a massive vertical "pop," but it is at high risk of losing attitude control (and crashing) during that climb.

The Mathematics

The controller calculates how much "headroom" is needed for the RPY (Roll/Pitch/Yaw) loops. ATC_THR_MIX_MAX sets the upper limit for this priority:

$$ \text{Headroom\_Reserved} = \text{MixRatio} \cdot \text{Max\_Authority} $$

Physical Meaning: If ATC_THR_MIX_MAX is 0.5, and you are at 100% throttle, the flight controller will actually reduce the average throttle of all motors to 50% to give the Roll and Pitch loops the room they need to increase/decrease individual motor speeds.

The Engineer's View

This parameter is the _thr_mix_max member in AC_AttitudeControl_Multi.

It is enforced in the motor mixer:

// AC_AttitudeControl_Multi.cpp
_throttle_rpy_mix_desired = (1.0f - ratio) * _thr_mix_min + ratio * _thr_mix_max;

This is the reason why ArduPilot drones sometimes sound like they are "stuttering" or reducing power when you do a high-speed maneuver—the software is dynamically lowering the throttle to ensure it can still meet the roll/pitch torque requirements.

Tuning & Behavior

  • Default Value: 0.5 (50% headroom)
  • Range: 0.5 - 0.9
  • Effect of Increasing: Much faster vertical acceleration. The drone "rockets" up.
  • Effect of Decreasing: Maximum stability. The drone will never lose its level orientation, regardless of how hard you push it.

Use Case Recommendations

  • Standard Multirotor: Keep Default (0.5). 50% is a very safe value that prevents "washout" in turns.
  • Racing Drone: Increase to 0.7 - 0.8. Needed for that "snappy" vertical authority, but requires a very rigid frame and perfectly balanced props.
  • Heavy Lift / Expensive Payload: Decrease to 0.45. Never sacrifice the safety of the payload for a faster climb rate.

Troubleshooting

  • Scenario: When I do a 100% throttle "punch out," the drone starts to tilt or "tumble" to one side.
    • Diagnosis: Throttle Saturation. The motors are at 100%, and there isn't enough headroom left for the attitude controller to stay level.
    • Fix: Reduce ATC_THR_MIX_MAX to 0.5 or 0.45.

ATC_THR_MIX_MIN

Default 0.1
Range 0.1 0.25

Throttle Mix Minimum (ATC_THR_MIX_MIN)

Description

ATC_THR_MIX_MIN is a "priority setting" for your drone's motors. It handles the difficult moment of Landing.

When you land a drone, you pull the throttle stick to zero. If the drone is tilted slightly as it touches the ground, the flight controller will try to level it by spinning up some motors. However, if the motors spin up too hard while the drone is on the ground, it can create a "bounce" or "ground resonance" that makes the drone flip over.

ATC_THR_MIX_MIN limits how much "authority" the attitude controller has to overrule your low throttle command.

  • Low Value (0.1): The drone prioritizes your throttle command. If you pull the stick to zero, the motors will stay very low, even if the drone is tilted. This makes for safer, "stickier" landings.
  • High Value (0.25): The drone prioritizes staying level. Even at zero throttle, it will spin the motors aggressively to stay flat. This can cause the drone to bounce back into the air during a touchdown.

The Mathematics

The motor mixer calculates a priority ratio ($R$) between attitude correction and vertical lift. ATC_THR_MIX_MIN sets the lower bound of this ratio:

$$ \text{MixRatio} = \text{constrain}(\text{Current\_Priority}, \text{THR\_MIX\_MIN}, \text{THR\_MIX\_MAX}) $$

Effect: If the drone is landing and the Calculated Priority is 0.05, it will be "boosted" to 0.1 (the minimum). This ensures that at least 10% of the motor authority is always reserved for leveling the drone, regardless of how low the throttle is.

The Engineer's View

This parameter is the _thr_mix_min member in AC_AttitudeControl_Multi.

It is used in AC_AttitudeControl_Multi::update_throttle_rpy_mix():

// AC_AttitudeControl_Multi.cpp
_throttle_rpy_mix = (1.0f - ratio) * _thr_mix_min + ratio * _thr_mix_max;

This dynamic mixing allows the drone to smoothly transition from "High Control" during flight to "Low Authority" during landing, preventing the feedback loops that cause "Ground Wobble."

Tuning & Behavior

  • Default Value: 0.1 (10% Authority)
  • Range: 0.1 - 0.25
  • Effect of Increasing: The drone fights harder to stay level during landing. Safer for landing in high wind on a slope.
  • Effect of Decreasing: The drone is more likely to stay on the ground once it touches down. Reduces "bouncing."

Use Case Recommendations

  • Top-Heavy Drones: Increase to 0.15. Drones with high centers of gravity (e.g., those with tall antennas or top-mounted batteries) are unstable on the ground and need more authority to stay upright during touchdown.
  • Underpowered Drones: Keep at 0.1. You want the motors to stop as soon as possible to prevent a tip-over.
  • Autonomous Landing (RTL): Keep Default. 0.1 is the most tested value for reliable auto-landings.

Troubleshooting

  • Scenario: Every time I land, the drone touches the ground and then "jumps" back up 20cm before finally disarming.
    • Diagnosis: ATC_THR_MIX_MIN is too high. The drone is over-correcting for the impact and "powering" itself back into the air.
    • Fix: Reduce ATC_THR_MIX_MIN to 0.1.

ATC_TURN_MAX_G

gravities
Default 0.6
Range 0.1 10.0

Turning maximum G force (ATC_TURN_MAX_G)

Description

ATC_TURN_MAX_G is the "Anti-Rollover" setting for rovers and boats.

When a vehicle turns at high speed, centrifugal force pushes it sideways. If this force is too high, a car might flip over, or a boat might slide (drift) uncontrollably. This parameter caps that force. If the rover is driving fast, the autopilot will automatically widen its turns to ensure the lateral force never exceeds this limit.

  • Low Value (e.g. 0.3): Safe, slow turns. Good for top-heavy trucks or tractors.
  • High Value (e.g. 1.5): Aggressive, sharp turns. Good for low-slung racing cars with high-grip tires.

The Mathematics

The maximum turn rate ($\omega\_{max}$) is calculated from the current speed ($V$) and the G-limit ($A\_{max\_g}$):

$$ \omega\_{max} = \frac{A\_{max\_g} \cdot g}{V} $$

As speed $V$ increases, the allowed turn rate $\omega$ must decrease to stay under the G-limit.

Tuning & Behavior

  • Default Value: 0.6 G.
  • Recommendation:
    • Ackermann Car: Set to the point where the tires just start to squeal or the car feels "tippy."
    • Boat: Set to 0.3-0.5 to prevent massive heel angles.
    • Skid-Steer: Usually set high (1.0+) as they are typically low-profile and stable.