Tiny quad on my own bench, flight controller I flashed myself. First arming: it leaps, flips over, and lands upside down. I was ready to blame the PID tuning. It was not the PID tuning.
On a quad X, the four motors spin in alternating directions (two clockwise, two counter-clockwise) so the torques cancel and you can yaw by speeding up one diagonal pair. The controller has a motor mixer table that says "to roll right, speed up motors 1 and 2, slow down 3 and 4", and so on. If the physical motor numbering does not match the mixer, the controller commands the opposite correction. The error grows, which is positive feedback, which is why it flips in a fraction of a second.
The checklist I now run before every first flight on a new build:
- Props off. Always, for anything involving motors on the bench.
- Open the configurator's motor test and spin motors one at a time. Check that the numbered motor is where the diagram says.
- Check each motor's direction. Reversing a motor on most ESCs is a setting, or you can swap two of its three wires.
- Check the prop type matches the motor direction (they are not interchangeable: the pitch is handed).
- Tilt the quad by hand with props off and look at the motor outputs: the motors on the low side should speed up to push it back level.
Step 5 is the real test of the whole chain, sensor orientation included. I had the gyro axis rotated 90 degrees in the settings. Props came back on only after the check passed.