Research on UWB Indoor Positioning System Based on TOF Combined Residual Weighting

The performance of TDOA positioning based on UWB is limited by the hyperbolic characteristics of TDOA, especially for tags away from the hyperbolic asymptote. Aiming at this problem, a new UWB indoor positioning system is proposed. Firstly, TOF ranging is adopted to build the positioning equations; then the weighted centroid algorithm of four base stations is presented to compute the initial rough position of the tag; and the residual weighting is introduced to optimize the initial tag position; then, the corresponding nonlinear positioning equations, which will be algebraically transformed to one distribution function, are solved, and the optimal tag coordinates can be obtained by the Newton iteration method. Simulation experiments have verified the positioning reliability of the proposed algorithm under different noise environments and for different tag positions.


Introduction
In the ultra-wideband (UWB) positioning system, the ranging accuracy and measuring range are the two key metrics, which can degrade with the noise level, tag location, base station (BS) quantity, and positioning methods, generally. In the LOS or NLOS scenario, the UWB positioning mode is commonly based on time of flight (TOF) [1,2] or time difference of arrival (TDOA) [3,4], which will construct nonlinear positioning equations if the measured distance between the tag and each BS is known; then the tag coordinates can be obtained by solving the positioning equations, such as the Fang algorithm [3], Chan algorithm [4], or Taylor [5][6][7] algorithm. In TDOA positioning, high-precision clock synchronization is required, and the positioning error will increase when the tag is away from the hyperbolic asymptote [8]. When adapting TOF ranging to construct a set of hyperbolic equations, the Chan-Taylor method is often used to solve the tag coordinates [9][10][11], which is time-consuming in computation; alternatively, the centroid algorithm is presented to obtain the initial tag positions, and the final tag coordinates can be optimized by the Taylor iterations to improve the positioning performance [12,13], especially in serious noise environments. However, in the Chan-Taylor iterations, the covariance matrix of TDOA measurements is employed, thus the final tag positioning will be affected by TDOA hyperbolic properties [14]. In addition, for the computed tag coordinates, the literature proposes a residual weighting algorithm (Rwgh) to improve the initial location results by utilizing the minimum residuals instead of the mean square error in the TDOA [15,16]; based on the above residual weighting idea, the higher power of residual as a weighting function is presented to improve the positioning accuracy [17], however, which brings higher complexity in computation. To overcome the impact of TDOA hyperbolic properties and improve location accuracy, the TOF-based UWB system is studied, especially under serious noise environments. In the proposed TOF algorithm, the weighted centroid algorithm is adapted to compute the rough tag position, and a new residual weighting algorithm is proposed to reflect the minimum residuals between the TOF ranging and the estimated distance between the rough tag coordinates and the four BS, aiming to mitigate the rough tag locating error. In addition, an efficient Newton iteration is presented to optimize the final tag positions, avoiding the locating error from the irreversibility of the Hesse matrix.

Algorithm Description
TOF ranging is realized by asymmetric double-sided two-way ranging (ADS-TWR) [18] shown in Figure 1. Firstly, the tag transmits a ranging request signal to the BS; and the BS feeds the ranging signal to the tag; then the tag sends a ranging request signal to the BS. The time T from the tag to the BS can be computed by Equation (1) where T round1 is the total time of transmitting the ranging signal from the tag to the BS and from the BS to the tag; T round2 is the total time of the ranging signal transmitted from the BS to the tag and from the tag to the BS; T reply1 is the time delay from the BS reception of the tag ranging signal until the transmission of the reply; and T reply2 is the time delay from the tag reception of the BS ranging signal until the transmission of the reply. If c is the speed of light, then the distance from the tag to the BS is Equation (2) R n = c × T Sensors 2023, 23, x 2 of 13 brings higher complexity in computation. To overcome the impact of TDOA hyperbolic properties and improve location accuracy, the TOF-based UWB system is studied, especially under serious noise environments. In the proposed TOF algorithm, the weighted centroid algorithm is adapted to compute the rough tag position, and a new residual weighting algorithm is proposed to reflect the minimum residuals between the TOF ranging and the estimated distance between the rough tag coordinates and the four BS, aiming to mitigate the rough tag locating error. In addition, an efficient Newton iteration is presented to optimize the final tag positions, avoiding the locating error from the irreversibility of the Hesse matrix.

Algorithm Description
TOF ranging is realized by asymmetric double-sided two-way ranging (ADS-TWR) [18] shown in Figure 1. Firstly, the tag transmits a ranging request signal to the BS; and the BS feeds the ranging signal to the tag; then the tag sends a ranging request signal to the BS. The time T from the tag to the BS can be computed by Equation (1) where Tround1 is the total time of transmitting the ranging signal from the tag to the BS and from the BS to the tag; Tround2 is the total time of the ranging signal transmitted from the BS to the tag and from the tag to the BS; Treply1 is the time delay from the BS reception of the tag ranging signal until the transmission of the reply; and Treply2 is the time delay from the tag reception of the BS ranging signal until the transmission of the reply. If c is the speed of light, then the distance from the tag to the BS is Equation (2) n R c T = Given Rn, the TOF positioning equations of the four BS can be represented as Equation (3) Given R n , the TOF positioning equations of the four BS can be represented as Equation (3) where (x, y) is the abscissa and ordinate of the tag, and (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), and (x 4 , y 4 ) are the abscissa and ordinate of the four BS respectively. R 1 , R 2 , R 3 , and R 4 are the distances between the tag and the four BS stations, respectively. When solving the nonlinear positioning Equation (3), if each BS is taken as the center of the circle and the distance between each BS and the tag as the radius, four circles can be obtained that will have a common intersection, that is, the coordinate of the tag. However, in reality, there are multiple intersections or no intersections among the four positioning circles because of environmental noise or interference. As shown in Figure 2, where there is no intersection point between circles A, C, and D, which will result in no solution of Equation (3).
where (x, y) is the abscissa and ordinate of the tag, and (x1, y1), (x2, y2), (x3, y3), and (x4, y4) are the abscissa and ordinate of the four BS respectively. R1, R2, R3, and R4 are the distances between the tag and the four BS stations, respectively. When solving the nonlinear positioning Equation (3), if each BS is taken as the center of the circle and the distance between each BS and the tag as the radius, four circles can be obtained that will have a common intersection, that is, the coordinate of the tag. However, in reality, there are multiple intersections or no intersections among the four positioning circles because of environmental noise or interference. As shown in Figure 2, where there is no intersection point between circles A, C, and D, which will result in no solution of Equation (3) Aiming at the above problem, in this study, one weighted centroid positioning algorithm is presented, firstly, the centers of the four circles are connected, as in Figure 2, selecting a point E on the AB side of the quadrilateral ABCD to satisfy Equation (4) where R1 and R2 are the radii of circle A and circle B, respectively. Similarly, the coordinate positions of F, G, and H can be obtained. Thereby, the quadrilateral EFGH can be constructed, whose centroid is the tag coordinate O, denoted as (xo1, yo1) in Equation (5). Here point O is taken as the initial rough position of the tag.
where (xE, yE), (xF, yF), (xG, yG), and (xH, yH) are the abscissa and ordinate of E, F, G, and H, respectively. Aiming at the above problem, in this study, one weighted centroid positioning algorithm is presented, firstly, the centers of the four circles are connected, as in Figure 2, selecting a point E on the AB side of the quadrilateral ABCD to satisfy Equation (4) where R 1 and R 2 are the radii of circle A and circle B, respectively. Similarly, the coordinate positions of F, G, and H can be obtained. Thereby, the quadrilateral EFGH can be constructed, whose centroid is the tag coordinate O, denoted as (x o1 , y o1 ) in Equation (5).
Here point O is taken as the initial rough position of the tag.
where (x E , y E ), (x F , y F ), (x G , y G ), and (x H , y H ) are the abscissa and ordinate of E, F, G, and H, respectively. Thereby, the standard residual between the TOF range R n and the distance from each BS to the computed initial rough position is Equation (6) R The residual weighting is introduced to optimize the rough position of the tag as Equation (7) [ Sensors 2023, 23, 1455 4 of 12 where N represents the number of ranging times from the BS to the tag, thus solving N different initial rough position of the tag. To improve positioning accuracy, (x o , y o ) will be regarded as the initial value of the positioning equations, which can be optimized, generally by Gauss-Newton iteration [19] or iterative least squares [20]. However, the above optimization methods require Hesse matrix irreversibility, resulting in unsolvable problems [21]. To simplify the iteration process, the Newton iterative method is proposed in this paper. In the proposed Newton iterative method, the nonlinear positioning equations as Equation (3) are combined to obtain Equation (8) Setting the variable z as Equation (9) When z = 0, the solution of Equation (9) is the tag coordinate. Thus, solving nonlinear Equation (3) has been transformed into an optimization problem when z = 0. If we describe the partial derivative of x concerning z as Equation (10) and the partial derivative of y concerning z as Equation (11) z y = 8y − 2y 1 − 2y 2 − 2y 3 − 2y 4 (11) Then the multivariate Newton iteration will be transformed into two univariate Newton iterations in the x direction and y direction, respectively.
If (x i , y i ) is the rough estimated coordinate of the tag, the optimal tag position can be computed by the Newton iterative solution, which can be described as Equation (12) where (x i , y i ) and (x i+1 , y i+1 ) are the coordinates of the tag position at the i-th iteration and the (i+1)-th iteration, respectively.
During each iteration, the target position is constantly updated as Equation (13) x where ∆x and ∆y are the difference between the abscissa and ordinate of the tag before and after the iteration, respectively. Set the threshold ε, which satisfies Equation (14) |∆x| ≤ ε |∆y| ≤ ε When ∆x and ∆y satisfy Equation (14), the iteration will stop, and the estimated final tag position can be obtained.
Compared with the Taylor algorithm and iterative least squares, the proposed Newton iterative algorithm does not need to use the Hesse matrix, avoiding the problem of the Hesse matrix irreversibility. Besides, the weighted centroid combined with the Newton iterative algorithm can provide the final tag position with higher positioning accuracy.

Simulation Experiment
Selecting four UWB BS under scatter plot analysis of tag positioning conditions, the coordinates are A(0, 0), B(100, 0), C(0, 100), and D(100, 100), respectively; and the tag coordinate is (x, y). When positioning, the tag receives and records signals from each BS, and the channel noise obeys N (0, δ 2 ).

Parameter Optimization of the Proposed Residual Weighting
During the computing process of the standard residual as Equation (6), these singular values corresponding to the computed initial rough coordinates far away from the tag positions will be removed, and the optimal threshold is set to 0.0031 by experiment, that is Equation (15) R(x o1 , y o1 ) −1 > 0.0031 (15) In Equation (7) where n is the number of experimental simulations. Select N in (7,9,5), and the noise variance as 0.5, and 10 tag positions are randomly generated. The RMSE performance of the proposed position algorithm is shown in Figure 3. When N = 9, the RMSE of these 10 points is the smallest. This shows that when N = 9, the residual weighting effect is the best, and the optimal N is equal to

Contrast Experiments
To verify the feasibility of the proposed positioning algorithm, the simulation compares and analyzes the RMSE performance of the weighted centroid Taylor iterative positioning algorithm based on TOF (referred to as TOF-Taylor) [12] and the TDOA positioning algorithm based on TOF ranging (referred to as TOF-TDOA) [9].

Contrast Experiments
To verify the feasibility of the proposed positioning algorithm, the simulation compares and analyzes the RMSE performance of the weighted centroid Taylor iterative positioning algorithm based on TOF (referred to as TOF-Taylor) [12] and the TDOA positioning algorithm based on TOF ranging (referred to as TOF-TDOA) [9].

The TOF-Taylor
TOF ranging constructs the positioning Equation (3), then the weighted centroid algorithm is introduced to compute the initial coarse coordinate O 1 (x o , y o ) of the tag; then the Taylor algorithm is used to optimize O 1 [12]. Assuming A (x 1 , y 1 ) as the reference BS, R n , n = 1, 2, 3, 4 is obtained by TOF ranging, and we can obtain the hyperbolic equations Equation (17) where R 1 is the distance between the tag and the reference BS A; and R n , n = 2, 3, 4 are the distances between the tag and the other three BSs, respectively. Expanding Equation (17) where R n,1 = R n − R 1 , n = 2, 3, 4; and ∆x 1 and ∆y 1 are the errors between the true coordinates of the tag and the abscissa and ordinate coordinates of the solution coordinates, respectively. Equation (18) can be described in matrix form as Equation (19) Z − N∂ = r (19) where r is the error vector, and as Equations (20) and (21) ∂ is the position deviation given by the WLS method as Equation (22) ∂= [∆x 1 , Here, Q is the covariance matrix of the TDOA measurement.
The target positions will be continuously updated by solving Equation (18) recursively, until the updated ∆x 1 and ∆y 1 satisfy Equation (23) Here, ε 1 is the threshold of the positioning error. When the iteration is stopped, the final estimated tag position is recorded as (x o , y o ).

The TOF-TDOA
In the TOF-TDOA [9], TOF ranging in round three is presented to obtain the distance from each BS to the tag, which is recorded as r n , and taking the BS A as the reference BS, the TDOA hyperbolic equations can be constructed as Equation (24) Substituting Equation (24) into Equation (18), we can obtain Equation (25) x n,1 x + y n,1 y + r n,1 r 1 = where x n,1 = x n − x 1 , y n,1 = y n − y 1 , r n,1 = r n − r 1 , K n = x 2 n + y 2 n . We can see that the nonlinear positioning Equation (18) has been transformed into the linear Equation (25), which can be rewritten in matrix form as Equation (26) HV=L Solving Equation (26) by the Chan algorithm [24], an initial rough tag position can be obtained as (x h , y h ). In this process, twice WLS is adapted, and the output of the first WLS can be expressed as Equation (27) where ϕ is the covariance matrix of the measurement. The second WLS is Equation (28) In L ' , (x − x 1 , y − y 1 ) can be approximately replaced by H, that is the output initial rough tag position of the first WLS as Equation (27); thereby, after twice WLS, the initial rough tag position (x h , y h ) can be solved as Equation (29) Substituting Equation (29) into Equation (18), the final tag coordinate can be obtained by Taylor iteration, denoted as (x o , y o ).

Experiment 1 Influence of Noise on Positioning Performance
To verify the performance of the proposed algorithm in a severe noise environment, the noise variance is set to 0.1, 0.25, 0.5, 0.75, and 1, respectively. The real coordinate of the tag is (60, 35), the experiment simulation is 1000 times, and the threshold ε and ε 1 are set to 0.001. The positioning accuracy of the different positioning algorithms is shown in Figure 4.

Experiment 2 Influence of Tag Position on Positioning Performance
To verify the performance of the proposed algorithm in special tag positions, we set the noise variance to 0.4 and five coordinates were randomly generated, {(40, 39), (80, 37), (89, 72), (9,12), (58, 63)}, of which (40, 39), (58, 63) represent tags far from the hyperbolic asymptote and (80, 37), (89, 72), (9,12) represent tags close to the BS. Comparison of the RMSE of the TOF-TDOA, TOF-Taylor, and the proposed algorithm, and the iterations of the proposed algorithm are shown in Figure 5 and Figure 6, respectively. The corresponding evaluation indexes are analyzed in Table 1.  As can be seen from Figure 4, the positioning error of the proposed algorithm shows a slow upward trend with the increase in the noise. When the noise variance is equal to 0.75, the positioning accuracy is improved by 46% and 48% compared with the TOF-Taylor and the TOF-TDOA, respectively; when the noise variance is equal to 1, the positioning accuracy is improved by 53% and 65%, respectively, and, at this condition, the TOF-Taylor and the TOF-TDOA are not applicable with an RMSE above 0.8. However, the proposed algorithm isn't sensitive to noise, and, therefore, can be applied in a severe noise environment.

Experiment 2 Influence of Tag Position on Positioning Performance
To verify the performance of the proposed algorithm in special tag positions, we set the noise variance to 0.4 and five coordinates were randomly generated, {(40, 39), (80, 37), (89, 72), (9,12), (58, 63)}, of which (40, 39), (58, 63) represent tags far from the hyperbolic asymptote and (80, 37), (89, 72), (9,12) represent tags close to the BS. Comparison of the RMSE of the TOF-TDOA, TOF-Taylor, and the proposed algorithm, and the iterations of the proposed algorithm are shown in Figures 5 and 6, respectively. The corresponding evaluation indexes are analyzed in Table 1. As can be seen from Figure 5, the positioning accuracy of the proposed algorithm is improved by 28% and 44% on average compared with the TOF-Taylor and the TOF-TDOA, respectively; in the given tag positions close to the BS or far from the hyperbolic asymptote, the RMSE of the proposed algorithm doesn't exceed 0.3, however, the TOF-Taylor and the TOF-TDOA are not applicable with RMSE values above 0.5. In addition, the positioning accuracy of the proposed algorithm is further verified by standard deviation, mean error, and median error in Table 1. In comparison, from Figure 6, the proposed algorithm needs more iterations, but this is negligible because each iteration is about 0.005 s. the noise variance to 0.4 and five coordinates were randomly generated, {(40, 39), (80, 37), (89, 72), (9,12), (58, 63)}, of which (40, 39), (58, 63) represent tags far from the hyperbolic asymptote and (80, 37), (89, 72), (9,12) represent tags close to the BS. Comparison of the RMSE of the TOF-TDOA, TOF-Taylor, and the proposed algorithm, and the iterations of the proposed algorithm are shown in Figure 5 and Figure 6, respectively. The corresponding evaluation indexes are analyzed in Table 1.    Figure 5, the positioning accuracy of the proposed algorithm is improved by 28% and 44% on average compared with the TOF-Taylor and the TOF-TDOA, respectively; in the given tag positions close to the BS or far from the hyperbolic asymptote, the RMSE of the proposed algorithm doesn't exceed 0.3, however, the TOF-Taylor and the TOF-TDOA are not applicable with RMSE values above 0.5. In addition, the positioning accuracy of the proposed algorithm is further verified by standard deviation, mean error, and median error in Table 1. In comparison, from Figure 6, the proposed algorithm needs more iterations, but this is negligible because each iteration is about 0.005 seconds.

Experiment 3 Scatter Plot Analysis of Tag Positioning
The scatter plots of the three positioning algorithms are shown in Figure 7a,b, respectively. In experiments, the real tag coordinate is (70, 63), the noise variance is 0.8, and the number of experiments is 500.
As can be seen from Figure 7, under a serious noise of variance 0.8, the positioning coordinates of the proposed algorithm show better concentration around the real tag coordinate; by comparison, the TOF-Taylor and the TOF-TDOA have a more divergent distribution of positioning coordinates, and several positioning coordinates have been seriously distorted, which can no longer satisfy the needs of indoor positioning