# Optimal Configuration and Path Planning for UAV Swarms Using a Novel Localization Approach
## 4 UAV Path Optimization  
Section 3 provides the optimal configuration, without considering receiver constraints. However, in general, the UAV receiving platform is affected by its movement constraints and cannot achieve the conditions for optimal configuration within a short time [30]. Usually, the UAVs are far from the emitter; also, they are affected by the communication constraint and collision avoidance constraint. Therefore, it takes some time before reaching the optimal localization configuration. The UAV path planning problem is a constrained optimization problem [31] that involves the calculation of UAVs waypoints at discrete time instants. The optimal trajectory is generated by minimizing the trace of the CRLB, which is analyzed in Section 3. The receiver measurements are assumed to be synchronized with waypoint updates. In addition, UAVs are assumed to be equipped with a Global Positioning System (GPS) and robust line-of-sight (LOS) datalinks [32]. Assuming the systematic UAV discrete dynamic model is [15; 33]:  
\[\mathbf{X}_{k+1}=f(\mathbf{X}_{k},\mathbf{u}_{k}),k=1,2,\cdots,M, \tag{49}\]  
where \(\mathbf{X}_{k}\) is the system status value \(\mathbf{X}_{k}=\left[\mathbf{x}_{1}(k),\cdots,\mathbf{x}_{M}(k)\right]^{T}\) at the time \(k\), and \(\mathbf{u}_{k}\) is the control vector \(\mathbf{u}_{k}=\left[u_{1}(k),u_{2}(k),\cdots u_{M}(k)\right]\) of UAV at each moment. Without loss of generality, UAV1 is assigned as the reference node, and the proposed waypoint update equation of the UAV is:  
\[\mathbf{x}_{i}(k+1)=\left[ \begin{array}{c}x_{i}(k)\\ y_{i}(k)\end{array} \right]+v_{0}T\left[ \begin{array}{c}\cos u_{i}(k)\\ \sin u_{i}(k)\end{array} \right], \tag{50}\]  
where \(v_{0}\) is the UAV flight speed and \(T\) is the time interval between waypoint updates. The UAVs path can be optimized by taking the CRLB as the optimization rule. Within each time interval, SDP methods and EKF are used to update emitter localization and tracking estimations. Therefore, the objective function can be expressed as:  
\[\left\{ \begin{array}{ll}\arg\!\!\min f(\mathbf{u}_{k+1})=Tr(\mathbf{J}_{k+1 }^{-1}(r_{i},\theta_{i})),\;k\leq 3\\ \arg\!\!\min f(\mathbf{u}_{k+1})=Tr(\mathbf{P}_{k+1|k+1}(r_{i},\theta_{i})),k> 3\end{array} \right. \tag{51}\]  
\[s.t.\|u_{i}(k+1)-u_{i}(k)\|\leq u_{\max} \tag{52}\]  
\[g_{1 ij}(\mathbf{u}_{k})=R_{h}-\|\mathbf{x}_{i}(k+1)-\hat{\mathbf{x}}_{t}(k)\|\geq 0 \tag{53}\]  
\[g_{2 ij}(\mathbf{u}_{k})=\|\mathbf{x}_{i}(k+1)-\hat{\mathbf{x}}_{t}(k)\|-R_{l }\geq 0 \tag{54}\]  
\[g_{3 ij}(\mathbf{u}_{k})=c_{h}-\|\mathbf{x}_{i}(k+1)-\mathbf{x}_{j}(k+1)\|\geq 0 \tag{55}\]  
\[g_{4 ij}(\mathbf{u}_{k})=\|\mathbf{x}_{i}(k+1)-\mathbf{x}_{j}(k+1)\|-c_{l}\geq 0, \tag{56}\]  
where Equation (52) is the turn rate constraint of the UAV. Equations (53) and (54) represent the distance constraint from the UAV to the emitter. Equations (55) and (56) are the UAV communication constraint and collision avoidance constraint, respectively. Therefore, the path optimization can be converted to non-linear optimization [34]. This problem is solved by directly configuring the non-linear programming method (DCNLP) or sequential quadratic programming (SQP) [35]. Considering that only the inequality constraint is included in this constraint, the interior penalty function is adopted in this paper to convert this non-linear constraint to an unconstrained problem of minimization auxiliary function. A small calculation amount guarantees the real-time performance of the calculation. The calculation steps are as follows:  
Step 1: Give the system status \(\mathbf{X}_{k}=\left[\mathbf{x}_{1}(k),\cdots,\mathbf{x}_{M}(k)\right]^{T}\) of each UAV at the time \(k\), TDOA measurement \(\mathbf{\hat{z}}\) and Equations (52)-(56). Step 2: Use the SDP methods to calculate the emitter location value \(\hat{\mathbf{x}}_{t}(k)\) and the estimated value \(\mathbf{x}_{t}(k|k)\) by using EKF estimator.