SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 1(1); June (2020), pp. 17–21
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

A Design of the Intelligent Aircraft based on STM32
Fengzhi Dai1,2, Hongbo Hao1

Tianjin University of Science and Technology, China
Tianjin Tianke Intelligent and Manufacture Technology CO., LTD, China

12

ARTICLE INFO
Article History
Received 23 October 2019
Accepted 01 July 2020
Keywords
Aircraft
Man-machine interaction
Wireless transmission

ABSTRACTWith the chip STM32f767 igt6 (M7 series) as the core, the designed aircraft will finally realize
the intelligence by using the optimized attitude algorithm (cascade PID and single-stage PID sharethe optimized control), omni-directional ultrasonic radar detection barrier collision prevention
technology, long-distance wireless transmission technology (to realize the timely transmission ofimages recognition), navigation technology (the Beidou and GPS double positioning system torealize more accurate positioning), voice recognition technology, man-machine interaction
technology, and wireless local area network technology. The experiment shows the result.

© 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/).

PID

1. Introduction

1.2. Innovation of the design

1.1. Research backgroundThe designed aircraft has the functions of voiceinteraction, image recognition, and it has stereo radar.
The main control core STM32F767 is the first aircraft
designed for M7 in China. M7 has high processing speed,
excellent running effect and stable performance. It cancarry a variety of smart sensors, and have multiple
peripheral interfaces to support IIC, USART
communication external device mounting and large-size
screen display.

In the inspection of the expressway, the UAV(Unmanned Aerial Vehicle) is used to conduct theinspection of the high-speed section. It is possible tocarry out the first-time processing of various emergencies,
and truly grasp the road conditions of the expressway inreal time. Also in the field of forest fire prevention,
various sensors and line electronic devices are not easy
to be installed, so the application of the UAV can
immediately monitor the situation of the forest [1].
Another advantage of the four-rotor UAV is its smallsize. Unmanned aircraft can autonomously fly in the airand finish certain tasks. Compared with the ordinary
aircraft, it is simple and low cost, and it is easy to be
maintained and manufactured. UAV can be used for realtime battlefield investigation, target positioning, and unit
tracking in military. It can also be used for survivor
rescue and all kinds of scientific experiments because it
can carry a variety of scientific equipment.

1.3. The main work
The control algorithms, software and hardware aredesigned. In this paper, the communication protocols
used by various quad-rotor aircrafts are analyzed in depth
and optimized for program design.
According to the current mainstream algorithm ofquadrotor, the attitude control is optimized.
This paper analyzes the fusion algorithm that uses
multiple types of sensors to achieve flight movement
control.

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

172. Principle and Modeling of Four-rotor Aircraft
2.1. Four-rotor dynamics analysis
First, the four-rotor aircraft has a cross shape with thefour arms. In flight, there are generally two states, Xshaped or cross-shaped. The aircraft is equipped with animaging device. The principle is to realize the action of
the aircraft through the angle between the aircraft and thehorizontal plane. First of all, the quadrotor has a crossshape and has four arms.
Generally, there are two states when flying, which are
the X-type and cross-type. The angle between the armand the forward direction is 45 degrees, and the adjacentarms are perpendicular for each other. The arms coincidewith the forward direction, and two adjacent verticalarms are crossing [2]. The four-rotor aircraft is usuallyequipped with camera. The X type is often used in flight.
It is mainly used to realize the movement through theangle between the aircraft and the horizontal plane, so it
is relatively simple [3].

Fig.1 Equivalent circuit diagram of three-phase brushless
motor

2.2.2. The torque equation
The current magnitude and electromagnetic torque of aphase brushless motor are proportional to the flux.

=P T=∑ ixexeω(3)xThe equation of motion of the motor is

T=TL + Jedωdt(4)

2.2.3. The aircraft model
The four-rotor has six flight states: rising, descending,forward, backward, leftward and rightward. In order tostabilize the hover, it is necessary to detect the angle
between the four motors and the horizontal plane.
The aircraft uses the quaternion and Euler angles in 3D
stereology to represent the angle of rotation, and thecalculation formula uses a 3D Cartesian coordinate
system, as shown in Fig.2.

2.2. Four-helical mathematical modeling
The four-helical aircraft is a nonlinear, multi-variable,highly coupled, under actuated system. The motion stateof the aircraft has 6 degrees of freedom, and there are
only 4 inputs. The idealized model is assumed as follows.
2.2.1. DC motor modeling
The phase voltage of each winding of the three-phasebrushless DC motor is composed of the winding induced
potential and the copper wire's own resistance. Therefore,
the following voltage balance equation can be used foreach voltage.

U= IR + L

di+Edt(1)
Fig.2 3D Cartesian coordinate system Definition of quaternion

Then the three-phase DC state equation isU a   Ra 0 0  ia   Laa Lab Lac  ia  ea U  = 0 R 0  i  +  L L L  i  +  e (2)b b   b   ba bb bc   b   b U c   0 0 Rc   ic   Lca Lcb Lcc   ic   ec The equivalent circuit diagram of the three phasebrushless motor is shown in Fig.1.

q = [ w x y z]

T2q = w2 + x 2 + y 2 + z 2 = 1
Conversion of Euler angles to quaternions:(5)(6)

 w cos(φ / 2) cos(θ / 2) cos(ψ / 2) + sin(φ / 2)sin(θ / 2)sin(ψ / 2)  x  sin(φ / 2) cos(θ / 2) cos(ψ / 2) − cos(φ / 2)sin(θ / 2)sin(ψ / 2)  (7) q == y  cos(φ / 2)sin(θ / 2) cos(ψ / 2) + sin(φ / 2) cos(θ / 2)sin(ψ / 2)   
 z  cos(φ / 2) cos(θ / 2)sin(ψ / 2) + sin(φ / 2)sin(θ / 2) cos(ψ / 2) Quaternion is converted to Euler angle:18

2( wx + yz ) 
arc tan()1 − 2( x 2 + y 2 ) ϕ  θ  = arcsin(2( wy − zy ))  ψ  arctan( 2( wz + xy ) ) 
1 − 2( y 2 + z 2 ) 

4.3. Power supply
The system contains 5V to 3.3V regulated power supply,
which mainly supplies power to 3.3V modules and core
STM32F767 chips. In order to prevent the voltage frombeing too high, the voltage regulator is used to stabilize
the voltage.

(8)

3. Aircraft scheme design

4.4. Module Interface Circuit

3.1. Overall scheme

As each module transmits information through digital
signals, the common interfaces are IIC, UART, andmotor interface, voice interface, camera interface, etc.

The aircraft modules used in this paper include M7 series
control cores, attitude sensors, intelligent interactive
equipment, wireless remote control equipment, obstacle
avoidance equipment, positioning equipment, and upper
computer display equipment.

5. Software scheme design
5.1. Single-level PID control algorithm

3.2. Equipment selection

The PID (positional, incremental and differential)
algorithm of the input-output response is used and theparameters are adjusted to make the output response
reach an ideal state. The positional PID is related to theerror of the whole past, and the integral link is used. The
incremental PID is only related to the error of the firsttwo beats, and the output is the control increment.
The single-stage PID is more suitable for the linear
system. When the output and the control are linear, thesingle-stage PID method can get better results, but thefour-axis is not a linear system.

This paper selects the frame (F450), motor (B2212
brushless motor), ESC (SimonK ESC), NRF24L01
wireless module, ESP8266 WIFI module, voicerecognition module LD3320A, ultrasonic module HCSR04, OV5640 camera module, GPS Beidou dual
positioning Module S1216, attitude sensor MPU6050
AK8975.
4. Hardware scheme design
4.1. Overall design

5.2. Cascade PID control algorithm

After the component selection is completed, the overall
circuit is designed accordingly. Each module has its own
communication method, and each module occupies
different internal resources to the core control board
according to different design schemes.

As a result, it is difficult to obtain good control effect by
the single-stage PID. In order to achieve the ideal control
effect, the cascade PID is introduced [5]. It is divided into
the inner loop and outer loop. The input and feedback of
the outer loop are angle data, while the input andfeedback of the inner loop is the angular velocity data,
which is quickly adjusted according to the expectedspeed.
The outer loop is the input to the inner loop according
to the angular deviation, and the inner loop determines
how much the speed should be operated according to theangular deviation.
Generally, we only use the PI control in the outer loop.
Proportion corrects the aircraft from the deviation angle
to the desired angle. Integration eliminates the angularstatic difference.
In the inner loop, we adopt the PID control. Proportion
corrects the yaw angular velocity of the aircraft to thedesired value. Integration eliminates the static

4.2. STM32F767 minimum system design
The system includes a hardware reset circuit for testing
the system; the Jlink download interface is used todownload programs and online testing. The SDRAM
external expansion circuit uses the W9825G6KH chip toexpand the 256K memory capacity to 32M, which
enhances the demand for memory of each program. TheFLASH chip used in the FLASH external circuit isMT29F4G08, which adds 512M of storage space to themain control [4]. It can be used to store pictures and key
information.

19

Co., Ltd (19JCTPJC53700). It is also supported by theIndustry-University Cooperation and Education Project(201802286009) from Ministry of Education, China.

acceleration difference. And the different coefficient
makes the correction faster.
6. Testing and conclusion

References

The design realized the stable flight of the aircraft. It
detected the environmental parameters and realized thefunction of human-computer interaction. It also provided
more convenient control through the remote control ofthe mobile phone, and supported the real-time onemegapixel image transmission. It can record and takepictures and support the GPS/Beidou global positioning
and synchronize positioning in real time in Google Earth.
The accuracy of positioning information also improves
gradually with the accumulation of time [6].
Google Earth is a simulated Earth that contains
information about various roads and buildings on theentire earth. Supported by the Google Earth, the locationof the aircraft is shown in Fig.3 and the Google Earthinterface is shown in Fig.4.

1. Hongbo Hao, Fengzhi Dai, Haokang Wen, Jichao Zhao,
Qianqian Zhang, Research on the Intelligent Aircraft
Design based on STM32, Proceedings of the 2020
International Conference on Artificial Life and Robotics,
Oita, Japan, 2020.1.13-16, pp. 628-631.
2. C. H. Lo, E. H. K. Fung, Y. K. Wong, Intelligent
Automatic Fault Detection for Actuator Failures in
Aircraft. IEEE Transactions on Industrial Informatics,2009, 5(1): pp.50-55.
3. J. Escareno, S. Salazar-Cruz, R. Lozano, Embedded
control of a four-rotor UAV, Proceedings of 2006
American Control Conference, Minneapolis, USA, 2006.
4. Yuan Gao, Yiqing Liu, Integrated Circuit IO
Characteristic Intelligent System, Proceedings of 2020 5thInternational
ConferenceonComputerandCommunication Systems, Shanghai, China, 2020, pp. 895899.
5. Ming-Hao Hung, Li-Sun Shu, Shinn-Jang Ho, Shiow-Fen
Hwang, Shinn-Ying Ho, A Novel Intelligent
Multiobjective Simulated Annealing Algorithm for
Designing Robust PID Controllers, IEEE Transactions onSystems, Man, and Cybernetics - Part A: Systems andHumans, 2008, 38(2): pp. 319-330.
6. Lina He, Maorong Ge, Jiexian Wang, Jens Wickert,Harald Schuh, Experimental Study on the Precise Orbit
Determination of the BeiDou Navigation Satellite
System. Sensors, 2013, 13(3): pp.2911-2928.

Authors Introduction
Fig.3 Aircraft position

Dr. Fengzhi Dai

He received an M.E. and Doctor ofEngineering (PhD) from the Beijing
Institute of Technology, China in
1998 and Oita University, Japan in
2004 respectively. His main
research interests are artificial
intelligence, pattern recognition androbotics. He worked in National
Institute of Technology, Matsue
College, Japan from 2003 to 2009. Since October 2009, hehas been the staff in Tianjin University of Science andTechnology, China, where he is currently an associate
Professor of the College of Electronic Information andAutomation.

Fig.4 Google earth

Acknowledgements
The research is partly supported by the Project of Tianjin
Enterprise Science and Technology Commissioner toTianjin Tianke Intelligent and Manufacture Technology20

Ms. Hongbo Hao

research paper

She is a first-year master candidatein Tianjin University of Scienceand Technology, majoring inpattern recognition, principle ofautomatic control, engineering
mathematics and other importantcontrol disciplines. Her researcharea is about deep learning andimage processing. During her
study, she has published several

21