Swarm of Drones in a Simulation Environment—Efficiency and Adaptation

: In the swiftly advancing field of swarm robotics and unmanned aerial vehicles, precise and effective testing methods are essential. This article explores the crucial role of software-in-the-loop (SITL) simulations in developing, testing, and validating drone swarm control algorithms. Such simulations play a crucial role in reproducing real-world operational scenarios. Additionally, they can (regardless of the type of application) accelerate the development process, reduce operational risks, and ensure the consistent performance of drone swarms. Our study demonstrates that different geometrical arrangements of drone swarms require flexible control strategies. The leader-based control model facilitates coherent movement and enhanced coordination. Addressing various issues such as communication delays and inaccuracies in positioning is essential here. These shortcomings underscore the value of improved approaches to collision avoidance. The research described in this article focused on the dynamics of drone swarms in a simulated context and emphasized their operational efficiency and adaptability in various scenarios. Advanced simulation tools were utilized to analyze the interaction, communication, and adaptability of autonomous units. The presented results indicate that the arrangement of drones significantly affects their coordination and collision avoidance capabilities. They also underscore the importance of control systems that can adapt to various situations. The impact of communication delays and errors in positioning systems on the required distance between drones in a grid structure is also presented. This article assesses the impact of different levels of GPS accuracy and communication delays on the coordination of group movement and collision avoidance capabilities.


Introduction
Drone swarms represent a collection of aerial robots that work together to achieve a specific objective [1].The control of drone swarms has increasing importance in numerous domains (e.g., environmental monitoring and military applications).Operating collectively, drones have the capacity to execute intricate and demanding tasks that an individual drone would be incapable of accomplishing [2] (e.g., ecosystem monitoring, agriculture, the entertainment industry, crisis management, and defense applications).Environmental monitoring applications may encompass lots of different tasks (i.e., scanning forested areas to detect and track wildfire outbreaks).In the case of responding to crisis situations, drone swarms can effectively deliver medical supplies or food to regions with limited access.Drone swarms also offer groundbreaking tactical capabilities in a military context (autonomous reconnaissance and the execution of combat missions with minimal risk to crewed units).
Therefore, solutions aim to mitigate the threats arising from the use of unmanned aerial vehicles (UAV) [3,4].
Drone swarms represent a true revolution, due to their ability to perform complex, coordinated actions.The control of a drone swarm is executed based on advanced decisionmaking algorithms, utilizing sensors and computational units located on the drone [1].In the evolving field of automation and robotics, controlling drone swarms poses a challenge that engineers and scientists are striving to meet.A comprehensive insight into swarm engineering is provided in [5].The article focuses on the intricacies of designing, implementing, and verifying control algorithms for swarm systems.The diversity of practical applications of swarm robotics, along with the challenges of their practical deployment, are emphasized in [6].The paper in [7] highlights the unmanned aerial vehicle (UAV) systems being extensively applied in various fields like smart agriculture, search and rescue operations, and military surveillance.The concept of distributed consensus, which is pivotal in coordinating multiple drones, is elaborated in [7,8].This encompasses the theoretical foundations and practical implementations of a swarm of drones.The utility of swarm intelligence in adaptive routing within telecommunication networks is explored in [9].The article illustrates the versatility of swarm-based approaches.An explanation and verification of methods for flight formation and autonomous coordination of drones in real-world conditions is presented in [10].The unique challenges faced by non-holonomic robots in modeling and controlling formation are discussed in [11].A detailed review covering the history, technologies, and applications of drones is provided in [12].An exploration of the biological inspirations for swarm robotics and their application in heterogeneous swarms across various contexts is provided in [13,14].
In addition to the foundational works on drone management and coordination, such as the distributed consensus model [8], recent research has introduced unsupervised methods for characterizing drone swarms using RF signal analysis and machine learning [15].They provide a comprehensive review of reliability assessment methods for drone swarms, emphasizing the importance of structural analysis and the importance of evaluation in ensuring operational reliability [16].An exploration of evolutionary algorithms in enhancing the design and problem-solving capabilities of swarm robotics is presented in [17].The article in [18] demonstrates the innovative applications of swarm robotics in theoretical and practical domains.Distributed collaborative partial SLAM for efficient navigation of autonomous robots [19] and the development of control algorithms for group formation flights in dense environments [20] can improve coordination within drone swarms.
In this article, we present our research conducted using simulation methods.We used software-in-the-loop (SITL) [21] to study the control mechanisms of drone swarms.The presented simulation methods are essential to determine the impacts of positioning errors, speed variations, and communication delays from the point of view of preserving a specific flight structure within a drone swarm.One of the aspects presented in the article is estimating the minimum distance between drones, dependent on the flight speed, to enable collision-free flights of the swarm.The simulation-based approach presented in this article enables precise and cost-effective verification of a swarm control concept that utilizes the leader drone mechanism.The assumptions of the simulation environment were described in our earlier article [22].
In the proposed concept of swarm drone control, each drone is equipped with a set of sensors and a GPS that enables the collection of environment and location data.The drones communicate autonomously, exchanging information about their status, planned routes, and detecting obstacles.Such an approach enables them to avoid collisions, coordinate actions in group tasks, and dynamically adapt to variable conditions.To achieve maximum positioning precision, real-time kinematic (RTK) positioning is used.As a result, the drones in a swarm maintain very small distances between each other, precisely execute tasks that require an accurate location, and maintain the given flight structure of the swarm.The research considered the impact of GPS positioning error, communication delays, and two methods of maintaining drone swarm structure.The examined communication delays could also simulate the data processing time by sensors.The research results presented in the article can serve as the foundation for the development of a specialized communication system for exchanging information between autonomous drone swarms and a collision avoidance system for the swarm within its surrounding external environment.The article in [23] presented experiments very similar to ours.However, the authors of the article assumed large distances between drones.In the case of large distances between drones, the communication delays between drones or positioning accuracy do not affect drone collisions.When the distance between drones in the swarm decreases, the impact of distance and communication delays on their collisions increases.
The remainder of this paper is organized as follows: Section 2 describes the methods for controlling drone swarms, as well as the mechanism based on the leader drone.Section 3 presents the simulation environment.Section 4 describes the results of the conducted experiments.Section 5 presents the conclusions drawn from the experiments and future work.

The Drones and the Swarm of Drones
Drones have gained an increasing share of the market as tools capable of performing a wide range of tasks in various fields.In the natural sciences, drones are used for remote environmental research.They collect data and information essential for analyzing and monitoring key aspects of the environment and infrastructure [24] (e.g., crop estimation, forestry remote sensing, disease observation, and power grid remote-sensing).The development of sensor technology for drones is growing dynamically and opens new possibilities for the control and applications of drone swarms.Advanced sensors and new software are gaining popularity and enable more effective and reliable management of drone swarms [25].The authors in [26] proposed a mission definition system that enables efficient execution of autonomous missions.The application of deep reinforcement learning can also lead to the development of intelligent navigation methods that can guide drones to accidents, disasters, and anomaly locations using sensor data [27].Simulation methods are also being developed for prototyping and rapid testing of control strategies that enable interactions between different units [28].Industrial drones are also crucial for modern production processes.Current research focuses on identifying constraints related to the integration of UAVs with modern production processes [29].
The technologies of drone swarms, facilitated by the implementation of modern sensors and the development of advanced control mechanisms, become increasingly valuable and prevalent in practical applications.Drones have a growing impact on various industrial sectors and scientific fields.Drones can contribute to the monitoring and preservation of the natural environment, investigate climate changes, analyze alterations in ecosystems, and collect data related to pollution.Swarm drones can be utilized for conducting rescue operations, locating victims in hard-to-reach areas, or monitoring public spaces to ensure safety and security.
Drones play a vital role in the monitoring and inspection of large-scale construction projects and urban infrastructure.Drone swarms can efficiently scan extensive areas in a short period, providing precise data for the detection of damages or structural issues of power towers, lines, bridges, and railway lines [30].By employing drones, farmers can monitor their crops across vast expanses, analyze soil conditions, track the health of plants and animals, and optimize resources such as water and fertilizers.Swarm drones can also assist in planting and harvesting crops.

Drone Swarm Control
In the field of swarm drone control, various methods enable the efficient and coordinated operation of multiple units.Currently, two concepts of manual drone control are commonly employed.In the first, each drone is individually controlled.The second concept involves point-based control, which includes superior and subordinate drones [31].This approach allows assigning a predetermined trajectory for each drone.Drone swarm management often draws inspiration from nature, using algorithms similar to those described by Floreano and Mattiussi [32], or employing biological concepts to decide where to place drone delivery hubs [33].
Many researchers develop detailed approaches to swarm robotics, based on strong math [34].A key part of this field is creating ways for drones to move safely in changing places, like crowded cities, without crashing.This solution requires carefully set coordinates for all drones.These ideas often come from watching nature (ants or birds movement) [35].
Managing drone swarms is tricky, because it mixes various techniques and methods.The article in [36] discusses the problem of drone mobility.The importance of the problem of finding the best paths for drone swarms is presented in [37].The problem of maintaining swarm structure while avoiding obstacles is described in the article in [38].
The drone depicted in Figure 1 represents a standard configuration that is foundational for the development of our intended swarm formations.This model is not uniquely designed but is an example of the type of quadcopter utilized in our research.It is outfitted with a suite of sensors for environmental interaction, multiple motors that provide agile maneuvering capabilities, and an energy-dense battery to ensure prolonged operational periods.The heart of the drone flight control system is a mainstay in drone technology, due to its proven performance, the STM32 microprocessor.This microprocessor faithfully executes commands from the ArduPilot flight management software and enables manual control and autonomous flight patterns.
The individual drone is integrated with a Raspberry Pi microcomputer, which runs specialized software.This software empowers the drone to communicate within a networked swarm, maintain its relative position within the formation, and autonomously execute collision avoidance strategies.

Swarm Drone Control Based on the Leader Mechanism
The paper presents a distinctive approach to swarm control.The innovative aspect of our method is a mechanism where drones mimic the trajectory and movements of a lead drone.Such a solution allows each unit of the swarm to replicate the flight parameters of the designated leader.The leader tracking mechanism should be precise enough to allow for smooth and coherent coordination within the swarm, while maintaining a constant flight speed.
During the experiments, we assessed the impact of positioning system accuracy on swarm formations and the occurrence of drone collisions, as well as the effect of communication and positioning system delays on swarm formations and the occurrence of drone collisions.We focused on specific flight algorithms where drones maintain a consistent cruising speed.

Drones Swarm in Simulation Environment
Complex systems require advanced testing and validation methods.Simulation methods such as software-in-the-loop (SITL) [21] play a crucial role in testing and validating control algorithms.Our SITL was fully implemented in a software environment and enabled testing of various scenarios.This approach is particularly useful in the early stages of product development [21] and allows us to understand the fundamental control mechanisms and interactions among swarm units.The use of simulations is a cost-effective approach in the design and implementation of systems.Simulation techniques are utilized in both academic research and in industrial applications related to Industry 4.0.[39].These methods are advantageous due to their repeatability and the opportunity they provide for exploring platforms that might otherwise be unattainable [40].Simulations protect physical systems from damage and reduce the duration of testing.Conducting swarm control concept tests in a simulated environment helps to avoid hazardous scenarios during real-world experiments and prevents expensive drones from potential damage.

Prepared Software, Simulation Environment and Drone Modeling
The assumptions of the simulation environment created for this article were described in our previous article [22].The created simulation environment SITL enables the analysis of many different aspects affecting the operation of drones and drone swarms in collaboration with real drone swarm control software.
Our SITL simulation was based on Microsoft AirSim [41].We constructed the simulation environment using the most recent official source code and Unreal Engine.Basic 3D terrain was created, to ensure an obstacle-free space for the swarm.Physical prototypes were crafted utilizing the Holybro X500 frame, Pixhawk 6C flight controller, 2216 KV920 motors, 1045 propellers, a 4S 5000 mAh battery, and custom 3D-printed components such as the chassis, fastening elements, and covers.To bolster stability during autonomous landings, we relocated the battery to the top position and substituted the high landing gear with low-profile chassis legs directly mounted to the arms.The bottom case, safeguarding the compute module inside, serves as emergency landing gear in muddy terrain.
Despite the variety of drone models available in the AirSim environment, none of them precisely match our physical model.For AirSim models, parameters are set in the source code, thus making it impossible to change the physical parameters of the kinematic model after compilation.To avoid this limitation, we migrated the kinematic model parameters to a settings file.Such an approach allowed effortless parameter modifications without model compilation.In contrast to the dimensions and mass of drones, which can be directly measured, determining the inertia matrix is a more intricate process.In the AirSim environment, inertia matrix computation relies on the mass and its position relative to the model's center point.For a more precise estimation of the inertia matrix, a CAD model with assigned materials of the elements can be employed.Motor parameters (encompassing thrust, torque, power, and current across RPM ranges from 30% to 100% throttle) were derived from producer documentation.Motor revolutions were capped at 9845 RPM, aligning with the maximum value measured from the documentation.
The data transmission latency between the flight control unit and the position reporting information (PRI) interface was quantified at approximately 19 ms.Such an assumption resulted from the UART communication speed, which was set at a baud rate of 115,200 and a Mavlink message payload of 280 bytes.The data processing latency on a companion computer, specifically a Raspberry Pi 4B model, was determined to be a maximum of 10 ms.This time depended on the parameters of our custom-developed software.Moreover, the principal data processing loop within the Ardupilot framework, executed on a standard STM32H743 flight controller processor, operated at a frequency of 400 Hz (2.5 ms).The conducted simulation studies incorporated a foundational delay parameter of 40 ms.This allowed a realistic representation of the data processing time of the drone swarm.
As part of the work, we also developed swarm control software (Figure 2) and Pythonbased software communication, drone behaviors, and localization based on GPS RTK data modules.The communication module supports data exchange protocols.Additionally, we created software support testing techniques: flight controller software, control systems, communication subsystems and ground stations.

Swarm Drone Communication
The method of controlling a swarm of drones from a ground station was designed to ensure continuous communication between the ground station software and drones in the formation.Such communication utilizes the MAVLink protocol.The created simulator allowed real-time monitoring of the location of each drone, which was crucial for maintaining the designated positions and flight trajectories.
The communication system for drone swarms was based on WiFi technology compliant with the 802.11s standard.The drone network communicated using a mesh network topology.This architecture enabled direct interaction between drones, as well as between drones and the ground control station (GCS), ensuring the transmission of key data such as positional coordinates and operational statuses across the entire network.
We employed the Global Navigation Satellite System (GPS) to ascertain precise location information.To enhance the accuracy of our positioning capabilities, we integrated realtime kinematic (RTK) GPS modules within our aerial units.Concurrently, an RTK base station was deployed on the ground to provide real-time correction message (RTCM) data.This arrangement significantly refined the positional data, which are essential for the coordinated maneuvering of the swarm.This technology helped improve positioning accuracy to 5 cm in UAV positioning applications [42].
Communication between the GCS station and the nodes of the drone swarm (Figure 3) used standard 802.11protocols.The transmitted messages included data about the node positions, i.e., the drones' location and altitude.Control frames contain information about the trajectory the drone is to follow.Telemetry data indicators and operational data, such as battery charge level or information from installed sensors, were also included.The specific types of frames depend on the specific missions performed by the drone swarms.

Simulation Experiments
During experiments, we carried out a series of tests where a swarm of drones navigated in a straight line from point A to point B (each point being 50 m apart).The experiments considered flights at varying speeds of 1, 2, 3, 4, and 5 m/s.Additionally, the impact of various levels of GPS error, including errors of 0 cm, 5 cm, 50 cm, and 100 cm, on the accuracy and safety of the swarm's flight was examined.The experiments anticipated different communication delays, at levels of 0 ms, 50 ms, 100 ms, 200 ms, 300 ms, 400 ms, and 500 ms.The aim of the experiment was drone swarm synchronization and coordination assessment.

During the experiments two scenarios
Maintaining a grid formation of 20 m × 20 m with distances of 5 m between drones was considered: a grid formation with the leader in the upper left corner (Figure 4) (only two drones at a time focus on each other, each drone looks at the leader) and a formation with leaders propagating the flight trajectory, where each subsequent drone follows its predecessor (Figure 5).In the second scenario, the errors were expected to propagate as each drone in the sequence looked to its predecessor.Such a solution potentially amplifies the positioning and communication errors.
The aim of these experiments was to determine the minimum distances that must be maintained between drones in a given formation to avoid collisions.The study results helped to determine how positioning errors and communication delays affect the safe minimum distance.The purpose of this work was to verify the mechanisms developed in simulation conditions (before tests with real drones in real-world conditions).Additionally, these studies allowed determining the control mechanism input data, which assured the safe execution of missions (the speed of the swarm's movement and the distance between drones).Based on real experiments, we assumed a safe distance of 2 m between drones to allow avoiding collisions, considering their physical sizes.

Scenario I
Experiments were conducted on a drone swarm forming a grid formation, with the lead drone located in the upper left corner (Figure 4).Tables 1-4 present the observed minimum distances between drones in the swarm, respectively, for the maximum positioning errors: 0 cm, 5 cm, 50 cm, and 100 cm.For each configuration, simulations were carried out to verify the impact of the swarm's movement speed (in the range of 1-5 m/s) and transmission delays (ranging from 0 to 500 ms).The results in Tables 1 and 2 demonstrate that a precise positioning system (accuracy similar to GPS RTK, error not exceeding 5 cm) and standard fast networks with delays not exceeding 50 ms enabled drone flights with a full range of speeds.The results noted in Tables 3 and 4 considered positioning errors which are similar to the classic capabilities of the GPS without RTK corrections (errors of 50 cm and 100 cm).The obtained results determined maximum safe speeds of 3 m/s and 2 m/s.Such a distance can be obtained in the case of fast networks (delays not exceeding 50 ms).
The results proved that for the safe management of drone missions, it is necessary to use fast networks, comparable in performance to classic Wi-Fi networks, as well as the application of GPS RTK positioning corrections.The same dependencies can be observed in Figures 6 and 7.

Scenario II
Scenario II considered a drone formation with a leader that propagated the flight trajectory, where each subsequent drone followed its predecessor (Figure 5).Tables 5-8 present the observed minimum distances between drones in the swarm for the maximum positioning errors: 0 cm, 5 cm, 50 cm, and 100 cm.The obtained results assess the impact of the swarm's movement speed (ranging from 1-5 m/s) and transmission delays (ranging from 0-500 ms).Scenario II examined a more advanced formation structure of the swarm.The results in Tables 5 and 6 show that the safe flight speed could not exceed 2 m/s.This result was independent of the precision of the positioning system and network delays.The results in Tables 7 and 8 present the case of positioning errors similar to the classic capabilities of the GPS system without RTK corrections.The safe speed of the swarm should not exceed 1 m/s.To increase the speed of the swarm's movement, it would be necessary to implement advanced mechanisms for collision avoidance.The results presented in Table 8 confirm the previous findings.At a speed of 1 m/s and delays exceeding 200 ms, the drones collided.The results presented in Figures 8 and 9 detail the impact of a swarm speed of 2 m/s and a communication delay of 50 ms on the change in distance between drones 1 and 5 for the swarm formation of Scenario II.

Conclusions
The article presents the results of simulation experiments that were focused on the behavior of drone swarm flight structures.We analyzed the impact of positioning errors, speed, and communication delays on swarm coordination.The presented control mechanism, based on the others mimicking the trajectory and movements of the lead drone, facilitated smooth and coherent coordination within the swarm and maintained a constant flight speed.Our research also employed basic behavioral rules for drone swarms (leader-based model).The findings showed that drone behavior depends on their spatial configuration.The conducted experiments provided significant information on the behavior of drone swarms under various conditions, enhancing the understanding of the dynamics of swarm flight.
The findings suggest that for different geometric arrangements/formations, the optimal configuration may vary.This indicates that increasing the speed of drone flight may require adaptable control strategies and advanced collision avoidance mechanisms.
Implementing new solutions is crucial for ensuring the safety and efficiency of drone swarm operations, especially in situations that require rapid response and precise maneuvering, as well as in cases of communication interruptions or delays.
Drone swarms can be utilized in a variety of applications, from monitoring to rescue operations.These experiments can open new possibilities for their application in various fields.
Simulation reduces the costs of testing real drones in various conditions.It allows a detailed verification of the swarm control concept using a leader-based mechanism and opens up new possibilities for the effective and safer use of drones.One such application could be swarms dedicated to drone shows.Currently, existing solutions rely on individually setting routes for all drones.The solution proposed in this article significantly facilitates the process of drone show preparation.
Employing advanced simulation tools is a cost-effective method for testing and refining drone swarm operations and closely mirrors current environmental challenges and operational demands.In the case of this article, the simulation helped to develop a collision avoidance that preserves the distances between surrounding objects and swarm nodes.In our future works, we want to develop such systems.
The most important task of the swarm coordination system is to maintain the geometric formation of drones.This task requires cyclical transmission of telemetry messages.This exchange is an example of standard point-to-point communication.As research has shown, this is one of the most important elements of a drone swarm management system.
The conducted research demonstrated the influence of communication delays, drone swarm speed, and the accuracy of the positioning system on maintaining swarm structure and the safety of swarm movement.In the case of a positioning system based on RTK GPS (positioning accuracy 5 cm), with the distance between drones being 5 m, a swarm structure with a leader at one corner of the formation (Figure 4), and a maximum communication delay of 100 ms, safe flight was possible when the maximum speed of drones did not exceed 5 m/s.In case of the worse communications delay (500 ms), the maximum swarm speed was 4 m/s.In the case of another swarm structure (each subsequent drone follows its predecessor, Figure 5), the corresponding speeds were 2 m/s and 1 m/s.For a standard drone positioning system (accuracy 100 cm), safe flight was possible for the swarm structure with a single leader at the corner (Figure 4) and a maximum speed of 2 m/s.
The results of these studies can be utilized in developing collision avoidance systems based on drone sensors (e.g., LIDAR, fisheye cameras, ultrasonic sensors, and others).In this scenario, the maximum communication delay can be treated as the maximum data processing time for sensors.
The simulation research presented in the paper allows identifying the boundary conditions for efficient and effective drone swarm management.The determined boundaries will help us to determine appropriate drone hardware in future works.
Additionally, we need to state that controlling a swarm of drones with a single leader is easier and results in fewer errors in maintaining the structure.The structure of a swarm in which each drone only looks at the drone in front of it requires a much better communication system, with significantly lower transmission delays.

Figure 3 .
Figure 3. Communication system and information exchange for swarm drone.

Figure 6 .
Figure 6.Scenario I-The impact of communication delay on the distance between drone 1 and 5, for a positioning error of 5 cm and a speed of 2 m/s.

Figure 7 .
Figure 7. Scenario I-The impact of speed on the distance between drone 1 and 5, for a positioning error of 5 cm and a communication delay of 50 ms.

Figure 8 .
Figure 8. Scenario II-the impact of communication delay on the distance between drone 1 and 5, for a positioning error of 5 cm and a speed of 2 m/s.

Figure 9 .
Figure 9. Scenario II-the impact of speed on the distance between drone 1 and 5, for a positioning error of 5 cm and a communication delay of 50 ms.

Table 1 .
Scenario I-Minimum distance between drones in a swarm for maximum GPS positioning error = 0 cm.

Table 2 .
Scenario I-Minimum distance between drones in a swarm for maximum GPS positioning error = 5 cm.

Table 3 .
Scenario I-Minimum distance between drones in a swarm for maximum GPS positioning error = 50 cm.

Table 4 .
Scenario I-Minimum distance between drones in a swarm for maximum GPS positioning error = 100 cm.

Table 5 .
Scenario II-Minimum distance between drones in a swarm for maximum GPS positioning error = 0 cm.

Table 6 .
Scenario II-Minimum distance between drones in a swarm for maximum GPS positioning error = 5 cm.

Table 7 .
Scenario II-Minimum distance between drones in a swarm for maximum GPS positioning error = 50 cm.

Table 8 .
Scenario II-Minimum distance between drones in a swarm for maximum GPS positioning error = 100 cm.