# Three-Dimensional Obstacle Avoidance Strategy for Fixed-Wing UAVs Based on Quaternion Method
## 3 Improved 3D-VO Method for UAV Collision Avoidance
### Avoidance Velocity  
We rely on the concept of the VO cone and the avoidance plane introduced in the previous sections to solve the avoidance velocity, mainly referring to Ref. [17], additionally taking into account the kinematic and dynamic constraints of the fixed-wing UAV. The original VO methods usually update the avoidance velocity to a point on the boundary of the VO cone. There are many ways to solve such a velocity, for example: by changing the magnitude without changing the direction, changing the direction without changing the magnitude, or a combination the two strategies, according to a certain optimization index. For fixed-wing UAVs, its velocity magnitude must be greater than the stall speed. At the same time, the top speed is limited, due to physical limitations. Therefore, the velocity control range seems to be narrow. Moreover, due to the inertia of the UAV, the thrust is less sensitive for controlling the velocity. Consequently, relying on rudders to change the direction of the velocity is considered to be the best way in this work. Constraints 1 (dynamic constraints): We introduce the concept of the maximum deflection angle \(\alpha\), which is the maximum change of the velocity in the direction, in order to characterize the dynamic constraints of the UAV, similar to the motion primitives proposed in Ref. [13]. In this work, \(\mathbf{v}_{av0}\) is a continuous control parameter \(\mathbf{v}_{av0}\mapsto\mathbf{u}(\mathbf{v}_{av0})\), indicatingthe magnitude and direction of the velocity of the UAV, defining the reference trajectory from the moment the UAV avoidance mode starts. \[\mathbf{p}_{ref}(t)=\mathbf{p}(t_{0})+(t-t_{0})\mathbf{v}_{avo}\,t\geq t_{0}\]  
Meanwhile, the trajectory \(\mathbf{p}_{UAV}(t)\) is the bijective function of the initial state \(\mathbf{x}(t_{0})\) and the control input \(\mathbf{u}(t)\). The control input needs to meet the dynamic constraints of the UAV:  
\[\mathcal{U}=\Big{\{}\mathbf{u}\in\mathbb{R}^{3},\text{respect all dynamic constrains}\Big{\}} \tag{20}\]  
The trajectory of the UAV gradually converges to the reference trajectory under the control force. The maximum error between the trajectory and the reference trajectory \(\chi(t)=\max\Big{(}\|p_{UAV}(t)-p_{ref}(t)\|\Big{)}\) shows a significant difference under different initial states and control input. The influence of the control parameter \(\mathbf{v}_{avo}\) on \(\chi\) is what we are concerned about. As shown in Figure 4b, the UAV can track the reference trajectory of the original direction with a small error, and the maximum error value increases almost linearly with the increase in \(\alpha\) Figure 4a. We can quickly query the maximum error corresponding to a different value of \(\alpha\), which is constant relative to a given initial value. Given the initial state \(\mathbf{x}(t_{0})\), the set of control parameters that limit the maximum error below \(\chi^{*}\) is defined as follows:  
\[\mathcal{A}:=\Big{\{}\mathbf{v}_{avo}\Big{|}\max\Big{(}\|\mathbf{p}_{UAV}(t)-\mathbf{p}_{ ref}(t)\|\Big{)}\leq\chi^{*}\ \mathbf{u}\in\mathcal{U}\Big{\}} \tag{21}\]  
where \(\mathbf{v}_{avo}^{*}\) refers to the boundary of the set \(\mathcal{A}\), corresponding to the maximum deflection angle \(\alpha_{\max}\). In the avoidance plane \(S^{\delta}=\mathbb{R}^{2}\), the relationship between the original velocity of the UAV and the avoidance velocity is expressed as follows:  
\[\left\{ \begin{array}{cc}\mathbf{v}_{avo}^{\delta}=\mathbf{K}(\alpha)\cdot\mathbf{v}_{ UAV}^{\delta}\\ \mathbf{K}(\alpha)=\left[\begin{array}{cc}\cos(\alpha)&-\sin(\alpha)\\ \sin(\alpha)&\cos(\alpha)\end{array}\right]\end{array} \right.\quad(\|\mathbf{x} \|\leq\alpha_{\max}) \tag{22}\]  
Constraints 2 (collision avoidance and kinematic constraints): In addition to the magnitude constraint, \(\mathbf{v}_{avo}\) must satisfy the obstacle avoidance constraint as well, that is, the end of the vector, which we call the velocity point, should be on the conic section \(\mathcal{F}\).