A Collective Control Scheme to Solve Time-varying Formation Control Problem of Multiple Autonomous Underwater Vehicles with Time Delay

Due to the limitation of complexity and uncertainty of the underwater environment, the related technologies of autonomous underwater vehicles(AUVs) develop slowly. Therefore, an ingenious solution characterized by low cost, conve-nient operation, and low individual intelligence is urgently required. Inspired from these collective behaviours of gregarious creatures in nature, the coordination control problem of multiple AUVs is endowed with new research signiﬁcance to complete complex underwater operational tasks. This paper aims to propose a general control scheme to solve the time-varying formation control problem of multiple AUVs that take into account the communication time delay. Firstly, a complete six-degrees-of-freedom dynamical model is applied instead of the real AUVs in the following theoretical analysis and simulation veriﬁcation. Then, a metric-based nearest neighbour interacted rule is introduced to build the communication network of the system. Periodic sampling technology and zero-order hold loop are adopted to simplify the communication problem of time delay. Based on the above dynamical model and communication mechanism, a distributed collective control protocol is proposed to enable these AUVs asymptotically converge to a desired geometrical conﬁguration on the condition that the initial communication network is undirected and connected. During the evolutionary process, no collision happens between any two AUVs. The formation conﬁguration can be maintained until a simple switching controller works for the conﬁguration transformation tasks. Finally, the simulation results proved the effectiveness of the above collective control scheme and visually exhibited the three-dimensional dynamical evolutionary process.


Introduction
In recent years, the rapid development of robotic technologies has greatly facilitated industry production, agricultural implementation, even people's life. Therein, coordination control technology of multiple robots attracts more and more attention not only because these robots can liberate human hands but also greatly improve work efficiency [1] [2][3] [4]. Besides, these robots also play an irreplaceable role in exploring unknown spaces in the world. Because of the complexity and uncertainty of an underwater environment, how to solve the formation control problem of multiple autonomous underwater vehicles has gradually become a hot and difficult scientific topic.
The traditional formation control methods include the leader-follower method [5], behaviour-based method [6], artificial potential method [7], virtual structure method [8], and so on. The period during which these traditional control methods are adopted can be defined as the Former-Formation Control Era(FFCE). The FFCE emphasizes that various autonomous vehicles complete a task together for the purpose of improving completion efficiency and reducing completion time. In recent years, multiagent technology has developed rapidly and also brought new research inspirations to the formation control problem [9], which is called the Post-Formation Control Era(PFCE). Except for these advantages of traditional formation control, the new formation control system applied multi-agent technology also has the advantages of low cost, strong robustness, flexible system configuration, and strong anti-interference ability [10].
The future development of the formation control problem mainly extends in two directions. Firstly, due to the development of hardware technology, a single robot is endowed with better location perception, data analysis, motion control, and other capabilities, which bring the possibility for multi-robot systems to perform more complex collaborative tasks. This direction can be regarded as a direct extension of F-FCE. Secondly, inspired by the collective behaviour of gregarious creatures in nature, how to solve the formation control problem of large-scale(hundreds) multi-robot systems is the main research content of PFCE. The collective technology was thus born, which emphasizes that a group of individuals with limited intelligence can complete complex tasks just relying on simple rules and local interactions.
The movement of autonomous underwater vehicles(AUVs) in the three-dimensional underwater space is always affected by the uncertain hydrodynamic force and the complex underwater environment. Therefore, robustness, flexibility, and effectively control algorithm is urgently required. In this paper, we mainly discuss the basic control scheme to solve the formation control problem of multiple autonomous underwater vehicles(AUVs) using collective technologies. The collective control scheme is developed on the basis of an open system architecture using distributed control protocol and self-organizing network architecture. The characteristics of functional decentralization ensure that the failure of one or some robots will not affect the completion Title Suppressed Due to Excessive Length 3 of the final task. The emergence of group intelligence of the robot system is decided only by each individual's information interaction capability, three-dimensional motion capability, data manipulation capability, and environment perception capability.
The Boid model proposed by Reynolds in 1987 is recognized as the earliest mathematical model to draw collective behaviours of social animals [11]. The flocking behaviour of birds can be reproduced by computer simulations relying on three simple heuristic rules. Since then, Vicsek [12], Couzin [13], Cucker and Smale [14], et al. have continuously improved and developed Reynolds' collective model. Cavagna et al. tried to integrate the above models by proposing a more general theory [15]. Knorn et al. gave a basic framework that is able to accommodate most of the development on collective control of the multi-agent system and divided the collective control problem into four aspects: agent dynamics, network topologies, communication mechanisms, and collective behaviours [16]. Beyond the conventional nearest neighbour interaction rule, an acute angle test interaction rule is proposed by Ning et al. for dispersion and flocking with switching topology, and simulation results proved that the new collective controller is effective and robust [17]. Jia et al. proposed a general framework to modelling kinds of flocking scenarios and have given a quantitative analysis of different flocking models, such as they already found that the collective motion under several-levels leader-follower hierarchical structure is more difficult to be destroyed by random perturbations than the egalitarian one [18]. Besides, Liu et al. applied collective strategy to resolve the formation control problem of multiple unmanned surface vessels for chasing and surrounding a target vessel [19]. Jin et al. combined the collective theory with machine learning to improve the capability of the traffic light control system enabled by hierarchical multi-agent modelling framework [20]. In a word, collective strategies can be applied not only to solve the formation control problem of the multi-agent system but also to other cooperation tasks. Furthermore, collective control protocol can be combined with machine learning and other artificial intelligence methods to solve the complex control problem.
The implement of the distributed control algorithms requires each AUV can interact the status information with its neighbours, such as position, speed, attitude, etc., because each AUV needs to update its current motion state according to its neighbours' status information. Undirected graphs are usually used to describe the topological communication relationship among AUVs. However, due to the limitations of communication bandwidth, propagation rate, communication distance, external interference, and environmental influences, there exists a complex time lag among AUVs. Therefore, the influence of time delay should also be considered in engineering applications [21] [22].
In order to ensure that these AUVs can complete high-precision formation control tasks, except advanced control algorithms, a stable and reasonable dynamic model is also needed. The dynamic model of the AUV is used to explain the relationship between the motion of the body and the force/moment exerted on the body [23]. An accurate dynamic model not only facilitates the designer to grasp the motion characteristics of the AUV but also helps to find possible design defects. The motion of each AUV is highly nonlinear and time-varying. The dynamic equation of the AUV is a six-degree-of-freedom, multiple-variable, and high-coupling differential equation. More importantly, there exist uncertain interference factors, such as uncertain hy-4 Y N Jia and W C Zhang drodynamic coefficients, ocean currents, and other environmental factors. In order to obtain an accurate dynamic model, there are mainly two methods. One is to generate a mathematical model by applying physical tools based on the AUV's mechanical structure, hydrodynamic analysis, thruster layout, and other factors, which is called the analytical method. The other is to directly derive the dynamical model based on the known input/output experimental data, which is called system identification. A general mentality is to combine the above two methods. That is, an analytical method is used to get the mathematical model first, and then the system identification method is applied to confirm the model parameters. However, because of the high cost of experimental data and the abundant species of the hydrodynamic propulsion structure of underwater robots, it is hard to obtain a uniformly available hydrodynamic model. Therefore, this paper discusses a complete six-degrees-of-freedom dynamic model of the AUV, which is not limited to a specific type of underwater equipment. The relevant conclusions and methods can be derived for cooperative control tasks of other AUVs with a similar dynamical model. This paper is mainly based on the Boid model to implement time-varying formation control tasks. First of all, it is necessary to construct a dynamic model for each autonomous underwater vehicle (AUV) on the condition that each AUV is isomorphic and has the same dynamic characteristics. Secondly, the information interaction among these AUVs is drawn by dynamically switchable communication networks on the basis of the metric-based nearest neighbour interaction rules. Besides, the communication time delay is also considered. Third, based on the above dynamic model and switch communication network with time delay, a distributed collective control protocol is designed for each AUV. Each AUV adjusts its behaviour according to the above control protocol to form a consistent and cohesive time-varying formation. Besides, the stability of the AUV system is proved. Finally, numerical simulations are carried out on 30 AUVs to verify the effectiveness of the above control scheme.
The rest of this paper is organized as follows. The dynamical model of each AUV is given in section II. Section III introduces the design of the switching and time-delay communication network. Based on the proposed assumptions, section IV presents a collective algorithm to execute the time-varying formation control task with consideration of time delay. The stability of the AUV system is also proved. In section V, taking the formation control task of 30 AUVs as an example, the effectiveness of the above controls scheme is validated. The simulation results of the formation transition of these 30 AUVs are also given in section V. Finally, the conclusions are drawn in section VI.

Modeling
Suppose that there are N AUVs sailing freely in a three-dimensional underwater area. Every AUV satisfies the condition of static balance, that is, the buoyancy in the water is equal to its gravity. Then, the six-degree-of-freedom complete dynamic model of Title Suppressed Due to Excessive Length 5 the ith AUV(i = 1, · · · , N) is given as follows [24] .
, ω i (t) denote the linear speed component of the ith AUV along the surge axis, sway axis, and heave axis at time t; p i (t), q i (t), r i (t) denote the roll angular speed, pitch angular speed, and yaw angular speed of the ith AUV at time t; F xi (t), F yi (t), F zi (t) denote the force component of the ith AUV along the x-axis, y-axis, and z-axis at time t; M xi (t), M yi (t), M zi (t) denote the torque component of the ith AUV along the surge axis, sway axis, and heave axis at time t; I xi = ∫ (y 2 i + z 2 i )dm i represents the moment of inertia of the ith AUV around the x axis, I yi = ∫ (x 2 i + z 2 i )dm i represents the moment of inertia of the ith AUV around the y axis, I zi = ∫ (x 2 i + y 2 i )dm i represents the moment of inertia of the ith AUV around the z axis; m i denotes the quality of the ith AUV, i = 1, · · · , N. In particular, individual differences do not exist among these AUVs, the value of m i doesn't change versus time. That is to say, m i is equal to m j for Therein, F i (t) and M i (t) are considered as the control input of the ith AUV at time t. Our task is to design F i (t) and M i (t) to satisfy the collective tasks. In this paper, every variable is time-variant, except for these declared to be time-invariant. Therefore, we may use Q instead of Q(t) for short in the following sections. Then, the equations in 6 Y N Jia and W C Zhang (1) can be merged into the following matrix form: where Title Suppressed Due to Excessive Length 7 and As shown in Fig. 1, consider the case that the external form of the AUV can be approximated as a cylinder, and each AUV is driven by a single screw propeller at the tail of the vector propulsion. Thrust vector technology can be applied to endow the AUV with three-dimensional movement capability. Because the AUV is symmetrical along the XOY axis and the XOZ axis, we get I yi = I zi . Let the diameter of the cylinder be R = 0.2m, the body length be l = 2m, and the mass be m = 50kg. According to the formula of the moment of inertia, we can obtain that

Communication Mechanism Design
As mentioned above, each AUV relies on its neighbour's status information to make decisions. Therefore, the communication mechanism of these AUVs is one of the indispensable contents of the collective control scheme, which is absolutely related to the convergence performance of the emergence of collective behaviours. Generally, a metric-based interaction mechanism named the nearest-neighbour interaction rule is adopted. That is to say, when the distance between two AUVs is less than the communication radius R, the two AUVs are considered to be neighbours. Information can interact only among neighbours. A communication network is built according to the interactive relationship among these AUVs, which is usually drawn by an undirected graph ξ (t). Therein, the node set is ν = {1, 2, · · · , N}, and the time-varying edge set is ε ∈ ν × ν. ν is a finite set and not empty. If AUV i and AUV j are neighbors at the time t, then ( j, i) ∈ ε(t).
The set of neighbors of the AUV i at the time t is denoted by N i (t). The set of neighbors of the AUV i at the initial moment is defined as where ∥ • ∥ is the Euclidean norm, and D is the communication radius. The communication network of the AUV system is time-varying because the distances between these AUVs change with time during the convergent process. Suppose that ξ (t) is connected at the initial moment. The time-varying communication network ξ (t) is supposed to switch at t p , p = 1, 2, · · · . Then, in order to keep the connectivity of the network, one hysteresis is introduced [25]: Obviously, ξ (t) is fixed on every non-empty, bounded, continuous time period [t r ,t r+1 )(r = 0, 1, · · · ). In order to clarify the neighbor relationship, the adjacency matrix A N = [w i j ] N×N ∈ M N (R) of the graph ξ (t) is introduced as follows: Sonar is the most common communication technology for underwater vehicles. The propagation speed of sound waves in an underwater environment is υ sonar = 1500m/s. Because of the uncertainty of the underwater environment as well as the doppler effect caused by the relative distance and relative speed between the AUVs, the communication time lag among AUVs shows the characteristics of complexity and diversity. In order to simplify the problem, periodic sampling technology and a zero-order hold loop are adopted. Suppose h > 0 denotes the sampling period, and τ denotes the sampling delay. The sampling delay and the sampling period satisfy the following constraint 0 < τ < h.

Control Protocol Design
Except for the dynamical model and communication mechanism, the distributed control protocol is another indispensable content of the collective control scheme. Each AUV can independently determine its behaviour based on the control protocol, which is designed on the basis of the status information of its neighbours.

Collective Control Protocol Design without Time-Delay
Consider N AUVs governed by (1). The initial positions and the initial attitudes of these AUVs are randomly generated. Suppose that the minimum turning radius of each AUV is d min . Let D * denote the safe distance between any two AUVs, then D * = 2d min . Suppose that the initial communication network is undirected and connected. The distributed control protocol is mainly realized by the combination of consensus algorithm and artificial potential field method. The consensus algorithm is mainly used to make all individuals move at the same speed and attitude angle, while the negative gradient of the attraction/repulsion function is adopted to influence the relative positions of individuals in the group to achieve the purposes of collision avoidance, connectivity maintenance, and desired formation. According to the above principle, the distributed control protocol of AUV i is given as follows: Title Suppressed Due to Excessive Length 9 where −J −1 i B i is the gyro effect item, which will disappear when the roll angular velocity p i is zero. Besides, V (∥P i j ∥) is the potential function between the AUV i and the AUV j, whose definition is Definition 1 (potential function). The potential function V (∥P i j ∥) is a differentiable, non-negative, radially unbounded function of the distance between the AUV i and j, which satisfies the following conditions: (3) V (∥P i j ∥) reaches its unique minimum when AUV i and AUV j are located at a desired distance between D * and D.
The total potential energy of the AUV system is given by where V i (t) represents the potential energy of the AUV i at time t. Suppose that the desired linear speed vector Q d of the system is not zero. Then, we can get the following conclusions. Theorem 1. Consider a complex system composed of N AUVs with dynamics (1). The behaviour of each AUV is determined by the control protocol (12). Suppose that the initial communication topology ξ (0) is an undirected and connected graph. Then the following conclusions hold: 1. There will be no collision between any two AUVs, that is, is connected at all times; 3. The attitude angles, linear velocities, and angular velocities of all AUVs have asymptotically become the same as each other, that is, The system approaches a cohesive configuration that minimizes the total potential V , that is, dV /dt = 0.
proof. According to (2) and (12), we can obtain thaṫ Let is an undirected graph, the Laplacian matrix L N is symmetric positive semi-definite. Consider the following energy function as the common Lyapunov function: 10 Y N Jia and W C Zhang where I 3 denotes the 3 × 3 identity matrix. Then, the derivative of E(P,Θ , Q, Φ) w.r.t. the time t ∈ [t r ,t r+1 ) is: According to (2), we know thatṖ (14) into (16), dE/dt can be further expressed by K i is an antisymmetric matrix, one gets The initial potential energy of the system is limited. The initial velocities and initial attitude angles of the AUVs are also finite. Thus, the system's initial energy E(P(0),Θ (0), Q(0), Φ(0)) is finite. Since dE dt ≤ 0 for each time-internal [t r ,t r+1 ), r = 0, 1, · · · , the upper bound of E(t) is obviously its initial value E(P(0),Θ (0), Q(0), Φ(0)). Then, the system's potential energy V (t) is finite. Furthermore, the potential energy V (∥P i j ∥) between AUV i and AUV j is also finite. 1) Collision avoidance: When ∥P i j ∥ → D * , according to the first rule of definition 1, one gets V (∥P i j ∥) → ∞. However, V (∥P i j ∥) → ∞ conflicts with the conclusion that V (∥P i j ∥) is finite. Therefore, ∥P i j ∥ > D * can be obtained, which ensures that there will be no collision between any two AUVs. The conclusion 1 of Theorem 1 holds.
2) Connectivity maintenance: According to the second rule of definition 1, if for a certain (i, j) ∈ ε, there is ∥P i j ∥ → D, then one gets V (∥P i j ∥) → ∞, which is contrary to the conclusion that V (∥P i j ∥) is bounded. Then, V (∥P i j ∥) < D for all (i, j) ∈ ε and t ∈ [t r ,t r+1 ) can be obtained. Hence, whenever there is a link between two AUVs, the edge is never lost during each time-interval [t r ,t r+1 ), that is, ε(t r ) ⊆ ε(t r+1 ). Furthermore, if a new edge (i, j) / ∈ ε is added to ε, the associated potential function V (∥P i j ∥) is bounded, so the new potential energy V is also bounded. Consequently, the connectivity of the communication network can be preserved at all times. The conclusion 2 of Theorem 1 is proved.
3) Velocity Alignment: The initial interaction topology of the system is a connected graph. The number of vertices is finite. Thus the set of all connected graphs on the vertices is a finite set. Therefore, the number of switching times of the system is finite, and the interaction network ξ (t) eventually becomes fixed. The following discussion will mainly focus on the time-internal [t f , ∞), where t f is the last switching moment.

Formation Control Protocol Design without Time-Delay
The proposed distributed control protocol is inspired by the collective behaviours of social animals such as a school of fish, a flock of birds, and so on. As long as the attitudes/speeds of these AUVs are not consistent or the potential energy of the system does not reach the minimum value, the control protocol (12) keeps working all the time. According to the above analysis, when the total potential energy of the system reaches the minimum, the distance between all AUVs becomes stable. Therefore, the desired rigid formation can be obtained as long as the potential function is minimized. Based on the above collective control algorithm, the virtual structure method is adopted to further realize the formation control task of the multiple AUVs. Given a desired geometric pattern χ, which consists of N vertices In order to achieve the desired rigid formation χ, the control protocol of the AUV i can be revised by where Then, we can get the following Corollary 1, which is used to solve the collective control problem of multiple AUVs under designated formation.
Corollary 1. Consider a complex system composed of N AUVs with dynamics (1). The behaviour of each AUV is determined by the control protocol (21). Suppose that the initial communication topology ξ (0) is an undirected and connected graph. Then the following conclusions hold: 1, there will be no collision between any two AUVs, that is, The communication network ξ (t) of the system is connected at all times; 3. The attitude angles, linear velocities, and angular velocities of all AUVs have asymptotically become the same as each other, that is, Θ i = Θ j , Q i = Q j , Φ i = Φ j , i, j ∈ ν, i ̸ = j; 4. The system approaches a desired geometric configuration χ that minimizes the total potential, that is, dV /dt = 0.
The proof process of Corollary 1 is similar to that of Theorem 1. Therefore, the certification process is omitted here.

Formation Control Protocol Design with Time-Delay
As mentioned above, periodic sampling technology and zero-order hold loop are adopted to solve the formation control problem of multiple AUVs with time delay. Suppose that the sampling period h > 0 and the sampling delay τ are constants and satisfy the following constraints 0 < τ < h. Then, the specific formation control protocol of the AUV system is rewritten as follows.
Title Suppressed Due to Excessive Length 13 When t ∈ [kh, kh + τ), the control protocol of the AUV i is When t ∈ [kh + τ, kh + h), the control protocol of the AUV i is

Simulation Verification
This paper focuses on proposing a research framework and methodology to solve related formation control problems of the AUVs. Theoretical analysis and simulation verification is a low-cost method to explore underwater robotic technology, which can avoid blind trials and reduce experimental costs. Therefore, this paper focuses on the analysis and verification of the collective control scheme to solve the formation problem of AUVs from the perspective of theoretical derivation and simulation implementation and provides the necessary theoretical foundation and data model for future underwater experiments. A collective control protocol consisting of a consensus algorithm and artificial potential field algorithm is proposed to realize the coordination control tasks of multiple AUVs. The above theoretical analysis already proved that multiple AUVs under the control protocol (12) could realize collective control tasks on the condition that the initial communication network is connected. Geometric formation control problem can be resolved further by a new control protocol (21), which is designed by modifying the control protocol (12) with the desired geometric formation information χ. Furthermore, control protocol (22) and (23) offers a solution for the formation control problem of multiple AUVs considering sampling time-delay τ. In addition, a simple switching controller is introduced to realize the transformation of different geometric formations of these AUVs. In order to verify the effectiveness of the above-mentioned distributed control protocols, several simulation experiments are implemented by 30 AUVs on the Matlab platform. 14 Y N Jia and W C Zhang

Parameter Selection
Without loss of generality, the initial state of each AUV is generated randomly, on the condition that the initial interaction network of these 30 AUVs is an undirected and connected graph. Suppose that the minimum turning radius of each AUV is d min = 6m, then the safety distance between any two AUVs is D * = 2d min = 12m. During the entire collective formation process, the positions of any two AUVs i and AUV j satisfy ∥p i j (t)∥ = ∥p i (t) − p j (t)∥ ≥ 12. The communication radius between AUVs should meet the constraint condition 12m < D ≤ 1000m. Thus we choose D = 750m.
Thus, the specific potential function involved in the above control protocols is defined as the following form: where a > 0, b > 0, and c are all constants. Therein, a = 5000, and b = 1. The first term b ∥P i j ∥ 2 −D * 2 is the repulsive potential, the second term −a ln(D 2 − ∥P i j ∥ 2 ) is the attractive potential.
Then, the gradient of the potential function V (∥P i j ∥) is given by where b (∥P i j ∥ 2 −D * 2 ) 2 represents the repulsion term working in a short distance, and a D 2 −∥P i j ∥ 2 represents the attraction term acting on a long distance. The direction of attraction force and repulsion force are opposite. Then, an unique distance exists to balance the attractive and repulsive forces. Furthermore, it should be noted that the desired linear speed vector cannot be zero, and the desired roll angular speed should be zero, that is, Q d ̸ = 0 and p d = 0. When the desired pitch angular speed q d = 0 and the desired yaw angular speed r d = 0, the system converges to a uniform linear motion; when the desired pitch angular speed q d ̸ = 0 and the desired yaw angular speed r d ̸ = 0, the system stabilizes to a time-varying motion.

Simulation Analysis
There are mainly two simulation experiments, one experiment is without communication time-delay, and the other considers communication time-delay. For each experiment, 30 AUVs are carried out to realize the desired formation task first, and then they are required to change the formation configuration to another configuration, such as from herringbone-shape formation to one-shape formation. During each simulation experiment, the green star point represents the initial position of each AU-V, and the centre of the coloured ball represents the position of each AUV at the end of the simulation.  Firstly, the 30 AUVs governed by (1) under the control protocol (21) first form the desired herringbone formation. Secondly, The desired herringbone formation can be maintained for a period of time. Thirdly, the 30 AUVs transform into another desired one-shape formation under a switching controller, and the one-shape formation can be maintained at all times. The entire simulation process is 3500s, and the formation transform happens at 2500s. The simulation results are shown in Fig. 2 and Fig. 3.  Figure 2(a) shows that all AUVs gradually converge from a random initial state to a desired herringbone formation and then gradually transform into a one-shape formation under the control protocol (21). The formation details have been enlarged in Figure 2(a). Fig. 2(b) shows all the distances between any two AUVs versus time, and these distances gradually become stabilized. These distances also appear a jumping change at t = 500s, but they soon become stabilized again. Besides, conflicts between individuals can be completely avoided during the entire evolution process since all the distances between any two AUVs are larger than the safe distance D * . At the same time, the total potential energy of the system gradually decreases and finally tends to a stable value. Fig. 3(a), Fig. 3(b) and Fig. 3(c) respectively show that all AUVs gradually move at a consistent attitude angle, a consistent linear speed, and a consistent attitude angular speed. It is clear to see in Fig. 3(b) that there exists a distinct jumping change of the linear speed of each AUV at t = 2500s, which is caused by the formation transform from a herringbone configuration to a one-shape configuration. These simulation results have clearly proven that the 30 AUVs can realize the formation transform under the above-mentioned control protocol (21).

Time-varying formation transformation with time-delay
Since the sampling period h and the sampling delay τ satisfy the following condition 0 < τ < h. Therefore, we choose τ = 0.1s and h = 0.2s. Other parameters are all totally the same as the above experiment without time-delay. The simulation time t = 3500s, the simulation results of 30 AUVs under the control protocol (22) and (23) are shown in Fig. 4 and Fig. 5. Fig. 4(a) clearly shows that all AUVs gradually converge from a random initial state to a desired herringbone formation and then gradually transform into a oneshape formation. Fig. 4(b) shows the variation of the distance between all individuals over time. It can be seen that these distances gradually become stabilized. When t = 2500s, all these distances have a jumping change, but they quickly become stabilized again. This recovering process represents a formation transform from the herringbone pattern to a one-shape pattern. Fig. 5(a), Fig. 5(b), and Fig. 5(c) respectively show that all AUVs are gradually moving at the same attitude angle, the same linear speed, and the same attitude angular speed. It can be clearly seen in Fig. 5(b) that when t = 2500s, the linear speed of each AUV have distinct changes, which represents the transformation from the herringbone formation to the one-shape formation. These simulation results can clearly indicate that the 30 AUVs can realize the formation maintain and formation transformation under the above-mentioned control protocol (22) and (23).
Finally, we offer a video on the three-dimensional dynamical evolutionary process of formation maintenance and transformation. The critical snapshots of the evolutionary process of the collective experiment without time delay are shown in Fig.  6, and the critical snapshots of the evolutionary process of the collective experiment with time-delay are shown in Fig. 7. Each AUV is represented by a coloured ball, and the colour is used to express the desired formation relationship of these AUVs. The initial state of the 30 AUVs is randomly generated, which satisfy the condition that the initial communication network is connected. Both Fig. 6 and Fig. 7 show that the 30 AUVs gradually form the desired herringbone formation from the initial state of random distribution, and these AUVs line up by colour, meaning that they are arranged according to the desired formation. These AUVs keeps herringbone formation for a short while, and then they are gradually switched to configure another one-shape formation, and the adjacent relationship of these AUVs in the formation remains unchanged. Besides, Fig. 6 indicates that the AUV system can form the desired herringbone formation at around t = 800s, while Fig. 7 indicates that the AUV system can form the desired herringbone formation at more than t = 2000s. Thus, time delay has an obvious influence on the convergence rate. According to the potential function, increasing the value of a can accelerate the emergence of consensus of these AUVs to some extent.  to four parts, dynamical model, communication mechanism, control protocol, and numerical simulation. Firstly, a complete six-degrees-of-freedom dynamical model is adopted to take the place of the real AUVs in theoretical analysis and simulation verification. Secondly, a communication mechanism based on the metric-based nearest neighbour interacted rule is introduced. For the sake of conforming to the engineering applications, the communication time delay is also considered. The periodic (a) attitude angle (b) linear speed (c) attitude angular speed sampling technology and zero-order hold loop are adopted to simplify the complexity of the communication network. Thirdly, based on the above dynamical model and communication mechanism, a distributed collective control protocol is proposed to enable these AUVs asymptotically converge to form a desired geometrical configuration with time-delay constraints, on the condition that the initial communication network is undirected and connected. The formation can be maintained and also can be transformed into another one. Besides, no collision happens between any two AUVs. Finally, the simulation illustrated the effectiveness, robustness, and environmental adaptability of the above collective control scheme and visually demonstrated the three-dimensional dynamical evolutionary process. The relevant conclusions and methods can be derived for cooperative control tasks of other robots with a similar dynamical model.

Data availability
The authors declare that the data supporting the findings of this study are available within the article.

Conflict of interest
The authors declare that they have no conflict of interest.