Research on Indoor Fusion Positioning Based on EKF for Uwb_Imu

: The study aims to improve the accuracy and stability of indoor positioning by integrating information from two types of sensors: UWB (Ultra-Wideband) and IMU (Inertial Measurement Unit) calibrated to eliminate system errors. The fusion algorithm utilizes Extended Kalman Filter (EKF) to combine UWB data and IMU measurements. First, the IMU undergoes self-calibration to correct system errors. Then, UWB ranging technology is used to estimate the target's position, and the information from the IMU's gyroscope and accelerometer is used to update the kinematic model. Finally, the EKF filters and predicts measurement errors and system noise to obtain accurate target position estimation. Experimental results demonstrate that this fusion method can enhance the precision and robustness of indoor static target positioning. The research findings are highly applicable in areas such as indoor positioning and intelligent surveillance.


Introduction
With the increasing demand for indoor positioning, such as indoor navigation and smart surveillance, the requirements for the accuracy and stability of indoor positioning technology are also increasing.Single UWB (Ultra-Wideband) positioning methods often cannot meet these requirements, therefore, new positioning methods need to be found to solve the indoor positioning problem.Among them, the fusion of UWB and IMU (Inertial Measurement Unit) sensor information has received considerable attention [2][3][4][5][6].
UWB technology is a broadband signal transmission technology that obtains target position information by measuring the arrival time difference of signals.It has the characteristics of high accuracy and strong anti-interference ability, making it suitable for indoor positioning applications.However, using UWB technology alone may have issues with measurement errors and instability.On the other hand, IMU is a sensor that measures the orientation and acceleration of an object, usually consisting of a gyroscope and accelerometer.By measuring the rotation and acceleration information of an object, the displacement and velocity of the object can be estimated in real-time.IMU sensors have the characteristics of high frequency and strong real-time performance, but they may be affected by accumulated errors and drift issues during long-term use.Therefore, fusing the information from UWB and IMU sensors can make full use of their respective advantages and improve the accuracy and stability of indoor positioning.Some scholars have researched and explored fusion methods of UWB and IMU.Yao Lu [7] et al. proposed a UWB/IMU fusion method based on the Unscented Kalman Filter (UKF) algorithm, with experimental results showing fusion positioning error within 0.5 meter and stability almost up to 99%.Zhang Binfei [8] et al. proposed a tightly coupled algorithm in complex indoor environments, which improved the accuracy of UWB positioning by 88.6% compared to UWB alone.Wang Peng [9] et al. proposed an improved particle filter algorithm for UWB/IMU fusion, which increased the positioning accuracy by 65.6% and 56.0% compared to EKF and UKF, respectively, while reducing the running time by 42.3% compared to the standard particle filter algorithm.Yang Xiujian [10] etal.proposed a UWB/IMU/odometer fusion positioning method based on an improved UKF algorithm, showing an improvement of approximately 22.8% and 13.1% in positioning accuracy compared to EKF and UKF, respectively.
This article aims to achieve accurate static positioning of indoor targets by fusing UWB initial positioning data and self-calibrated IMU data using the Extended Kalman Filter (EKF).The EKF, as a commonly used fusion algorithm, can filter and predict UWB data and IMU measurements to obtain an accurate estimate of the target's position.The fusion method is verified through an experimental environment and the data is analyzed using MATLAB software.

IMU positioning technology
IMU consists mainly of accelerometers and gyroscopes, which can measure the acceleration and angular velocity of the carrier in the vehicle coordinate system.Then, these measured values are converted to the navigation coordinate system, and the position, velocity, and attitude information are calculated through integration.In this paper, the North, East, Down (NED) coordinate system is chosen as the navigation coordinate system.The vector rotation from the vehicle coordinate system to the navigation coordinate system can be achieved through Euler angles, direction cosine matrix method, or quaternion method.Euler angles are simple and intuitive, but they may encounter gimbal lock problems.The direction cosine matrix method involves solving the differential equations of the attitude matrix, which requires a large computational burden.Therefore, this paper chooses the quaternion method, which has a smaller computational load and a simpler algorithm.The rotation matrix from the vehicle coordinate system (B-system) to the navigation coordinate system (N-system) based on the attitude quaternion q is as follows: In the equation,     represents a quaternion and satisfies: In the equation, "a " represents the three-axis acceleration in the navigation coordinate system, "a " represents the threeaxis acceleration in the vehicle coordinate system, and "g" represents the local gravitational acceleration.After the rotation transformation, the measured values from the accelerometer are integrated to obtain the velocity and position in the navigation coordinate system.

UWB Positioning Technology
UWB positioning technology is a high-precision IoT positioning technology at the centimeter level.It utilizes UWB wireless signals for positioning and combines measurements of time difference of arrival (TDOA) and the coordinates of base stations to achieve high-precision location calculation for IoT devices.This article adopts the Two Way-Time of Flight (TW-TOF) method, where each module generates an independent timestamp from the start.Module A's transmitter sends a pulse signal with the nature of an emission request on its timestamp, and Module B responds by transmitting a signal at a specific moment, which is received by Module A on its own timestamp.This allows for the calculation of the flight time of the pulse signal between the two modules, thereby determining the flight distance, d. Figure 1 illustrates the three-plane positioning method.
Where C is the speed of light.Based on Figure 1, we establish the UWB positioning equation system. Where: coordinates of the base stations,d 、d 、d represent the distances from the three base stations to the target point measured by UWB.The positioning of the target point is usually solved using the least squares method.By transforming the above equation system into a matrix form and adopting regularized least squares method, the estimated value of the target point can be obtained as: Where:

UWB_IMU Data Fusion
3.1.IMU Self-calibration 3.1.1.Using imu_tk package to determine system errors and compensate for them According to D. Tedaldi, A. Pretto [11][12] and others, the imu_tk package is first used to calibrate the IMU used, and the three elements of the system error of the IMU are measured, namely: misalignment matrix, scale matrix, and bias vector.The data obtained is then used to compensate the accelerometer and gyroscope of the IMU using the following formula: where M is the misalignment matrix, K is the scale factor matrix, and B is the bias matrix for the accelerometer.Figures 2 and 3 show the specific data matrices for the accelerometer and gyroscope used in this paper.The IMU was left motionless for approximately five hours, and the data from the three-axis gyroscope was recorded.Then, using the Allen variance analysis package in MATLAB, the obtained data was analyzed to identify the sources of noise.The results are shown in Figure 4-6.The following five parameters were obtained: quantization noise, random walk of angles, bias instability noise, rate random walk, and rate ramp.The random errors obtained in the three axes are used as the values of Q for the next step of EKF fusion.

EKF for UWB/IMU data fusion.
The Kalman filter was initially used for linear systems.It provides optimal results when the system model is linear and the noise is Gaussian white noise.However, in real-life scenarios, there are many nonlinear problems.The Extended Kalman Filter (EKF) is a filter that linearizes the expected value and covariance through Taylor series expansion to address nonlinear problems.In indoor positioning, due to the presence of NLOS errors, measurement noise often does not follow a Gaussian distribution, and using the Kalman filter may not yield optimal estimates.In this paper, we employ the EKF to incorporate position, velocity, quaternion, accelerometer bias, and gyroscope bias into a single filter.The UWB measurements are used as the measurement values, and the position estimates obtained through IMU integration are used as the prediction values for the EKF, to update the position, velocity, and attitude information.The state and measurement equations for the Extended Kalman Filter are as follows: In the equation: W and V represents process and measurement noise.be the Jacobian matrix of the measurement function.The EKF fusion process is as follows: Prediction step: Predict (prior) state estimation.
Compute the residual between the estimated state and the measurement value Y = Z H X | ;Calculate the covariance of the residual S =H P | H R ; Update step: Calculate the optimal Kalman gain.

P | I K H P | (13)
In the equation, Q and R are the noise of U and Z covariance matrices for and , respectively.

Experimental Results and Analysis
An experimental setup was constructed in the office area (as shown in Figure 7).The experimental modules utilized the Decawave DW1000 chip and SC-AHRS-100D2 inertial navigation system.Three UWB base stations were deployed within a 1.2m x 1.2m area, where base station 0 was connected to the PC via a USB cable.The experimental setup included base station 0 located at (0.0, 0.0), base station 1 at (1.2, 0.0), base station 2 at (0.0, 1.2), and a test vehicle integrated with a tag labeled Tag0.During testing, the base stations and the tag were positioned at the same height (0.3m) to minimize positioning errors.The initial configuration for the testing location is shown in Figure 8.To verify the positioning accuracy of UWB in a static environment, 9 different locations were selected for measurement in the aforementioned experimental area.These 9 locations were arranged in a zigzag pattern.The actual coordinates of the locations are as follows: Location 1 (0.9, 0.9), Location 2 (0.6, 0.9), Location 3 (0.3, 0.9), Location 4 (0.3, 0.6), Location 5 (0.6, 0.6), Location 6 (0.9, 0.6), Location 7 (0.9, 0.3), Location 8 (0.6, 0.3), and Location 9 (0.3, 0.3).The vehicle was controlled to pass through these locations sequentially with a 15-second pause at each location.The actual position data of the vehicle was recorded in the background and outputted.The recorded data was then compared and analyzed using MATLAB software.The results of the comparative experiment between the two data sets are shown in Figures 9 and 10.From the above comparison of experimental results, it can be observed that the positioning accuracy and stability are not satisfactory when using UWB positioning alone.The positioning results, especially when approaching the experimental area, tend to deviate from the actual values.The average error is 14.82cm, with a maximum error of 26.40cm.However, after performing EKF fusion, the deviation between the fused positioning coordinates and the actual position of the vehicle is smaller.The positioning range is more concentrated, with an average positioning accuracy of 10.33cm and a maximum error of only 13.68cm.

Conclusion
To improve the positioning accuracy of mobile robots indoors, this study proposes and verifies a UWB/IMU information fusion method based on the EKF algorithm after self-calibration of the IMU.Firstly, UWB is used to calculate the robot's position data, and then the IMU is analyzed and compensated for its self-errors.Next, the Extended Kalman Filter is employed to fuse the information obtained from UWB and the calibrated IMU.Through experimental verification, it is demonstrated that this method can achieve the desired positioning accuracy for indoor robots.