The field of unmanned aerial vehicles (UAVs) has witnessed exponential growth, driven by advancements in microelectronics, sensor technology, and control theory. Among various configurations, the quadrotor drone has emerged as a dominant platform for research and commercial applications due to its mechanical simplicity, vertical take-off and landing (VTOL) capability, and hovering stability. However, traditional quadrotor designs often face challenges such as low power-to-weight ratios, sluggish dynamic response to attitude changes, and susceptibility to electrical noise from high-current motor drivers, which can destabilize the sensitive control electronics.
This article presents the design and implementation of a novel, integrated mechatronics quadrotor drone. The core innovation lies in the fusion of the electronic and mechanical subsystems, where the printed circuit board (PCB) itself forms the primary structural frame, replacing traditional carbon fiber or plastic arms. This approach significantly reduces the overall weight and complexity of the quadrotor drone. The system is built around a high-performance STM32 microcontroller, employs a Mahony complementary filter for robust attitude estimation, and utilizes a dual-loop cascade PID control strategy for precise flight dynamics. A meticulously designed power management system with isolated rails ensures reliable operation, separating noisy high-power circuits from sensitive control and sensor modules. The integration of multiple sensors, including an IMU and barometers, provides comprehensive state estimation for the quadrotor drone.

Hardware Platform Design for the Mechatronics Quadrotor Drone
The hardware architecture of the mechatronics quadrotor drone is designed for minimal weight, high reliability, and computational efficiency. The system integrates control, sensing, communication, and propulsion into a cohesive unit where the PCB serves as the central chassis.
Overall System Architecture
The functional block diagram of the quadrotor drone system encapsulates its mechatronic nature. All critical components are hosted on a multi-layer PCB, which also provides the physical structure for mounting the motors and propellers.
| Module | Key Component | Primary Function |
|---|---|---|
| Main Controller | STM32F411CEU6 | Central processor for sensor fusion, control algorithm execution, and system management. |
| Inertial Measurement Unit (IMU) | MPU9250 | Provides 9-DOF data (3-axis gyro, 3-axis accel, 3-axis magnetometer) for attitude estimation. |
| Altitude Sensor | Two FBN320 Barometers | Measures atmospheric pressure to estimate altitude with high precision. |
| Power Management | LTC4054, SX1308, XC6206 | Manages battery charging, provides stable 5V and 3.3V rails from a 3.7V LiPo battery. |
| Motor Drivers | N-Channel MOSFETs (x4) | Drives the four brushless DC motors with PWM signals from the MCU. |
| Communication | ESP8266 (Wi-Fi), NRF24L01+ (2.4GHz) | Enables communication with a ground station or remote controller. |
| Peripheral Interface | OpenMV Camera Header | Provides expansion capabilities for computer vision applications. |
Core Controller Circuit
The brain of the quadrotor drone is the STM32F411 microcontroller, chosen for its superior balance of performance, power efficiency, and peripheral set. Operating at up to 100 MHz, it provides the necessary computational horsepower for real-time sensor fusion and control algorithms. Its rich set of peripherals is fully utilized:
- Multiple SPI/I2C Interfaces: Used for high-speed communication with the MPU9250 IMU and other sensors.
- High-Resolution Timers: Generate the precise PWM signals required to control the four motor speeds independently.
- Direct Memory Access (DMA): Offloads data transfer tasks from the CPU, crucial for handling continuous sensor data streams without impacting control loop timing.
The circuit design around the MCU emphasizes signal integrity and power cleanliness. Each power pin is decoupled with a 0.1µF ceramic capacitor placed as close as possible to the pin on the PCB layout to filter high-frequency noise. A critical design note is the connection of a 4.7µF capacitor to the VCAP1 pin, which is essential for stabilizing the internal core voltage regulator, a step vital for reliable programming and operation of the quadrotor drone’s flight controller.
Sensor Suite Integration
Accurate state estimation is the foundation of stable flight for any quadrotor drone. This design incorporates a multi-sensor suite focused on agility and precision.
Attitude and Heading Reference System (AHRS): The MPU9250 is a system-in-package combining a 3-axis gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer. It communicates via I2C, allowing the main controller to read all nine degrees of freedom. The sensor’s data is fundamental for the Mahony filter algorithm. The pull-up resistors on the I2C lines are carefully selected to ensure reliable communication at 400 kHz.
Altitude Sensing: For vertical position control, two FBN320 barometric pressure sensors are employed. Their use provides redundancy and helps average out noise. Each sensor is flanked by decoupling capacitors (C35, C36) placed immediately adjacent to their power pins on the PCB to minimize noise from the digital supply, ensuring the clean analog readings necessary for centimeter-level altitude hold in the quadrotor drone.
Software Architecture and Control Algorithm Design
The software for the mechatronics quadrotor drone is architected around a real-time sensor-data-processing pipeline culminating in a robust control law. The primary tasks are attitude estimation and stabilizing control.
Sensor Fusion with Mahony Complementary Filter
The raw data from the IMU cannot be used directly due to inherent sensor imperfections. The gyroscope provides accurate short-term rotational rate but drifts over time due to integration. The accelerometer gives a stable long-term reference for the gravity vector but suffers from high-frequency noise due to motor vibrations and translational movements. The Mahony complementary filter elegantly fuses these signals.
The algorithm’s objective is to estimate the orientation quaternion Q. The gyroscope-measured angular velocities (ωx, ωy, ωz) are used to propagate the quaternion forward in time via its time-derivative. The relationship between the quaternion derivative and the body-axis rotation rates is given by:
$$
\dot{\mathbf{Q}} = \frac{1}{2} \mathbf{Q} \otimes \begin{bmatrix} 0 \\ \omega_x \\ \omega_y \\ \omega_z \end{bmatrix}
$$
In matrix form, the discrete-time update (using a first-order Runge-Kutta approximation) is:
$$
\begin{bmatrix} q_0 \\ q_1 \\ q_2 \\ q_3 \end{bmatrix}_{t+\Delta t} = \begin{bmatrix} q_0 \\ q_1 \\ q_2 \\ q_3 \end{bmatrix}_{t} + \frac{1}{2} \Delta t
\begin{bmatrix}
-\omega_x q_1 – \omega_y q_2 – \omega_z q_3 \\
\omega_x q_0 – \omega_y q_3 + \omega_z q_2 \\
\omega_x q_3 + \omega_y q_0 – \omega_z q_1 \\
-\omega_x q_2 + \omega_y q_1 + \omega_z q_0
\end{bmatrix}_{t}
$$
where Δt is the sampling period. This prediction is then corrected using the accelerometer data. The core of the correction is the vector cross-product between the estimated gravity vector (from the current quaternion) and the measured gravity vector (from the accelerometer, normalized). For small angles, the magnitude of this cross-product approximates the orientation error:
$$
\mathbf{e} \approx \mathbf{\hat{g}} \times \mathbf{\bar{a}}
$$
where ē is the error vector, ĝ is the estimated gravity vector in body frame, and ā is the normalized accelerometer measurement. This error is fed into a PI controller to generate a gyroscope bias correction:
$$
\mathbf{\omega}_{correction} = K_p \mathbf{e} + K_i \int \mathbf{e} \, dt
$$
The corrected angular rate ωcorrected = ωgyro + ωcorrection is then used in the quaternion update equation. This fusion provides a stable, drift-free estimate of the quadrotor drone’s roll (φ) and pitch (θ) angles. The yaw angle (ψ) is derived similarly, potentially using the magnetometer, though in minimal configurations it can be tracked by the gyroscope’s z-axis with the understanding of slow drift.
The performance advantage of this method is significant. The table below contrasts the characteristics of the Mahony filter with using the MPU9250’s internal Digital Motion Processor (DMP).
| Feature | Mahony Complementary Filter | MPU9250 DMP |
|---|---|---|
| Customizability | High (adjustable Kp, Ki) | Low (fixed proprietary algorithm) |
| Computational Load | Moderate, on main MCU | Offloaded to IMU co-processor |
| Dynamic Response | Fast, tunable | Slower, optimized for general motion |
| Latency | Very low (direct sensor read) | Higher (DMP output delay) |
Dual-Loop Cascade PID Control Strategy
To achieve stable and responsive flight, the quadrotor drone employs a cascade PID control architecture. This structure effectively handles the nonlinear dynamics and inherent coupling between axes. A single PID loop often proves inadequate as it tries to control angle directly with motor commands, leading to overshoot and instability.
The cascade control uses two loops: an outer attitude (angle) loop and an inner rate (angular velocity) loop.
- Outer Loop (Angle PID): This loop takes the desired roll, pitch, and yaw angles (φd, θd, ψd) from the pilot or autonomous navigation system and compares them with the estimated current angles (φ, θ, ψ) from the Mahony filter. The output of this PID controller is the desired angular rate for each axis.
$$
\omega_{desired} = PID_{angle}(Angle_{error}), \quad \text{where } Angle_{error} = Angle_{desired} – Angle_{estimated}
$$ - Inner Loop (Rate PID): This faster, higher-frequency loop takes the desired angular rate from the outer loop and compares it with the measured angular rate (ωx, ωy, ωz) directly from the gyroscope (or filtered rate). Its output is the motor throttle correction signal.
$$
MotorCorrection = PID_{rate}(Rate_{error}), \quad \text{where } Rate_{error} = \omega_{desired} – \omega_{measured}
$$
The inner loop’s primary job is to make the quadrotor drone respond quickly and dampen disturbances, acting like an “angular rate stabilizer.” The outer loop then shapes this stable platform to achieve the desired orientation. This separation of concerns greatly improves performance. The final motor signals for the four motors (M1, M2, M3, M4) are mixed from the PID outputs (for roll, pitch, yaw) and the base throttle command (T). For an “X” configuration quadrotor drone, the mixing is:
$$
\begin{aligned}
M1 &= T + PID_{pitch} + PID_{roll} – PID_{yaw} \\
M2 &= T + PID_{pitch} – PID_{roll} + PID_{yaw} \\
M3 &= T – PID_{pitch} – PID_{roll} – PID_{yaw} \\
M4 &= T – PID_{pitch} + PID_{roll} + PID_{yaw}
\end{aligned}
$$
Typical parameters for the cascade control of a small mechatronics quadrotor drone might be in the ranges shown below, though fine-tuning is always required for a specific build.
| Control Loop | Proportional (P) | Integral (I) | Derivative (D) | Update Rate |
|---|---|---|---|---|
| Angle (Outer) | 3.0 – 6.0 | 0.01 – 0.05 | 0.0 – 0.2 | 250 – 500 Hz |
| Rate (Inner) | 0.1 – 0.3 | 0.001 – 0.01 | 0.01 – 0.05 | 500 – 1000 Hz |
Power System and Propulsion Design
A reliable and clean power supply is critical for the sensitive electronics of a mechatronics quadrotor drone. The design segregates power domains to prevent noise from the high-current motor circuits from affecting the control logic.
Intelligent Battery Management and Voltage Regulation
The system is powered by a single-cell 3.7V Lithium-Polymer (LiPo) battery. The power management subsystem performs three key functions: charging, multi-rail voltage conversion, and isolation.
1. Battery Charging Circuit: Based on the LTC4054 linear charger IC, this circuit allows convenient USB charging. The charge current (IBAT) is programmed via a single resistor (RPROG) according to:
$$
I_{BAT} = \frac{900V}{R_{PROG}}
$$
A red LED provides clear visual charging status. The circuit includes thermal protection and automatically terminates charging when the battery is full, ensuring safety and longevity for the quadrotor drone’s power source.
2. Voltage Conversion Rails:
- 3.7V to 5V Boost Converter: The SX1308 switching regulator efficiently boosts the battery voltage to a stable 5V rail. The output voltage is set by a feedback resistor divider (R19, R20):
$$
V_{OUT} = V_{REF} \left(1 + \frac{R_{19}}{R_{20}}\right)
$$
where VREF is typically 0.6V. This 5V rail powers peripherals like the ESP8266 module and provides input for the subsequent 3.3V regulators. - Dual 3.3V Low-Dropout Regulators (LDOs): Two separate XC6206 LDOs generate 3.3V from the 5V rail. One (3V3_1) powers the STM32, IMU, and other core sensors. The second (3V3_2) is dedicated solely to the ESP8266 Wi-Fi module. This power domain isolation is crucial because the ESP8266 can cause significant current spikes during transmission, which would introduce noise on the shared 3.3V line and destabilize the sensor readings of the quadrotor drone.
High-Efficiency Motor Drive Circuitry
The propulsion system uses four coreless brushed DC motors (720 size) for their simplicity and low cost. Each motor is driven by a dedicated N-channel MOSFET circuit. When the MCU outputs a high PWM signal to the gate of the MOSFET through a current-limiting resistor (R4), the switch closes, allowing battery current to flow through the motor. The speed of the quadrotor drone’s motor is directly controlled by the duty cycle of this PWM signal. A Schottky diode (D6) is placed across each motor as a flyback diode to safely dissipate the inductive kick-back voltage generated when the MOSFET turns off, protecting the semiconductor switch. The specifications of the motor are summarized below.
| Parameter | Specification | Note |
|---|---|---|
| Model | 720 Coreless Brushed DC | |
| Rated Voltage | 3.0V – 4.2V | Driven directly from LiPo |
| No-load Current | ~0.2A | |
| Stall Current | > 1.9A | MOSFETs are rated accordingly |
| Thrust per Motor | > 20g @ 4V | Provides > 80g total thrust |
System Integration: PCB as a Structural Element
The mechatronics philosophy is fully realized in the physical construction of this quadrotor drone. The multi-layer PCB is not merely a carrier for components; it is designed to be the primary airframe. The four arms of the quadrotor drone are extensions of the main PCB, with the motors soldered directly onto pads at their ends. This eliminates the need for separate arms, screws, and wiring harnesses, leading to a dramatic reduction in weight and assembly complexity.
Design Considerations:
- Layer Stack-up: A 4-layer stack-up (Signal, GND, PWR, Signal) is typically used. The continuous ground plane in the second layer provides excellent noise shielding and a stable reference for high-speed signals, which is vital for the clean operation of the IMU and MCU in the quadrotor drone.
- Mechanical Robustness: The PCB material (FR-4) and thickness (e.g., 1.6mm) are chosen to provide sufficient rigidity to withstand flight stresses and minor impacts. Copper pours on outer layers add strength.
- Thermal Management: The MOSFETs and voltage regulators dissipate heat. Thermal vias under these components and exposed copper pads help transfer heat away, ensuring reliable operation of the quadrotor drone.
- Weight Optimization: The PCB layout is optimized to minimize size and unused space, directly contributing to a lower overall weight and higher agility for the quadrotor drone.
Hardware Testing and Performance Validation
The completed mechatronics quadrotor drone system underwent rigorous testing. The integrated PCB-based frame resulted in a remarkably compact and lightweight platform, with a diagonal motor-to-motor distance under 10cm and an all-up-weight (including battery) under 20g.
Dynamic Response Test: The performance of the Mahony complementary filter was evaluated by comparing its estimated pitch angle output against the angle derived from the MPU9250’s internal DMP. The quadrotor drone’s IMU was subjected to rapid manual tilting. The results clearly showed that the custom Mahony filter implemented on the STM32 exhibited significantly faster response and lower latency in tracking the sudden angle changes compared to the DMP output. This superior dynamic performance is directly attributable to the higher update rate and tunable gains of the Mahony algorithm, enabling more responsive control of the quadrotor drone.
Flight Performance: With tuned PID parameters, the quadrotor drone demonstrated stable hover, precise attitude control, and agile maneuvers. The isolation of power domains effectively eliminated control glitches that are often caused by motor noise. The key performance metrics achieved are listed below.
| Metric | Measured Performance |
|---|---|
| Total Weight | 18 grams |
| Frame Size (Diagonal) | 9.5 cm |
| Hover Throttle | ~65% |
| Attitude Control Bandwidth | > 10 Hz |
| Flight Time (with 150mAh LiPo) | 10 – 12 minutes |
| Communication Range (Wi-Fi) | > 50 meters (open field) |
Conclusion
This article has detailed the comprehensive design of a fully integrated mechatronics quadrotor drone. By adopting a system-level approach where the PCB serves as both the electronic backbone and the mechanical frame, a highly compact, lightweight, and reliable platform was achieved. The selection of the STM32F411 microcontroller provided the necessary computational resources, while the implementation of the Mahony complementary filter and a dual-loop cascade PID control algorithm ensured robust, low-latency attitude estimation and precise, stable flight dynamics. The thoughtful design of the power system, with dedicated voltage rails and domain isolation, proved essential in maintaining signal integrity for the sensitive sensors amidst the electrically noisy environment of the motor drivers.
The resulting quadrotor drone is not merely a collection of components but a synergistic mechatronic system. Its excellent power-to-weight ratio, dynamic responsiveness, and stable flight characteristics validate the design choices. This integrated approach paves the way for further miniaturization and cost reduction in agile micro aerial vehicles. The platform is highly suitable for research in control algorithms, swarm robotics, and embedded system design, demonstrating significant practical value as a high-performance mechatronics quadrotor drone.
