Abstract

This paper focuses on the grouping formation control problem of unmanned aerial vehicle (UAV) swarms in obstacle environments. A grouping formation and obstacle avoidance control algorithm based on synchronous distributed model predictive control (DMPC) is proposed. First, the UAV swarm is divided into several groups horizontally and into a leader layer and a follower layer vertically. Second, tracking is regarded as the objective, and collision avoidance and obstacle avoidance are considered as constraints. By combining the velocity obstacle method with synchronous DMPC and providing corresponding terminal components, a leader layer control law is designed. The control law can enable the UAV swarm to track the target while avoiding collisions and dynamic obstacles. Then, considering the formation maintenance term, based on different priorities, member-level obstacle avoidance and group-level obstacle avoidance strategies are proposed, and the corresponding follower layer control laws are provided. Furthermore, the stability of the UAV swarm system under the control algorithm is demonstrated based on the Lyapunov theory. Finally, the effectiveness of the designed algorithm and its superiority in obstacle avoidance are verified through simulations.

1. Introduction

In recent years, the development of unmanned aerial vehicles (UAVs) has achieved fruitful results, and UAVs have found a wide range of applications in both military and civilian fields. Compared with a single UAV, UAV swarms yield better performances in reconnaissance [1], search [2], and enemy attacks [3]. The introduction and improvement of methods such as reinforcement learning, neural networks, disturbance observers, fractional-order calculus, and event-triggered communication [46] have also led to new developments in fault-tolerant control of UAV swarms, demonstrating its advantages and necessity. Therefore, UAV swarms have become a new research hotspot.

With the complexity of the environment and the diversity of the tasks, sometimes, considering a UAV swarm as a large group cannot fully meet the requirements of the task. This issue arises for the following reasons: (1) When the number and scale of UAVs in the swarm increase, it will cause the interaction topology between the UAVs to become more complex, the difficulty of collaboration will increase, and the control effect will not be ideal. (2) When the task requires a swarm to perform multitarget tracking, multiarea detection or coverage, and multiprey encirclement, a single group cannot complete the task well. (3) When a task requires a swarm to have different “functional units” (such as reconnaissance, strike, and communication), a single group cannot perform differentiated control on different “functional units.” In the three typical situations mentioned above, we need to divide the swarm into multiple groups and implement grouping formation control (GFC) to improve the efficiency of the entire swarm. Meanwhile, obstacle environments are common when UAV swarms perform tasks, and encountering obstacles is inevitable for swarms. When multiple groups in a swarm encounter obstacles, it may involve issues such as obstacle avoidance and collaboration within a single group and between multiple groups. However, research on these issues is not sufficient. The above two aspects are the main motivation to study the grouping formation control problem of UAV swarms in obstacle environments.

For single group control problem, the formation control technology is an important foundation. The classical methods of formation control include the leader–follower method [7], the virtual structure method [8], the behaviour-based method [9], and the artificial potential field (APF) method [10], which have laid the foundation for formation control research. Emerging methods such as a graph theory-based method [11, 12], consensus theory [1315], swarm intelligence [16, 17], and distributed model predictive control (DMPC) [18, 19] have also found applications in formation control.

Model predictive control (MPC) can redefine the costs and constraints based on changes in the objectives and environment, and it can explicitly handle input and state constraints of the system. Its receding horizon optimization strategy can cope with environmental uncertainty [20]. DMPC can overcome the problem of computing and communication burden of centralized control, and if a noniterative synchronization strategy is adopted to calculate the control input [21], only one inter-UAV communication is required for each sampling period.

In the practical application of UAV swarm formation control, it is usually hoped that the swarm can achieve multiple functions simultaneously, such as trajectory tracking, formation maintenance, collision avoidance, and obstacle avoidance. Synchronous DMPC is often used to study swarm formation control problems with complex requirements due to its unique advantages. Yang and Ding implemented a swarm tracking reference trajectory and also ensured the collision avoidance and obstacle avoidance functions of the swarm, as well as the stability of the swarm system [21]. Without a reference trajectory, Guo et al. combined synchronous DMPC with the velocity obstacle (VO) method to handle collision avoidance and obstacle avoidance constraints, avoiding the design of complex terminal components in traditional DMPC theory and reducing the complexity of the controller [22]. For networked autonomous vehicles with a limited communication range, Lyu et al. combined CMPC and ADMM to propose an equivalent synchronous DMPC strategy [23]. Lyu et al. considered the avoidance of dynamic obstacles but only considered them as an additional constraint and did not provide stability proof under dynamic obstacle conditions. Bono et al. proposed a swarm-based DMPC scheme for coordination and control of multiple vehicle formations in uncertain environments [24]. To address the target capturing problem for MAS in obstacle environments, Fedele and Franzè proposed a strategy of alternating the use of two DMPC-based control actions [25]. It is worth noting that previous authors [2125] considered collision and obstacle avoidance issues to some extent while completing tasks such as tracking, arrival, and encirclement. However, these studies mainly focused on the avoidance of static obstacles but do not fully consider the avoidance of dynamic obstacles. The avoidance of dynamic obstacles is worthy of further study.

For GFC problem, there are currently not many research results. Kushleyev et al. proposed a trajectory generation technique based on mixed integer quadratic programming (MIQP) and a grouping and region partitioning strategy to manage the complexity caused by the growth of the state space dimensions, and 16 UAVs were used to complete the tasks of swarm grouping, flying through windows, and swarm transformations into three-dimensional spiral and pyramid formations [26]. Chen et al. studied the formation control problem of fixed-wing UAV clusters and proposed a hierarchical grouping scheme. Collaborative path following control laws and distributed leader–follower control laws were designed for the leader and follower layers, respectively. Numerical simulation verification was conducted on 10 fixed-wing UAVs [27]. Tian et al. addressed the time-varying group formation tracking problem of a general linear multiagent system (GLMAS) with a switching interaction topology. Under the influence of external disturbances and the switching topology, two different distributed adaptive control protocols were constructed based on distributed observers, and the closed-loop stability of the GLMAS was demonstrated using the Lyapunov theory [28]. Wu et al. addressed the multigroup formation tracking control problem for a second-order multiagent system with multiple leaders via distributed impulsive control methods [29]. Haghighi and Cheah introduced adaptive interaction forces to cope with the interactions between groups, enabling a swarm to establish arbitrarily complex formations [30]. Zhao et al. studied multigroup tracking control for MAS, in which the control scheme combined event-triggered technology and impulsive theory [31].

In the existing research on GFC, the focus has been on the construction of grouping frameworks and the implementation of formation control. Less consideration has been given to GFC in obstacle environments, relying solely on simple prepath planning [2628] and changing formation shape [32] strategies for obstacle avoidance. Therefore, GFC in obstacle environments is a problem worth studying.

Based on the above literature review, this study was mainly focused on the GFC problem of a UAV swarm in obstacle environments, and a grouping formation and obstacle avoidance control algorithm was proposed based on synchronous DMPC. The main contributions of this work are as follows: (1) For the first time, the GFC framework was combined with synchronous DMPC theory to solve the GFC problem in the obstacle environment. In contrast to previous work [2628, 32], the collision and obstacle avoidance function of the swarm itself was considered. (2) A grouping and layering control framework was established that divided the UAV swarm into several groups horizontally and into a leader layer and a follower layer vertically. (3) A leader layer control law was designed that combined synchronous DMPC with a VO to obtain new terminal constraints and provide corresponding terminal components. In contrast to previous approaches [2125], this control law can achieve avoidance of not only static obstacles but also dynamic obstacles. (4) Follower layer control laws were designed. In response to the GFC problem in obstacle environments, based on different priorities, member-level obstacle avoidance and group-level obstacle avoidance strategies were proposed, and the corresponding control laws were obtained. (5) Based on the Lyapunov theory, the designed algorithm can strictly ensure that the entire swarm tends to stabilize in obstacle environments.

The paper is organized as follows. Section 2 provides the problem description and establishes the model. Section 3 proposes obstacle avoidance strategies and designs control laws for the leader and follower layers. In Section 4, the effectiveness and superiority of the proposed algorithm are verified through simulation experiments. Section 5 presents the conclusions.

2. Problem Description and Model Establishment

2.1. Problem Description

In typical situations, such as large-scale, multiobjective situations requiring functional heterogeneity as mentioned in Introduction, we need to perform grouping formation control on the swarm. Furthermore, the research on group formation control in obstacle environments has a high value in practical applications. To address this issue, it is first necessary to establish a grouping and layering control framework, as shown in Figure 1.

In this paper, the swarm is divided horizontally into several independent groups and vertically into a leader layer and a follower layer. In the context of this paper, leaders are mainly responsible for tracking global reference trajectories and avoiding static and dynamic obstacles. Due to the diversity of tasks (such as multitarget tracking), they are not required to maintain a specific formation shape. The follower is mainly responsible for tracking the reference trajectory of the group (or the real-time trajectory of the group leader), maintaining the expected formation within the group, and possessing a certain obstacle avoidance function. Due to the need to consider inter-UAV collision avoidance, and because the number of groups and the number of members within each group are not too large, leaders can communicate with each other in pairs, and followers of the same group can also communicate with each other.

2.2. Model Establishment

It is assumed that there are quad-rotor UAVs in the swarm. Currently, a variety of open-source autopilots have been launched in the market, which can achieve a velocity control function. With such an autopilot, the velocity of a UAV can track a desired velocity command in a reasonable time [3335]. Therefore, the velocity loop can be modeled as a first-order inertial element. And the state equation of the swarm equipped with autopilots can be described as where , is the state vector of UAV , and represent position and velocity vectors, respectively, represents the control input, and represents the desired velocity command. The system and input matrices are, respectively, where is the time constant in the velocity loop, which can be obtained through flight experiments.

Equation (1) is discretized to obtain the discrete state equation where , , , and is the sampling period. The state and input of UAV are, respectively, constrained by and .

UAVs in the swarm are divided into groups, consisting of group leaders and followers, and they are placed in the sets and , respectively, satisfying the . The followers of the group are placed in set , satisfying the condition .

3. Control Algorithm Design

This paper mainly studies the problem of GFC in obstacle environments. Due to the different requirements for the leader and follower layers, control laws need to be designed separately. The control laws of the leader and follower layers have evolved from previous work [36], which is mainly based on the DMPC theory to study the tracking and obstacle avoidance problems of single group.

3.1. Obstacle Avoidance Strategy

When the swarm executes tasks, it is necessary to perform grouping formation control on the swarm in situations of “large-scale,” “multiobjective,” and “functional heterogeneity.” When a swarm encounters obstacles, two obstacle avoidance strategies can be proposed based on different priorities: member-level obstacle avoidance and group-level obstacle avoidance.

In the member-level obstacle avoidance strategy, all members in the swarm have an obstacle avoidance function. In each group, the leader tracks the global reference trajectory, while the follower tracks the group reference trajectory.

When maintaining the formation of a group is a higher priority, a group-level obstacle avoidance strategy needs to be adopted. In the group-level obstacle avoidance strategy, the leader of each group has the obstacle avoidance function, and when the leader avoids obstacles, the determination of the safety radius needs to consider all followers of the group which it belongs to. Followers of each group do not have the obstacle avoidance function and only track the real-time trajectory of the group leader.

When designing the control algorithm, the control laws of the follower layer may vary depending on the obstacle avoidance strategy, as detailed in Sections 3.3 and 3.4.

3.2. Leader Layer Control Law

Leaders are mainly responsible for tracking global reference trajectories and avoiding static and dynamic obstacles. Due to the diversity of tasks, it is not mandatory to maintain specific formations of the leaders. This section focuses on avoiding static and dynamic obstacles, combining synchronous DMPC with VO to design control laws for the leader layer. The leader layer formation control objectives can be described as follows where , is the common reference trajectory, represents the desired relative position between UAV and , is the safe radius of the UAV, and represent the position and threat radius of obstacle , respectively, and is the set of obstacles.

When using a synchronous strategy to calculate control inputs, it is not possible to know the real control inputs and states of the other UAVs. The assumed control inputs and assumed states need to be introduced, and the variable declarations are shown in Table 1.

The assumed control input is defined as where is the feasible control input at . The assumed state is defined as where is the next state of under the action of . Then, and are defined.

3.2.1. Cost Function

Given the weight parameters and , the cost function of the leader is defined as with where , , , , and and are the reference state and reference input, respectively. in needs to be designed.

3.2.2. Collision Avoidance and Obstacle Avoidance Constraints

In the receding horizon, the collision avoidance term in equation (4) should have been written as

where . However, due to the inability to obtain the real position of neighbor , the assumed position has to be used instead. Equation (9) is updated to

To ensure safety, the position compatibility constraint is designed to constrain the deviation of the assumed position information: where and , . Combining (10) and (11) yields

In this way, both the collision avoidance term in equation (4) and equation (9) can be guaranteed.

In the receding horizon, the obstacle avoidance constraint is written as

The type of obstacle can be static or dynamic. Because obstacles do not have computing and communication functions and cannot provide assumed state information, the design of the obstacle avoidance constraint differs from the design of the collision avoidance constraints. In practice, can be obtained by equipping UAVs with detection sensors and corresponding estimation or prediction algorithms. The design of the control law is based on the availability of .

3.2.3. Terminal Constraints

In conventional synchronous DMPC, it is necessary to design terminal components (including the terminal controller, terminal set, and terminal cost function) to ensure the stability of the system [21]. However, to avoid dynamic obstacles, in this paper, the design pattern is changed, and the VO is combined with collision avoidance and obstacle avoidance constraints [22] to design terminal constraints instead of a terminal set to ensure the safety and stability of the system.

When for collision avoidance and obstacle avoidance constraints (10), (11), and (13), it can be obtained that

Assuming that the velocity of the UAV remains constant at , based on the VO [22], the constraint at can be designed as where , , and .

The terminal constraints (14) and (15) make a feasible control input for terminal moment, which means that the velocities of the UAV and obstacles remain constant.

Note 1. In the previous work [22], the acceleration was taken as the control input during modeling, and was the terminal feasible control input while remaining the velocity constant. The control input of this paper is the desired velocity, and according to the dynamic equation (3), is the terminal feasible control input.

Note 2. The obstacle avoidance constraint in terminal constraint (15), when considering , strictly speaking, can only avoid obstacles of static and uniform motion. In practical applications, since the optimization problem is solved iteratively based on the sampling period . It can make , so that dynamic obstacles that can be approximated as uniform motion within can also be avoided. Due to the obstacle avoidance constraints when , the safety of avoiding dynamic obstacles can be guaranteed. Furthermore, according to the terminal obstacle avoidance constraints, reducing and increasing and can improve the ability to avoid dynamic obstacles.

3.2.4. Terminal Controller and Terminal Cost Function

Based on the terminal constraints in Section 3.2.3, this section designs the terminal controller and the terminal cost function based on the principle of system stability, and it provides a new method for determining key parameters of the terminal components that are suitable for them.

The terminal controller is designed as where ; is to be designed. Meanwhile, based on the design of the terminal constraints, the terminal controller satisfies

The terminal cost function is designed as where ; is to be designed.

By introducing equation (16) into the formation model (3) and assuming that the reference trajectory also satisfies the dynamic model (3), the error model can be obtained as follows:

By combining equations (7), (16), (18), and (19), it can be concluded that where .

To ensure the stability of the swarm system, the key parameters and in the terminal components can be determined through optimization problem 1, defined as follows:

Optimization problem 1: where .

is selected offline, and the selection principle is to try to make the eigenvalues of tend to zero or be less than zero when solving online. This can ensure that there is always a pair of and at moment , ensuring that the conditions and hold.

3.2.5. Algorithm Implementation and Stability Proof

Taking into account the cost function, collision avoidance and obstacle avoidance constraints, and terminal components (terminal constraints, terminal controller, and terminal cost function) designed earlier, the optimization problem for each UAV in the swarm is defined as follows:

Optimization problem 2: where and . The constraints are denoted as (22. a) ~ (22. i). The steps for solving the optimization problem 2 are provided in Algorithm 1.

   Offline initialization parameters: Select the sampling period and the prediction horizon . For UAV , given the weight parameters and , and the desired vector , determine in the terminal cost function.
   Online solving:
   (i)
   Provide initial optimal control input and initial optimal state , .
   (ii)
   Step 1: sample the current state and obtain the assumed position , , .
   Step 2: solve optimization problem 2 and use , , and during the solution process to simultaneously solve optimization problem 1, ultimately obtaining the optimal control input sequence , , selecting , and also obtaining the corresponding of the optimal solution.
   Step 3: calculate the assumed state using equations (3) and (6), and send to UAV .
   Step 4: , return to Step 1.

According to Algorithm 1, Theorem 1 is given as follows.

Theorem 1. At moment , the swarm leader UAVs synchronously solve their optimization problems, given by optimization problem 2, according to Algorithm 1. If there is a feasible solution to optimization problem 2 for each UAV at , then for all , optimization problem 2 for each UAV is feasible. Furthermore, the system composed of swarm leader UAVs is asymptotically stable.

Proof. (i)Recursive feasibilityAt moment , if the optimization problem 2 of UAV is feasible, the optimal control input is represented as , , and the optimal state is represented as , . Based on equations (5) and (6), the control input and state are constructed as and , respectively.
First, at moment , and corresponding in and satisfy constraints (22.a)–(22.g) at moment . Second, the terminal constraints designed based on the VO enable to satisfy constraints (22. a)–(22. g) at moment . Third, under the action of also satisfies the terminal constraints (22. h)–(22. i) at moment . Therefore, is a feasible solution for optimization problem 2 at moment . Furthermore, if there is a solution at moment , then there must be a solution at moment . If there is a solution at the initial moment, then there will be a solution at every future moment. (ii)StabilityThe Lyapunov function is defined as the sum of the optimal costs of all leader UAVs: Taking the feasible control input and state at moment as and , respectively, it can be obtained that Based on equations (23)–(25) and (20) in the terminal component, it can be obtained that If , , and , then .
According to equation (21), there is always a pair of and at moment that can ensure that and hold. Thus, holds, meaning that the system composed of swarm leader UAVs is asymptotically stable.

3.3. Follower Layer Control Law Based on Member-Level Obstacle Avoidance Strategy

When the follower layer adopts the member-level obstacle avoidance strategy, all members of the swarm have the obstacle avoidance function, and the followers do not need to strictly maintain the formation during obstacle avoidance. In each group, the leader tracks the global reference trajectory, while followers track the group reference trajectory.

3.3.1. Cost Function

When the follower layer adopts the member-level obstacle avoidance strategy, the objectives of the follower layer are to track the group’s reference trajectory, avoid collisions, avoid obstacles, and maintain formation.

For group in the swarm, the cost function of follower is defined as

The stage cost function and terminal cost function are, respectively, where , , , , , and . is the reference state of group and is the same as the reference state of leader , i.e., . is the desired relative position between follower and the group reference trajectory , is the desired relative position between follower and , and is the neighbor set of follower .

3.3.2. Constraints

The constraints that need to be designed in the following layer also include collision avoidance, obstacle avoidance constraints, and terminal components, but due to the consideration of the formation maintenance in the cost function, state compatibility constraints need to be added.

In the member-level obstacle avoidance strategy, the followers of each group also have the obstacle avoidance function, so the obstacle avoidance and avoidance constraints remain unchanged: where , , and . In follower layer, follower can communicate with other members of group and all members of adjacent group .

When considering the formation maintenance term in the cost function, in order to ensure the stability of the system due to the uncertain deviation between the assumed state and the real state, additional compatibility constraint are usually imposed to limit the deviation. The design of the state compatibility constraint is as follows: where , , , , , , and .

Next, terminal constraints are designed. The terminal constraints for collision avoidance and obstacle avoidance in the following layer are the same as those given by equations (14) and (15). When , the state compatibility constraint (30) becomes

Similar to equation (15), based on the VO, when , the state compatibility constraint (30) becomes where , , , , and . , where , , , and.

The terminal constraints (14), (15), (31), and (32) make a feasible control input at the terminal moment.

Finally, the terminal controller and terminal cost function are designed. The forms of the terminal controller and terminal cost function are the same as those given by equations (16) and (18), respectively, but due to changes in the cost function, the determination of the parameters and also needs to be changed accordingly.

By combining equations (27), (16), (18), and (19), it can be obtained that where

Similarly, the key parameters and in the terminal components can be determined by solving optimization problem 3, expressed as follows:

Optimization problem 3: where

3.3.3. Stability Proof

When the follower layer adopts the member-level obstacle avoidance strategy, for each follower, (i) the cost function should be (27). (ii) When , the collision avoidance and obstacle avoidance constraints are (29), and the compatibility constraint is (30). (iii) When , the terminal constraints for obstacle avoidance and avoidance are (14), and the terminal constraint for compatibility is (31). (iv) When , the terminal constraints for obstacle avoidance and avoidance are (15), and the terminal constraint for compatibility is (32). Therefore, optimization problem 4 can be described as:

Optimization problem 4: where . In the cost function, , and in the collision avoidance constraints, .

The process of this algorithm is completely consistent with that of Algorithm 1. On the basis of Algorithm 1, (1) add the weight parameter , convergence speed parameter , and desired vectors and in the offline stage. (2) Obtain the assumed position , and assumed state , in Step 1. (3) Simultaneously solve optimization problems 4 and 3 in Step 2. (4) Calculate in Step 3 and send and to UAV and , respectively.

Theorem 2. At moment , the follower UAVs in group of the swarm synchronously solve their optimization problems, given by optimization problem 4, according to Algorithm 2. If there is a feasible solution to optimization problem 4 for each UAV at , then for all , optimization problem 4 for each UAV is feasible. Furthermore, the system composed of follower UAVs in group is asymptotically stable.

Proof. (i)Recursive feasibilityThis proof is the same as the recursive feasibility proof of Theorem 1. (ii)StabilityA new Lyapunov function is defined as the sum of the optimal costs for all follower UAVs in group . Taking the feasible control input and state at moment as and , respectively, equations (24) and (25) and the following equation can be obtained: By combining equations (37), (24), (25), (38), and (33), it can be obtained that where , , and .
State compatibility constraint equation (30) is applied, and the first two terms of equation (39) can be changed to Equation (40) is reintroduced to equation (39) to obtain where .
According to equation (34), there is always a pair of and at moment that can satisfy and . Thus, is satisfied, meaning that the system composed of follower UAVs in group is asymptotically stable.

The system composed of swarm leader UAVs is asymptotically stable, and the system composed of follower UAVs in each group is also asymptotically stable. In the member-level obstacle avoidance strategy, the reference state of each group coincides with the reference state of the group leader, so the entire swarm system is stable.

3.4. Follower Layer Control Law Based on Group-Level Obstacle Avoidance Strategy

When formation maintenance is a priority, the group-level obstacle avoidance strategy can be adopted. The leader of each group has the obstacle avoidance function, while the group followers do not have the obstacle avoidance function and only track the real-time trajectory of the group leader. When the leader avoids obstacles, the determination of the safety radius needs to consider all followers within the group.

3.4.1. Cost Function

When the follower layer adopts the group-level obstacle avoidance strategy, the objectives of the follower layer are to track the trajectory of the group leader, avoid collisions between UAVs, and maintain formation.

For the group in the swarm, the cost function for defining follower is still where , , , , and represents the desired relative position between follower and leader .

However, at moment , follower cannot obtain the state information of leader at both the current moment and the next moments.

If the leader’s assumed state is adopted, the assumed states for the future of moments and are different at the same time, i.e., , which will result in the inability to guarantee a decreasing tracking error for each follower and the stability of the system being compromised. Therefore, using the leader’s assumed state in the tracking term of the cost function is not a good choice.

In the field of formation control based on synchronous DMPC theory [21, 22], it is a prerequisite for research that the reference trajectory is provided by a virtual leader (i.e., can be obtained), and the problem of tracking the leader’s real-time trajectory has not been fully studied yet.

This paper provides a feasible approach. Since follower requires the state , of leader , it is possible to have leader fly for moments first and then record . At this moment, follower starts tracking and obtains the state of leader . This converts real-time trajectory tracking into tracking a known reference trajectory, but there is an second tracking delay. When the formation maintenance is a higher priority and if is small, such a tracking performance is acceptable.

3.4.2. Stability Proof

For the follower layer, the control law design using the group-level obstacle avoidance strategy and the control law design using the member-level obstacle avoidance strategy are similar. Except for the selection of tracked trajectories, the biggest difference is that in the group obstacle avoidance strategy, the followers within the group do not have obstacle avoidance function. When using the group-level obstacle avoidance strategy, the design of collision avoidance constraints, compatibility constraint, terminal constraints, terminal controller, and terminal cost function is almost identical to that when using the member-level obstacle avoidance strategy. The control law design of the group-level obstacle avoidance strategy only requires the obstacle avoidance part of the control law of the member-level obstacle avoidance strategy to be removed and the reference state and reference control input to be replaced with and , respectively.

Referring to optimization problem 4, i.e., equation (36), under the group-level obstacle avoidance strategy, the optimization problem of the followers in each group can be described as follows:

Optimization problem 5: where , , and . In the cost function, , and in the collision avoidance constraints, .

The process of this algorithm is completely consistent with that of Algorithm 2. On the basis of Algorithm 2, (1) the desired vector is replaced with the in the offline stage. (2) Optimization problem 5 and problem 3 are multi-objective solved in Step 2.

Theorem 3. At moment , the follower UAVs in group of the swarm synchronously solve their optimization problems, given by optimization problem 5, according to Algorithm 3. If there is a feasible solution to optimization problem 5 for each UAV at , then for all , optimization problem 5 for each UAV is feasible. Furthermore, the system composed of follower UAVs in group is asymptotically stable.

Proof. The proof is completely consistent with the proof of Theorem 2.
The system composed of swarm leader UAVs is asymptotically stable, and the system composed of follower UAVs in each group is also asymptotically stable. In the group-level obstacle avoidance strategy, the followers of each group track the real trajectory of the leader, so the entire swarm system is stable.

Note 3. The control algorithm proposed in this paper has two forms, corresponding to obstacle avoidance strategies. (1) Under the member-level obstacle avoidance strategy, the leader layer adopts Algorithm 1 and the follower layer adopts Algorithm 2; (2) under the group-level obstacle avoidance strategy, the leader layer adopts Algorithm 1 and the follower layer adopts Algorithm 3.

4. Simulations

This paper mainly focuses on the GFC problem of UAV swarms in obstacle environments and proposes a grouping formation and obstacle avoidance control algorithm based on synchronous DMPC. Two types of simulations were conducted: (1) a scenario of a single group avoiding obstacles was established to verify the superiority of the proposed algorithm in obstacle avoidance and (2) a scenario of multiple groups avoiding obstacles was established to verify the effectiveness of the proposed algorithm, and the member-level obstacle avoidance strategy was compared with the group-level obstacle avoidance strategy..

4.1. Scenario of Single Group Avoiding Obstacles

In the scenario of a single group avoiding obstacles, the swarm was considered as to be a large group, and the follower layer control law based on member-level obstacle avoidance was implemented. Compared to the leader layer control law, the follower layer control law considers the cost of the formation maintenance more. The swarm tracks the common reference trajectory.

In the simulations discussed in this section, a swarm of UAVs in three-dimensional space was considered, each of which satisfied the dynamic model (2), where . The three velocity components in each UAV state vector were not allowed to exceed 15 m/s, and the velocity commands in the control input were not allowed to exceed 15 m/s. In the simulation, the sampling time was set to ; the predict horizon was set to ; the weight parameters were set to , , and ; and the convergence speed parameter was set to . The inter-UAV communication topology and inter-UAV neighbor relationship topology are represented by adjacency matrices:

indicates that UAV and UAV could communicate with each other, while indicates that UAV and UAV were neighbors to each other. The safety radius was set to  m.

To better describe the formation control performance, the following definitions are given. The minimum distance between UAVs is defined as

The minimum distance between the UAVs and obstacles is defined as

The formation error is defined as

The tracking error is defined as

The initial state and desired formation of the UAV swarm were set to

Furthermore, , . The common reference state trajectory was set as a fixed point , and the reference state trajectory of each UAV was . was selected. Five cylindrical obstacles (including two dynamic ones) were present, which were defined as , , , , and . The threat radius was set to , .

Figures 2(a) and 2(b) show the movement trajectories of the swarm in a complex obstacle environment. The swarm departed from the starting point, passed through the obstacles, and finally reached the desired position and formed the desired formation.

Figure 3 shows the distances between UAVs and distance between UAVs and obstacles. The minimum distance between UAVs was at the starting point, so . The minimum distance between the UAVs and the obstacles was , so . The swarm met the requirements for collision and obstacle avoidance. It can be seen that the algorithm proposed in this paper is capable of tracking, collision avoidance, and avoiding static and dynamic obstacles.

Figure 4 shows the formation and tracking errors of the swarm. Table 2 shows the performance comparison. Based on Figure 2, Figure 4, and Table 2, the obstacle avoidance performances of the APF algorithm [10], the consensus theory algorithm [15], and the proposed DMPC-based algorithm in the complex and dense obstacle environment were compared. (1) The swarm formation error band was set to . The time for the APF algorithm to enter the error band was 7.4 s, the time for the consensus theory algorithm to enter the error band was 6.8 s, and the time for the proposed algorithm to enter the error band was 6.4 s. When  s, the formation error of the APF algorithm was 174.75 m larger than that of the proposed algorithm, and the formation error of the consensus theory algorithm was 109.17 m larger than that of the proposed algorithm. It can be seen that the speed of forming the desired formation of the proposed algorithm is faster. (2) The swarm tracking error band was set to . The time for the APF algorithm to enter the error band was 7.2 s, the time for the consensus theory algorithm to enter the error band was 7.7 s, and the time for the proposed algorithm to enter the error band was 6.7 s. It can be seen that the obstacle avoidance path of the proposed algorithm was better and that the tracking speed of the proposed algorithm was faster.

Figure 5 shows and cost function curves. Every curve in Figure 5(a) is negative at all times, and . Furthermore, can be obtained. On the other hand, in Figure 5(b), monotonically decreases and tends to 0. Therefore, the swarm system is asymptotically stable.

In summary, among the algorithms that consider collision avoidance, obstacle avoidance, and tracking, the proposed algorithm has some advantages in swarm obstacle avoidance. (1) From the horizontal comparison, the algorithm in this paper performed better than the typical APF algorithm [10] and consensus theory algorithm [15] in avoiding obstacles, forming formation faster and tracking performance better. (2) From the vertical comparison, literatures [2125] were all formation controllers designed based on DMPC, but they could only avoid static obstacles, while the algorithm in this paper can avoid static and dynamic obstacles at the same time and can ensure the stability of swarm, with more comprehensive obstacle avoidance ability.

4.2. Scenario of Multiple Groups Avoiding Obstacles

In this section, a scenario of multiple groups avoiding obstacles is examined to verify the effectiveness of the proposed algorithm. The results are compared with those of the member-level obstacle avoidance strategy with the group-level obstacle avoidance strategy.

A swarm system composed of three leaders and eight followers was simulated.

Leaders were numbered 1–3, and followers were numbered 4–11. The specific grouping sets were , , and . During the simulation, the parameters were set as follows: , , , , , , and . In particular, to make the tracking delay of the follower layer in the group-level obstacle avoidance strategy smaller, the prediction horizon was set to . The inter-UAV communication topology and inter-UAV neighbor relationship topology are represented by adjacency matrices:

Communication topology is related to collision avoidance constraints. Since there are only 11 UAVs in the swarm in the simulation scenario setting, it is reasonable to allow all UAVs to communicate with each other. Neighbor topology is used to calculate the formation maintenance term in the cost function. Leaders were neighbors to each other, and members within the group were neighbors to each other (including group leader).

To better describe the grouping formation control performance, the following definitions are given. The tracking error of the leader layer is defined as

The formation error of the leader layer is defined as

Typically, the tracking error of the follower layer is defined as

Due to the particularity of the group-level obstacle avoidance strategy, the second type of the tracking error of the follower layer is defined as

The formation error of the follower layer is defined as

The tracking error of the entire swarm is defined as

The formation error of the entire swarm is defined as

The simulation scenario settings are as follows: a swarm consisting of 11 UAVs escorts a cooperative UAV of the friendly side, with group 1 and group 3 undertaking a strike mission and group 2 undertaking a reconnaissance mission. The initial state and desired formation of the UAVs were, respectively, set to

The cooperative UAV of the friendly side was considered to the common reference trajectory and satisfy the dynamic equation (3). The reference trajectory was set as

Three cylindrical obstacles (including one dynamic obstacle) were present, which were defined as , , and.

The threat radius was set to , .

Figures 6(a) and 6(b) show the top view of the trajectory of the entire swarm under two obstacle avoidance strategies. The swarm was divided into three groups, each playing different roles. The swarm departed from the starting point, then crossed obstacles, and finally caught up with UAV of the friendly side and formed an escort formation. Under the member-level obstacle avoidance strategy, the swarm can temporarily change the formation within the group to avoid obstacles, making the overall formation freer. Under the group-level obstacle avoidance strategy, the priority of the swarm was to maintain the formation within the group. Obstacle avoidance was completed by the group leader, and the formation within the group was well maintained.

In Figures 710, the curves under the member-level obstacle avoidance strategy are represented by solid lines (-), while the curves under the group-level obstacle avoidance strategy are represented by dashed lines (-- or -.).

From Figures 7 and 8, it can be seen that under the two obstacle avoidance strategies, and . Therefore, and . Under the two obstacle avoidance strategies, the swarm meets the requirements of collision avoidance and obstacle avoidance.

Figures 9 and 10 show the formation and tracking error curves, respectively. Under the two obstacle avoidance strategies, the formation error of the entire swarm and the tracking error of the entire swarm converged to zero. Based on Figures 610, the grouping formation control algorithm under the two obstacle avoidance strategies proposed in this paper could complete the escort task in the obstacle environment.

Furthermore, the advantages and disadvantages of the two obstacle avoidance strategies were compared based on Figures 6, 9, and 10.

In terms of the formation maintenance performance, the results were as follows: (1) According to the formation error of the leader layer , the formation maintenance performance of the member-level obstacle avoidance strategy was better. Because the determination of the group leader’s safety radius in group-level obstacle avoidance strategy needs to consider the distribution of all group members, the leader’s maneuver underwent a greater change in terms of the formation shape when avoiding obstacles. (2) According to the formation error of the follower layer , the formation maintenance performance of the group-level obstacle avoidance strategy was better. The followers of each group took formation maintenance as the priority, and obstacle avoidance was completed by the group leader without changing the formation within the group. Thus, the formation maintenance performance was better. (3) According to the formation error of the entire swarm , the formation maintenance performance of the member-level obstacle avoidance strategy was better.

In terms of the tracking performance, the results were as follows: (1) According to the tracking error of the leader layer , the error curves under the two strategies were similar. (2) Regarding the tracking errors of the follower layer, when of member-level obstacle avoidance strategy (taking as the group reference trajectory) and of group-level obstacle avoidance strategy (taking as the group reference trajectory) were compared, the tracking performance of the group-level obstacle avoidance strategy was better. But in the group-level obstacle avoidance strategy, the tracking delay was indeed a problem. (3) When the tracking errors of the follower layer were both unified as , the tracking performance under the member-level obstacle avoidance strategy was better. (4) According to the tracking error of the entire swarm , the tracking performance of the member-level obstacle avoidance strategy was better.

In general, the formation maintenance performance of the group-level obstacle avoidance strategy was better, and the tracking performance of the member-level obstacle avoidance strategy was better. The group-level obstacle avoidance strategy had a better tracking performance under the evaluation standard of the second type of tracking error of the follower layer, but there was a tracking delay problem.

Figure 11 shows the cost function curves under two obstacle avoidance strategies. The cost function curve of the leader layer (due to order of magnitude, this curve is not drawn in Figure 11(b), but this curve almost coincided under two strategies) decreased and tended to zero. Therefore, the two systems composed of leaders were asymptotically stable under two obstacle avoidance strategies.

Under the member-level obstacle avoidance strategy, the cost function curves of the three groups in the follower layer decreased and tended to 0. Under the group-level obstacle avoidance strategy, after a delay of , the cost function curves of the three groups in the follower layer also decreased and tended to 0 (the group-level obstacle avoidance strategy took the group leader trajectory as the reference trajectory, so the order of magnitude of was relatively small). Therefore, the three systems composed of followers were asymptotically stable under two obstacle avoidance strategies. Furthermore, under two strategies, the entire swarm was asymptotically stable.

In summary, the grouping formation control algorithm under the two obstacle avoidance strategies proposed in this paper enabled the swarm to complete escort tasks in an obstacle environment and ensured the stability of the swarm system. The formation maintenance performance of the group-level obstacle avoidance strategy was better, and the tracking performance of the member-level obstacle avoidance strategy is better. The group-level obstacle avoidance strategy has better tracking performance under the evaluation standard of the second type of tracking error of the follower layer, but there is a tracking delay problem. Both obstacle avoidance strategies have their advantages and disadvantages, and different obstacle avoidance strategies can be chosen based on different needs.

5. Conclusions

In this paper, the GFC problem of UAV swarms in obstacle environments was studied. First, a grouping and layering control framework was established: the swarm was divided horizontally into several independent groups and vertically into a leader layer and a follower layer. Second, two obstacle avoidance strategies were proposed based on different priorities: member-level obstacle avoidance and group-level obstacle avoidance. Third, with the aim of avoiding dynamic obstacles, the synchronous DMPC and VO were combined to obtain the leader layer control law. On the basis of the leader layer control law, further considering the formation maintenance term, two control laws for the follower layer were given according to different obstacle avoidance strategies. The stability of the swarm under this control algorithm (including leader layer control law and follower layer control laws) was theoretically proved. Finally, through simulation, it can be concluded that (1) the designed single-layer control law can simultaneously avoid static and dynamic obstacles and had advantages in obstacle avoidance performance, formation speed, and tracking performance and (2) the designed grouping formation control algorithm could complete tasks in obstacle environments under both obstacle avoidance strategies. The formation maintenance performance of group-level obstacle avoidance strategy was better, while the tracking performance of member-level obstacle avoidance strategy was better. Both obstacle avoidance strategies had their own advantages and disadvantages, and different obstacle avoidance strategies can be selected according to different needs.

The algorithm proposed in this paper has good theoretical and practical value for solving problems such as large-scale formation, multitarget tracking and strike, formation escort, target encirclement, and saturation attack in obstacle environments.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work is supported by the National Natural Science Foundation of China (61903374).We thank LetPub (http://www.letpub.com/) for its linguistic assistance during the preparation of this manuscript.