## 5 Control Algorithms for UAV Networking
### Centralized Control Algorithm
#### 5.1.2 Virtual Structure  
The virtual structure model helps UAVs maintain precise positions in formation and improve synchronous operation without depending on a specific leader UAV. This method is widely applied in UAV control problems to optimize coordination, maintain formation, and avoid collision.  
Several studies have proposed dynamic virtual structure-based flight formation control for fixed-wing UAVs, in which the dynamic formation trajectory generation algorithm helps the UAVs change formation smoothly along a predetermined flight trajectory. This method ensures that the UAV formation can be maintained accurately in complex maneuvering situations [91]. Another study uses a flexible virtual structure. It allows the UAV to adjust its flight direction easily without being constrained, as in rigid geometric virtual structure methods. The simulation results on a six-degree-of-freedom (6 DOF) UAV show that the UAV can follow the desired trajectory stably [92].  
Figure 27 illustrates the working principle of the virtual structure in UAV formation control. This process starts with the virtual force field acting on the virtual structure, determining the overall position of the UAV formation. The virtual structure then adjusts to match the position of the UAV, and the UAV also changes its position to match the virtual structure, creating a two-way interaction between them. The position of the UAV is influenced by the environment, and it adjusts according to the virtual structure to maintain the desired formation. This model helps the UAV maintain alignment, adapt to surrounding conditions, avoid obstacles, and easily perform formation transformations by changing the virtual structure [93].  
In environments with interference or limited communication, a single-line virtual structure approach has been developed so that UAVs can maintain formation even in the absence of real-time communication between UAVs. By updating the position of the virtual leader UAV in real time and using geometric constraints, the UAV can calculate the desired position and adjust the flight direction based on the roll angle [94]. The combination of a virtual structure with a nonlinear control algorithm overcomes the drawback of relying on the leader UAV in the Leader-Follower method. This approach helps the UAV formation maintain a tight position even in the presence of interference or during the execution of a turn [95].  
In addition, a behavioral flight control method incorporating virtual structures was developed to reduce the dependence on the quality of wireless communication in the UAV formation. This approach helps the UAV maintain a stable formation in an unknown environment while enhancing the ability to avoid obstacles and potential threats [96]. The virtual structure is integrated with a nonlinear MPC algorithm, where each UAV is equipped with its own controller to optimize the distance from obstacles and other UAVs in the formation. This model helps UAVs to automatically adjust their positions by solving the optimization problem according to a sequential quadratic program, ensuring stable control performance even in three-dimensional space [97].  
In addition, to maintain large-scale UAV formations, a consensus algorithm incorporating virtual structures has been studied to ensure uniformity among UAVs in the formation. This method uses a consensus strategy to optimize the state of each UAV, maintaining the formation structure during flight and minimizing trajectory errors [98].