# Combining Dilution of Precision and Kalman Filtering for UWB Positioning in a Narrow Space
## 2 Methods
### Positioning Algorithm and DOP Numerical Distribution Model  
Suppose that there are \(m\) positioning base stations in the two-dimensional space and their coordinates are \(\theta_{i}=\left[x_{i},y_{i}\right]^{T}\), \(i=1,2,3\ldots\). There are certain tags (the positions are unknown) to be tested in the space, and their coordinates are \(\theta=\left[x,y\right]^{T}\). Through TOA measurement, the measurement distance from the tag to the \(i\)th base station can be obtained. Therefore, the TOA measurement model can be expressed as follows [38]:  
\[d_{i}=\|\theta-\theta_{i}\|_{2}+\varepsilon_{i},i=1,2,3,\ldots,m \tag{1}\]  
where \(d_{i}\) represents the distance between the \(i\)th base station and the tag; \(\varepsilon_{i}\) represents the ranging error of TOA. When calculating the coordinates of the tag, the coordinates of the positioning base station and the measurement distance are known. Therefore, the tag position can be solved by the following mathematical model:  
\[\left\{\begin{array}{c}\left(x_{1}-x\right)^{2}+\left(y_{1}-y\right)^{2}=d_ {1}^{2}\\ \left(x_{2}-x\right)^{2}+\left(y_{2}-y\right)^{2}=d_{2}^{2}\\ \cdot\\ \cdot\\ \cdot\\ \left(x_{m}-x\right)^{2}+\left(y_{m}-y\right)^{2}=d_{m}^{2}\end{array}\right. \tag{2}\]  
Equation (2) can be transformed into the matrix form: AX = B, which can be solved using the least square (LS) method [39]:  
\[X=\left(A^{T}A\right)^{-1}(A^{T}B). \tag{3}\]  
In general, the coordinate information of the tag is calculated by the LS method. However, the LS method is based on the assumption that the ranging error has a constant variance. In the actual measurement, the ranging error is changing [40]. At this time, the WLS method can be used to solve the above problems. This method mainly introduces a weighted matrix to multiply the ranging error of a single range by the estimated range to obtain more reliable results. The positive definite weighted matrix \(W\) with diagonal \(m\) is as follows:  
\[W=\begin{bmatrix}w_{1}&0&\cdots&0\\ 0&w_{2}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&\cdots&0&w_{m}\end{bmatrix}. \tag{4}\]  
In Equation (4), the element \(w_{i}\) in the positive definite weighted matrix \(W\) can be calculated by measuring the reciprocal of the product of distance and ranging error \(\varepsilon_{i}^{2}\)[41]. At this point, the estimated position of the tag can be expressed in the WLS estimator:  
\[X=\left(A^{T}WA\right)^{-1}(A^{T}WB). \tag{5}\]  
Its covariance matrix can be expressed as:  
\[Q=\left(A^{T}WA\right)^{-1}=\begin{bmatrix}q_{11}&q_{12}&q_{13}\\ q_{21}&q_{22}&q_{23}\\ q_{31}&q_{32}&q_{33}\end{bmatrix}. \tag{6}\]  
In general, the horizontal dilution of precision (HDOP) and PDOP can be derived from the covariance matrix computed from the error equation [42]:  
\[HDOP=\sqrt{q_{11}+q_{22}}. \tag{7}\]\[PDOP=\sqrt{q_{11}+q_{22}+q_{33}}. \tag{8}\]  
From the above equations, it is not difficult to find that the HDOP and PDOP values are obtained by the LS estimation, and their values reflect the possible accuracy of UWB measurement positioning. The size of the PDOP values is positively correlated with the error of the base station positioning. The larger the PDOP values, the greater the amplification of the ranging error by the positioning algorithm, and the lower the positioning accuracy of the system [18]. In order to improve the positioning accuracy when the PDOP values are far greater than the normal value, the positioning error can be reduced by combining the PDOP numerical analysis model with KF. In this study, we calculated the PDOP values by changing the location of the test node throughout the space.