# UWB Positioning Algorithm Based on Fuzzy Inference and Adaptive Anti-NLOS Kalman Filtering
## 2 A Ranging Error Mitigation Algorithm for CIR Signal Characteristics Based on Fuzzy Inference
### Implementation of the Fuzzy Inference System
#### 2.2.2 Determination of Fuzzy Sets and Fuzzy Rules  
In the present study, the commonly used indoor objects, such as iron plates, wooden boards and the human body, were used as the obstacles to construct the fuzzy sets and fuzzy rules for the CIR signal characteristics of UWB and the NLOS errors. The experimental scene of the testing environment is depicted in Figure 2. The experimental processes to establish the relationship between the CIR signal characteristics of UWB and the ranging errors in an NLOS environment are set as follows: (1) The base station node was fixed at a specific position, and the tag node was placed 0.5 m away from the base station; (2) An obstacle was placed 10 cm away from the base station node to collect the signal characteristic data 500 times; (3) The distance between the obstacle and the base station node was increased by 20 cm after each measurement of a group of data, followed by 500 times of signal characteristic data collection; (4) The obstacle was moved in the above-mentioned method until it could not be placed between the tag node and the base station node; (5) The distance between the tag node and the base station node was increased by 0.5 m, and the previous procedures were repeated until this distance reached 3 m.  
Figure 1: Structure of the fuzzy system for mitigating ranging errors based on the Mamdani model.  
The experimental scene for exploring the relationship between the CIR signal characteristics of UWB and the ranging errors in the LOS environment was basically consistent with that in the NLOS environment, except that the former had no obstacles in the middle. The experimental processes are set below: (1) The base station node was fixed at a specific position, while the tag node was placed 0.5 m away from it, and the signal characteristic data were collected 500 times at this position; (2) The position of the tag node was changed to increase the distance by 0.5 m, the corresponding testing was conducted, and data were recorded; (3) The previous operation was repeated until the distance between the tag node and the base station node reached 3 m.  
Based on the analysis of the obtained experimental data, the input signal characteristic RSSI was grouped into five fuzzy sets in this study, represented by \"very large\", \"large\", \"medium\", \"small\" and \"very small\". The input signal characteristic FPPL was classified into six fuzzy sets indicated by \"very large\", \"large\", \"medium\", \"small\", \"very small\" and \"extremely small\". The input signal characteristic RT was assigned into five fuzzy sets expressed by \"extremely small\", \"very small\", \"small\", \"medium\" and \"large\". Moreover, the output NLOS error was divided into five fuzzy sets presented as \"very small\", \"small\", \"medium\", \"large\" and \"very large\". In this paper, a total of 25 fuzzy rules were formulated according to the collected data of the CIR signal characteristics RSSI, FPPL and RT of UWB and the NLOS errors, as well as the established fuzzy sets, as shown in Table 1.  
\begin{table}
\begin{tabular}{c c c c c} \hline  & **RSSI** & **FPPL** & **RT** & **Range Error** \\ \hline
1 & very large & very large & extremely small & very small \\ \hline
2 & very large & very large & very small & very small \\ \hline
3 & very large & large & extremely small & very small \\ \hline
4 & very large & large & very small & very small \\ \hline
5 & very large & medium & extremely small & small \\ \hline
6 & very large & small & large & small \\ \hline
7 & large & very large & extremely small & small \\ \hline \end{tabular}
\end{table}
Table 1: The fuzzy rules based on RSSI, FPPL and RT of UWB.  
Figure 2: Specific testing environment.