Professional Documents
Culture Documents
Development of Flight Controller Using STM Microcontroller Board
Development of Flight Controller Using STM Microcontroller Board
Microcontroller Board
Gokul V, Jayashree T R
Department of Aeronautical Engineering
Rajalakshmi Engineering College
Chennai, India
gokul.v.2018.meav@rajalakshmi.edu.in, jayashree.tr@rajalakshmi.edu.in
Abstract—Nowadays, drones or so-called UAV's are modified according to our needs because they are hardware-
extensively used both in the civil sector and military sector. wise or wholly proprietary. It is necessary to know the
Flight controllers used in UAV’s is the main embedded functioning of the flight controller to modify it. So a flight
hardware electronic component where all the processing take controller is developed by using STM32 microcontroller as a
place. It is considered to be the heart for the drones. There are
base along with various other sensors with the objective to get
several drone flight controller platforms available but they are
either hardware wise or wholly proprietary and doesn't allow high customisation.
for much customisation. For academia it is necessary to know
the functioning of the drone to customise it. So a flight controller
is developed by programming a STM32 (Blue Pill) II. LITERATURE REVIEW
microcontroller to get a high degree of customisation. Sensors
like gyro, barometer, gps, etc., are interfaced with HaiYang Chao, YongCan Cao, YangQuan Chen et al in
microcontroller and the values obtained are manipulated with [1] presented a survey on the autopilot system for small or
control algorithm to achieve the functioning of flight controller micro unmanned aerial vehicles (UAVs). It discusses on
for flying. A telemetry system is also developed to get the useful various commercial, open source and research autopilot
flight information in real time, when the drone is flying for systems. They a re explained on both the hardware and
monitoring purpose. The aim of this project is to create a flight software viewpoints. Several autopilots available in the
controller where the operation of hardware and software are market are compared in terms of sensors and microcontroller
well known in order to get a high customisation where the user
capability. It concludes by stating that design of software is
can modify the code or hardware according to the needs for any
specific purpose.
far more crucial than the hardware for flight controller.
Keywords—uav, flight controller, control algorithm, telemetr y Emad Ebeid, Martin Skriver, Jie Jin et al in [2]
discusses the components of flight controller and the UAV
system. This survey paper also covers both the hardware and
I. INTRODUCTION software of flight controller. It compares the available open
source flight controller platforms depending upon the features
Drones can be broadly classified into two namely fixed - and concludes that on hardware side, pixhawk is best due to
wing and multirotor. In multirotors, quadcopter or quadrotor its flexibility and capabilities. Similarly on software side, it
is a classic arrangement used widely. The quadcopter uses concludes ardupilot is full fledged and comparatively best
four propellers to produce lift and to control the dynamics of software.
drones. Out of four propellers, two rotate clockwise while the
other two rotate counterclockwise. By varying the speed in Sarah Pontes Madruga, Augusto de Holanda B. M.
rotors, the drone is steered and the desired direction is Tavares, Alisson Vasconcelos de Brito, Tiago Pereira
achieved. Nascimento et al in [3] developed a flight controller for
quadcopter based on raspberry pi 3. It explains the
The main components which constitute the quadrotor methodologies and technicalities involved for developing a
are flight controller, airframe, motors propellers, battery, flight controller. It explains on how the motor and other
ESC, transmitter and receiver. A flight controller has sensors sensors communicate with the flight controller through
onboard such as MEMS gyroscope, MEMS barometer, etc., communication protocols. It concludes by saying that
where it gathers data and manipulate it with control methods Implementing on open source hardwares and softwares and
to achieve optimal flying. In response to the input received developing own control algorithms for drones will be a good
from the receiver, the flight controller changes the rpm of the option for better understanding.
motors.
S. Sabikan, S. W. Nawawi et al in [4] proposed an open
The flight controller can be classified into three sections source platform for flight controllers in drones where UAV
namely hardware part, software part and ground control can be used for any outdoor applications. This paper
station. The flight controller hardware consists of experimented autopilot in outdoors and provided results on
microcontroller, sensors and other electronic components. performance, stabilization, interference and vibration. It
The flight controller software a cquires data from sensors and concludes that because of magnetic field interference by
by use of certain control algorithms, it manipulates and motors, battery and ESC’s, the magnetometer may point
operates the drone. The ground control station receives data wrong direction. High vibrations on flight controller may
from the drone when it is on flight and displays the flight data cause accelerometer based altitude and horizontal position
information such as GPS coordinates, battery voltage, speed, estimations to drift far off from the actual values.
etc. There are different flight controller platforms available
for drones, in which we can mainly point out are Pixhawk, Zhaolin Yang, Feng Lin, Ben M. Chen et al in [5]
Naza, Ardupilot Mega, etc. These platforms cannot be analyses various autopilot platforms available and it
introduces various control methodologies to improve the
robustness and performance of the flight controller. It further
emphasises that for long term reliability of flight controller,
Environmental Stress Screening (ESS) needs to be carried
out. i.e., random vibration test and temperature cycling test.
V. ANALYSIS
The initial imu values (roll, pitch, yaw) is fed into the
controller as an input and depending upon the current state Although the control algorithm is used, the test flight
and the command given, it calculates the error rate and was not stable leading to many drifts. The problem was due
reduces the error by controlling the motors by giving ppm to the gain values. After little tuning, the drone slowly got
pulses to the esc’s which in turn controls the motors and stabilized. The gain values are fine tuned till the drone is
corrects the imu angles of the quadcopter. By this way it completely stabilized. The final gain values after tuning are
stabilizes the drone and neglects the wobbling issues. mentioned below.
In the main program loop an interrupt will be acting, i.e., P Gain = 1.0
always the drone tries to stabilize by processing the PID
I Gain = 0.02
calculations, but when the transmitter sends signals to the
receiver an interrupt will start acting pausing the PID D Gain = 10.0
calculations. When the receiver signals are sensed, interrupt
The readings of the battery voltage was little error
starts acting by measuring the rising edge pulse, then PID
prone due to the interferences of the electronic speed
continues to resume. Immediately when falling edge pulse is
controllers. In order to compensate the error a filter is used.
detected interrupt start acting measure by the falling time and
The formula for the filter is shown below.
again the main program loop will be resumed.
Battery Voltage = (Previous loop voltage * 0.92) + (analog
B. Voltage Divider
value / 1410.1) (3)
In quadcopter it is very much important to know the
The MS5611 barometer is very sensitive to light. When it
battery voltage because when the battery drains during flight,
is exposed to light it gives an error rate of around 5%. In order
drone may crash leading to components malfunction. So it is
to neglect this, the barometer sensor is enclosed inside the
necessary to know the battery voltage. In order to find the
casing with holes drilled on the sides for the air to pass by.
battery voltage, a voltage divider circuit is used in the flight
The comparison at normal condition and light exposure
controller. The voltage divider converts the high voltage
condition is shown in the graph below. (For reference) The
number to smaller one. We need to convert high voltage to
test was done at an height of 20m.
smaller voltage because STM32 is 3.3V tolerant, any voltage
above 3.3V connected to STM32 will damage the board. So
a voltage divider circuit is used. The maximum output voltage
Fig.7. Flight Controller
REFERENCES
[1] HaiYang Chao, YongCan Cao, and YangQuan Chen, “Autopilots
for Small Unmanned Aerial Vehicles: A Survey,” International
Journal of Control, Automation, and Systems, Vol. 8, No.1,
pp.36-44, 2010.
[2] Emad Ebeid, Martin Skriver, Jie Jin, “A Survey on Open-Source
Flight Control Platforms of Unmanned Aerial Vehicle,”
Euromicro Conference on Digital System Design, 2017.
[3] Sarah Pontes Madruga, Augusto de Holanda B. M. Tavares,
Alisson Vasconcelos de Brito, Tiago Pereira Nascimento, “A
Project of an Embedded Control System for Autonomous
Quadrotor UAVs,” Brazilian Symposium on Robotics, 2018.
Fig.6. IMU Data [4] S. Sabikan, S. W. Nawawi, “Open-Source Project (OSPs)
Platform for Outdoor Quadcopter. Journal of Advanced Research
Design,” Vol. 24, No. 1, pp. 13-27, 2016.
[5] Zhaolin Yang, Feng Lin, Ben M. Chen, “Survey of Autopilot for
VI. CONCLUSION: Multi-rotor Unmanned Aerial Vehicles,” IECON 2016 - 42nd
Annual Conference of the IEEE Industrial Electronics Society,
The flight controller is developed by interfacing the pp. 6122-6127, 2016.
sensors and by implementing the PID control algorithm. The [6] H. Lim, J. Park, D. Lee, and H. J. Kim, “Build your own
telemetry system is also developed to monitor the flight datas quadrotor: Open-source projects on unmanned aerial vehicles,”
IEEE Robotics & Automation Magazine, vol. 19, no. 3, pp. 33–
when the drone is flying. The hardware and software 45, 2012.
operations of the flight controller are open and well known [7] Sangook Cho, Sanghyuk Park and Keeyoung Choi, “Autopilot
paving way for high customisation where the user can modify Design for a Target Drone using Rate Gyros and GPS,”
it according to their needs in future to accomplish any International Journal of Aeronautical and Space Science, Vol. 13,
No. 4, pp. 468-473, 2012.
application oriented tasks.
[8] Atheer L. Salihland and M. Moghavvemi, “Flight PID Controller
For future work, we can further use it for any application Design for a UAV Quadrotor,” Scientfic Research and Essays,
Vol. 5, No. 23, pp. 3660 – 3667, 2010.
oriented tasks such as using it for surveillance, agriculture, [9] C. Nam and S. Danielson, “Development of a Small UAV with
weather monitoring, etc. Nowadays usage of drones has been real-time video surveillance,” American Society for Engineering
vast in every industrial sector and finding new ways to Education, 2011.
incorporate for making their task easy. This project can be [10] H. Wu, D. Sun, and Z. Zhou, “Micro air vehicle: Configuration,
analysis, fabrication, and test,” IEEE/ASME Trans. on
very useful in research sectors and other areas to accomplish Mechatronics, vol. 9, no. 1, pp. 108-117, 2004
their needs of application by modifying the flight controller. [11] R. Beard, D. Kingston, M. Quigley, D. Snyder, R. Christiansen,
W. Johnson, T. Mclain, and M. Goodrich, “Autonomous vehicle
technologies for small fixed wing UAVs ,” AIAA J. Aerospace
Computing, Information, and Communication, vol. 2, no. 1, pp.
92-108, 2005.
[12] Rongbing Li, Jianye Liu, Ling Zhang, Yijun Hang,
“LIDAR/MEMS IMU integrated navigation (SLAM) method for
a small UAV in indoor environments,” DGON Inertial Sensors
and Systems (ISS), 2014.
[13] Bolun Zeng ,JIANBO ZHANG ,LANG CHEN ,YAO WANG,
“Self-balancing car based on ARDUINO UNO R3,” IEEE 3rd
Advanced Information Technology, Electronic and Automation
Control Conference (IAEAC), 2018.
[14] LAI Gui-chuan,HUANG Hua-wei, “Design of High Resolution
Pressure and Temperature Measurement System Based on
MS5611-01BA01,” Journal of Sichuan University of Science &
Engineering(Natural Science Edition, 2012.
[15] Aleksandar Rodi´c, Gyula Mester, and Ivan Stojkovi´c,
“Qualitative Evaluation of Flight Controller Performances for
Autonomous Quadrotors,” Intelligent Systems: Models and
Applications, pp. 115-134, 2013.
[16] Lozano, R., Castillo, P., Dzul, A., “ Stabilization of a mini
rotorcraft having four rotors,” IEEE/RSJ International
Conference on Intelligent Robots and Systems, Sendai, Japan,
pp. 2693–2698, 2004.
[17] Turczi, A., “Flight Control System of an Experimental
Unmanned Quad-Rotor Helicopter,”10th International
Symposium of Hungarian Researchers on Computational
Intelligence and Informatics, 2009.