Aerospace and Electronic Systems Magazine January 2018 - 52

Software in the Loop for Navigation and Control of UAV
Ts = ( m × g ) / ( N × Th )

(13)

Th and N are required thrust for hovering and the number of
motors, respectively. Then through multiplying thrust's scale factor
by each motor's velocity, each one's thrust will be obtained, which
will be added to its previous value in every update. Furthermore, to
simulate compass data, a magnetometer noise is added to roll, pitch
and yaw angles. Temperature and absolute pressure are considered
as 26°C and 94.5 KPa. So, the simulated barometer altitude measurements will be achieved from

z log  P0 / P   T  C

(14)

wherein P0, P, T, C are absolute pressure, environment's pressure,
environment's temperature, and a constant value of 29.271267, respectively.

NAVIGATION SYSTEM
In this study, we applied the extended Kalman filter (EKF) algorithm to estimate vehicle position, velocity, and angular orientation
based on rate gyroscopes, accelerometer, compass, GPS, and barometric pressure measurements. A greatly simplified nonmathematical description of EKF based navigation system of the simulated
quadcopter in APM firmware is as follows:

Figure 2.

C

Diagram of SITL using APM and MAVProxy.

in which the torques around the x-body, y-body, z-body axis, U2,
U3, and U4 can be derived from

(

)

(4)

(
= d (Ω

)

(5)

U 2 = b Ω 24 - Ω 22
U 3 = b Ω 32 - Ω12
U4

2
2

+ Ω 42 - Ω12 - Ω 32

)

(6)

Furthermore, linear equations of motion will be derived as
(9)


y = U1 ( cos Ø sin θsin φ − cos φsin Ø )

(10)


z = U1 cosθ − cos Ø − mg

(11)

in which main thrust, U1, can be calculated from

)

C

C

C

(12)

wherein Ø, θ, φ, Ωi, Ix,y,z, J, b, d, l, and m indicate roll angle, pitch
angle, yaw angle, each rotor's angular velocity, moment of inertia of body, moment of inertia of propeller, thrust coefficient, drag
coefficient, moment arm, and quadcopter's mass, respectively. In
this study an X-configuration quadcopter with flying weight of
around 1.5 kg was simulated. Required throttle for hovering is set
to 51 percent of the most throttle while in APM firmware throttle
is graded from 0 to 1,000. To calculate the simulated quadcopter's
thrust, a scale factor is defined as
52

C

C


x = U1 ( sin Ø sin φ +  cos Øcos φsin θ )

(

C

(7)

Ω = Ω 2 + Ω 4 − Ω1 − Ω 3

U1 = b Ω12 + Ω 22 + Ω 32 + Ω 24

C

Step 1. Integrating IMU angular rates to calculate the angular position.
Step 2. Converting IMU accelerometers data from body
frame to NED frame.
Step 3. Integrating accelerometer data to calculate the velocity.
Step 4. Integrating velocity to calculate position.
Step 5. Using estimated gyro and accelerometer noise to
estimate the increase in error of the angles, velocities, and
position data calculated by using IMU data and then applying these estimated errors to form State Covariance Matrix.
Step 6. Subtracting GPS measurements from position data,
achieved up to step 4 (prediction step' data), to calculate innovation.
Step 7. Combining the innovation from step 6, State Covariance Matrix from step 5 and GPS measurement noise to
correct each state's estimation.
Step 8. Now the amount of uncertainty in each of states is
reduced due to calculations up to 7th step. Therefore, the
filter computes this reduction, updates the State Covariance
Matrix, and returns to the first step.

As mentioned at the beginning of this section, GPS, barometer, compass, and IMU measurements are used to estimate the
quadcopter's position, velocity, and angular orientation through
the EKF based navigation system. As Table 1 shows, there is a
different range of values for the noise in each simulated sensor's
measurements. To set the Root Mean Square (RMS) value of the
noise in the measurements, we note that if we set this parameter

IEEE A&E SYSTEMS MAGAZINE

JANUARY 2018



Table of Contents for the Digital Edition of Aerospace and Electronic Systems Magazine January 2018

No label
Aerospace and Electronic Systems Magazine January 2018 - No label
Aerospace and Electronic Systems Magazine January 2018 - Cover2
Aerospace and Electronic Systems Magazine January 2018 - 1
Aerospace and Electronic Systems Magazine January 2018 - 2
Aerospace and Electronic Systems Magazine January 2018 - 3
Aerospace and Electronic Systems Magazine January 2018 - 4
Aerospace and Electronic Systems Magazine January 2018 - 5
Aerospace and Electronic Systems Magazine January 2018 - 6
Aerospace and Electronic Systems Magazine January 2018 - 7
Aerospace and Electronic Systems Magazine January 2018 - 8
Aerospace and Electronic Systems Magazine January 2018 - 9
Aerospace and Electronic Systems Magazine January 2018 - 10
Aerospace and Electronic Systems Magazine January 2018 - 11
Aerospace and Electronic Systems Magazine January 2018 - 12
Aerospace and Electronic Systems Magazine January 2018 - 13
Aerospace and Electronic Systems Magazine January 2018 - 14
Aerospace and Electronic Systems Magazine January 2018 - 15
Aerospace and Electronic Systems Magazine January 2018 - 16
Aerospace and Electronic Systems Magazine January 2018 - 17
Aerospace and Electronic Systems Magazine January 2018 - 18
Aerospace and Electronic Systems Magazine January 2018 - 19
Aerospace and Electronic Systems Magazine January 2018 - 20
Aerospace and Electronic Systems Magazine January 2018 - 21
Aerospace and Electronic Systems Magazine January 2018 - 22
Aerospace and Electronic Systems Magazine January 2018 - 23
Aerospace and Electronic Systems Magazine January 2018 - 24
Aerospace and Electronic Systems Magazine January 2018 - 25
Aerospace and Electronic Systems Magazine January 2018 - 26
Aerospace and Electronic Systems Magazine January 2018 - 27
Aerospace and Electronic Systems Magazine January 2018 - 28
Aerospace and Electronic Systems Magazine January 2018 - 29
Aerospace and Electronic Systems Magazine January 2018 - 30
Aerospace and Electronic Systems Magazine January 2018 - 31
Aerospace and Electronic Systems Magazine January 2018 - 32
Aerospace and Electronic Systems Magazine January 2018 - 33
Aerospace and Electronic Systems Magazine January 2018 - 34
Aerospace and Electronic Systems Magazine January 2018 - 35
Aerospace and Electronic Systems Magazine January 2018 - 36
Aerospace and Electronic Systems Magazine January 2018 - 37
Aerospace and Electronic Systems Magazine January 2018 - 38
Aerospace and Electronic Systems Magazine January 2018 - 39
Aerospace and Electronic Systems Magazine January 2018 - 40
Aerospace and Electronic Systems Magazine January 2018 - 41
Aerospace and Electronic Systems Magazine January 2018 - 42
Aerospace and Electronic Systems Magazine January 2018 - 43
Aerospace and Electronic Systems Magazine January 2018 - 44
Aerospace and Electronic Systems Magazine January 2018 - 45
Aerospace and Electronic Systems Magazine January 2018 - 46
Aerospace and Electronic Systems Magazine January 2018 - 47
Aerospace and Electronic Systems Magazine January 2018 - 48
Aerospace and Electronic Systems Magazine January 2018 - 49
Aerospace and Electronic Systems Magazine January 2018 - 50
Aerospace and Electronic Systems Magazine January 2018 - 51
Aerospace and Electronic Systems Magazine January 2018 - 52
Aerospace and Electronic Systems Magazine January 2018 - 53
Aerospace and Electronic Systems Magazine January 2018 - 54
Aerospace and Electronic Systems Magazine January 2018 - 55
Aerospace and Electronic Systems Magazine January 2018 - 56
Aerospace and Electronic Systems Magazine January 2018 - 57
Aerospace and Electronic Systems Magazine January 2018 - 58
Aerospace and Electronic Systems Magazine January 2018 - 59
Aerospace and Electronic Systems Magazine January 2018 - 60
Aerospace and Electronic Systems Magazine January 2018 - 61
Aerospace and Electronic Systems Magazine January 2018 - 62
Aerospace and Electronic Systems Magazine January 2018 - 63
Aerospace and Electronic Systems Magazine January 2018 - 64
Aerospace and Electronic Systems Magazine January 2018 - Cover3
Aerospace and Electronic Systems Magazine January 2018 - Cover4
http://www.brightcopy.net/allen/aesm/34-2s
http://www.brightcopy.net/allen/aesm/34-2
http://www.brightcopy.net/allen/aesm/34-1
http://www.brightcopy.net/allen/aesm/33-12
http://www.brightcopy.net/allen/aesm/33-11
http://www.brightcopy.net/allen/aesm/33-10
http://www.brightcopy.net/allen/aesm/33-09
http://www.brightcopy.net/allen/aesm/33-8
http://www.brightcopy.net/allen/aesm/33-7
http://www.brightcopy.net/allen/aesm/33-5
http://www.brightcopy.net/allen/aesm/33-4
http://www.brightcopy.net/allen/aesm/33-3
http://www.brightcopy.net/allen/aesm/33-2
http://www.brightcopy.net/allen/aesm/33-1
http://www.brightcopy.net/allen/aesm/32-10
http://www.brightcopy.net/allen/aesm/32-12
http://www.brightcopy.net/allen/aesm/32-9
http://www.brightcopy.net/allen/aesm/32-11
http://www.brightcopy.net/allen/aesm/32-8
http://www.brightcopy.net/allen/aesm/32-7s
http://www.brightcopy.net/allen/aesm/32-7
http://www.brightcopy.net/allen/aesm/32-6
http://www.brightcopy.net/allen/aesm/32-5
http://www.brightcopy.net/allen/aesm/32-4
http://www.brightcopy.net/allen/aesm/32-3
http://www.brightcopy.net/allen/aesm/32-2
http://www.brightcopy.net/allen/aesm/32-1
http://www.brightcopy.net/allen/aesm/31-12
http://www.brightcopy.net/allen/aesm/31-11s
http://www.brightcopy.net/allen/aesm/31-11
http://www.brightcopy.net/allen/aesm/31-10
http://www.brightcopy.net/allen/aesm/31-9
http://www.brightcopy.net/allen/aesm/31-8
http://www.brightcopy.net/allen/aesm/31-7
https://www.nxtbookmedia.com