Select Page

I Team Details
1. Toms Jiji Varghese (22567)
2. Sanidhya Saxena (22586)
II Introduction
Quadcopters, also known as multirotors or drones, are popular flying machines with diverse applications.
This report outlines the development of a quadcopter
ight controller using the STM32F407 microcontroller, MPU6050 inertial measurement unit (IMU), Flysky FS-
I6 remote control, and sensor fusion techniques for flight stabilization.
III Hardware
ˆ Microcontroller (MCU): STM32F407 – An ARM-
based MCU with suffcient processing power for real-time oating point ight control algorithms and mo-
tor control.
ˆ Inertial Measurement Unit (IMU): MPU6050 – A 6-
DOF sensor which provides 3-axis gyroscope and ac-
celerometer data crucial for attitude estimation and
stabilization.

Remote Control (RC): Flysky FS-I6 – A widely used
RC system with a transmitter and receiver.
ˆ Electronic Speed Controllers: Commonly available
BLDC motor speed controllers based on SimonKrmware.
ˆBrushlessDC Motors/Batteries:
1000KV
A2212/13T BLDC motors and Lipo Batteries

IV Software Development
4.1 Development Environment:
An STM32CubeIDE will be used for code develop-ment, compilation, and debugging. along with serial
terminals programs like teraterm/matlab programs for PID tuning.

4.2 Key Software Modules:
Sensor Driver: This module acts as the bridge be-tween the ight controller and the MPU6050 IMU. It
handles I2C communication to initialize the sensor,reads raw gyroscope and accelerometer data, and applies calibration osets to eliminate inherent biases.

Sensor Fusion: Since raw sensor data can be noisy and prone to drift, this module employs a sen-
sor fusion technique (either complementary flter orKalman flter) to combine gyroscope and accelerom-
eter data. This results in a more accurate and robustestimation of the quadcopter’s orientation (pitch,
roll, and yaw).

PPM Decoder: The PPM signal received from theFlysky FS-I6 remote control contains all control
channel information. This module will efciently de-code the signal with the help from interrupts to ex-
tract individual control inputs for pitch, roll, throttle,and yaw.

PID
Control Loops (Core for Stability):
Proportional-Integral-Derivative (PID) control loops are the backbone of flight stability. These
control loops continuously analyze sensor data (obtained from sensor fusion) and compare it to
desired flight attitudes (setpoints received from theRC). Based on these comparisons, the PID loops
adjust motor control signals in real-time to maintain
a stable flight

Motor Control: This module translates the processed control signals (from PID loops and throttle) into

PWM (Pulse Width Modulation) signals for eachmotor. Utilizing the STM32F407’s dedicated PWM
peripherals, these signals are sent to the ESCs, ul-timately controlling the speed of each brushless DC
motor.
ˆ Battery Voltage Monitoring (Optional): The ADCn the STM32F407, along with an external voltage
divider circuit and a digital lter, can be used tomonitor battery voltage continuously. This data can
trigger failsafe mechanisms like motor shutdown orautomatic landing if the voltage dips below a pre-
defined safety threshold, protecting the Li-Po batteryfrom damage.

4.3 Optimization for Real-time Performance:
A crucial aspect of the software development is ensuringreal-time performance. All software routines will be im-
plemented efficiently, aiming for motor speed updates inthe millisecond range. This rapid update rate minimizes
control lag and enables a more responsive flight experi-ence.

V Balancing Processing Demands
The flight controller juggles several real-time tasks: sensordata acquisition, control algorithm execution, and motor
control signal generation. Balancing these demands on the STM32F407 MCU is crucial.

The accuracy of PWM signals determines the responsive-ness and efficiency of motor control.

Referances:

[1] (http://www.brokking.net/ymfc-
32_main.html)
[2] https://en.wikipedia.org/wiki/Kalman_lter
[3] https://github.com/CarbonAeronautics
[4] Quadcopter
Design
MATLAB
(https://www.youtube.com/playlist?list=PLPNM6NzY
yzYqMYNc5e4_xip-yEu1jiVrr)

Video: Quad-copter