Betaflight autotune from a chirp flight
Chirp autotune sits next to the Betaflight configurator and the ESC configurator. Tuning PIDs by feel takes many packs. A chirp test makes the flight controller sweep a sine wave through each axis while it logs, and the log then shows how the quad responds at every frequency. FlySpark reads that CHIRP log and works out a Betaflight autotune suggestion in simplified slider form.
It runs in your browser or in the FlySpark app on Android and iPhone. Reading a log needs no flight controller. With one connected, the suggestion can be applied and saved in one step.
Free. Hardware connections need Chrome or Edge on a computer; phones use the FlySpark app.
- Free
- Nothing to install
- Demo without hardware
In short
Chirp autotune reads a Betaflight blackbox log recorded with debug_mode CHIRP, measures each axis's frequency response, and suggests simplified-tuning slider values. FlySpark runs it in the browser or the Android and iPhone apps; with a disarmed quad connected, the suggestion can be applied and saved.
Key facts
- Needs a Betaflight log recorded with debug_mode = CHIRP; the sweep is found from the CHIRP flight-mode bit in the log.
- Frequency response is estimated with Welch's method, and only frequencies with coherence of 0.5 or more are used.
- Three tuning targets: Aggressive (50° phase margin), Normal (60°) and Conservative (72.5°).
- Each pass changes gains by between 0.5× and 2×.
- Output is Betaflight simplified-tuning slider values, shown next to the current values from the log.
- Reads .BBL, .BFL and .TXT logs; a sample chirp flight works with no log.
- Betaflight 2026.6 added an experimental Autotune tab to the Betaflight App that uses the same chirp-log approach.
Betaflight
INAV
ArduPilot
PX4- BLHeli_S
Bluejay
AM32
ExpressLRS
EdgeTX
DroneCAN
MAVLink
Try it
Settle the trace
This is an illustration. Tune fades the wobble.
Betaflight
Features
- 01
Reads CHIRP blackbox logs
Import a Betaflight log recorded with debug_mode = CHIRP. FlySpark finds the sweep for each axis on its own and shows the file, sample rate and axes found.
- 02
Measured frequency response
Magnitude and phase per axis, worked out from the stick-free sweep. Only frequencies the sweep measured cleanly are drawn.
- 03
Stability numbers that matter
Bandwidth, gain crossover, phase margin, loop delay, resonant peak, sensitivity peak, overshoot, rise time and settling time for roll, pitch and yaw.
- 04
Step response and spectrogram
See the predicted step response over the first 100 ms, a sensitivity plot, and a gyro spectrogram that shows the sweep itself.
- 05
Three tuning targets
Aim for an Aggressive, Normal or Conservative phase margin. The suggestion changes to match.
- 06
Simplified slider suggestions
Proposed values for Master Multiplier, P / I Gain, I Gain, D Gain, Feedforward and D-Term Filter, next to your current values from the log.
- 07
Apply and save from the tool
Connected to the quad and disarmed, apply the gains from the axis you pick. FlySpark writes the sliders and saves them.
- 08
Try it with a sample flight
No log yet? Load a sample chirp flight to see every plot and number before you fly.
What a chirp autotune does
A chirp is a sine wave that rises in frequency. In CHIRP mode, Betaflight injects it into one axis at a time while you hover, and blackbox logs both what was asked for and what the gyro saw. Comparing the two at every frequency gives the frequency response of the quad: how much it follows, and how late.
From that response FlySpark works out the numbers tuners care about. Phase margin says how far the loop is from oscillating. Loop delay is the lag from filters, motors and props. Sensitivity peak says how strongly the loop amplifies disturbances such as propwash. It then picks a gain that reaches your chosen phase margin while keeping peak sensitivity inside a robustness bound.
This is different from hand tuning, where you change a slider, fly, and judge by feel or by step responses in a log. It is also different from INAV's fixed-wing autotune, which adjusts gains during flight. The chirp method measures first, then suggests.
Betaflight autotune: recording a CHIRP flight
CHIRP mode is part of Betaflight 2025.12 and newer. Some cloud builds leave it out; if CHIRP does not appear in the Modes tab, build the firmware again with chirp included.
In the CLI, set debug_mode = CHIRP so the log carries the sweep data. Give CHIRP mode a switch in the Modes tab. Turn on blackbox logging at a fast rate. Then fly to a steady hover in an open space, flip the CHIRP switch on, and hold the quad steady while the sweep runs. Repeat for each axis. The OSD shows when the chirp is running and when it is finished.
Calm air helps. Wind and stick inputs add signals the sweep did not cause, which lowers coherence and leaves fewer clean frequencies to work with.
Importing the log
Open the chirp autotune from the FlySpark web app, or the Autotune tab in the FlySpark Betaflight configurator. Choose Import Blackbox Log and open the .BBL, .BFL or .TXT file. FlySpark finds the CHIRP sections, groups them by axis and runs the analysis on your own device.
If the file has no sweep, you get: No CHIRP data found. Make sure the log was recorded with debug_mode = CHIRP and that CHIRP mode was switched on during the flight. That means one of the two steps above was missed.
Reading the analysis
The analysis card lists each axis side by side. Bandwidth and gain crossover say how fast the loop responds. Phase margin is the headroom before oscillation; Crossover Limit and Max Phase Margin say how far the gain can go with this hardware. Loop delay is the total lag; less delay allows a higher gain. Overshoot, rise time and settling time describe the predicted step response.
The Frequency Response plots show magnitude and phase. Only frequencies measured with coherence of 0.8 or higher are drawn, so gaps mean the sweep was not clean there. The sensitivity plot shows where the loop amplifies disturbances. The gyro spectrogram shows the sweep as a rising curve, with dashed lines at its start and end frequencies.
Tuning targets and safety limits
Choose a tuning target. Aggressive aims for 50° of phase margin, Normal for 60°, Conservative for 72.5°. Less margin means a sharper, more locked-in quad and less tolerance for noise and damage.
Two limits keep suggestions sensible. A single pass changes the gain by at most half or double, so a badly tuned quad gets there over several flights. And no gain is proposed that pushes peak sensitivity past the robustness bound if a safer one exists.
When a limit decides the result, FlySpark says so. If the craft cannot reach the target margin, the gain is held and you are told to pick a lower target or add D. If the change was clamped, apply, fly another chirp and repeat. If no gain keeps sensitivity inside the bound, the value is marked as a starting point to re-measure.
Applying the suggested sliders
The Proposed Sliders card shows each simplified slider with your current value from the log next to the suggestion. The sliders are shared across axes, so choose which axis to apply gains from.
Connect the flight controller, disarm, and press Apply Gains. FlySpark writes the simplified tuning over MSP and saves it. If the quad uses hand-set PIDs, it asks first: applying switches the PID sliders on for roll, pitch and yaw and replaces the current PID values. Fly, check the feel, and run another chirp if a note asked you to.
Chirp autotune versus the PID Tuning tab
The chirp tool gives a measured starting point. The PID Tuning tab in the FlySpark configurator is still where you fine-tune: sliders, individual P, I, D and feedforward values, anti-gravity, TPA and the rest. Filters live in the Filters tab, and a normal blackbox log in the FlySpark blackbox viewer shows whether noise or propwash still need work.
At a glance
Chirp autotune compatibility
| Firmware for chirp logs | Betaflight 2025.12 and newer, with CHIRP built in |
|---|---|
| Log settings | debug_mode = CHIRP, CHIRP mode on a switch |
| Log formats | .BBL, .BFL, .TXT |
| Axes | Roll, pitch and yaw |
| Tuning targets | Aggressive 50°, Normal 60°, Conservative 72.5° phase margin |
| Gain change per pass | Between 0.5× and 2× |
| Output | Betaflight simplified sliders |
| Where it runs | Chrome, Edge and other current browsers; FlySpark app on Android and iPhone |
| Applying gains | Connected and disarmed; the browser connects over USB or Bluetooth in Chrome or Edge |
Betaflight
How to autotune Betaflight PIDs with a chirp flight
Prepare the firmware
Use Betaflight 2025.12 or newer with CHIRP included. In the CLI set debug_mode = CHIRP, and give CHIRP mode a switch.
Turn on blackbox
Set a fast logging rate in the Blackbox tab and make sure there is room on flash or the SD card.
Fly the sweep
Hover in calm air, flip CHIRP on, and hold steady until it finishes. Repeat for each axis.
Import the log
Open the FlySpark chirp autotune and import the blackbox file.
Pick a target
Choose Aggressive, Normal or Conservative and read the notes for each axis.
Apply and test
Connect, disarm, apply gains from the chosen axis, then fly and run another chirp if asked.
Troubleshooting
Common problems and fixes
Problem
No CHIRP data found
Fix
The log was not recorded with debug_mode = CHIRP, or CHIRP mode was never switched on. Set both and fly again.
Problem
CHIRP is missing from the Modes tab
Fix
The firmware was built without chirp, or is older than 2025.12. Build it again with chirp included.
Problem
No coherent data
Fix
Wind, stick inputs or a short sweep left no clean frequencies. Fly the chirp again in calm air and keep your hands still.
Problem
Connect to flight controller to apply gains
Fix
Reading works offline, but applying writes to the board. Connect over USB, Bluetooth or Wi-Fi first.
Problem
Disarm before applying gains
Fix
Gains are only written while the quad is disarmed.
Problem
The note says the target cannot be reached
Fix
The craft's delay limits its phase margin. Choose a lower target, or add D to raise the limit.
Problem
The gain change was clamped
Fix
One pass changes gain by at most half or double. Apply, fly another chirp and repeat.
Glossary
Glossary of terms
- Chirp
- A sine wave that sweeps up in frequency, used to measure how the quad responds.
- Frequency response
- How much and how late the quad follows a command at each frequency.
- Phase margin
- How far the control loop is from oscillating. More margin is calmer; less is sharper.
- Gain crossover
- The frequency where the loop gain falls to one; it sets how fast the quad responds.
- Loop delay
- Total lag from filters, motors and props. It limits how high the gains can go.
- Sensitivity peak
- How strongly the loop amplifies disturbances such as propwash at its worst frequency.
- Coherence
- How much of the measured response was caused by the sweep rather than wind or sticks.
- Simplified sliders
- Betaflight's slider tuning, which sets P, I, D and feedforward together from a few values.
FAQ
Frequently asked questions
What is Betaflight autotune?
Betaflight autotune here is the chirp log. Betaflight 2025.12 records a frequency sweep. FlySpark suggests slider values from that log.
What is chirp autotune?
A method that measures the quad's response with a frequency sweep, then picks gains for a target phase margin instead of tuning by feel.
Do I need a flight controller connected?
Not to read a log. Connect only when you want to apply the suggested gains.
How do I record a chirp log?
Set debug_mode = CHIRP, give CHIRP mode a switch, turn on blackbox, then hover and flip CHIRP on for each axis.
Which tuning target should I pick?
Normal for most quads. Aggressive for a clean, stiff racer. Conservative for a heavy, soft or noisy build.
Will it change my individual PIDs?
It suggests simplified sliders. If your quad uses hand-set PIDs, applying turns the sliders on and replaces the current PID values, after asking.
Why does it say the gain was clamped?
One pass changes gain by at most half or double. Apply, fly another chirp, and repeat until no clamp note appears.
Can I use it on my phone?
Yes. The FlySpark app on Android and iPhone has the same chirp autotune, and can apply gains over Bluetooth or Wi-Fi, or USB on Android.
Does it tune filters too?
It suggests the D-Term Filter slider with the gains. For gyro filters and noise, use the spectrum in the FlySpark blackbox viewer.
Can I try it without a log?
Yes. Load the sample chirp flight to see every plot and number.
Does it work with INAV?
No. The chirp autotune reads Betaflight CHIRP logs and writes Betaflight sliders.
What is a chirp tuning step?
One sweep in the chirp log. FlySpark groups the sweeps by axis, shows the frequency response, and suggests a slider move. The suggestion is applied on the PID tab, or from this tool when you choose to write it.
References
Sources
The official documentation behind the background facts on this page.
- Betaflight 2026.6 Release NotesBetaflight · betaflight.com
- Debug ModesBetaflight · betaflight.com
- debug.c (debug mode names)Betaflight on GitHub · github.com
- PID Tuning GuideBetaflight · betaflight.com







