# Formation Control Technology of Fixed-Wing UAV Swarm Based on Distributed Ad Hoc Network
## 6 Simulation Analysis
### Formation Assembly and Formation Switching  
The 12 UAVs took off in succession. After each UAV passed the assembly point A, the formation-switching algorithm began to take over the UAV, planning the trajectory of the UAV; the formation was assembled into an inverted V-shape; and then the formation-switching algorithm was enabled again to change the swarm into a V-shaped formation, as shown in Figure 10. The simulation parameters that had to be set are shown in Table 1. The simulation results of formation assembly and formation switching in the horizontal plane are shown in Figures 11 and 12.  
Figure 10: UAV swarm formation assembly and formation switching.  
The assembly formation was V-shaped, the formation switching was changed from V-shaped to column formation, the vertical formation interval in the y-direction was 100 m, and other parameters remain unchanged. The simulation is shown in Figures 13 and 14.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**UAV Swarm Attributes** & **Parameter Value** \\ \hline Number of UAVs \(n\) & 12 \\ Launch interval & 5 s \\ UAV speed \(V\) & 30 m/s \\ Maximum turning angle constraint \(\beta_{\text{max}}\) & 90\({}^{\circ}\) \\ Turning radius \(R\) & 300 m \\ Minimum track length constraint \(d_{s}\) & 600 m \\ Assembly point A & (0 m, 2000 m) \\ Communication topology & Fully Connected \\ Assembled formation & Inverted V-Shape \\ Switch formation & V-Shape \\ Formation interval in x direction & 100 m \\ Half vertex angle of V-shaped & 45\({}^{\circ}\) \\ Formation-switching distance D & Adaptive (met the minimum switching distance) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Simulation parameters.  
Figure 11: Formation assembly and formation switching.  
Figure 12: Assembly formation and switch formation.  
It can be seen in Figures 12 and 14 that when the communication topology of UAV swarm was fully connected, formation aggregation and formation switching could make the distance between each UAV meet the desired requirements after a formation interval correction; namely, the communication event was \(k=0\). If the communication topology was partially interrupted, the formation interval had to be corrected again. This method could simply and quickly converge to the final expected formation interval value. It can be seen in Figures 11 and 13 that this formation method could quickly plan the route to the formation waypoints under the constraints of the UAV dynamics, and has a high engineering application value.  
We reset obstacles for simulation, and the obstacle information is shown in Table 5. Other parameters remain unchanged; the horizontal plane simulation results are shown in Figure 16.  
\begin{table}
\begin{tabular}{c c c} \hline
**UAV Index** & **X/m** & **Y/m** \\ \hline
1 & 1000 & 3000 \\
2 & 1000 & 6500 \\
3 & 1000 & 3500 \\
4 & 1000 & 6000 \\
5 & 1000 & 4000 \\
6 & 1000 & 5500 \\
7 & 1000 & 4500 \\
8 & 1000 & 5000 \\ \hline \end{tabular}
\end{table}
Table 4: Initial position of UAV.  
Figure 15: UAV formation obstacle avoidance.  
\begin{table}
\begin{tabular}{c c} \hline
**Obstacle Avoidance Area Properties** & **Parameter Value** \\ \hline Rectangle center point & (7000 m, 5000 m) \\ Rectangular area length & 10,000 m \\ Rectangular area width & 10,000 m \\ \hline \end{tabular}
\end{table}
Table 2: Obstacle avoidance area parameters.  
As can be seen in Figures 15 and 16, the UAV swarm could be intelligently divided into multiple smaller formations to pass obstacles or fly around to avoid obstacles. Finally, it could be reconstructed into the expected formation. The simulations showed that the algorithm could quickly and flexibly plan the cooperative obstacle avoidance path and had the ability of online formation to avoid obstacles.