Research on Ultrasonic Localization Method of Moving Objects Based on Improved TOA Algorithm

In the process of ultrasonic positioning of moving objects, a position algorithm TOA is optimized and improved due to the problem of delay caused by sequential ranging of the sequential ranging of the ultrasonic transmitter and receiver, the system’s solving time, and the signal transmission time. By setting an error compensation factor for the velocity of the object to be located and the unit positioning time of the system, the error is compensated to achieve the same positioning accuracy when the object to be located is stationary. The simulation results show that the positioning accuracy can be stabilized within 3 cm at a certain speed, and the positioning can be performed well for objects to be positioned with a certain speed.


Introduction
With the rapid development of information technology, the demand for indoor positioning technology is increasing. Indoor positioning is widely used in many fields, such as guiding customers to shop in large shopping malls, finding the location of cars in underground parking lot, sorting and transporting goods in logistics warehouse. The wide application prospect of indoor positioning makes the research of indoor positioning continue. Based on the existing research, it can be found that there is little research on the positioning accuracy of indoor moving objects. Therefore, this paper proposes an error compensation based on the moving object's own velocity to optimize the improved TOA localization algorithm.

Ultrasonic distance measurement principle
In the ultrasonic positioning system, the transmitter transmits the ultrasonic signal to the surrounding according to the predetermined program or a certain regular time. In this paper, the ultrasonic transmitter is placed on the object to be located, as shown in Figure 1. When the positioning system is started, the ultrasonic receiver will receive the ultrasonic waves from the transmitter respectively, and the specific location of the ultrasonic transmitter can be calculated by using the transmission time of the ultrasonic waves reaching these receivers respectively, combined with the ultrasonic wave rate and the corresponding positioning algorithm [1].  Figure 1. Ultrasonic three-dimensional positioning principle diagram If the object to be located in the positioning system is in a moving state, the moving trajectory of the target object can be recorded by continuous measurement of distance and position solving. Let the propagation speed of ultrasonic waves in the air be C, and the propagation time from the target to be located at the transmitting end of the piggyback ultrasonic waves to each receiving end of the ultrasonic waves be T i , then the distance between the target object to be located and the receiving end of the ultrasonic waves is shown in equation (1).
• (1) Since the propagation speed of ultrasound in air is temperature dependent, the measurement error is determined by the ultrasound transmission time T i and the speed of ultrasound in air C [2][3]. The propagation velocity of ultrasound is given by the equation (2).

Ultrasonic positioning scheme
When determining the position of ultrasonic receiving node, we need to follow this principle: no matter the transmitter moves in any position of the positioning area, we must ensure that there are three or more ultrasonic receiving nodes in its transmitting signal area, so as to ensure the normal operation of the positioning system. For the layout of ultrasonic receiving nodes, we must first consider how to determine a layout structure, so that it has a larger coverage, while achieving the least cost and higher accuracy at the same time, and the cost depends on the number of ultrasonic receiving terminals used in the system. Since the ultrasonic transmitter has the transmitting angle, a maximum coverage area exists. Figure  2 shows the coverage area of a typical ultrasonic emitter transforming the inclination angle, which can be represented by the following parameters.
θ : The maximum cone angle that can be sensed by the ultrasonic receiving end. r : The radius of the maximum coverage circle of the ultrasonic transmitting end, beyond which the target will not receive the signal.
R : The maximum transmitting distance of the ultrasonic transmitting end. h : The vertical distance (height) between the ultrasonic receiving end and the target. Figure 2. Typical coverage of the ultrasonic transmitter The square side length ι is a function of the radius r of the circle covered by the ultrasonic emitting end, and the radius r is a function of the height h and the emitting angle θ of the ultrasonic emitting end, and the function relationship is shown in equation (5). Therefore, for a given design area, the larger the square side length, the lower the layout cost.
Through the above analysis of the number of ultrasonic positioning system receiving node settings and location distribution, the ultrasonic transmitter direction angle is set to θ. According to the ultrasonic receiving node location layout strategy, a square endpoint-based receiving node layout scheme is proposed, as shown in Figure 3. This is the use of the characteristics of the square can be tiled on the plane, so as to ensure that in any plane can be completely covered no measurement dead angle, but also to determine the possibility of fast layout.  Figure 3. Layout based on square endpoints The actual layout space is assumed to be of length A, width B and height h. S is the area of the ceiling. For the square layout scheme, the number of ultrasonic receiving nodes required in the system is a function of the side length ι, as shown in equation (4) where S is the area of the square, K1 is the number of squares required, m is the number of squares in each row, n is the number of squares in each column, and the product K2 of m and n is used to verify K1. g is the number of ultrasonic receiving nodes, and its calculation schematic is shown in Figure 4. For each additional square in the first row, the number of endpoints increases by 2. Consider the first square with 4 endpoints, as shown in equation (7) is shown.
1 2 (7) The endpoints of the first square in the second row are increased by 2, and the endpoints are increased by one for each subsequent square, considering all the columns and then subtracting the first column, as shown in equation (8).  . Schematic diagram of the square-based ultrasonic receiver node calculation The length of the sides of the square and the number of sides were determined by calculations to ensure both a fast layout and that there are three and more ultrasonic receivers receiving the transmitted signal at any position.

Principle of TOA algorithm
Ultrasonic transmitter (object to be positioned) to transmit ultrasonic waves to each ultrasonic receiver (base station) the time elapsed, the product of time and ultrasonic velocity is the distance of the object to be positioned to each base station, when each ultrasonic receiver as the center of the circle, the distance is the radius for the circle, two distance circles intersect at two points, to get the ultrasonic transmitter two location solutions, so the third distance circle is needed to determine the actual location of the transmitter [4][5].
To facilitate the calculation, assume that the XOY plane is the ceiling of the indoor space, the ultrasonic receiver is arranged on the plane at the positions of A (0, 0, 0), B(a, 0, 0), C(0, b, 0), and the object to be located M is located on the ground, and its spatial coordinate position is M(x, y, z), then the distances from the three receiving points to the object to be located M are D1, D2, D3. The principle diagram of ultrasonic three-dimensional positioning is shown in Figure 1, and the spatial geometric relationship in the diagram can be listed as equation (10). (10) Solving the above equation yields： The values of T(x, y, z) coordinates can be solved by equation (10), which is shown in equation (11), and finally the spatial location coordinates of the positioned target M are obtained.
TOA positioning in two dimensions can be regarded as a model with three circles intersecting at a point, as shown in Figure 5. When the time of ultrasonic receiver and transmitter are perfectly synchronized, the exact time of the object to be positioned arriving at the fixed base station can be measured. Assuming the position coordinates of the object to be positioned are M(x ,y), the position coordinates of the three receivers are RS i (x i , y i ), i=1,2,3, the velocity C of the ultrasonic signal is multiplied by the TOA measurement time to get the distances r 1 , r 2 , r 3 from the three receivers to the object to be positioned. The coordinates of the object to be measured can be calculated according to the geometric relationship. Figure 5. TOA -2D schematic To achieve two-dimensional positioning by TOA algorithm, the position of the object to be positioned at the intersection of three distance circles requires at least three ultrasonic receivers (base stations) to achieve positioning, and the three receivers cannot be co-located. The above TOA principle shows that the time parameters are all absolute time in the system, which means that the ultrasonic receivers and transmitters need to be strictly time-synchronized so as to meet the reference time of all ultrasonic receivers for the same point in time.

Defect analysis of TOA algorithm for locating moving objects
After determining the layout and number of ultrasonic receiving ends, it takes time t 1 for the ultrasonic wave to propagate in the air, time t 2 for the circuit system to transmit the signal, and time t 3 for the positioning algorithm to solve the problem. When the positioning system starts, it takes time t 2 for the control terminal to transmit the signal to the ultrasonic transmitter, time t 1 for the ultrasonic transmitter to transmit the ultrasonic wave to the receiver in the air, time t 2 for the ultrasonic receiver to transmit the signal back to the control terminal, and time t 3 for the computer to solve the position coordinates through the TOA algorithm. assume that the speed of the object to be positioned is v, and it is uniform linear motion; in the positioning unit time t, the system is positioned once, which requires at least three measurements, then the moving distance of the moving object is :  . Altered TOA-two-dimensional schematic For computational convenience, the schematic diagram of the altered TOA algorithm is simplified, where the size of the first radius r 1 can be reduced to r 12 after passing through the object to be located through a period of displacement, as shown in Figure 8.  Figure 8. Simplified schematic of the changed TOA algorithm From the figure, it can be seen that the new radius r 12 is related to the displacement s of the object to be positioned, which is related to its own velocity v, as shown in equation (14).
∆ (14) However, it is not easy to obtain t 1 , t 2 and t 3 directly, so it is necessary to determine the total time of about t by the time it takes from the command issued at the computer side to the receipt of the position coordinate information, as shown in Figure 9. Figure 9. System architecture diagram Then combined with the previous analysis of displacement error, for the convenience of calculation, the time t is averaged into three segments, which represent the displacement error of each ranging, for the first ranging, the displacement error is (15) The second range was measured with a displacement error of (16) The third range was measured with a displacement error of (17) The relationship between s and Δs is determined by geometric modeling of the model shown in Figure 8. where r* represents the vertical axis distance of the object to be located in the 2-dimensional plane from the center of the ranging circle, which can be given by each ranging; the new radius equation (19) is obtained by substituting equation (15)   In the improved algorithm, r 1 is replaced by r 12 , similarly r 2 is replaced by r 22 and r3 is replaced by r 32 , so that the TOA algorithm changes to equation (23).
The position coordinates can be obtained by calculation.

Results and Discussion
By substituting the real position of the ultrasonic receiver into the positioning algorithm, the simulation experiments of the two algorithms before and after the improvement are carried out, and the temperature E is set at 20°C; determine the ultrasonic transmitting end direction angle θ as 40° by measuring the direction angle experiment. The algorithm before and after the improvement is simulated by MATLAB, and the simulation plane space size is 90cm×90cm, as shown in figure 11 and figure 12. Figure 11. Error distribution before TOA improvement & Figure 12 Error distribution after TOA improvement Figure 11 and figure 12 represent the error analysis before and after the improvement of the TOA algorithm, both in centimeters. From the figures, we can see that compared with the improved algorithm, the error of the pre-improvement algorithm is mainly distributed in the range of 0cm-6cm, while the error of the post-improvement algorithm is mainly distributed in the range of 0cm-3cm.
Then, by collecting data for 8 coordinates, in giving different values of speed, the obtained coordinate data are shown in the table 1.  The simulation results show that the positioning accuracy can be stabilized within 3cm even when the object to be positioned has a certain speed; as shown in Table 2, the positioning error can be reduced by more than 1cm, which can be well positioned for the object to be positioned with a certain speed.

Conclusion
Through the positioning simulation experiment of the ultrasonic positioning system based on the improved algorithm, the final result shows that the positioning error of the system can be stably controlled in the range of 3 cm, and the system is able to locate the object to be located with a certain speed. In the future, further improvements can be made in the following aspects: improving the accuracy through more ingenious algorithms; determining the speed range of the object to be located in a certain accuracy; using ultrasonic transmitters with larger emission angles to control the number of ultrasonic receivers and reducing the cost.