Location of Moving Targets in Substation Non-Line-of-Sight Environment

In substations, a localization system based on a wireless sensor network (WSN) is a challenge, because the propagation of the measured signal could be blocked by various devices. In other words, non-line-of-sight (NLOS) propagation, where the signal propagation path is occluded, will affect measurement accuracy. A novel localization method based on a two-step weighted least squares and a probability distribution function is proposed to reduce the influence of NLOS error on the localization result. In this method, the initial multi-group localization result is obtained by the two-step weight weighted least-squares method, and the probability distribution function of the target is constructed by using the initial localization results, which can effectively reduce the influence of the NLOS error on the localization result. The simulation and test results show that the proposed method can keep the coordinate error within 30 cm in the substation. Compared with the localization result of two-step weighted least-squares (TSWLS) method, the average localization error is reduced by more than 1 m. Compared with the other two similar algorithms, the localization accuracy is improved by more than 50%. The tested results show that the localization performance of the method is robustness in the NLOS environment of the substation. While ensuring stability, the proposed algorithm is less efficient than some existing ones. However, under the calculation conditions of ordinary computers, the average single-point calculation time is less than 0.1 s, which can meet the needs of applications in substations.


Introduction
In power substations, power equipment is densely populated. Due to the high level of voltage, there are many high-risk working areas. Inadvertent entry of moving targets such as inspectors and equipment may result in loss of life and property [1,2]. Currently, there are no reliable technical means and measures to protect human life in power substations. The safety of substation staff is mainly reliant on the consciousness of the safety supervisors, which is time-consuming, laborious, and subjective. During commissioning and maintenance work of substations and transmission lines, it is often necessary to use tall vehicles, such as large cranes. When a work vehicle works near live equipment or under live transmission lines, personnel supervision is usually required to prevent the working vehicle from touching the line. As there may be personnel fatigue, or care may not be timely, and the safety risks are high. If the location of the moving target in a substation can be the algorithm will be affected. Therefore, KF-based localization algorithms and PF-based localization algorithms are usually applied to localization systems with multiple sensors for measurement, such as the localization of robots that integrate targets of various sensors. For mobile targets such as mobile workers or mobile vehicles in a substation, to facilitate carrying and controlling costs, only the distance-sensing tags are often carried. Therefore, it is necessary to study a localization algorithm that can achieve better robustness and accuracy under the condition that only distance measurement information can be achieved.
To improve the robustness and accuracy of the localization algorithm when using only ranging information, this paper proposes a new method based on probability distribution function. The method proposed in this paper does not need to identify the NLOS measurement, nor does it require a priori knowledge of the distribution or statistics of the NLOS errors. All it needs is the LOS measurement error distribution. The difference between this method and the probabilistic methods based on PF or KF is that the proposed method is to construct the error distribution function by using the excess distance sensor data in the localization system and the KF and PF algorithms are localization algorithms that establish the probability of object distribution based on the position and motion state information of the object. The proposed algorithm has almost no dependence on the motion state information, and can ensure accuracy and robustness in the localization system with only the distance sensor. On the other hand, in contrast to the existing localization methods that use the NLOS prior error distribution to correct the results, the localization algorithm proposed in this paper uses the measured data acquired in real time to construct the probability distribution function of the localization target in space, and then achieve the position estimation of the target. By grouping and initializing a large number of real-time ranging data, multiple possible coordinate points are obtained, and the error probability distribution function is constructed according to these points, which can effectively improve the robustness and accuracy of the algorithm, which is an important contribution of this paper.
The detailed procedure of the proposed algorithm can be summarized as follows. First, to make a brief screening of the base station to ensure the computational efficiency of the algorithm, a simple base station selection principle is proposed, which can improve the calculation speed of the algorithm while ensuring the localization accuracy. This is one of the important contributions of this article. Secondly, all the data that participate in the localization are grouped, and each group of data is used for initial localization. Finally, the probability distribution function of the target is constructed by using multiple sets of initial localization results, and the target coordinates are obtained. This method can effectively improve the robustness of the algorithm and reduce the influence of measurement error on the localization result. This is another important contribution of this paper. The localization performance of the proposed algorithm is examined by simulation and experiment. This paper is organized as follows. In Section 2, we formulate the localization model and method. In Section 3, the simulation is carried out, and the results are discussed. The field test and analysis are introduced in Section 4. Section 5 is the conclusion of this paper.

Time Difference of Arrival (TDOA) Localization Model
The time difference of arrival (TDOA) [30,31] is a method for target localization based on analysis of the time difference of signals associated with the target. To achieve spatial localization, at least the time difference between the target and 4 different localization base stations should be known. However, when there are only 4 base stations for localization, there is a great possibility of large errors. Therefore, in actual localization applications, it is often ensured that the number of base stations is more than four.
It is assumed that a base station of M (M > 4) with known positions is set in the three-dimensional space, and the coordinates of the i-th base station are expressed as S i = (x i ,y i ,z i ) T , i = 1, 2, . . . , M. The coordinates of the target are expressed as U = (x,y,z) T , and the distance from the target to the i-th base station can then be expressed as: 2 (1) The first base station S 1 is selected as the reference base station for TDOA localization, and the TDOA measurement value can be expressed as: in (2), τ i1 represents the time difference measurement value between the measurement target and the base station S i and S 1 , t i and t 1 are the time values at which the signal arrives at the base station S i and S 1 . ∆t i1 is the measurement error of time difference between S i and S 1 , and c is the speed at which electromagnetic waves propagate in a vacuum. By multiplying the two sides of (2) by the speed of light, the equation below can be obtained: in (3), r i1 = r i − r 1 is the distance between the measurement signals reaching the two base stations, and n i1 = c∆t i1 represents the measurement error of the difference in their distance to the base station. By combining (3) and (1), the localization equation can be obtained: where i = 2, 3, . . . , M. Without considering the NLOS error, it can be assumed that the measurement error n i1 in (4) obeys a normal distribution with a mean of 0 and a variance of σ. By solving the optimal estimate of (4), the coordinates of the location of the target can be located.

Initial Localization Method Based on Two-Step Weighted Least Squares
To obtain a more effective localization algorithm, Equation (4) is transformed into a linear equation, and then the optimal estimation is obtained by the two-step weighted least-squares (TSWLS) [6] method as the initial localization result.
And we can express Equation (6) in the form of a vector: Subtracting both sides of Equation (7) by r 1 2 , we can get: Sort out the two sides of Equation (8), we can get: Ignoring the quadratic term of the error term in Equation (9) and organize it into a matrix form: Equation (10) is linearized from a nonlinear equation to a linear equation. We can get the coordinates U of the target from ϕ. The least-squares (LS) method can be used to obtain the best estimate of ϕ : Here Ψ is the weighting matrix of Equation (11), Ψ = E (ηη T ) = c 2 BQB, where Q is a diagonal matrix with a diagonal element of 0.5σ 2 . It represents an error covariance matrix. Ψ is not known in practice as B contains the true distances between source and receivers. Further approximation is necessary to solve the problem. According to the fact that the difference between the two sides of the triangle is smaller than the third side, we know that r i −r 2 is less than the distance between the two sensors. The distance between the sensors is fixed. When the distance of the localization target distance sensor is greater than 20 times the distance between the sensors, the difference between any two r i will be less than 5% of the corresponding r i , and it can be seen that each r i is equal, so we can assume that B ≈ r 2 I, I is an identity matrix. Equation (11) can be approximated as: And then an estimated value of r 1 can be obtained by using Equation (12). After that we can use r 1 to calculate the estimated value of r i . From which matrix B can be obtained. Then matrix B can be substituted into Equation (11) to obtain the position estimation result.
When using (11) to estimate the position of the target, in a LOS condition, the root mean squared error (RMSE) of the localization result can be close to the Cramer-Rao bound [32], and the calculation is very simple. With the increase of the measured value, the two-step LS method can use the measurement data of the redundant base station to improve the localization accuracy. However, in the case of a large LOS measurement error or NLOS propagation, the localization accuracy of the two-step linear LS method cannot be guaranteed. Consequently, one must perform the initial solution of Equation (10). To achieve precise localization in the complex environment of substation, the results need to be further optimized based on the initial estimation. Here, a probability distribution function is introduced to further improve the position estimation.

Location Estimation Algorithm Based on Probability Distribution Function
In the substation environment, the propagation path of a measurement signal includes both the LOS path and the NLOS path. The measurement error under the LOS path is small, and is generally regarded as due to white noise obeying a normal distribution. The propagation error under the NLOS path is associated with the propagation environment. Without the propagation error, the aforementioned equations can be solved with a unique optimal solution. However, the LOS error and NLOS error existing in the measured value make it difficult for the numerical method to converge to the optimal solution when solving the equation. From a statistical point of view, the localization result obtained by the combination of the data with higher LOS measurement value is closer to the actual coordinate of the target, and the localization result is consistent and obeys the spatial normal distribution. Localization results that are more affected by the NLOS measurement data will deviate from the region and will not exhibit a regular distribution. Therefore, the concept of spatial probability distribution is introduced. Through the distribution of most of the localization results that are less affected by the NLOS measurement data, the target will have the smallest probability of error in space. Localization results with large errors will deviate from the region, do not have uniform regularity, and will not affect the probability distribution of the region.
Assuming that the number of base stations is N > 4, the number of measurement values that can be obtained is N − 1. In this paper, data combination refers to a data set containing some measurement data. Group all the measurement values, N − 1 measurement values can be expressed as C 4 N−1 which is a data combination containing 4 measured values. For each data combination, one set of localization results can be obtained. Due to the LOS error and the NLOS error, the localization results of each data combination are not the same, and there is an error among the calculated coordinates and the actual coordinates.
Reference [33] proposes that when the TDOA time difference measurement error is large, in the polar coordinate system, the directional angle information calculated by the localization algorithm is more accurate than the modular length information calculated by the localization algorithm. Therefore, after considering the localization result as a spatial straight line, the more accurate direction information can be used to obtain the final result.
We solve each data combination separately, and record the result coordinates (x pj , y pj , z pj ). At the same time, the geometric center of all the base stations in each data combination is recorded, its coordinates are expressed as (x Oj , y Oj , z Oj ). The two points of the known coordinates in the space form a straight line. Using the data combination initial localization result (x pj , y pj , z pj ) and the data combination geometric center (x Oj , y Oj , z Oj ), a space line can be established using (13).
The probability p j (θ,φ) of any point in the space is the unknown target satisfying (14), where σ θ and σ φ are the root mean square errors of the LOS measurement error after conversion to azimuth.
Equation (15) is the joint probability density of each direction vector, and the point with the smallest joint probability density in space is the target coordinate to be located.
In (15), θ and Φ respectively represent the direction angle of the standard point (x Oj , y Oj , z Oj ) of any point in the space and the corresponding data, as shown in (16): After calculating (15), the joint probability density of each point in space can be normalized according to Formula (17), and the probability distribution of the target in a certain region can be obtained. The larger the value of Formula (17), the greater the probability that the localization result exists in the space enclosed by the three-dimensional surface.
By using the error distribution range of the localization result, it is possible to locate more effectively, and to avoid unnecessary accidents caused by the deviation of the localization coordinates.
When passing the equation to the spatial probability density function of (14), it is necessary to know the root mean square error of the azimuth angle θ j and the pitch angle φ j due to the device measurement error under the LOS condition. It was obtained by experimental statistics in this paper. The experimental method is: (i) placing the localization tag at a known coordinate position of the substation; (ii) using the previous method to detect the tag at different positions of the substation; and (iii) using the two-step linear LS method to calculate the azimuth angle θ j , φ j . Finally, in (iv), using (18) to calculate the root mean square error, where n is the number of experiments and θ ave is the average of n experimental measurements θ j . A total of 50 experiments were performed.

Base Station Selection
The probability distribution-based localization method requires data from all the base stations to locate the target. When constructing the probability distribution function, the C 4 N−1 group data should be solved. Because of the increase of N, the calculation amount of the algorithm is multiplied. When N < 10, the number of data combinations does not exceed 100. Therefore, the upper limit of the number of base stations that participate in localization is set to 9.
There are two main principles for selecting a base station. The first is to select the base station which presents LOS propagation conditions. The second is to choose those base stations that are that are closer to the target after the consideration of the first principle.
Since the difference between the two sides of the triangle is smaller than the third side in length, the distance difference between the target of the two base stations is smaller than the distance between the two base stations. However, if there exists NLOS propagation when a localization signal reaches a certain base station, the time for the localization signal to reach the base station is greatly increased. Generally, the base station whose signal arrives at the earliest time is selected as the reference base station. The measured value d i1 of the distance difference between the i-th base station and the reference base station is obtained using Equations (2) and (3). The distance D i1 between the base stations can be calculated from the known base station coordinates. If d i1 ≥ D i1 , it can be determined that there is NLOS propagation between the target and the i-th base station. Therefore, the primary screening of all the base stations can remove the localization base stations that are greatly affected by the NLOS propagation.
After screening through the above steps, the remaining base stations can be used for localization. If the number of remaining base stations is still greater than 9, the 9 base stations with the earliest arrival time of the signal are selected to participate in the localization. When the number of remaining base stations is less than 4, the 3 base stations with the earliest signal arrival time are selected among the excluded base stations to participate in the localization.

Steps of the Localization Method
A novel localization method based on TSWLS and probability distribution function is adopted here. The specific flow chart of the proposed method is shown in Figure 1, which can be further elaborated as follows: Step 4: Initial Localization. According to Equation (11) and Equation (12), the position estimates of the different data combinations are obtained. The solution of the equations can be expressed as (xpj, ypj, zpj), and the space vector group is established by Equation (13).
Step 5: Using the probability distribution function to process the initial localization result. The spatial probability distribution model is established by Equations (14)- (17), and the point where the error probability in space is the smallest is set as the coordinate of the target to be located.

Begin
Obtaining a time difference measurement value of the target to be located reaching each base station Simple screening of base station plaques using the method mentioned in Section 2.4 Grouping the measurement value and obtained all data combinations (O1,O2…Oj…OU) containing 4 measurement values.
the number of base stations participating in the location is greater than 9?
Calculate the reference point (xOj, yOj, zOj) of each data combination YES NO Initial Localization according to equations (11) and (12) Calculate the space vector group by equation (13) Using the error probability function to process the initial localization result, obtained the result by using equation (14)- (17).

Simulation
To verify the localization performance of the proposed algorithm, this section carries out a simulation study on the 3 existing algorithms, namely the algorithm proposed in the paper, the TSWLS [6] algorithm, residual weighted (RWGH) [34] algorithm, and the residual test (RT) [17] algorithm. The two-step WLS algorithm uses the LS method to estimate the position of the target, and is generally used for localization under LOS conditions. The RWGH algorithm weights different results by the residual of the initial localization result to reduce the influence of the NLOS error. The Step 1: A coordinate system is established in the substation, and the localization base station is arranged at the designated position. Obtaining the time difference between the signal emanated from the target to be located and each base station Step 2: Screening the base station. When the number of base stations participating in the location of the target is greater than 9, the appropriate localization base station is selected by using the procedure described in Section 2.4. When the number of base stations is less than or equal to 9, all base stations are selected as the localization base station; Step 4: Initial Localization. According to Equation (11) and Equation (12), the position estimates of the different data combinations are obtained. The solution of the equations can be expressed as (x pj , y pj , z pj ), and the space vector group is established by Equation (13).
Step 5: Using the probability distribution function to process the initial localization result. The spatial probability distribution model is established by Equations (14)- (17), and the point where the error probability in space is the smallest is set as the coordinate of the target to be located.

Simulation
To verify the localization performance of the proposed algorithm, this section carries out a simulation study on the 3 existing algorithms, namely the algorithm proposed in the paper, the TSWLS [6] algorithm, residual weighted (RWGH) [34] algorithm, and the residual test (RT) [17] algorithm. The two-step WLS algorithm uses the LS method to estimate the position of the target, and is generally used for localization under LOS conditions. The RWGH algorithm weights different results by the residual of the initial localization result to reduce the influence of the NLOS error. The RT algorithm compares the calculated residual with a set threshold to identify the NLOS base station in the environment. Then, by removing the measurement data obtained by the NLOS base station, the purpose of improving the accuracy of the algorithm is achieved.
The simulation results are compared and analyzed to verify the superiority of the proposed algorithm.

Simulation Parameters
The simulation conditions are set as follows: The targets to be positioned were randomly RT algorithm compares the calculated residual with a set threshold to identify the NLOS base station in the environment. Then, by removing the measurement data obtained by the NLOS base station, the purpose of improving the accuracy of the algorithm is achieved. The simulation results are compared and analyzed to verify the superiority of the proposed algorithm.

Simulation Parameters
The simulation conditions are set as follows: The targets to be positioned were randomly distributed in a space area of 30 m × 30 m × 3 m. There were 8 base stations in the to-be-positioned area, and the coordinates were respectively as S1 = (15,  To verify the localization performance of the algorithm under different conditions, this section sets four different simulation conditions. The simulation conditions are set as shown in Table 1.  To verify the localization performance of the algorithm under different conditions, this section sets four different simulation conditions. The simulation conditions are set as shown in Table 1. Simulation 1 compared the performance of the algorithm with the LOS measurement error standard deviation in the absence of NLOS measurement error, which reflect the relationship between the performance of the algorithm and the performance of the localization sensor. Simulation 2 and Simulation 3 compared the performance of the four algorithms with the NLOS measurement error, and reflected the relationship between the performance of the algorithm and the propagation environment, respectively. Simulation 2 simulated the situation when the maximum possible error of NLOS changes, and simulation 3 simulated the situation when the number of NLOS base station changes. The evaluation index of the performance of the algorithm from Simulation 1 to Simulation 3 was the RMSE of the position estimate and the true value. Simulation 4 further tested the performance of several algorithms. The cumulative distribution function (CDF) was chosen to compare these four algorithms. Figure 3 shows the relationship between the performance of the algorithm and the standard deviation σ of the LOS measurement error without NLOS measurement error. It can be seen from the figure that the localization performance of each algorithm is similar when the measurement error is small. However, when the standard deviation σ is high and the localization sensor performance is poor, the root mean square error of the localization algorithm proposed in this paper is significantly smaller than other algorithms, and it has better localization stability.  Figure 3 shows the relationship between the performance of the algorithm and the standard deviation σ of the LOS measurement error without NLOS measurement error. It can be seen from the figure that the localization performance of each algorithm is similar when the measurement error is small. However, when the standard deviation σ is high and the localization sensor performance is poor, the root mean square error of the localization algorithm proposed in this paper is significantly smaller than other algorithms, and it has better localization stability.    can reduce the influence of NLOS signal on the localization result in this mixed propagation environment. When the NLOS error is large, the proposed algorithm has better localization performance.   Figure 4 shows the error curve of the algorithms with their performances as a function of NLOS measurement error when several other conditions are the same. It can be seen from the figure that the TSWLS algorithm failed to maintain a good localization performance in the LOS/NLOS mixed propagation environment, while the RWGH algorithm, the RT algorithm and the proposed algorithm can reduce the influence of NLOS signal on the localization result in this mixed propagation environment. When the NLOS error is large, the proposed algorithm has better localization performance. Figure 5 shows the relationship between algorithm performance and the number of NLOS base stations. It can be seen from the figure that as the number of NLOS base stations increased, the  localization performance of all algorithms decreased. The localization algorithm based on residual identification sharply declined in localization performance when half of the base stations were changed to NLOS ones. The proposed algorithm maintained high localization accuracy when there were large proportion of NLOS base stations. Figure 6 compares the CDF curves of four algorithms when σ is 0.2 m, where there were 2 NLOS base stations, and the maximum possible error of NLOS was 3 m. According to the results in the figure, it can be seen that the algorithm error proposed in this paper is significantly smaller than other algorithms. In addition, the proposed algorithm is smooth when the error value is less than 0.6m. This shows that under this simulation condition, the maximum localization error of the proposed algorithm is less than 0.6 m, and it is unlikely to cause misjudgment in the application.     figure, it can be seen that the algorithm error proposed in this paper is significantly smaller than other algorithms. In addition, the proposed algorithm is smooth when the error value is less than 0.6 m. This shows that under this simulation condition, the maximum localization error of the proposed algorithm is less than 0.6 m, and it is unlikely to cause misjudgment in the application.

Test Arrangement
To verify the simulation results, a localization test was carried out in a 220 kV substation. The photo of the substation site layout is shown in Figure 7. Figure 8 is a plain view of the substation test arrangement. In Figure 8, 1 is a lightning arrester; 2 is a voltage transformer; 3 is a circuit breaker; 4 is a current transformer; 5 is an isolating switch; 6 is a coupling capacitor, and U, V, and W represent three phases of a high voltage device. In the space rectangular coordinate system established in the substation, the unit of coordinates is meters. The eight localization base stations had the coordinates S1 (−9.5, −5.5, 1.8), S2 (−9.5, −5.5, 0), S3 (9.5, −5.5, 1.8), S4 (9.5, −5.5, 0), S5 (9.5, 5.5, 1.8), S6 (9.5, 5.5, 0), S7 (−9.5, 5.5, 1.8), S8 (−9.5, 5.5, 0). The UWB measurement module was arranged at the corresponding location to obtain relevant measurement information. At the same time, the tag for the signal source

Test Arrangement
To verify the simulation results, a localization test was carried out in a 220 kV substation. The photo of the substation site layout is shown in Figure 7. Figure 8 is a plain view of the substation test arrangement. In Figure 8, 1 is a lightning arrester; 2 is a voltage transformer; 3 is a circuit breaker; 4 is a current transformer; 5 is an isolating switch; 6 is a coupling capacitor, and U, V, and W represent three phases of a high voltage device. In the space rectangular coordinate system established in the substation, the unit of coordinates is meters. The eight localization base stations had the coordinates S 1 (−9.5, −5.5, 1.8), S 2 (−9.5, −5.5, 0), S 3 (9.5, −5.5, 1.8), S 4 (9.5, −5.5, 0), S 5 (9.5, 5.5, 1.8), S 6 (9.5, 5.5, 0), S 7 (−9.5, 5.5, 1.8), S 8 (−9.5, 5.5, 0). The UWB measurement module was arranged at the corresponding location to obtain relevant measurement information. At the same time, the tag for the signal source was fixed on a rigid long rod to serve as a localization target, and the height of the tag was 1.5 m. In this paper, two paths were designed in the experiment. One was a straight path and the other was a rectangular path. For the straight path, the localization target carrying the tag was moved manually from measuring point P 1 (2.5, 3, 1.5) to measuring point P 2 (−1.1, 0.76, 1.5) and finally to measuring point P 3 (−4.8, −1.6, 1.5). For the rectangle path, the four vertices of the path were (−4, 3, 1.5), (4, 3, 1.5), (4, −1, 1.5), (−4, −1, 1.5), respectively. The target moves along a rectangular path determined by these four vertices. was fixed on a rigid long rod to serve as a localization target, and the height of the tag was 1.5 m. In this paper, two paths were designed in the experiment. One was a straight path and the other was a rectangular path. For the straight path, the localization target carrying the tag was moved manually from measuring point P1 (

Test Result and Discussion
The time difference measured between the base station in the field is calculated by using the probability distribution-based localization algorithm, the RWGH localization algorithm, the RT algorithm, and the TSWLS algorithm, respectively. To better verify the superiority of the proposed algorithm, this section also adds the localization trajectory of the TSWLS localization algorithm improved by the PF [26] method, and compares it with each algorithm.
The localization track of the straight path is shown in Figure 9 and Figure 10, from which it can be seen that the localization error of the proposed method is significantly smaller than other localization methods. In the XY plane, in addition to the TSWLS algorithm, the localization trajectories of the other four localization algorithms are basically distributed next to the actual trajectory. The algorithm proposed in this paper is more precise than the RWGH algorithm, the RT

Test Result and Discussion
The time difference measured between the base station in the field is calculated by using the probability distribution-based localization algorithm, the RWGH localization algorithm, the RT algorithm, and the TSWLS algorithm, respectively. To better verify the superiority of the proposed algorithm, this section also adds the localization trajectory of the TSWLS localization algorithm improved by the PF [26] method, and compares it with each algorithm.
The localization track of the straight path is shown in Figures 9 and 10, from which it can be seen that the localization error of the proposed method is significantly smaller than other localization methods. In the XY plane, in addition to the TSWLS algorithm, the localization trajectories of the other four localization algorithms are basically distributed next to the actual trajectory. The algorithm proposed in this paper is more precise than the RWGH algorithm, the RT algorithm, and the PF method. In the XZ plane, the localization algorithm proposed in the paper has far smaller error in height localization than the RWGH algorithm and the PF algorithm. The RT algorithm has a large error. When the target moved along a straight path, the RMSE value of the localization value and the real value of the proposed algorithm was 0.25 m, the RMSE obtained by the PF algorithm was 0.34 m, the RMSE of the RWGH algorithm and the real value was 0.52 m, and the RMSE obtained by the RT algorithm was 1.09 m. The RMSE obtained by the TSWLS algorithm was 1.41 m. From the results, we can see that under the linear trajectory, the proposed algorithm has the best localization performance. algorithm, and the PF method. In the XZ plane, the localization algorithm proposed in the paper has far smaller error in height localization than the RWGH algorithm and the PF algorithm. The RT algorithm has a large error. When the target moved along a straight path, the RMSE value of the localization value and the real value of the proposed algorithm was 0.25 m, the RMSE obtained by the PF algorithm was 0.34 m, the RMSE of the RWGH algorithm and the real value was 0.52 m, and the RMSE obtained by the RT algorithm was 1.09 m. The RMSE obtained by the TSWLS algorithm was 1.41 m. From the results, we can see that under the linear trajectory, the proposed algorithm has the best localization performance.    The localization track of the rectangle path is shown in Figures 11 and 12 The localization accuracy of the proposed method is obviously better than other methods in both XY plane and XZ plane. When the target moved along a rectangle path, the RMSE value of the localization value and the real value of the proposed algorithm was 0.28 m, the RMSE obtained by the PF algorithm was 0.55 m, the RMSE of the RWGH algorithm and the real value was 0.59 m, and the RMSE obtained by the RT algorithm was 0.94 m. The RMSE obtained by the TSWLS algorithm was 1.38 m. The localization error of the PF localization algorithm under the rectangular trajectory is slightly increased. This is because the motion state changes at the turning point of the moving target, and the correction effect of the PF localization algorithm on the localization trajectory will decrease. Under the rectangular trajectory, the localization error of the proposed localization algorithm is still the lowest among these five algorithms.    The localization track of the rectangle path is shown in Figure 11 and Figure 12 The localization accuracy of the proposed method is obviously better than other methods in both XY plane and XZ plane. When the target moved along a rectangle path, the RMSE value of the localization value and the real value of the proposed algorithm was 0.28 m, the RMSE obtained by the PF algorithm was 0.55m, the RMSE of the RWGH algorithm and the real value was 0.59 m, and the RMSE obtained by the RT algorithm was 0.94 m. The RMSE obtained by the TSWLS algorithm was 1.38 m. The localization error of the PF localization algorithm under the rectangular trajectory is slightly increased. This is because the motion state changes at the turning point of the moving target, and the correction effect of the PF localization algorithm on the localization trajectory will decrease. Under the rectangular trajectory, the localization error of the proposed localization algorithm is still the lowest among these five algorithms.  Table 2. From Table 2, we can see that in the case of NLOS, TSWLS cannot guarantee the accuracy of localization result. From Figure 9 to Figure 12, we can see that the localization result of TSWLS in this environment is not stable. From the results, we can also see that the PF can effectively improve the initial localization result of the TSWLS algorithm. The correction effect of the PF algorithm on the linear trajectory is better than the correction effect on the rectangular trajectory. This is because the moving state of the moving target changes significantly at the corner, and in the localization system with only the distance sensor, the motion state of the object itself cannot be corrected very well. Finally, it can be seen from Table 2 that the localization accuracy of the proposed algorithm in both paths does not change significantly, and the RMSE values are less than 30 cm, which is the minimum of among all the algorithms. When the object moves along a linear path, the localization error of the proposed algorithm is only 0.09 m lower than the PF localization method. However, on the rectangular trajectory, the localization error of the proposed algorithm is reduced by 0.27 m compared with the PF localization algorithm. This is because the algorithm proposed in the paper does not rely on other state information of the target to correct the localization result. The algorithm proposed in this paper reduces the influence of measurement error on the localization result based on the probability distribution function of the initial localization result of the group, so it is less affected by the moving trajectory of the target. The average time consumption of an algorithm for a single point in the localization process is shown in Table 3, from which we can see that the algorithm mentioned in the paper takes the second longest time of these five localization algorithms, but it did not exceed 0.1 s. The localization target moving speed in the substation is not too fast; although the algorithm proposed in the paper is not as efficient as the existing algorithm, it can still meet the requirement in practical application. How to further improve the computational efficiency of the proposed algorithm is an area for improvement in follow-up studies. To further analyze the influence of measurement error on the localization accuracy of the proposed algorithm and the RWGH algorithm, the below analyzes the localization results of P 1 , P 2 , and P 3 . Table 4 lists the time difference among the time when the tag signal is at P 1 , P 2 , and P 3 , and the difference between the time difference measurement and the real-time difference. T i1 in the table indicates the time difference between the arrival of the signal at the i-th base station and the first base station. As can be seen from Table 4, the time measurement error, when the base station is in the LOS situation, generally does not exceed 0.5 ns. The closer the measurement distance, the smaller the measurement error. When the localization base station is occluded, the measurement error changes depending the severity of the occlusion. Localization base stations 5 and 6 may be taken as an example for further analysis. These two base stations were in front of a lightning arrester, and localization base station 5 was placed on the ground, so that the occlusion is severe. However, since localization base station 6 was placed high above ground, the occlusion is not obvious when the measurement point was far away, and the measurement error did not change significantly.
The data in Table 4 was made available to apply the RWGH algorithm and to apply the proposed algorithm for localization. The results are shown in Table 5. The accuracy of the algorithm is represented by the RMSE value of the localization result and the actual result. The unit of the coordinates and the RMSE value in Table 5 are in meters. It can be seen from Table 5 that the localization algorithm proposed in this paper is more stable than the RWGH algorithm, especially when the NLOS measurement error is serious. Taking P 1 as an example, the localization performance of the proposed method is significantly better than the existing algorithm. At the same time, among the three localization points, the final localization errors of the localization points P 2 and P 3 are small. This is because the positions of P 2 and P 3 are relatively empty, the error of the time difference measurement from the point to each base station is small. Combined with the data of the field test, the accuracy of the time difference measurement has a great influence on the localization result. The localization algorithm proposed in this paper can effectively reduce the influence of measurement error on localization error, and each single coordinate error fell within 30 cm. In the actual application in the substation, in addition to considering the placement of the localization base station and improving its measurement performance, the localization method proposed in this paper can effectively reduce the influence of measurement error and make the localization result more reliable.

Conclusions
This paper proposes a new localization method based on TSWLS and probability distribution function. The proposed method obtains multiple sets of initial localization results using the two-step weighted least-squares method, and constructs the probability distribution function of the target by using the initial localization results. The final localization result is obtained by solving the objective function. This localization method reduces the influence of measurement error on the localization result, and can effectively improve the stability and effectiveness of the localization algorithm. For the traditional LS localization, the localization result obtained by the data with more LOS measurements will be closer to the actual coordinates of the target, and will be regularly distributed around the actual coordinates. The initial localization results obtained by the data with more NLOS measurements will have large deviations, which show no regularity. By constructing the probability distribution function, the initial localization results that are greatly affected by the NLOS error can be effectively eliminated. This can help solve the shortcoming that the traditional least-squares-based localization method is greatly affected by the NLOS error. At the same time, through the simple base station screening algorithm, the algorithm proposed in the paper has better computational efficiency.
The results of the simulation analysis and the field test show that the average localization error is reduced by more than one meter compared with the TSWLS method when the measurement error is large. Compared with the RWGH algorithms and the RT method, the proposed algorithm has improved the localization accuracy by more than 50%. Compared with the PF method, the proposed method also has better performance. When the object moves along a linear path, the localization error of the proposed algorithm is 0.09 m lower than the PF localization method. However, on the rectangular trajectory, the localization error of the proposed algorithm is reduced by 0.27 m compared with the PF localization algorithm. This method can keep the coordinate error within 30 cm in the substation environment. This proves that the localization method proposed in this paper can achieve precise localization of targets in substation environments with only the ranging sensors, although the computational efficiency of the proposed algorithm is not as efficient as some existing algorithms. The average time required for a single-point calculation using the proposed algorithm is less than 0.1 s on an ordinary PC. It can meet the basic requirements of the mobile target location in the substation.