At present, people’s demand for precise positioning technology is becoming more and more urgent. For example, many applications such as smart agriculture  , smart robot  , environmental monitoring  , require accurate location information of the target node. The UWB (Ultra wideband) positioning system    transmits data by sending narrow pulses at the nanosecond level, which can provide centimeter-level ranging accuracy. At the same time, the genetic algorithm      has become a common method due to its high solution accuracy, fast convergence speed, and strong robustness among the positioning algorithms. In view of this, the combination of the UWB ranging technology and the genetic algorithm positioning can improve the accuracy of positioning. Thus, this paper proposes a UWB positioning system based on the genetic algorithm. The system preprocesses the measurement data of TOA (time of arrival), and uses a genetic positioning algorithm to estimate the target position, which can obtain a good precise positioning effect.
2. UWB Positioning System Description
The positioning system takes STM32F103C8T6 as the main control. The control program is written into the hardware to control the sending and receiving of data through Keil5 software. The hardware uses TTL serial port to connect to the upper computer, and the upper computer displays specific data information through the software written in VS2012. As shown in Figure 1, both the unknown tag and the base station use the same hardware structure , whose different functions are defined by the software. The hardware contains the DW1000 UWB chip, which is a positioning chip based on the IEEE802.15.4a standard. The system obtains the measured distance from the unknown tag to different base stations, and estimates the location of the unknown tag through the genetic algorithm.
3. Bilateral Ranging Algorithm
The UWB positioning system uses a bilateral ranging algorithm based on the TOA technology    , and obtains the distance between the nodes by measuring the propagation time of the UWB signal. The bilateral method  adds a communication on the basis of the unilateral ranging method. Thus, the time used for two communications can reduce the impact of the error introduced by the clock offset on the ranging. Device A and device B are two devices with DW1000 modules, as shown in Figure 2. Device A firstly initiates a ranging
Figure 1. Photograph of physical hardware.
Figure 2. Principle diagram of bilateral ranging.
request, and Device B sends back a response after receiving the request. After receiving the response, Device A sends a second ranging request, and Device B receives this request and completes a ranging process.
When the device processes data each time, it records the timestamp of the current processing. In this way, the transmission time difference can be obtained through the relationship of the timestamp:
Thus, the measured distance is equal to the transmission time multiplied by the speed of light c. The error introduced by the bilateral ranging method：
where represents the ratio of the actual frequency and the expected frequency of device A’s clock, and represents the ratio of the actual frequency and the expected frequency of device B’s clock. Assuming that the clock accuracy of device B or device A is 10 parts per million, , , the distance between the devices is 100 m. Thus, the error is seconds, and the corresponding ranging error is 1.1 mm, which is completely negligible. Therefore, the bilateral ranging method is widely used. Using the above ranging algorithm, the ranging information can be obtained for positioning.
4. Location Process Based on Genetic Algorithm
This system obtains the distance data of the unknown tag to different base stations through the UWB ranging technology, and uses software to preprocess the distance data. According to the preprocessed distance data, a positioning equation set can be established:
where denotes the k-th base station’s position; and denote the measured distance and actual distance between the k-th base station and the unknown tag respectively; denotes the ranging error. Finally, the genetic algorithm is used to solve the positioning equation, and the precise position of the unknown label is given. The specific positioning process is as follows:
Step 1. Preprocess the distance data.
As shown in Figure 3 (a) is measured data at 12.35 meters; (b) is measured data at 11.01 meters; (c) is measured data at 6 meters, the measured distance data fluctuates little. Therefore, simple averaging can be used for preprocessing.
Step 2. Initial population.
Suppose the population size is N, and the generation group is , where is the n-th individual in the g-th generation population, , .
Figure 3. Measuring distance data.
Step 3. Calculate fitness value.
The fitness value is used to evaluate the quality of an individual. The smaller the fitness value, the better the individual, and the larger the fitness value, the worse the individual. According to Formula (3), the fitness function value is defined as
Step 4. Selection.
The selection operator is applied to the group. The selection operation uses a roulette operator, which is realized by accumulating the probability.
Step 5. Crossover.
The crossover operator is applied to the group, and the two selected individuals are generated according to the single-point crossover method.
Step 6. Variation.
The mutation operator is applied to the group, and the selected individual generates a new individual through the basic position mutation method.
Step 7. The next generation group is obtained, after the group g undergoes selection, crossover, and mutation operations.
Step 8. Repeat steps 3 to 6 until the maximum evolution number is reached, and the final result is the estimated location of the unknown tag. Figure 4 shows the flow chart of the positioning process.
5. Experimental Results and Analysis
The actual measurement environment of UWB positioning system based on the genetic algorithm is shown in Figure 5. is the position of the unknown tag. The locations of the four base stations are A (0, 0), B (0, 12), C (12, 12), D (12, 0). The main base station A uniformly processes the measurement information from other base stations, and transmits the information to the upper computer PC through the USB data cable. The parameters of the genetic algorithm are shown in Table 1.
The root mean square error (RMS) of positioning is defined as:
Table 1. The parameters of the genetic algorithm.
Figure 4. Positioning flowchart.
Figure 5. Actual measurement environment.
where is the estimated location of the unknown tag. During the test, the unknown tag is placed in different positions. The different estimated positions and the corresponding RMS errors are shown in Table 2. The estimated coordinates of the root mean and different positions square error of positioning are shown in Table 2. It can be seen from this table that the measured positioning accuracy is within 30 cm.
Table 2. Location statistics of some target tags.
This paper designs a UWB positioning system that is based on genetic algorithm, which can solve the precise position of the unknown tag. The positioning experiment test shows that the positioning accuracy of the system is within 30 cm, which can well meet the positioning requirements. However, the system only considers the situation under the line-of-sight environment, and the situation under the non-line-of-sight environment needs further study.
 Chen, K., Li, Z., Ma, L. and Tang, Y. (2020) Intelligent Agriculture—Agricultural Monitoring and Control Management System. In: Xu, Z., Parizi, R., Hammoudeh, M. and Loyola-González, O., Eds., Cyber Security Intelligence and Analytics, CSIA 2020, Advances in Intelligent Systems and Computing, Vol. 1146, Springer, Cham, 317-325.
 Anitha, D., Shelke, V.D., Anupama, C.G., et al. (2020) Intelligent Wireless Sensor Networks for Precision Agriculture. In: Artificial Intelligence and Evolutionary Computations in Engineering Systems, Springer, Singapore, 167-181.
 Zhang, J., Liu, R., Yin, K., et al. (2018) Intelligent Collaborative Localization among Air-Ground Robots for Industrial Environment Perception. IEEE Transactions on Industrial Electronics, 66, 9673-9681.
 Zhang, H., Chen, N. and Fan, G. (2019) An Improved Localization Algorithm for Intelligent Robot. 2019 IEEE 12th International Congress on Image and Signal Processing, Bio-Medical Engineering and Informatics (CISP-BMEI), Huaqiao, 19-21 October 2019, 1-5.
 Corro, H., Robles, E., Merchan, F., et al. (2019) Design and Implementation of a Lo-Ra-Based IoT Network for Environmental Parameters Monitoring. 2019 IEEE 7th International Engineering, Sciences and Technology Conference (IESTEC), Panama City, 9-11 October 2019, 596-600.
 Safia, A.A., Al Aghbari, Z. and Kamel, I. (2019) Distributed Environmental Event Monitoring Using Mobile Wireless Sensor Network. Procedia Computer Science, 155, 335-342.
 Luo, J. and Gao, H. (2016) Deep Belief Networks for Fingerprinting Indoor Localization Using Ultra Wideband Technology. International Journal of Distributed Sensor Networks, 12, Article ID: 5840916.
 Güler, S., Abdelkader, M. and Shamma, J.S. (2019) Infrastructure-Free Multi-Robot Localization with Ultra-Wideband Sensors. 2019 IEEE American Control Conference (ACC), Philadelphia, 10-12 July 2019, 13-18.
 Ji, Y., Hejselbæk, J., Fan, W., et al. (2018) A Map-Free Indoor Localization Method Using Ultra Wideband Large-Scale Array Systems. IEEE Antennas and Wireless Propagation Letters, 17, 1682-1686.
 Sackey, S.H., Chen, J., Henry, A.J., et al. (2019) A Clustering Approach Based on Genetic Algorithm for Wireless Sensor Network Localization. 2019 IEEE 15th International Conference on Computational Intelligence and Security (CIS), Macao, 13-16 December 2019, 54-58.
 Ren, Q., Zhang, Y., Nikolaidis, I., et al. (2020) RSSI Quantization and Genetic Algorithm Based Localization in Wireless Sensor Networks. Ad Hoc Networks, 107, Article ID: 102255.
 Kanwar, V. and Kumar, A. (2020) DV-Hop Based Localization Methods for Additionally Deployed Nodes in Wireless Sensor Network Using Genetic Algorithm. Journal of Ambient Intelligence and Humanized Computing, 11, 5513-5531.
 Sharma, G. and Kumar, A. (2018) Improved Range-Free Localization for Three-Dimensional Wireless Sensor Networks Using Genetic Algorithm. Computers & Electrical Engineering, 72, 808-827.
 Li, J., Cui, X., Song, H., et al. (2017) Threshold Selection Method for UWB TOA Estimation Based on Wavelet Decomposition and Kurtosis Analysis. EURASIP Journal on Wireless Communications and Networking, 2017, Article No. 202.
 Xie, Y., Janssen, G.J.M., Shakeri, S., et al. (2017) UWB Pulse Detection and TOA Estimation Using GLRT. EURASIP Journal on Advances in Signal Processing, 2017, 1-12.
 Yang, Z. (2018) TOA Estimation Algorithm Based on Noncoherent Detection in IR-UWB System. Wireless Algorithms, Systems, and Applications: 13th International Conference, WASA 2018, Tianjin, 20-22 June 2018, Vol. 10874, 201.
 Choi, B., La, K. and Lee, S. (2018) UWB TDOA/TOA Measurement System with Wireless Time Synchronization and Simultaneous Tag and Anchor Positioning. 2018 IEEE International Conference on Computational Intelligence and Virtual Environments for Measurement Systems and Applications (CIVEMSA), Ottawa, 12-14 June 2018, 1-6.