Formation Control and Obstacle Avoidance Algorithm of a Multi-USV System Based on Virtual Structure and Artiﬁcial Potential Field

: This paper proposes a formation generation algorithm and formation obstacle avoidance strategy for multiple unmanned surface vehicles (USVs). The proposed formation generation algo-rithm implements an approach combining a virtual structure and artiﬁcial potential ﬁeld (VSAPF), which provides a high accuracy of formation shape keeping and ﬂexibility of formation shape change. To solve the obstacle avoidance problem of the multi-USV system, an improved dynamic window approach is applied to the formation reference point, which considers the movement ability of the USV. By applying this method, the USV formation can avoid obstacles while maintaining its shape. The combination of the virtual structure and artiﬁcial potential ﬁeld has the advantage of less calculations, so that it can ensure the real-time performance of the algorithm and convenience for deployment on an actual USV. Various simulation results for a group of USVs are provided to demonstrate the effectiveness of the proposed algorithms.


Introduction
Compared to a single unmanned surface vehicle (USV), the multi-USV system has numerous advantages, such as the high robustness, fault tolerance, good adaptability, and high efficiency of task execution. Therefore, the multi-USV system has broad application prospects in various areas, such as seabed surveying, rescue, material transportation, and target protection [1][2][3][4].
Several formation control algorithms are popular, including the virtual structure method [5,6], leader-follower method [7][8][9], behavior-based method [10,11], artificial potential field method [12], and graph theory method [13]. Each algorithm has advantages and disadvantages. For example, the virtual structure method can guarantee accuracy of the formation shape but cannot flexibly transform the formation structure. The leaderfollower architecture has a clear relationship between robots in formation. In addition, it is simple to deploy the algorithm to the actual robot. However, this architecture largely depends on the leader. An advantage of the behavior-based approach is that the system can rapidly expand, while it is difficult to accurately express the behavior mathematically, which thus does not guarantee the stability of the system.
Although the control methods are different in the existing literature, the research has always been focused on the formation accuracy and obstacle avoidance. To address the problem of formation collision avoidance for USVs, the leader-follower structure and distributed control strategy were adopted in [14]. A leader-follower formation control strategy was proposed for the formation of USVs, which considered partially known control

Model and Problem Statement
In this paper, formation control and obstacle avoidance algorithms for multiple USVs are proposed. This section introduces the kinematic model of the USV and statement of the formation problem.

USV Kinematic Model
In multi-USV formation, the size of the USV can be ignored compared to the formation scale, so that it can be simplified as a unicycle model.
In Figure 1, XOY represents the geodetic coordinate system, while x b o b y b represents the body coordinate system of the USV. The state information of the USV includes the location (x, y) and heading θ, while P = x y θ T is the position vector of the USV.
The kinematic equation of the USV is [27]: where v is the forward speed, while ω is the angular velocity of the USV. cos 0 sin 0 01 x v Py where v is the forward speed, while  is the angular velocity of the USV.  Figure 2 shows a diagram of the virtual structure method in which the thick dashed line denotes the shape outline of the virtual structure, while the USV dashed-line shape denotes the location distribution of each USV in the final formation. The formation implementation can be described by satisfying Equation (2)

Algorithm Design
In this section, a formation control algorithm is proposed. The virtual structure method has the advantages of a clear geometric position relationship of members in the formation and high accuracy of formation keeping. On the other hand, the artificial potential field method has the advantage of a low computational complexity in collision avoidance research. Therefore, the algorithm of the combination of a virtual structure and artificial potential field is applied for formation control. A schematic diagram of the algorithm is shown in Figure 3. The black circle represents the formation reference point, the  Figure 2 shows a diagram of the virtual structure method in which the thick dashed line denotes the shape outline of the virtual structure, while the USV dashed-line shape denotes the location distribution of each USV in the final formation. The formation implementation can be described by satisfying Equation (2):

Formation Definition
where p d i and p c i represent the desired position and current position of the i th USV, respectively, and M denotes the number of USVs in the formation. cos 0 sin 0 01 where v is the forward speed, while  is the angular velocity of the USV.  Figure 2 shows a diagram of the virtual structure method in which the thick dashed line denotes the shape outline of the virtual structure, while the USV dashed-line shape denotes the location distribution of each USV in the final formation. The formation implementation can be described by satisfying Equation (2):

Algorithm Design
In this section, a formation control algorithm is proposed. The virtual structure method has the advantages of a clear geometric position relationship of members in the formation and high accuracy of formation keeping. On the other hand, the artificial potential field method has the advantage of a low computational complexity in collision avoidance research. Therefore, the algorithm of the combination of a virtual structure and artificial potential field is applied for formation control. A schematic diagram of the algorithm is shown in Figure 3. The black circle represents the formation reference point, the

Algorithm Design
In this section, a formation control algorithm is proposed. The virtual structure method has the advantages of a clear geometric position relationship of members in the formation and high accuracy of formation keeping. On the other hand, the artificial potential field method has the advantage of a low computational complexity in collision avoidance research. Therefore, the algorithm of the combination of a virtual structure and artificial potential field is applied for formation control. A schematic diagram of the algorithm is shown in Figure 3. The black circle represents the formation reference point, the virtual structure is built around the formation reference point, the blue circle represents the point on the virtual structure, which is referred to as virtual structure point, and the orange circle represents the virtual leader. During the formation process, the path of the virtual structure depends on the formation reference point. Virtual leaders track their corresponding virtual structure points, while the USV accurately tracks the path of the virtual leader to achieve the desired formation.
virtual structure is built around the formation reference point, the blue circle represents the point on the virtual structure, which is referred to as virtual structure point, and the orange circle represents the virtual leader. During the formation process, the path of the virtual structure depends on the formation reference point. Virtual leaders track their corresponding virtual structure points, while the USV accurately tracks the path of the virtual leader to achieve the desired formation.

Generation of the Virtual Structure
where r  represents the guidance control law related to formation path planning, according to which the formation reference point moves along the desired formation path.  The reasons for the introduction of the virtual leader are as follows. In the initial stage, the USV is randomly distributed in the initialization area, which may be far away from the corresponding virtual structure point r i p . If the USV directly drives to r i p , collision between the USVs may occur. During the dynamic process, the effective control of the motion state of the USV will be lost. Similarly, during the process of formation 3.1. Generation of the Virtual Structure p r ∈ R 2 and u r ∈ R 2 represent the position and velocity vectors of the formation reference point in XOY, respectively. The motion model of the formation reference point can be expressed by: where τ r represents the guidance control law related to formation path planning, according to which the formation reference point moves along the desired formation path. p s i ∈ R 2 denotes the location of the i th virtual structure point in x b o b y b . Its location in XOY can be expressed by: where R(θ) and L represent the transformation matrix from x b o b y b to XOY and formation scaling matrix, respectively. They can be expressed as follows: The reasons for the introduction of the virtual leader are as follows. In the initial stage, the USV is randomly distributed in the initialization area, which may be far away from the corresponding virtual structure point p r i . If the USV directly drives to p r i , collision between the USVs may occur. During the dynamic process, the effective control of the motion state of the USV will be lost. Similarly, during the process of formation transformation, the shape of the virtual structure changes from p s i to p s i . The corresponding expected formation trajectory will also have a step change. The USV changes from tracking the original formation trajectory to tracking the new formation trajectory, with a large position change. In this process, there are also problems of collision between USVs and control of the USV. Using a virtual leader and enabling the USV to track it, the movement state of the USV can be effectively controlled before the generation of the formation. Simultaneously, using the virtual leader as a medium, the introduction of the artificial potential field can avoid collisions between USVs.
The motion model of the virtual leader can be expressed by: where p i ∈ R 2 and u i ∈ R 2 are the position and velocity of the i th virtual leader, respectively. The control input of the i th virtual leader is: where p r i and u r i are the position and velocity of the i th virtual structure point in XOY, respectively. c 1 is the feedback coefficient of the position error, c 2 is the speed error feedback coefficient, and f i,j is the force term of the artificial potential field for collision avoidance, which is used to achieve collision avoidance between virtual leaders. As for collision avoidance between USVs, because USVs are randomly arranged near their corresponding virtual leader's position in the initial stage, the USV only needs to track the corresponding virtual leader accurately to avoid collisions with each other. It is considered that the i th virtual leader is in the potential field generated by the neighboring virtual leaders. The total potential energy of the i th virtual leader can be expressed by: where φ( * ) is the artificial potential field function, and * denotes the vector modulus. As the artificial potential field is used to only avoid collision rather than organize the formation, the potential field only has repulsion, while the potential function is designed as: where r is the distance between virtual leaders and r 0 is the influence range of the artificial potential field. When the relative distance between virtual leaders is larger than r 0 , no interaction of artificial potential field forces exists. η is the potential field gain coefficient, which should be selected to consider the actual performance of the USV. A very small value is not conducive to the safe collision avoidance of a USV, while a too large value may lead to the control input exceeding the capacity of the actuator. It is necessary to consider the possible interference to the formation in the design of the artificial potential field and choose the value of the potential field range as follows: Thus, in the neighborhood of the final formation, the term of artificial potential field on the right side of Equation (8) can be eliminated. Equations (7) and (8) form a linear second-order system: According to the Hurwitz theorem, the system is stable when c 1 ≥ 0, c 2 ≥ 0. As the tracking target of the USV, the virtual leaders should avoid violent movement to reduce the frequent maneuver of the USV. The smaller c 1 can avoid a too fast movement of the virtual leader to the formation reference point, and thus the speed tends to saturation. The larger c 2 can match the speed, which is convenient for a stable generation of the formation. The effect of the artificial potential field during the formation process can be considered as interference to the second-order system. Owing to the existence of a negative gradient term of the artificial potential field, virtual leaders move towards the direction where the artificial potential field can be reduced to achieve collision avoidance.

Formation Transformation
According to Equation (4), the velocity of the virtual structure point in XOY can be expressed as: Assuming that the transformation of the formation is achieved by a step change of p s i → p s i , Equation (13) can be simplified to: where p s i represents the shape of the formation. During the formation movement, the formation switching can be achieved by changing the value of p s i . L represents the size of the virtual structure. The size of the formation can be changed by setting different values of L.

Obstacle Avoidance
The USV formation inevitably needs to pass through the obstacle area during the movement. In some specific application scenarios, such as collaborative object transportation and collaborative area scanning operation, the USV formation is necessary to maintain the complete structure during the process of obstacle avoidance. In this section, we study the conformal obstacle avoidance algorithm for multi-USV formation.

Artificial Potential Field Method
The artificial potential field method is a common algorithm in robot obstacle avoidance research. The robot is in the force field generated by obstacles and target point, the target attracts the robot, the obstacles repel the robot, and the robot moves under the action of joint forces [28,29]. However, the algorithm has a defect of a local minimum value, which will lead to robot falling into a "dead point". As the actual movement ability is not considered, the robot cannot accurately track the path planned by the algorithm. In practical application, it is often used in combination with other algorithms [30][31][32].

Dynamic window approach
The dynamic window approach is a local path planning algorithm, which considers the dynamic performance of the USV [33,34]. Its implementation consists of two steps. The first step is to generate an effective search space, in which the performance constraints of the USV need to be fully considered. The second step is to select the best scheme in the search space.
(1) Search spacex In this step, every group of speed generated in the search space is tested to ensure that they can safely control the USV. The generation of speed instructions is limited by the speed and acceleration of the USV. Simultaneously, for safety, the USV should have enough obstacle avoidance distance during the process of movement. By comprehensively considering the above constraints, a feasible speed space is finally generated.
The USV has the ability to move forward and rotate. Moreover, the moving distance of the USV in the sampling period is limited. Therefore, the trajectory of the USV in the sampling period can be simplified to a straight line. The coordinate of the USV at time t + 1 can be calculated, so that the trajectory of every set of velocities can be estimated. Therefore, the derivation formulas of the USV are: where x t and y t are coordinates of the USV on the x-axis and y-axis of the world coordinate system, v and ω are the linear and angular velocities of the USV, respectively, and θ t is the heading of the USV at time t.
In the velocity space (v, ω), sets of velocity are sampled and every set corresponds to a simulated track, while the velocity sampling range needs to be determined according to the limitations of the property of the USV and environmental constraints.
The limitation of the maximum velocity and minimum velocity is: where v c and ω c represent the linear and angular velocities, respectively. Based on safe considerations, the USV needs to stop moving before hitting obstacles. The range of the speed of the USV under the maximum deceleration is: where dist(v, ω) is the shortest distance from the USV to the obstacle on the corresponding trajectory of the velocity (v, ω). Thus, the actual sampling range of the USV speed is the intersection of the above three speed spaces: (2) Optimization The purpose of this step is to obtain the optimal speed set and evaluate the speed set in the search space. In the original dynamic window approach, the definition of the evaluation function is: where σ is the smoothing function, α, β, γ are constants, and heading(v, ω) is an index used to evaluate the alignment degree between the current direction and target direction of the USV at the current set sampling speed. dist(v, ω) represents the distance between the USV and nearest obstacle on the current track. If there is no obstacle on this track, it is set as a constant. velocity(v, ω) is the position vector of the USV. The kinematic equation ofto evaluate the speed of the current track. The original evaluation function can quickly guide the USV to the target position. However, when the USV approaches the target, the angle between the heading of the USV and target sharply increases. Under the function of the heading(v, ω) term in the evaluation function, the USV will then increase its angular velocity ω to reduce θ, which will make the motion of the USV insufficiently smooth. Therefore, the evaluation function needs to be improved.
(3) Improved evaluation function The evaluation function in the dynamic window approach is improved by importing the distance from the USV to the target. The improved evaluation function is as follows: where goal_dist(v, ω) is the distance from the current position of the USV to the target. The physical meaning of the other items is consistent with the evaluation function before the improvement. By the improved algorithm, the heading angle of the USV can converge to the target point more quickly and the obstacle avoidance time can be reduced, while ensuring the safety of obstacle avoidance.

USV Path Tracking Algorithm
The USV achieves the formation by tracking the corresponding virtual leader. Thus, it is necessary to design the corresponding tracking control algorithm for the USV.
In Figure 4, P c = x c y c θ c represents the current gesture information of the USV, u = v ω T represents the control input, and P d = x d y d θ d represents the desired gesture the of USV.  The tracking controller is designed as follows: (1) Velocity controller Figure 4 shows that the distance between the current position and desired position of the USV is: The speed controller of the USV is designed as: (2) Heading controller The angle error of the USV during the tracking is: To accurately track the desired heading by the USV, the Proportional Integral (PI) controller is used to control the angle. The designed heading angle control law is:

Numerical Simulations
Simulations are carried out to evaluate the algorithms proposed in this study.

Path Tracking Controller
The tracking controller is designed as follows: (1) Velocity controller Figure 4 shows that the distance between the current position and desired position of the USV is: The speed controller of the USV is designed as: (2) Heading controller The angle error of the USV during the tracking is: To accurately track the desired heading by the USV, the Proportional Integral (PI) controller is used to control the angle. The designed heading angle control law is:

Numerical Simulations
Simulations are carried out to evaluate the algorithms proposed in this study.  Figure 6 shows the virtual structure of the formation, in which the black point and blue point represent the formation reference point and virtual structure point, respectively. The red circle denotes the force range of the potential field.  Figure 7 shows the simulation results of the formation for line path tracking. The blue diamond in Figure 7a indicates the virtual leader, while the red triangle in Figure 7b indicates the USV. As shown in Figure 7, the virtual leaders can stably form the desired formation, while the USV achieves the formation by accurately tracking the corresponding virtual leader. As shown in Figure 8, the distances between the neighboring USVs are maintained at 7.07 and 10 m, consistent with the distance between preset virtual structure points.   Figure 6 shows the virtual structure of the formation, in which the black point and blue point represent the formation reference point and virtual structure point, respectively. The red circle denotes the force range of the potential field.  Figure 7 shows the simulation results of the formation for line path tracking. The blue diamond in Figure 7a indicates the virtual leader, while the red triangle in Figure 7b indicates the USV. As shown in Figure 7, the virtual leaders can stably form the desired formation, while the USV achieves the formation by accurately tracking the corresponding virtual leader. As shown in Figure 8, the distances between the neighboring USVs are maintained at 7.07 and 10 m, consistent with the distance between preset virtual structure points.  Figure 7 shows the simulation results of the formation for line path tracking. The blue diamond in Figure 7a indicates the virtual leader, while the red triangle in Figure 7b indicates the USV. As shown in Figure 7, the virtual leaders can stably form the desired formation, while the USV achieves the formation by accurately tracking the corresponding virtual leader. As shown in Figure 8, the distances between the neighboring USVs are maintained at 7.07 and 10 m, consistent with the distance between preset virtual structure points.  Figure 7 shows the simulation results of the formation for line path tracking. The blue diamond in Figure 7a indicates the virtual leader, while the red triangle in Figure 7b indicates the USV. As shown in Figure 7, the virtual leaders can stably form the desired formation, while the USV achieves the formation by accurately tracking the corresponding virtual leader. As shown in Figure 8, the distances between the neighboring USVs are maintained at 7.07 and 10 m, consistent with the distance between preset virtual structure points.

Curve Path Tracking
Another typical tracking case is curve path tracking. Assuming that the initial positions of the virtual leaders and USVs are randomly distributed in the area of ( )       , 10,10 , 20, 20 Figure 9 shows the simulation results of the formation for curve path tracking. As shown in Figure 10, the distances between the neighboring USVs are maintained at 7.07 and 10 m. Figures 9 and 10 show that the three USVs achieve the desired formation shape and that the formation can accurately track the curve path.

Curve Path Tracking
Another typical tracking case is curve path tracking. Assuming that the initial positions of the virtual leaders and USVs are randomly distributed in the area of {(x, y)|x ∈ [−10, 10], y ∈ [−20, 20] }, Figure 9 shows the simulation results of the formation for curve path tracking. As shown in Figure 10, the distances between the neighboring USVs are maintained at 7.07 and 10 m. Figures 9 and 10 show that the three USVs achieve the desired formation shape and that the formation can accurately track the curve path.

Curve Path Tracking
Another typical tracking case is curve path tracking. Assuming that the initial positions of the virtual leaders and USVs are randomly distributed in the area of ( )       , 10,10 , 20, 20 Figure 9 shows the simulation results of the formation for curve path tracking. As shown in Figure 10, the distances between the neighboring USVs are maintained at 7.07 and 10 m. Figures 9 and 10 show that the three USVs achieve the desired formation shape and that the formation can accurately track the curve path.

Formation Scalability
The scalability of the number of formation members is an important index to evaluate the formation control algorithm. The algorithm proposed in this study can adjust the number of formation members according to the mission requirements. Formation generation simulation of four and six USVs are carried out. Figure 11 shows the virtual structure of the four-USV formation. Assuming that the shape of the virtual structure is a square, the centroid of the square is selected as the formation reference point, while the distance between each virtual structure point and formation reference point is 5 m. Assuming that the force range of the potential field is set The scalability of the number of formation members is an important index to evaluate the formation control algorithm. The algorithm proposed in this study can adjust the number of formation members according to the mission requirements. Formation generation simulation of four and six USVs are carried out. Figure 11 shows the virtual structure of the four-USV formation. Assuming that the shape of the virtual structure is a square, the centroid of the square is selected as the formation reference point, while the distance between each virtual structure point and formation reference point is 5 m. Assuming that the force range of the potential field is set to 5 m, the initial positions of the virtual leaders and USVs are randomly distributed in the area of ( )       , 20, 20 , 25, 25 Figure 12 shows the simulation results of the four-USV formation generation. Figure  13 shows that the distances between each USV and formation reference point are maintained at 5 m, consistent with the distance designed in the virtual structure.   Figure 12 shows the simulation results of the four-USV formation generation. Figure 13 shows that the distances between each USV and formation reference point are maintained at 5 m, consistent with the distance designed in the virtual structure. The scalability of the number of formation members is an important index to evaluate the formation control algorithm. The algorithm proposed in this study can adjust the number of formation members according to the mission requirements. Formation generation simulation of four and six USVs are carried out. Figure 11 shows the virtual structure of the four-USV formation. Assuming that the shape of the virtual structure is a square, the centroid of the square is selected as the formation reference point, while the distance between each virtual structure point and formation reference point is 5 m. Assuming that the force range of the potential field is set to 5 m, the initial positions of the virtual leaders and USVs are randomly distributed in the Figure 12 shows the simulation results of the four-USV formation generation. Figure  13 shows that the distances between each USV and formation reference point are maintained at 5 m, consistent with the distance designed in the virtual structure.      . Figure 15 shows the simulation results of the four-USV formation generation. Figure  16 shows that the distances between each USV and the formation reference point are maintained at 10, 7.07, and 0 m, consistent with the distance designed in the virtual structure.    Figure 15 shows the simulation results of the four-USV formation generation. Figure 16 shows that the distances between each USV and the formation reference point are maintained at 10, 7.07, and 0 m, consistent with the distance designed in the virtual structure. . Figure 15 shows the simulation results of the four-USV formation generation. Figure  16 shows that the distances between each USV and the formation reference point are maintained at 10, 7.07, and 0 m, consistent with the distance designed in the virtual structure.    Equation (14). It is assumed that three USVs are randomly distributed at the initial time, Figure 16. Distance between USVs and formation reference point.

Structure Change
The change in the formation structure is achieved by setting different p s i values in Equation (14). It is assumed that three USVs are randomly distributed at the initial time, forming a triangle shape first, then switching to the line shape, and finally returning to the triangle shape. Figure 17 shows that during the period of 0-100 s, the USVs gradually form the triangle formation structure from the random distribution state. The relative distances between USVs are maintained during the movement in the period of 100-200 s movement. After 200 s, the formation structure starts to change. The distances between the USVs gradually stabilize to new values. After moving a certain distance, the formation starts to switch and eventually returns to the original triangle formation. forming a triangle shape first, then switching to the line shape, and finally returning to the triangle shape. Figure 17 shows that during the period of 0-100 s, the USVs gradually form the triangle formation structure from the random distribution state. The relative distances between USVs are maintained during the movement in the period of 100-200 s movement. After 200 s, the formation structure starts to change. The distances between the USVs gradually stabilize to new values. After moving a certain distance, the formation starts to switch and eventually returns to the original triangle formation.

Structure Scaling
The scaling of the formation configuration is achieved by setting different L & values in Equation (14). It is assumed that three USVs are randomly distributed at the initial time.
The distance between each virtual structure point and formation reference point is expected to be 5 m. The USV gradually forms a triangle formation from the random distribution state. After moving a certain distance, the formation scale gradually reduces to 0.7 times the initial state, and then gradually returns to the initial state value. Figure 18a, b shows the trajectories of the USVs and relative distances between the USVs during the process, respectively. L values in Equation (14). It is assumed that three USVs are randomly distributed at the initial time. The distance between each virtual structure point and formation reference point is expected to be 5 m. The USV gradually forms a triangle formation from the random distribution state. After moving a certain distance, the formation scale gradually reduces to 0.7 times the initial state, and then gradually returns to the initial state value. Figure 18a, b shows the trajectories of the USVs and relative distances between the USVs during the process, respectively.
in Equation (14). It is assumed that three USVs are randomly distributed at the initial time. The distance between each virtual structure point and formation reference point is expected to be 5 m. The USV gradually forms a triangle formation from the random distribution state. After moving a certain distance, the formation scale gradually reduces to 0.7 times the initial state, and then gradually returns to the initial state value. Figure 18a, b shows the trajectories of the USVs and relative distances between the USVs during the process, respectively.

Dynamic Window Approach
Assuming that the simulation parameters such as starting point information, target point information, and obstacle information are consistent, the paths generated by the original approach and improved approach are compared.

Dynamic Window Approach
Assuming that the simulation parameters such as starting point information, target point information, and obstacle information are consistent, the paths generated by the original approach and improved approach are compared. Figure 19 shows the simulation results of local path planning of the dynamic window approach. As is seen in Figure 19, after the improvement of the evaluation function, the USV can keep a safe distance from the obstacles and move in a shorter path, which saves moving time. After avoiding the obstacles, the improved algorithm can make the USV's heading angle converge to the target point faster, so as to ensure that the USV can reach the target faster.  Figure 19 shows the simulation results of local path planning of the dynamic window approach. As is seen in Figure 19, after the improvement of the evaluation function, the USV can keep a safe distance from the obstacles and move in a shorter path, which saves moving time. After avoiding the obstacles, the improved algorithm can make the USV's heading angle converge to the target point faster, so as to ensure that the USV can reach the target faster.  Figure 20 shows a diagram of the obstacle avoidance strategy. The USV formation maintains its shape during the obstacle avoidance process. In this study, the strategy of applying the improved dynamic window approach to the formation reference point is used. In this strategy, the whole formation is regarded as a larger-scale USV centered on the formation reference point. Using this method, the formation reference point can plan a favorable path for USVs to avoid obstacles.  Figure 20 shows a diagram of the obstacle avoidance strategy. The USV formation maintains its shape during the obstacle avoidance process. In this study, the strategy of applying the improved dynamic window approach to the formation reference point is used. In this strategy, the whole formation is regarded as a larger-scale USV centered on the formation reference point. Using this method, the formation reference point can plan a favorable path for USVs to avoid obstacles.

Formation Obstacle Avoidance
Assuming that the distance between each USV and formation reference point is 5 m, the target point is located at (50, 50), the obstacle is located at (20,20), and the radius of the obstacle is 4 m. Figure 20 shows a diagram of the obstacle avoidance strategy. The USV formation maintains its shape during the obstacle avoidance process. In this study, the strategy of applying the improved dynamic window approach to the formation reference point is used. In this strategy, the whole formation is regarded as a larger-scale USV centered on the formation reference point. Using this method, the formation reference point can plan a favorable path for USVs to avoid obstacles. Assuming that the distance between each USV and formation reference point is 5 m, the target point is located at (50, 50), the obstacle is located at (20,20), and the radius of the obstacle is 4 m. Figure 21 shows the simulation results of the formation obstacle avoidance. Compared to the results in [35], where the artificial potential field for multi-AUV systems is used to achieve obstacle avoidance, the path planned by our algorithm is smoother and more executable for actual vehicles. As shown in Figure 22, all USVs are at a safe distance from the obstacle, which demonstrates that the algorithm is able to generate acceptable safe paths in an obstacle environment. Furthermore, as shown in Figure 22a, the distances  Figure 21 shows the simulation results of the formation obstacle avoidance. Compared to the results in [35], where the artificial potential field for multi-AUV systems is used to achieve obstacle avoidance, the path planned by our algorithm is smoother and more executable for actual vehicles. As shown in Figure 22, all USVs are at a safe distance from the obstacle, which demonstrates that the algorithm is able to generate acceptable safe paths in an obstacle environment. Furthermore, as shown in Figure 22a, the distances between the obstacle and each USV are recorded. Notably, the smallest distance between the USV and obstacle is 5 m. The relative distances between the USVs are shown in Figure 22b. The formation shape can be well maintained as the distance fluctuations remain relatively small. between the obstacle and each USV are recorded. Notably, the smallest distance between the USV and obstacle is 5 m. The relative distances between the USVs are shown in Figure  22b. The formation shape can be well maintained as the distance fluctuations remain relatively small.

Conclusions
In this study, the formation control algorithm of a multi-USV system and problem of conformal obstacle avoidance are investigated. The algorithm combining the virtual structure and artificial potential field can effectively organize USVs to generate the desired between the obstacle and each USV are recorded. Notably, the smallest distance between the USV and obstacle is 5 m. The relative distances between the USVs are shown in Figure  22b. The formation shape can be well maintained as the distance fluctuations remain relatively small.

Conclusions
In this study, the formation control algorithm of a multi-USV system and problem of conformal obstacle avoidance are investigated. The algorithm combining the virtual structure and artificial potential field can effectively organize USVs to generate the desired Figure 22. Distance during the process of obstacle avoidance: (a) distance between USVs and obstacle; (b) distance between the neighboring USVs.

Conclusions
In this study, the formation control algorithm of a multi-USV system and problem of conformal obstacle avoidance are investigated. The algorithm combining the virtual structure and artificial potential field can effectively organize USVs to generate the desired formation and flexibly change the formation shape by structure switching and scaling strategies. Through the improved dynamic window approach, the formation reference point can plan a safe obstacle avoidance path for the formation, and thus the formation can maintain the shape while avoiding the obstacle. Compared to the traditional artificial potential field method, the proposed method is more conducive because it considers the actual execution ability of the USV. Finally, the numerical simulation results validated the effectiveness of the proposed formation control algorithm.