# Simple Ultrasonic-Based Localization System for Mobile Robots
## 3 System Design
This should ensure measurement accuracy after calibration to precise distances. Therefore, distances were only approximately set using a tape measure. For each approximate distance (as shown in Figure 3), the repeatability of the measurement was ultimately evaluated. The conversion of distance from the measured results was possible by creating an arithmetic progression method of calculated magnitudes for a given time interval. We could calculate the distance from the measured results by creating a graph from the arithmetic averages of magnitudes for each distance and then fitting a curve through the created points, letting MATLAB estimate the equation of the fitted curve. The second option, due to future calibration, was to create an equation that would also include the calculation of the speed of sound in air at a given temperature and humidity. The equation also includes the offset of the measurement start by the dead zone as well as the delay from the signal transmission, which in this case was a total of 2944 microseconds. \[dist=2.944 ms*v_{US}+mag_{max}*0.004*v_{US} \tag{1}\]  
where \(mag_{max}\) is the sample with the highest magnitude and the speed of ultrasound propagation in air for a known temperature and humidity is as follows:  
\[v_{US}=331.4+0.6*T+0.0124*RH \tag{2}\]  
where \(T\) is the temperature in \({}^{\circ}\)C and \(RH\) is the relative humidity of the air in %. After calibrating all three tags with the receiver, we proceeded to verify the repeatability of the measurements and thus the accuracy for determining the position of the receiver in space. According to Figure 5, the system of three tags was mounted on the ceiling approximately using a tape measure. Figure 5: Arrangement of tags and measured points when viewed from above. For testing purposes, a space with a ceiling height of more than 2.7 m was designed. By computing the beam angle of the transducer for losses up to \(-10\) dB, the distance of the sides of the mounting triangle was calculated to be less than 2 m. Therefore, a specific length of sides, 1.8 m, was proposed, which falls within the calculated interval. The origin of the coordinate system was designed at point T1 (beacon 1), such that its x-axis passed through point T2 (beacon 2). Points T1 to T3 lie in a horizontal plane with the floor and ceiling. This plane is at the level of the ceiling. The axis, when viewed from above, points downward. Points A0 to E4 were marked on the floor for measurement purposes. Using the online tool GeoGebra, a model of the arrangement of elements in space was constructed to better determine the intersection of all three planes derived from the 70\({}^{\circ}\) angle beam and the height of the system in Figure 6.  
For this specific case and for a height of 2.72 m (measuring height), the points B0, C0, D0, B1, C1, D1, B2, C2, D2, and C3 lie at the intersection of the circles from beacons 1, 2, and 3. The remaining points either intersect only two circles or are only inside one circle at Figure 1:0  
Figure 1:1 Model created by GeoGebra. At points A0, A1, \(\ldots\), E4, repeated measurements were conducted. In each point, 100 measurements were taken. From the measurements using Equations (1) and (2), the distances from the receiver to beacons 1 to 3 were calculated. The coordinate system chosen was where the origin of the coordinate system is at point beaconT1 [0;0]. beaconT1 has coordinates \(x_{1}\) and \(y_{1}\), and beacon2 has coordinates \(x_{2}\) and \(y_{2}\). The x-axis passes through point beacon2, and the z-axis is downward. The basic equations for trilateration calculation of measured coordinates from distances \(d_{1}\), \(d_{2}\), and \(d_{3}\) are as follows:  
Figure 1:2  
Figure 1:3  
Figure 1:4  
where \(x\), \(y\), and \(z\) are coordination of the measuring point. However, the mentioned equations have an error in the calculation, as the calculation for the x-coordinate does not take into account the intersection of all three distances. The coordinate is calculated only from distances \(d_{1}\) and \(d_{2}\).