SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 1(4); March (2021), pp. 204–208
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

Design and Implementation of Quad-rotor UAV Based on Remote
Control Equipment and Program
Junjie Lin, Chunxia Zhang, Yizhun Peng, Ting Zhao, Wangfeng He

College of Electronic Information and Automation, Tianjin University of Science and Technology, Tianjin,300222, China

ARTICLE INFO
Article History
Received 09 November 2019
Accepted 27 November 2020
Keywords
UAVOpenMV module
IMU unit

ABSTRACT

Quad-rotor UAV is an unmanned aircraft controlled by radio remote control equipment andindependent program control device. In the past five years, unmanned intelligent equipment hasattracted extensive attention. At present, the application of UAV in aerial photography, agriculture,
plant protection, mapping and other fields has greatly expanded the application of UAV itself.
Our UAV is based on TI MSP432, which can be connected to PC via USB port. This printed
circuit board is used to transmit the program for the flight control of UAV. The OpenMV module
serves as the data source of the line patrol controller, which is the top-level controller, the samelevel as the remote controller. The IMU unit calculates information to attitude controller, in orderto keep the flight of UAV stable. After the IMU solution information is fused with the opticalflow sensor, the information is sent to the horizontal controller to control the flight of the UAV inthe horizontal direction. Similarly, After the IMU information is fused with the laser height
information, the height controller is applied to control the flight height of UAV.

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

company for flight control, OpenMV3 camera for machine
vision processing [4], optical flow sensor and othertechnologies, through program design and hardware
production, the UAV can complete various tasks. In
various fields of military and residential life, the design

1. Introduction
With the rapid development of the times and the rise of theintelligence of unmanned devices, the unmannedintelligent devices have received extensive attention in thepast 5 years. Four rotor UAV is a kind of UAV controlled
by radio remote control equipment and independent
program control device [1]. At present, the application of
UAV in aerial photography, agricultural plant protection,
mapping and other fields has greatly expanded the use of
UAV itself [2][3].
Compared with the general aircraft, unmanned aerial
vehicles in both military and civilian aspects of the wide
range of applications. The advantage of drones is that they
can remotely control the aircraft and can even execute inaccordance with prescribed procedures, thereby freeing up
human resources.
Based on the above discussion, this design focuses on
the basic function realization of UAV and the realizationof camera and line patrol function based on OpenMV. This
design system uses MSP432 microcontroller of TI

has a very high practical value.
2. Main control device
2.1. Selection of controller

With the development of electronic technology, we havemore possibilities in the selection of main controller. Our
team had planned to use STM32 single-chip computer andTI series single-chip computer respectively to carry out theflight control experiment of the line patrol robot.
Compared with 51 single-chip microcomputer, STM32
single-chip microcomputer has the advantages of fasterprocessing speed and more peripheral serial ports. Besides,
our team members are familiar with the application ofSTM32 single-chip microcomputer. Therefore, we choose
this single-chip microcomputer in the beginning. We read

Corresponding author’s E-mail: pengyizhun@tust.edu.cn, URL: www.tust.edu.cn

204the data collected by MPU6050 through the programming
code, determined the state of the aircraft, and then carriedout the corresponding data processing.
We find that in the flight control of Quad-rotor UAV,
compared with TI series single-chip microcomputer,
STM32
single-chip
microcomputerhas
some
disadvantages in program processing speed and power
consumption. When the main controller of Quad-rotor
UAV has a large amount of computation, STM32 cannot
meet our requirements.
TI uses the Cortex-M kernel, which contains the accessto the complete arm instruction set. In addition. It also
includes the DSP extension instruction and a floating-point
FPU module, which improves the performance comparedwith STM32. Therefore, after the discussion with teammembers, we chose TI series MSP432 single-chip
microcomputer.

OpenMV is an embedded camera with STM32 as theprocessing core. It is equipped with micro Pythoninterpreter and supports Python Programming on theembedded. This system uses OpenMV instead of computer
to carry out a series of image acquisition and processing
tasks, and can directly control the pan tilt system,
simplifying the structure of the system, making the wholesystem less cost, smaller volume, and easier to apply toreal life scenarios. When the whole moving target tracking
system works offline, the system only takes up 10 cm *10cm * 10 cm space, which is incomparable with anotherscheme. In addition, the anti-interference ability ofOpenMV is stronger than that of Ov7725 camera.
To sum up, our team decided to choose the OpenMV3camera and use Python language for machine vision
processing. OpenMV is shown in the Fig.1.

2.2. Control system scheme
We adopt the scheme of minimum system of single-chip
microcomputer. The Smallest single-chip system withhigh-performance analog technology and a wealth of onchip peripherals can significantly reduce the peripheralcircuit design and reduce the difficulty of system design.
It is very suitable for our system design, and this scheme
has an efficient and flexible development environment.
3. Machine vision tools

Fig.1. OpenMV

4. Microcontroller
MSP430 is a 16-bit simplified instruction set
microcontroller. Developers can flexibly write commonsystems, including timers, input/output expanders, system
reset controllers, electrically erasable programmable readonly memory (EEPROM), etc.
32 in MSP432 represents that the MCU is 32-bit.
Compared with 16-bit RISC (reduced instruction set)
MSP430, MSP432 adopts 32-bit RISC, which greatlyimproves the performance. While optimizing theperformance, the power loss is reduced, and its effective
power consumption and standby power consumption are
only 95 μ A/MHz and 850nA/MHz respectively.
After comprehensive consideration, we choose MSP432controller. MSP432 board is designed as shown in theFig.2.

Optical flow is the apparent movement of the image
brightness mode. Under certain conditions, the motion
information of an object can be obtained based on theoptical flow [5]. We install the optical flow sensor at thebottom of the drone, use the optical flow method to analyze
the ground feature information collected by the camera,
calculate the speed of the aircraft relative to the ground,and combine the speed obtained by the optical flow
method with the speed obtained by the inertial element toobtain more accurate Data, and then obtain the relative
position information of the aircraft through integration toachieve positioning. Optical flow methods are divided into
two categories, dense and sparse. Among them, dense
optical flow calculation is complex and requires a large
amount of resources. It requires the processor to have highcomputing power, so it cannot be applied to embedded
platforms [6].
The maximum output of Ov7725 camera collected
image information is 300,000 pixel images, which issmaller than the maximum output pixel of OpenMV.
Ov7725 has its own source crystal oscillator and voltage
regulator chip, and has a FIFO frame buffer chip-the chip
contains 384K FIASH. It can buffer two frames of QVGA
image data, but the stability is relatively poor.

Fig.2. MSP432 board205

5. Mpu6050 sensorinterpolation can only use quaternions. In other forms, wemust turn to quaternion, then turn back after interpolation,and then get the attitude solution [8] [9].

Mpu-6050 is the first integrated 6-axis motion processing
component in the world. Compared with the multicomponent scheme, Mpu-6050 avoids the problem of thedifference between the time axis of the combined
gyroscope and the accelerator, and reduces a lot ofpackaging space. Mpu-6050 has a full sensing range of ±250, ± 500, ±1000 and ±2000°/sec(DPS), which canaccurately track fast and slow movements.

7. Hardware circuit design
7.1. Overall system diagram
The overall diagram of the system is shown in the Fig.3.

5.1. Calculation
The mpu6050 sensor has an internal digital LPF, which
can be modified by setting the value of the config register.
This is the initialization program of mpu6050 sensor
written by our team during the calculation.
I2C_Write_Byte(MPU6050_ADDRESS,PWR_MGMT_1, 0x80);
I2C_Write_Byte(MPU6050_ADDRESS, SMPLRT_DIV,0x00); 0x00(1000Hz)
I2C_Write_Byte(MPU6050_ADDRESS,PWR_MGMT_1, 0x03);
I2C_Write_Byte(MPU6050_ADDRESS,CONFIGL,0x04); 0x04(20Hz)
I2C_Write_Byte(MPU6050_ADDRESS,GYRO_CONFIG, 0x18);
I2C_Write_Byte(MPU6050_ADDRESS,ACCEL_CONFIG, 0x18);

Fig.3. Overall system diagram
7.2. Circuit diagram

5.2. Automatic correction (triaxial accelerationsensor)
bam = Ta K a ( b am′ + ba′ )6. UAV attitude control
We use PID to control the position of the aircraft to obtain
the desired speed, and obtain the actual speed based on thesensor fusion. The PID is used to control the speed of theaircraft, and then the closed-loop PID control algorithm isused to control the attitude of the aircraft [7]. In attitudecontrol, we need to know three values: quaternion, rotation
matrix and Euler angle.
If one need to convert vectors between coordinate systems,
one method can be in matrix form; the other method is touse Euler angles as the "master copy" of the orientation,
but at the same time maintain a rotation matrix. When theEuler angles change, The matrix must also be updated atthe same time. When a large amount of orientation data(such as animation) needs to be saved, Euler angles orquaternions are used. Euler angles occupy 25% lessmemory, but conversion to matrix is slow. If the animation
data needs to nest the connection between coordinatesystems, quaternions may be the best choice. Smooth206

7.3. Power supply

3. Chao Hai Yang, Cao Yong Can, Chen Yang
Quan.Autopilots for small unmanned aerial vehicles:Asurvey[J].International journal of control, automation, andsystems, 2010, 8 (1)4. Chen Kaiyue. Design and implementation of machine vision
test system based on image processing [D]. Hebei
University of science and technology. 2017
5. Jiu Ruibo. Airborne video stabilization algorithm based onFAST-9 corner and optical flow method [J]. Science andTechnology Information. 2019 (01)
6. Fankhauscr P, Huttcr M. ANYmaI: A Unique Quadruped
Robot Conquering Harsh Environments[J]. Rcsearch
Features, 2018(126):54-57.
7. Gu Zhixin, Yao Bo, Xu Kaihong, et al. Research on rocksheep limbs dynamics analysis and related technologies. JXi. Development and innovation of mechanical andelectrical products, 2010, 23 (J).
8. Song Yu, song Junwei. Design simulation of attitude
stability controller for four rotor UAV [J]. Computersimulation. 2017 (08)9. Huang Jiaqi, Wu Xiaoyan, Zhang Rui, Ma Zhen. Researchon optimal control of attitude stability of four rotor aircraft[J]. Computer simulation. 2016 (07)The power supply consists of transformer, filter andregulator. Provide 5V or 12V voltage for the whole system
to ensure the normal and stable operation of the circuit.
This part of the circuit is realized by 3 terminal voltageregulator tube.
8. Program design
The program design is divided into two parts, which arewritten by different members. The first part is the controlof the aircraft, including take-off, hover height
determination, rotation, horizontal flight and landing, etc.
The second part is the OpenMV self-process, includingcolor and line recognition, shooting, storage and so on.
The main idea of our program design is to use C
language to write a one-key takeoff program, and then use
keil5 software and optical flow sensor to achieve thealtitude and stability of the quadrotor.
After that, the OpenMV and the flight controller are
jointly adjusted to realize the cable-tracking flight of theaircraft. At the same time, program of the OpenMV
realizes the function of taking pictures and storing during
the flightAuthors Introduction
Mr. Junjie Lin

9. Test plan and result analysis
According to the requirements of UAV safety performance,
we set up the experimental site in our laboratory andcarried out many tests. The main testing instruments andinstruments we use are: MSP432 microcontroller, opticalflowsensor,
OpenMV3cam7camera,
HIGHDISCHARGELI-POBATTERY lithium battery andsw-lds50a laser module.
Through the above module and the corresponding
program, we have been able to achieve the line finding andbasic flight, and can achieve the function of fixed heightand camera shooting storage.

He is now an undergraduate in Tianjin
University of Science & Technology. His
research field is communication and signal
processing.

Dr. Chunxia Zhang
She is an Associate Professor in Tianjin
University of Science & Technology. She
obtained a doctor's degree in informationand control from the Institute of Modern
Physics, Chinese Academy of Sciences, in2005. Her research field is exchange
principle and communication technology.

Acknowledgements
This research was supported by Student’s Platform forInnovation and Entrepreneur Training Program, Tianjin
University of Science and Technology(201910057245).

Dr. Yizhun Peng

References
1. Tang Qiang, Zhu Zhiqiang, Wang Jianyuan.Research on
Autonomous Flight Control of Foreign UAVs [J]. System
Engineering and Electronics, 2004, 26 (3)2. Tang Shufang. Research on four rotor aircraft technology
based on optical flow positioning [D]. Nanjing. Nanjing
University of Aeronautics and Astronautics

207

He is an Associate Professor in Tianjin
University of Science & Technology. He
received a doctor's degree in control theoryand control engineering from the Instituteof Automation ， Chinese Academy ofSciences, in 2006.His research field isintelligent robot and intelligent control.

Miss. Ting Zhao

She is now an undergraduate student at
Tianjin University of Science&Technology.
Her research field is control science andcontrol engineering, and intelligent control
is her research direction.

Miss. Wangfeng He
She is now an undergraduate student at
Tianjin University of Science &Technology. Her research field iscommunication and signal processing.

208