## 2 Method
### Real-Time Control and Acquisition Platform  
In order to implement the open-closed-loop composite method and obtain the flight data for model training, a highly dynamic control and acquisition platform is required to collect the real-time flight data of the UAV. The variables of the collected data include the  
Figure 1: Architecture of the open-closed-loop compound control strategy on the real-time control and acquisition platform.  
control instruction, 3D position, acceleration, and battery voltage. To ensure the accuracy and integrity of real-time data, this high-dynamic control and acquisition platform is very different from the existing UAV control platforms, especially in low-delay communication and real-time accurate positioning.  
Common UAV positioning techniques include Global Positioning System (GPS), Ultra Wide Band (UWB), Bluetooth, and acoustic positioning. The accuracy of GPS is in meters, and the accuracy can be improved to decimeters or centimeters through Real-Time Kinematic (RTK) technology. However, the GPS positioning frequency is slow, and it cannot meet the low-delay positioning requirements for this platform. If the GPS positioning refresh frequency is 10 Hz and the UAV speed is 5 m/s, the returned deviation of the UAV position data may reach 0.5 m with a low refresh rate. The communication delay time of ZigBee, Long-Range Radio (LoRa), or Bluetooth usually ranges from tens of milliseconds to hundreds of milliseconds, and they also further increase the position deviation of the flying UAV. Therefore, the communication delay time of the platform must also be set below a certain value. According to the common flight scenes of UAV clusters, it is necessary to build a real-time control and acquisition platform with positioning accuracy \(\leq\)\(\pm\)15 cm, communication delay time \(\leq\) 20 ms, UAV state refresh frequency \(\geq\) 25 Hz, and the number of supported UAV \(\geq\) 10. To solve the contradiction of the positioning accuracy and refresh frequency in the platform, the multi-sensor fusion technology (UWB, optical flow sensor, and barometer) was adopted. The platform also has the problem of data communication blocking between the UAVs and the ground base station. Therefore, the wireless communication structure of the double data link, the reconstruction of the UAV control system, and the multi-thread processing technology of the ground base station were adopted to improve the acquisition accuracy and data integrity of the flying UAVs.  
Figure 2 shows the block diagram of the real-time control and acquisition platform. The functions of flight monitoring, trajectory planning, multi-thread remote control, and log backup were performed in the host computer of the platform. In the UAV terminal, the UAV flight data acquisition, wireless communication with the host computer, and flight control were implemented to realize the actual trajectory. After software optimization, the average wireless transmission delay (sent from the ground station to the UAVs or returned from the UAVs to the ground station) can reach less than 5 ms, the serial port output rate is up to 500 kbps, and the packet loss ratio is less than 1%. The transmission delay is much lower than that of LoRa, ZigBee, and Wi-Fi. The UAVs adopt the positioning method composed of the UWB, optical flow sensor, and barometer. At the same time, the four-base-station scheme is arranged in the UWB positioning subsystem. The positioning refresh frequency of each UWB sensor can reach 350 Hz in the state of a single UAV, satisfying the high refresh requirement of the UAV state. In the rectangular positioning area of 15 \(\times\) 15 m\({}^{2}\), the average deviation fluctuation in static positioning is less than \(\pm\)3 cm. The distributed and heterogeneous structure was designed to ensure that the UAVs can execute the preset real-time control instructions and collect real-time flight data simultaneously.