Skip to main content
All projects

Senior Design Project

STM32 Quadcopter Flight Controller

Development and Implementation of an STM32-Based Quadcopter Drone Flight Controller Board

In Progress

A flight controller is the system that allows a quadcopter to interpret sensor measurements, respond to pilot commands, and coordinate its four motors.

In this senior design project, we’re developing our own STM32-based flight controller from the ground up. The work brings together embedded programming, sensing, wireless communication, and control systems—progressively developing and testing these functions before moving toward a dedicated, custom-designed circuit board.

Assembled X-frame quadcopter on a lab bench, showing all four propellers, motor controllers, and the wired STM32 receiver.
Four-motor development prototype with the receiver and MPU-6050 mounted near the center of the frame.

How the flight controller works

A quadcopter steers by changing the speed of its four motors. The flight controller combines the pilot’s commands with motion measurements to decide what each motor should do.

  1. Pilot commands
    Desired tilt and throttle
    Motion sensor
    Acceleration and rotation
  2. STM32 flight controller

    Estimates tilt, calculates corrections, and combines them with throttle into four motor commands.

  3. ESCs and motors

    Electronic speed controllers use the commands to drive the motors.

Bench checks verified the controller’s motor-command calculations. Physical stabilization still needs testing.
Technical signal path and hardware
Controller hardware
Two STM32F407G-DISC1 development boards
Firmware
Embedded C
Sensing and radio
MPU-6050 and CC1101
Actuation
Four PWM-controlled ESCs
Project period
2026–2027

Transmitter and radio

  1. Joystick references

    Two joysticks provide throttle, roll, and pitch inputs.

  2. Command mapping

    The transmitter converts calibrated joystick inputs into reference commands.

  3. CC1101 wireless link

    The boards exchange command packets wirelessly through SPI2-connected CC1101 modules.

Receiver inputs

  1. Received references

    The receiver reads throttle, roll, and pitch commands from valid radio packets.

  2. MPU-6050 measurements

    The receiver reads accelerometer and gyroscope data over I²C2.

  3. Attitude estimation

    Bias correction and complementary filtering produce estimated roll and pitch angles.

Control and actuation

  1. Control calculations

    At a nominal 100 Hz, TIM6 schedules roll and pitch corrections using provisional proportional gains.

  2. Motor mixing

    The X-frame mixer combines throttle and both corrections into four motor commands.

  3. PWM outputs

    TIM4 generates four PWM signals at 50 Hz for the ESCs.

  4. Four ESCs

    Each speed controller receives its own PWM signal.

  5. Four brushless DC motors

    The ESCs drive the motors on the X-frame.

The motor-induced frame motion that would feed back into the IMU remains unverified. Bench checks used hand-applied tilts.

Our development journey

We tested the board’s functions one at a time before combining them on the four-motor frame. Each stage links to its experiment or next validation step.

  1. Experimentally Verified

    Set up and test the STM32 board

    Verified the STM32’s serial transmit and receive path with a loopback test and onboard LEDs.

  2. Experimentally Verified

    Measure the motor-control signals

    Verified four PWM outputs at about 50 Hz, with an independently set pulse width on each channel.

  3. Bench-Tested

    Estimate tilt from motion readings

    Confirmed MPU-6050 communication and checked that the roll and pitch estimates responded to hand-applied tilts.

  4. Bench-Tested

    Run one motor on the bench

    Ran a single motor from STM32 PWM commands and checked that hand-applied tilt changed the command.

  5. Experimentally Verified

    Check radio range and signal loss

    Verified wireless packet reception and confirmed that signal loss triggered a stop command in a single-motor test.

  6. Bench-Tested

    Test all four motors together

    The transmitter, receiver, and four motor channels worked together on the bench under a shared throttle command.

  7. Bench-Tested · Current stage

    Check how tilt changes motor commands

    The controller calculated different commands for the motor groups, and all four timer compare values matched the calculated commands.

  8. Planned

    Test stabilization and develop the PCB

    Measure how the frame responds to motor commands, tune the controller, and use the validated requirements to design and test the dedicated PCB.

Explore the Full Development Journey

Follow the experiments in order to see the test setups, decisions, observations, photographs, and limitations behind each stage.

The bench tests verify the control signals and calculations. Physical stabilization, motor speed and thrust measurements, systematic PID tuning, validation of the dedicated PCB, and autonomous flight remain ahead.

See All Stages and Experiments

Alongside the current STM32 prototype work, I have started learning PCB design with KiCad. This preparation will support the later transition from development boards and external modules toward a dedicated flight-controller PCB.

PCB Design & KiCad