In this section, we first present the control objective and implemented architecture to perform the experiments, and secondly, the specifications for the experiments and the analyzed metrics to study the scalability are described.
3.1. Control Architecture
The main goal of this work is to explore the limit in the number of agents supported by two of the main simulators used in the field of control and robotics. For that purpose, we consider a formation control problem in which the complexity of the formation basically depends on the number of agents,
N. The MRS is modeled in terms of a graph
, where
is a finite set of
N vertices representing the nodes or agents and
is a finite set of edges, representing the communication links between them. More specifically, the desired formation is defined in such a way that the agents should be uniformly distributed over a semi-spherical virtual surface. The uniform distribution of points over a sphere is a classical mathematical problem that is difficult to solve analytically, and recent approximate solutions have been proposed [
38]. Then, the graph
is defined in such a way that the formation is ensured to be rigid [
39] and, as a result, target values are generated for the inter-distances between any two nodes
and
that are connected in the graph (
).
Figure 3 shows an example of the desired 3D formation and the projection over the XY plane for
and a semi-sphere centered at (0,0,0) and a radius
m.
In Robotic Park a hierarchical control structure with three levels is available for experiences. It includes a position controller at the lower level, a coordination controller, and path planning at the upper level (see
Figure 4). The solution to the formation control problem with collision avoidance proposed in this paper does not involve the upper level. Thus, the intermediate and the lower level participate as described below.
At the lower level, the position controllers follow a distributed architecture and are implemented onboard each robot. They close the control loop with signals generated by internal estimators from their sensors’ data and the external positioning systems, they have to ensure the stability of the closed-loop response, and work at the highest frequency (between 100 and 500 Hz). Different control architectures have been implemented on the two types of robots used in this work. [
9]. For instance, the Kheperas IV use two controllers focused on position and orientation, and the Crazyflie is controlled using a two levels-cascaded PID controllers scheme. Moreover, at this level, an additional term is included to avoid collisions between robots. This control term is derived from repulsive potential fields as follows:
where
denotes the repulsive potential of sensor
k,
is a threshold that activates the repulsive potential,
is the value of the distance between the sensor and the obstacle, and
is a constant that characterizes the field. Then, the resulting repulsive force
is defined by:
where
is the relative position between the robot and the obstacle. Hence, the sum of all repulsive forces is
, which has an impact on the goal position according to the following expression:
where
is the deviation of the goal position signal received from the coordination level,
h is the period of the controller, and
v is a constant velocity.
The intermediate level is responsible for coordinating the movements between agents to ensure that the desired formation is achieved. The implementation of this level can be centralized or decentralized, being the second option the preferred choice when the number of agents is large. Moreover, a distributed implementation in which a node only communicates with a subset of agents (neighbors), defined by the graph, reduces delays in the transmission of signals between the different control levels. As described above, the formation is defined by a set of target distances. That is, if two nodes and are connected in the graph by an edge, then the distance between them, , should reach a desired value . Both, the connection between nodes and the target distances are assumed to be given to ensure the desired dome shape. Additionally, to achieve the semi-spherical surface and guarantee rigidity, all the agents should maintain a distance R to the origin.
Let us denote as
the position of any agent
i. In this case, the formation controller is defined as follows:
where
is a gain and
represents the distance between agents
i and
j. Note that when all the distances between
i and its neighbors
converge to the target values
and the distance of each agent to the origin is
R, then the control signal
approaches zero. For practical reasons, the gains
are all set to the same value
which ensures that the second term in (
4) has a higher weight.
From the implementation point of view, the control law (
4) cannot be computed in continuous time but at discrete instances of time. Additionally, each agent needs to get the relative distance to its neighbors. Thus, deciding the updating times of (
4) has an impact on both the control performance and the amount of information exchanged through the network. Moreover, the higher the number of nodes
N, the larger the demand for network usage. For this reason, an event-based communication protocol has been implemented. Event-based sampling is an alternative to the periodic sampling method that has been proven to be effective in reducing the number of samples [
40]. The main idea is that it is the state/the output of the system and not the time that determines when to sample the system. In recent decades it has experienced a boom due to the advantages it provides in cyber-physical systems (networked control systems), due to their resource-constrained.
In this case, the trigger function is defined depending on an error function that depends on the position of the agent and a threshold, so that an event (sampling) occurs when that function reaches that limit value. Usually, the error function
is defined as the norm of the difference between the current measurement of the state
and the last transmitted measurement,
. There are different proposals for the threshold in the literature (constant, state-dependent, etc) but, in general terms, the larger the threshold, the lower the rate of events. Thus, the trigger time of an event-based control system is defined by the following recursive form:
where
is the error function and
is the trigger function. The evaluation of the trigger function runs in a loop that in the current implementation has a frequency of 50 Hz.
3.2. Experiments Description
Once the control objective has been defined, the experiments designed to study the scalability of the tools developed are described below. The different experiments are characterized by an increasing number of agents located along the surface of a hemisphere. A sweep is made from the simplest case with 5 agents to the limits that the simulation tools are able to support, 40 agents. In the hemisphere, the agents are placed at different levels. The level of height consists of the Khepera IV ground robots moving in the XY plane. The rest of the agents are of the Crazyflie type and can move in three-dimensional space. Next, we briefly describe the developed experiments:
The MRS of experiment A (see
Figure 5a,b) consists of a total of 5 agents, 4 of which are Khepera IV and 1 Crazyflie. In this case, all the robots are real and only their corresponding digital twins are running in the virtual environment.
In experiment B (see
Figure 5c,d), the MRS is composed of 10 agents: 4 Crazyflies, and 6 Khepera. In this case, 4 real Crazyflies and 4 real Kheperas are used. In the virtual environment, 2 Kheperas run in addition to the virtual twins of the real robots.
In experiment C (see
Figure 5e,f), the MRS is composed of 15 agents: 7 Crazyflies, and 8 Khepera. In this case, 5 real Crazyflies and 4 real Kheperas are used. The rest of the agents up to 15 are completely digital.
The fourth experiment, D, (see
Figure 5g,h) employs a total of 20 agents, 11 of which are Kheperas and 9 are Crazyflies. In this experience, 6 Crazyflies and 4 Kheperas are real. The rest of the agents up to 20 are completely digital.
The MRS in experiment E (see
Figure 5i,j) is composed by 30 agents. In this case, the distribution of agents is 18 Crazyflies and 12 Khepera.
For the last experiment, F, depicted in
Figure 5k,l, the number of robots is 40 (26 Crazyflies and 14 Khepera).
From experiences A to C the proportion of real robots is more than 50% (reached in D). From D to F, the number of real robots is maintained at 6 Crazyflies and 4 Kheperas, increasing in this way the proportion of digital agents in these experiences progressively. This information is summarized in
Table 1 and the final spatial distribution is shown in
Figure 5.
To quantitatively evaluate the experiments, several parameters have been considered. On the one hand, we try to measure how computationally demanding are these experiments when the number of agents increases, and on the other hand, the impact on the performance of the system. These are the performance indices analyzed:
Global CPU percentage. This value represents the current system-wide CPU utilization as a percentage.
CPU percentage. It represents the individual process CPU utilization as a percentage. It can be > 100.0 in case of a process running multiple threads on different CPUs.
Real-Time Factor (RTF). It shows a ratio of calculation time within a simulation (simulation time) to execution time (real-time).
Integral Absolute Error (IAE). This index weights all errors equally over time. It gives global information about the agents.
Integral of Time-weighted Absolute Error (ITAE). In systems that use step inputs, the initial error is always high. Consequently, to make a fair comparison between systems, errors maintained over time should have a greater weight than the initial errors. In this way, ITAE emphasizes reducing the error during the initial transient response and penalizes larger errors for longer.