[PX4 Tuning Series 2] Catching Hidden Vibrations and Filter Tuning: Finding the Perfect Compromise Between Control Latency and Noise

Hello again to all university students, graduate students, and researchers dedicating yourselves to the study of autonomous drones and aerospace engineering!

In our previous [Series 1], we covered the essential hardware preparation steps, such as using high-quality frames and moving motor wires to the AUX pins to physically minimize control latency. We also activated the high-rate logging profile (SDLOG_PROFILE) to ensure we have high-resolution data for precise analysis.

Today, we transition fully into the software realm and dive into ‘Filter Tuning’, which takes place inside the drone’s brain, the Flight Controller (FC). No matter how rigidly you assemble your hardware, high-speed spinning motors and propellers will inevitably generate microscopic vibrations (noise). If this noise enters the controller through the IMU (Inertial Measurement Unit) sensors, the motors will twitch randomly, overheat, and in severe cases, cause the vehicle to crash.

So, why not just filter out all the noise? Unfortunately, there is a critical trade-off: trading off increased control latency for improved noise filtering. The stronger you apply the filters, the larger the phase delay becomes, drastically degrading flight performance. In this post, we will kindly guide you through analyzing actual flight logs to find the “perfect compromise” that eliminates noise while keeping control latency to an absolute minimum.


1. Essential Preparation Before Tuning: ‘Undertuning’ and the Test Flight

Before you even touch a filter parameter, you must perform a first pass at basic PID tuning by intentionally setting the P and D gains too low, a process known as undertuning. If the controller’s P or D gains are set too high, the controller itself might cause oscillations that can easily be misinterpreted as mechanical noise in the logs. If the default gains are already low enough to prevent these oscillations, you may proceed with them.

1-1. The 30-Second Test Flight for Data Collection

To analyze the logs, we need to collect the right flight data. The test flight should be conducted following these steps:

  1. Safe Mode Flight: Take off and hover in Stabilized mode or Altitude mode.
  2. Disturbance Input: Induce a fast step-input by quickly pushing the roll and pitch sticks in all directions and letting them spring back.
  3. Throttle Variations: Temporarily increase the throttle to observe how the vibrations change as the motor RPM changes.
  4. Keep it Short: The total duration of this maneuver does not need to be more than 30 seconds. When testing different filter parameters, make sure to land and disarm in between so that separate log files are created for each setup.

Looking at a real-world flight test conducted by the domestic research team ‘QUAD Drone Lab’, we can see them carefully collecting roll and pitch data while performing both straight-line and circular flights.

재생

2. Log Analysis: Discovering the Invisible Vibrations

Once the flight is complete, extract the .ulg log file from the FC’s Micro SD card and upload it to the Flight Review website. The most important graph we need to inspect here is the ‘Actuator Controls FFT’ (Fast Fourier Transform) plot.

Let’s refer back to the ‘QUAD Drone Lab’ case. When the researchers manually flew their quadcopter, the vehicle hovered extremely stably to the naked eye, and the RC control feel was reported to be exceptionally smooth. However, upon analyzing the post-flight logs, a surprising result emerged: a powerful vibration spike in the 60~80Hz range was continuously feeding into the IMU sensors, completely invisible to the pilot. This specific noise band typically originates from the propellers or motors.

If you spot this kind of log, do not try to fix a vehicle that suffers from high vibrations with filter tuning alone! Instead, fix the vehicle hardware setup first, such as tightening the structural gaps in the frame near the motor mounts, just as the QUAD Drone Lab team did. Once the hardware is as solid as possible, it is time to use software filters to shave off the residual micro-noise.


3. Low-pass Filter Tuning Guide

A low-pass filter (LPF) allows frequencies lower than a set cutoff frequency (the actual movement of the vehicle) to pass through, while blocking higher frequencies (the noise).

Our ultimate goal here is to increase this cutoff frequency as much as possible to reduce control latency. The default PX4 settings are set very conservatively (low) so they can work safely on lower-quality setups. Therefore, optimizing this value is mandatory to unlock the full performance of a research drone.

Look at how drastically the latency decreases as you raise the IMU_GYRO_CUTOFF parameter:

  • 30Hz (Default): Approx. 8.0ms delay
  • 60Hz: Approx. 3.8ms delay
  • 120Hz: Approx. 1.9ms delay

However, if you raise the frequency too high, noise will bleed into the motors, causing them to twitch randomly, overheat, and reduce your overall flight time. Thus, you must tune it carefully following these steps:

3-1. Gyro Filter (IMU_GYRO_CUTOFF) Tuning Procedure

  1. First, keep the D-term filter (IMU_DGYRO_CUTOFF) anchored at a safe, low value of 30Hz.
  2. Carefully increase the IMU_GYRO_CUTOFF value from the default 30Hz in steps of 10Hz (or start around 100Hz if the vehicle is well-built and not too large).
  3. Perform a short test flight, then check the FFT plot in the log.
  4. Set the cutoff frequency to the highest value possible just before the general noise level starts to increase noticeably (typically around and above 60Hz).

3-2. D-term Filter (IMU_DGYRO_CUTOFF) Tuning Procedure

The D-term (Derivative) of the PID controller is the most susceptible to noise because it inherently amplifies it. For this reason, PX4 provides a separately configurable low-pass filter for the D-term. Once your Gyro filter is set, apply the same method to increase the IMU_DGYRO_CUTOFF value while comparing the FFT plots.

  • Example: If you tested at 40Hz, 70Hz, and 90Hz, and found that the general noise level (especially for roll) starts to spike at 90Hz, then 70Hz would be your confirmed safe setting.
  • Warning: There can be negative impacts on flight performance if IMU_GYRO_CUTOFF and IMU_DGYRO_CUTOFF are set too far apart (e.g., Gyro=80, D=15), so maintain a reasonable balance between the two.

4. Applying Notch Filters: The Precision Noise Sniper

While a Low-pass Filter (LPF) shaves off ‘everything above’ a certain frequency, a Notch Filter is designed to precision-strike and filter out narrow band noise, just like the 60~80Hz spike discovered in the ‘QUAD Drone Lab’ flight test.

Without a notch filter, you would be forced to drastically lower the low-pass filter’s cutoff frequency just to block that single sharp spike, which would horrifically increase the phase lag for the entire system.

4-1. Static Notch Filter Configuration Example

If you see a significant, narrow lower-frequency noise spike in your flight log’s FFT plot, you can configure up to two static notch filters. For example, to eliminate a noise spike with a center frequency of 70Hz and a bandwidth of 20Hz (covering the 60~80Hz range), set the parameters in QGroundControl as follows:

Bash
# Example: Configuring the first static notch filter
IMU_GYRO_NF0_FRQ = 70   # Center frequency to strike (Hz)
IMU_GYRO_NF0_BW = 20    # Bandwidth to cover (Hz)

These notch filters operate independently from the low-pass filters, meaning you can tune them in any order without having to set one before collecting data for the other.

4-2. Dynamic Notch Filters

Advanced researchers know that as the motor RPM changes during flight, the vibration frequencies shift along with it. PX4 provides a Dynamic Notch Filter feature that tracks and eliminates these shifting frequencies in real-time by utilizing ESC RPM telemetry feedback (like DShot) or an onboard FFT analysis. To enable this, set the IMU_GYRO_DNF_EN parameter (0 for ESC RPM, 1 for Onboard FFT).


5. Additional Tips and Precautions

  • Compromises based on Vehicle Size: Acceptable latency depends on your vehicle size and expectations. FPV racers typically tune for absolute minimal latency (pushing IMU_GYRO_CUTOFF to around 120Hz), whereas larger camera drones or heavy research vehicles are less critical of latency, making a gyro cutoff around 80Hz perfectly acceptable.
  • Mandatory Motor Temperature Checks: While you are pushing the cutoff frequencies higher during tuning, you must limit your flights to no more than 20-30 seconds. After landing, physically touch the motors to verify they are not getting too hot and listen for any odd sounds indicative of excessive noise.

Conclusion

Excellent work! Today, we successfully analyzed flight logs to hunt down hidden noise and performed critical filter tuning to block that noise from reaching the motors while maintaining minimal control latency. With both hardware checks and filter tuning now complete, your drone is physically optimized to react instantaneously to the controller’s commands without any vibratory interference.

All that is left is to apply a brilliant flight algorithm to this outstanding hardware. In our next post, [Series 3: Manual PID Tuning for Beginners (Manual/Basic PID Tuning)], we will explore the comprehensive PID tuning techniques using QGroundControl, starting from the innermost Rate controller up to the Attitude controller, ensuring absolute control over your vehicle.

If you ever felt lost staring at flight logs in your lab, we hope this guide provided a clear path forward. See you in the next series!


YouTube Tutorial

재생

Author: maponarooo, CEO of QUAD Drone Lab

Date: March 6, 2026

Similar Posts

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다