{'fraction_non_alphanumeric': 0.04087533679437471, 'fraction_numerical': 0.01445751462180456, 'mean_word_length': 4.254834254143646, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Pedestrian Dead Reckoning with Low-Cost Foot-Mounted IMU Sensor

In this paper, we researched Pedestrian Dead Reckoning (PDR) with one foot-mounted IMU sensor. The issues of PDR are magnetism noise and accumulated error due to the noise included in acceleration and gyro data. Two methods are proposed in this paper. First is the gait-phase-estimation method with pitch angle for the Zero Velocity Update algorithm. Second is a method for avoiding accumulated errors by updating the roll and pitch angles with acceleration. The two experiments were conducted to examine the error of gait-phase estimation and distance estimations. The relative error of distance was about 7.40% in the case of walking straight and about 12.27% in the case of a shifting travel direction.


Introduction
PDR is the one of the technologies to estimate pedestrian position. PDR contributes to navigation systems. Navigation systems should use GPS or PDR technology depending on the situation. For example, a navigation system navigates a person using GPS when they are in the outdoors and navigates a person using PDR when they are in an underground pathway. There are technologies for navigation systems, such as GPS; however, GPS is unsuitable for an indoor navigation system. Navigation systems with IMU sensors are suitable for indoor navigation systems.
IMU-based PDR technologies have been explored in detail by the other papers, and there are advantages, such as no effects from circumjacent objects except for electronic goods in IMU-based PDR. There are technologies to estimate a pedestrian's position, such as methods using ultrasound waves or beacons. Pedestrian position estimation by these methods are affected by circumjacent objects.
However, there are two main disadvantages in IMU-based PDR methods. First is the accumulated error in estimating velocity. Second is the accumulated error in estimating attitude angles. Generally, the first issue is handled by a Zero Velocity Update algorithm, and the second issue is handled by sensor-fusion methods, such as a Kalman filter and Complementary filter. The development of high accuracy mid-stance detection algorithms for Zero Velocity Updates is needed. Therefore, in this paper, we proposed new methods to solve these two issues. First is the gait-phase-estimation method for the Zero Velocity Update algorithm. This detects the mid-stance phase. The pitch angle is the focus in this method. When a foot is in mid-stance phase, the pitch angle and the gyro of the foot-mounted IMU sensor will be nearly 0. Secondly, the roll/pitch update method handles the accumulated error in attitude angles. The roll and pitch angles are calculated by integrating the gyro during gait phases, except for mid-stance, and they update the roll and pitch angles using the acceleration measured in each mid-stance phase. The main contributions of this paper are two proposed methods: • The gait-phase estimation method for Zero Velocity Updates. • The roll/pitch update method that, during the mid-stance phase, updates the roll and pitch angles using the acceleration measured in each mid-stance phase.
This paper is organized in five sections, with the Introduction in Section 1, Related Works in Section 2, the System and Method in Section 3, Experiments in Section 4 and our Conclusions and Future Work in Section 5.

Application Model
A pedestrian wears an IMU sensor on their left shoe. Figure 1 shows application model.

IMU Sensors and Deployment Positions for PDR
In this research, a low-cost IMU sensor was used. There are tactical-grade IMU sensors, such as STIM202 [1], STIM300 [2]. Tactical-grade IMU sensors have much better performance compared with low-cost IMU sensors. However, tactical-grade IMU sensors are not suitable for navigation system in daily life because the price is expensive. In this paper, a low-cost IMU sensor is mounted on a shoe because it is easy to detect the midstance phase for Zero Velocity Updates. There are papers on PDR using smartphones, such as [3][4][5]. A paper [4] (A. Poulose et al.) described that the advantage of using smartphonebased position-estimation systems is that this requires no additional peripherals devices except for the smartphone itself. However, according to the paper [3] (S. Park et al.), the zero velocity phase rarely occurs in the case of Zero Velocity Updates (ZUPT) in the smartphone.

Related Works for the First Issue and Second Issue
In the paper [6] (H. Fourati), a method using the Complementary filter instead of Extended Kalman filter was proposed. The paper [6] presented the Quaternion-based complementary filter. MTI-IMU produced by Xsens was used for the experiments of [6]. The measurement error in positioning was about 0.4%.
In the paper [7] (Z. Xiao-dong et al.), a new Zero Velocity Update algorithm using Kalman filter and Particle filter was proposed. An IMU sensor produced by Xsens was used in the experiments of [7]. The measurement error in positioning was less than 0.5%.
In the paper [8] (L.-F.Shi et al.), a novel orientation estimation and gait-phase detection algorithm were proposed. The paper [8] proposed a Zero Velocity Update and orientation and velocity calibration method. The experiments of [8] were conducted indoors and outdoors, attaching an MPU9250 IMMU to the foot. The average distance error was less than 1.2%.

Summary
In previous studies, the orientation and velocity calibration method [8] and methods using sensor-fusion methods, such as Quaternion-based Complementary filter [6], Kalman filter and Particle filter [7] were proposed to handle accumulated error issues. In addition, many gait-phase detection algorithms have been proposed to improve Zero Velocity Updates as well. Therefore, in this paper, the roll/pitch update method and gait-phase-estimation method are proposed with the aims of handling accumulated errors in attitude angles and improving the Zero Velocity Update method. Figure 2 shows the system architecture. There are 11 steps. The gyro and magnetism data are calibrated in step 0. After that, the acceleration, gyro and magnetism data are input. In step 1 to step 3, all input data are filtered by the simple moving average. In step 4, gait-phase estimation is conducted to detect mid-stance phase. In step 5, the gyro data of the pitch angle and roll angles are integrated, and the roll and pitch angles are updated mid-stance using acceleration. In step 6, the gyro and magnetism data are fused to calculate the yaw angle. In step 7, the acceleration is converted from local coordinates to global coordinates. In step 8, the acceleration is integrated to calculate the velocity, and the Zero Velocity Update is conducted. In step 9, the velocity is integrated to calculate the position vector. In step 10, the pedestrian position is estimated using the yaw angle and position vector.

Data Preprocessing (Step 0)
Before the data are processed, the gyro and magnetism data are calibrated. In the gyro calibration, gyro offsets are eliminated by subtracting the gyro data for calibration from the raw gyro data. In the magnetism calibration, the gap of the ellipse center is measured, and the raw magnetism data are modified with the measured gap.

Low-Pass Filter (Step 1, 2, 3)
Acceleration, gyro, and magnetism data are filtered with a low-pass filter and simple moving average. The definition of the simple moving average is shown in Equation (1). a f iltered,n and a raw,n denote filtered data and raw data, respectively.
In this paper, n denotes the index. 2w + 1 is the window size. The window size is set to 21 (w = 10).

Gait Phase Estimation (Step 4)
We propose a method to estimate the gait phase with pitch angle. According to the papers [6,9], there are two phases, the stance phase and the swing phase in the gait phase. Furthermore, according to [9], there are the pre-stance, mid-stance and terminal stance in the stance phase, and there are the pre-swing, mid-swing and terminal swing in the swing phase. Figure 3 shows six gait phases. According to the paper [10], the pitch angle is obtained with Equation (2).
Equation (2) is used for our method. Let θ a,n = tan −1 −a x,n a 2 y,n +a 2 z,n . θ a,n denotes θ a measured in n-th time. The algorithm to estimate the gait phases is as follows.
Step 1: Conduct the low-pass filter to θ a,n 2 and ω y,n 2 .
N: Length of the data Step 2: Estimate the gait phase into Label L n where θ 1 , θ 2 denote thresholds. θ 1 is set to 0.1, and θ 2 is set to 0.2. If L n = 0, it is estimated as mid-stance. Otherwise, if L n = 1, it is not estimated as mid-stance.

Integration and Roll and Pitch Update (Step 5)
The method for avoiding accumulated errors in attitude angles is proposed for use in a ramp. In the paper [8] (L.-F.Shi et al.), they make an assumption that the roll and pitch angles are assumed to be the same as the initial value during each stance phase. In the paper [8], a method based on this assumption is proposed. However, in the case of a ramp, their assumption does not hold.
In the method in this paper, during each mid-stance phase, the roll and pitch angles are updated to φ a and θ a as measured in each mid-stance phase. On the other hand, the gyro is integrated during the other gait phases. According to the paper [10], Equation (6) can be used to obtain the pitch angle.
Equations (2) and (6) are used for the roll/pitch update method. The trapezoidal rule is used for integration. The trapezoidal rule is shown in the following equation ∆t is 1/Sampling rate, The integration and roll and pitch update method is implemented with the recurrence Formula (8). Figure 4 shows the comparison between roll and pitch angles obtained by only integration and roll and pitch angles obtained by (8). It is confirmed that the orange lines show less drift than the blue lines.

Kalman Filter (Step 6)
The Kalman filter is implemented with the following status equation and observation equation.
ψ k = ψ k−1 + ∆tω z,k + w k (9) w k , v k and ψ k denote the system noise, the observation noise and the yaw angle in the k − th time, respectively. The observation vector z k is −atan2(m x,k , m y,k ) − ψ 0 . ψ 0 is the average of −atan2(m x,k , m y,k ) from index k = 0 to k = 399. Let ψ k be status vectorx k , A = 1, B = ∆t, u k = ω z,k and H = 1. According to [11], the prediction equations are defined from (11) to (12).
I denotes the unit matrix. The filter deviation matrix P 0 is set to 100, and Q and R are set to 1.0 × 10 −5 , 1.0 × 10 2 .

Coordinate Conversion (Step 7)
The acceleration is converted from local coordinates to global coordinates with Quaternion. Quaternion q is represented as q = q 0 + q 1 i + q 2 j + q 3 k. Let u = u 0 + u 1 i + u 2 j + u 3 k, a l = a x i + a y j + a z k and a g = a X i + a Y j + a Z k. u, a l and a g denote Quaternion, which represents rotation, acceleration in the local coordinate and acceleration in the global coordinate, respectively. ψ, θ and φ denote the yaw angle, pitch angle and roll angle, respectively. The local coordinate is converted to a global coordinate with the following equation.
u denotes the conjugate Quaternion of u. Figure 5 shows the comparison between the accelerations in the local coordinate and in the global coordinate.

Integration and Zero Velocity Update (Steps 8 and 9)
Zero Velocity Update is used for reducing the drift. The foot velocity is almost 0 when the foot state is in the mid-stance. From the trapezoidal rule and Zero Velocity Update, the foot velocity v n and position vector r n are calculated with the following recurrence equation.
(v 0 = 0 ∈ R 2 , r 0 = 0 ∈ R 2 ) Figure 6 shows the comparison between the velocity obtained by only integration and the velocity obtained by the Zero Velocity Update and integration.

Pedestrian Position Estimation (Step 10)
The pedestrian position is estimated on the complex plane using the following equations ( Figure 7). p n = p n−1 + ||r n − r n−1 ||i (20) p n = (p n − p n−1 e iψ n ) + p n−1 (p 0 = 0) p n is the pedestrian position.

Experiments
The two experiments were conducted for accuracy examination of the system. The experiments were conducted indoors. Figure 8 shows the implementation of the system, and Figure 9 shows the location of the IMU sensor. The IMU sensor (Wonder-Sense, developed in our laboratory) was used.

Exp. 1: Gait Phase Estimation Test
This experiment's objective is accuracy examination for gait-phase estimation. We defined the True label by synchronizing the collected data with videos taken during collecting the data. If the True label is 0, this indicates mid-stance. On the other hand, if the True label is 1, this indicates the other gait phases. The estimation error (ER) is calculated with the below equation. Table 1 shows the estimation error of mid-stance by the gait-phase-estimation algorithm shown in Section 3.4. Three sets of straight walking data of one person were collected.  The gait-phase-estimation algorithm should be improved from the data in Table 1. Estimation error of mid-stance was about 7.34% in average. However, each estimation error is scattered. A reliable gait-phase-estimation algorithm should have a lower error and low variance.

Exp. 2: Test for Estimation of Walking Trajectory
This experiment's objective was the examination of the accuracy of the trajectory estimation. The relative error (RE) shown in the following equation calculates the accuracy of the distance estimation.

RE=
Estimated distance − Walked distance Walked distance × 100 [%] (23) Figure 13 shows the walking routes of this experiment. Figures 14-16 show the estimated walking trajectory. Tables 2-4 show the results of the estimated distance. The walking data of one person were collected. This experiment was conducted in the laboratory.
The relative error of distance is much larger than in related studies, and the yaw angle estimation is not good as shown Figures 15 and 16. One of the possible reasons for the bad yaw angle estimation is the effect of magnetism from the other electronic devices. It is possible that the Kalman filter could not accurately estimate the yaw angle due to the large magnetism noise. Therefore, the yaw angle estimation in this paper should be improved referring to papers on the heading estimation method, such as [12,13].

Conclusions and Future Work
The norm of the relative errors of distance was about 7.40% in the case of straight walking and a short distance. On the other hand, the relative error of distance was about 12.27% in the case of a shifting travel direction. In comparison with with related research, the relative errors of the system in this paper were larger. In particular, the relative error of distance was much larger in the shifting travel direction. Future work must verify the accuracy of the system for the case of walking on a ramp. We could not verify this due to time constraints in our research. In addition, the roll/pitch update method in Section 3.5 was proposed in the case of a ramp, and the gait-phase-estimation method in Section 3.4 was proposed in the case of no ramp. Therefore, the gait-phase-estimation method should be modified when the roll/pitch update is verified in the case of walking on a ramp.