# An Advanced Path Planning and UAV Relay System: Enhancing Connectivity in Rural Environments
## 2 Materials and Methods
### Energy Awareness and Wind Resilience  
UAVs need to be resilient against adverse weather conditions, such as wind. When a UAV flies against the wind, it must increase its power to avoid time delays or instability issues. Conversely, when the UAV flies in the same direction as the wind, the consumed power can be decreased to save energy and cover longer distances before charging the battery. Battery consumption is, therefore, dependant on the wind, such that charging slots cannot be predefined due to the uncertainty of the wind speed and direction. Consequently,  
Figure 4: Successful and unsuccessful relay links. the UAV needs to autonomously decide when to stop the patrol mission and head towards a charging station. This approach aims to maintain a constant ground speed throughout the trajectory by modulating the throttle, whilst avoiding deflection in the presence of wind. This causes the UAV to remain stationary when the UAV airspeed and wind speed are equal and opposite, satisfying the following relation:  
\[\text{Ground speed}=\text{True air speed}+\text{wind speed}. \tag{5}\]  
The UAV heading/angle and wind direction, however, change throughout mission execution, as depicted in Figure 5. The true air speed \(\vec{V}_{\textit{tas}}\) can, therefore, be determined using  
\[\vec{V}_{\textit{tas}}=\vec{V}_{\textit{G}_{S}}-\vec{V}_{\textit{wind}}\cos \alpha. \tag{6}\]  
At maximum speed, the UAV uses the maximum throttle, according to  
\[\vec{V}_{\textit{tas}_{\textit{max}}}=\text{Throttle}_{\textit{max}\%}. \tag{7}\]  
Under the assumption that the throttle response is tuned such that \(\vec{V}_{\textit{tas}}\) grows linearly with \(\text{Throttle}_{\%}\), the required throttle percentage can be found using  
\[\text{Throttle}_{\%}=\frac{\vec{V}_{\textit{tas}}}{\vec{V}_{\textit{tas}_{ \textit{max}}}}\times 100\% \tag{8}\]  
Combining (8) with (6) further suggests that  
\[\text{Throttle}_{\%}=\frac{100(\vec{V}_{\textit{G}_{S}}-\vec{V}_{\textit{wind }}\cos\alpha)}{\vec{V}_{\textit{tas}_{\textit{max}}}}. \tag{9}\]  
From (9), it is noted that the \(\text{Throttle}_{\%}\) depends only on the wind velocity and its angle between the UAV heading, when assuming a constant ground speed. This value can, therefore, be used to estimate the energy consumption and determine when to return to a charging point. Under the assumption that the UAV is flying at maximum throttle, the motor consumes the maximum amount of current \(I_{\textit{drawn}_{\textit{max}}}\). Additionally, it is assumed that the current grows linearly with the throttle, such that  
\[I_{\textit{drawn}}=\frac{\text{Throttle}_{\%}}{100}\times I_{\textit{drawn}_{ \textit{max}}}. \tag{10}\]  
Given a fixed ground speed, the total time traveled at step \(n\) is calculated from the distance traveled at each raster grid step as  
Figure 5: Representation of wind velocity vector and UAV true air speed. \[t_{(n)}=t_{(n-1)}+\frac{\sqrt{\textit{reslon}(x_{(n)}-x_{(n-1)})^{2}+\textit{ reslat}(y_{(n)}-y_{(n-1)})^{2}+(z_{(n)}-z_{(n-1)})^{2}}}{\bar{V}_{G_{S}}}. \tag{11}\]  
The battery charge used can be subsequently calculated using  
\[\text{Ground speed}=\text{True air speed}+\text{wind speed}. \tag{5}\]0  
Consequently, the estimated remaining time at step \(n\) is found according to  
\[\text{Ground speed}=\text{True air speed}+\text{wind speed}. \tag{5}\]1  
where \(A_{h_{capacity}}\) is the full battery charge capacity. Finally, the estimated remaining range is given by  
\[\text{Ground speed}=\text{True air speed}+\text{wind speed}. \tag{5}\]2  
A random point from the Hamiltonian cycle output of the traveling sales problem is used as a charging station, such that the distance to this point is computed and denoted by \(\Delta\text{path},\text{station}(n)\). Three possible conditions thereby exist:  
1. If Estimated range \((n)>\Delta\text{path},\text{station}(n)\), it implies that the UAV has enough charge to reach the charge station. 2. If Estimated range \((n)<\Delta\text{path},\text{station}(n)\), it implies that the UAV cannot reach the charge station. 3.