Tools
The sliders in Betaflight do not tell you what they do. You move one, fly a pack, and try to remember whether the quad felt better. This is the same maths the flight controller runs, wired to a quad you can watch.
Everything is a rate. Your sticks ask for a rotation speed, the gyro measures what you got, and the PID loop closes the gap by changing motor speeds. The catch is that motors take about twenty milliseconds to change speed, so every correction arrives slightly late. Nearly everything a tune can get wrong comes out of that one fact.
A quad flying one manoeuvre over and over, so you can move a slider and see what changed.
This browser has no WebGL.
The sliders and the response plot below still work.
The amber outline is where the sticks asked the quad to be. On a good tune the quad sits in it. A soft tune trails behind it, and a hot one swings past and comes back. Locked watches from beside the axis you picked below, which is the only camera that holds still while the quad moves.
Scales the whole tune at once. Up if the quad feels loose and disconnected, down if it is buzzing or the motors are hot.
How hard the quad argues with the air. Too low and it wanders off the stick; too high and it oscillates.
The brake on P. It stops the correction overshooting, at the cost of amplifying gyro noise into the motors.
How much extra D is allowed when the quad is actually moving. Lets you run low D while hovering and more during a flip.
Holds the attitude against wind and an off-centre centre of gravity. Too much and it bounces back after a hard move.
Acts on stick movement rather than on error, so it moves the motors before the quad has fallen behind. Costs nothing at a standstill.
Pitch carries more inertia than roll on almost every frame, so it usually wants slightly more than roll.
Same idea for D. Configurator calls this the pitch:roll D ratio.
Moves every gyro cutoff at once. Lower is quieter and slower; the delay it adds is what a too-high P oscillates on.
Same for the D term, which is the noisiest part of the loop. Most hot-motor problems are D and this slider, not P.
| P | I | D | D Max | F | |
|---|---|---|---|---|---|
| roll | 45 | 80 | 30 | 40 | 120 |
| pitch | 47 | 84 | 34 | 46 | 125 |
| yaw | 45 | 80 | 0 | 0 | 120 |
Rates decide what you are asking for. PIDs decide how well you get it.
The same quad, the same tune and the same loop as the bench, but seen from the camera. A step response tells you what the quad did on one axis for half a second. This tells you whether you can put it where you want it.
A demo flies the course until you take it over. It is not cheating: it flies on the sticks, through the same rate loop as you would, so it is flying whatever tune the sliders are set to. Load a bad one and watch it get worse at its own job.
To fly it yourself you need a radio. Put your transmitter into USB joystick mode, plug it in, and press Take over. There is no keyboard option, because a keyboard cannot hold a stick anywhere except the stops, and a tune you can only ask for full deflection from is a tune you cannot feel.
The gates stay open, so catching a frame costs you nothing. The trees and the buildings do not. Every course turns round and comes back rather than running off into the distance, because a straight line is flown with the sticks near the middle, and the middle is the one place a bad tune still feels fine. It is stopping and reversing that costs.
There is a bando in the course list: three floors, no windows left, and a stairwell you can climb straight up and out through the roof. The gates only say where to be. How you get up there is your problem, which is rather the point.
Fly a lap on the defaults, load Hot P, no D without landing, and fly the same lap again. Turn the sound on for it, and put it fullscreen.
This browser has no WebGL.
Put your transmitter into USB Joystick mode and plug it in. On EdgeTX that is the USB page in the radio settings, or the prompt that appears when you connect the cable. The browser then sees it as a game controller, which means this works in Chrome, Firefox and Safari alike.
Nothing here is written to the radio and nothing leaves your machine. The values you see are your channels after mixes and expo, which is what the flight controller would have received.
P is the size of the correction, in proportion to how far off the rate is right now. It is the only term that has to be there. On its own it always overshoots, because by the time the quad has reached the rate you asked for, the motors are still spinning up.
D is the brake. It acts on how fast the error is closing rather than on the error, so it starts backing off before the quad arrives. Set the D slider to zero on the model above and the step response grows a bounce on the front of it. The cost is that D also multiplies gyro noise, and the motors have to play that noise back. That is where hot motors come from.
I is memory. It accumulates whatever error P and D leave behind and pushes until it is gone, which is what holds an attitude in wind or with a battery mounted off centre. Take it away and the quad tracks the stick but will not hold a line. Too much and it keeps pushing after the error has gone, which is the bounce back you feel at the end of a hard roll.
Feedforward is the only term that is not reacting to anything. It watches the sticks rather than the gyro, so when you move a stick it moves the motors immediately instead of waiting for the quad to fall behind first. It does nothing at all when the sticks are still, which is why it costs nothing in a hover and why it cannot rescue a bad tune.
D Max exists because the right amount of D during a flip is more than the right amount in a hover. It lets D rise only when the quad is actually moving, so you get the braking where it matters without paying for the noise the whole flight.
The filter sliders are the other half of the same argument. Filtering removes the noise D would otherwise amplify, but every filter delays the signal, and delay is exactly what makes a loop oscillate. Pull the gyro filter slider down on the model and the motors get quieter and the step gets worse.
The controller is ported from the firmware:
simplified_tuning.c for the sliders,
pid.c for the loop, mixer.c for the
mixer, rc.c for the rate curves. The gain scales,
the iTerm relax, the D Max boost, the airmode normalisation
and the pid sum limits are the real ones.
The airframe under it is not your airframe. It is a five inch freestyle quad at roughly 650 grams with generic motors, and it does not know about your frame's resonances, your bent prop, or your ESC firmware. Use it to understand which direction a slider moves things and what that looks like. Do not copy numbers off it onto a real quad.
It also flies in acro only, which is the mode PIDs are tuned in. There is no self levelling to hide behind, so if you fly it with your own radio it will get away from you exactly like the real thing does.