## 4 UAV-TPUA: UAV Trajectory Progress Updating Algorithm
### Updating Trajectory Progress
After access, the drone flight is divided into three stages, whose trajectory is shown in Figures 5 and 6:

* Stage 1: SSB only (ending at approximately 200 m altitude) for the drone to quickly approach the search and rescue area;
* Stage 2: SSB+PRS (straight flight, ending at approximately 50 m), for drone position adjustment;
* Stage 3: SSB+PRS (circular flight until positioning convergence is achieved), for the drone to complete the final positioning stage. After the drone approaches the search and rescue area, it enters the Stage 3. According to the previous experiments, in line-of-sight conditions, the measurement error is further reduced compared to the initial positioning results. Therefore, to ensure the final positioning result is generated in line-of-sight conditions as much as possible, the drone should

Figure 5: The complete flight trajectory of the UAV. Figure 6: Schematic diagram of the actual UAV flight trajectory. not only lower its altitude to approach the UE but also consider flying around the vicinity of the search and rescue personnel to ensure that most of the line-of-sight remains within the visual range. Additionally, based on the beam situation, when the drone's position is at a 45\({}^{\circ}\) elevation angle towards the terminal position, it is more advantageous for beam sweeping and measuring to obtain more accurate beam measurement results. Therefore, during the circular flight, the drone's trajectory should always aim to be at a 45\({}^{\circ}\) elevation angle towards the terminal position, while gradually approaching the UE in the xy plane with a very small angle \(\theta\), forming the trajectory shown in Figure 7.

Figure 8 shows the variation of distance error over time between the UAV and the victim throughout the entire trajectory. In our approach, after entering Stage 2, utilizing \"SSB+PRS\" allows for positioning of the UE. To illustrate the assistance provided by this approach in positioning, we simulated the positioning accuracy at different time points starting from Stage 2. The simulation results are shown in the following figure. It can be observed that at the beginning of Stage 2, the positioning error is relatively large. As time progresses and the airborne base station approaches the UE, the positioning accuracy significantly improves upon entering Stage 3. Based on the convergence and setting conditions, the positioning accuracy of our approach can reach 1 m within 1 min. Figure 8: The localization error over time. Figure 7: The UAV in stage 3 flies around the victim in a circular trajectory. ## 6 Conclusions

This paper proposes the use of drones equipped with 5G NR base stations to search and rescue victims carrying 5G mobile phones in disaster areas. In response to the issue of limited positioning accuracy and long search and rescue time in existing research results using uplink reference signals for victim localization, this paper suggests utilizing 5G NR downlink beam sweeping technology to assist drones in conducting search and rescue missions. To this end, this paper presents a three-stage search and rescue process. In the initial stage, drones emit SSB bursts within the coarse-grained beam sweeping range to determine the approximate direction of victims in the disaster area. In the subsequent stage, drones refine the narrow beam within the selected SSB burst set beam range, emit PRS, and take full advantage of the high beam resolution brought by the massive antennas carried by 5G NR base stations to achieve precise 3D positioning of victims in the disaster area. Based on this two-stage search and rescue approach, this paper proposes a drone trajectory update algorithm to guide drones to quickly fly from outside the disaster area to the vicinity of the victims in the disaster area, completing fast search and rescue tasks. Simulation results show that as the algorithm converges, the final accuracy error of the drone to the victims is around 1 m, demonstrating the feasibility and advantages of the proposed BWSAR in this paper.