The drone is naturally unstable
A multirotor looks mechanically simple: several motors, propellers and a lightweight frame. But in flight, the aircraft is constantly being disturbed by wind, vibration, changes in thrust and small differences between its motors. Without continuous correction, it would quickly tilt or rotate away from the pilot's intended attitude.
The flight controller is the computer that closes this loop. It receives measurements from sensors, compares the aircraft's actual motion with the desired motion, calculates a correction and sends commands to the motors. Open-source autopilots such as ArduPilot and PX4 implement this as a layered control system rather than as one simple command.
Gyroscopes and accelerometers tell the controller what is happening
A gyroscope measures angular velocity: how quickly the aircraft is rotating around its roll, pitch and yaw axes. This gives the controller a fast measurement of whether the drone is beginning to rotate or is already rotating too quickly.
An accelerometer measures acceleration along three axes. It also provides information that helps estimate the aircraft's orientation relative to gravity, although vibration and other motion can complicate the measurement. ArduPilot's documentation describes accelerometers and gyroscopes as core onboard sensor inputs, with calibration required as part of setup.
Because no single sensor is perfect, flight-control systems can combine measurements from multiple sensors. ArduPilot's EKF, for example, fuses gyroscope, accelerometer and other measurements to estimate orientation, velocity and position while rejecting some individual sensor errors.
The feedback loop is the key
The controller is constantly asking a simple question: is the drone doing what it was told to do? If the desired roll rate is zero but the gyro reports that the aircraft is rolling, the controller calculates an error and produces a correction.
This is feedback control. A PID controller is one common method. The proportional term responds to the current error, the integral term responds to accumulated error, and the derivative term responds to how the error is changing. PX4 documents a PID rate controller for roll, pitch and yaw, with filtering used to reduce the effect of sensor noise.
The correction has to be calculated quickly. ArduPilot's attitude-control documentation describes repeated control updates and a chain that converts pilot commands into desired angles or rates, then into motor outputs.
Motors and ESCs turn software decisions into movement
A flight controller cannot directly spin a motor. It sends an electrical control signal to an electronic speed controller, or ESC. The ESC regulates the power delivered to a brushless motor so that its speed changes as requested.
In a quadcopter, changing the speed of individual motors creates the forces needed for roll, pitch and yaw. To roll, for example, the controller increases thrust on one side while reducing it on the other. The aircraft tilts, and the thrust vector changes direction. The controller then adjusts the motors again to reach and hold the requested attitude.
ArduPilot documents motor mixing as the stage that converts roll, pitch, yaw and throttle commands into individual motor outputs. Its ESC documentation also lists protocols such as PWM and DShot for communicating motor-speed commands.
Why tuning matters
The control system has to be responsive without becoming unstable itself. If gains are too low, the aircraft can feel slow to correct disturbances. If gains are too high, the controller can over-correct, producing oscillations or a twitchy aircraft.
PX4's tuning guidance notes that a badly tuned rate controller can produce visible oscillations and that the controller must be tuned around the aircraft's hover-thrust behaviour. ArduPilot similarly provides separate attitude and rate-control stages and requires sensor and ESC configuration before flight.
This is why the flight controller is more than a small computer board. It is part sensor-processing system, part control algorithm and part actuator manager. Its job is to make thousands of small corrections fast enough that the aircraft appears stable to the person watching it.
What happens when the system cannot correct the problem?
Flight control has limits. A damaged propeller, failing motor, severe vibration, saturated actuator or bad sensor can reduce the controller's ability to generate the required correction. A quadcopter also has a finite amount of thrust, so it cannot recover from every disturbance or hardware failure.
Software can provide failsafes, but these are not substitutes for sound hardware and operation. ArduPilot's setup guidance includes calibration, ESC configuration, first-flight procedures and failsafe mechanisms because stable flight depends on the entire chain working together. ξciteξturn0search3ξ
The important point is that a drone does not stay in the air because one component is exceptionally smart. Stability emerges from a fast loop: sensors measure motion, software calculates error, the controller decides how to correct it, ESCs change motor speed, and the sensors immediately measure the result again. That loop repeats throughout the flight.