Professional Documents
Culture Documents
I. I NTRODUCTION
The device includes an accelerometer, a gyroscope, a magnetometer and an altimeter that communicates with the MCU
via I2C bus. A RF Bluetooth module interfaces the board with
external devices as personal computer, smartphone and tablet.
SD card memory allows data storing. The block diagram
of the system is shown in Fig. 1 and the main features of
each component of the device are described in the following
subsubsections.
1) MCU Module: ATmega328 (ATMEL, USA) is a lowpower single chip 8-bit microcontroller belongs to the
megaAVR series. This module combines 32-kb ISP flash
memory with read-while-write capabilities, 1-kb EEPROM, 2kb SRAM, 23 general purpose I/O lines, 32 general purpose
working registers, internal and external interrupts, serial programmable USART, byte-oriented a 2-wire serial interface, a
SPI serial port, 6-channel 10-bit A/D converter, programmable
watchdog timer with internal oscillator, and five software
selectable power saving modes. The device operates in the
range 1.8-5.5 V.
2) Accelerometer and Gyroscope: MPU-6050 (InvenSense
Inc., USA) combines a MEMS 3-axis gyroscope and a MEMS
3-axis accelerometer on the same silicon die together. The
gyroscope is a tri-axis angular rate sensor with a sensitivity
up to 131 LSBs/dps and a full-scale ranges of 250, 500,
1000, and 2000dps. The accelerometer is a tri-axis sensor
with a programmable full scale range of 2g, 4g, 8g and
16g. MPU-6050 communicates with MCU via I2C bus.
3) Magnetometer: HMC5883L (Honeywell, USA) is a 3axis magnetoresistive sensor designed for low-field magnetic
sensing. It has an embedded 12-bit ADC achieving 4 mG
field resolution in 8 G fields. The module measures both
the direction and the magnitude of Earths magnetic field.
HMC5883L communicates with MCU via I2C bus.
4) Altimeter Sensor: MS5611-01BA (MEAS, Switzerland)
is a new generation of high resolution MEMS altimeter sensors
with SPI and I2C bus interface. It provides a precise digital
24 bit pressure and temperature values and different operation
modes that allow the user to optimize the conversion speed
and the current consumption.
5) Wireless Module: HC-05 module (Honeywell, USA) is
an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup. It is
a small low-power transceiver ideal for embedded applications.
6) Storage Module: MicroSD card is used to provide
the device with mass-storage capability. Communication with
microSD card is achieved over SPI interface.
The data from sensors are sampled at 50 Hz. A calibration
procedure of the device was performed offline to compensate
systematic errors in the AHRS.
B. Altimeter to Calculate Altitude
The altimeter sensor allows to calculate altutitude Hbaro ,
from temperature and pressure measurements [8]:
(T + 273.15)
(1 (P/P0 )(0.19) )
(1)
0.0065
where Hbaro is measured in meters, T is the temperature
measured in C, P is the pressure measured in Pa and P0
is the pressure at sea level. P0 is approximately 101.325
kPa in normal conditions, but varies according to the time.
The altitude measure is affected by high frequency noise that
causes a measurement error. For this reason, the raw values of
altitude calculated by the altimeter are unusable in all systems
that require great accuracy. In order to reduce the error about
Hbaro =
The vertical displacement signal is obtained by a double integration of the dynamic acceleration component perpendicular
to the terrestrial surface. This acceleration must be referred
to the terrestrial reference system, called earth f rame, in
which the Z-axis is the vertical component of the Earths
surface while X-axis and Y-axis are the parallel components.
Therefore, to estimate vertical displacement we use the Z
component of the vector of acceleration referred to earth
f rame Eaz . A 3-axis accelerometer measures the acceleration
in three dimensions in space expressed in the coordinate system aligned with the sensor board and called sensor f rame.
It is necessary to obtain the acceleration components in the
earth f rame from the acceleration components measured in
the sensor f rame. This is possible rotating the acceleration
components Sa to the earth f rame by means of the rotation
matrix ESR [9]. In general, the rotation matrix of a rigid body
may be represented by Yaw, Pitch and Roll angles. Yaw is
a rotation around the Z-axis of the earth f rame, Pitch is a
rotation around the Y-axis of the earth f rame and Roll is a
rotation around the X-axis of the earth f rame. The sensor
fusion algorithm was implemented to compute the rotation
matrix to obtain an absolute measurement of orientation.
The AHRS filtering procedure combines information acquired
from a 3-axis accelerometer, a 3-axis gyroscope and a 3-axis
magnetometer in order to obtain an unique estimate of a rigid
body orientation.
Madgwick et al. [9] proposed an efficient algorithm applicable to AHRS which employs a three-dimension representation of orientation referring to earth f rame. In this algorithm
the rotation matrix ESR is described directly from quaternion
E
data
q [9]. Madgwicks algorithm uses a quaternion
S
representation to prevent problems such as gimbal lock that
may occur when using Euler angles. A quaternion q, is a
four-element vector constituted of one real part, q0 , and three
complex parts, q1 q2 and q3 . The representation of the Euler
angles starting from the components of a quaternion q can be
expressed by the following equations:
Y aw = atan2(2(q2 q3
P itch =
arctan( p
Roll = atan2(2(q1 q2
q0 q1 ), 2qo2
2(q1 q3
1
1 + 2q32 )
q0 q2 )
(q2 q3
q0 q3 ), 2qo2
q0 q2 ) 2
1 + 2q12 )
(2)
(3)
(4)
S
q
E est,n
San
S
q
E est,n
E
q
S est,n
San
E
q
S est,n
(5)
(7)
as + b
(9)
s2 + as + b
The altitude estimated output by complementary filter is:
1
b
H(s)
= 2 G1 (s)Edz (s) + G2 (s)Hbaro (s) =
s
1
= 2 G1 (s)(ha (s) + n1 (s)) + G2 (s)(hb (s) + n2 (s)) =
s
= G1 (s)(ha (s) + n1 (s)) + G2 (s)(hb (s) + n2 (s)) =
G2 =
s2
as + b
n1 (s) + 2
n2 (s)
(10)
s2 + as + b
s + as + b
where a and b are the natural frequency and damping ratio,
respectively. The proposed complementary filter is shown in
b is obtained as follows:
Fig. 4 where the altitude estimated H
b = {(Hbaro H)k
b 1 + 1 [(Hbaro H)k
b 2 + ha + n1 ]} 1 (11)
H
s
s
b
Since Hbaro = hb + n2 and solving for H(s):
= h(s) +
b
b
b + H k1 + H k2 = hb k1 + n2 k1 + hb k2 + n2 k2 + ha + n1
H
2
2
2
s
s
s
s
s
s
s2 s2
Fig. 4. Diagram of the complementary filter used for the altitude estimation.
therefore:
s2
k1 s + k2
n1 (s) + 2
n2 (s)
+ k1 s + k2
s + k1 s + k2
(12)
that is equal to (10). The dinamic acceleration component
perpendicular to the terrestrial surface is doubly integrated
to produce a vertical displacement estimate. The altitude
b is differenced with the altitude measurement
estimated H
Hbaro , to produce an error signal which is fed back to produce
corrections in the estimates.
b
H(s)
= h(s) +
s2
Fig. 6. (a) Comparison of altitude estimation using raw altitude (grey line)
and complementary filter (black line) data in an experimental trial. (b) Zoom
of altitude estimation showing in greater detail the difference between the two
measures.
TABLE I
C OMPARISON OF THE ALTITUDE STANDARD DEVIATION AVERAGE VALUES
BETWEEN ALTIMETER RAW SIGNAL AND FILTERED SIGNAL , CALCULATED
OVER 75 TRIALS
Floor
1
2
3
2
1
STD [m]
using Altimeter
using Filter
0.138
0.043
0.123
0.039
0.125
0.049
0.122
0.029
0.127
0.049
TABLE II
C OMPARISON OF THE STANDARD DEVIATION AVERAGE VALUES BETWEEN
OUR DEVICE AND Y.K. K IM S PROPOSED DEVICE .
Floor
1
2
3
2
1
STD [m]
Our device
Kims device
0.043
0.120
0.039
0.130
0.049
0.140
0.029
0.100
0.049
0.150
R EFERENCES
[1] K. Sagawa, T. Ishihara, A. Ina, and H. Inooka, Classification of
human moving patterns using air pressure and acceleration, in Industrial
Electronics Society, 1998. IECON98. Proceedings of the 24th Annual
Conference of the IEEE, vol. 2. IEEE, 1998, pp. 12141219.
[2] H. Sternberg, M. Fessele, and C. Honniger, Indoor navigation without
infrastructure-based local positioning system, in Proceedings of the 6th
International Symposium on Mobile Mapping Technology MMT, vol. 9,
2009.
[3] F. Bianchi, S. J. Redmond, M. R. Narayanan, S. Cerutti, and N. H.
Lovell, Barometric pressure and triaxial accelerometry-based falls
event detection, Neural Systems and Rehabilitation Engineering, IEEE
Transactions on, vol. 18, no. 6, pp. 619627, 2010.
[4] A. Pande, Y. Zeng, A. K. Das, P. Mohapatra, S. Miyamoto, E. Seto,
E. K. Henricson, and J. J. Han, Energy expenditure estimation with
smartphone body sensors, in Proceedings of the 8th International Conference on Body Area Networks. ICST (Institute for Computer Sciences,
Social-Informatics and Telecommunications Engineering), 2013, pp. 8
14.
[5] A. M. Sabatini and V. Genovese, A stochastic approach to noise
modeling for barometric altimeters, Sensors, vol. 13, no. 11, pp. 15 692
15 707, 2013.
[6] Y.-K. Kim, S.-H. Choi, H.-W. Kim, and J.-M. Lee, Performance
improvement and height estimation of pedestrian dead-reckoning system
using a low cost mems sensor, in Control, Automation and Systems
(ICCAS), 2012 12th International Conference on. IEEE, 2012, pp.
16551660.
[7] M. Tanigawa, H. Luinge, L. Schipper, and P. Slycke, Drift-free dynamic
height sensor using mems imu aided by mems pressure sensor, in
Positioning, Navigation and Communication, 2008. WPNC 2008. 5th
Workshop on. IEEE, 2008, pp. 191196.
[8] J. Parviainen, J. Kantola, and J. Collin, Differential barometry in
personal navigation, in Position, Location and Navigation Symposium,
2008 IEEE/ION. IEEE, 2008, pp. 148152.
[9] S. O. Madgwick, A. J. Harrison, and R. Vaidyanathan, Estimation
of imu and marg orientation using a gradient descent algorithm, in
Rehabilitation Robotics (ICORR), 2011 IEEE International Conference
on. IEEE, 2011, pp. 17.
[10] W. T. Higgins, A comparison of complementary and kalman filtering,
IEEE Transactions on Aerospace and Electronic Systems, vol. 11, no. 3,
pp. 321325, 1975.
[11] R. Mahony, T. Hamel, and J.-M. Pflimlin, Nonlinear complementary
filters on the special orthogonal group, Automatic Control, IEEE
Transactions on, vol. 53, no. 5, pp. 12031218, 2008.