## 4 Theoretical Considerations on the Positions Obtained from the Indoor Positioning System  
In order to establish a mathematical means of confirming the positions returned by the indoor positioning system, a simple geometrical model was used. In the following, we will consider four fixed beacons arranged as in Figure 8, halfway along the sides of the considered work volume and all placed at the same height. In this situation, the dimensions of the work volume _Lx_, _Ly_, and _Lz_ are known. We will attach to this volume a Cartesian coordinate system Oxyz with the origin in the center of the base surface. The robot will move on the base surface considered flat. The current coordinates of the robot are \((x^{*},y^{*})\). The Marvelmind system used allows the real-time measurement of the distances between the fixed beacons BF\({}_{1}\), BF\({}_{2}\), BF\({}_{3}\), and BF\({}_{4}\) and the beacon mounted on the robot R, i.e., the distances \(d_{1}\), \(d_{2}\), \(d_{3}\), and \(d_{4}\) (Figure 8). Next, the robot coordinates will be determined depending on the geometry considered above and the measured distances. In Figure 8:  
\(BF_{1}\), \(BF_{2}\), \(BF_{3}\), \(BF_{4}\)--fixed beacons;  
\(R\)--mobile beacon;  
\(L_{x}\), \(L_{y}\), \(L_{z}\)--dimensions of workspace;  
\(d_{1}\), \(d_{2}\), \(d_{3}\), \(d_{4}\)--distances to fixed beacons, respectively;  
\(x^{*}\), \(y^{*}\)--robot current coordinates. In the right triangle ABR, the Pythagorean relation can be written:  
\[AR=\sqrt{x^{*2}+\left(y^{*}+\frac{L_{y}}{2}\right)^{2}}, \tag{1}\]  
and in right triangle \(\underline{BF_{1}AR}\):  
\[d_{1}=\sqrt{L_{z}^{2}+x^{*2}+\left(y^{*}+L_{y}/2\right)^{2}}, \tag{2}\]  
and finally:  
\[x^{*2}+\left(y^{*}+L_{y}/2\right)^{2}=d_{1}^{2}-L_{z}^{2}, \tag{3}\]  
Figure 8: Coordinates of fixed beacon BF\({}_{1}\). Finally, the equations to determine the position of the robot relative to the fixed beacons are as follows: \begin{tabular}{c c} \hline
**Beacon** & **Equation** \\ \hline \(BF_{1}\) & \(x^{*2}+\left(\frac{L_{y}}{2}+y^{*}\right)^{2}=d_{1}^{2}-L_{z}^{2}\) \\ \(BF_{2}\) & \(y^{*2}+\left(\frac{L_{y}}{2}+x^{*}\right)^{2}=d_{2}^{2}-L_{z}^{2}\) \\ \(BF_{3}\) & \(x^{*2}+\left(\frac{L_{y}}{2}+y^{*}\right)^{2}=d_{3}^{2}-L_{z}^{2}\) \\ \(BF_{4}\) & \(y^{*2}+\left(\frac{L_{z}}{2}+x^{*}\right)^{2}=d_{4}^{2}-L_{z}^{2}\) \\ \end{tabular}  Note: in the considered situation, since the robot moves on a flat surface, two fixed beacons are sufficient to determine the current coordinates of the robot. Next, the two coordinates will be determined based on the information received from beacons \(BF_{1}\) si \(BF_{3}\). Once the distances \(\mathrm{d}_{1}\) and \(\mathrm{d}_{3}\) from are determined, the current coordinates of the robot \(\mathrm{x}^{*}\) and \(\mathrm{y}^{*}\) can be determined. To do this, the difference between the two expressions can be obtained:  
\[\left(y^{*}+L_{y}/2\right)^{2}-\left(\frac{L_{y}}{2}-y^{*}\right)^{2}=d_{1}^{2 }-d_{3}^{2}, \tag{4}\]  
and the \(y^{*}\), coordinate as:  
\[y^{*}=\frac{d_{1}^{2}-d_{3}^{2}}{2\cdot L_{y}}. \tag{5}\]  
By substituting this expression into relation (1) we obtain:  
\[x^{*}=\sqrt{d_{1}^{2}-L_{2}^{2}-\left(\frac{d_{1}^{2}-d_{3}^{2}}{2\cdot L_{y}} -L_{z}\right)^{2}}. \tag{6}\]  
In the same way, the coordinates of \(\mathrm{x}^{*}\) and \(\mathrm{y}^{*}\) can be determined by considering the information from other pairs of fixed beacons. In this situation, the coordinates can be determined with very good precision, each of them representing the arithmetic mean of the coordinates calculated for each individual case. Following this model, a second variant was considered, one that will allow the positions of the mobile beacons to be determined by using their coordinates relative to the fixed beacons. In order to perform this second model, the working area was divided into squares, each with a side of 750 mm. Figure 9 depicts a schematic representation of the work area, where points A, with coordinates XY (0, 140 cm), and B, with coordinates (0, 280 cm), were marked.