Gyro filtering

Also known as: gyro filter

On this page 7

Gyro filtering is the digital signal processing applied to gyroscope data inside a drone’s flight controller so that the stabilization loop responds to the aircraft’s real rotation rather than to vibration noise from motors, propellers and the frame. In flight control for Drones, it is one of the most influential settings after PID tuning, because every correction the controller makes starts from the filtered gyro signal.

The challenge is a trade-off between noise and delay. Strong filtering produces a clean signal but adds latency, which makes the aircraft feel sluggish and can trigger oscillation; weak filtering keeps the response sharp but lets noise reach the motors as heat, buzzing and shaky video.

Why a drone gyroscope signal needs filtering

A MEMS gyroscope measures angular velocity on three axes, but it cannot tell a deliberate roll from a high-frequency shake. Spinning motors, slightly unbalanced propellers and flexing arms produce vibration in the range of roughly 100 to 600 Hz on a typical 5-inch FPV quadcopter, and that energy appears in the gyro trace as noise superimposed on the true motion.

If the noise passes unfiltered into the PID controller, the derivative term amplifies it most, because D reacts to the rate of change and noise changes very quickly. The result is motors receiving rapid, meaningless corrections. The table summarizes the main noise sources and where they appear in the spectrum.

Noise sourceTypical frequencyBehavior
Motor rotation100-600 Hz, rising with throttleNarrow peaks that move with motor RPM
Motor harmonicsTwo or three times the base frequencyWeaker peaks above the fundamental
Frame resonanceAbout 80-250 Hz depending on stiffnessFixed peak excited at certain throttle levels
Propwash turbulenceRoughly 20-100 HzBroadband disturbance during descents and turns
Electrical noiseVariable, often widebandCaused by poor wiring or power filtering
Typical noise sources in a multirotor gyro signal

Propwash disturbance overlaps the frequency band of genuine control, so filters cannot remove it without harming responsiveness. Gyro filtering therefore targets mainly the higher, narrower peaks caused by motors and the frame.

Filter types used in flight controllers

Modern flight controller firmware such as Betaflight and INAV combines several filter types in a chain, each designed for a different kind of noise. Static filters use fixed cutoff frequencies, while dynamic filters move their frequency in real time based on throttle, spectral analysis or motor telemetry.

Filter typeWhat it doesMain cost
PT1 low-passFirst-order smoothing above a cutoff frequencyGentle slope, modest delay
PT2 and PT3 low-passHigher-order smoothing with steeper attenuationMore delay than PT1 at the same cutoff
Biquad low-passSecond-order filter with sharp roll-offCan overshoot and adds phase delay
Static notchRemoves a narrow band at a fixed frequencyOnly useful for a stable resonance
Dynamic notchTracks noise peaks found by FFT analysisSmall processing load, lag in tracking
RPM filterNotches placed exactly at motor frequencies from telemetryRequires bidirectional DShot ESCs
Common gyro filter types and their roles

A low-pass filter attenuates everything above its cutoff, so it treats wanted and unwanted high-frequency content alike. A notch filter cuts only a narrow band, which makes it far more selective; this is why the RPM filter, which knows each motor’s exact speed, allows pilots to relax low-pass filtering considerably and regain responsiveness.

The latency trade-off in gyro filtering

Every filter introduces phase delay: the filtered signal lags behind the real motion. At the gyro update rate of a modern controller, often 8 kHz with a 4 or 8 kHz PID loop, a single millisecond of extra delay already reduces how aggressively the PID gains can be set before the aircraft starts to oscillate.

Lowering a low-pass cutoff by half roughly doubles its delay at control frequencies, which is why cutoff selection matters more than filter count. The following table shows how filter strength typically affects flight behavior.

Filter settingSignal qualityFlight feelTypical risk
Too lightNoisy, motor peaks visibleVery sharpHot motors, jello in video, ESC damage
BalancedPeaks removed, low-frequency motion intactCrisp and locked inRequires blackbox verification
Too heavyVery smooth traceSoft, delayed, bouncyLow-frequency oscillation, poor propwash handling
Effect of filter strength on flight behavior

Experienced tuners treat the filter stack and PID gains as one system. Removing unnecessary filtering lets the D term act faster against propwash oscillation, but only if the airframe is mechanically clean enough to tolerate the extra noise.

How to tune gyro filters in practice

The reliable method is measurement first, adjustment second. Pilots record a flight with blackbox logging, then inspect the gyro spectrum in a log viewer to see where noise peaks sit and how they move with throttle. Only after that do they change filter settings, ideally one parameter at a time.

ObservationRecommended actionReason
Peaks follow motor RPMEnable RPM filter, raise low-pass cutoffsSelective notches replace broad smoothing
Fixed peak at one frequencyUse dynamic or static notch near that frequencyTargets frame resonance precisely
Broad noise across the spectrumCheck hardware before adding filtersLoose parts and bent props cause wideband noise
Clean trace, sluggish feelReduce filtering gradually, recheck motor temperatureExcess delay limits PID performance
Decision guide for common filtering situations

Hardware fixes come before software. Balanced propellers, tight screws, soft-mounted flight controllers and healthy motor bearings often remove more noise than any filter, and they do so without adding latency.

Common mistakes with gyro filtering

Many filtering problems come from copying settings between different aircraft. A setting that suits a stiff 5-inch freestyle frame may overheat the motors of a flexible 7-inch long-range build. Frequent errors include:

  • Disabling filters entirely to chase responsiveness, which can burn motors within a single flight.
  • Stacking several low-pass filters with low cutoffs, multiplying delay without noticeable benefit.
  • Enabling the RPM filter without confirming that bidirectional DShot telemetry works on every motor.
  • Judging the result by feel alone instead of checking motor temperature and blackbox traces.

Gyro filtering is also distinct from accelerometer filtering and AHRS fusion, which estimate attitude for self-leveling modes. Gyro filters affect the rate loop used in every mode, including acro mode.

A non-technical view

A drone constantly measures how it is turning so it can stay steady. The problem is that its motors shake the whole aircraft, and the sensor feels that shaking too. Gyro filtering is the software that separates real movement from vibration.

Imagine trying to hear a friend in a noisy café. Your brain ignores the clatter of dishes and focuses on the voice. Filters do the same for the drone. The catch is that too much filtering makes the drone react late, like a listener who waits too long before answering, so the goal is just enough cleaning and no more.

A concrete example

An FPV pilot builds a new 5-inch freestyle quadcopter and flies it with default filter settings. After two minutes the motors come down noticeably warm and the video shows faint jello during fast climbs. A blackbox log reveals a strong noise peak that rises from about 200 Hz at hover to 450 Hz at full throttle, clearly tied to motor speed.

The pilot enables bidirectional DShot and the RPM filter, then raises the gyro low-pass cutoff and reduces the dynamic notch count. A second log shows the motor peaks almost gone, and motor temperature after the same flight drops to barely warm. Because less low-pass filtering is now needed, the pilot can raise the D gain slightly, which visibly reduces propwash wobble when diving through a gap between two trees.