ArduPilot Harmonic Notch Filter Setup with FFT Analysis
ardupilotharmonic-notchffttuningvibration

ArduPilot Harmonic Notch Filter Setup with FFT Analysis

LogHat Engineering TeamJune 9, 20268 min read

Key Takeaway

The ArduPilot harmonic notch (INS_HNTCH_*) cuts motor-frequency noise from the gyro signal. Three modes: throttle (1), ESC telemetry (3), in-flight FFT (4 — F7/H7 only). Setup: enable INS_LOG_BAT_OPT=4 + INS_LOG_BAT_MASK=1, take a 30-second hover log, read the dominant peak in Mission Planner's FFT review, set INS_HNTCH_FREQ and INS_HNTCH_BW = freq/2, choose mode. Required for tight tuning.

TL;DR: The ArduPilot harmonic notch filter (INS_HNTCH_* parameter family) cuts motor-frequency noise from the gyro signal before it reaches the rate controller. Three modes drive the notch centre frequency: throttle-based (mode 1), ESC telemetry (mode 3), and in-flight FFT (mode 4 — F7/H7 only). Set up by enabling raw IMU batch sampling, taking a 30-second hover log, reading the dominant motor peak from Mission Planner’s FFT review, then configuring INS_HNTCH_FREQ, INS_HNTCH_BW, and INS_HNTCH_MODE to suppress that peak. The notch is a precondition for tight tuning; without it, AutoTune chases motor noise instead of airframe dynamics.

Why the harmonic notch matters

Motors generate vibration at their rotational frequency and harmonics. On a typical multirotor at hover, the motor frequency is between 100 and 300 Hz. The gyro samples at 1 kHz on most flight controllers, so motor frequencies are well within the gyro bandwidth — they show up as direct noise in the rate-loop measurement.

Without filtering, the rate loop amplifies that noise through the D term, producing motor whine and limiting how tightly you can tune. The harmonic notch is a narrow band-stop filter centred at the motor frequency that removes that noise without affecting the rest of the gyro signal. With the notch in place, raising ATC_RAT_RLL_D doesn’t amplify motor noise — you can get a much tighter tune.

The three notch tracking modes

  • Throttle-based (INS_HNTCH_MODE = 1) — the notch frequency scales with commanded throttle. Simple, works on any FC, but inaccurate during throttle transients. Use only if you don’t have ESC telemetry or in-flight FFT capability.
  • ESC telemetry (INS_HNTCH_MODE = 3) — the notch frequency tracks measured motor RPM from the ESC. Accurate, follows real motor speed in transients. Requires DSHOT bidirectional telemetry or a separate ESC telemetry UART.
  • In-flight FFT (INS_HNTCH_MODE = 4) — the autopilot runs a continuous FFT on the gyro signal and adjusts the notch centre to the detected peak. Most accurate; requires F7 or H7 class processor.

Pick the most accurate mode your hardware supports. Mode 4 on F7/H7, mode 3 if you have ESC telemetry, mode 1 as a fallback.

Step 1 — enable raw IMU logging for the setup flight

Before the configuration flight:

  • INS_LOG_BAT_OPT = 4 — enable pre- and post-filter batch sampling.
  • INS_LOG_BAT_MASK = 1 — sample from the first IMU.
  • INS_RAW_LOG_OPT = 9 — restrict raw logging to primary gyro pre- and post-filter (avoids overloading slower processors).

Reset INS_LOG_BAT_MASK = 0 after the analysis — the batch sampling consumes RAM continuously.

Step 2 — take a 30-second hover log

Calm conditions, no pilot input, steady hover. The autopilot needs at least 30 seconds of clean hover data for a useful FFT. Avoid aggressive manoeuvres; the FFT analyses the spectral content of motor noise, which is cleanest when the motors are running at hover RPM.

Step 3 — read the dominant peak in Mission Planner

Open Mission Planner → Setup → Advanced → FFT → IMU Batch Sample. Load the .bin log. The graph shows four spectra: ACC0 (pre-filter accelerometer), ACC1 (post-filter), GYR0 (pre-filter gyro), GYR1 (post-filter).

Look at GYR0. You’ll see one or more peaks. The dominant peak is usually motor rotational frequency at hover — commonly 150–250 Hz for typical multirotors. Note the frequency.

You may also see a smaller peak at 2x or 3x the dominant frequency — those are the harmonics. The notch can be configured to suppress them too via the INS_HNTCH_HMNCS bitmask.

Step 4 — configure the notch

Three core parameters to set:

  • INS_HNTCH_ENABLE = 1 — turn the notch on.
  • INS_HNTCH_FREQ = peak_frequency — the centre frequency from your FFT reading.
  • INS_HNTCH_BW = peak_frequency / 2 — the bandwidth of the notch. Half of the centre frequency is the conventional starting point.
  • INS_HNTCH_MODE = your chosen mode — 1, 3, or 4.

For mode 1 (throttle), you also need:

  • INS_HNTCH_REF = hover throttle — the throttle value at which the peak frequency was measured. Read from MOT_THST_HOVER if learned.

For mode 3 (ESC telem) the autopilot reads RPM from the telemetry stream — no further configuration needed.

For mode 4 (in-flight FFT), set FFT_ENABLE = 1 separately and reboot the autopilot for FFT support to come up.

Step 5 — verify the notch worked

Take another short hover log with the notch enabled. Re-open the FFT review and compare GYR0 (pre-filter) against GYR1 (post-filter). The motor frequency peak should be substantially attenuated in GYR1. If it isn’t, the notch is mis-tuned:

  • If the peak hasn’t moved at all, the notch isn’t centred correctly. Verify INS_HNTCH_FREQ.
  • If the peak is partially reduced but not eliminated, raise INS_HNTCH_ATT (notch attenuation, default 40 dB) or increase bandwidth.
  • If the peak has moved to a slightly different frequency, the motor RPM at hover changes with the new tune. Re-measure.

Harmonics — when to chase them

The dominant peak gets the notch first. If significant harmonic peaks remain (typically 2x or 3x the dominant) at frequencies above the gyro bandwidth, they can alias back into the rate loop. Configure additional notches via:

  • INS_HNTCH_HMNCS — bitmask of which harmonics to track. Bit 0 = first (dominant), bit 1 = second (2x), bit 2 = third (3x). Setting to 3 covers first and second.

Each enabled harmonic uses CPU; on slower autopilots, two is usually the limit.

Per-motor tracking with ESC telemetry

With ESC telemetry, the autopilot can track each motor’s individual frequency separately. Enable via bit 1 of INS_HNTCH_OPTS. Useful for asymmetric airframes where motors don’t all spin at the same speed.

Fast sampling on small frames

For very small frames where motor frequencies are at or near the 1 kHz gyro sample limit (Nyquist), enable fast sampling with INS_FAST_SAMPLE = 1 or higher. Without it, motor frequencies above 500 Hz alias down to false frequencies the notch can’t track. F7 and H7 autopilots have the CPU headroom for this.

Common mistakes

  • Configuring a notch before fixing mechanical vibration. The notch handles motor-rotation noise; it can’t mask the wideband noise from bad bearings or unbalanced props. Fix mechanical first — see our VIBE post.
  • Using throttle mode when ESC telem is available. Mode 3 is significantly more accurate during throttle transients; if you have the wiring, use it.
  • Setting bandwidth too narrow. A narrow notch attenuates more at the centre but misses the frequency when it drifts; half the centre frequency is a robust starting point.
  • Forgetting to re-tune after enabling the notch. Once the notch is in place, AutoTune can produce a much tighter tune — usually higher ATC_ANG_RLL_P than before. Re-run AutoTune to capture the available authority.

When LogHat helps — and when it doesn’t

LogHat plots the FFT of pre- and post-filter gyro data automatically when raw IMU sampling is logged, flags the dominant peak frequency, and surfaces the active INS_HNTCH_* parameters at takeoff. What we can’t do is reboot your autopilot for the FFT-mode setup — that’s a Mission Planner workflow.

About the author

LE

LogHat Engineering Team

The LogHat engineering team — drone-systems engineers who build and operate the LogHat flight analytics platform. Posts in this byline are written and reviewed by team members working on the parsers, analysis engine, and Vector AI that the post describes.

Tagged

ardupilotharmonic-notchffttuningvibration

Try LogHat

Analyze your flight logs in seconds

Upload a .bin, .tlog, .log, or .ulg file. Get AI crash analysis, 3D replay, and forensic PDF reports instantly.

Try LogHat Free