Attitude Estimation Method Using Kalman Filter For MARG Sensors and Its Application
Attitude Estimation Method Using Kalman Filter For MARG Sensors and Its Application
Zeyang Dai
A DISSERTATION
Abstract x
Chapter 1 Introduction 1
1.1 Attitude Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Attitude representation . . . . . . . . . . . . . . . . . . . . . . 2
1.1.3 MARG sensors model . . . . . . . . . . . . . . . . . . . . . . 7
1.1.4 Wahba’s problem . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.5 Attitude kinematics . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.6 Dynamic filtering and estimation . . . . . . . . . . . . . . . . . 9
1.1.7 Issues in practical applications . . . . . . . . . . . . . . . . . . 10
1.2 Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
iv
4.3.1 Filter design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.3.2 Matrix operation accelerator . . . . . . . . . . . . . . . . . . . 43
4.4 Implementation and Evaluation . . . . . . . . . . . . . . . . . . . . . . 44
4.4.1 Performance metrics . . . . . . . . . . . . . . . . . . . . . . . 44
4.4.2 Experiment setup . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.4.3 Performance of proposed accelerator . . . . . . . . . . . . . . . 45
4.4.4 Performance of accelerated filters . . . . . . . . . . . . . . . . 46
4.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Chapter 6 Conclusion 65
Acknowledgment 67
References 75
v
List of Figures
Figure 4.1 Framework of 9-axis Attitude and heading reference system (AHRS) 42
Figure 4.2 Block of the Matrix Operation Accelerator . . . . . . . . . . . . . 44
Figure 4.3 Architecture of the Experiment Platform . . . . . . . . . . . . . . 44
vi
List of Tables
vii
List of Abbreviations
viii
UKF Unscented Kalman filter
VFPU Vector floating point unit
Wi-Fi Wireless Fidelity
ix
Abstract
Attitude estimation using magnetic, angular rate and gravity (MARG) sensor array
is an essential technique for pervasive applications such as controlling of the Unmanned
Aerial Vehicle (UAV) and motion capture. These applications employ attitude estima-
tion techniques to obtain the orientation of an object with respect to the Earth’s frame.
Although an abundance of attitude estimation algorithms has been proposed in the past
decades, still there are some challenges, including the trade-off between the accuracy
and the computational effort, accelerating of the advanced estimation algorithm, and
adapting for the emerging field of motion capture. To deal with them, this thesis ad-
dresses these problems in order.
At first, in order to reduce the computational effort and provide a reliable solution
for critical constrained resource applications, a quaternion based Lightweight Extended
Kalman Filter (LEKF) is proposed. In this filter, we devise a simplified measurement
model to process acceleration and magnetic field observations. With this model, on
one hand, it need a few computations to process observation vectors. On the other
hand, half parameters of Jacobian matrix are constant and others have common factors,
this further reduces the computational effort. Moreover, theoretically the accuracy is
maintained due to without any linearization of the nonlinear observation model. Ex-
perimental results show that the proposed filter provides better performance in terms of
either attitude estimation accuracy or computational time.
Further, a matrix operation accelerator is investigated to accelerate the sigma-point
Kalman filter (SPKF). Comparing with the typical extended Kalman filter (EKF), SPKF
can provide better precision and is more robust, but at the expense of higher com-
putational complexity. On the other hand, the designed accelerator provides a good
reusability as well. Experiments are conducted on Zynq-7020, and results indicate that
the proposed scheme can reduce about 50% computing time.
Finally, we studied the motion capture system and designed wireless time synchro-
nized motion trackers. Each tracker is composed of a microcontroller enabling Wireless
Fidelity (WiFi) connectivity and a MARG sensor array. With built-in WiFi connectiv-
ity, it’s easily to establish the motion capture system by connecting to a given wireless
router, which actually is an scalable asynchronous sensor network. Thus, time syn-
chronization of these trackers is first investigated and an easy-to-operate scheme is pro-
posed, which avoids the complicated hardware design and reduces the cost significantly.
What’s more, to take full advantage of the performance of the sensors and enable the
sensors working at an asynchronous measurement rate, the traditional solution EKF is
adapted for multi-rate sensor fusion. Last but not least, several experiments are car-
ried out to validate the feasibility of the proposed motion tracker for motion capture.
Experimental results fully prove the reliability of the method for time synchronization
and that the proposed motion tracker is feasible for motion capture and there is a good
consistency with the optical system.
Chapter 1
Introduction
Attitude estimation, which is responsible for determining the orientation of the ob-
ject in three dimensional space, has become the fundamental component in most of
modern devices. For example, in controlling of Unmanned Aerial Vehicle (UAV), the
correct attitude information are crucial for feedback in the governing control system. In
smartphones, attitude information can be utilized for navigation, which has significantly
improved user experience in modern daily life. And in gaming industry, active gaming
platform is getting more and more popular, where the gaming devices gather the attitude
information of users, so as to expand the capability of this style of game, or help open
total virtual reality scenarios at the edge of the augmented reality. Attitude estimation
of the aforementioned applications is achieved with low-cost magnetic, angular rate and
gravity (MARG) sensor array with the recent advances in Micro-electromechanical Sys-
tems (MEMS), which normally consists of a 3-axis accelerometer, a 3-axis gyroscope,
and a 3-axis magnetometer.
In this section, we provide the knowledge review of attitude estimation using Mag-
netic, angular rate and gravity sensor array (MARG) sensors. The fundamental con-
cepts are presented in order, including the coordinate system, attitude representations,
the MARG sensors model, two fundamental methodologies for extracting attitude infor-
mation from MARG sensors readings, in which the first is known as Wahba’s problem,
also termed as deterministic attitude estimation of the accelerometer and magnetome-
ter, and the second is about the attitude kinematics which obtains the attitude through
integrating the gyroscope measurements. Then, the concept of dynamic filtering and
estimation is introduced, which is actually the sensor fusion technique, and aims at
eliminating the bottleneck of single sensor. Last but not least, issues in practical appli-
cations are discussed.
1
CHAPTER 1. INTRODUCTION
For Attitude and heading reference system or local tangent plane coordinates, there
are two well-known coordinate systems; East, North, Up coordinates (ENU) and North,
East, Down coordinates (NED). The former is used in geography, while the later one
is specially used in aerospace. The local ENU coordinates are formed from a plane
tangent to the Earth’s surface fixed to a specific location and the east axis is labeled as
x, the north y and the up z by convention, while for NED coordinates the north axis is
labeled as x, the east y and the down z. It is easy to find that, ENU coordinates and NED
coordinates are similar except for swapping ’down’ for ’up’ and x for y. In this paper,
like most of other researchers, NED coordinate system is chosen as the benchmark and
implemented for all the designed applications in this thesis, as defined in Fig. 1.1.
With respect to a reference frame, we have three frequently used ways to describe
the orientation of a rigid body, they are the equivalent form and include the Euler angles,
Direction cosine matrix (DCM) and quaternion respectively. In the following, we will
2
1.1. ATTITUDE ESTIMATION
discuss the three representations separately and describe the transformational relation
between them. The Euler angles are three angles introduced by Leonhard Euler, in
general they are termed as roll, pitch and yaw, and denoted as φ, θ and ψ or α, β and
γ in mathematical. According to Euler’s rotation theorem, the three angles can be used
to describe any rotation, as shown in Fig. 1.2 where φ is the angle between the x axis
and the N axis, θ for the angle between the z axis and the Z axis and ψ for the angle
between the N axis and the X axis. We assume the rotation is in x-convention. When
writing the rotation in terms of rotation matrices, the rotation is defined to be
where
cos(ψ) sin(ψ) 0
R(ψ) = −sin(ψ) cos(ψ) 0 (1.2)
0 0 1
1 0 0
R(θ) = 0 cos(θ) sin(θ) (1.3)
0 −sin(θ) cos(θ)
cos(φ) sin(φ) 0
R(φ) = −sin(φ) cos(φ) 0 (1.4)
0 0 1
where
r11 = cos(ψ)cos(φ) − cos(θ)sin(φ)sin(ψ)
r12 = cos(ψ)sin(φ) + cos(θ)cos(φ)sin(ψ)
r13 = sin(ψ)sin(θ)
r21 = −sin(ψ)cos(φ) − cos(θ)sin(φ)cos(ψ)
r22 = −sin()sin(φ) + cos(θ)cos(φ)cos(ψ) (1.6)
r23 = cos(ψ)sin(θ)
r31 = sin(θ)sin(φ)
r32 = −sin(θ)cos(φ)
r33 = cos(θ)
3
CHAPTER 1. INTRODUCTION
h i
The derived matrix is the so-called DCM. Let ω = ωx ωy ωz be the angular ve-
locity on axis x, y and z respectively of the rigid body expressed in the body frame B,
then, the rigid body kinematics equation is given by
Ṙ = RS(ω) (1.7)
For the rotation from the sensor frame to the body frame, the kinematics is expressed
X'
A
B
Y
Z'
̂
Z
Y'
Figure 1.3: Rotation from Frame A to Frame B, of Angle θ Around the Axis A r̂
as
Ṙ = −S(ω)R (1.9)
where rx , ry and rz are the components of the units vector A r̂ in x, y and z axes of
frame A respectively, while the elements, w, x, y, z and q0 , q1 , q2 q3 , are the frequently-
used different equivalent forms of the quaternion definition. Conventionally, all the
4
1.1. ATTITUDE ESTIMATION
With the quaternion of unit length, the frequently used quaternion arithmetic is defined
as the following. The conjugate of the quaternion is
h i
B ∗
Aq =A
B q = q 0 −q 1 , −q 2 , −q 3 (1.12)
where ∗ denotes the conjugate of the quaternion. The quaternion product of two quater-
nions, a and b, is defined by
h i h i
a ⊗ b = a0 a1 a2 a3 ⊗ b 0 b 1 b 2 b 3
T
a0 b 0 − a1 b 1 − a2 b 2 − a3 b 3
(1.13)
a0 b 1 + a1 b 0 + a2 b 3 − a3 b 2
=
a b − a b + a b + a b
0 2 1 3 2 0 3 1
a0 b3 + a1 b2 − a2 b1 + a3 b0
where ⊗ denotes the Hamilton product. Note that the quaternion product is not com-
mutative, that is, a ⊗ b 6= b ⊗ a. With another quaternion C
B q to express the rotation
from frame B to frame C, the compounded orientation A q can be obtained by
C
C
Aq =B C
Aq ⊗ Bq (1.14)
For the rotation between two same vectors, A v and B v, which are described in frame A
and frame B respectively, we insert 0 to each vector as the first element and figure out
the rotation by
B ∗
B
v=B A
Aq ⊗ v ⊗ Aq (1.15)
A q also can
As mentioned before, these representation are equivalent. The orientation B
be represented as the rotation matrix defined by
2q02 − 1 + 2q12 2(q1 q2 + q0 q3 ) 2(q1 q3 − q0 q2 )
R(B 2
A q) = 2(q1 q2 − q0 q3 ) 2q0 − 1 + 2q2
2
2(q2 q3 + q0 q1 ) (1.16)
2(q1 q3 + q0 q2 ) 2(q2 q3 − q0 q1 ) 2q02 − 1 + 2q32
where the conversion is a homogeneous expression. The reverse mapping, from the ro-
tation matrix to the quaternion, though the Shepperds’s method [5] is usually considered
5
CHAPTER 1. INTRODUCTION
√
where t0 = 1 + r11 + r22 + r33 ,
(r23 − r32 )/t1 if r22 < −r33 , r11 > r22 , r11 > r33
1 t1 if r22 > −r33 , r11 < −r22 , r11 > −r33
q1 = (1.18)
2 (r12 + r21 )/t1 if r22 > r33 , r11 < −r22 , r11 < −r33
(r + r )/t if r22 < r33 , r11 < −r22 , r11 < r33
31 13 1
√
where t1 = 1 + r11 − r22 − r33 ,
(r31 − r13 )/t2 if r22 < −r33 , r11 > r22 , r11 > r33
1 (r12 + r21 )/t2 if r22 > −r33 , r11 < −r22 , r11 > −r33
q2 = (1.19)
2 t2 if r22 > r33 , r11 < −r22 , r11 < −r33
(r + r )/t if r22 < r33 , r11 < −r22 , r11 < r33
23 32 2
√
where t2 = 1 − r11 + r22 − r33 ,
(r12 − r21 )/t3 if r22 < −r33 , r11 > r22 , r11 > r33
1 (r31 + r13 )/t3 if r22 > −r33 , r11 < −r22 , r11 > −r33
q3 = (1.20)
2 (r23 + r32 )/t3 if r22 > r33 , r11 < −r22 , r11 < −r33
t if r22 < r33 , r11 < −r22 , r11 < r33
3
√
where t3 = 1 − r11 − r22 + r33 . This is the revised version and more accurate and
stable. The Euler angles can be extracted from B
A q by
6
1.1. ATTITUDE ESTIMATION
where k represents the sensor type, uk is the truth physical quantities in metric unit, and
yk is the sensor reads. Sk is the scale factor. Tk is the Gram–Schmidt orthogonalization
matrix for compensating the error of non-orthogonality. bk is the bias vector, normally
it’s the constant. nk is the vector of white noise caused by thermo-mechanical events
and stated as a zero mean process with a standard deviation equal to σk . For the 3-axis
sensor, yk , uk , bk and nk is 3 × 1 vectors, while Sk and Tk are 3 × 3 matrices. Although
the sources of error are almost same, they have different contributions to the overall
orientation accuracy for different sensors, we discuss them separately in the following.
A gyroscope is the sensor that measures the angular rate, the orientation for which
is obtained by integrating the measured angular rate over time. Evidently, constant bias
errors grow linearly with time and the bias has a significant effect on the accuracy of
the orientation. But not to worry, we can find the constant bias error of a gyro by taking
the average of the output over a long period of time while the device is not rotating, and
subtract it from subsequent measurements to eliminate this form of error. In contrast,
white noise has no effect on the integrated orientation due to it is a zero mean process.
Besides, the bias stability, not represented in the sensor model, generally it is very small
and not necessary to concern for the low-cost MARG, is the another often concerned
noise resource and tell us how stable the bias of a gyroscope is over a certain specified
period of time.
An accelerometer is responsible for measuring the acceleration. In modern devices,
the bias of the accelerometer is very small and has a minimal effect on the accuracy of
the orientation.
An magnetometer measures the strength and direction of the local magnetic field.
Different with the gyroscope and the accelerometer, the main sources of error are the
soft iron and hard iron due to its measurements are subjected to distortion. Soft iron
distortions are considered deflections or alterations in the existing magnetic field and
commonly caused by metals such as nickel and iron, while hard iron distortion caused
by the magnetic material or magnetized objects will cause a permanent bias in the sensor
7
CHAPTER 1. INTRODUCTION
output. In actual use, the magnetometer is required to do the ellipse fitting to compen-
sate such two error for a given application scenario.
Wahba’s problem [8], also known as static attitude determination, involves numeri-
cally determining the attitude taking advantage of the body vector observations without
considering its kinematics. For instance, the attitude determination using the measure-
ments of accelerometer and magnetometer. In this problem, simultaneously two sets of
N observed unit vectors V1 , ..., VN and W1 , ..., WN are respectively known in the refer-
ence coordinate system and the body frame, the attitude is merely regarded as a matrix
that transforms the reference vectors V1 , ..., VN in the reference frame to the vectors
V1 , ..., VN in the body frame and as a result, can be obtained by mathematical optimiza-
tion techniques. In this way, the rotation matrix, orthogonal matrix R, is numerically
found by minimizing
N
1X
L(R) = ai |Wi − RVi |2 (1.23)
2 i=1
PN
where the ai are non-negative weights. By normalizing the weights, that is, i=1 ai =
1, the loss function is rewritten in the straightforward form
N
X
L(R) = 1 − ai WiT RVi = 1 − tr(RB T ) (1.24)
i=1
This equation converts the problem to maximum the term tr(RB T ) by finding the ap-
propriate R and attitude is found on an optimization basis. The found attitude normally
comes with a lower accuracy due to the discarding of the information of the system
dynamics.
Solutions to the Wahba’s least squares problem includes the earliest attitude re-
construction method TRAID [9], Singular Value Decomposition (SVD) method [8],
Fast Optimal Attitude Matrix (FOAM) [10], Q-Method [11], QUaternion ESTimation
(QUEST) [12], EStimation of Optimal Quaternion (ESOQ) [13–15], the recent consid-
eration [16] and so on. For more details of this problem readers are referred to [17].
8
1.1. ATTITUDE ESTIMATION
1
q̇ = [Ω×]q (1.26)
2
where
0 −ωx −ωy −ωz
ωx 0 ω z −ω y
[Ω×] =
ω −ω
(1.27)
y z 0 ω x
ωz ωy −ωx 0
Then integrating over time is
1
qk+1 = I4×4 + [Ω×] qk (1.28)
2
where k denotes the time step, while I4×4 is the 4×4 identity matrix. The state transition
formula takes the full system dynamics into account. However, when there are bias
errors that occurs in the gyroscope readings, this iterative formula would lead to the
significant accumulative error of the estimated angles with the increasing of time. As
so, we generally fuse the measurements of the gyroscope and observations from the
accelerometer and magnetometer together as the reliable solution, this is also called the
sensor fusion techniques and leads us to the next topic.
9
CHAPTER 1. INTRODUCTION
(FCF) than before. However, the typical drawback of CF is that the gain is constant and
always empirically given for one time and the inability to adapt the weight for another
quite different scenario, still can not be overcome completely. In contrast, KF based
methods are always taken as the common solution due to its guaranteed performance.
Therefore, this thesis mainly involves the theory of KF.
The KF is by far the most common one and statistically the optimal estimate for
linear system with independent white Gaussian noises. Especially only one iteration
is required for KF applications since the rate of convergence is higher than the angu-
lar speed in general. As a result of the guaranteed high performance, amounts of KF
based methods have been developed. In particular to adapt for nonlinear systems, such
methods like Extended Kalman filter (EKF) and the advanced SPKF, which includes
Unscented Kalman filter (UKF) [20], Central difference Kalman filter (CDKF) [21, 22]
and Cubature Kalman filter (CKF) [23], are developed in the later. For more discussion,
the introduction of KF is given in the Chapter 2, and the presentation and acceleration
of SPKF is explained in the Chapter 4.
• For low-end devices, the resource are limited strictly, thus finding the lightweight
solution is absolutely imperative.
• For advanced Kalman filters based applications, how to achieve the performance
of being real-time has to be considered.
• In the real application of motion capture, where the distributed sensor nodes ob-
tain the orientation information of the object so as to reconstruct the motion tra-
jectory, as a result, time synchronization between the distributed sensor nodes
needs to be investigated. Besides, due to the sensors of the accelerometer, the
gyroscope, and the magnetometer works in an asynchronous measurement rate,
multi-rate sensor fusion also should be concerned.
10
1.3. CONTRIBUTIONS
Chapter 4
Motion trackers and
built motion capture
system
Chapter 2
Lightweight Extended Kalman Fiter for MARG Sensors
Orientation Estimation
Chapter 4
Wireless Time Synchronized
Motion Trackers Using Kalman
Filtering to Multi-rate Sensor Fusion
Chapter 3
Real-Time Attitude Estimation of Sigma-Point Kalman
Filter via Matrix Operation Accelerator Chapter 2 & 3
Atiitude estimation
algorithm and
Kalman Filter
algorithm accelerator
Figure 1.4: Thesis Structure and the Relationship of Three Main Chapters
1.3 Contributions
This dissertation is a report about three years of my research on the topics of motion
capture theory and application using KF for MARG sensor array. We start the research
from two ways; one is the attitude estimation theory; two is the investigation of the
motion capture system using MARG sensor array. The results are described in Chapter
11
CHAPTER 1. INTRODUCTION
• The accuracy of the proposed filter for the drone application and human motion
capture is evaluated with the golden truth provided by the optical system, namely
Vicon.
• The general structure of SPKF is summarized and the attitude estimation filter
based on SPKF is designed.
(3) Chapter 4. Wireless time synchronized motion trackers using kalman fil-
tering to multi-rate sensor fusion
12
1.4. PUBLICATIONS
For existing MARG sensor array based capture systems, time synchronization be-
tween trackers is normally ignored. Although some commercial devices such [24] pro-
vide accurate hardware solution, the hardware solution usually raise the cost signifi-
cantly and exceed the actual needs of the precision. therefore, in this paper,
• To verify the feasibility of the proposed motion trackers for motion tracking,
firstly time synchronization is assessed, then the accuracy of the attitude esti-
mation is evaluated with the reference measurements provided by Vicon, at the
last the built motion capture system is validated during human walking and the
results are compared with results extracted from the optical system.
1.4 Publications
The following papers have been published or submitted to major journals and con-
ference.
(1) Major journal paper
1. Zeyang Dai, and Lei Jing. Lightweight Extended Kalman Filter for MARG Sen-
sors Attitude Estimation. IEEE Sensors Journal, 2021.
DOI: 10.1109/JSEN.2021.3072887.
2. Linjun Zhao, Chuanhua Su, Zeyang Dai, Huakun Huang, Shuxue Ding, Xinyi
Huang and Zhaoyang Han. (2019). Indoor device-free passive localization with
DCNN for location-based services. The Journal of Supercomputing, 1-18.
DOI: 10.1007/s11227-019-03110-2.
1. Zeyang Dai, and Lei Jing. Real-Time Attitude Estimation of Sigma-Point Kalman
Filter via Matrix Operation Accelerator. 2019 IEEE 13th International Sym-
posium on Embedded Multicore/Many-core Systems-on-Chip (MCSoC), Singa-
pore, Singapore, 2019, pp. 342-346.
DOI: 10.1109/MCSoC.2019.00055.
13
CHAPTER 1. INTRODUCTION
2. Zeyang Dai, Chenghong Lu and Lei Jing. Time Drift Compensation Method on
Multiple Wireless Motion Capture Nodes. In 2020 13th International Conference
on Human System Interaction (HSI) (pp. 266-271). IEEE.
DOI: 10.1109/HSI49210.2020.9142648.
3. Lei Jing, Zeyang Dai and Yiming Zhou. Wearable Handwriting Recognition with
an Inertial Sensor on a Finger Nail. 2017 14th IAPR International Conference on
Document Analysis and Recognition (ICDAR), Kyoto, 2017, pp. 1330-1337.
DOI: 10.1109/ICDAR.2017.219.
4. Yiming Zhou, Zeyang Dai and Lei Jing. A Controlled Experiment Between Two
Methods on Ten-Digits Air Writing. 2016 IEEE International Conference on
Computer and Information Technology (CIT), Nadi, 2016, pp. 299-302.
DOI: 10.1109/CIT.2016.112.
14
Chapter 2
Related Work
In this section, two related works are described; first to introduce the basic theory
of KF, and second to introduce the method of noise identification for MARG sensors.
p(ω) ∼ N (0, Q)
(2.2)
p(υ) ∼ N (0, R)
With the symbol xˆ−k ∈ R to express the a priori state estimate at step k, and xˆk ∈ R
n n
to express the a posteriori state estimate at step k, the a priori and a posteriori errors
15
CHAPTER 2. RELATED WORK
can be defined to be
e− −
k = xk − x̂k
(2.3)
ek = xk − x̂k
Then the a priori estimate error covariance is
h i
−T
Pk− =E e−
k ek (2.4)
Considering
x̂k = x̂− −
k + Kk (zk − Hk x̂k ) (2.6)
where this formula is to compute an a posteriori state estimate x̂k as a linear combi-
nation of an a priori estimate x̂−
k and a weighted difference between an actual mea-
surement zk and a measurement prediction Hk x̂− −
k , and the difference (zk − Hk x̂k ) is
called the measurement innovation or the residual. The n × m matrix K is the gain
for minimizing the a posteriori error covariance. Substituting the above equations, the
resulting K is given by
Then we will get the well-known KF formulas and the summarized structure is graphi-
cally presented in Fig. 2.1.
Predict
− − −1
= ( + )
−
̂ = ̂ +
− −
̂ = ̂ + ( − ̂ )
−
= +
−
= ( − )
Correct
16
2.2. NOISE IDENTIFICATION
∂f ∂h
Ak = , Hk = (2.9)
∂x x̂k−1 ∂x x̂−k
and
∂f ∂h
W = , V = (2.10)
∂ω x̂k−1 ∂υ x̂−k
As for other advanced KFs, which aims at compensating the errors caused by the
large linearity of the system, are not introduced here.
Figure 2.2: Sample Plot of Square-Root Allan Variance Analysis Results [1]
17
CHAPTER 2. RELATED WORK
For MARG sensors, there are five basic noise terms [31], they are quantization
noise, the most concerned angle random walk, bias instability, rate random walk, and
rate ramp. For estimation of MARG sensors’ stochastic errors, several methods have
been devised, that is, adaptive Kalman filtering, Power spectral density (PSD), auto-
correlation function and Allan variance [32]. Among them, Allan variance [1, 33, 34]
is the simplest one, which is a method of representing the root mean square random-
drift errors as a function of averaging times. Assume that we have N measurements
y = {y1 , y2 , ..., yN } with sample time τ0 . The cluster time with length m is expressed
as τm = mτ0 . Thus, Allan variance is expressed as
M
X −1 h i2
1
σy2 τ = y j+1 − yj (2.11)
2(M − 1) j=1
where M denotes the number of cluster samples y k , and the average of cluster is defined
by
m
1 X
y k (m) = ym(k−1)+i 0 ≤ k ≤ M (2.12)
m i=1
where k indicates the kth cluster and the cluster time m is subject to m ≤ N/2. Then
we plot square-root of the results in log-log plot, it should look like the one shown in
Fig. 2.2. Different terms appear in different regions of τ . This allows us to identify
various random that exist in the measurements processes easily.
18
Chapter 3
3.1 Introduction
MARG sensors have been widely applied to our surrounding devices. These appli-
cations include the UAV [35, 36], human motion capture [37], wearable devices [38],
and so on. The MARG sensors are employed to compute the orientation of a rigid body
with respect to an inertial frame so as to precisely control the actuators or extract mo-
tion features. Normally, orientation parameters can be acquired from two approaches.
The first approach, related to the Inertial navigation system (INS), is to do integral of
angular rates from gyroscope over time if initial conditions are known. The second
approach is summarized as Wahba’s problem [8, 17] formed by at least two vector ob-
servations. As is known, in the case of low-cost MARG sensors, gyroscope measures
the angular velocity of a moving object. Accelerometer and magnetometer measure the
earth’s gravitational and magnetic fields respectively to provide an absolute reference
of orientation with the assumption that the measurements are not disturbed by any ex-
ternal noises. Their performance are always subject to their inherent drawbacks, for
example, drift error, external disturbance, and so on, that means we can not just rely on
any one to obtain accurate orientation estimation. For instance, the angular-rate inte-
gral will diverge very fast as time goes, and accelerometer’s output will be disturbed by
non-gravitational acceleration when the motion isn’t flat. There are too many uncertain-
ties inside almost every process of their sensing. Hence, a reliable attitude estimation
solution is to fuse them together using sensor fusion techniques.
Looking back on the past decades, amounts of approaches have been proposed for
sensor fusion. Roughly, we can classify them into two categories: complementary fil-
19
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
ter [39–41] and Kalman filter [42–44] based methods. Complementary filters obtain a
more accurate orientation estimation by compensating for each sensor in the frequency
domain, while Kalman filters adopt a probabilistic determination of the state modeled as
a Gaussian distribution given the system model. Early thoughts of complementary filter
based solutions are raised around 1990 by Foxlin who first applied MARG sensors to
monitor the attitude motion of human’s head [18], the strategy of which is that combines
the accelerometer and magnetometer as the Electronic compass (eCompass) [45], the
problem of which can be effectively solved by optimization algorithms like GDA [39],
Gauss newton algorithm (GNA) [46] and Levenberg-Marquadt algorithm (LMA) [47]
or solutions to Wahba’s problem for example TRIAD [48, 49], Fast optimal matrix al-
gorithm (FOMA) [10], QUEST [50] and ESOQ [13]. Based on this, Mahony in 2008
studied the attitude representation on spectial orthogonal groups by different way [51].
Madgwick computed the attitude using the GDA via quaternion representation [39].
Especially FCF [40] proposed by Wu was proved to be faster and more robust than pre-
vious. Although all the above solutions are the constant gain complementary filters, the
typical drawback of which is that the gain is always empirically given for one time and
the inability to adapt the weight for another quite different scenario when their accu-
racy is affected, it has reflected the development trend where lightweight solutions with
maintained accuracy are preferred when seeking the balance between the performance
and the computation complexity.
The Kalman filter is by far the most common one and statistically the optimal es-
timator for linear system with independent white Gaussian noises, generally one itera-
tion is sufficient for convergence. As a result of the excellent performance, considering
that the systems are normally nonlinear, and to apply Kalman filter to nonlinear sys-
tems, adaption and implementation of Kalman filter for nonlinear systems are signif-
icantly investigated in the past decades. Adapted methods basically contain EKF [?],
UKF [20], CDKF [21, 22], and CKF [23], where EKF is the most popular solution, and
the later three are the so called sigma-point Kalman filter with higher computations and
advanced performance. Same with complementary filters, Kalman filter is also often
considered for attitude estimation. Sabatini presented his work to obtain accurate ori-
entation estimation using EKF in [43]. To reveal higher accuracy, Marina proposed the
attitude estimation algorithm based on UKF [35]. Although performance is guaranteed,
these methods are heavy on computations, and resource constrained devices could not
afford for it. Similar with the development trend of complementary filters, the prob-
lem of attitude estimation using Kalman filter are revisited recently. Valenti presented
a linear Kalman filter (LKF) [44] using the algebraic quaternion algorithm. As well,
Guo proposed the fast Kalman filter (Guo’s FKF) [52] with their previous contribu-
tions, which has been proved to be better than LKF. These attempts exactly made a
major breakthrough on reducing computational cost. However, existing solutions are
20
3.2. ORIENTATION FROM OBSERVATION VECTORS
still not perfect. For example, too many linear approximations could lower the accu-
racy, and there may be alternative methods to further reduce the computational cost,
and maintain the accuracy.
Therefore, what motivates us is to develop a novel lightweight Kalman estimator to
reduce computational cost, and maintain the accuracy so as to further reduce power dis-
sipation for MARG sensors attitude estimation. In this paper, a simplified measurement
model is systematically derived to establish the LEKF with employing the quaternion
kinematic equation as the process model. This proposed measurement model simplifies
the involved computations, and is proved to make a contribution on reducing compu-
tation cost. During the experiments, a commercial sensor for data collection, and an
optical system to provide reference measurements of orientation, namely Vicon, are
utilized to investigate the performance of the established Kalman filter. Evaluation for
different application scenarios is considered, which primarily include human motion
capture and the drone applications. Results indicate that the proposed filter provides re-
liable performance for both applications. Moreover, the comparison experiment shows
that the proposed filter provides better performance in terms of either attitude estimation
accuracy or computational time.
This chapter is organized as follows. Section II involves the attitude determination
from the accelerometer and magnetometer. Section III describes the design and imple-
mentation of the proposed filter. Experimental environment, experiments, and results
are presented in Section IV. Section V gives the concluding remarks.
Ab = CAr ,
(3.1)
M b = CM r ,
21
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
o1 = W1 ,
o2 = W2 ,
o3 = W1 × W2 ,
(3.4)
r1 = V 1 ,
r2 = V 2 ,
r3 = V1 × V2 .
Directly, we assign (W1 , V1 ) to the pair Ab , Ar , and (W2 , V2 ) to the pair M b , M r .
Through derivation, the final result C is given by
C1,1 C1,2 C1,3
C = C2,1 C2,2 C2,3
C3,1 C3,2 C3,3
m −m a ay mz −az my
(3.5)
x
N m
D x
mN
ax
= my −m
m
D ay az mx −ax mz
mN
ay ,
N
mz −mD az
mN
ax my − ay mx az
22
3.2. ORIENTATION FROM OBSERVATION VECTORS
quaternion,
C1,1 = q02 + q12 − q22 − q32
C1,2 = 2(q1 q2 + q0 q3 )
C1,3 = 2(q1 q3 − q0 q2 )
C2,1 = 2(q1 q2 − q0 q3 )
C2,2 = q02 − q12 + q22 − q32 (3.6)
C2,3 = 2(q0 q1 + q2 q3 )
C3,1 = 2(q0 q2 + q1 q3 )
C3,2 = 2(q2 q3 − q0 q1 )
C3,3 = q02 − q12 − q22 + q32
and the transformation relation between the quaternion and the Euler angles,
where φ is the roll, θ for pitch, and ψ for yaw, respectively. Taking the constraint of
the quaternion representing the orientation into consideration, we can obtain that using
only four elements of the DCM are sufficient to extract the Euler angles, thereinto C1,3
and C2,3 are for determining the pitch and roll angles, and C1,1 and C1,2 are responsible
for the yaw angle. Although C3,3 as well can play the same role as C1,1 , C1,1 is preferred
because of the simpler calculations, as the following reformulated measurement model
indicates.
C1,3 ax
C2,3 ay
zk = = , (3.8)
C a
3,3 z
ay mz −az my
C1,2 mN
23
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
Predict Steps
Correct the covariance
State prediction
Magnetometer
Covariance prediction
Kalman gain
Correct Steps
This section investigates the establishment of the proposed LEKF, and we firstly
assume that the bias error of gyroscope are constant, and has been cancelled before
used. In order to formulate the system model, we employ the discretized quaternion
kinematic equation as the process mode, which is written as
∆T
qk = I4×4 + [Ω×] qk−1 , (3.9)
2
T
where qk = q0,k q1,k q2,k q3,k defines the process state in quaternion form
at time k, I4×4 is the 4 × 4 identity matrix, and ∆T denotes the sampling interval
between epoch k and k − 1, while [Ω×] is determined with the gyroscope output
ω = (ωx , ωy , ωz )T by
0 −ωx −ωy −ωz
ωx 0 ωz −ωy
[Ω×] = . (3.10)
ω −ω 0 ω
y z x
ωz ωy −ωx 0
By integrating with the derived measurement model, the Kalman filter model is formu-
lated by
∆T
qk = I4×4 + [Ω×] qk−1 + wk ,
2 (3.11)
zk = Hk qk + υk ,
24
3.3. FILTER DESIGN
where wk and υk denote the progress noise and observation noise respectively, while
Hk is the observation matrice, we write down the derivation by
2q1,k q3,k + 2q2,k q0,k
2q2,k q3,k − 2q1,k q0,k
∂ 2
2 2 2
q
0,k − q 1,k − q 2,k + q 3,k
2q1,k q2,k − 2q3,k q0,k
Hk =
∂qk (3.12)
−q2,k q3,k −q0,k q1,k
q1,k q0,k q3,k q2,k
= 2
q
.
0,k −q1,k −q2,k q3,k
q3,k q2,k q1,k q0,k
As is known, the process model and measurement model can not be applied to
the covariance directly. Instead, the matrices of the Jacobian are computed, which are
actually the partial derivatives for both models. For the process model, the Jacobian
Ξk−1 is given by
q1,k−1 q2,k−1 q3,k−1
−q0,k−1 q3,k−1 −q2,k−1
Ξk−1 = −q
.
(3.13)
3,k−1 −q 0,k−1 q 1,k−1
∂zk
J= n o
∂ (Ab )T , (Mb )T
∂C1,3 ∂C1,3 ∂C1,3 ∂C1,3 ∂C1,3
∂C1,3
∂ax
∂C2,3
∂ay
∂C2,3
∂az
∂C2,3
∂mx
∂C2,3
∂my
∂C2,3
∂mz
∂C2,3
(3.14)
∂a
= x ∂ay ∂az ∂mx ∂my ∂mz
∂C3,3 ∂C3,3 ∂C3,3 ∂C3,3 ∂C3,3 ∂C3,3
∂ax ∂ay ∂az ∂mx ∂my ∂mz
∂C1,2 ∂C1,2 ∂C1,2 ∂C1,2 ∂C1,2 ∂C1,2
∂ax ∂ay ∂az ∂mx ∂my ∂mz
The detailed results are listed in the Appendix A. Henceforth, we can easily handle
the covariance Σwk for the process noise, and Συk for the observation noise, which are
respectively computed by
2
∆T
Σwk = Ξk−1 Σgyro ΞTk−1 , (3.15)
2
and
Συk = J · diag [Σacc , Σmag ] · JT , (3.16)
where Σgyro = σg2 · I3×3 is the covariance of gyroscope, Σacc = σa2 · I3×3 for accelerom-
25
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
z− −
k = Hk qk (3.17)
the workflow is summarized in Fig. 3.1. Considering the constraints of the quaternion
representing the orientation and to ensure the filer working correctly, another thing that
should be noted, is that the last resulting quaternion must be normalized in every iter-
ation of Kalman filtering. Intuitively, LEKF is a lightweight Kalman filter, due to the
simplified measurement model, and that its involved computation is reduced, particu-
larly more than half elements of the Jacobian J are constant, and other parameters have
plenty of common factors.
26
3.4. EXPERIMENTS AND RESULTS
magnetometers, and interfaced with a compact computer called NanoPi Duo2. The
hardware is shown in Fig. 3.2. In the following experiments, the raw data is collected
via the UART to USB data wire at 200Hz. With Zhang’s contribution in [7], his pro-
posed calibration method is employed to cancel the bias errors, including both of the
accelerometer and the gyroscope, while the scale factor error, as the equation 5 indi-
cates in [7], is not considerable in our case. Academically, the scale factor error also
should be concerned for the calibration, yet it’s experimentally proved to be extremely
small [53,54], and have few influence comparing with the bias errors, especially for the
sensor fusion of short time periods, and modern advanced integrated sensors. Regrad-
ing on the magnetometer, the frequently-used ellipsoid fitting algorithm is applied to
calibrate the magnetometer [55]. Through analyzing the obtained calibration parame-
ters, we found that the drone has a significant magnetic disturbance to the axis-z of the
magnetometer, including both of the soft- and hard-iron interference, it is predictable
that the angle of yaw could be subject to greater errors than other two of Euler angles.
For the filter setup, the sensor noise characteristics are obtained directly from the offi-
cial datasheet of HWT905, that is, Σgyro = 0.0025·I3×3 (◦ /s)2 , Σacc = 0.0001·I3×3 g 2 ,
and Σmag = 0.0004 · I3×3 uT 2 .
27
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
an advanced Kalman filter, cubature Kalman filter [23], and then figure out the offset
between the two coordinate systems. Secondly, for each experimental data, we perform
a cross-correlation of both angular rates of the two systems to figure out the time drift,
as indicated in Fig. 3.4, where both angular rates have been aligned to the same coor-
dinate system. In theory, the error of time synchronization is less than one sampling
interval.
1 Vicon
MARG
rad/s
1
36.5 36.505 36.51 36.515 36.52
1 Vicon
MARG
rad/s
1
36.5 36.505 36.51 36.515 36.52
Time(s)
28
3.4. EXPERIMENTS AND RESULTS
2
Magnetometer (Gauss) Gyroscope (rad/s) Accelerometer (G)
X
1 Y
Z
0
1
2 0.0 20.0 40.0 60.0 80.0
X
1 Y
0 Z
1
2
0.0 20.0 40.0 60.0 80.0
1 X
Y
0 Z
1
0.0 20.0 40.0 60.0 80.0
Time(s)
200
175
150
125 Z
100
75
50
25
65
60
55
30 40 50 Y
50 60 45
X 70 80 40
by the optical system. Directly, although the movement range between different trials
is different that leads to the fluctuating evaluation results, we can see that the estimated
roll and pitch has relative stable performance for both application scenarios, whereas
29
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
the estimated yaw performs relatively poorly for human motion capture, and dramati-
cally under the condition of drone applications. We would explain the results separately
in detail in the following.
For more details about the attitude estimation for human motion capture applica-
tions, we show the raw data of the Trial1 in Fig. 3.5, the corresponding estimated Euler
angles in Fig. 3.7, and the consequent moving trajectory in Fig. 3.6. Especially, Fig.
3.6 intuitively reveals the process of the movement, in which we pick up the sensor from
the red point, then stochastically wave the sensor in the air, and finally put the sensor
back to the blue position. In this case, the estimated Euler angles coincide well with the
reference, except that the estimated yaw has a large initial error. Through our analysis,
as stated above, the large initial error is caused by the significant magnetic distortion of
the drone, even though the magnetometer’s readings have been calibrated using ellipse
fitting algorithm, it cannot be overcome completely. As well, the iron house, in which
the optical system is assembled, has some effects on the magnetometer. This is why the
estimated yaw performs a bit worse than the other two. In contrary, on the other hand,
this proves that the proposed LEKF has a good convergence performance.
20 Reference
Estimated
Roll (deg)
0
20
20 0.0 20.0 40.0 60.0 80.0
Reference
Estimated
Pitch (deg)
20
0.0 20.0 40.0 60.0 80.0
25 Reference
Estimated
Yaw (deg)
0
25
50
0.0 20.0 40.0 60.0 80.0
Time(s)
Similarly, in order to analyze the details about the attitude estimation for drone
applications, Fig. 3.5 and Fig. 3.7 depict the raw data and corresponding estimated
Euler angles of Trial4, respectively. For the large spikes of the raw data in the tail. it’s
attributed to the sudden landing of the drone. In this case, it can be recognized easily
that there is drastic vibration on the axis-z of the accelerometer, which is certainly
resulted by the flight of the drone. Even so, both of the roll and pitch still do the
estimation very well. However, the estimated yaw diverges from the reference greatly.
The reason is that the running motors of the drone, which always work with powerful
30
3.4. EXPERIMENTS AND RESULTS
pulse current, further disturbs the surrounding magnetic field, it’s very hard to deal with
such dynamic noises. By contrast, the estimated roll and pitch angles are immune to the
magnetic disturbance.
20 Reference
Estimated
Roll (deg)
0
20
20 0.0 20.0 40.0 60.0 80.0
Reference
Estimated
Pitch (deg)
20
0.0 20.0 40.0 60.0 80.0
25 Reference
Estimated
Yaw (deg)
0
25
50
0.0 20.0 40.0 60.0 80.0
Time(s)
Evidently, through the evaluation results, the proposed LEKF is shown to coincide
with the reference very well for both application scenarios. Although the performance
of the estimated yaw depends on the environmental factor of the magnetic field strongly,
the estimated roll and pitch are proved to be immune to the magnetic disturbance.
31
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
650
Without Pollution
600 Polluted Slightly
Polluted Strongly
Amplititude (mGauss)
550
500
450
400
Start of the pollution End of the pollution
350
0.0 20.0 40.0 60.0 80.0 100.0
Time(s)
When operating under the condition of the distorted magnetic field, the magnetome-
ter’s readings will be distorted heavily. To a certain degree, although the experiment of
attitude estimation evaluation has proved the fact that the estimated roll and pitch are
immune to the magnetic disturbance, to clearly learn the fact, a simulation is conducted
where we distort the magnetometer’s outputs manually. We collect a static data that is
considered as a clean set of data, all the estimated Euler angles of which should stay
in a straight line, and then manually pollute this data with both of soft- and hard-iron
disturbance, as drawn in Fig. 3.10. Fig. 3.11 shows the estimated Euler angles of
clean and polluted data for a comparison. Apparently, for the slight magnetic distor-
tion (lower than 50 mGauss), basically we can say that the estimated roll and pitch are
immune to the magnetic distortion. However, for the strong magnetic distortion (more
than 50 mGauss), it not only affects the yaw angle but also the roll and pitch. In this
case, a robust mechanism such as detecting the magnetic distortion with the norms of
the magnetometer’s readings can be leveraged to make all the Euler angles immune to
magnetic disturbance.
Apart from the usual applications, attitude estimation on the drone has a high de-
mand on the response in the presence of the vibration. As mentioned above, definitely
there exists vibrations in all the trials of the drone, the Fast Fourier Transformation
(FFT) analysis result, as shown in Fig. 3.12, also confirms it as fact, where an approxi-
32
3.4. EXPERIMENTS AND RESULTS
0.0
Without Pollution
0.5 Polluted Slightly
Roll (deg)
1.0 Polluted Strongly
1.5
Pitch (deg)
2.80 Polluted Strongly
2.85
2.90
5 0.0 20.0 40.0 60.0 80.0 100.0
Without Pollution
0 Polluted Slightly
Yaw (deg) Polluted Strongly
5
10
0.0 20.0 40.0 60.0 80.0 100.0
Time(s)
0.010
0.008
0.006
Amplititude
0.004
0.002
0.000
0 20 40 60 80 100
Frequency (Hz)
Figure 3.12: FFT Analysis Result of the Accelerometer‘s Axis-Z Values of Trial4
mate 90Hz vibration on the axis-z of the accelerometer’s outputs can be identified eas-
ily. We can see that, although the proposed LEKF does not have any robust mechanism
about the vibration, it’s experimentally proved to have a good anti-vibration ability.
where the superscript of υk∗ is utilized to distinguish with the proposed. Experimental
conditions of which are the exact same as the LEKF, for instance the covariance of the
filter, and the runtime environment. The experiment compares aspects of the precision
of attitude estimation, and the computational cost.
33
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
RMSE
Trials Roll Pitch Yaw Method
1.60 1.68 3.22 Guo’s FKF
1
1.31 1.62 3.32 UKF
1.48 1.01 3.23 Guo’s FKF
2
1.17 0.98 2.49 UKF
1.20 0.95 3.22 Guo’s FKF
3
0.81 0.91 2.50 UKF
1.72 1.15 5.44 Guo’s FKF
4
1.23 1.03 5.87 UKF
1.25 0.92 2.44 Guo’s FKF
5
1.15 0.97 4.09 UKF
1.97 2.04 7.96 Guo’s FKF
6
1.41 1.95 5.87 UKF
The overall statistical values of the attitude estimation accuracy for all trials are
shown in Table. 3.2, and Fig. 3.13 draws the estimation details of Trial1. Combin-
ing with Table. 3.1, we can find out that the accuracy of the proposed LEKF and the
basic UKF has a tiny difference on the roll and pitch, on one hand, this is because
the linearized system model limits the performance, so that the UKF cannot play to its
strength, particularly for large nonlinear systems, on the other hand, this means that the
proposed LEKF can provide excellent performance for such applications, as same as
the UKF, although the EKF has first-order approximated the calculation progress. Also,
we can see that, the proposed LEKF outperforms Guo’s FKF on the estimation of roll
and pitch, regardless of which application scenarios. Regarding the yaw angle, there
are lots of uncertainties caused by the magnetic distortion, but in general, the proposed
LEKF is second only to the UKF for human motion capture, it as well demonstrates
that the UKF does well in challenging environment.
Computational cost is another important indicator of algorithm besides the accuracy.
Here, we compare the consumed time of the proposed LEKF and Guo’s FKF, whereas
the UKF is not considered, due to UKF is an advanced Kalman filter, and normally
takes much more computing time than EKF. The evaluation result is plotted in Fig.
3.14. Distinctly, the proposed LEKF is slightly faster than Guo’s FKF.
34
3.5. SUMMARY
20
Reference
Proposed
Roll (deg)
0 Guo's FKF
UKF
20
10 0.0
Reference
Pitch (deg)
0 Proposed
Guo's FKF
10 UKF
0.0
20 Reference
Yaw (deg)
Proposed
0 Guo's FKF
UKF
20
0.0
Time(s)
Proposed
0.24 Guo's FKF
Comsumed Time( 10 3 s)
0.22
0.20
0.18
0.16
Figure 3.14: Consumed Time of the Proposed LEKF and Guo’s FKF
3.5 Summary
Attitude estimation for MARG sensors is revisited in this work. With employing the
quaternion kinematic equation as the process mode, we derive a simplified measurement
model to establish the proposed LEKF. Our analysis prove that the proposed measure-
ment model is conductive to reduce computation effort, this measurement model works
efficiently, and simplifies the involved computation, especially the computation of its
Jacobian where more than half elements are constant, and others have plenty of com-
mon factors.
Performance of the proposed LEKF are assessed using a commercial sensor for col-
lecting raw MARG sensors’ data and an optical system called Vicon to provide refer-
ence measurements. Evaluation for different application scenarios is considered, which
primarily includes human motion capture and the drone application. Results indicate
that the proposed LEKF performs very well, and is experimentally proved to have a
35
CHAPTER 3. LIGHTWEIGHT EXTENDED KALMAN FILTER FOR MARG SENSORS
ATTITUDE ESTIMATION
good anti-vibration. What’s more, the estimated roll and pitch are immune to the rel-
atively small magnetic distortion. Finally, the comparison experiment shows that the
proposed LEKF can provide good performance, as same as the basic UKF, but it con-
sumes slightly less time than Guo’s FKF.
where
∂mD 1 ∂mD 1
= mx , = my ,
∂ax 2mD ∂ay 2mD
∂mD 1 ∂mD 1
= mz , = ax ,
∂az 2mD ∂mx 2mD
∂mD 1 ∂mD 1
= ay , = az ,
∂my 2mD ∂mz 2mD
∂mN mD ∂mD ∂mN mD ∂mD
=− , =− ,
∂ax mN ∂ax ∂ay mN ∂ay
∂mN mD ∂mD ∂mN mD ∂mD
=− , =− ,
∂az mN ∂az ∂mx mN ∂mx
36
3.6. APPENDIX:DERIVATION OF JACOBIAN MATRIX
37
Chapter 4
4.1 Introduction
Low-cost MARG sensor array have been increasingly used to obtain precise attitude
information. For example, accurate knowledge of attitude is essential for flight control
in UAVs and mobile robotics navigation. Gyroscope measures the angular velocity of
a moving object. Accelerometer and magnetometer measure the earth’s gravitational
and magnetic fields respectively to provide an absolute reference of orientation. As
we known, these inexpensive sensors suffer from less accuracy and noisy due to white
Gaussian noise and environmental effects like temperature or mechanical vibration. A
lot of adaptive fusion techniques [39, 40, 42] have been studied in the past. In general
we employ the well-known EKF [43, 52, 56] as the common solution.
However, the increasing demands for accuracy and robustness make us face greater
challenges. The express companies are trying to use drones instead of people to de-
livery. More and more robots are being used for many tasks which are considered too
dangerous for people to do. The harsh environment will lead to the highly nonlinear
system. The EKF may not provide enough accuracy because of the limited first order
accuracy of the nonlinear functions. The SPKF [57–59] is potentially better solution.
The core of SPKF is the sigma-point approach, which propagates the sigma points
through the true non-linearity, without approximation, and then a weighted mean and
covariance is taken. This results in approximations that are accurate to the third order
(Taylor series expansion) for nonlinear Gaussian inputs and at least the second-order for
non-Gaussian inputs [60]. In addition, SPKF is free of the burdensome analytic deriva-
tion or Jacobians. Totally there are three kinds of SPKF, UKF [20], CDKF [21, 22]
38
4.2. SIGMA-POINT KALMAN FILTER
and CKF [23]. Generally we use square-root filters because ill-conditioned covariance
matrix may cause numerical instability. The only drawback is their higher computa-
tion cost than EKF. Typical embedded microprocessor can not afford for the real-time
implementation.
To speed up such filters, many approaches using FPGA [61–64] have been proposed
since matrix operations of these algorithms have high spatial and temporal parallelism.
These method can be roughly divided into two categories. One is to implement the
accelerator as the external co-processor. The other is to embed the accelerator in a soft-
core processor and use custom instructions for accessing. More or less, methods are
effective for acceleration compared with software implementation. However, it is easy
to become obsessed with the acceleration and forget the re-usability. This will result in
the waste of time for redesign, particularly when the design is quite complex.
Therefore, what motivates us is the re-usability. In this paper, an IP core called
matrix operation accelerator is proposed, which not only can be reused to accelerate
such matrix operation based filters, but also saves silicon. What’s more, we implement
the system on Zynq-7020 (XC7Z020-1CLG484) for experimental verification.
The organization of this chapter is as follows. First, we briefly introduce the algo-
rithm of SPKF and sigma-point approaches in section 4.2. Then Section 4.3 describes
the system architecture, including the filter design and the proposed matrix operation
accelerator. The implementation of the system and evaluation about the result are pre-
sented in Section 4.4.2. Finally the work is concluded in Section 4.5.
where xk denotes the hidden state of the system, uk is the control input and yk repre-
sents the observed measurement at time k. The state transition function F and observa-
tion function H are both nonlinear. The process noise vk and the observation noise wk
are assumed to obey white Gaussian distribution, N (0, Qk ) and N (0, Rk ) respectively.
Furthermore, except the sigma-point approach, the framework of EKF and SPKF are
39
CHAPTER 4. REAL-TIME ATTITUDE ESTIMATION OF SIGMA-POINT KALMAN FILTER VIA
MATRIX OPERATION ACCELERATOR
the exact same. Consequently we can summarize the structure of SPKF (UKF, CDKF
and CKF) as,
Algorithm 1 Square-root sigma-point Kalman filter Structure
Initialize with
x̂0 = E [x0 ] S0 = chol E (x0 − x̂0 )(x0 − x̂0 )T (4.2)
Time update
Yk|k−1 = H(χk|k−1 )
P2L ω (m) Y I
i i,k|k−1 ,
ŷk = Pi=0 (m)
−
2L ω Y II
i=1 i i,k|k−1 ,
Measurement update
q
(c) −
Sŷk = qr ωi (Y1:2L,k|k−1 − ŷk ), SR,k−1
n o
cholupdate Sŷ , Y0,k|k−1 − ŷ− , ω (c) , I
k k 0
Sŷk =
S , II
ŷk
2L
X h ih iT
(c) − −
Pxk yk = ωi χi,k|k−1 − x̂k Yi,k|k−1 − ŷk
i=0 (4.5)
K= (Pxk yk /ST
ŷk )/Sŷk
x̂k = x̂− −
k + K(yk − yk )
q n o
ξ= (c)
ωi (χ1:2L,k|k−1 − x̂− −
k ) − K(Y1:2L,k|k−1 − ŷk )
cholupdate S− , KS , −1 , I
k ŷk
Sk =
qr {ξ, S II
R,k−1 } ,
40
4.2. SIGMA-POINT KALMAN FILTER
where L is the dimension of x and (Sk )i indicates the ith column of the matrix Sk .
Then we calculate the utilized weights by
(m) λ (c) λ
ω0 = ω0 = + (1 − α2 + β)
L+λ L+λ
1 (4.7)
(m) (c)
ωi = ωi = i = 1, ..., 2L
2(L + λ)
and
(m) h2 − L (m) 1
ω0 = ωi =
h 2h (4.9)
2
(c) 1 (m) h −1
ωi = 2 ωi = i = 1, ..., 2L
4h 4h2
41
CHAPTER 4. REAL-TIME ATTITUDE ESTIMATION OF SIGMA-POINT KALMAN FILTER VIA
MATRIX OPERATION ACCELERATOR
Comparing with UKF, it’s obvious that the CDKF uses only a single parameter, which
is easy to tune from a practical perspective. Another advantage over UKF is the CDKF
is more adaptive, they have the same performance though [22] [66].
The CKF employs a third-degree spherical-radical cubature rule to compute Gaussian-
weighted integrals numerically with the best performance of them. The sigma-point
approach is described by
√
x̂ L(Sk )i , i = 1, ..., L
+
k−1
χi,k−1 = √
x̂
k−1 − L(Sk )i , i = L + 1, ..., 2L (4.10)
(m) (c) 1
ωi = ωi = , i = 1, ..., 2L
2L
Since CKF only requires 2L cubature points, CKF has better computational speed the-
oretically. It’s more convenient to be implemented without free parameters to tune.
The general framework of 9-axis AHRS is shown in Fig. 4.1. We assume that biases
of gyroscope, accelerometer and magnetometer are constant and cancelled before used.
Moreover, quaternion is chosen as the attitude representation for solving gimbal lock
and the computation simplicity. With the sensed angular rate ω = (ωx , ωy , ωz )T , we can
42
4.3. SYSTEM ARCHITECTURE OVERVIEW
define the process model using the discretized quaternion kinematic equation,
∆t
qk = I4×4 + [Ω×] qk−1 (4.11)
2
where r indicates the reference frame and Rot(qk ) is the rotation matrix converted
from qk , while Ar and Mr in [40] are given by
h iT
Ar = 0 0 1
h iT
Mr = mN 0 mD
(4.14)
mD = ax mx + ay my + az mz
q
mN = 1 − m2D
Through analyzing the structure of SPKF, apparently it’s a matrix operation based
algorithm. These matrix operations include such like matrix inversion, matrix multipli-
cation and qr decomposition and etc. Furthermore, the matrix operations are sequen-
tial, it’s not necessary to synthese the whole algorithm to digital circuit, which is a very
costly waste of silicon. As so, we design the matrix operation accelerator instead. It
not only saves silicon but also is reusable to adapt for different matrix operation based
algorithms. Fig. 4.2 shows the block of the matrix operation accelerator.
This block is able to manipulate the memory directly and works like Direct memory
access (DMA). There are several registers in control unit, which is used to configure the
matrix operation unit. Once we configure these registers by accessing the interface ctrl,
this accelerator will automatically finish the matrix operation and move the resulting
matrix to the destination memory area. Then, it will trig irq_done signal to inform
other processing unit.
43
CHAPTER 4. REAL-TIME ATTITUDE ESTIMATION OF SIGMA-POINT KALMAN FILTER VIA
MATRIX OPERATION ACCELERATOR
where tsw is the execution time of the software implementation and thw is the execution
time of the accelerated implementation.
44
4.4. IMPLEMENTATION AND EVALUATION
Table 4.2 shows the latency of the accelerator and speedup of the execution. The
speedup indicates the acceleration factor defined as the ratio of execution time of the
software implementation to the execution time with the accelerator. From the table, the
45
CHAPTER 4. REAL-TIME ATTITUDE ESTIMATION OF SIGMA-POINT KALMAN FILTER VIA
MATRIX OPERATION ACCELERATOR
matrix addition, subtraction and cholupdate is slower than the software implementation
when executing with the accelerator. The first two is because of the low computational
complexity. cholupdate is due to the sequential order of the calculations which can not
be paralleled.
4.5 Summary
In this chapter, a matrix operation accelerator is proposed to accelerate SPKF for
real-time orientation estimation. These advanced filters have higher performance in
terms of accuracy and more robust than EKF. It’s quite essential for modern applica-
tions particularly in hash environment. The accelerator is programmed in C and synthe-
sized using Xilinx’s Vivado Design Suite. We conduct the experiment on Zynq-7020
(XC7Z020-1CLG484). The experimental results show that the accelerator is efficient
of the computation and saves silicon. With this, on one hand, it not only improves
the performance but also offloads the heavy computation from the CPU. On the other
hand, it’s reusable to speedup other matrix operation based algorithms, which will save
46
4.5. SUMMARY
time for redesign. Although some of computation of SPKF is executed in software and
can not be solved as the matrix operation, the proposed scheme is still a considerable
solution to the problem of algorithm acceleration.
47
Chapter 5
5.1 Introduction
As discussed before, Motion capture (MoCap) technology has become increasingly
popular and can be found everywhere in daily life. For example, in areas such as film
and game industry, medical science and gesture recognition. In the film and game
industry, the designers generally combine MoCap with virtual reality technology to
make objects extremely vivid and lifelike [68]. Well-known film "Avatar" and game
"Pokemon Go" have acquired a good reputation. In the filed of medical science, it’s
proved that MoCap is a good way of the monitoring of patients’ condition and help
them to obtain more efficient rehabilitation therapies [69, 70]. For gesture recognition,
it’s exactly an old research topic and improves users experience of human-computer
interaction [71, 72]. Anyway, all the applications need obtain the positions, speeds,
attitudes of the object by employing a certain MoCap technology.
As so far, there are many MoCap techniques that have been developed and only
two of them become the promising frontier, namely, optical sensor based and MARG
sensors based methods. Solutions such as mechanical based [73] and magnetic based
[74–76] are being retired due to either the inconvenience for wearing or the low per-
formance in terms of accuracy, while vision based method [77] is more susceptible to
background, like illumination, occlusion and other environmental factors. Optical sen-
sor based systems like Vicon [78] succeed in doing this and could be the first successful
application of MoCap, which enable users to move freely and have an excellent perfor-
mance on accuracy. Usually the users are required to wear infrared reflective markers
and the system determines the motion of the markers from the images recorded by the
48
5.1. INTRODUCTION
surrounding cameras. On the other hand, MARG based systems [79–81] extract the
information by integrating the measurements of the gyroscope with a given initial con-
dition or deriving from the two observed vectors referring to the global frame. However,
optical based methods are only available in structured environments and quite expen-
sive, it would be preferred for film shooting and other applications that require high
accuracy. In comparison, MARG based systems are a very promising frontier because
of its low price, low power consumption and small size, what’s more, they can be used
almost anywhere. In consequence, we focus on MARG based techniques for motion
capture in this paper.
As we known, due to the bottleneck of each component of MARG, the MARG
based systems have to employ the optimal sensor fusion algorithm to extract the accu-
rate attitude information. These algorithms can generally be divided into two categories
in rough; complementary filter CF based approaches and extended Kalman filter (EKF)
based approaches respectively. Comparing with EKF based approaches, CF based ap-
proaches obtain the attitude by compensating for each other in the frequency domain.
During the recent years, several advanced CF based methods have been developed.
In [39], Madgwick proposed a computationally efficient orientation algorithm using
the gradient descent algorithm. In 2016, Wu proposed a novel fast quaternion-based
estimator to further reduce the computing complexity in [40]. Although CF has more
efficient computations, a typical drawback is that the gain is constant and always empir-
ically given for one time and the inability to adapt the weight for another quite different
scenario. In contrast, EKF is always taken as the common solution due to the guaran-
teed high performance. In 2005, Trawny proposed an IKF [42] to solve the problem of
attitude estimation. This approach performs well on robustness and still provides a ref-
erence of the idea for the modern applications. To reduce the computational complexity,
Valenti presented a linear Kalman filter using the algebraic quaternion algorithm in [44],
and Guo established a more computational measurement model in his proposed FKF re-
spectively. These work proved that EKF is adaptive and has a stable performance on
accuracy. Therefore, we employ EKF as the solution of attitude estimation as well.
Until now, many motion capture systems have already been developed [24, 79, 81,
82], especially the famous commercial motion capture system Xsens MVN [24] has
been wildly used in the practical applications. Commercial systems, although being
easy-to-use and providing an excellent performance in terms of accuracy, strictly limit
the scalability of the sensor network because the sensor network is established using
their self-defined protocol. Moreover, the time synchronization of the asynchronous
network often has been ignored. Even the company Xsens handled the problem by the
hardware solution in the next generation product [82] and achieved high accuracy of
time synchronization, the hardware method is quite expensive and exceeds the actual
need. For the prototypes developed by the research center, they normally focused on re-
49
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
ducing the limitations such as power consumption, size and weight, it is rate to consider
the scalability and time synchronization of the sensor network of the motion capture
system.
Therefore, the novel wireless time synchronized motion tracker is proposed in this
chapter. The presentation will be described in three aspects: the working principles of
the motion tracker, the design of the attitude estimation algorithm and the validation of
the motion tracker.
50
5.2. WORK PRINCIPLES
measurement from the motion sensor and estimate the attitude using our proposed EKF.
Further, the processed data is delivered to the second task, which actually is a client
program using Transmission Control Protocol/Internet Protocol (TCP/IP) and transfers
the results out. Last but not least, the third task runs a terminal program for human
computer interaction to configure the parameters of the motion tracker. These tasks
ensure that the motion sensing will be completed successfully.
On the whole, the proposed motion tracker is compact and easy in implementation.
51
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
I2C
CC3200
MPU9250
With built-in Wi-Fi Antenna
connectivity
3.3V
UART
Regulator Micro-USB
USB to UART
4.2V
5V
Battery Charger
of the motion tracker and it doesn’t take much effort to remove or add a tracker node.
However, one coin has two sides. The built sensor network is asynchronous. This is to
say, the measurements are misaligned from different trackers, and we have to figure out
a solution for the time synchronization before conducting any motion tracking activities.
Note that the gyroscope will produce the same results when placed in the same
coordinate system, this property can be utilized to figure out the problem of time syn-
chronization. We assume that all the sensors hold the same characteristics particularly
the sampling interval. In the beginning of conducting the motion capture, we attach all
the required trackers to the same rigid segment and perform some random acts for a
while. We choose one of them as the benchmark, find other trackers to the benchmark
alignment and rotate all the angular rate to the coordinate system of the benchmark.
Theoretically all the results should be the almost same. With the symbol ji q to express
the rotation from the frame of the tracker i to the frame of the benchmark tracker j,
such rotation operation can be formulated by
j
ω = ji q ⊗ i ω ⊗ ji q∗ , i 6= j (5.1)
where ⊗ denotes the quaternion product and ∗ is the conjugate of the quaternion [3],
while i ω indicates the angular rate of the tracker i. In this way, choosing any one of
them as the benchmark, we can perform a cross-correlation to figure out the time offset.
In theory, the time synchronization error is lower than one sampling interval of the
gyroscope. The higher sampling rate is conducive to improve the time synchronization
accuracy.
52
5.2. WORK PRINCIPLES
Although the method for time synchronization adds the complexity of the usage in
some way, it is acceptable and easy to operate. In particular, this approach reduces the
cost and avoids the complicated hardware design.
B ∗
G
Bq =G
Sq ⊗ Sq (5.2)
where GB q is the known orientation of each segment in T-pose or P-pose. In fact, dif-
ferent applications require different calibration methods, more detailed information is
provided in [24, 83].
+1
+1
.
. i+1 +1
i
.
x
Figure 5.3: Schematic of Segment Kinematics
The second step is to figure out the way to update the position of the joint. Fig. 5.3
shows the simplified schematic of segment kinematics in the global two-dimensional
coordinate system. Evidently, the position G pi+1 is determined by the translation of
the position G pi and the rotation G
B qi+1 . B qi and B qi+1 are the known orientations and
G G
53
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
provided by the tracker i and i + 1 respectively. With the known position G pi and the
segment length S li+1 , the position G pi+1 for the segment i + 1 can be computed by
G ∗
G
pi+1 = G pi + G S
B qi+1 ⊗ li+1 ⊗ B qi+1 (5.3)
where we assume the position p0 of the joint origin is known. And the joint angle i+1
i q
in quaternion between the segment i and i + 1 can be extracted by
G ∗
i+1
i q =G
B qi ⊗ B qi+1 (5.4)
where I4×4 is the 4 × 4 identity matrix, ∆T denotes the sampling interval of the gyro-
scope and
0 −ωx −ωy −ωz
ωx 0 ωz −ω y
[Ω×] = ω −ω
(5.6)
y z 0 ωx
ωz ωy −ωx 0
54
5.3. ATTITUDE ESTIMATION
w 2 + x2 − y 2 − z 2 2xy − 2wz 2wy + 2xz
R(q) = 2wy + 2xy w 2 − x2 + y 2 − z 2 2yz − 2wx (5.8)
2 2 2 2
2xz − 2wy 2yz + 2wx w −x −y +z
where we use qk instead of G S qk for simplicity, while wk and υk are the process noise
and observation noise and assumed to obey white Gaussian distribution. Combing with
the structure of the extended Kalman filter, the covariance Qk is computed by
2
∆T
Qk = Ξk−1 Σgyro ΞTk−1 , (5.11)
2
with the given covariance matrix Σgyro = σg2 I3×3 where σg denotes the deviation of
angular rate. The Ξk−1 is computed by
q1,k−1 q2,k−1 q3,k−1
−q0,k−1 q3,k−1 −q2,k−1
Ξk−1 =
−q
.
(5.12)
3,k−1 −q 0,k−1 q 1,k−1
In contrast, the covariance Rk for the observation noise is simply equal to the diagonal
matrix of the covariance of the accelerometer and magnetometer.
55
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
where
−q−
y,k q −
z,k −q −
w,k q −
x,k
−
H1,k = 2 q−
x,k q −
w,k q −
z,k q y,k (5.15)
− − −
qw,k −qx,k −qy,k q− z,k
where
h0,0 = q− −
w,k mN − qy,k mD h0,1 = q− −
x,k mN + qz,k mD
h0,2 = q− −
y,k mN − qw,k mD h0,3 = −q− −
z,k mN − qx,k mD
h1,0 = −q− −
z,k mN + qx,k mD h1,1 = q− −
y,k mN + qw,k mD
(5.17)
h1,2 = q− −
x,k mN + qz,k mD h1,3 = q− −
w,k mN + qy,k mD
h2,0 = q− −
y,k mN + qw,k mD h2,1 = q− −
z,k mN − qx,k mD
h2,2 = q− −
w,k mN − qy,k mD h2,3 = q− −
x,k mN + qz,k mD
In general, the maximum fusion rate of the Kalman filter is limited by the lowest
sampling rate of the utilized sensors. For example, in modern sensors, gyroscope and
accelerometer have the same high sampling rate usually, while magnetometer outputs
the measurement in relative low rate. Such limitation is a waste of the performance
of the sensor that can senses the signal in high sampling rate, which degrades over-
all performance of the application. Thus, the designed filter adopts a multi-rate filter
architecture. With this architecture, this filter allows the sensors to work at an asyn-
chronous sample rate and takes full advantage of the performance of all the sensors.
The workflow of this filter is summarized as the following:
(1) Predict the state if the gyroscope is available: q−
k = I4×4 +
∆T
2
[Ω×] qk−1 .
(2) Covariance prediction: P−
k = Fk Pk−1 Fk + Qk with Fk = I4×4 +
T ∆T
2
[Ω×] .
(3) If the accelerometer and magnetometer are both available, execute the missions
of this block and move to step (5), if only accelerometer available, move to step
(4).
56
5.3. ATTITUDE ESTIMATION
h iT
i Observations: yk = S
A S
M .
ii Kalman gain: K = P− − T
k Hk (Hk Pk Hk + Rk ) .
T −1
(4) Correct the quaternion with the readings from the accelerometer:
h iT
i Observations: yk = S A .
ii Kalman gain: K = P− − T
k H1,k (H1,k Pk H1,k + R1,k ) .
T −1
(5) Update the state and covariance for the next turn and move to step (1): qk−1 = qk ,
Pk−1 = Pk
N
X −2
1
2
σ (τ ) = (xn+2 − 2xn+1 + xn )2 (5.18)
2(N − 2)τ 2 n=1
Several types of noise can be identified by fitting the computed Allan deviation and the
cluster time τ . In this paper, only the white noises, σg for the gyroscope, σa for the
accelerometer and σm for the magnetometer, are considered, which can be recognized
by observing the value at τ = 1 in the log-log plot of Allan deviation and the cluster
time τ . The analysis results will be described in the experiment section.
57
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
In this section, several experiments are conducted and the results are discussed.
Results of Allan variance are shown in the first subsection. The second subsection
evaluates the performance of the attitude estimation of the motion tracker by comparing
with the reference measurement provided by the optical system, namely Vicon. Thirdly,
the assessment of time synchronization of the motion trackers is carried out. At last,
with the synchronized motion trackers, the built motion capture system is validated
during human walking. All the experiments are carried out with 100 Hz sampling rate,
the measurement range of ±2 g for accelerometer and ±2000 ◦ /s for gyroscope and the
low pass filter is set to 98 Hz.
To obtain the Allan variance, the tested tracker is placed on the foam board, which
plays the role of a filter to damp the vibrations from the surrounding environment.
Moreover, all the metal objects that could cause the distortion of the magnetic field are
cleared. We record the measurements over 4 hours.
Accelerometer (m/s2 )
Gyroscope (rad/s)
Magnetometer (Gauss)
10−2
σ(τ )
10−3
10−4
Fig. 5.4 shows the analysis results of the Allan variances of the three sensors. Ac-
cording to this graph, the white noise of the three sensors can be easily identified and
Table. 5.2 lists the results. The results of noise identification will be utilized to setup
the attitude estimation filter.
58
5.4. EXPERIMENTS AND RESULTS
In this section, we evaluate the performance of the attitude estimation with Vicon,
which is an optical system that consists of eight infrared cameras and is able to track
the position of optical markers continually. When attaching three non co-linear markers
to the rigid body, the orientation of which can be extracted from the three measured
positions and viewed as the reference orientation. Fig. 5.5 shows the experimental
device. We first keep the device stationary and align the two coordinate system of the
sensor and Vicon using cubature Kalman filter [23]. Further, the experimental data is
acquired from the random motion generated by moving the tacker manually. Similar
with the method to synchronize the trackers, time synchronization between the tracker
and Vicon is done by locating the maximum value of the correlation rate of the angular
rate from the two system.
Table. 5.3 shows the RMSE of three trials. Although the magnetometer is calibrated
using the ellipsoid fitting algorithm [55], the angle of yaw still behaves badly, there are
two probable factors that cause this; the first is taht the iron house, the experiment room
of Vicon, could disturb the magnetic field, and the second is that the magnetometer
could suffer from low performance. In practical, the magnetometer can be discarded by
increasing σm to infinity when it performs poorly. In contrast, angles of pitch and roll
have relative reliable performance.
59
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
Tracker2 - Tracker1
40 Tracker3 - Tracker1
Tracker4 - Tracker1
20
Time Offset (s)
−20
−40
The analysis results are shown in Fig. 5.6 and Fig. 5.7. From Fig. 5.6, we can
conclude that the offset is stable when the vector length is larger than 40000. This is to
say, we need more than 6 minutes data for time synchronization at least. Although it
adds the complexity of the implementation of devices in some way, it may be acceptable
for application without strict time limitations. Fig. 5.7 shows that the time offset is
changed with the increasing of working time, this probably because the clock precision
of sensors is different. Even so, the changing of time offset can be ignored for short
time monitoring.
60
5.4. EXPERIMENTS AND RESULTS
1
Tracker1 - Tracker4
Tracker2 - Tracker4
0
Tracker3 - Tracker4
−1
−3
−4
−5
0.0 1000.0 2000.0 3000.0 4000.0
Time (s)
Vicon
Tracker
Roll (deg)
−50
−25
50 Vicon
Tracker
Yaw (deg)
25
−25
Fig. 5.8, Fig. 5.9 and Fig. 5.10 depicts the analyzed results where the joint angle
is represented using euler angle for intuition. Evidently, there is a good consistency
between the tackers and Vicon, except the angle of yaw performed below other two.
In Fig. 5.10, as a result of our analysis, the anomaly in the beginning is caused by the
61
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
Vicon
100
Tracker
Roll (deg)
50
0
0.0 10.0 20.0 30.0 40.0
40 Vicon
Tracker
Pitch (deg)
20
−20
0.0 10.0 20.0 30.0 40.0
80
Vicon
60 Tracker
Yaw (deg)
40
20
0
0.0 10.0 20.0 30.0 40.0
Time (s)
50
Vicon
Tracker
Roll (deg)
−50
−100
0.0 10.0 20.0 30.0 40.0
−20 Vicon
Tracker
Pitch (deg)
−40
−60
Vicon
Tracker
Yaw (deg)
100
50
sudden lifting of the foot and this part is excluded when calculating RMSE. Table. 5.4
shows the calculated RMSE for two trials.
In this experiment, we investigate the feasibility of the built motion capture system
by evaluating the accuracy of estimated joint angles. Although the angle of yaw of
the trackers is without correction of the magnetometer and its inaccuracy could affect
the accuracy of the extracted joint angle, the experimental results still reflect the good
consistency between the proposed trackers and the optical system.
62
5.4. EXPERIMENTS AND RESULTS
RMSE
Trials Joint Angle Roll Pitch Yaw
Hip 7.99 2.68 9.18
0 Knee 0.72 2.80 5.63
Ankle 2.94 1.22 2.67
Hip 7.79 3.90 10.25
1 Knee 1.14 2.37 6.25
Ankle 2.52 2.21 5.09
63
CHAPTER 5. WIRELESS TIME SYNCHRONIZED MOTION TRACKERS USING KALMAN
FILTERING TO MULTI-RATE SENSOR FUSION
5.5 Summary
In this chapter, novel wireless time synchronized motion trackers are presented.
First of all, we introduced the work principles of the proposed motion tracker. This part
explained the architecture of the motion tracker, the workflow of the residing program
and the establishment of motion capture system. The tracker is compact and easy to use.
In particular, the scalability of the sensor network is not limited and a low-cost and easy-
to-operate method is proposed for time synchronization of the trackers. And, segment
kinematics are briefly introduced, which includes the step for system calibration and
the update of the position of the joint. Then, quaternion-based EKF to multi-rate sensor
fusion is designed for the attitude estimation, this filter enables the sensors working at
an asynchronous measurement rate and takes full advantage of the performance of the
sensors. Moreover, the setup of the filter is described particularly the Allan variance is
introduced and utilized in order to achieve optimum performance.
With the proposed trackers, several experiments are carried out. At first, the white
noise of the sensors are identified using Allan variance and utilized to setup the pa-
rameters of the filter. Then the accuracy of the attitude estimation is assessed with the
reference measurements provided by Vicon. Results indicate that angles of pitch and
roll provides reliable performance, while the angle of yaw suffers from the magnetic
disturbance or the low performance of the magnetometer. Further, the feasibility and
stability of time synchronization is investigated. Results shows that, it needs more 6
minutes for time synchronization and is acceptable for application without strict time
limitations, and time synchronization is stable within a short time. Finally, to verify the
feasibility of the trackers for motion capture, we validate the established motion capture
system during human walking. Although the accuracy of the joint angle suffers from
the inaccuracy of the angle of yaw, the experiment results still reflect that there is a good
consistency between the proposed trackers and the optical system.
64
Chapter 6
Conclusion
65
CHAPTER 6. CONCLUSION
66
Acknowledgment
I wish to express my sincere appreciation to my supervisor, Prof. Lei Jing, for the
patient guidance, encouragement and advice he has provided throughout my time as his
student. I have been extremely lucky to have a supervisor who cared so much about my
life and work, who responded to my questions and queries so promptly and modestly,
and who found the opportunity of the internship for me and accompanied me for almost
five years.
I also would like to thank the constructive comments and suggestions from the re-
view committee members; Prof. Xiang Li, Prof. Kazuyoshi Mori and Prof. Keitaro
Naruse. Their professional opinions have significantly improved my dissertation. As
well, I sincerely thanks their time and attention on my research topic. Through the
defending of the dissertation, I learned a lot.
The assistance from laboratory secretary, Mrs. Hoshi; Dr. Huakun Huang, Mr.
Chenghong Lu and all other members of our laboratory is truly appreciated. Mrs. Hoshi
often helped me borrow the experiment room and cared my daily life in the Lab. Dr.
Huang always shared experience and considerations on research with me. And Mr. Lu
usually assisted me to complete the experiments. Without their support, this research
could not have reached its goal.
Finally, I wish to acknowledge the support and great love of my family, my girl-
friend, Huicong Yu; my father, Xinzhong Dai; and my grandfather, Jiayun Dai. They
kept me going on and this work would not have been possible without their input.
Sincerely thanks you all. Best wishes to you!
67
References
[1] I. Board, “Ieee standard specification format guide and test procedure for single-
axis interferometric fiber optic gyros,” IEEE Std, pp. 952–1997, 1998.
[2] Y.-B. Jia, “Quaternions and rotations,” Com S, vol. 477, no. 577, p. 15, 2008.
[3] B. Kenwright, “A beginners guide to dual-quaternions: what they are, how they
work, and how to use them for 3d character hierarchies,” 2012.
[5] S. W. Shepperd, “Quaternion from rotation matrix,” Journal of Guidance and Con-
trol, vol. 1, no. 3, pp. 223–224, 1978.
[7] Z.-Q. Zhang, “Two-step calibration methods for miniature inertial and magnetic
sensor units,” IEEE Transactions on Industrial Electronics, vol. 62, no. 6, pp.
3714–3723, 2014.
[8] G. Wahba, “A least squares estimate of satellite attitude,” SIAM review, vol. 7,
no. 3, pp. 409–409, 1965.
[9] J. R. Wertz, Spacecraft attitude determination and control. Springer Science &
Business Media, 2012, vol. 73.
68
REFERENCES
[12] M. D. Shuster and S. D. Oh, “Three-axis attitude determination from vector ob-
servations,” Journal of guidance and Control, vol. 4, no. 1, pp. 70–77, 1981.
[13] D. Mortari, “Esoq: A closed-form solution to the wahba problem,” Journal of the
Astronautical Sciences, vol. 45, no. 2, pp. 195–204, 1997.
[14] ——, “Second estimator of the optimal quaternion,” Journal of Guidance, Con-
trol, and Dynamics, vol. 23, no. 5, pp. 885–888, 2000.
[15] F. L. Markley and D. Mortari, “Quaternion attitude estimation using vector ob-
servations.” Journal of the Astronautical Sciences, vol. 48, no. 2, pp. 359–380,
2000.
[16] J. Wu, Z. Zhou, B. Gao, R. Li, Y. Cheng, and H. Fourati, “Fast linear quaternion
attitude estimator using vector observations,” IEEE Transactions on Automation
Science and Engineering, vol. 15, no. 1, pp. 307–319, 2017.
[19] S. Madgwick, “An efficient orientation filter for inertial and inertial/magnetic sen-
sor arrays,” Report x-io and University of Bristol (UK), vol. 25, pp. 113–118,
2010.
[22] K. Ito, “Gaussian filter for nonlinear filtering problems,” in Proceedings of the
39th IEEE Conference on Decision and Control (Cat. No. 00CH37187), vol. 2.
IEEE, 2000, pp. 1218–1223.
[24] D. Roetenberg, H. Luinge, and P. Slycke, “Xsens mvn: Full 6dof human motion
tracking using miniature inertial sensors,” Xsens Motion Technologies BV, Tech.
Rep, vol. 1, 2009.
[25] R. E. Kalman, “A new approach to linear filtering and prediction problems,” 1960.
69
REFERENCES
[26] G. Welch, G. Bishop et al., “An introduction to the kalman filter,” 1995.
[27] G. Bishop, G. Welch et al., “An introduction to the kalman filter,” Proc of SIG-
GRAPH, Course, vol. 8, no. 27599-23175, p. 41, 2001.
[29] M. I. Ribeiro, “Kalman and extended kalman filters: Concept, derivation and prop-
erties,” Institute for Systems and Robotics, vol. 43, 2004.
[31] A. Hussen and I. Jleta, “Low cost inertial sensors modeling using allan variance,”
International Journal of Computer, Electrical, Automation, Control and Informa-
tion Engineering, vol. 9, no. 5, pp. 1237–1242, 2015.
[32] M. Matejček and M. Šostronek, “Computation and evaluation allan variance re-
sults,” in 2016 New Trends in Signal Processing (NTSP). IEEE, 2016, pp. 1–9.
[33] R. J. Vaccaro and A. S. Zaki, “Statistical modeling of rate gyros,” IEEE Transac-
tions on Instrumentation and Measurement, vol. 61, no. 3, pp. 673–684, 2011.
[34] B. IEEE, “Ieee standard specification format guide and test procedure for single-
axis interferometric fiber optic gyros,” 1998.
[37] G. Bellusci, F. Dijkstra, and P. Slycke, “Xsens mtw: Miniature wireless inertial
motion tracker for highly accurate 3d kinematic applications,” Xsens Technologies,
2013.
[38] X. Meng, Z.-Q. Zhang, J.-K. Wu, W.-C. Wong, and H. Yu, “Self-contained pedes-
trian tracking during normal walking using an inertial/magnetic sensor module,”
IEEE Transactions on Biomedical Engineering, vol. 61, no. 3, pp. 892–899, 2013.
70
REFERENCES
[40] J. Wu, Z. Zhou, J. Chen, H. Fourati, and R. Li, “Fast complementary filter for
attitude estimation using low-cost marg sensors,” IEEE Sensors Journal, vol. 16,
no. 18, pp. 6997–7007, 2016.
[41] J. Wu, Z. Zhou, H. Fourati, R. Li, and M. Liu, “Generalized linear quaternion com-
plementary filter for attitude estimation from multisensor observations: An opti-
mization approach,” IEEE Transactions on Automation Science and Engineering,
2019.
[42] N. Trawny and S. I. Roumeliotis, “Indirect kalman filter for 3d attitude estima-
tion,” University of Minnesota, Dept. of Comp. Sci. & Eng., Tech. Rep, vol. 2, p.
2005, 2005.
[44] R. G. Valenti, I. Dryanovski, and J. Xiao, “A linear kalman filter for marg orienta-
tion estimation using the algebraic quaternion algorithm,” IEEE Transactions on
Instrumentation and Measurement, vol. 65, no. 2, pp. 467–481, 2015.
[48] H. D. Black, “A passive system for determining the attitude of a satellite,” AIAA
journal, vol. 2, no. 7, pp. 1350–1351, 1964.
[49] ——, “Early development of transit, the navy navigation satellite system,” Journal
of Guidance, Control, and Dynamics, vol. 13, no. 4, pp. 577–585, 1990.
[50] W.-Y. Loh and Y.-S. Shih, “Split selection methods for classification trees,” Sta-
tistica sinica, pp. 815–840, 1997.
71
REFERENCES
[52] S. Guo, J. Wu, Z. Wang, and J. Qian, “Novel marg-sensor orientation estimation
algorithm using fast kalman filter,” Journal of Sensors, vol. 2017, 2017.
[54] Z. Yang, S. Yan, and B. Li, “Hybrid calibration method for three-axis gradiome-
ter,” IEEE Magnetics Letters, vol. 8, pp. 1–5, 2017.
[55] J. Fang, H. Sun, J. Cao, X. Zhang, and Y. Tao, “A novel calibration method of
magnetic compass based on ellipsoid fitting,” IEEE Transactions on Instrumenta-
tion and Measurement, vol. 60, no. 6, pp. 2053–2061, 2011.
[56] R. G. Valenti, I. Dryanovski, and J. Xiao, “A linear kalman filter for marg orienta-
tion estimation using the algebraic quaternion algorithm,” IEEE Transactions on
Instrumentation and Measurement, vol. 65, no. 2, pp. 467–481, 2016.
[57] J.-m. Duan, D. Liu, H.-x. Yu, and H. Shi, “An improved fastslam algorithm for
autonomous vehicle based on the strong tracking square root central difference
kalman filter,” in 2015 IEEE 18th International Conference on Intelligent Trans-
portation Systems. IEEE, 2015, pp. 693–698.
[58] D. Liu, J. Duan, and H. Shi, “A strong tracking square root central difference
fastslam for unmanned intelligent vehicle with adaptive partial systematic resam-
pling,” IEEE Transactions on Intelligent Transportation Systems, vol. 17, no. 11,
pp. 3110–3120, 2016.
[60] S. J. Julier and J. K. Uhlmann, “New extension of the kalman filter to nonlinear
systems,” in Signal processing, sensor fusion, and target recognition VI, vol. 3068.
International Society for Optics and Photonics, 1997, pp. 182–194.
72
REFERENCES
[62] D. T. Tertei, J. Piat, and M. Devy, “Fpga design and implementation of a matrix
multiplier based accelerator for 3d ekf slam,” in 2014 International Conference on
ReConFigurable Computing and FPGAs (ReConFig14). IEEE, 2014, pp. 1–6.
[63] J. Soh and X. Wu, “An fpga-based unscented kalman filter for system-on-chip ap-
plications,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 64,
no. 4, pp. 447–451, 2017.
[65] E. A. Wan and R. Van Der Merwe, “The unscented kalman filter,” Kalman filtering
and neural networks, pp. 221–280, 2001.
[66] R. Van Der Merwe et al., “Sigma-point kalman filters for probabilistic inference
in dynamic state-space models,” Ph.D. dissertation, OGI School of Science &
Engineering at OHSU, 2004.
[68] C. Bregler, “Motion capture technology for entertainment [in the spotlight],” IEEE
Signal Processing Magazine, vol. 24, no. 6, pp. 160–158, 2007.
[71] L. Jing, Y. Zhou, Z. Cheng, and T. Huang, “Magic ring: A finger-worn device for
multiple appliances control using static finger gestures,” Sensors, vol. 12, no. 5,
pp. 5775–5790, 2012.
[72] Y.-L. Hsu, C.-L. Chu, Y.-J. Tsai, and J.-S. Wang, “An inertial pen with dynamic
time warping recognizer for handwriting and gesture recognition,” IEEE Sensors
Journal, vol. 15, no. 1, pp. 154–163, 2014.
73
REFERENCES
[79] B. Fang, F. Sun, H. Liu, and D. Guo, “Development of a wearable device for
motion capturing based on magnetic and inertial measurement units,” Scientific
Programming, vol. 2017, 2017.
[81] P.-z. Chen, J. Li, M. Luo, and N.-h. Zhu, “Real-time human motion capture driven
by a wireless sensor network,” International Journal of Computer Games Tech-
nology, vol. 2015, p. 4, 2015.
74
REFERENCES
75