# Enhancing Real-Time Kinematic Relative Positioning for Unmanned Aerial Vehicles
## 3 Cycle Slip Detection Strategy for a UAV
### Time-Differenced Single-Frequency Carrier Phase Measurements (TDSFM)  
In general, the DACSD can be also used for single-frequency measurements. However, because of its large thresholds, DACSD is recommended for use in conjunction with another test metric. In this study, the use of time-differenced single-frequency carrier phase measurements (TDSFM) [32] was proposed for cycle slip detection of single-frequency-only measurements. To derive the TDSFM metric, the time rate of the carrier phase is modeled as follows:  
\[\begin{split}\phi_{f}^{k}&=\dot{t}-\dot{I}_{f}+ \dot{T}+\left(b-\dot{b}^{k}\right)+\lambda_{f}N_{f}^{k}+\epsilon_{\dot{\phi}}\\ &=\mathbf{1}^{k}\cdot\left(\mathbf{v}^{k}-\mathbf{v}\right)+\dot{b}+ \lambda_{f}N_{f}^{k}+\tilde{\epsilon}_{TDSFM,res}.\end{split} \tag{10}\]  
where dot \(\dot{(\cdot)}\) is a differentiation operator, \(\mathbf{v}\) and \(\mathbf{v}^{k}\) are the velocities of the UAV and satellite \(k\), respectively.  
Figure 6: DACSD (without cycle slip) values and derived thresholds from the flight data. DACSD serves as a complement to the TDDFC method.  
To calculate TDSFM, the velocity of the UAV and its clock drifts are computed using dual-frequency measurements that have already passed the TDDFC and DACSD thresholds. Then, \(N_{f}^{k}\) can be assumed to be zero, and Equation (10) can be reformulated as follows:  
\[\phi_{f}^{k}-\mathbf{1}^{k}\cdot\phi^{k}=-\mathbf{1}^{k}\cdot\mathbf{v}+b+\varepsilon _{\phi}^{k}. \tag{11}\]  
where \(\phi^{k}\) is an estimated satellite velocity from the broadcast ephemeris data. Using \(m\) sets of carrier phase rates that have passed the TDDFC and DACSD tests, \(\mathbf{v}\) and \(b\) can be determined from the following linear equation:  
\[\mathbf{Y}=\mathbf{C}\mathbf{X}+\bar{\varepsilon}_{TDSFM,comb} \tag{12}\]  
where  
\[\mathbf{Y}=\begin{bmatrix}\phi_{f}^{1}-\mathbf{1}^{1}\cdot\mathbf{v}^{1}\\ \vdots\\ \phi_{f}^{m}-\mathbf{1}^{m}\cdot\mathbf{v}^{m}\end{bmatrix},\mathbf{C}=\begin{bmatrix} -\mathbf{1}^{1}&1\\ \vdots&\vdots\\ -\mathbf{1}^{m}&1\end{bmatrix},\mathbf{X}=\begin{bmatrix}\mathbf{v}\\ b\end{bmatrix}.\]  
With estimated \(\mathbf{X}\), denoted as \(\hat{\mathbf{X}}\), TDSFM values, \(T_{TDSFM}\), for \(n^{th}\) single frequency-only measurements are computed as follows:  
\[T_{TDSFM}=\dot{\phi}_{f}^{n}-\mathbf{1}^{n}\cdot\phi^{n}-\begin{bmatrix}- \mathbf{1}^{n}&1\end{bmatrix}\cdot\hat{\mathbf{X}}. \tag{13}\]  
\(T_{TDSFM}\) collected from flight tests are shown in Figure 7. There was no apparent trend in the TDSFM with respect to the satellite elevation angles, which seemed to be caused by the small number of single-frequency measurement samples. Based on the test statistics, the threshold for \(T_{TDSFM}\) is set as a constant of 0.1160 m/s to allow a false alarm rate of \(10^{-5}\). The TDDFC, DACSD, and TDSFM thresholds are summarized in Table 3.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multicolumn{5}{c}{**Polynomial Coefficients**} \\ \cline{2-5}  & **3 rd-Order** & **2 nd-Order** & **1 st-Order** & **Constant** \\ \hline TDDFC [m] & +4.1162 \(\times\)\(10^{-8}\) & \(-\)1.9358 \(\times\)\(10^{-6}\) & \(-\)8.2256 \(\times\)\(10^{-4}\) & +0.1013 \\ DACSD [cyc] & \(-\)1.1586 \(\times\)\(10^{-5}\) & +1.8570 \(\times\)\(10^{-3}\) & \(-\)0.1093 & +7.2164 \\ TDSFM [m/s] & - & - & - & +0.1160 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Thresholds for the absolute values of TDDFC, DACSD, and TDSFM based on flight test data.  
Figure 7: TDSFM (without cycle slip) values from the flight data and threshold for cycle slip detection in single-frequency GNSS measurements.