- Research
- Open Access

# Pedestrian dead reckoning for MARG navigation using a smartphone

- Zengshan Tian
^{1}, - Yuan Zhang
^{1}Email author, - Mu Zhou
^{1}and - Yu Liu
^{2}

**2014**:65

https://doi.org/10.1186/1687-6180-2014-65

© Tian et al.; licensee Springer. 2014

**Received:**7 January 2014**Accepted:**23 April 2014**Published:**10 May 2014

## Abstract

The demand for navigating pedestrian by using a hand-held mobile device increased remarkably over the past few years, especially in GPS-denied scenario. We propose a new pedestrian dead reckoning (PDR)-based navigation algorithm by using magnetic, angular rate, and gravity (MARG) sensors which are equipped in existing commercial smartphone. Our proposed navigation algorithm consists of step detection, stride length estimation, and heading estimation. To eliminate the gauge step errors of the random bouncing motions, we designed a reliable algorithm for step detection. We developed a BP neural network-based stride length estimation algorithm to apply to different users. In response to the challenge of magnetic disturbance, a quaternion-based extended Kalman filter (EKF) is introduced to determine the user's heading direction for each step. The performance of our proposed pedestrian navigation algorithm is verified by using a smartphone in providing accurate, reliable, and continuous location tracking services.

## Keywords

- Pedestrian navigation
- Localization
- Dead reckoning
- MARG sensors
- Smartphone

## 1 Introduction

A large number of navigation systems, such as GPS, can only be applied to the outdoor and open sky scenarios since the microwaves are easily blocked by the buildings and ground. To solve this problem, the multi-MEMS inertial sensor-based navigation systems are more favored in recent 5 years [1, 2]. Inertial sensors are independent of the external information, involve no radiation energy to the environment, and require no external reference frame. On this basis, it can be recognized as an autonomous navigation system providing location, heading, and attitude angle [3, 4]. The navigation information obtained from the inertial system is featured with continuity, high data-updating rate, good short-term accuracy, and stability. The magnetic, angular rate, and gravity (MARG) sensors involved in MEMS technology have been widely used in smartphones for pedestrian inertial navigation and are expected to become one of the key components of a variety of localization and tracking systems [5, 6].

As far as we know, the pedestrian inertial navigation systems are normally based on pedestrian dead reckoning (PDR) algorithm which is independent of the integration of acceleration values. Based on the physiological characteristics of pedestrian movement, we can use the cyclical characteristics and statistics of acceleration waveform and features which are associated with the walking speed to estimate the stride length. Moreover, the heading is obtained from the integration of gyroscope or from the combination of magnetometer and accelerometer. Due to the randomness of pedestrian hand-held way, the attitude angle of a smartphone cannot be constant. Hence, the accuracy of heading can be guaranteed only after the real-time attitude angle has been calculated. Therefore, the way to obtain an accurate attitude angle solution in different environmental conditions without the external absolute reference signals forms one of the significant challenges to be concerned [7, 8].

There are two categories of algorithms for attitude angle updating by using the angular rate of gyroscope: the Euler angle algorithm and the quaternion algorithm. The Euler angle algorithm relies on the Euler angle differential equations to calculate the yaw, pitch, and roll angles. Since the pitch angle in Euler angles can result to degenerations, the yaw and roll angles cannot be determined uniquely when the pitch angle is close to 90°. The quaternion algorithm avoids the singularity problem involved in Euler angles by solving four linear differential equations. On this basis, the quaternion algorithm is featured with simple computation cost and is easy to be operated for a wide application. In quaternion algorithm, since the gyroscope is suffered by the accumulated measurement errors, it is not effective to measure the angles over a long period of time. To obtain a stable and reliable attitude angle, the gyroscope should be integrated with accelerometer and magnetometer. To this end, the complementary filter, Kalman filter, and gradient descent algorithm are widely used to conduct data fusion. The work in [9] proposed the quaternion-based gradient descent algorithm to merge the measured absolute angle and angular velocity and then obtain three degrees of freedom (DOF) for attitude measurement. The algorithm in [9] is simple and is easy to be implemented, but the related accuracy performance is not good. The quaternion-based extended Kalman filter (EKF) algorithm in [10] is recognized to be more accurate, but more system state vectors and higher computation cost are required, which is not appropriate for the real-time processing on a smartphone platform. There is significant accuracy deterioration by using the aforementioned conventional algorithms when a large linear acceleration occurs or the magnetometer is seriously interfered by the surrounding noise, such as the blocking by iron products. To solve this problem, this paper shows a new pedestrian dead reckoning-based MARG navigation algorithm, which is highly accurate and is easy to be implemented on smartphones.

This paper is organized as follows. Section 2 gives the system framework. Section 3 presents the algorithms for step detection and stride length estimation. The heading estimation algorithm is discussed in Section 4. Section 5 shows some testing results and the related discussion. Finally, we conclude this paper in Section 6.

## 2 System framework

*θ*

_{ i }and

*d*

_{ i }(

*i*= 1,..,

*k*) stand for the heading angle and the stride length of step

*i*. Hence, the user's position coordinates can be calculated by (1) as soon as the parameters

*d*

_{ i }and

*θ*

_{ i }are estimated.

## 3 Step detection and stride length estimation

*a*

_{ x },

*a*

_{ y }, and

*a*

_{ z }are the output data of triaxial accelerometer in the

*X*,

*Y*, and

*Z*directions respectively. Then, we can obtain a single peak curve of accelerometer modulus by using a digital low-pass filter, detect the peak point accurately, and consequently calculate the step number. Some small jitters could be produced during walking when the pedestrian is holding the phone. On this basis, the peaks appear in the output waveform of accelerometer modulus values, as shown in Figure 3. We set a threshold to eliminate the gauge errors of steps which resulted from the shaking of smartphone, such that

*T*stands for the time interval between every two adjacent peaks, g is the local acceleration of gravity. T

_{Th}and A

_{Th}stand for the time threshold and the peak threshold, respectively.

*A*

_{max}and

*A*

_{min}stand for the maximum and minimum of modulus values of accelerometer which are obtained from the step detection.

*C*is the proportionality coefficient. Since the step lengths are determined by height, attitude, and frequency, the value of

*C*which is significantly influenced by the pedestrian height and stride frequency cannot be constant. Considering the nonlinear relations of the proportion coefficient

*C*, pedestrian height, and stride length, we use a back propagation (BP) neural network to obtain this nonlinear mapping for the sake of predicting the value

*C*accurately and real timely. The structure of our addressed BP neural network is shown in Figure 4.

## 4 Heading estimation

### 4.1 Gyroscope attitude estimation

*x*,

*y*, and

*z*in the coordinates of smartphone are measured by a three-axis gyroscope. The attitude of the smartphone is obtained from the integration of the quaternion-based rigid body kinematic equations. The quaternion-based rigid body kinematic equations are

*Q*=

*q*

_{0}+

*q*

_{1}

*i*+

*q*

_{2}

*j*+

*q*

_{3}

*k*,

*q*

_{ i }(

*i*= 0, 1, 2, and 3) is a real number.

*t*

_{0}is the initial time of the user's movement.

*Q*

_{0}is the initial quaternion.

*W*= 0 +

*w*

_{1}

*i*+

*w*

_{2}

*j*+

*w*

_{3}

*k*is the quaternion of the attitude angular velocity in the coordinates of smartphone. ⊗ denotes the multiplication of quaternion. We can represent (5) in matrix form as

*ω*

_{ i }(

*i*= 1, 2, and 3) is the angular velocity. We assume that the angular velocity is a constant value in the same sampling interval. By calculating the differential equations in (6), the formula of quaternion discrete time can be obtained by

*q*

_{ i }(

*i*= 0,…, 3) can be used to update the attitude rotation matrix. Finally, we calculate the roll, pitch, and yaw as

### 4.2 Extended Kalman filter design

*w*

_{ k }is the vector of processing noise. The measurement model is constructed by stacking the normalized accelerometer and the magnetometer measurement vectors as

**g**is the vector of normalized gravity.

**h**is the vector of normalized magnetic field intensity. The vectors of measurement noise in accelerometer and magnetometer are notated as

^{ a }

*v*

_{k + 1}and

^{ m }

*v*

_{k + 1}which can be recognized as the uncorrelated zero-mean white noise processes with the corresponding covariance matrix

*R*.

*H*as

where ||a_{
k
}|| and ||m_{
k
}|| are the modulus values of accelerometer and magnetometer. *k*_{i 1} and *k*_{i 2} are the weighting factors. var(*i*_{k − N/2}: *i*_{k + N/2}) (*i* = *a*, *m*) is the variance of modulus values in the sliding window with the size of *N*. When the smartphone has a large linear acceleration or is suffered by the external magnetic interference, both modulus value and variance of accelerometer and magnetometer are increased. In this case, to reduce the influence of the linear acceleration and the external magnetic interference, we distribute large values to the observation variance, ${\mathit{\sigma}}_{\mathit{a}}^{2}$ and ${\mathit{\sigma}}_{\mathit{m}}^{2}$, to guarantee that the filtering process is determined by the output of gyroscope.

### 4. 3 Heading correction

During the walking, the smartphone is suffered by not only the upward and forward movement, but also the swings. From the curve of heading angles obtained by EKF, we can find that the smartphone swings severely. To reduce the impact of swing on heading estimation, we use the second-order Butterworth digital low-pass filter to conduct heading correction.

## 5 Testing results

### 5.1 Step detection and stride length estimation

**Results of stride length estimation**

Height (cm) | Reference SL in average (m) | Estimated SL in average (m) | Standard deviation (m) |
---|---|---|---|

158 | 0.6402 | 0.6407 | 0.0237 |

165 | 0.6688 | 0.6635 | 0.0475 |

170 | 0.6818 | 0.6859 | 0.0354 |

175 | 0.6908 | 0.6936 | 0.0186 |

178 | 0.7609 | 0.7584 | 0.0332 |

### 5.2 Heading estimation

### 5.3 Trace tracking

**Tracking results**

Testing no. | Reference distance (m) | Trajectory distance (m) | Tracking error (m) |
---|---|---|---|

1 | 400 | 401.4250 | 3.8258 |

2 | 400 | 405.8776 | 3.7322 |

3 | 400 | 392.5757 | 7.1245 |

4 | 400 | 407.7600 | 4.5983 |

5 | 400 | 391.9255 | 7.1424 |

6 | 400 | 396.3920 | 3.3802 |

7 | 400 | 410.6800 | 6.6355 |

8 | 400 | 409.0023 | 7.9658 |

9 | 400 | 403.9670 | 6.3162 |

10 | 400 | 405.4671 | 5.6600 |

## 6 Conclusions

This paper presents a new pedestrian navigation algorithm based on the MARG sensors equipped in Huawei smartphone. The testing results on the smartphone platform show that the accurate, reliable, and continuous localization and tracking can be provided. Our proposed algorithm can be applicable to many other types of smartphones and also provide an important guidance to the design of the integrated Wi-Fi and MEMS navigation systems [18–20]. Furthermore, the optimization of heading estimation algorithm forms another interesting work in future.

## Declarations

### Acknowledgements

This work was supported in part by the Program for Changjiang Scholars and Innovative Research Team in University (IRT1299), National Natural Science Foundation of China (61301126), Special Fund of Chongqing Key Laboratory (CSTC), Fundamental and Frontier Research Project of Chongqing (cstc2013jcyjA40032, cstc2013jcyjA40034, cstc2013jcyjA40041), Scientific and Technological Research Program of Chongqing Municipal Education Commission (KJ130528), Startup Foundation for Doctors of CQUPT (A2012-33), Science Foundation for Young Scientists of CQUPT (A2012-77), Natural Science Foundation Project of CQ CSTC(CSTC2012jjB40009), and the Key Laboratory of Optoelectronic Devices and Systems of Ministry of Education and Guangdong Province.

## Authors’ Affiliations

## References

- Soehren W, Hawkinson W: A prototype personal navigation system.
*IEEE Aerospace and Electronic Systems Magazine*2008, 6(23):10-18.View ArticleGoogle Scholar - Evennou F, Marx F: Advanced integration of WiFi and inertial navigation systems for indoor mobile positioning.
*EURASIP J Adv Sign Process*2006, 2006: 164-164.Google Scholar - Nilsson JO, Zachariah D, Skog I, Händel P: Cooperative localization by dual foot-mounted inertial sensors and inter-agent ranging.
*arXiv preprint arXiv*2013, 1304: 3663.Google Scholar - Li F, Zhao C, Ding G, Gong J, Liu C, Zhao F: A reliable and accurate indoor localization method using phone inertial sensors. In
*Proceedings of the 2012 ACM Conference on Ubiquitous Computing*. New York: ACM; 2012:421-430.View ArticleGoogle Scholar - Ali A, Siddharth S, Syed Z, El-Sheimy N: An improved personal dead-reckoning algorithm for dynamically changing smartphone user modes. In
*Proceedings of the 25th International Technical Meeting of the Satellite Division of the Institute of Navigation (ION GNSS 2012)*. Nashville: ; 2432-2439. 17–21 September 2012Google Scholar - Beauregard S, Haas H: Pedestrian dead reckoning: a basis for personal positioning. In
*Proceedings of the 3rd Workshop on Positioning, Navigation and Communication (WPNC’06)*. Hannover: ; 27-35. 16 March 2006Google Scholar - Wan EA, Van Der Merwe R: The unscented Kalman filter for nonlinear estimation. In
*Adaptive Systems for Signal Processing, Communications, and Control Symposium 2000*. Lake Louise, Alta: AS-SPCC; 153-158. 1–4 October 2000Google Scholar - Munguia R, Grau A: An attitude and heading reference system (AHRS) based in a dual filter. In 2011 IEEE 16th Conference on Emerging Technologies & Factory Automation (ETFA). Toulouse: ; 1-8. 5–9 September 2011Google Scholar
- Madgwick SOH, Harrison AJL, Vaidyanathan R: Estimation of IMU and MARG orientation using a gradient descent algorithm. In 2011 IEEE International Conference on Rehabilitation Robotics (ICORR). Zurich; 1-7. 29 June to 1 July 2011Google Scholar
- Sabatini AM: Quaternion-based extended Kalman filter for determining orientation by inertial and magnetic sensing.
*IEEE Trans Biomed Eng*2006, 53(7):1346-1356. 10.1109/TBME.2006.875664View ArticleGoogle Scholar - Ren H, Kazanzides P: Investigation of attitude tracking using an integrated inertial and magnetic navigation system for hand-held surgical instruments.
*IEEE-ASME Trans Mech*2012, 17(2):210-217.View ArticleGoogle Scholar - Setoodeh P, Khayatian A, Frajah E: Attitude estimation by separate-bias Kalman filter-based data fusion.
*JNav*2004, 57(2):261-273.Google Scholar - Yun X, Bachmann ER: Design, implementation, and experimental results of a quaternion-based Kalman filter for human body motion tracking.
*IEEE Transactions on Robotics*2006, 22(6):1216-1227.View ArticleGoogle Scholar - Marins JL, Yun X, Bachmann ER, McGhee RB, Zyda MJ: An extended Kalman filter for quaternion-based orientation estimation using MARG sensors. In
*Proceedings of 2001 IEEE/RSJ International Conference on Intelligent Robots and Systems, vol 4*. Maui, HI; 2001:2003-2011.Google Scholar - Shin SH, Park CG, Kim JW, Hong HS, Lee JM: Adaptive step length estimation algorithm using low-cost MEMS inertial sensors. In
*Sensors Applications Symposium, 2007. SAS'07*. San Diego; 1-5. 6–8 February 2007Google Scholar - Jahn J, Batzer U, Seitz J, Patino-Studencka L, Gutiérrez Boronat J: Comparison and evaluation of acceleration based step length estimators for handheld devices. In 2010 International Conference on Indoor Positioning and Indoor Navigation (IPIN). Zurich; 1-6. 15–17 September 2010Google Scholar
- Shih WY, Chen LY, Lan KC: Estimating walking distance with a smart phone. In 2012 Fifth International Symposium on Parallel Architectures, Algorithms and Programming (PAAP). Taipei; 166-171. 17–20 December 2012Google Scholar
- Shin B, Lee JH, Lee H, Kim E, Kim J, Lee S, Cho Y, Park S, Lee T: Indoor 3D pedestrian tracking algorithm based on PDR using smarthphone. In 2012 12th International Conference on Control, Automation and systems (ICCAS). Jeju Island: ICC; 1442-1445. 17–21 October 2012Google Scholar
- Chon J, Cha H: Lifemap: a smartphone-based context provider for location-based services.
*Pervasive Comput*2011, 10(2):58-67.View ArticleGoogle Scholar - Klingbeil L, Wark T: A wireless sensor network for real-time indoor localisation and motion monitoring. In
*International Conference on Information processing in sensor networks, 2008*. St. Louis: IPSN'08; 39-50. 22–24 April 2008Google Scholar

## Copyright

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.