International Journal of Control, Automation and Systems 17(2) (2019) 486-499
http://dx.doi.org/10.1007/s12555-017-0308-7

ISSN:1598-6446 eISSN:2005-4092
http://www.springer.com/12555

Flight and Hover Control System Design for a Mini-quadrotor Based on
Multi-sensors
Zhongli Ma, Huixin Li*, Yanming Gu, Zuoyong Li, and Qianqian Li
Abstract: Mini-quadrotor is difficult to control in the air due to its small size and light weight. This paper presents
the flight and hover control system for a mini-quadrotor, including design and simulation of calculations and controllers. Firstly, the attitude and position of the mini-quadrotor are obtained by distributed multi-sensors. Since attitude calculation of aircraft needs a number of combined rotations and vectors transformed by rotation, quaternions
are applied to express the attitude model. About error compensation of gyroscope and accelerometer, IMU_Updata
algorithm of Mahony filter are applied and improved to realize data fusion [1]. In order to realize accurate hovering
at certain position, UWB (Ultra Wideband) are applied to gain positional information of mini-quadrotor and correct
the antenna delay caused sensor error by base station positioning. The discrete Kalman filter of original data is used
to achieve the optimized estimation of the airborne position. Px4flow optical flow sensor is able to gets velocity
information and avoid the noise problem, which is caused by differential of position data. Then, the mathematical
model of a mini-quadrotor’s flight and hover control system can be established. Herein, integral items are solved by
the integral separation and integral limiting to mitigate the serious overshoot and oscillation of the system caused by
the cascade PID. Finally, the simulation of the attitude controller and position controller are applied with the MATLAB Simulink library. The simulation result shows that the designed attitude controller and position controller can
enable the mini-quadrotor to fly smoothly, move in all directions and hover.
Keywords: Calculation, controller, flight and hover, mini-quadrotor, multi-sensors.

1.

INTRODUCTION

For traditional outdoor quadrotor, the widely used
method for stability and control in full states is fusion of
information from inertial sensor and GPS [2, 3], yet normal quadrotor is not inconvenient for indoor application
due to their large size. For indoor application, however,
due to the serious interference of indoor wireless signal,
quadrotors are unable to effectively obtain framing signal like GPS signal and wireless positioning signal, which
makes then unable to be accurately positioned indoors.
What’s more, because of its small size and light weight,
mini-quadrotor is more likely to be affected by airflow
and more difficult to control. With the development of autonomous navigation technology for ground mobile robots
in unknown environments, researchers are focusing on autonomous flight of mini-quadrotor indoor [4,5]. Due to its

small size, it can be used widely in various areas to achieve
information detecting and aircraft knowledge learning.
Hardware system, navigation and control methods are
the key to achieve the stable flight and hover of miniquadrotors. Nowadays, the hardware device of miniquadrotor focuses on open source flight and hover control system based on APM and PIXHAWK [6]. JiYi successfully launched the indoor vision positioning system,
and applied optical flow and ultrasonic sensors to miniquadrotor [3]. Domestic Infinite Team developed BlackHole1 open source micro four rotors and BlackSpider1
micro eight rotors that used coreless motor as power plant
and needed only a simple drive circuit to drive motor [7].
They are smaller in size, lower at cost, and safer than that
with large brushless motor. SZ DJI Technology Co. firstly
applied indoor vision positioning system on Inspire1 and
Phantom3. DJI released Phantom4 in March 2016 with

Manuscript received May 26, 2017; revised July 26, 2018; accepted September 28, 2018. Recommended by Associate Editor Son-cheol
Yu under the direction of Editor Hyun-Seok Yang. The authors are grateful to College of Automation Harbin Engineering University and
Fujian Provincial Key Laboratory of Information Processing and Intelligent Control of Minjiang University. This project is supported by
National Natural Science Foundation of China (61772254) and Key Project of College Youth Natural Science Foundation of Fujian Province
(JZ160467). The authors thank Ms Yifang Wang from South China University of Technology for her help in improving this paper.
Zhongli Ma is with Department of Control Engineering in Chengdu University of Information Technology, No. 24 Xuefu Road, economic
development zone of southwest airport, Chengdu, Sichuan, China (e-mail: 914843936@qq.com). Huixin Li and Qianqian Li are with
College of Automation, Harbin Engineering University, Harbin, China (e-mails: {943599926, 1611680715}@qq.com). Yanming Gu is
with School of Astronautics, Harbin Institute of Technology, Harbin Heilongjiang, China (e-mail: 877729730@qq.com). Zuoyong Li is
with Fujian Provincial Key Laboratory of Information Processing and Intelligent Control, Minjiang University, Fuzhou, China (e-mail:
journalpaper@yeah.net).
* Corresponding author.

c
⃝ICROS,
KIEE and Springer 2019

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

487

Fig. 1. The overall designing of mini-quadrotor flight and hover control system.

powerful computer vision technology, including vision
based visual positioning, target tracking, wall barrier etc.
The research of navigation and control algorithms includes attitude calculation, position calculation and flight
control. Four-rotor attitude estimation algorithms contain mainly posture estimation based on nonlinear complementary filtering algorithm and Kalman filter algorithm
[8, 9]. The Kalman filter provides the best estimation
based on the knowledge of the dynamics model and the
signal noise characteristics. The control algorithms have
been well studied. However, due to the uncertainties in the
aircraft system, the outcome of some control algorithms
in the actual flight and hover control system might deviate from the theoretical results. And even some theoretical algorithms are difficult to convert into the code transplanted to the microprocessor. In order to solve this problem, Castillo and Lozano have studied the control problem of micro-quadrotor from real-time tracking and stability [10]. Chi-Ching Yang used the time optimal control
method to control the flight process of aircraft, and conducted a detailed analysis and in-depth study [11]. Currently, the most widely used and well-developed control
system in the four rotor is mostly based on PID and nested
PID control algorithms [12]. PID controllers are not only
simple in structure, easily controlled, but also with strong
robustness. In the future, the flight and hover control system is still the hot research area in order to realize the
better flight and hover [13]. With development of technology, machine learning and vision system will be introduced into mini-quadrotors to achieve functions like target
tracking and automatic obstacle avoidance [14].
For indoor mini-quadrotor, the following problems
need to be solved: 1) Autonomy: mini-quadrotor must
autonomously obtain its relative position. 2) Perception:
mini-quadrotor can fuse and deal with self-detected data
to achieve the perception of the surrounding environment.
3) Robustness: the navigation system needs to overcome
the influence of disturbances like temperature and airflow
changes [15]. 4) The navigation system must consider the
delay caused by computation and communication.
For normal quadrotor, above researches about system,
model and algorithms are effective and reliable. But the
design of the control system and navigation algorithm for
mini-quadrotor should be improved. In this contribution,

we focuses on analysis of the flight and hover control system of mini-quadrotor that contains calculation and control of position, attitude and process. Positional information of mini-quadrotor can be obtained via multi-sensor
fusion using DW1000. Based on the mathematical model
and dynamic model of mini-quadrotor, attitude controller
is designed by angle and angular velocity measured by gyroscope and accelerometer. In this way, smooth flight of
mini-quadrotor can be achieved. Finally, height and horizontal controller is based on position, velocity and acceleration information collected by optical flow sensor, barometer, ultrasonic sensor and accelerometer, so that the miniquadrotor can realize accurate hover.
2.

THE SCHEME OF FLIGHT AND HOVER
CONTROL SYSTEM

The flight and hover control system mainly consists of:
sensor signal acquisition, attitude calculator, attitude controller, horizontal position controller and height position
controller. Fig. 1 presents the overall designing of miniquadrotor flight and hover control system.
IMU (Inertial measurement unit) is composed of gyroscope and accelerometer [16]. Gyroscope provides angular rate, while accelerometer provides acceleration. The
obtained data is used to calculate current attitude of the
aircraft. The optical flow sensor measures the speed of
the aircraft [17]. Tag measures and fixes the position of
the aircraft using the base station. The aircraft’s horizontal position is controlled based on the information of the
speed and position. The ultrasonic sensor and barometer
measure the height, and control it with the fusion of height
data.
3.

ATTITUDE CALCULATION OF THE
MINI-QUADROTOR

3.1. Attitude description and error compensation
3.1.1 Attitude description
Attitude calculation of the mini-quadrotor requires lots
of combined rotations and vectors that are transformed
by rotation, so we use quaternions to express the attitude
model [18].

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

488

⃗ as
If three-axis gyroscope represents angular rate ω
⃗ = [ ωx
ω

ωy

ωz ]T ],

(1)

where ωx , ωy and ωz stands for angular velocities along
X-axis, Y-axis and Z-axis, respectively.
According to differential equations about quaternions,
renewal equations about quaternions are:
 
    
q0
q̂0
q0
0 −ωx −ωy −ωz
 q1 ∆t
 q̂1   q1   ωx 0
ω
−
ω
z
y
  ,
  =  +
 q̂2   q2   ωy −ωz 0
ωx  q2  2
ωz ωy −ωx 0
q3
q3
q̂3
(2)

(a) Static angular rate before standardization of errors.

where ∆t is gyroscope’s sampling time of angular rate; q0 ,
q1 , q2 , q3 are functions of time.
The Euler angles can be expressed as [19]
2(q0 q1 + q2 q3 )
φ = arctan( 2
),
q0 − q21 − q22 + q23

θ = arcsin(2(q0 q2 − q1 q3 )),
2(q1 q2 + q0 q3 )
Ψ = arctan( 2
),
q0 + q21 − q22 − q23

(3)
(4)
(5)

where Euler angle φ , θ , ψ stand for pitch, roll and yaw of
aircraft, respectively.

(b) Static angular rate after standardization of errors.

3.1.2 Error compensation
The error model of gyroscope is defined as

    
ωx
ωx
MPU6500_Gyro_Offset.X
 ωy  =  ωy  −  MPU6500_Gyro_Offset.Y  ,
MPU6500_Gyro_Offset.Z
ωz
ωz
(6)

Fig. 2. Static angular rate before and after standardization
of errors.

The error calibration of gyroscope uses the following
formula:


 
MPU6500_Gyro_Offset.X
ωxi
n
1
 MPU6500_Gyro_Offset.Y  = ∑  ωyi  ,
n 1
MPU6500_Gyro_Offset.Z
ωzi

Gyroscope and accelerometer are affected by zero drift
and temperature drift. Besides, due to the insufficient accuracy of MEMS, measurement error will gradually increase, which is why zero drift is mainly considered [20].
Zero drift is corrected based on gyroscope and accelerometer’s property. In detail, static three axis outputs of the
angular velocity are 0. Gyroscope’s and accelerometer’s
three axis outputs of the angular rate are sampled n times,
and the average value is every axis’s zero drift. Fig. 2
shows the angular velocity before and after standardization. Fig. 3 shows the acceleration before and after standardization.
As is shown in Fig. 2(a) and Fig. 3(a), one can observe
obvious zero drift before standardization. But in Fig. 2(b)
and Fig. 3(b), the curve of X-axis, Y-axis and Z-axis fluctuate around 0, indicating a successful standardization of

The error calibration of accelerometer uses the following equation:



  
MPU6500_Acc_Offset.X
0
n axi
1
MPU6500_Acc_Offset.Y= ∑ayi − 0 ,
n 1
where MPU6500_Gyro_Offset.X,MPU6500_Gyro_Offset.Y
MPU6500_Acc_Offset.Z
azi
4096
andMPU6500_Gyro_Offset.Z respectively represent zero
(i = 1, 2, . . . , n)
(9)
drift error of X-axis, Y-axis and Z-axis.

(i = 1, 2, . . . , n).

(7)

The error model of accelerometer is
    

ax
ax
MPU6500_Acc_Offset.X
 ay  =  ay  −  MPU6500_Acc_Offset.Y  , (8)
az
az
MPU6500_Acc_Offset.Z
where MPU6500_Acc_Offset.X, MPU6500_Acc_Offset.Y
and MPU6500_Acc_Offset.Zrespectively represent zero
drift error of X-axis, Y-axis and Z-axis.

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

(a) Static data that’s still in horizontal plane before standardization of errors of accelerometer.

489

Fig. 4. Waveform of angle changes with X-axis swinging.
of which the real part is 0 (for rotation only); parameter kP
controls crossover frequency between accelerometer and
gyroscope; parameter kI is used to correct gyroscope error.
Because of compensation for accelerometer, the accuracy of roll and pitch are within 0.2◦ in static state, and
angle drift of yaw is less than 0.2◦ /min in static state in a
short period of time (less than 5 minutes). Fig. 4 presents
dynamic testing results. The ability of tracking is tested
with X-axis swinging and changes of angle of pitch. Since
the angles of Y-axis and Z-axis during the swing process are not entirely steady, one can discover minor angle
changes of Y-axis and Z-axis in Fig. 4.

(b) Static data that’s still in horizontal plane after standardization
of errors of accelerometer.

Fig. 3. Static data that’s still in the horizontal plane before and after standardization of errors of the accelerometer.

errors.
3.2. Attitude data fusion
IMU_Updata-improved algorithm is applied to data fusion [21], which enables the attitude estimation to update
in time, and the information of gyroscope and accelerometer can be fused at the same time. In this way, precise
attitude estimation can be obtained.
1
q̂˙ = q̂ ⊗ P(Ω̄ + δ ),
2
∫

(10)

e,

(11)

δ = k p · e + kI ·
e = v̄ × v̂,

(12)

where q̂ is system attitude estimation represented by
quaternions; δ is the information by PI regulator; e is
the relative error between actual measured inertia vector
v̄ and predictive vector v̂; P(·) is pure quaternion operator

4. POSITION CALCULATION OF THE
MINI-QUADROTOR
4.1. Principle and realization of distance measurement
4.1.1 Basic principle of distance measurement
TWR (two-way ranging) is calculated by multiplying
the TOF (the time of flight) between Tag and Anchor with
c (the speed of electromagnetic waves), as is shown in the
following equation.
Distance = c × TOF =c ×

t2 − t1 − treply
,
2

(13)

c: the speed of electromagnetic waves in air, c ≈ 3 ∗ 108
m/s; TOF: time of flight.
4.1.2 Realization of distance measurement
The base stations are located in the geography coordinate system, with their positions are known via geometric
relationship. Base station positioning is based on the same
principle with GPS system, but its delay error during the
signal transmission can be ignored due to its short distance
indoor.
4 anchors (A for short) are positioned as is shown
in Fig. 5 (A0:(0,0,1), A1:(0,10,1), A2:(10,10,1),

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

490

Fig. 7. The delay of transmitting and receiving antennas.
Table 1. The official parameter calibration table.
Fig. 5. Position of the base stations indoor.

Channel
1
1
2
2
3
3

Pulse repetition
frequency (MHz)
16
64
16
64
16
64

Calibration distance
(m)
14.75
9.3
12.9
8.14
11.47
7.24

Fig. 6. A base station applied in this work.
A3:(10,0,1)). The distance unit is meter (m). Fig. 6
shows a base stations applied in this work.
Tag: (X,Y,Z): A0 : (X0 , Y0 , Z0 ), A1 : (X1 , Y1 , Z1 ),
A2 : (X2 , Y2 , Z2 ), A3 : (X3 , Y3 , Z3 ). The distance to A0,
A1, A2, A3 are dis0 , dis1 , dis2 and dis3 respectively.
(X0 −X)2 + (Y0 −Y)2 + (Z0 −Z)2 = dis0 2 ,

(14)

2

(X1 −X) + (Y1 −Y) + (Z1 −Z) = dis1 ,

(15)

(X2 −X)2 + (Y2 −Y)2 + (Z2 −Z)2 = dis2 2 ,

(16)

(X3 −X) + (Y3 −Y) + (Z3 −Z) = dis3 .

(17)

2

2

2

2

2

2

2

Fig. 8. The calibration scene of anchor platform.

The positions of base stations are substituted into the formula to find out position of Tag.
(dis1 2 − dis2 2 + 100)
X=
,
20
(dis0 2 − dis1 2 + 100)
Y=
,
20
Z = dis0 2 − X2 −Y2 +1.

Fig. 9. The calibration scene of tag platform.
(18)
(19)
(20)

4.2. Data analysis
4.2.1 Sensor calibration
According to the official manual of DecaWare, the main
reasons of DW1000’s measurement errors are: a), crystal
oscillator affected by pre-set capacitor; b), transmitter’s
power output and spectrum; c), antenna delay. Since antenna delay is the most important contributing factor to
errors, time stamp needs to be corrected to improve the

measurement accuracy. This paper focuses on correction
of antenna delay. Fig. 7 depicts the delay of transmitting and receiving antennas. The antenna delay consists
of transmitters and receivers’ delay, as shown in Table 1.
Fig. 8 and Fig. 9 are the scenes of calibration.
DWM1000 is calibrated at distance of 8.14 m. During
the calibration, program parameters of antenna delay are
adjusted until the DWM1000-measured distance is closes
to 8.14 m.
The DW1000 is with No. 2 channel and PRF is 64MHz.
According to the official parameter calibration table (Table 1), the calibration distance between transmitter and re-

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

491

Fig. 10. The static positioning data collection scene of
DWM1000.
(n is the number of samples; d is distance/ m)
Fig. 11. The distance between Tag and Anchor in static
state before and after Kalman filter.

ceiver should be 8.14 m.
4.2.2 Data collection
Based on the above analysis, Anchor is fixed at known
coordinate position, and Tag is still fixed at (5, 5, 2). 180
groups of base stations’ distance are measured at static
state, as is shown in Fig. 10.
4.2.3 Kalman filter of original data
The random distances between Tag and Anchor are linear and follow the Gaussian distribution. Discrete Kalman
filter is applied to the collected distance data [22], which
is, linear minimum variance estimation, a widely applied
algorithms [23, 24].
The mathematical model of discrete Kalman filter is

(n is number of samples; d is distance/ m)

X(K) = AX(K − 1) + BU(K) + W(K),

(21)

Z(K) = HX(K) + V(K).

(22)

Fig. 12. Comparison of distance before and after Kalman
filter along rectangular box.

(23)

The transfer vector of X(K|K − 1) is estimated by
K − 1. X(K − 1|K − 1) is optimal result of last time, and
X(K|K) is optimal result of this time. The covariance of
P(K|K − 1) is estimated by K − 1, and the covariance of
P(K − 1|K − 1) is estimated by K − 1. P(K|K) is the updated covariance of this time.

The basic steps of discrete Kalman filter are:
Prediction equations:
X(K|K − 1) = AK(K − 1|K − 1) + BU(K),
T

P(K|K − 1) = AP(K − 1|K − 1)A + Q.

(24)

Renewal equations:
X(K|K) = X(K|K − 1)
+ Kg (K)(Z(K) − HX(K|K − 1)),

(25)

Kg (K) = P(K|K − 1)HT /(HP(K|K − 1)HT + R),
(26)
P(K|K) = (I − Kg (K)H)P(K|K − 1),

(27)

where X(K) is the state vector; U(K) is the drive input
vector; A is the state transition matrix; B is the control input matrix; P(K) is the covariance matrix; Z(K) is
the measured value; H is the observed value; Kg (K) is
Kalman gain; I is the identity matrix; W(K) is process
noise and W(K) ∼ N(0, Q);V(K) is measurement noise
and V(K) ∼ N(0, R).

Due to the absence of input control, input vector U is
0. Kalman filter is applied to dis0 , dis1 , dis2 , dis3 . The
data after filtering is plotted with Matlab, as is shown in
Fig. 11.
Fig. 11(a), (b), (c) and (d) illustrate dis0 , dis1 , dis2 and
dis3 , respectively. The blue curve shows the original data,
while the red curve shows the Kalman filtered distance
data.
The distance data of four base stations can be obtained
by circling the rectangular box (with (5, 2, 2) as its canter)
three times. The distance change trajectory of each base
stastion is plotted by Matlab, as is shown in Fig. 12.

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

492

(n is number of samples; x,y,z are distance/ m)

(Abscissa is time/s; Ordinate is velocity (m/s))

Fig. 13. Position of Tag in static state after Kalman filter.

Fig. 15. The velocity of X-axis and Y-axis when optical
flow sensor is static.

(n is number of samples; x,y,z are distance/ m)
Fig. 14. The Kalman filtered spatial position of tag circling along the rectangle for three times.

4.2.4 Distance calculation
Fig. 13 shows position of Tag in static state after
Kalman filter, where the accuracy of X-axis and Y-axis position are within 0.1 m and the accuracy of Z-axis position
is within 0.5 m. Errors are mainly attributed to the position
of base stations, which is why ultrasonic and barometer
are placed at the position of Z-axis.
Fig. 14 shows the Kalman filtered spatial position of tag
circling along the rectangle for three times. Wireless positioning can achieve real time measurement of the spatial
position of the tag.
5.

VELOCITY CALCULATION OF THE
MINI-QUADROTOR

The position of the aircraft could be obtained by
DW1000, and the velocity of the aircraft could be obtained
by differential. But noise of velocity obtained this way is
particularly large, since the differential process actually
enlarges the noise. Herein, Px4flow sensor is applied to

(Abscissa is time/s; Ordinate is velocity (m/s))
Fig. 16. The velocity of Y-axis when optical flow sensor
swings.
collect smoother real-time speed data with smaller noise
[25].
The optical flow sensor is fixed at the bottom of the
plane and parallel to the OXY plane of the carrier coordinate system in order to measure the velocity at X-axis
and Y-axis. Fig. 15 and Fig. 16 show optical flow data of
ground station from the official 3DR QGroundControl.
In Fig. 15 and Fig. 16, blue curves represent the velocity
of X-axis, while black curves represent the velocity of Yaxis. Fig. 15 shows that noise at static state is less than
0.09 m/s. Fig. 16 shows the trend of velocity changes of
Y-axis, while the velocity of X-axis fluctuate around zero
when Px4flow is moved along the Y-axis.
6.

DESIGN AND SIMULATION OF ATTITUDE
CONTROLLER OF THE MINI-QUADROTOR

6.1. The design of attitude controller
As shown in Fig. 17, a cascade PID controller is applied
as the attitude controller. The outer loop is an angle loop

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

493

Fig. 17. Attitude cascade PID controller.

Fig. 18. Simulation diagram of the attitude controller.

with an update frequency of 250 Hz. The inner loop is
an angular velocity loop with a larger update frequency of
500 Hz since the angular velocity changes faster. According to the characteristics of attitude controller, the outer
loop uses a PI controller and the inner loop uses a PD controller [26].
The attitude is calculated from data collected by gyroscope and accelerometer, so that the attitude of the carrier
coordinate system relative to the geographical coordinate
system is obtained. Then, it is compared to the expected
attitude with PI control, where the output is expected angular velocity. The current angular velocity measured by
gyroscope is compared to the expected value and put in
the angular velocity loop to perform PD control. Finally,
PWM output corresponding to each Euler angle is processed with logical combination operations to get PWM
output corresponding to four-way motor. Based on the expected attitude, aircraft can finally produce lift to the corresponding directions, which can control the aircraft every
direction’s movement. This is the basic working process
of attitude controller.
6.2. Simulation verification
Attitude control is required in order to achieve a smooth
flight of the mini-quadrotor. Ideally, mini-quadrotor can

stably hover in the air when its roll, pitch, velocity and
acceleration are zero. However, the position of miniquadrotor cannot be perfectly controlled due to the existence of various interferences [27, 28].
MATLAB Simulink library is applied to the simulation of attitude controller. The simulation framework of
the attitude controller mainly consists of the attitude command frame, attitude controller, model of X frame miniquadrotor and dynamics model of mini-quadrotor [29].
Fig. 18 shows four motor-throttle commands of miniquadrotor (curve 2) and motor revs (curve 1). Fig. 19
presents the waveform of attitude controller simulating the
position of mini-quadrotor.
It can be seen from Fig. 20 that at the first second, given
an expected rotating angle around Y-axis, the attitude roll
of aircraft θ adjusted to the expected roll in about 0.7 s.
In Fig. 19, No. 3 and No. 4 motor revs increase at the first
second, while that of No. 1 and No. 2 decrease. The position of aircraft changes in the direction of X-axis at first.
Similarly, this phenomenon can also be observed when expected pitch and yaw are given. Due to the absence of position control loop, the position of aircraft is a randomly
curved path in the entire flying process. Therefore, the design of attitude control can enable the mini-quadrotor to
fly smoothly and move in all directions [30].

494

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

Fig. 19. Simulation waveform about motor-throttle and revs of the attitude controller.

Fig. 20. Attitude controller simulation of the mini-quadrotor position.

7. DESIGN AND SIMULATION OF POSITION
CONTROLLER OF THE MINI-QUADROTOR
7.1. The design of height position controller
In Fig. 21, the current height information is obtained
by ultrasonic and barometer, which is compared to the ex-

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

495

Fig. 21. Height position cascades PID controllers.

Fig. 22. Horizontal position cascades PID controllers.

Fig. 23. Simulation diagram of the position controller.

pected height to get deviation. Then, PI controller inputs
deviation to height position loop to get the expected velocity, which is compared to current velocity. Then, PD
controller inputs deviation to height velocity loop to get
offset that can adjust motor throttle. Finally, the output of
attitude controller and the output of motor are fused to get
the final PWM [31].

The control frequency of height position loop and velocity loop are both 50 Hz because the vertical velocity is
of large noise. This is attributed to the fact that vertical velocity cannot be measured directly and can only be derived
by height measured by ultrasonic and barometer. The
accuracy of ultrasonic is satisfying, but its measurement
range is only 3.5 m and its update frequency is less than

496

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

Fig. 24. Simulation of motor-throttle and revs of the position controller.

Fig. 25. Simulation of position controller simulating the position of mini-quadrotor.

20 Hz. So the velocity from derivative updates slowly.
The measurement range of barometer is wide, but the accuracy of measurement is low compared to ultrasonic, and
its maximum update frequency is 50 Hz. Therefore, this

contribution applies sliding filter in velocity, which can
reduce noise. The measured velocity is affected by the
size of sliding windows. The longer the windows are, the
smoother the data is, but it could compromise the real-

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors

time capability and lead to data delay. Experimental results indicate that the optimized length of velocity sliding
windows is 5.
7.2. The design of horizontal position controller
As shown in Fig. 22, the horizontal position is controlled by cascade PID controllers. The outer loop is a
horizontal position loop performing PI control, with an
update frequency of 25 Hz. The inner loop is a horizontal
velocity loop performing PD control, with a larger update
frequency of 50 Hz since the velocity changes faster [32].
The real-time horizontal position of aircraft is obtained
by tag. The velocity obtained by optical flow sensor is
integrated to get explicit horizontal position in a short period of time [17]. The final horizontal position of aircraft
is obtained by fusing the above information, which is then
inputted into the horizontal position controller. After differential and sliding windows filter, the position of tag can
get a velocity with large noise. The current velocity of
aircraft is obtained by fusing it with the velocity from the
optical flow.
7.3. Simulation verification
The attitude controller along cannot control the position
of aircraft because of the disturbance of external environment, position measurement errors of aircraft and the difference between motors and blades [28]. So position control is required for mini-quadrotor. Fig. 23 is simulation
diagram of position controller. Fig. 24 is simulation about
motor-throttle and revs of position controller. Fig. 25 is
simulation of position controller simulating the position
of mini-quadrotor.
From simulation verification, the corresponding aircraft
flies in one direction when expected angles are given. One
can observe from the velocity waveform that the velocity
of aircraft maintain basically steady. From the position
waveform, we know that the aircraft moving in a straight
line. Therefore, it makes a uniform linear motion. The position controller can control the position of aircraft. Therefore, according to the characteristics of mini-quadrotor,
the height position controller and horizontal position controller can be designed [33].
8.

CONCLUSIONS

Mini-quadrotor has recently attracted researchers’ attention due to its application in many areas. However, the
control of mini-quadrotor has become a problem due to
its small size and light weight. In this contribution, we
developed a flight and hover control system that able to
achieve smooth flight and stable hover. Accurate attitude
information are obtained by reducing the measurement errors of accelerometer and gyroscope and expressed with
quaternion. Accurate positional information are obtained
through position and velocity calculation to achieve stable

497

hover. Cascade PID based attitude controller and position
controller enable the mini-quadrotor to fly smoothly. In
the following study, machine learning and vision system
could also be introduced into mini-quadrotor to achieve
real-time target tracking and automatic obstacle avoidance.
REFERENCES
[1] S. O. H. Madgwick, “An efficient orientation filter for inertial and inertial/magnetic sensor arrays,” Report x-io and
University of Bristol, vol. 25, pp. 113-118, April 2010.
[2] Q. Lindsey, D. Mellinger, and V. Kumar, “Construction
of cubic structure with quadrotor teams,” Autonomous
Robots, vol. 33, no. 3, pp. 323-336, June 2012.
[3] C. Bills, J. Chen, and A. Saxena, “Autonomous MAV flight
in indoor environments using single image perspective
cues,” Proc. of IEEE International Conference on Robotics
and Automation, vol. 30, pp. 5776-5783, 2011.
[4] J. Qi, D. Song, L. Dai, J. Han, and Y. Wang, “The New
Evolution for SIA Rotorcraft UAV Project,” Journal of
Robotics, vol. 3, pp. 1-9, May 2010.
[5] A. Alarifi, A. Al-Salman, M. Alsaleh, A. Alnafessah, S. AlHadhrami, M. A. Al-Ammar, and H. S. Al-Khalifa, “Ultra
wideband indoor positioning technologies: analysis and recent advances,” Sensors, vol. 16, no. 5, pp. 1-36, 2016.
[6] L. Meier, P. Tanskanen, L. Heng, G. H. Lee, and F. Fraundorfer, “PIXHAWK: a micro aerial vehicle design for
autonomous flight using onboard computer vision,” Autonomous Robots, vol. 33, no. 1-2, pp. 21-39, 2012.
[7] S. Grzonka, G. Grisetti, and W. Burgard, “Towards a navigation system for autonomous indoor flying,” Proc. of
IEEE International Conference on Robotics & Automation,
pp. 2878-2883, 2019.
[8] B. Hummelink, C. D. Wagter, Q. P. Chu, and J. A. Mulder,
“AHRS for small fixed-wing UAV with low-cost IMU/GPS
using nonlinear complementary filtering,” Aiaa Guidance,
Navigation, & Control Conference, 2006.
[9] F. Jurado, M. Rodriguez, A. Dzul, and R. Campa,
“Stochastic feedback controller for a quadrotor UAV with
dual modified extended Kalman filter,” International Workshop on Research, 2015.
[10] H. Abaunza, P. Castillo, R. Lozano, and A. Victorino,
“Quadrotor aerial manipulator based on dual quaternions,”
Proc. of International Conference on Unmanned Aircraft
Systems, pp. 152-161, 2016.
[11] L. C. Lai, C. C. Yang, and C. J. Wu, “Time-optimal control
of a hovering quad-rotor helicopter,” Journal of Intelligent
& Robotic Systems, vol. 45, no. 2, pp. 115-135, 2006.
[12] L. Li, L. Sun, and J. Jin, “Survey of advances in control
algorithms of quadrotor unmanned aerial vehicle,” Proc. of
IEEE International Conference on Communication Technology, pp. 107-111, 2015.

498

Zhongli Ma, Huixin Li, Yanming Gu, Zuoyong Li, and Qianqian Li

[13] B. Niu, D. Wang, H. Li, X. Xie, and N. D. Alotaibi, “A
novel neural-network-based adaptive control scheme for
output-constrained stochastic switched nonlinear systems,”
IEEE Transactions on Systems Man & Cybernetics Systems, vol. 99, pp. 1-15, 2017.
[14] B. Niu, H. Li, and T. Qin, “Adaptive NN dynamic surface
controller design for nonlinear pure-feedback switched
systems with time-delays and quantized input,” IEEE
Transactions on Systems Man & Cybernetics Systems, pp.
1-13, 2017.
[15] Y. Yang, Q. Wu, and M. Chen, “Robust trajectory tracking
control for a quadrotor unmanned aerial vehicle using disturbance observer,” World Congress on Intelligent Control
& Automation, pp. 697-702, 2016.
[16] M. Tailanian, S. Patemain, R. Rosa, and R. Canetti, “Design and implementation of sensor data fusion for an autonomous quadrotor,” Pro. of IEEE International Conference in Instrumentation and Measurement Technology
(I2MTC), pp. 1431-1436, 2014.
[17] Q. Gao, Y. Wang, and D. Hu, “Onboard optical flow and
vision based localization for a quadrotor in unstructured indoor environment,” Proc. of Guidance, Navigation & Control Conference, pp. 2387-2391, 2014.
[18] J. F. Guerrero-Castellanos, N. Marchand, A. Hably, S.
Lesecq, and J. Delamare, “Bounded attitude control of
rigid bodies: real-time experimentation to a quadrotor
mini-helicopter,” Control Engineering Practice, vol.19, no.
8, pp. 790-797, 2011.
[19] E. Fresk and G. Nikolakopoulos, “Full quaternion based
attitude control for a quadrotor,” Proc. of Control Conference, no. 415, pp. 3864-3869, 2013.

[26] H. Wang and M. Chen, “Sliding mode attitude control for
quadrotor micro unmanned aircraft vehicle using disturbance observer,” Proc. of Guidance, Navigation & Control
Conference, pp. 568-573, 2015.
[27] K. Schauwecker and A. Zell, “On-Board Dual-StereoVision for the Navigation of an Autonomous MAV,” Journal of Intelligent & Robotic Systems, vol. 74, no. 1, pp.
1-16, 2014.
[28] M. Eich, F. Bonnin-Pascual, E. Garcia-Fidalgo, A. Ortiz,
G. Bruzzone, Y. Koveos, and F. Kirchner, “A robot application for marine vessel inspection,” Journal of Field
Robotics, vol. 31, no. 2,pp. 319-341, 2014.
[29] D. Matouk, O. Gherouat, F. Abdessemed, and A. Hassam,
“Quadrotor position and attitude control via backstepping
approach,” Proc. of 8th International Conference on Modelling, ICMIC 2016, pp. 73-79, 2017.
[30] H. Bolandi, M. Rezaei, R. Mohsenipour, H. Nemati, and S.
M. Smailzadeh, “Attitude control of a quadrotor with optimized PID controller,” Intelligent Control & Automation,
vol. 4, no. 3, pp. 342-349, 2013.
[31] G. Hoffmann, H. Huang, S. Waslander, and C. Tomlin,
“Quadrotor helicopter flight dynamics and control: theory
and experiment,” Proc. of the AIAA Guidance, Navigation,
and Control Conference, Hilton Head, South Carolina, August 2007.
[32] M. A. Vieira, M. Vieira, P. Louro, L. Mateus, and P. Vieira,
“Indoor positioning system using a WDM device based on
a-SiC:H technology,” Journal of Luminescence, vol. 191,
pp. 135-138, 2017.
[33] H. S. Khan and M. B. Kadri, “Position control of quadrotor
by embedded PID control with hardware in loop simulation,” Proc. of Multi-topic Conference, pp. 395-400, 2014.

[20] A. L. da Silva and J. J. da Cruz, “Fuzzy adaptive extended
Kalman filter forUAV INS/GPS data fusion,” Journal of the
Brazilian Society of Mechanical Sciences and Engineering,
vol.38, no. 6, pp. 1671-168, 2016.
[21] M. Ficco, F. Palmieri, and A. Castiglione, “Hybrid indoor
and outdoor location services for new generation mobile
terminals,” Personal and Ubiquitous Computing, vol. 18,
no. 2, pp. 271-285, 2014.

Zhongli Ma received the Ph.D. degree
in Automation from Harbin Engineering
University, Harbin, China in 2006. Her research include machine vision and pattern
recognition.

[22] S. A. Belokon, Y. N. Zolotukhin, K. Y. Kotov, A. S.
Mal’tsev, and A. A. Nesterov, “Using the Kalman filter
in the quadrotor vehicle trajectory tracking system,” Optoelectronics, Instrumentation and Data Processing, vol.49,
no. 6, pp. 536-545, 2013.
[23] Z. Zhang, Y. Xu, J. Yang, X. Li, and D. Zhang, “A survey of
sparse representation: algorithms and applications,” IEEE
Access, no. 3, pp. 490-530, 2015.
[24] Y. Xu, D. Zhang, J. Yang, and J.-Y. Yang, “A two-phase
test sample sparse representation method for use with face
recognition,” IEEE Transactions on Circuits and Systems
for Video Technology, vol. 21, no. 9, pp. 1255-1262, 2011.
[25] J. Kim, M.-S. Kang, and S. Park, “Accurate modeling and
robust hovering control for a quadrotor VTOL aircraft,”
Journal of Intelligent and Robotic Systems, vol.57, no. 1,
pp. 9, 2010.

Huixin Li will receive the M.E. degree
in Automation from Harbin Engineering
University, Harbin, China in 2019. Her
research interests include machine vision,
pattern recognition and robot technology.

Flight and Hover Control System Design for a Mini-quadrotor Based on Multi-sensors
Yanming Gu received the Master degree
in the School of Astronautics, Harbin Institute of Technology, Harbin, China in
2018. His research interests include aircraft control, pattern recognition and robot
technology.

Zuoyong Li received the Ph.D. degree
from the School of Computer Science and
Technology at Nanjing University of Science and Technology, Nanjing (NUST),
China, in 2010. His current research interests include image processing, pattern
recognition and machine learning.

499

Qianqian Li received the M.E. degree
in Automation from Harbin Engineering
University, Harbin, China in 2018. Her
research interests include machine vision,
pattern recognition and robot technology.

Publisher’s Note Springer Nature remains neutral with regard
to jurisdictional claims in published maps and institutional affiliations.

