Chapter 14 · Software

Make it fly like it’s on rails

Tuning means adjusting filters and PIDs so the drone responds fast, with no oscillations and no hot motors. You don’t need it to start: once you fly confidently, here’s the method.

Reviewed: · Found a mistake? Let us know

Before touching your drone, play with the PID lab: move P, D, feedforward and the filters and you’ll see straight away what each value does. To watch one of your flights in 3D, load it into the flight replay.

The PID in two lines

P · Proportional

Corrects the current error: how hard it pushes the drone towards where you ask it to go. With too much P, it oscillates fast.

I · Integral

Corrects errors that persist over time, such as wind or an off-centre centre of gravity.

D · Derivative

Brakes the movement before it overshoots, like a shock absorber. With too much D, you get hot motors and noise.

Feedforward

Reacts directly to stick movement, without waiting for an error. It gives an immediate response.

Graph of the drone’s response to a stick command: well tuned, it gets there fast without bounce; with too much P it oscillates around the target; with too little P it gets there slowly commandtime →Well tunedToo much P: oscillatesToo little P: slow
Rough sketch: this is what you’ll see in Blackbox when you compare the command trace (setpoint) with the gyro trace.

The step response

When you do a flip, the setpoint jumps suddenly from one value to another: that’s a step. How the gyro gets there sums up the whole tune. The PID works like a car’s shock absorber: too little damping and it bounces; too much and it’s slow. The goal is critical damping: getting there as fast as possible without overshooting.

Three responses to the same stick snap: one bounces, one gets there fast and stays, and another arrives late THREE WAYS TO REACH THE SETPOINTtime →°/sunderdamped: bouncescritical: the goaloverdamped: slow
Underdamped (bounces), critical (the goal) and overdamped (slow).
Raising…SpeedOvershootSteady-state errorIf there’s too much
PFasterMoreLessFast oscillation
IA bit slowerMoreMuch lessSlow bounce-back
DA bit slowerLessSameHot motors, noise
FeedforwardMuch fasterA bit moreSameThe gyro gets ahead of the stick

A real log, analysed

These two graphs come from a real Blackbox log of a 5" test quad, recorded at about 3.2 kHz. They’re a good example of how to read a log with numbers rather than by eye.

Real log: the setpoint jumps to 1000 degrees per second and the gyro gets there about 16 milliseconds late and overshoots to about 1315 A REAL FLIP: GYRO VS SETPOINTtime (ms) →°/s05001000overshoot +32 %delay ≈ 16 msgyrosetpoint
The gyro arrives about 16 ms late and overshoots by 32 %: an underdamped response. First more D (or less P), then feedforward.
Real gyro spectrum: unfiltered it has a peak around 460 hertz; filtered it sits about 25 decibels lower REAL NOISE AT HIGH THROTTLEfrequency (Hz) →dB100200300400500600700motors ≈ 460 Hz−25 dBunfilteredfiltered
Motor noise (300–470 Hz) ends up about 25 dB lower after the filters, and below 100 Hz the movement passes through intact.

How to read it: find an isolated stick snap, measure the delay where setpoint and gyro cross the halfway point, and the overshoot by comparing the gyro peak with the setpoint. In the spectrum, the filtered gyro shouldn’t show any clear peak.

The order that works

Change one thing at a time, fly a pack, feel the motors and compare.

  1. Foundations

    Up-to-date firmware, RPM filter on and the ESC properly configured. Fresh props and nothing vibrating.

  2. Filters

    Reduce filtering bit by bit: less filtering means less delay, but more noise in the motors. Stop when they start to get warm.

  3. P/D balance

    With feedforward and I turned off, adjust the ratio between P and D until the drone stops cleanly after every move.

  4. Master gain

    Raise the master multiplier until oscillation or heat appears, then lower it a little.

  5. Bring I back

    Check that the drone doesn’t drift and doesn’t shake on descents.

  6. I-term relax and anti-gravity

    They stop bounce-back after flips and the nose dropping when you punch the throttle.

  7. Feedforward

    Raise it until the stick response feels as direct as you like.

  8. Dynamic damping

    If the motors get hot in aggressive flying, it reduces D only when needed.

  9. Rates and the rest

    Finally, rates to taste and settings such as dynamic idle or throttle boost.

The noise bands

In the Blackbox spectrum analyser, each frequency band has a different source and a different way of dealing with it.

FrequencyWhat it isHow to deal with it
Below 20 HzThe drone’s actual movementNot filtered
20–100 HzPropwash and oscillationsPID, never filters
100–250 HzFrame resonanceMechanical fixes and dynamic notch
Above 250 HzMotors and propsRPM filter and low-pass

Propwash

It’s the shaking that appears when you descend or turn through the air churned up by your own props. It rarely has a single cause: start with the mechanics (screws, soft mounts, a stiff frame, healthy motors), turn on the RPM filter, filter only as much as needed, raise D a little while watching motor temperature, and enable dynamic idle. When flying, tilt the drone slightly forward on descents to get out of the dirty air.

Diagnosing bounce-back

The speed of the bounce-back at the end of a flip tells you which term to adjust.

What you seeCauseWhat to do
Fast bounce that overshoots the setpointP/D balance too highMore D or less P
Stops short and then gets thereP/D balance too lowLess D or more P
Slow bounce at the end of the moveI has built upI-term relax
Gyro above or below in long rollsNot enough IMore I
Propwash that won’t improve and motors at 100 %Mechanical limit (saturation)Better-suited props, motors

To keep the balance when you raise the overall strength, multiply: if P = 60 and D = 35 (balance 1.71) and you raise D to 40, P goes to about 68. The P/D balance calculator does it for you.

Symptoms and fixes

SymptomWhat to try
Propwash: shaking on descents or in tight turnsFilter less, raise D, try an ESC PWM frequency of 24 kHz.
Oscillation at high throttleEnable or increase TPA, which reduces D above a certain throttle.
Hot motorsLower D or enable dynamic damping. Check props and vibrations.
Bounce-back after a flipAdjust the I-term relax cutoff.
The nose drops when you punch the throttleRaise anti-gravity.
Slowly driftsCheck the centre of gravity and raise I a little.

Blackbox: seeing what you can’t feel

Blackbox records gyro, stick and motor data during the flight. With that data you can see exactly where there’s noise or where the drone isn’t following what you ask.

  1. Enable it

    In the Blackbox tab, with a logging rate of about 1–2 kHz.

  2. Fly a pack

    Do a mix of moves: fast rolls, throttle changes and flips.

  3. Analyse

    Open the log in Blackbox Explorer to see the graphs and the noise spectrum, or in PIDtoolbox to analyse the response to each move.

  4. Interpret

    In the spectrum, look for noise peaks the filter doesn’t reach. In the response, the ideal is a fast rise that stops at the requested value, without overshooting or oscillating.

Before you touch anything, make sure the problem isn’t mechanical: a loose screw, a damaged prop or a worn bearing can look like a bad tune.

Do it guided from start to finish. Guided tuning prepares Blackbox over USB, guides you by voice through the test flights, reads the logs and suggests the changes one at a time.

Analyse your log right here. The FPV Assistant decodes Blackbox logs in your browser and gives you the step response, the noise before and after the filters, the throttle × frequency map and, with chirp logs, the frequency response. It also produces a downloadable report.