Abstract
Cooperative attack with unmanned aerial vehicles (UAVs) plays a critical role in modern military warfare. To achieve multi-swarm cooperative attack with obstacle avoidance of formation, this paper proposes a cooperative control strategy that integrates flight control and autonomous marshaling. Firstly, an improved dynamics model with virtual leader-following mode is constructed to achieve obstacle avoidance of the formation. And an improved interference fluid dynamic system (IIFDS) is applied to improve path selectivity during multi-swarm attack. Secondly, a two-layer attack framework based on distributed swarm coordinated trajectory tracking with heading angle constraints is designed to achieve autonomous clustering of the UAVs and target striking. Finally, the proposed improved dynamics model is compared with the particle swarm optimization (PSO) algorithm and artificial potential field (APF) method in terms of obstacle avoidance of formation to demonstrate its superiority, which can obtain better benefits. Furthermore, two simulations of multi-swarm cooperative attack are conducted to validate the effectiveness of the control strategy. The proposed method expands the application of UAVs attack with obstacle avoidance of formation and provides a valuable reference for modern military operations.
Introduction
With the development of automation technology and the arrival of the information age, the application of UAVs as an artificial intelligence-driven fighter has gradually risen from the tactical level to the strategic level [1]. The flexibility, controllability and miniaturization of UAVs have brought an unprecedented revolution to the military field, and UAV swarm attack has become the focus of global attention.
The use of UAVs in military operations nonetheless raises concerns about cyber espionage and cyber security [2]. The integration of artificial intelligence and advanced communication technology allows for real-time data acquisition and transmission, which can be intercepted and manipulated by adversaries. For instance, cyber attacks on UAV control systems can lead to loss of control or hijacking, which can result in disastrous consequences. Moreover, UAVs are not only used in typical air combat tasks [3–5], but also as a tool in cyber warfare. They can be equipped with hacking tools, sensors, and cameras to conduct reconnaissance, surveillance, and attacks on targets from the air. In recent years, there has been increasing interest in this area, with several studies focused on exploring various aspects of cooperative attacks using UAVs. For example, Wang et al. [6] designed a cooperative guidance law based on the impact angle constraint to achieve a simultaneous multi-agent attack on the same target. Zhen et al. [7] implemented a multi-UAV cooperative search attack based on a self-organizing algorithm and ensured high coverage in the cooperative search-attack mission. Zheng et al. [8] proposed a novel cooperative attack strategy for multiple UAVs to arrive at the destination simultaneously under specified time and safety conditions. With the dynamic development of the battlefield, the strategic deployment of UAV formation and the adaptability to the external environment awfully impact the operational performance so that it is important to address the security challenges associated with UAVs in military operations and to develop effective countermeasures. However, most of the existing operational structure is mainly focused on air interception and cooperative search based on single swarm, and there are relatively few studies on the cooperative attack of autonomous clustering with obstacle avoidance of formation in the sky overhead. Based on this observation, the present work aims to propel automatic marshalling of UAVs to achieve multi-swarm cooperative attack by a cooperative control strategy based on a improved dynamics model, improved interference fluid dynamics system [34] and the distributed swarm coordinated trajectory tracking [15] with heading angle constraints [16, 18], which is expected to enhanced the application of UAVs and have utility in military warfare.
The rest of this paper is organized as follows: Section 2 introduces the related work involved in cooperative attack. Section 3 presents the swarms cooperative attack model based on flight control and cooperative control in this work. Section 4 describes the experimental simulation results and Section 5 is highlighted the conclusion of the paper.
Related work
UAV swarm cooperative operation, a new mode of combat, will become an important means of maintaining superiority in the complex battlefield environment, which is irresistible and likely to become the primary weapon of the air force [9].
The most important early guarantee for successful swarm combat implementation is to plan a reasonable operational path to ensure stability within the swarm. Currently, the most extensively researched methods include coordinated path tracking(CPT) and coordinated trajectory tracking(CTT). The CPT comprises of two levels which include individual path tracking control and swarm coordination [10]. Regarding the path tracking problem, the reference path is relatively fixed in kinematical space. However, in order to improve the flexibility of UAV flight, the reference path may move relative to the inertial system in some actual application scenarios, and the speed of the UAVs needs to be timely parameterized in the path following control to adapt to a specific condition [11]. As a result, coordinated trajectory tracking, namely moving path following (MPF), has garnered significant attention from scholars. Building on the work of [10], Oliveira et al. [12] were the first to propose a motion control problem for the MPF in two-dimensional space with time-varying paths. With the emergence of UAV swarms, Lapierre et al. [13] achieved lateral maintenance movement control of two underwater robots through leader following. This breakthrough laid the groundwork for addressing the cooperative moving path following problem (CMPF). Subsequently, Cichella et al. [14] expanded on the CMPF by incorporating a fault communication network and switching topology. Similarly, Wang et al. [15] deduced a nonsingular control law to prevent singularity problems with MPF strategy, as described in [12]. Furthermore, they extended the MPF strategy to the CMPF for multiple agents, signifying a notable progression from the MPF problem of a single agent.
One critical aspect of swarm coordination in large-fleet UAV attack missions is the problem of heading rate control. Ren et al. [16] incorporated heading rate into the model predictive control framework to study the nonlinear trajectory tracking control of UAVs. Yu et al. [17] proposed a distributed dynamic control method based on the saturated heading angle to solve the leader’s consensus problem. Wang et al. [18] also proposed a hierarchical grouping control scheme based on heading rate for the CMPF problem to control the formation of large-scale UAV swarms. Accordingly, with the cooperative attack control system utilizing multiple swarms of UAVs, the entire swarm can feasibly carry out a cooperative attack through the use of heading angle and coordinated trajectory tracking.
Formation control technology is another means of achieving clustering of UAVs. Proper formation of UAVs allows them to cruise through early warning airspace and deploy anti-aircraft fire in possible vacuums. Giulietti et al. [19] first regarded formation assembly as formation control and focused on formation maintenance in combat environments. Based on Giulietti et al. laying the foundation for the formation of UAVs, many scholars have launched a heated discussion on UAV formation technology [20–22]. Due to the complexity of the modern battlefield, effective swarm stability during cooperative air attack of UAVs depends on avoiding internal collisions and overcoming the influence of external obstacles. Researching this aspect, Khatib [23] studied the obstacle avoidance mechanism of mobile robots, based on the artificial potential field method (APF) for the first time. Subsequently, most scholars explored the anti-collision problem of UAV swarms from the aspects of path planning [24], vision system [25], differential geometry [26] and so on. As the superior performance of UAVs is constantly exploited, a new cooperative mode combining formation technology and obstacle avoidance technology, namely obstacle avoidance control of UAVs formation, has emerged [27]. Wu et al. [28] achieved the contol of obstacle avoidance with formation of UAVs based on consensus theory and the particle swarm optimization (PSO) algorithm. Dai et al. [29] proposed a distributed formation control strategy with the combination of graph theory and artificial potential field (APF) theory to reach the goal of obstacle avoidance of formation. Chen et al. [30] reconstructed the formation in avoiding obstacles in a UAV swarm by adjusting the angular and linear velocity of the UAVs based on the distance between neighboring destination arcs with the CMPF strategy.
In recent years, the disturbance fluid system has demonstrated significant benefits in obstacle avoidance control. This system does not require solving complex fluid equations and avoids local minima, allowing for the obtainment of a smooth path in a short time [31]. Liang et al. [32] expanded the flow function into a 3D environment and proposed an interference fluid dynamics system (IFDS) for fluid-based obstacle avoidance. To improve the IFDS, Yao et al. [33] introduced the tangent matrix and proposed a cooperation strategy of virtual obstacles and additional attracting fluids, named improved IFDS (IIFDS). Recently, Wu et al. [34] overcame the limitation of artificial potential field method’s trap area by incorporating the kinematic constraint model into the IIFDS. This approach effectively balances obstacle avoidance and formation reconstruction and was the first to extend the fluid method to formation obstacle avoidance.
As the battlefield situation evolves, the cooperative attack control for multi-swarm of UAVs with obstacle avoidance of formation becomes crucial. It is still challenging to realize the cooperative attack with multiple swarms of the UAVs considering formation and obstacle avoidance. Therefore, a strategy is structured based on the improved dynamics model, coordinated trajectory tracking, and the IIFDS to hold immense practical significance for the battlefield.
Swarms cooperative attack model
UAV flight control
Formation control
The core of the formation control is based on the virtual leader-following way. There are three modes of UAV swarm formation: reorganization, maintenance, and transformation. The first mode involves reorganizing from disorder to a specific formation, while the latter two modes are illustrated in Fig. 1. Seeing from Fig. 1, the difference between the transformation structure and the formation maintenance is reflected in the difference in the formation of the initial and final states. During the process of formation maintenance, the first linkage mechanism is adopted to maintain formation structure with the forward level of the wrecked UAV keeping the formation position unchanged, while the rear level replaces it with minimum alternate cost to ensure that the difference between the number of UAVs on both sides of the team does not exceed 1.

Formation maintenance.
The desired formation information matrix can be defined as
Define the formation error TE and the path cost TP for the whole movement of the swarm as follows:
The collision problem of the swarm mainly includes two aspects: one is the collision among UAVs, and the other is the collision between UAVs and obstacles. The collision avoidance system is shown in Fig. 2. And the anti-collision mechanism is defined as follows:

Collision avoidance system.
Each UAV is modeled by the dynamics mode as follows:
In the system, the control variable u is designed based on the above formation control and anti-collision mechanism as follows:
In the UAV flight system, u v , u θ , and u ψ are definited as follows:
The IFDS comes from the improvement of theory of fluid avoiding obstacles [32]. Its essence is a mode based on potential field, which has the characteristics of smooth path and is not easy to fall into local optimal state. In order to solve this kind of the trap area problem and the local minimum problem in the obstacles environment, Wu et al. [34] further developed an improved IFDS (IIFDS) algorithm by enhancing the tangent matrix. The detailed process is described below.
Assuming that the threat posed by the spherical obstacle is only considered within the system, it is described as follows:
Set the initial flow speed as follows:
Assuming that there are M′ obstacles in the threat area, the total impact of obstacles on the original flow field can be described by the interference modulation matrix H as follows:
More specifically, the coordinate system of the kth obstacle is formed by introducing tangent vectors ς1
k
and ς2
k
perpendicular to the n
k
on the surface of the obstacle, where
Finally, the actual interference flow speed
To reduce road congestion during obstacle avoidance with UAV swarms, the IIFDS is further improved by incorporating an interference modulation matrix and considering actual interference flow speed, as well as using a potential field between UAVs based on [27] to ensure the security of UAVs during cooperative attack.
Adjust the speed V of the UAV upon entering the flow field as follows:
According to Eq. (15), update the initial flow speed Λ. Meanwhile, to improve interference modulation matrix H k in Eq. (13) to adapt swarm motion, the rejection reaction coefficient ρ k and tangential reaction coefficient ζ k are set as follows:
Building on the work in [28] about collision avoidance between agents in UAV swarms, a paired potential function between UAVs is introduced to modify the
Set the paired potential function between UAVs as follows:
For UAV i, its neighbor set can be regarded as moving obstacles. Assuming that there are
Inferred from the above, the position update formula of the UAV in the obstacle system is
A hierarchical group control framework for UAVs is constructed, which divides all UAVs into multiple disjoint unit layers. Each unit layer is equipped with a virtual leader and randomly set a leader to enable autonomous marshalling and formation attack of UAVs during the mission.
Leader mode
The moving path following control for the leader in the swarm is set.
Assuming that

Path following error of a leader.
Take the derivative of Eq. (23) with respect to time as follows:
Set the expected value σ
i
of
With the declination error
The law of the leader speed control is:
Set the control law of the virtual leader 0 in the ith swarm as follows:
When dealing with multiple swarms, the following cooperative control for the leaders in these swarms is designed. Assuming that
The coordinated trajectory tracker law of the follower in the swarm is designed as follows:
The heading angle control law of follower layer in the ith swarm is as follows:
In the process of cooperative attack in obstacle environment, combining Eqs. (21), (27), and (31), and the corresponding heading angle of the leader is:
The swarm formation of multiple UAVs is considered to achieve cooperative attack in the airspace. The attack cooperation mode satisfies the principle of minimizing attack distance cost, which means:
The assembly mode follows a uniform mass approach, in which the number of UAVs in each swarm is equal based on the assigned attack target, and the total cost of assembly distance is minimized. The aggregatio mechanism is as follows:
Performance inspection of the model and two cooperative attack experiments are designed using MATLAB R2021a to demonstrate the feasibility and effectiveness of the work. Detailed descriptions of the simulation results are provided below.
Model performance inspection
Initialize the position, speed, heading and climbing angles of the virtual leader as S0 = (-50, - 50, 0), v0 = (2, 2, 0),
Due to the model controlling the horizontal flight of the UAV, the process of obstacle avoidance with maintaining wild geese formation of the improved dynamics model is presented as a two-dimensional perspective in Fig. 4. To illustrate the superiority of the model, the comparison and analysis of its obstacle avoidance of formation with that of the PSOA and the APF in the same flight environment will be conducted. This includes the same initial and final position for the swarm formation, as well as obstacle distribution. The result is presented in Table 1. According to Table 1, through the running time of it is longer compared to that of the APF, the formation error and path cost of the improved dynamics model are 35.4219 and 1625.3708 which are both less than these of the PSO and the APF. This fully validates the better effectiveness of the designed model in formation obstacle avoidance.

Obstacle avoidance of formation based on the improved dynamics model.
Comparing the performance of obstacle avoidance of formation
Note: TC is the running time of the computer.
In addition, the effectiveness of the improved dynamics model with the first linkage mechanism in maintaining formation structure is further validated in the case of arbitrary UAV wrecking, which is reflected in Fig. 5. Set the UAV to wreck at t = 200s. From Fig. 5(a), 5(b) and Fig. 5(c), the formation structure can be restored based on the model considering that a single leader, multiple UAVs on the other side or on the same side are fall and lose. In general, formation structure stabilization can be achieved based on improved dynamics model.

Inspection of formation maintenance.
Base on the improved dynamics model with the IIFDS and the multi-swarm cooperative control framework, the multi-swarm cooperative attacks in the three-on-three mode and three-on-one mode are conducted, which aim to explain the availability of the improved dynamics model to achieve cooperative attack with considering obstacle avoidance of formation. The entire simulation flow of the multi-swarm cooperative attack is depicted in Fig. 6.

Simulation flow.
During the attack process, arrang the final formation of each UAV swarm in a geese formation and set attack targets in a stationary state. The number N′ of UAVs is set to 21, and the positions of UAVs are randomly distributed with initial height to 0. Initialize the state of each virtual leader as S0 = (0, 0, 0), v0 = (2, 2, 0),
Firstly, select the swarm leaders at random corresponding to the attack targets. Afterwards, the traversal search method is adopted to identify the followers for each leader to achieve grouping in compliance with the mechanism of UAVs marshaling and attack matching. The result of grouping is showed in Fig. 7. When iter = 3742, W1 + W2 reaches to the minimum 390.3882 from Fig. 7(a). {Based on that, the 21 UAVs are evenly into three swarms from Fig. 7(b). The cooperative attack process is reflected in Fig. 8, where Swarm1, Swarm2, and Swarm3 respectivly attack the Tag1, Tag3, and Tag2. Moreover, from vertical view Fig. 8(b)and side view Fig. 8(c) and Fig. 8(d), all UAV swarms safely pass through the obstacle area within the attack range and converge to the final formation. And the 6th UAV in Swarm3 successfully avoid collision with the dynamic obstacle. Overall, all swarms achieve precise strikes against the targets with considering the obstacle avoidance of formation.

UAVs grouping and clustering.

Swarms cooperative attack of three-on-three mode.
The heading convergence of the three-on-three attack mode is shown in Fig. 9. The convergence of each UAV in the three swarms during the cooperative attack is illustrated in Fig. 9(a), Fig. 9(b), and Fig. 9(c), respectively. Upon inspection, the heading angle curve of each UAV in Swarm1, Swarm2, and Swarm3 respectively tends to the angle range of Tag1 ([38.6598, 51.3402]), Tag3 ([23.1986, 34.9194]), and Tag2 ([55.0806, 66.8014]), and the heading angle of each UAV converges to of that of its virtual leader. Besides, the error of the yaw angle betweeen virtual leader and each swarm converges to 0 in attack range, as evidenced by Fig. 9(d). According to heading convergence analysis, all UAVs have achieved precise targeting and marshalling, indicating that the UAV swarms have achieved great coordination in their attacks.

Heading angle convergence curve of three-on-three mode.
Furthermore, the speed convergence of each UAV during cooperative attack is shown in Fig. 10. The speed curve of each UAV in the three swarms is depicted in Fig. 10(a), Fig. 10(b), and Fig. 10(c), respectively. The speed of each UAV both inside and outside the obstacle environment rise and fall almost simultaneously. Eventually, the speed of each UAV converges to that of the virtual leader in their respective swarm in the same amount of time. The total speed error between the virtual leader and each swarm converges to 0, as shown in Fig. 10(d). This fully demonstrates the effectiveness and cooperativity of the control system in swarm attack tasks.

Speed convergence curve of three-on-three mode.
To further verify the feasibility of the control system, the obstacle environment is reset by changing the size and layout of the obstacles while taking formation reorganization, maintenance, and transformation into consideration in three-on-one cooperative attack mode. The attack diagram is shown in Fig. 11. It displays the expected formation where Swarm1 maintains the formation of wild geese, Swarm2 transforms its formation from cross to wild geese, and Swarm3 reorganizes its formation from disorder to wild geese so that all swarms complete formation convergence. All UAVs in the swarms successfully pass through the obstacle field and achieved precise strike with wild geese formation based on the control strategy of the UAV swarms in the three-on-one attack mode.

Swarms cooperative attack of three-on-one mode with formation.
The cooperative attack information is reflected in Fig. 12. The total speed error between the virtual leader and its leading swarm trends to 0 from Fig. 12(a). Due to the influence of the dynamic obstacle, the speed fluctuation of Swarm2 is greater than that in the static obstacle environment, resulting in a larger total speed error with the virtual leader. The yaw angle between the virtual leader and each swarm almost closes to 0 and converges into the angle attack range of [-6.3426, 6.3426] seeing as Fig. 12(b). There is a phenomenon that the yaw amplitude during the attack is larger than that of the environment without formation transformation, which is a special evidence reflected in Swarm1 and Swarm2. Furthermore, as shown in Fig. 12(c), the error of the expected formation of each swarm approximately converges to 0. At length the relative distances between swarms reflected in Fig. 12(d) reach the minimal values of 76.9994, 5.1486, and 33.4929, which are not less than 0 during the cooperative attack process to ensure security between swarms. In the three-on-one mode, the UAV swarms can also perfectly coordinate to complete the attack task based on the model with the multi-swarm cooperative control framework.

Cooperative attack information of three-on-one mode with formation.
The work presents the integration process of formation, obstacle avoidance and targets attack based on multi-swarm cooperative mode. For such, a improved dynamics model is designed to achieve the obstacle avoidance of formation, and a cooperative control framework based on the distributed swarm coordinated trajectory tracking with heading angle constraints is proposed to realize UAVs autonomous marshalling and target strike. Besides, the IIFDS based on swarm improves the autonomous path selectivity in the process of the collision avoidance. Comparing with the PSOA and the APF, the formation error and path cost of the improved dynamics model are both less, which can obtain better benefits in formation obstacle avoidance. Moreover, the multi-swarm cooperative attacks in three-on-three mode and three-on-one mode with considering obstacle avoidance of formation are achieved. And the precision strike, heading convergence and velocity convergence in the process of swarm attack fully illustrate the cooperativity and effectiveness of the control strategy. This model effectively expands the field of UAV operations in modern militarywarfare.
However, the control model is not self-reactive due to being constructed based on known state of obstacles and static attack targets, which may not be feasible for sudden and unknown obstacles and moving targets. The model is further improved in future to compensate for this deficiency.
Footnotes
Acknowledge
This work was partially supported by the State Key Program of National Natural Science of China (91324201), the Fundamental Research Funds for the Central Universities of China (2018IB017), Equipment Pre-Research Ministry of Education (6141A0203 3703), the Natural Science Foundation of Hubei Province of China (2014CFB865).
