# Remotely Controlled Robot Swarms: A Structural Analysis and Model for Structural Optimization
## 2 Materials and Methods
### Driving System and Distance Control Model  
The driving system was responsible for the speed and direction of the robots' movement. The required robot speed and direction were remotely controlled, and modified based on the robots' distances from other robots and obstacles, according to the implemented algorithms. Moreover, the driving system was a model with a changing maximum  
Figure 4: The light identification system. Figure 5: (**a**) The location of distance detectors with markers of the assumed distance between robots. (**b**) A photograph of a real model with a marker. speed limit. The limit depended on the energy used in the previous period of movement. The required speed depended on the robots' distance from other robots in the follower model, or on these distances and the commanded speed in the unstructured swarm. The swarm was modelled with \(N\) two-dimensional columns and a two-row matrix, where \(N\) is the number of robots in the swarm, and two dimensions, X and Y, were used for positioning:  
\[\left[ \begin{array}{ccc}X_{1}&X_{2}&\cdots&X_{N}\\ Y_{1}&Y_{2}&\cdots&Y_{N}\end{array} \right] \tag{1}\]  
The position of a robot is a vector [X,Y], calculated according to Equations (2) and (3) for each column of the above matrix:  
\[X_{n}=X_{0n}+\sum V_{xn}\cdot\tau=X_{0n}+\sum V_{n}\cdot\tau\cdot cos\alpha_{n} \tag{2}\]  
\[Y_{n}=Y_{0n}+\sum V_{yn}\cdot\tau=Y_{0n}+\sum V_{n}\cdot\tau\cdot sin\alpha_{n} \tag{3}\]  
where \(\tau\)--the integration time interval. \(X_{0n}\), \(Y_{0n}\)--the initial position of n robot in the absolute coordinates system  
\(V_{xn}\), \(V_{yn}\)--the speed vector components in the absolute coordinates system  
\(V_{n}\)--the robots' movement speed  
\(\alpha_{n}\)--the direction of movement  
The required speed of movement was calculated according to the following rules. In a structural swarm model:  
In the first modelling approach, the required speed \(V_{zF}\) is proportional to the difference between the real distance \(R_{R}\) to the predecessor and the minimal assumed value \(Rm\), as shown in Figure 6:  
This is the limited (saturated) P regulator model:  
\[Vz_{F}=k_{VZ}(R_{R}-R_{m}) \tag{4}\]  
\[Vz=\left\{ \begin{array}{cc}Vz_{F},&\mid Vz_{F}<VL\\ VL,&Vz_{F}\geq VL\end{array} \right. \tag{5}\]  
where \(k_{VZ}\) is the magnification of the proportional speed regulator. If \(R_{R}\) is lower than \(R_{m}\), the required speed is zero. However, the real \(V_{r}\) speed of movement depends on movement resistance \(M\), so it can be modelled as  
\[V_{r}=Vz-K_{M}M \tag{6}\]  
Figure 6: The assumed distance for the speed calculation. The \(M\) value is generated by a random value generator (\(rand(t)\)), giving a value in the range 0-1, and the \(MA\) is the maximum resistance. \[M=MA\cdot rand(t) \tag{7}\]  
The real speed cannot be higher than the speed limit \(VL\), which depends on the energy source wearing out:  
\[VL=VL0-KL\sum M\tau \tag{8}\]  
This wearing out depends on the movement resistance on the way and the wearing-out coefficient \(KL\). In the second approach, the distance from the followers is taken into account, which makes the \(VL0\) lower. \[VL_{R}=kL_{VZ}(R_{M}-R_{r}) \tag{9}\]  
When the robots are not moving in line, the angle \(\alpha\) (turning) is calculated based on the difference between the central position of the predecessor and the robots' distance from it. When an unstructured swarm was considered, the speed in two dimensions was calculated in a similar way. The upper and lower speed limits in both directions were calculated for the distance between the robots, keeping them within the assumed range. If the remotely ordered speed was in a limited range, then it was executed. For an unstructured robot swarm, the distance between the robots was given higher priority than the required speed (value and direction). The other regulator used was a model with hysteresis, or a death zone. If the distances between the robots were within the zone between \(Rm\) and \(RM\), the required speed could be calculated as follows:  
\[Vz_{n}=\left\{