Adaptive Extended Kalman Filter Position Estimation Based on Ultra-Wideband Active-Passive Ranging Protocol

This paper first presents a comprehensive analysis of Non-Line-of-Sight (NLoS) error cases in the Ultra-Wideband (UWB) Active-Passive Two-Way Ranging (AP-TWR) protocol. Based on this analysis, we then propose the Adaptive Extended Kalman Filter (A-EKF) positioning method, utilizing variances calculated from AP-TWR range estimates, which are adapted based on the distance and intermittency of the range estimates. The proposed method needs no training data, nor any additional information about the environment the system is deployed in and does not yield any additional time delays. Based on experiments conducted in an industrial environment, the results show that the proposed method outperforms standard non-adaptive AP-TWR and active-only Single-Sided Two-Way Ranging (SS-TWR) methods in both stationary and movement tests. The stationary tests show that on average the proposed A-EKF method provides more than three times lower Root-Mean-Square-Error (RMSE) than the next best method (AP-TWR) in 3D positioning, while SS-TWR consistently performs worse by about 0.4 m in the z-axis. Additionally, the movement tests confirm the findings of the stationary tests and show that the challenging propagation conditions of the testing environment cause maximum errors at about 4.5 m for AP-TWR and SS-TWR, whereas the proposed A-EKF managed to mitigate these effects and reduce the error by 9 times, resulting in a maximum error of 0.5 m.


I. INTRODUCTION
Ultra-Wideband (UWB) is a term used for radio communication that covers a bandwidth of over 500 MHz or 20% of the carrier center frequency. With the IEEE 802.15.4a-2007 amendment to the original IEEE 802.15.4-2006 standard, additional physical layers were introduced, which enabled precise ranging for UWB devices [1].
Utilizing UWB technology provides several benefits. The first one is the reduced interference with other narrowband wireless technologies thanks to the low transmission power The associate editor coordinating the review of this manuscript and approving it for publication was Mohamed Kheir . of the wideband signal [2]. Another benefit of UWB is the nanosecond-range duration of the signal pulses, which reduces the effect of multipath as the signals from multiple propagation paths can be determined and filtered out accordingly [3]. Additionally, the high temporal resolution allows for centimeter-level ranging by utilizing Time of Flight (ToF) estimation by various Two-Way Ranging methods or using the Time Difference of Arrival (TDoA) method [4].
Like Bluetooth or WiFi, UWB also relies on the propagation of Radio Frequency (RF) waves, allowing it to function effectively even in Non-Line-of-Sight (NLoS) situations, although with diminished performance [2], [5]. In contrast, indoor positioning systems based on light, vision, or infrared technologies are unable to operate in these conditions [6].
To reduce the accuracy/precision penalties induced by NLoS propagation conditions, numerous NLoS detection and/or mitigation methods have been proposed [7]. In the literature, these strategies typically fall into three distinct but not mutually exclusive categories which are briefly discussed in the following paragraphs.
Firstly, channel statistics-based methods exploit the additional information about the propagation channel itself. These methods may use the various channel state parameters directly supplied by UWB transceiver chips (i.e. Qorvo DW1000 [8]) or the raw Channel Impulse Response (CIR) values. The former provides quickly accessible values, while the latter entails more time-consuming processes to extract the CIR [9].
Krishnan et al. employed machine learning (ML) methods (Multi-Layer Perceptron and Boosted Decision Trees) with the DW1000 supplied parameters of first path power and total received power to achieve a classification accuracy of up to 87% [10]. Similarly, [11] utilized readily available signal parameters reported by the DW1000 transceiver chip and proposed classifiers based on Gaussian Distribution and Generalized Gaussian Distribution models, outperforming multiple state-of-the-art ML techniques. The authors of [12] put forward a Neural Network model, which was trained on distance measurements, the running standard deviation of these measurements, and several received signal parameters. The purpose was to derive weights for a weighted least squares position estimator, aiming to minimize the impact of NLoS. In addition to ML, various other methods have been researched, such as fuzzy inference of NLoS parameters combined with adaptive Kalman filtering [13], utilizing logistic regression for NLoS detection [14], and devising a power-performance metric based on the estimated first path power and the total received power [15].
A sizable amount of research has been conducted by using the raw CIR: NLoS detection via Capsule Networks [16], proposing an NLoS-induced outlier-aware positioning method based on multilayer perception [17], signal decomposition by One-Dimensional Wavelet Packet Analysis in conjunction with Convolutional Neural Networks (CNN) [18], Transformer deep learning model [19], combining the Multilayer Perceptron with CNN to reduce calculation complexity [20], overcoming the problem of site-specific models by conducting Long Short-Term Memory training to predict NLoS error magnitude and variance of measurements [21], to name a few of the latest. In addition to ML and deep learning, other methods utilizing the raw CIR are explored: NLoS detection using fuzzy comprehensive evaluation [22], a weighted particle filter based on probability density functions of Line-of-Sight (LoS)/NLoS correlation coefficients [23], and adaptively selecting the optimal anchors based on the channel quality indicators [24].
Although the methods based on raw CIR typically offer higher accuracy than methods based on the readily available channel parameters, they propose a drawback on the scalability of a positioning system as the extraction of the raw CIR values from the transceiver is a time-consuming process [9]. Moreover, employing ML models requires large amounts of high-quality training data, which makes the data-gathering process tedious, while the training and implementation of models could turn out computationally expensive [20], [25].
Secondly, the position estimate-based category is with the broadest reach, covering methods that use position estimation residuals, redundancy of ranging estimates, environment (geometrical and propagation) data, or time series of position estimates.
In [26], Chen proposed the seminal Residual Weighting (Rwgh) algorithm, in which the position estimates and their residuals are calculated with every possible range estimate combination. The final position estimate is found as a residual-weighted linear combination of the intermediate position estimates. Jiao et al. improved on the work of Chen, lowering the computational cost by introducing an iterative approach to residual weighting [27]. Given N range estimates, this method calculates position estimates and residuals with N − 1 combinations, choosing the one with the lowest average residual. It then selects the subsets until possible and calculates the final weighted position estimate based. Even though the computational complexity is reduced compared to Chen's algorithm, the method still requires in the order of tens of intermediate position estimate calculations to provide a final estimate.
Similar to the previous methods, [28] utilized the ranging residuals to propose an iterative residual test to identify and use only the detected LoS distances for positioning. Excluding NLoS distances, particularly in situations where multiple anchors are affected by the NLoS conditions, may lead to the inadvertent dismissal of crucial data for accurate positioning. In [29], the authors detected the presence of NLoS from statistical parameters calculated from the ranging residuals. While the general detection of Non-Line-of-Sight (NLoS) presence in positioning demonstrated high accuracy, discerning individual NLoS range estimates became more challenging as the accuracy decreased.
In [30] the authors addressed NLoS-corrupted measurements by detecting points of intersection with known obstacles present in a room. Subsequently, they computed correction terms based on these intersections to rectify the inaccuracies caused by NLoS effects. Similarly, Silva et al. utilized the geometric floor plan of the positioning environment, alongside information about the surrounding walls' composition, to propose a through-the-wall ranging model for positioning [31]. As this information is highly specific to the positioning environment, the setup of such a positioning system needs extra steps, such as acquiring floor plans or site surveying and matching them to the specific refractive indices of the walls of the positioning environment.
Thirdly, range-based methods utilize the time series of ranging values to detect and mitigate NLoS-induced position errors, for example by using the running variance of range estimates or a known probability density function for LoS/NLoS detection [32]. Applying such methods requires a priori error distributions or introduces time latency to the detection [22]. Furthermore, without additional constraints, the running variance method could lead to false classification if the tag is moving during the estimation process [33]. Momtaz et al. proposed a statistical method of detecting and eliminating the NLOS errors with lower computational complexity and increased accuracy [34], allowing for a more scalable solution than the previously mentioned Rwgh algorithm. As a downside, this method requires a specific online training phase, in which the noise term has to be measured. In order to circumvent some of the restrictions caused by extracting the CIR samples from the transceiver chip, Barral et al. opted to use the received signal value in conjunction with ranging data as features for multiple ML techniques for LoS/NLoS classification [9].

A. CONTRIBUTIONS
The advent of the UWB Active-Passive Two-Way Ranging (AP-TWR) protocol researched in [35] and [36] opens up a new way of providing robust positioning in the presence of NLoS conditions. The following paragraphs outline the contributions of this paper.
While previous studies have focused on the performance of AP-TWR ranging, this paper goes further to examine how AP-TWR range estimates affect positioning accuracy. The proposed AP-TWR-based positioning method is validated and benchmarked in a real industrial environment to assess its performance.
The formulation of the proposed positioning method involves a thorough analysis of different NLoS error cases of AP-TWR, a novel contribution that has not been explored in the existing literature. Utilizing the redundant range estimates of AP-TWR allows for the calculation of range estimate noise variances, which is based on the previous analysis representative of NLoS propagation conditions. The noise variance is coupled with the proposed distance and intermittency penalties and used as input parameters to an Extended Kalman Filter (EKF) to provide a novel NLoS-robust and accurate positioning method.
The uniqueness of the proposed method lies in its avoidance of computationally expensive iterative NLoS detection techniques, lack of reliance on channel statistics or CIR information, independence from acquiring large datasets and labeling for model training, retention of all ranging data by not discarding any information, absence of latency issues typically found in methods computing running parameters, and the ability to operate without any knowledge about the environment, such as the composition and placement of walls or obstructions in a room. The proposed method stands out as a scalable, relatively easy-to-implement, and FIGURE 1. The Active-Passive Two-Way Ranging protocol. Tag T starts the ranging process by transmitting a packet, to which the active anchor Ai responds, after which T finishes the ranging sequence with a final transmitted packet. The passive anchor Aj listens to the active transmission in the air and calculates its passive range estimate.
accurate NLoS-robust positioning solution, capable of efficiently adapting to various environments and ensuring reliable performance even in challenging propagation conditions. The rest of the paper is organized as follows: Section II gives the theoretical background of the AP-TWR protocol, Section III presents the effects of NLoS on the AP-TWR range estimates and formulates the proposed method based on it, Section IV describes the environment and the parameter values used in the experiments, Section V provides the analysis of the results, and Section VI concludes this paper.

II. ACTIVE-PASSIVE TWO-WAY RANGING
The AP-TWR protocol packet exchange diagram is pictured in Fig. 1, where the mobile device (tag T) starts the ranging sequence by transmitting a ranging request packet. Upon receiving that packet, the current active anchor Ai responds after its processing time t Ai,T , which T promptly receives and records the round trip time interval t T ,Ai . The final ranging report packet sent by T is irrelevant from the standpoint of producing time interval values; rather it is used to communicate the t T ,Ai values back to the anchors for final range calculation. Meanwhile, the passive anchor Aj listens to the packet exchange of T and Ai and records the time interval between receiving T's first packet and Ai's response, t Aj,Ai .
The resulting values are used in calculating the AP-TWR Time of Flight (ToF) estimates via: where the first part corresponds to the active ranging by Single-Sided Two-Way Ranging (SS-TWR), and the second part is used to calculate the passive range estimates, hence the name AP-TWR. The resulting term t T ↔Aj|Ai is the estimated ToF between T and Aj, calculated with the VOLUME 11, 2023 information acquired from listening to Ai's active ranging. The ToF between Ai and Aj, t Ai↔Aj , is considered known as the anchors are part of a fixed infrastructure, with known coordinates. Therefore t Ai↔Aj can be measured by ranging between the anchors or calculated theoretically. The values of the active anchor index are in the range of 1 ≤ i ≤ m and the index for passive anchors is 1 ≤ j ≤ n, where the total number of additional passive-only anchors is l = n − m, such that n ≥ m, meaning that the active anchors act as passive anchors while they are not actively transmitting.
The resulting ToF estimates are converted to range estimates via the expression d j|i = c · t T ↔Aj|Ai , where c is the wave velocity in the propagation medium. In this case, we assume the velocity to be the speed of light in vacuum c ≈ 3 · 10 8 m/s, as UWB is based on radio-frequency electromagnetic waves. Designating k as the temporal measure i.e. the ranging sequence number, we get the AP-TWR range estimate measurement matrix at time step k as T d,k : Previous studies [35], [36] have solely focused on evaluating the performance of the AP-TWR, based on the ranging Root-Mean-Square Error (RMSE). However, in this paper, we extend the evaluation to include the precision of position estimates as the primary consideration. Additionally, a novel position estimation algorithm based on the EKF is proposed, aiming to further enhance the performance. The specific contributions of this paper were explained in more detail in Section I.

III. PROPOSED METHOD
This section provides the theoretical background and formulation of the proposed AP-TWR-based Adaptive Extended Kalman Filter (A-EKF) positioning system. The following subsections present the essential information about the effects of NLoS on AP-TWR range estimates, the mechanisms for penalizing the inputs based on the distance and the intermittency of the range estimates, and finally the theory and the algorithm formulation of the proposed method.

A. EFFECT OF NLoS TO AP-TWR ESTIMATES
In order to quantify the effect of NLoS on AP-TWR estimates, (1) is analytically observed when arbitrary NLoS one-way bias factors β are introduced into the equations, depending on the severity of the NLoS case. Noting that for the formulation of this specific AP-TWR NLoS analysis, all other sources of errors are omitted. Table 1 presents the seven cases of errors possible for the trio of T, Ai, and Aj. The different NLoS propagation paths are viewed as separate cases between the tag and active anchor (T ↔ Ai), the tag and the passive anchor (T ↔ Aj), the active and passive anchors (Ai ↔ Aj), and all possible combinations thereof. Each case introduces a specific set of bias factors β to the propagation times t T ↔Ai , t T ↔Aj , and t Ai↔Aj .
In the context of Table 1, the variables with the hat (·) are affected by the NLoS bias, whereas the equivalent variables without the hat (·) are the true values, unaffected by the bias. The fourth column presents the NLoS-affected term(s) of Eq. (1), referenced to Fig. 1. The final two columns present the net effect of NLoS on the active and passive range estimates of AP-TWR, respectively.
The results of Table 1 show that in Cases 1, 4, 6, and 7, the active range estimate is additively impaired by a factor β T ↔Ai due to the existing NLoS path between T and Ai. Interestingly, the passive range estimates are unaffected by the NLoS between T and Ai, as its bias term cancels out in the calculation of the passive range estimates.
On the other hand, the passive range estimates are similarly affected by NLoS in pairwise Cases 2 & 4, 3 & 6, and 5 & 7. Noting that an obstruction between Ai and Aj (Cases 3, 5, 6, 7) causes a negative β Ai↔Aj NLoS term to emerge, which could translate to an altogether negative NLoS bias in the passive range estimates, as opposed to a strictly positive NLoS bias for standard active ranging protocols [37], [38].
The effects of NLoS presented in Table 1 align with the observed error cases for TDoA defined by Zandian and Witkowski in [39], while also expanding on it by adding the NLoS link between the active and passive anchor.
The presence of variable NLoS biases in the AP-TWR estimates can be used to one's advantage, as the rows of (2) may contain estimates from many anchors with various propagation conditions between them and the tag. This translates into fluctuating range estimates in the rows of the measurement matrix, the measure of which can be expressed by the row variances σ 2 j|1:m,k corresponding to each time step k, expressed in matrix form: Previous research [36] has shown that taking the medians of the AP-TWR measurement matrix rows provides robust range estimates for positioning, therefore we denote the final range estimates of each time step k in matrix form as: where the tilde markers denote the mathematical operation of median across each row d 1|1:m,k . . . d n|1:m,k of (2). The values of (4) act as the input to the EKF position estimation.

B. DISTANCE PENALTY
Research has shown that the accuracy of position estimation may be impaired because the ranging error magnitude has a distance-dependent component [7], [21]. However, some results show that this relationship is not exactly linear [5]. As a way to give higher weights to shorter distances, we propose a parametric exponential scaling coefficient e s c ·d j|1:m,k , where the scaling constant is defined as s c = ln s m s d . It is calculated via user-set parameters s m and s d such that the exponential scaler provides a multiplier of s m at distance s d .
The resulting values corresponding to each distance are then expressed as the exponential scaling vector: which is used to modify the measurement noise vector in the AP-TWR A-EKF positioning scheme. The usage of the scaling vector is further explained in Section III-D.

C. INTERMITTENCY PENALTY
The UWB range estimates can be impaired by intermittent noise, multipath, and obstacles in the environment the system is operating in [40]. As a result of some or many of the aforementioned effects, the range estimates supplied by the UWB system might arrive intermittently.
To establish the intermittency penalty method, we hypothesize that the intermittent values are inherently less accurate, as the intermittent values show that the system works on the edge of its detection limit in the ranging process. We set forward two parameters, a positive integer l s and a non-negative real number l m , i.e., the time history length, and the intermittency multiplier, respectively.
Representing all the historical ranging values as sets on numbers with a cardinality of l s , corresponding to all anchors in the system A 1 , A 2 , . . . , A N at time step k, we get: The elements of the sets of time history values assume the value of 0 in the case where a specific anchor does not produce a range estimate at that time instance. So, at each time instance, we get the number of missing range estimates in the history window for each anchor: The resulting numbers of missing values are in turn used to calculate the total set of intermittency penalty multipliers for each anchor in the system, for each time step value k: Similar to (5), the intermittency penalty multiplier vector at time instance k is then formulated as: such that the values l i 1 ,k , l i 2 ,k , . . . , l i n ,k are elements of the subset of L k and i 1 , i 2 , . . . , i n are the indices of the subset elements, marking the specific anchors providing their corresponding range estimates at time instance k. Since only the intermittency penalty magnitude and not the input positioning data is dependent on time series history, no extra time-domain latency is introduced to the positioning process.

D. EXTENDED KALMAN FILTER
The literature encompasses a wide range of position estimation algorithms, spanning various Linear Least Squares (LLS), Nonlinear Least Squares (NLS), and multiple Bayesian Filter approaches, to name a few [41]. Among these methods, the EKF has demonstrated excellent performance in LoS scenarios while outperforming other methods in NLoS conditions, on par with the performance of the Unscented Kalman Filter (UKF) [42]. Furthermore, the EKF exhibits lower complexity, resulting in calculation times that are more than three times shorter than those of the UKF [39]. Considering these factors, the EKF was selected as the foundation for the method proposed in this paper.
Furthermore, in the scope of this paper, a single-model approach is utilized due to the absence of information regarding whether the tag is moving or stationary. However, incorporating sensors that provide additional information on the tag's movement/stationary state could enable adopting a multi-model approach. For instance, the switch to a zero-velocity model could be considered for cases where the tag is detected to be stationary [43].
Following previous works [21], [44], we expand the position, velocity, and acceleration model of EKF to three dimensions (3D). We do so by expressing the corresponding values at each time step as X k , and tying them with information from the previous time step k − 1 using the appropriate kinematics equations: where at time step k the coordinates, velocities, and acceleration values for each of the three axes are defined as x k y k z k , v x k v y k v z k , and a x k a y k a z k , respectively. The kinematics equations and sampling time T s are used to express the dependency of values at time step k from values at k − 1. The last terms of each row represent the position (T 3 s /6)w k−1 , velocity (T 2 s /2)w k−1 , and acceleration (T s · w k−1 ) noise of the model, respectively.
The process noise can be rewritten as a vector w k−1 = w x k−1 w y k−1 w z k−1 T with a covariance matrix Q k−1 = diag(σ 2 jx , σ 2 jy , σ 2 jz ). Therefore, the state vector (8) can be expressed as a series of matrix calculations, such that: where matrix A is the state transition matrix and is written as: and G represents the noise transition matrix as: The AP-TWR range estimates z j,k are placed in the observation/measurement vector Z k , which consists of the sum of the true distance vector D k = d 1,k d 2,k . . . d n,k T and the observation noise vector The latter of which has a covariance matrix of R k = diag(σ 2 d 1 ,k , σ 2 d 2 ,k , . . . , σ 2 d n ,k ): The vector D k can be rewritten in the form of circle equations, where the centers are defined by the anchor coordinates x j y j z j : Because the resulting equations are nonlinear, the first-order Taylor expansion is utilized for linearization, to produce the Jacobian matrix H k : such that the partial derivatives are calculated at each time step k as: (15c)

E. PROPOSED ADAPTIVE EKF METHOD
The proposed positioning method is described in the algorithm's pseudocode in Alg. 1, which consists of three distinct phases: AP-TWR ranging, EKF prediction, and EKF correction. The algorithm is also visualized as a flowchart in Fig. 2. As a first step, the EKF initial state and state covariance matrices need to be initialized; this part is described in more detail in Section IV. After initialization, the first phase is launched, where the AP-TWR measurement matrix is acquired. Since the coordinate is calculated for three axes, a minimum of four input range estimates is needed. Otherwise, the position estimation process is skipped for this time step.
When the number of columns of the measurement matrix is larger than one i.e., m > 1, the row medians (4) and variances (3) are calculated. In the other case, the measurement matrix is directly taken as the observation vector and an appropriately-sized row variance vector S k is constructed by repeating a default observation noise variance, σ 2 d . Then the distance and intermittency penalty vectors are calculated, and the observation covariance matrix R k is formed as a diagonal matrix composed of the Hadamard product of vectors S k , B k , and C k .
In the following phase, the state and its covariance matrices are predicted, noting that the predicted values are marked with a ''minus'' superscript. Finally, the Kalman gain is computed and used to correct the state estimate and covariance providing a position estimate for that time step.
We adopt the naming convention used in previous studies [45], [46] that refer to the Kalman Filter as adaptive when the covariance matrices Q and R are dynamically modified. Accordingly, we introduce our approach as the Active-Passive Two-Way Ranging Adaptive Extended Kalman Filter (AP-TWR A-EKF) positioning method.

IV. EXPERIMENTAL SETUP
This section provides an overview of the experiments to validate the proposed AP-TWR A-EKF positioning method.
The experiments were conducted using the AP-TWR protocol implemented in the Eliko UWB RTLS system [47], which is based on the Qorvo DW1000 UWB transceiver chip [8]. The true coordinates of the anchors' and tag's locations were surveyed using the Leica DISTO S910 laser distance meter, which provides three-dimensional coordinates [48].
The Eliko UWB RTLS was deployed in an industrial environment, at the premises of Krah Pipes OÜ [49] which specializes in producing large thermoplastic pipes. The factory premises were selected for conducting the experiments as they provide challenging conditions for the positioning system and the proposed method. These conditions include 1) restrictions on the placement of the anchors: most of the anchors have to be mounted near the ceiling, thus the tag is almost always positioned outside the 3D convex hull of ▷ Predict state 16:   20: returnX k , P k 21: end for  The factory environment of the experiments can be seen in Fig. 3 where the Leica Disto S910 is marked in cyan, the two visible anchors in red, and the tag in dark blue color. Additionally, an industrial crane is mounted on rails on the ceiling, but it cannot be seen clearly: only the hook block of the crane is visible in the upper center part of the photo. The Leica DISTO S910 was installed on a concrete mezzanine floor, with a height of about 4.5 meters from the ground floor, such that it could provide the tag and anchor's true location across the whole area. The locations of the anchors, measured with the Leica DISTO S910, are given in Table 2.
The first set of tests was conducted with a stationary tag, mounted on a tripod, at 30 separate test points across the factory. The locations of the test points (TP), anchors (A), and the Leica DISTO S910 can be seen in Fig. 4. At each of the 30 test points the AP-TWR range estimates were captured for 30 seconds, using a tag with an update rate of 10 Hz, providing data from approximately 300 ranging sequences.
The second set of experiments was conducted to validate the results of the stationary tests. The experiment was performed with a moving tag which was mounted on a tripod, attached to a shelf trolley. The tag was moved throughout the factory with reference to the printed lines on the floor, where the critical points, i.e. turning points, are previously surveyed to provide a reference true track. The shelf trolley and the reference lines are also visible in Fig. 3. The data was captured throughout the movement process for 99 seconds, resulting in data of 990 separate ranging sequences.
The parameter values of the AP-TWR A-EKF used in the experiments are given in Table 3. The Eliko UWB RTLS was configured such that the maximum number of active anchors m max of AP-TWR protocol is 6. Although the intermittency and distance penalty parameters were chosen heuristically, it is likely that the chosen values are sub-optimal, not providing the best achievable positioning performance for the proposed method. Finding the optimal parameter values could be considered in future work.
The default observation noise variance σ 2 d and the process noise covariance values of Q k−1 are inferred from [21]. The sampling time T s was extracted from the tag's internal clock during each ranging sequence.
The very first step of the EKF process requires initializing the values of the initial state vector X 0 and the state covariance matrix P 0 . The initial coordinates x 0 y 0 z 0 of the state vector are given as the true coordinate measured by the DISTO S910 for all of the tested EKF variants, which are discussed in the following paragraphs. This is done to give all the methods the same initial conditions and to eliminate the additional errors from converging to the correct location when the initial position is set to the coordinate origin, for example. The initial speed and acceleration values for each axis are set to zero. The initial state covariance matrix P 0 is set as a 9-by-9 identity matrix, corresponding to the size of the state vector.
The proposed A-EKF positioning method is compared to the baseline EKF methods, accordingly using standard AP-TWR range estimates (4) and SS-TWR active-only range estimates as input. The same exact dataset is utilized for all of the compared methods, as both the SS-TWR and AP-TWR range estimates are inherently present in it, making the results of different methods directly comparable. The initial state, initial covariance, and Q k−1 matrix values are the same as stated in Table 3, whereas the diagonal of the appropriatelysized R k matrix is filled with the default variance σ 2 d values. The data acquisition was performed via a custom Python script that interfaces with the Eliko UWB RTLS server, extracts the required UWB range estimate packets, and saves them to a text file. Then a custom script written in R was used to parse and process the data, as well as to calculate the range estimates and the metrics for all three methods. Although this specific implementation provides the results by post-processing the range estimates, the proposed system is able to work in real-time applications.
The comprehensive dataset with supplemental materials and detailed explanations is uploaded to the IEEE Dataport repository and can be found in [50].

V. RESULTS
This section provides the results of the stationary and moving experiments and the analysis thereof.

A. STATIONARY TESTS
The results of the stationary experiments are given in Fig. 5, where the 2D and 3D Root-Mean-Square-Error (RMSE) of the SS-TWR, standard AP-TWR EKF, and the proposed A-EKF positioning methods are given across all of the 30 test points.  Firstly, focusing on the 2D results, it can be seen that for most cases all of the tested methods provide comparable performance at approximately 0.15 m RMSE. The SS-TWR EKF shows a more uniform performance across the test points, with an exception at TP 1 and TP 8 , where the 2D RMSE is significantly higher than usual, obtaining values of 0.49 m and 1.97 m, respectively. The higher RMSE of TP 8 is a result of the blocking of the LoS of the tag and A 1 , A 6 due to large pipe mandrels made of metal, visible in the upper-left side of Fig. 3, while in TP 1 , the direct propagation path to anchor A 7 is obstructed by the mezzanine floor.
The differences for the standard AP-TWR EKF are more diverse, as in test points 1,3,5,8,9, and 29 the 2D RMSE obtains significantly higher values than normal, ranging from  Table 1 suggests that AP-TWR range estimates are impaired because of the compound NLoS effects of different propagation paths encountered during each ranging sequence. The effects could be a result of a combination of the aforementioned pipe mandrels, the overhead crane blocking propagation paths between anchors, all of the assets in the factory, etc.
As both, the standard AP-TWR and SS-TWR, methods do not provide the EKF with any additional information on the measurement noise that may be present, the input distances are treated as equal and the distances with larger error contribute to an increase in the positioning error.
The proposed AP-TWR A-EKF positioning method, on the other hand, is robust against the adverse propagation conditions present in the industrial environment. The proposed method typically performs at a similar or lower error level than the baseline methods, whereas the largest differences come into play at the previously mentioned high error test points of the baselines. The following analysis gives an overview of the behavior of A-EKF compared to other methods in the most significant test points.
At the high-error test points 1, 3,5,8,9, and 29 of AP-TWR, the proposed A-EKF method reduces the RMSE respectively by 0.387, 4.902, 2.370, 1.617, 0.904, and 0.501 m, providing a large reduction in the absolute values of errors in every one of the high error test points. One minor drawback can be identified at test point 25, where the proposed method provides slightly lower performance than the baseline AP-TWR, with according RMSE of 0.445 m and 0.220 m. In terms of 2D RMSE, the proposed method performs better than AP-TWR in 18 of the 30 test points.
Comparing the proposed method to the SS-TWR in terms of 2D RMSE, it can be observed that the errors at TP 1 and TP 8 are reduced by 0.343 m and 1.863 m, correspondingly. Even though the proposed method provides slightly higher 2D errors at TP 5 and TP 25 , the opposite is true for the 3D case where the A-EKF provides slightly better RMSE performance than SS-TWR. In conclusion, the proposed method provides a lower RMSE than SS-TWR at 17 of the 30 test points.
Although the test points show rather similar trends in the 3D RMSE, we see that in typical cases not involving the large error test points, the proposed method alongside the AP-TWR consistently provides about 0.4 m lower RMSE.
All of the high error test points 1, 3, 5, 8, 9, and 29 of AP-TWR are again subsequently reduced by 0.597, 4.890, 2.378, 5.117, 1.565, and 0.340 m using the proposed method. Comparing the 3D results, it is evident that the proposed A-EKF method provides a reduction in RMSE at half of the test points when compared to AP-TWR, including the FIGURE 6. The movement paths of the second set of tests. The upper figure displays the tested methods' x and y coordinates, while the lower figure displays the z-coordinate across the ranging sequences. The critical points of the true movement path are marked with consecutive purple dots noted as MP on the respective figures. Note that on the z-coordinate plot, the movement path critical points are marked approximately in regards to the sequence number, as the shelf trolley needed to be stopped and its direction adjusted for the next segment of the movement.
previously mentioned points where the error magnitude was reduced significantly.
Similarly, the high error points 8 and 14 of SS-TWR are also mitigated by the proposed method, which reduces 3D RMSE by 5.074 and 0.763 m, correspondingly. Moreover, the A-EKF outperformed the SS-TWR positioning in 29 out of the 30 test points, providing moderately higher RMSE at only TP 9 .
On average, the tested methods achieved the following RMSE in 2D positioning: AP-TWR 0.492 m, SS-TWR 0.238 m, and A-EKF 0.149 m, meaning that the proposed method achieved almost 1.6 times better performance in 2D as the next best method, the SS-TWR. The 3D results showed the average RMSE of the methods to be AP-TWR 0.693 m, SS-TWR 0.765 m, and A-EKF 0.224 m, showing that the proposed method achieved over 3 times lower RMSE than the next best method i.e, AP-TWR.

B. MOVEMENT TESTS
The experiments with a moving tag were conducted to validate the results achieved by the stationary tests to show that the initialization of the methods does not affect the position estimates. Due to the inherent requirement of knowing the true coordinate of the tag at each time step, the calculation of objective error metrics becomes infeasible as the necessary devices to acquire an accurate time series reference track were unfortunately unavailable to the authors. As a consequence, the resulting analysis should be approached with caution as it solely presents the visual movement paths of the tested methods without calculating objective performance parameters in regards to the true movement track. Fig. 6 presents the results of the movement tests, which were described in detail in Section IV. Noting that although the x-y coordinate plot is zoomed in for clarity such that A 2 is not visible, the anchor still took part in the experiments. To facilitate the presentation of the 3D data, it was partitioned into two distinct graphs: a two-dimensional representation depicting the x-y plane of the factory floor, and a depiction of the z-coordinate variation corresponding to the ranging sequence number.
The previously surveyed critical movement points are marked with numbered purple dots (MP), connected by purple lines to indicate the true track of the movement. The approximate locations of arrival at the critical points are marked with corresponding purple dots in the z-coordinate graph. The locations on the z-coordinate figure are approximate because at each critical point, the shelf trolley was stopped to re-position it for the next section of the movement, so parts of the plots also correspond to brief stationary moments during the movement.
The movement traces in Fig. 6 support the results achieved in the stationary test, where the proposed A-EKF and the standard AP-TWR method consistently provide more accurate results in the z-axis, as was evident in the 3D RMSE graphs in Fig. 5.
In the first segment of the movement, all of the methods show slightly higher deviation from the true track, especially in the z-axis. This increased noise can be explained by the presence of the mezzanine floor on the right side, since in the first segment the tag is moved in parallel and almost under the mezzanine floor, obstructing the LoS paths to anchors 2, 5, and 7.
The next 3 movement segments show rather similar performance for all of the methods, keeping in mind that the SS-TWR method consistently shows about 0.5 m lower z-coordinate value compared to the true track, than other methods.
The final movement segment is impaired by the same pipe mandrels discussed in the previous section, as can be seen by the large deviations from the true track of the SS-TWR and AP-TWR methods. These fluctuations achieve a maximum of about 4.5 m in the x-y plane and about 1 m in the z-axis, whereas the proposed A-EKF positioning method deviates by a maximum of 0.5 m in both the x-y plane and the z-axis, reducing the maximum errors by about 9 times.

VI. CONCLUSION
This paper presented a comprehensive overview and analysis of the possible NLoS error cases that may be encountered with the usage of the UWB AP-TWR protocol. This analysis was the basis for the proposed A-EKF method, which was experimentally tested in an industrial environment and benchmarked against EKF position estimators based on active-only SS-TWR and standard AP-TWR range estimates. The proposed method can be used in real-time applications and does not require any additional information on the environment, signal properties, error models, statistics, or training data, or cause any additional time delays in the position estimation process.
Although in 2D the tested methods typically operated with the same performance, a part of the test points provided unfavorable propagation conditions for the UWB system, inducing large errors for standard AP-TWR (maximum about 5 m error) and SS-TWR (maximum about 2 m error), which the proposed A-EKF method mitigated, reducing errors with a maximal of less than 0.5 m. On average, the A-EKF provided almost 1.6 times lower RMSE that the next best i.e., the SS-TWR positioning method.
Similar trends were apparent in the 3D RMSE results as well, with the exception that the SS-TWR method provided consistently about 0.4 m inferior results than the other methods. The large errors of some test points are also present in the 3D results, with a maximum of about 5.4 m for both the SS-TWR and AP-TWR methods, while the A-EKF provided a maximum error of only 0.9 m. Across all of the test points, the average RMSE of the proposed method was more than 3 times lower than the next method, AP-TWR.
The movement tests confirmed the validity of A-EKF stationary tests by showing that the largest errors of AP-TWR and SS-TWR, caused by the presence of various assets in the factory, are reduced ninefold. Both sets of experiments showed the robustness of the proposed A-EKF positioning method with its ability to drastically reduce large errors caused by the propagation conditions.
While the current study has demonstrated the effectiveness of the A-EKF method, further investigation is warranted to identify and determine the optimal parameters for this approach. In-depth analyses and experimentations should be conducted to explore the impact of different parameter configurations on the method's performance, accuracy, and robustness. This exploration will contribute to refining the A-EKF algorithm.
The current paper has presented an overview of AP-TWR NLoS error cases. However, a more comprehensive and detailed analysis is required to identify and characterize specific NLoS error scenarios. In-depth investigations should be conducted to explore the possibilities of developing strategies to detect and mitigate these specific NLoS cases effectively. This analysis should encompass a broader range of environmental conditions, and diverse deployment scenarios to enhance the understanding and mitigation of AP-TWR NLoS errors.