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
- ESC Firmware: Ensure your ESCs support bidirectional DShot (BLHeli_32, AM32, or BLHeli_S flashed with Bluejay).
Betaflight Setup Steps
- Navigate to the Motors tab.
- 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).
- Enable the Bidirectional DShot toggle switch.
- 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).
- Click Save and Reboot.
- 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.
- Go to the PID Tuning tab $\rightarrow$ Filter Settings sub-tab.
- 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).
- Under Dynamic Notch Filter:
- Set Dynamic Notch Count to
1or2(since RPM filtering removes the primary noise band, 1-2 dynamic notches are sufficient). - Set Dynamic Notch Range to
LOW. - Set Q Factor to
200–250(higher Q creates a narrower notch, minimizing filter latency).
- Set Dynamic Notch Count to
- 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.3xto1.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 toward1.0x.
Phase 3: PID Tuning Procedure
- P (Proportional): Controls response sharpness and stick tracking. Higher = sharper feel, but too high causes high-frequency oscillations.
- I (Integral): Maintains heading/angle against wind and external forces. Higher = holds lines better, but too high creates slow oscillations.
- D (Derivative): Acts as a shock absorber to damp P-term overshoots and propwash. Too high causes extreme heat and high-frequency noise amplification.
- Feedforward (FF): Anticipates stick movements directly from your controller inputs without waiting for gyro feedback.
Methodical Step-by-Step Tuning Workflow
[ Default PIDs ] ──► [ Push Master Slider Up ] ──► [ Tune D Gain for Propwash ] ──► [ Fine-tune Feedforward ]
- Set Baseline Limits: Start with Betaflight default PIDs. Leave Angle Mode turned off; perform tuning in Acro Mode.
- Master Multiplier Adjustment:
- Move the Master Multiplier slider up by
0.1increments (e.g., from1.0to1.1to1.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.
- Move the Master Multiplier slider up by
- 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.
- 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.
- Open Betaflight Configurator and go to the Blackbox tab.
- Set Blackbox Logging Device to
Onboard FlashorSD Card(depending on your Flight Controller). - 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).
- Set Blackbox Debug Mode to
GYRO_SCALED(to analyze filtered gyro noise) orGYRO_UNFILTERED(to inspect raw motor noise before filters are applied). - Click Save.
Step 2: Perform the Test Flight
- Find an open area and plug in a fresh battery.
- 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.
- Disarm to save the log.
Step 3: Extract and Prepare the Log Files
PIDToolbox requires .csv files rather than raw .BFL / .BGF files.
- Open Betaflight Blackbox Explorer.
- Drag and drop your
.BFLlog file into Blackbox Explorer. - Click the Export button in the top right corner and select CSV.
- Save the generated
.csvfile in an accessible folder on your computer.
Step 4: Import and Analyze in PIDToolbox
- Download and open PIDToolbox (standalone executable).
- Click Select Log Folder in the top left and point it to the folder containing your
.csvfile. - Click Load Log and select your run from the dropdown list.
- 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)
- Navigate to the Spectral Analysis / Noise tab in PIDToolbox.
- 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.
- 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)
- Diagonal Heat Lines (Motor Harmonics): Noise lines that slope upward as throttle increases represent motor rotation noise (1st, 2nd, 3rd harmonics).
- Fix: If these lines are bright yellow/red in
Gyro Filtered, verify Bidirectional DShot and RPM Filtering are working properly.
- Fix: If these lines are bright yellow/red in
- Horizontal Heat Bands (Frame Resonance): Fixed frequency bands that stay bright at the same Hz regardless of throttle position indicate physical frame vibration or loose hardware.
- Fix: Target these specific bands using a Dynamic Notch Filter or check for loose arms/stack screws.
- Low-Frequency Noise (< 100 Hz): Broad noise in the 0–100 Hz range represents actual flight dynamics or severe propwash.
- Fix: Tweak PID gains (P/D ratios) rather than applying heavy low-pass filters, which add latency.
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.
- Remove all propellers from your drone for safety.
- Close Betaflight Configurator to free up your computer’s USB/COM port.
- Plug in a LiPo battery to power the ESCs, and connect your drone to your computer via USB.
- Open a Chromium-based browser (Google Chrome, Microsoft Edge, or Brave) and navigate to the ESC Configurator web application.
Step 2: Flash Bluejay Firmware
- Click Select Serial Port at the top right of the ESC Configurator, choose your Flight Controller’s COM port, and click Connect.
- Click Read Settings at the bottom right. All 4 ESCs will beep and populate on screen.
- 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.
- Click Flash Firmware at the bottom of the page.
- 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.0or 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).
- Target: Keep the auto-detected target matching your original layout (e.g.,
- Click Flash. Wait patiently while all 4 ESCs are flashed one by one.
- 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
- Disconnect from ESC Configurator and open Betaflight Configurator.
- Connect to your drone and go to the Motors tab.
- Set ESC/Motor Protocol to
DSHOT300(for 4 kHz PID loops on F4 FCs) orDSHOT600(for 8 kHz PID loops on F7/H7 FCs). - Enable the Bidirectional DShot toggle switch.
- Enter your motor bell magnet pole count under Motor Poles:
14for standard 5-inch motor stator sizes (22xx, 23xx, 2207, etc.).12for micro/whoop motor stator sizes (14xx, 12xx, 11xx).
- Click Save and Reboot.
Step 4: Verify System Operation
- Return to the Motors tab in Betaflight with the LiPo connected.
- Check the Error % (E: %) column next to each motor.
- Enable the master throttle slider and slowly raise throttle.
- 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).