Development and Application of a New Positioning Algorithm for Wireless Sensor Networks

— This paper aims to create a desirable positioning method for nodes in wireless sensor networks (WSNs). For this purpose, a source node positioning algorithm was developed based on time-of-arrival (TOA), in view of the nonlinear correlation between the measured values and unknown parameters in the observation equation of TOA source position. Several experiments were carried out to evaluate the performance of the proposed algorithm in terms of time measurement error, computing complexity, location error and Cramér–Rao lower bound (CRLB). The results show that the CRLB acquired by this algorithm can be used for WSN node positioning, provided that the independent zero mean Gauss measurement error is sufficiently small. The research findings lay a solid technical basis for optimal management, load balance, efficient routing, and automatic topology control of WSNs.


Introduction
Wireless localization technology [1] is based on the measurement of radio wave parameters, combined with a specific localization algorithm to calculate the location of the measured object. It includes infrared, ultrasonic, Bluetooth, radio frequency identification, ultra-wideband, WIFI, Zidbee, etc., initially to meet the needs of voyage navigation. The wireless localization resolution can be accurate to 0.25mm, which has a wide range of applications in cell phone location, mine personnel location, disaster site personnel search and rescue, container transportation tracking, and vehicle navigation. In WSNs, location information is used not only to report the location of a probe event, but also be used for target tracking, assisting with routing and network topology management, etc. The European Telecommunications Standards Institute (ETSI) has developed a series of standards for the wireless location of the GSM system. The current mobile location service industry has become one of the most promising mobile valueadded services. Academic researchers often strive to achieve the most effective localization methods under the current limited conditions of wireless devices and localization systems. Figure 1 shows a localization problem. It should be pointed out that a general node can also be used as an anchor node, as long as it knows itself location.
In the WSNs node location, the performance of the evaluation location algorithm usually has the following evaluation criteria:

Location accuracy
In the WSNs location algorithm, the location accuracy is generally represented by the ratio of the error value to the wireless range of the node. In addition, some localization algorithms use the size of the two-dimensional network of the network to indicate its accuracy [2].

Beacon node density
Another important indicator to measure the pros and cons of WSNs location algorithms is the density of reference nodes. Since the deployment of reference nodes in the WSNs manually or in a GPS mode has a great influence on the environment and application scalability of the WSNs, the reference node density can be used to evaluate one of the important indicators of the location algorithm cost and scalability [3].

Robustness and fault tolerance
In general, wireless networks are subject to many factors and conditions, which make robustness and fault-tolerance an important indicator for evaluating WSNs location algorithms. In order to ensure that the location algorithm can be applied in the real environment and avoid problems such as multi-path transmission, non-line-ofsight, and communication blind spots, the WSNs location algorithm must have strong fault tolerance and adaptability [4].

Energy consumption
Considering the miniaturization and limited energy characteristics of WSNs, the energy consumption problem is also one of the most important factors affecting the location algorithm. Therefore, for the location of WSNs, trade-offs between location accuracy and energy consumption are also needed to be considered, making it possible to achieve a good balance between location accuracy and energy consumption [5].
According to the analysis of the above WSNs location algorithm performance indicators, in general, a better location algorithm should have higher location accuracy, lower reference node dependency, strong fault tolerance and robustness, and lower energy consumption and the cost of realize and other characteristics [6][7][8][9]. These performance indicators are not only the performance indicators for evaluating WSNs' selflocalization algorithms, but also the optimal targets for the research and design of location algorithms. In the WSNs location problem, it is often necessary to comprehensively consider these performance indicators to make trade-offs based on specific requirements and propose a location algorithm that applies to different scenarios and different standards.

Distance Measurement for Wireless Location
In general, the RSSI value of the wireless point is related to the transmission distance of the wireless signal. The closer the wireless communication distance, the larger the value is. The RSSI receiver is a terminal that accepts signal power size parameters. The signal it receives is a function of space, frequency, and time. As shown in Figure 2, the change can be divided into path loss, shadow fading and small-scale fading. The path loss is the transmission loss caused by the distance between the transmitter and the receiver, and the shadow fade is used to describe the change of the average signal intensity due to the diversity of the location environment. The small-scale fading is related to the signal strength characteristics of the shorter distance signal from the receiver.
The RSSI-based method uses a theoretical or empirical signal transmission attenuation model to convert the transmission loss to distance by comparing the radio signal strength received at the receiving point with the known radio frequency signal strength of the transmitting node. The signal attenuation model is generally expressed as follow: where (d) and p(d & ) are the signal strengths at the distance from the base station d and d & respectively.
Since wireless sensors in general have wireless RF signals, it is easier to implement node ranging for the WSNs using the received signal strength. However, in the process of radio frequency signals achieving transmission, the signal attenuation due to environmental influences is inconsistent with the theoretical or empirical model and the individual differences of radio frequency hardware circuits. Therefore, ranging based on the received signal strength, and it is only a coarse-grained ranging technology [10].
The method obtains the distance by measuring the transmission time of the wireless transmission signal between the two nodes multiplied by its signal transmission speed, as shown in Figure 3. The signal is passed from the sending node to the receiving node, and then the receiving node sends another signal to send the node as a response. Through the "handshake" of both parties, the sending node can infer the distance from the node's periodic delay as follow: where represents the transmission speed of the wireless signal. The error of the measurement method mainly comes from the signal processing time, such as the calculation delay and the position delay G − J at the receiving end.
The angle of arrival of the signal is the angle of arrival of the reference node signal sensed by the antenna array or other special receiving device, and then the coordinates of the node are calculated using triangulation. In a multipath scenario, the angle is generally related to the virtual line connecting the anchor points or the BS. Figure 4 illustrates this problem. Because the complexity of detecting shadow effects is not even achievable, the angle can only be roughly estimated in the ground system. The disadvantage is that the hardware costs are very high. It is not suitable WSNs for large-scale size and power consumption [11].  In the process of node location based on distance measurement in WSNs, distance measurement is the first step. After completing the basic distance assessment, the next available accurate and efficient geometric coordinate calculation method is used to estimate the position information of unknown nodes. There are some common geometric methods, such as trilateration, triangulation, maximum likelihood estimation, hyperbola, and hybrid location.
The following is a brief introduction to the trilateration method. In the location-based WSNs location algorithm, it is the most common and most basic method for calculating coordinates. The steps are as follows: Assume that the distance from the node D to the reference node A is ρ J , then D is on a circle with point A as the center and ρ J as the radius. Similarly, if the distance of unknown node D to two other reference nodes B and C measured is G , ρ M . Then, point D is on a circle with B and C as its center and G and ρ M as its radius. The way we can determine that the unknown node is at the intersections of the three circles.
According to the geometric positions of the layouts A, B, C, and D shown in Figure  5, the coordinates of the three reference nodes A, B, and C are (x J , y J ) , (x G , y G ), (x M , y M ).
Combined with the actual node geometry, the coordinates of node D can be solved when assumed that there are no multiple solutions in Eq. (3).
The disadvantage of the triangulation method is that if there is an error, there may be a problem that the three circles can't intersect with one another.

3
TOA-based Source Localization Algorithm by Using Coordinate Translation Linearization

Algorithmic signal data model
In two-dimensional coordinate systems, a position can be represented by a column vector consisting of two elements. It is generally considered that a two-dimensional scheme can be described as follows: a signal emitting source node whose unknown position is denoted as p & and a timing for transmitting the timing signal as t & . There are m sensor nodes that are in sync with each other, and their known positions are denoted as ^, = 1, ⋯ , . The TOA measured as the arrival time of the corresponding sensor is recorded as t b , = 1, ⋯ , . All the observation equations are expressed as follows: In the case of sufficiently small Gaussian zero mean and independent measurement error, the above-mentioned mean square error location error is limited by the CRLB. CRLB can be derived from the probability density function given all unknown TOA measurement data and sensor locations.
The corresponding probability density function of the observation equation is expressed as follows: The corresponding Fisher information matrix is So CRLB is CRLB = TR{ BJ } (12)

Source location algorithm
Prior to the first stage of the evaluation algorithm presented in this paper, a suitable translation of the coordinate system is performed firstly, and the origin of the coordinate system is translated to the closest sensor node from the unknown source node, that is, the received time is the shortest (measured according to TOA). If the corresponding sensor node is labeled as sensor k, the above coordinate system transformation is expressed as follows: Where k = argmin^^ After transformation of the coordinate system, the following equation is obtained: In view of the above coordinate transformation, in observation Eq. (5), when m = k, it becomes So, it can be deduced Then we can see that the right side of the above equation contains only the relevant items of measurement error. The transformed observation equations appear in the form of a matrix.
Or it can be simply expressed as From the above formula, it can be seen that the nonlinearity has been eliminated. Since the error variance of the above equation is unknown at the first stage, the LS solution with the same weight is used here.
It can be seen from the above equation that when there is no measurement error, the above estimated unknowns, namely p ü & ç and t̂& ç , must be correct values.
Prior to the second stage evaluation, the corresponding coordinate system transformation still needs to be performed. The coordinate system origin is again converted to the estimated position and converted estimate the estimated transmission time to the source node in the first stage evaluation.
It can be seen that p ¢ çç and t ¢ çç contain only the items of measurement error. After converting the coordinate system, the observation Eq. (16) becomes After the transformation of the coordinate system, p ¢ çç , t ¢ çç only contains items with measurement errors. Therefore, when the measurement error is sufficiently small, the Here, c G t çç & G is took concrete derivation example. The above conclusion immediately corresponds to a value that needs to prove that c G t çç & G is insignificant with respect to 2c G t çç b t çç & . Consider the following scenario, it has a fixed value c and t çç b , and an estimated error t çç & that satisfies zero mean. If the variance is a Gaussian distribution of σ G , which is denoted as CN(0, σ G ), the corresponding probability function is expressed as: where ε is a fixed positive number, f it is a critical value of a negligible denominator. For example, a critical value of ε = 0.01 will be a sufficient condition for c G t çç & G to ignore for many practical scenarios. And this situation is equivalent to the proof of the following equation: When estimating the variance σ G → 0 of the error, Eq. (26) can be written as According to the cumulative distribution function of the Rayleigh distribution, we can observe Eq. (27) for any fixed value s, by reducing σ G up to 0, the following results can be obtained.
The Eq. (28) is equivalent to the fact that the ¨c G t çç & G¨ term is irrelevant to the 2|c G t çç b t çç & | term. Therefore, when the measurement error is small enough, Eq. (24) can be approximated as follows: or in the form of a vector matrix as follows: It can be simply expressed as: After the above two stages of estimation, coordinate system transformation will be performed again to restore the original coordinate system.

Simulation Analysis
The specific performance of the proposed TOA-based source location algorithm is evaluated through simulation. First, assume that the source node and the five sensor nodes in the sensor network are randomly distributed in one [-300, -300], [-300, 300], [300, 300], [300, -300] are the square regions of the vertices, and the signal transmission times of the source nodes are randomly distributed in the time period [-1000, 1000] (in nanoseconds). The TOA measurement error is assumed to be Gaussian zero mean error and independent of each other. Figure 6 shows the position of the randomly generated source sensor and the source transmission time during simulation and is fixed. It obtains curves from an average of more than 1000 independent runs and all measurement errors are generated independently in each run. As can be observed from Figure 6, the two-stage location algorithm proposed in this paper is superior to the one-stage location algorithm. When the measurement error is small enough, the CRLB lower limit can be approached. When the measurement error is relatively large, the third-stage algorithm achieves a slightly better location performance than the second-order algorithm. The convergence characteristics of the subsequent two-stage algorithm with iterative LS minimization are also slightly better than the two-stage algorithm. Figure 7 shows that the position of the randomly generated source sensor and the source emission time are not fixed in the simulation process. It derives curves from an average of more than 1000 independent executions, but measure error in each independent execution, source sensor position and source emission time are generated independently. As can also be seen from Figure 6 and Figure 7, the lower bound of the two-stage location error proposed in this paper exceeds the CRLB lower bound when the measurement error is large. It is mainly due to two reasons: when the node measurement error is relatively large relative to the sensor node distance, the approximate condition in Eq. (29) can't be satisfied; the CRLB derived based on the probability density function exists only in the nearby of value where the error is close enough small.

Conclusions
This chapter proposes a method of locating an unknown signal source based on the signal arrival time (TOA) measured by an unknown node of the sensor, where the positions of other sensor nodes are known and synchronized with the time of the unknown nodes. In general, the corresponding observation equation based on TOA source location includes the nonlinear relationship between measured values and unknown parameters. It will get result in the absence of valid unbiased estimates that approximate CRLB. A corresponding source localization algorithm based on TOA for linearization using coordinate system translation is proposed. The performance of the algorithm was evaluated in terms of time measurement error, computational complexity, mean squared location error, and CRLB. The simulation study of the location algorithm shows that when the independent zero-mean Gaussian measurement error is assumed to be small enough, the proposed location algorithm can effectively approach the CRLB lower limit value. It is applicable to the WSNs node location system based on the TOA measurement model.