Tuning a drone in Betaflight requires a methodical workflow: clean up signal noise using Bidirectional DShot & RPM Filters, refine residual noise with Dynamic Notch Filters, and then increase performance via PID Tuning.

Phase 1: Enable Bidirectional DShot & RPM Filtering

RPM filtering tracks the exact speed of each motor in real-time and applies narrow notch filters directly at motor-generated noise frequencies.

Prerequisites

Betaflight Setup Steps

  1. Navigate to the Motors tab.
  2. Set your ESC/Motor Protocol:
    • DShot300 for 4 kHz PID Loop Frequency (Recommended for F4 FCs to maintain CPU load $<40\%$).
    • DShot600 for 8 kHz PID Loop Frequency (Used on F7/H7 FCs).
  3. Enable the Bidirectional DShot toggle switch.
  4. Set Motor Poles to match your motors:
    • 14 poles for standard 5-inch motors (22xx, 23xx, 2207, etc.).
    • 12 poles for smaller micro/cinewhoop motors (14xx, 12xx, 11xx).
  5. Click Save and Reboot.
  6. Verify Operation: Return to the Motors tab, plug in a LiPo battery (with props OFF), and slowly raise the master throttle slider. The E-Error % value next to each motor must read 0%. If errors appear, drop your protocol from DShot600 to DShot300.

Phase 2: Dynamic Notch Filters Setup

With RPM filtering active, the Dynamic Notch filter handles residual frame resonances and non-motor harmonics.

  1. Go to the PID Tuning tab $\rightarrow$ Filter Settings sub-tab.
  2. Under Gyro RPM Filter:
    • Verify it is Enabled (it auto-enables once Bidirectional DShot is toggled).
    • Keep Harmonics at 3 (filters 1st, 2nd, and 3rd motor harmonics).
  3. Under Dynamic Notch Filter:
    • Set Dynamic Notch Count to 1 or 2 (since RPM filtering removes the primary noise band, 1-2 dynamic notches are sufficient).
    • Set Dynamic Notch Range to LOW.
    • Set Q Factor to 200250 (higher Q creates a narrower notch, minimizing filter latency).
  4. Filter Sliders Adjustment: Because RPM filters remove noise cleanly with near-zero phase delay, push the Gyro Filter Multiplier and D-Term Filter Multiplier sliders right toward Less Filtering (e.g., 1.3x to 1.5x). Safety Check: Fly for 30 seconds after pushing filter sliders right. Land and check motor temperatures. Warm is fine; if motors are too hot to hold for 5 seconds, back the sliders back down toward 1.0x.

Phase 3: PID Tuning Procedure

Methodical Step-by-Step Tuning Workflow

[ Default PIDs ] ──► [ Push Master Slider Up ] ──► [ Tune D Gain for Propwash ] ──► [ Fine-tune Feedforward ]
  1. Set Baseline Limits: Start with Betaflight default PIDs. Leave Angle Mode turned off; perform tuning in Acro Mode.
  2. Master Multiplier Adjustment:
    • Move the Master Multiplier slider up by 0.1 increments (e.g., from 1.0 to 1.1 to 1.2).
    • Perform sharp rolls, pitch flips, and full-throttle punch-outs.
    • Listen for “chirping” or sharp oscillations at the end of maneuvers. Stop raising when oscillations occur, then step back one increment.
  3. Damping (D Gain) & Propwash:
    • Cut throttle completely during a fast descent and catch the drone near the ground to test propwash.
    • If the drone wobbles during propwash, raise the D Gain slider slightly.
    • If motor temperatures start rising significantly, lower D Gain.
  4. Feedforward Adjustments:
    • If the quad feels “mushy” or lags behind your transmitter stick inputs, raise the Feedforward slider.
    • If it snaps aggressively past where you intended to stop stick input (bounce-back), reduce Feedforward.

Recording and analyzing Blackbox logs using PIDToolbox provides a visual, mathematical breakdown of your drone’s gyro noise, filter performance, and PID loop response.

Step 1: Configure Blackbox Logging in Betaflight

To view clear noise heatmaps in PIDToolbox, you need high-density, raw gyro data.

  1. Open Betaflight Configurator and go to the Blackbox tab.
  2. Set Blackbox Logging Device to Onboard Flash or SD Card (depending on your Flight Controller).
  3. Set Blackbox Sampling Rate:
    • Choose 2 kHz if your PID loop runs at 4 kHz.
    • Choose 4 kHz if your PID loop runs at 8 kHz.
    • (Do not use 1:1 sampling if your log space/SD card writing speed is limited).
  4. Set Blackbox Debug Mode to GYRO_SCALED (to analyze filtered gyro noise) or GYRO_UNFILTERED (to inspect raw motor noise before filters are applied).
  5. Click Save.

Step 2: Perform the Test Flight

  1. Find an open area and plug in a fresh battery.
  2. Arm the drone and execute a smooth test flight routine lasting 30–60 seconds:
    • Full Throttle Sweep: Slowly raise throttle from 0% to 100% over 5 seconds, then drop back down. Repeat 2–3 times.
    • Sharp Stick Inputs: Perform quick roll and pitch snaps to excite frame resonance and P/D oscillations.
    • Propwash Descent: Drop throttle and drop straight down into your own propwash.
  3. Disarm to save the log.

Step 3: Extract and Prepare the Log Files

PIDToolbox requires .csv files rather than raw .BFL / .BGF files.

  1. Open Betaflight Blackbox Explorer.
  2. Drag and drop your .BFL log file into Blackbox Explorer.
  3. Click the Export button in the top right corner and select CSV.
  4. Save the generated .csv file in an accessible folder on your computer.

Step 4: Import and Analyze in PIDToolbox

  1. Download and open PIDToolbox (standalone executable).
  2. Click Select Log Folder in the top left and point it to the folder containing your .csv file.
  3. Click Load Log and select your run from the dropdown list.
  4. Set the Throttle Window: Highlight the time range corresponding to your smooth throttle sweep (avoiding crash data or ground idle).

Generating the Noise Heatmap (Spectral Analysis)

  1. Navigate to the Spectral Analysis / Noise tab in PIDToolbox.
  2. Select the signal source:
    • Gyro Unfiltered: Shows native motor and frame noise frequencies across the entire throttle range.
    • Gyro Filtered: Shows the remaining noise reaching the PID loop after RPM and Dynamic Notch filters have done their work.
  3. Click Run / Plot.

Interpreting the Noise Heatmap

PIDToolbox displays a 3D spectrogram with Frequency (Hz) on the X-axis, Throttle (%) on the Y-axis, and Noise Intensity indicated by color heat (Yellow/Red = High Noise, Blue/Black = Clean).

   Throttle (%)
     100% │         / (Motor Harmonic Noise Tracks UP with Throttle)
          │        /
      50% │       /       [Frame Resonance Peak] ── (Fixed Horizontal Band)
          │      /
       0% └─────/─────────────────────────────────────
          0 Hz        200 Hz        400 Hz       600 Hz   Frequency (Hz)

Flashing Bluejay onto BLHeli_S ESCs replaces the stock 8-bit firmware, unlocking Bidirectional DShot for real-time motor RPM filtering and improved efficiency.

Step 1: Pre-Flashing Preparation

CRITICAL WARNING: 8-bit BLHeli_S ESCs can easily brick permanently if power is interrupted during flashing. Do NOT disconnect the USB cable or battery until all 4 ESCs finish.

  1. Remove all propellers from your drone for safety.
  2. Close Betaflight Configurator to free up your computer’s USB/COM port.
  3. Plug in a LiPo battery to power the ESCs, and connect your drone to your computer via USB.
  4. Open a Chromium-based browser (Google Chrome, Microsoft Edge, or Brave) and navigate to the ESC Configurator web application.

Step 2: Flash Bluejay Firmware

  1. Click Select Serial Port at the top right of the ESC Configurator, choose your Flight Controller’s COM port, and click Connect.
  2. Click Read Settings at the bottom right. All 4 ESCs will beep and populate on screen.
  3. Note the Layout Code: Look at the original layout identifier for your ESCs (e.g., J-H-40, G-L-30, J-H-50).
    • Do not manually change this layout identifier unless you are 100% sure of your hardware spec, as flashing the wrong layout can burn the ESC FETs.
  4. Click Flash Firmware at the bottom of the page.
  5. Configure the flashing parameters:
    • Target: Keep the auto-detected target matching your original layout (e.g., J-H-40).
    • Firmware: Select Bluejay.
    • Version: Choose the latest stable release (e.g., v0.21.0 or newer).
    • PWM Frequency:
      • 24 kHz: Standard for 5-inch freestyle/racing quads (maximum low-end torque/braking).
      • 48 kHz: Balanced choice for 3-inch/4-inch drones or smooth freestyle (cooler motors & longer flight times).
      • 96 kHz: Optimized for Tiny Whoops/micros (maximum battery efficiency).
  6. Click Flash. Wait patiently while all 4 ESCs are flashed one by one.
  7. When complete, click Read Settings again to verify all four ESCs show Bluejay with your selected PWM frequency.

Step 3: Configure Betaflight for Bidirectional DShot

  1. Disconnect from ESC Configurator and open Betaflight Configurator.
  2. Connect to your drone and go to the Motors tab.
  3. Set ESC/Motor Protocol to DSHOT300 (for 4 kHz PID loops on F4 FCs) or DSHOT600 (for 8 kHz PID loops on F7/H7 FCs).
  4. Enable the Bidirectional DShot toggle switch.
  5. Enter your motor bell magnet pole count under Motor Poles:
    • 14 for standard 5-inch motor stator sizes (22xx, 23xx, 2207, etc.).
    • 12 for micro/whoop motor stator sizes (14xx, 12xx, 11xx).
  6. Click Save and Reboot.

Step 4: Verify System Operation

  1. Return to the Motors tab in Betaflight with the LiPo connected.
  2. Check the Error % (E: %) column next to each motor.
  3. Enable the master throttle slider and slowly raise throttle.
  4. Verification Rule: The E: % for all 4 motors MUST stay at 0.00%. If any motor shows an error rate higher than 0%, lower your DShot protocol speed (e.g., down to DShot300).