A drone is an unmanned aerial vehicle that uses a central microcontroller to process inertial sensor data and adjust the speed of multiple brushless motors via electronic speed controllers to maintain stable flight. Understanding how a drone works from an electronics perspective shifts your design focus from simple DC motor switching to high-speed, closed-loop control systems requiring precise timing, low-latency sensor fusion, and high-discharge power distribution. Beginners commonly confuse the high-level navigation layer (GPS waypoints and RC stick inputs) with the low-level stabilization loop (IMU reading and ESC microsecond timing), assuming the drone simply reacts to the remote rather than constantly fighting physics thousands of times per second.

Circuit Design Shift: Moving from standard RC cars or rovers to multirotors changes your embedded architecture. You are no longer just sending PWM signals to a servo; you are managing Direct Memory Access (DMA) for SPI sensor polling, calculating floating-point PID math at 8kHz, and routing 100+ amps of transient current across a 4-layer PCB without inducing electromagnetic interference (EMI) in the gyroscope.

The Embedded Brain: IMU Sensor Fusion and PID Control

At the core of every modern drone is the Flight Controller (FC), typically built around an ARM Cortex-M4 or Cortex-M7 microcontroller like the STM32F405, STM32F722, or STM32H743. The FC's primary job is to read the Inertial Measurement Unit (IMU)—usually an ICM-42688-P or MPU6000 chip—which houses a 3-axis accelerometer and a 3-axis gyroscope.

The gyroscope measures rotational velocity (degrees per second), while the accelerometer measures linear acceleration and the gravity vector. The microcontroller reads this data over an SPI bus. To prevent the CPU from stalling while waiting for sensor data, modern FCs use DMA (Direct Memory Access). This allows the SPI peripheral to pull gyro data directly into RAM, triggering a hardware interrupt only when a fresh data packet is ready.

Loop Rates in 2026: A typical Betaflight or ArduPilot setup samples the gyroscope at 8kHz (every 125 microseconds) and runs the PID stabilization loop at 4kHz to 8kHz, depending on the MCU's clock speed and filtering load.

Once the error between the drone's current orientation and the pilot's desired orientation is calculated, the PID (Proportional-Integral-Derivative) controller generates a correction value. This value is mixed into the base throttle signal and sent to the Electronic Speed Controllers (ESCs). If the drone pitches forward, the PID loop commands the rear motors to spin faster and the front motors to slow down, leveling the craft in milliseconds.

Power Distribution and ESC Protocols

While the flight controller handles the math, the power distribution system handles the brute force. Multirotors use high-discharge Lithium Polymer (LiPo) or Lithium-Ion battery packs connected to a Power Distribution Board (PDB) or a 4-in-1 ESC stack. Let's look at the real-world electrical math for a standard 5-inch freestyle FPV drone.

Worked Numeric Example: 6S Power System Sizing

Assume you are building a drone with four 2306-size brushless motors (1750KV rating) powered by a 6S LiPo battery.

  • Nominal Voltage: 6S LiPo = 22.2V (Fully charged: 25.2V)
  • Peak Current per Motor: Bench testing shows each motor draws 35A at 100% throttle.
  • Total Peak Current: 4 motors × 35A = 140A.
  • Peak Power Output: 140A × 22.2V = 3,108 Watts.

At 140A, voltage sag will drop the battery voltage under load to roughly 20V, meaning your real-world peak power is closer to 2,800W. To handle 140A safely without melting connectors or causing excessive voltage drop, you must use an XT90 connector (rated for 90A continuous, but handles 140A burst safely for short flights) and 8 AWG or high-strand-count 10 AWG silicone wire for the main pigtail. The PCB traces on the 4-in-1 ESC must be thickened with solder or feature heavy copper pours (2oz or 3oz copper) to handle the current without delaminating.

To command the motors, the FC sends digital pulses to the ESCs. The industry has largely abandoned analog PWM (Pulse Width Modulation) in favor of digital protocols like DShot600. DShot600 transmits a 16-bit digital packet at 600 kilobits per second. This eliminates signal jitter, removes the need for ESC calibration, and enables 'Bidirectional DShot', where the ESC sends motor RPM data back to the FC on the same wire to allow for dynamic RPM notch filtering.

Where You Meet This in Practice

If you are wiring, building, or debugging a drone, you will interact with these embedded concepts in three specific areas:

  1. UART Wiring for Receivers: Modern RC systems like ExpressLRS use the CRSF protocol over a hardware UART. You must wire the receiver's TX pin to the FC's RX pin, and the receiver's RX to the FC's TX. You must also configure the FC's UART baud rate to 420,000 bps in the configurator to match the ELRS packet rate.
  2. PID Tuning and Filtering: When a drone oscillates or 'wobbles' in the air, it is usually a PID tuning issue or excessive motor noise feeding back into the gyroscope. Using tools like Betaflight's Blackbox logger, you can record the gyro noise frequencies and apply software notch filters to clean the signal before it hits the PID loop. For deeper tuning methodologies, refer to the ArduPilot initial tuning documentation.
  3. ESC Desync and Timing: If a motor stutters or fails to spin up, it is often a desync between the ESC's zero-crossing detection and the motor's back-EMF. This is usually fixed by updating the ESC firmware (like BLHeli_32 or AM32) and adjusting the motor timing advance or PWM frequency in the ESC configuration tool.
Component Standard Protocol / Part Key Electrical Metric
Flight Controller MCU STM32F722 / STM32H743 Clock speed (216MHz - 480MHz) dictates max PID loop rate.
Gyroscope/Accelerometer ICM-42688-P Communicates via SPI at up to 24MHz clock speed.
ESC Command Signal DShot600 / Bidirectional 600 kbit/s baud rate; requires DMA-enabled timer pins on the FC.
RC Receiver Link ExpressLRS (CRSF) UART at 420,000 baud; requires 5V logic level (or 3.3V with specific FCs).

Frequently Asked Questions

How does a drone hover in place without drifting?

A drone hovers by constantly running its inner-loop PID controller to maintain a zero-degree roll and pitch angle, while the outer-loop (if GPS or optical flow is equipped) makes micro-corrections to hold a fixed spatial coordinate. The flight controller reads the accelerometer to find the gravity vector (which points straight down) and uses the gyroscope to detect any rotational drift. It then adjusts the relative speeds of the four motors hundreds of times per second to keep the thrust vector perfectly aligned with gravity, counteracting wind and minor weight imbalances.

What is the difference between a flight controller and an ESC?

The flight controller (FC) is the 'brain'—a low-voltage (3.3V/5V) logic board that reads sensors, processes RC inputs, and calculates the required motor speeds. The Electronic Speed Controller (ESC) is the 'muscle'—a high-power circuit containing MOSFETs that takes the battery's raw high-voltage DC (e.g., 22.2V) and uses pulse-width modulation to synthesize a 3-phase AC waveform to drive the brushless motors. The FC tells the ESC what to do via a low-current signal wire; the ESC pulls the heavy current directly from the battery to spin the motor.

Why do modern drones use digital protocols like DShot instead of PWM?

Analog PWM (Pulse Width Modulation) represents motor speed by varying the width of a voltage pulse (usually 1000µs to 2000µs). This analog signal is susceptible to electromagnetic interference (EMI) from the high-current motor wires, causing signal jitter and requiring manual calibration of the ESC's throttle range. DShot sends a digital 16-bit binary packet. Because it is digital, it is entirely immune to analog noise, requires no calibration, and allows the ESC to send telemetry (like exact motor RPM) back to the flight controller on the exact same wire, enabling advanced software filtering.

How does an ESP32 compare to an STM32 for drone flight controllers?

While the ESP32 is a powerhouse for IoT, WiFi, and general maker projects, it is rarely used as the primary flight controller for high-performance multirotors. The STM32 series (F4, F7, H7) features dedicated hardware floating-point units (FPU), deterministic interrupt latencies, and advanced DMA controllers specifically suited for the microsecond-precision timing required by SPI sensor polling and DShot signal generation. The ESP32's background WiFi/Bluetooth tasks can introduce interrupt jitter that disrupts the strict timing of the PID loop. However, ESP32s are frequently used in drones as secondary companion computers for telemetry bridging, video streaming, or running ROS (Robot Operating System) nodes, while an STM32 handles the real-time stabilization.