A drone is an unmanned aerial vehicle (UAV) that relies on a central microcontroller flight controller to process inertial sensor data and adjust brushless motor speeds via electronic speed controllers (ESCs) to maintain stable flight. When you transition from basic hobby electronics to drone propulsion, it fundamentally changes your circuit design from a simple open-loop output to a high-speed, closed-loop feedback system requiring strict power rail isolation and microsecond-precise communication buses. Beginners commonly confuse the radio receiver (the RC link that simply passes your stick inputs) with the flight controller (the embedded brain that actually reads the IMU and stabilizes the craft hundreds of times per second).

LiPo Safety Note: High-performance drones draw massive current. A short circuit on a 6S LiPo can instantly weld metal and cause a fire. Always use a proper balance charger, never parallel mismatched cells, and inspect solder joints on the main power distribution board before every flight.

The Embedded Architecture of a Quadcopter

When you strip away the carbon fiber frame and plastic canopies, a modern drone is essentially a flying robot built around a 32-bit ARM Cortex microcontroller. The core of this system is the Flight Controller (FC). In 2026, the vast majority of custom and commercial FCs rely on STMicroelectronics STM32 chips—specifically the F4, F7, or H7 series.

The FC's primary job is to read the Inertial Measurement Unit (IMU). The IMU contains a 3-axis gyroscope and a 3-axis accelerometer. To prevent latency, this sensor is almost always wired to the MCU via an SPI bus running at 10MHz or higher, rather than the slower I2C bus. The MCU reads the raw sensor data, applies digital low-pass and notch filters to remove motor vibration noise, and then feeds the clean data into a mathematical model called a PID (Proportional-Integral-Derivative) controller.

The output of that PID controller is a set of four throttle values, one for each motor. However, the MCU cannot drive brushless motors directly; they require three-phase alternating current. The FC sends digital commands to Electronic Speed Controllers (ESCs), which contain their own dedicated gate-driver ICs and MOSFETs to commutate the motor phases.

Closed-Loop Control: The PID Loop and Motor Timing

To understand how drones work in real-time, we have to look at the math and the timing constraints. Let's look at a worked numeric example using a standard 5-inch freestyle FPV drone build.

  • Motors: 2306 brushless, 2400KV
  • Battery: 6S LiPo (22.2V nominal, 25.2V fully charged)
  • Current Draw: At full throttle, each motor pulls roughly 35A. Total system draw is 140A.
  • PID Loop Rate: The STM32F405 FC runs the stabilization loop at 4kHz, meaning it calculates corrections every 250µs.

Because the loop runs every 250µs, the MCU must read the gyro, calculate the PID error, and send the new motor commands within that window. Modern drones use the DShot digital protocol to talk to the ESCs. Specifically, DShot600 operates at 600 kilobits per second. A single 16-bit DShot frame takes exactly 37.5µs to transmit.

Because 37.5µs is well under the 250µs loop time, the MCU has ample CPU cycles left over to handle RC input parsing, On-Screen Display (OSD) rendering, and telemetry without dropping frames. If you were using older analog PWM signaling, the hardware timers would often block the CPU or introduce jitter, which is why digital protocols completely took over the embedded drone space.

Where You Meet This in Practice

If you are building, repairing, or tuning drones, you will interact with this embedded architecture constantly. Here is where the theory hits the workbench:

  • Flashing Firmware: You will use tools like Betaflight Configurator or ArduPilot Mission Planner to flash the STM32 chip. You must select the exact board target (e.g., SPEEDYBEEF405V3) because the firmware needs to know exactly which MCU pins are mapped to the SPI bus, UARTs, and motor outputs.
  • Gyro Noise and Soft-Mounting: If your drone flies erratically and the motors get hot, it is usually because high-frequency vibrations from the motors are saturating the IMU's accelerometer. In practice, you fix this by ensuring the FC is mounted on rubber grommets (soft-mounting) and by configuring dynamic RPM notch filters in the firmware, which use ESC telemetry to track and filter out the exact vibration frequency of the motors.
  • UART Mapping: When adding peripherals like a GPS module, a digital video transmitter (VTX), or a telemetry radio, you must wire them to specific TX/RX pins on the FC and assign the correct UART function in the firmware CLI. Crossing TX to TX instead of TX to RX is the most common beginner wiring mistake.

Flight Controller MCU Comparison

When selecting a flight controller for a custom build, the MCU dictates your processing headroom. Here is how the current generation of chips compares for embedded drone applications.

MCU Family Core Speed Typical Use Case Max PID Loop Rate Cost Range (FC Only)
STM32F405 168 MHz Budget builds, lightweight quads 4 kHz $25 - $35
STM32F722 216 MHz Standard 5-inch freestyle, racing 8 kHz $35 - $50
STM32H743 480 MHz Cinelifter, ArduPilot GPS rescue, heavy filtering 8 kHz - 16 kHz $55 - $80
Pro Tip: Running an 8kHz PID loop on an F405 chip will max out the CPU and cause failsafes. Always match your firmware loop rate to the hardware capability. For 90% of hobbyist builds, an F722 running at 4kHz or 8kHz is the sweet spot for price and performance.

Frequently Asked Questions

How do drone flight controllers use PID loops to stay level?

A PID loop is a control algorithm that continuously calculates an error value and applies a correction. Think of balancing a broom on your finger: the Proportional (P) term reacts to how far the broom is tilted from center, pushing it back. The Derivative (D) term reacts to the speed of the tilt, damping the movement so you don't overcorrect and cause an oscillation. The Integral (I) term handles steady-state errors, like a persistent wind pushing the drone to one side. The flight controller runs this math thousands of times a second to keep the craft perfectly level.

What is the difference between PWM and DShot protocols in drone ESCs?

PWM (Pulse Width Modulation) is an older analog protocol where the length of a voltage pulse (usually between 1000µs and 2000µs) dictates the throttle value. It is susceptible to electrical noise and latency. DShot is a fully digital protocol that sends binary packets (ones and zeros) over the wire. DShot is immune to analog noise, requires no calibration, and in its modern 'Bidirectional' variants, allows the ESC to send motor RPM data back to the flight controller on the same wire, enabling highly precise RPM-based vibration filtering.

How does a drone's IMU (gyroscope and accelerometer) actually measure movement?

Modern drone IMUs use MEMS (Micro-Electromechanical Systems) technology. The gyroscope measures rotational velocity using the Coriolis effect: it contains microscopic vibrating masses suspended on silicon springs. When the drone rotates, the vibration path shifts, changing the capacitance between the mass and fixed electrodes, which the chip translates into degrees-per-second. The accelerometer measures linear acceleration (and gravity) by measuring the physical deflection of a similar microscopic spring-mass system.

Why do custom drone builds use 4-in-1 ESCs instead of individual ones?

Early drones used four separate ESCs mounted on the arms. Today, almost all custom builds use a single 4-in-1 ESC board mounted directly under the flight controller in the center of the frame. This shifts the heavy copper and MOSFETs to the exact center of gravity, improving the drone's moment of inertia and making it flip and roll faster. It also drastically reduces wiring complexity, as the main battery power only has to be soldered to one central board rather than routed out to four separate arms, reducing the risk of a mid-flight solder joint failure.