RSSI measurement usually uses empirical model and theoretical model of signal propagation.
For the empirical model, before actual positioning, several test points are selected to record the signal strength received by each base station at these points, and an off-line database (x, y, ss 1, ss2, ss3) of the relationship between the position and the signal strength of each point is established. In actual positioning, the measured signal strengths (ss 1', ss2'', ss3'') are compared with the signal strengths recorded in the database, and the coordinates of the point with the smallest mean square deviation of the signal strength are taken as the coordinates of the node.
For the theoretical model, the radio propagation path loss model is often used for analysis. Commonly used propagation path loss models include: free space propagation model, logarithmic distance path loss model, hatha model, lognormal distribution model and so on. The propagation path loss model of free space radio is:
Where d is the distance from the source in km; F is the frequency in MHz;; K is the path attenuation coefficient. Other models simulate the real environment, but there is still a certain gap with the real environment. For example, the log-normal distribution model, its path loss calculation formula is:
Where Xσ is a Gaussian random variable with an average value of O, and its standard deviation ranges from 4 ~10; The range of k is between 2 and 5. Take d= 1 and substitute it into the formula (1) to get the loss, that is, the value of PL(d0). At this time, the signal strength of each unknown node when receiving the anchor node signal is:
RSSI= transmit power+antenna gain-path loss (PL(d))
2.2 Mathematical model of triangle centroid location algorithm based on RSSI
No matter which model it is, the calculated received signal strength always has an error with the actual situation. Due to the complexity of the actual environment, the conversion distance d from the anchor node to the unknown node is always greater than the distance between the actual two nodes. As shown in figure 1, anchor nodes a, b, c and unknown node d, and the distance between nodes a and d calculated according to RSSI model is ra; The distance between nodes b and d is Rb; The distance between nodes c and d is rC. Centered on a, b and c respectively; RA, rB and rC draw a circle with this as the radius to get the overlapping area. The basic idea of the triangle centroid location algorithm here is: calculate the coordinates of three feature points in the overlapping area of three circles, take these three points as the vertices of the triangle, and the unknown points as the centroid of the triangle, as shown in Figure 2. The feature points are E, F and G, and the calculation method of feature point E is as follows:
You can also calculate f and g, and simulate the coordinates of unknown points. In fig. 2, the actual point is d; The estimation point of triangle centroid algorithm is m; The estimated point calculated by trilateration method is n, which shows that the triangle centroid algorithm is more accurate.
3-triangle centroid algorithm flow based on RSSI
Step 3. 1
(1) The anchor node broadcasts information periodically, including its own node ID and coordinates. After receiving this information, the common node averages the RSSI of the same anchor node.
(2) When ordinary nodes collect a certain amount of anchor node information, they will not receive new information. Ordinary nodes rank anchor nodes according to RSSI from strong to weak, and establish the mapping between RSSI value and the distance from node to anchor node. Create 3 sets.
Anchor node set:
(3) Select the first few anchor nodes with large RSSI values for self-positioning calculation.
In B_set:, it is the key to improve the positioning accuracy to choose the beacon nodes with large RSSI value first to form the subsequent anchor node set.
For the set of anchor nodes, the coordinates of three intersection points are calculated in turn according to equation (3), and finally the coordinates of unknown nodes are obtained by centroid algorithm.
And (4) averaging the obtained unknown node coordinate set to obtain unknown node coordinates.
3.2 Definition of error
Defining the positioning error as ER, assuming that the coordinates of the unknown node obtained are (xm, ym), and its actual position is (X, Y), the positioning error ER is:
4 Imitate the truth
The triangle centroid algorithm is simulated by Matlab simulation tool, and the performance of the algorithm is studied. Assume that 36 anchor nodes are evenly distributed in the square area of 100 m× 100 m, and 70 unknown nodes are simulated by trilateration method and triangle centroid positioning algorithm respectively. The simulation results are shown in Figure 3. As can be seen from Figure 3, the triangle centroid algorithm has higher positioning accuracy than the trilateration method. When the ranging error becomes larger, the average positioning error obtained by the triangle centroid algorithm is far less than that obtained by the trilateration method.
5 conclusion
A method combining RSSI method with triangle centroid location algorithm is proposed. Through the simulation experiment, the algorithm is compared with the trilateration algorithm, which proves the superiority of the algorithm. The next step is to study the average positioning error with different number of anchor nodes.