Most of the previous research work on distributed clustering algorithms for UAVs has been limited to modeling, thus neglecting the practical application capability of the algorithms in real flight environments. Therefore, this paper carries out two aspects of work to prove the feasibility of the algorithm from the theoretical level to the practical level. The first part is the algorithm verification experiment, which builds a two-dimensional algorithm program, thus verifying that UAVs can form a stable cluster size through iterative computation. The second part is the physical simulation experiment, which builds a quadrotor UAV dynamics model in the physical simulation software Gazebo Classic and proves that the improved model allows the UAV clusters to exhibit higher motion consistency by comparing two sets of experiments in complex flight environments.
3.1. Algorithm Verification Experiment
Particles with two-dimensional directions are used in the experiments to represent the UAV with fixed velocity in the vertical direction and changing velocity in the horizontal direction with each iteration of the algorithm; the feasibility of the algorithm is preliminarily verified through two-dimensional experiments in MATLAB 2020b. The parameters of the UAV set in the experiment are shown in
Table 1.
Through this part of the experiment, we hope to demonstrate that the improved clustering algorithm exhibits higher stability. Therefore, experiments comparing UAV clusters with and without the addition of entropy metric adaptation values were conducted. The experimental procedure is as follows:
Generation and initialization of UAVs. UAVs were generated at random locations within a square area with a side length of 10 m. The UAVs were initialized with the entropy metric and initialized with the entropy metric. Initial speeds were assigned to these UAVs, aiming to ensure that the clustering algorithm does not fail due to zero initial value while exploring whether a chaotic UAV clustering system can maintain motion consistency. Therefore, the generated UAVs have the following parameters: initial position, velocity, and communication range. The generation of the UAV cluster is shown in
Figure 2, where the horizontal and vertical coordinates are equally scaled to the actual units.
Validation of the clustering algorithm before improvement. To simulate a real communication-constrained environment, the UAV’s communication range was limited, so that it could only sense other UAVs within a small range around it, but not all other UAVs on the map. To validate the algorithm’s effect on cluster stability, the external interference was set as a large random noise, which was used to simulate the effect of the complex flight environment on the cluster. One hundred sets of repeated experiments were conducted, with 50 iterations of the algorithm for each set of experiments. Statistical data found that clusters were clearly formed in 86 of the 100 repetitive experiments, with 69 cases showing cluster dispersion after iterations under strong interference, as shown in
Figure 3, in which the horizontal and vertical coordinates are scaled equally to the actual units. The different colors in the figure represent the flight paths of different UAVs. The data also revealed that most of the initialized UAV swarms formed distinct clusters after the 15th to 20th iterations.
Improved algorithm validation. In this experimental phase, UAVs calculate and exchange entropy metric adaptation values during the algorithm iteration, while the rest of the parameter settings are the same as in the previous step of the experiment. The same 100 sets of repetitive experiments were conducted, and 50 algorithm iterations were performed for each set of experiments. Statistical data revealed that all 100 groups of experiments formed stable clusters, and the clusters could be kept stable after highly noisy algorithm iterations, as shown in
Figure 4, where the horizontal and vertical coordinates are scaled equally to the actual units. The different colors in the figure represent the flight paths of different UAVs. Most of the experiments in this part formed obvious clusters after the 10th to 15th iterations. It can be seen that the algorithm introducing the population entropy metric improves the consistency of the cluster motion significantly, and the convergence speed of the cluster motion is improved by about 30%.
Through the above two parts of the comparison test, it can be seen that the randomly generated UAV swarms generally enter a stable state after 20 iterations. Therefore, the entropy value variance of the UAV samples in the first 20 iterations of the two parts of the experiment is counted separately, and a line graph is plotted, as shown in
Figure 5.
Figure 5 demonstrates decreasing entropy variance trends in both experiments, i.e., the algorithm before and after the improvement can cause the randomly generated UAVs to form clusters. However, the sample entropy variance calculated using the pre-improvement algorithm does not have a tendency to converge to 0 after 20 iterations, i.e., the UAV clusters diffuse in the iterative process of high noise, and the entropy variance fluctuates up and down under the influence of noise. The entropy variance of the samples calculated by the improved algorithm shows a tendency to converge to 0 after 20 iterations, i.e., the UAV cluster can remain stable in the iterative process of high noise, and the entropy variance continues to show a decreasing trend under the influence of noise.
Through the comparison experiment, it can be seen that the improvement of the algorithm has significantly enhanced the stability of the multi-UAV cluster under restricted environments. Additionally, the number of iterations of the algorithm required for cluster formation is reduced, and the system convergence speed is faster.
3.2. Physical Simulation Experiment
The experiments in the first part initially verified the feasibility and superiority of the improved algorithm, but the simplified 2D UAV model only accounts for two-dimensional motion, which lacks many physically necessary parameters compared to real UAVs. Therefore, in order to prove that the improved algorithm can be applied to a real UAV cluster system, this paper builds a quadrotor UAV model and a complex flight map in the Gazebo physical simulation environment, carrying out UAV cluster physical simulation experiments. In terms of UAV control mode selection during the experiment, a data comparison between velocity control and acceleration control is carried out. As shown in
Figure 6, compared with acceleration control, velocity control exhibits higher response speed and a smaller steady-state error; therefore, velocity control UAV flight was used during the experiment.
In the experiments in
Section 3.1, UAV-constrained communication under real flight conditions is simulated by limiting the UAV’s perceived range, while external interference is achieved by superimposing random noise on the speed. In the physical simulation experiments, complex flight maps are constructed to represent external interference, characterized by numerous large obstacles, as well as significant wind resistance. Formation obstacle avoidance flight experiments were conducted for two groups of UAV swarms, before and after the algorithm improvement, respectively, as shown in
Figure 7.
Figure 7 shows the algorithm improvement comparison experiments conducted in the Gazebo simulation environment. In the
Figure 7, the blue cylinder is a cylindrical obstacle, and the blue rectangular block is a rectangular obstacle. The shaded part is the shadow of the obstacle and the drone on the ground. Since the system entropy value is calculated iteratively at moments, in order to show the trend of the system entropy value throughout the entire experiment, four time nodes with significant entropy value changes—namely, the starting state, the first obstacle avoidance, the second obstacle avoidance, and the final state after passing through the obstacle—are selected as the key nodes in the experiment.
Figure 7a–d shows the four UAV cluster simulation experiments of the pre-improvement algorithm, and
Figure 7e–h shows the four UAV cluster simulations of the post-improvement algorithm. A comparison of the two sets of experiments shows that the pre-improved UAV cluster splits significantly when traversing dense obstacles, and the motion consistency is reduced, while the improved UAV cluster still maintains cluster convergence after traversing dense obstacles, and the cluster motion consistency is improved significantly. The individual entropy values and system entropy values of UAV clusters at four key nodes in the two experiments are plotted as line graphs, as shown in
Figure 8 and
Figure 9.
In Figure (a), it is evident that the entropy values of the algorithm before improvement is significantly higher than after improvement. In Figure (b), the entropy values of the improved algorithm is relatively high only at node 2, while it remains low at all other nodes. In Figure (c), although there is little difference in entropy between the original and improved algorithms for the first three nodes, a noticeable gap emerges from node 4 onward. Figure (d) exhibits a trend similar to Figure (a), where the entropy values of the improved algorithm is significantly lower. By comparing the data in
Figure 8, it can be seen that, except for the first aircraft, the individual entropy values of UAVs after the algorithm improvement is generally lower than those before the improvement, and all of them can be adaptively adjusted to the state of entropy decreasing after the entropy increase, i.e., each aircraft can converge to the stable state of self-adaptive adjustment in the complex flight environment.
Figure 9 reveals an overall entropy increase at four key nodes in both experiments. However, the overall entropy value of the system in the experiment before improvement has increased, indicating that the stability of the UAV cluster system gradually decreases. The average value of the system entropy value is 0.925, and the fluctuation range of the entropy value in the experimental process is within 63.4%. In contrast, the system entropy value of the system in the experiments after improvement shows a rising trend in the process of obstacle avoidance; however, the overall level of the system entropy value is significantly lower than that of the pre-improvement period, and it shows a decreasing trend after the end of the obstacle avoidance period. The stability level of the UAV cluster system in the flight process is improved overall compared with the pre-improvement level, and it is able to adaptively adjust according to the complex changes in flight constraints to maintain the consistency of the UAV cluster motion. The average value of the system entropy value is 0.587, and the fluctuation range of the entropy value is within 41.6%, i.e., the consistency of the UAV cluster motion, with the introduction of the group entropy metric, is improved by 21.8%.
The comparison of the two sets of experiments shows that when UAVs are clustered using the pre-improved algorithm, they adopt a scattered bypass to pass through obstacles. Due to the lack of inter-aircraft gravitational force when encountering obstacles, multiple avoidance attempts often result in individual UAVs losing their communication due to the spreading of distances, which leads to the dispersion of the clusters. When UAVs are clustered using the improved algorithm, the entropy metric is used to make up for the shortcomings caused by the lack of inter-machine gravity and is able to maintain stable clusters even after multiple obstacle avoidance attempts, which improves the consistency of the UAV’s clustering motion.
In the previous experiments, random noises in nature are modeled by simulation software, such as the positioning error of GPS and the change in wind resistance of flight. These disturbances are difficult to simulate accurately, so it is necessary to conduct flight experiments with physical prototypes to verify the effectiveness of the cluster model and algorithm proposed in this paper.
The multi-UAV cluster flight experiment process is complex, dangerous, and requires a certain amount of experimental equipment and manpower investment. Autonomous UAVs require real-time monitoring by the pilot to ensure that manual operation can be taken over at any time to prevent the system from going out of control and causing safety problems. Fully autonomous UAV cluster flights require a ground station to collect experimental data, calculate flight data in real time, and forward the speed and position information of the UAVs; thus, there is also a certain requirement for communication capacity. Considering the hardware and software equipment in the laboratory, the fully autonomous cluster flight experiment of three UAVs is designed. Three constitutes the minimum cluster lattice size, as fewer aircraft cannot adequately demonstrate that it is not enough to react to the interaction between the UAVs in the cluster, making it difficult to visualize the effect of the cluster algorithm.
In this paper, we construct a rotary-wing UAV cluster physical prototype test platform to verify the algorithm proposed in Chapter IV. Among them, a UAV hardware system based on self-development is designed with PIXHAWK (Holybro, Shenzhen, China) flight control as the core. The communication protocol was developed on MAVLINK (PX4 Development Team, Open Source), which functions to enable communication between the UAV and the ground station. The interactive software used QGC, which facilitated the exchange of information and task release. Data processing was carried out on the MATLAB graphical interface to enable the analysis of the logged cluster data.
Figure 9 shows the hardware platform block diagram.
In terms of hardware selection for the quadcopter UAV, the UAV adopts the PIXHAWK open-source flight control, which offers excellent performance, high expandability, and facilitates secondary development. The quadcopter’s spatial position, velocity, attitude, and collective rotational speed are controlled in a closed loop by the PIXHAWK flight controller, eliminating the need to calculate the tedious flight control parameters in the experimental process. The DJI F450 is used for the frame, which has the advantages of a lightweight structure and strong load capacity, providing 15 min of continuous flight time on full charge, ensuring experimental continuity. The GPS positioning module is equipped to ensure that the UAVs have a high positioning capability, and GPS positioning errors originate inherently from the module, so there is no need to add extra calculations.
In the experiment, each UAV needs to send and receive speed and position information within its interaction range and calculate its own speed in the next cycle of the algorithm; thus, it is necessary to choose the appropriate onboard computer and communication equipment. The NVIDIA Jetson TX2 onboard computer handles data collection and computation and transmits the speed of the next cycle to the PIXHAWK flight control board. It has the advantages of being lightweight and having strong computational ability, which can meet the needs of this experiment. The P900 communication module was selected, which supports the characteristics of a central node connecting multiple sub-nodes, with a maximum transmission distance of 20 km, operating at an 800 MHz frequency with 1.4 MHz bandwidth, which can fulfill the communication requirements of this experiment.
The experimental UAV and its hardware architecture are depicted in
Figure 10.
The UAV used in the experiment and its hardware structure are shown in
Figure 11, where
Figure 11a is the overall appearance of the drone and
Figure 11b is a block diagram of the drone’s core hardware components.
3.2.1. Experimental Design of Physical Prototype
The program design of the physical prototype experiment mainly focuses on the decision-making procedure of the UAV, including three modules: information interaction code, flight strategy code, and underlying control code. The information interaction code is used to transfer speed and position information between UAVs and transmit it to the TX2 onboard computer. The flight strategy code is used to determine the desired flight speed based on the position speed of the local UAV and the position speeds of its neighbors at the current moment and transmit it to the PIXHAWK flight control board. The underlying control code is used to manage the flight of the UAV.
In terms of quadcopter UAV communication, there are two main communication protocols in the UAV control system. One is the communication protocol between multiple nodes with MAVLINK as the core, which realizes the sending and receiving of the UAV’s position information. The other is the communication protocol between each processing program in the flight control system, which is based on ORB information. The motion consistency entropy metric theory designed in this paper is mainly calculated based on the velocity and position samples of each UAV in the cluster; therefore, it is necessary to customize the MAVLINK message to facilitate the calculation and release of the velocity of each UAV during the cluster flight.
The main steps of the physical prototype experiment are as follows:
(1) Port the relevant parameter files for UAV control in the GAZEBO simulation program to the onboard computer, and set the takeoff point and target point for the UAV according to the actual flight position, so that it can fly autonomously toward the target point after takeoff. This ensures that the UAV cluster will definitely cross the obstacle area during flight, allowing for an analysis of the consistency of the motion of the UAV cluster flight. The scene layout of the experiment is shown in
Figure 12:
Considering the safety of the experiment, it is necessary to impose certain restrictions on the aircraft before takeoff: maximum speed (2 m/s), altitude limit (3 m), and set up an electronic fence around the test site, so that the UAV will land automatically when it flies out of the fence.
(2) Power on the UAVs and wait for the PIXHAWK flight control board to search for GPS positioning information. All three UAVs automatically take off after obtaining GPS information, change formation to cluster lattice automatically, and fly toward the target point, crossing the pre-set obstacles on the way.
(3) All three UAVs landed automatically when they flew to the vicinity of the target point, and the flight data were exported and analyzed.
3.2.2. Experimental Results and Analysis of Physical Prototype
This section presents physical prototype experiment results and analyzes the UAV flight trajectory, speed changes, entropy changes, and flight altitude changes.
(1) Cluster flight process. The whole process of the experiment is shown in
Figure 13. In
Figure 13, the red circle represents the three UAV used in the experiment, the yellow circle represents the rectangular obstacle, and the yellow dashed line represents the virtual connection between each UAV, which is used to display the positional relationship between the UAV clusters. Before takeoff, the starting positions of all UAV are placed on the same straight line, as shown in
Figure 11a. After takeoff, the UAV swarm forms a triangular cluster structure, as shown in
Figure 11b.
Figure 11c,d show the situation of the UAV cluster in the first and second obstacle avoidance situations.
(2) Flight trajectory analysis. The trajectory route of each UAV in the experiment is shown in
Figure 14:
The blue diamond-shaped line in
Figure 14 represents the flight trajectory of UAV #1, or UAV1; the orange square line represents the flight trajectory of UAV #2, or UAV2; and the red star-shaped line represents the flight trajectory of UAV #3, or UAV3. For easier comparison, the time points corresponding to the graph are labeled in the figure.
Figure 13a shows the pre-flight linear UAV arrangement. The three UAVs were powered on and automatically searched for GPS positioning information; all of them searched, then automatically took off and entered the autonomous swarm mode. At t = 7 s post-takeoff, the UAVs formed an equilateral triangular formation, and
Figure 13b shows the cluster state of the three UAVs, while their relative positions are shown in
Figure 13b at t = 7 s. At about 19 s after takeoff, the three UAVs perform the first obstacle avoidance.
Figure 14 shows the three UAVs executing this maneuver, and their relative positions are shown at t = 19 s in
Figure 13c. At about 47 s after takeoff, the three UAVs perform the second obstacle avoidance.
Figure 13d shows the three UAVs executing this avoidance, and their relative positions are shown at t = 47 s in
Figure 14. At about 1 min after takeoff, the three UAVs flew to the vicinity of the target point and landed after automatically hovering to adjust their positions.
Figure 13e shows the landing state of the three UAVs, and their relative positions are shown on the rightmost side in
Figure 14.
At about 47 s after takeoff, i.e., when the UAV cluster flies to the vicinity of the second obstacle, it can be observed that the three UAVs form an approximate equilateral triangle cluster configuration again, which proves the validity of the motion consistency algorithm based on the entropy metric. In the cluster configuration formed at about 7 s after takeoff, UAV1 is in front (due south) of the remaining two, while in the cluster configuration formed for the second time, UAV2 is behind (due north) of the remaining two. This phenomenon occurs because of UAV1’s proximity to the obstacle, thus generating a larger collision avoidance velocity component between the real UAV and the virtual UAV, which results in a larger deviation from the original flight trajectory and a relatively longer flight trajectory path. In order to ensure the safety of the experiment, the speed of the UAV has been limited to less than 2 m/s prior to the experiment, so that UAV1 will be at the rear of the remaining two UAVs during the second obstacle avoidance.
(3) Speed change analysis. The velocity change in the three UAVs in the cluster is shown in
Figure 15:
The blue hexagonal line in
Figure 14 represents the change in speed over time for UAV1; the orange square line denotes the change in speed over time for UAV 2, UAV 2; and the red star-shaped line represents the change in speed over time for UAV 3, UAV 3. Analysis reveals all UAVs exhibited a velocity reduction at t = 7 s post-takeoff. Comparative analysis reveals that about 7 s after takeoff is the time when the UAVs first form a clustered configuration, indicating that the deceleration of the UAVs implies that the position adjustment is complete, and the traversing flights begin. UAV1’s velocity decreased sharply at t = 19 s, which is analyzed by comparison as the first obstacle avoidance moment. This is also the reason why the position of UAV1 changes relative to the other two UAVs at the end of the test. UAV2 experienced a velocity reduction at t = 25 s, and the comparative analysis shows that when UAV2 is flying between the two obstacles, it is subjected to the collision avoidance component from the virtual UAVs at the edges of both obstacles at the same time. These opposing collision avoidance vectors partially negate, constraining UAV2’s velocity. During t = 25–47 s, converging velocities indicate that the consistency of the cluster motion is improving and the entropy of the cluster motion is decreasing, which satisfies the algorithm designed in Chapter IV. At about 47 s after takeoff, the speeds are once again different, and the comparative analysis concludes that the cluster is performing the second obstacle avoidance. The three UAVs flew to the end of the vicinity for a short position adjustment, and the speeds gradually converged. Finally, the UAVs landed automatically, and all the speeds gradually decreased to zero.
(4) Entropy value change analysis. The entropy value change in the three UAVs in the cluster is shown in
Figure 16:
In
Figure 16, the blue hexagonal line represents UAV1, i.e., the change in entropy value of UAV1 over time; the orange square line represents UAV2, i.e., the change in entropy value of UAV2 over time; and the red star-shaped line represents UAV3, i.e., the change in entropy value of UAV3 over time. Data analysis of the above figure shows that the entropy values of UAV2 and UAV3 increase about 19 s after takeoff. A comparative analysis reveals that it is the time of UAV1’s first obstacle avoidance. Due to the decrease in UAV1’s flight speed, the speed differentials with UAV2/UAV3 increased; therefore, the entropy values of UAV2 and UAV3 increased. About 25 s after takeoff, the entropy values of UAV1 and UAV3 increase, and the comparative analysis reveals that UAV2 is in the middle of two obstacles. The speed of UAV2 is limited by two obstacles at the same time, causing it to decrease, and the difference between its speed and that of UAV1 and UAV3 increases, so the entropy value of UAV1 and UAV3 increases. During the period from about 25 s to 47 s after takeoff, the entropy values of all three UAVs show a decreasing trend, indicating that system entropy adaptively decreased through algorithmic iteration. The entropy value increases again at about 47 s after takeoff, and the comparative analysis shows that the cluster is performing the second obstacle avoidance. At this time, UAV1 flies to the backside of UAV2 and UAV3, and the difference in speed causes the entropy value of the two UAVs to increase. Then, the entropy value of the three UAVs continues to decrease until the end of the flight. A comprehensive comparison reveals that the entropy value of the UAV cluster decreases after two obstacle avoidance, verifying the effectiveness of the algorithm designed in Chapter IV.
(5) Flight altitude change analysis. The flight altitude changes in each UAV in the cluster are shown in
Figure 17:
The blue hexagonal line in
Figure 17 represents the change in height over time for UAV number one, i.e., UAV1; the orange square line represents the change in height over time for UAV number two, i.e., UAV2; and the red star-shaped line represents the change in height over time for UAV number three, i.e., UAV3. For experimental safety considerations, the maximum height of the UAVs was limited to 3 m prior to the experiment. The three UAVs reached their maximum altitude at about 5 s after takeoff and then maintained altitude within ±0.2 m of 3 m during flight. UAV2 and UAV3 landed at 51 s after takeoff, while UAV1 landed at 55 s after takeoff. Comparing the flight trajectory diagrams, UAV1 conducted positional adjustments during t = 51–55 s.
The physical prototype experiment shows that the UAV self-organized cluster model designed in this paper can be deployed in the cluster system, and the UAV motion consistency algorithm based on the entropy metric designed in this paper can effectively enable the cluster to converge quickly. The UAV cluster is able to react quickly to external obstacles during flight, and at the same time, it can take into account the collision avoidance between UAVs within the cluster, thus enhancing the UAV cluster motion consistency under multi-constraint conditions.
In the research of this paper, the adaptive parameters are mainly reflected in the calculation of the influence weights in the velocity alignment component. We achieve the adaptive adjustment of the UAV velocity calculation by transforming the fitness value into the influence weights of each UAV in the velocity alignment component. Judging from the experimental results, whether in the algorithm verification experiment or the physical simulation experiment, the improved algorithm with the introduction of swarm entropy measurement performs remarkably. In the algorithm verification experiment, this improved algorithm increases the convergence speed of the UAV swarm by about 30% and is more stable under high noise, while the swarm of the original algorithm is prone to dispersion. In the physical simulation experiment, the motion consistency of the swarm is significantly improved, and the fluctuation range of the system entropy value is reduced by 21.8%. This indicates that the improved algorithm can effectively guide the UAV swarm to evolve toward a better state. From a theoretical analysis perspective, the definition and calculation of swarm entropy show that the algorithm iteration optimizes the system in the direction of entropy reduction. Reasonable influence weights in velocity alignment can reduce the velocity differences among UAVs, decrease the swarm entropy value, and make the system more orderly and stable. This implies the convergence of the algorithm and, to a certain extent, shows that the algorithm may achieve a local optimal solution. However, due to the complexity and uncertainty of the actual environment, as well as the limitations of the algorithm itself, we are currently unable to strictly prove theoretically that it can achieve a globally optimal solution. In the subsequent research, we will conduct in-depth relevant theoretical analysis and supplement this part of the content.