# An Improved Single-Epoch Attitude Determination Method for Low-Cost Single-Frequency GNSS Receivers
## 3 CLAMBDA-Search Model
### An Improved Method for Single-Frequency Single-Epoch Attitude Determination
Given the construction matrix \(G(b_{2}^{n}){}^{2}\) and the true value of the baseline vector \(b_{2}^{n}\), we have the following:  
\[\delta_{\hat{N}_{DD}{}^{2}}=v_{DD}^{\varphi}{}^{2}=G(b_{2}^{n}){}^{2}b_{2}^{n}- G(\overset{\sim}{b}_{2}(k)){}^{2}\overset{\sim}{b}_{2}(k)\to N\Big{(}0,Q_{DD}^{ \varphi}{}^{2}\Big{)}\text{ with }\overset{\sim}{b}_{2}^{n}(k)\to b_{2}^{n}(k) \tag{18}\]  
where \(\overset{\sim}{\gamma}_{k}\rightarrow\gamma\). If \(\overset{\sim}{\gamma}_{k}\) is very close to its true value \(\gamma\), we can assume that \(v_{DD}^{\varphi}{}^{2}\) is normally distributed, and so the ambiguity error \(\delta_{\hat{N}_{DD}{}^{2}}\). Based on the covariance propagation law, we have the following:  
\[Q_{\hat{N}_{DD}{}^{2}}=\sigma_{\varphi_{DD}}^{2}\Bigg{[}G^{T}(\overset{\sim}{b }_{2}^{n}(k)){}^{2}G(\overset{\sim}{b}_{2}^{n}(k)){}^{2}\Bigg{]}^{-1} \tag{19}\]  
With the known conditions above, we can then conduct the standard CLAMBDA searching. The ambiguity-fixed baseline solution is that with the smallest ambiguity function. \[\overset{\sim}{z}_{j}^{2}=\arg\min_{z\in Z^{\prime 2}}F\big{(}z|\gamma_{j}\big{)} \tag{20}\]  
where, the ambiguity function takes the unknown attitude angle (which is is roll here) into account. \[\min_{z\in Z^{n}}\Bigg{(}\|z-z\|_{Q_{z}^{-}}^{2}+\min_{b\in R^{3}}H(z,b)+ \frac{\left\|\overset{\sim}{\theta}-\hat{\theta}\right\|}{\sigma_{\theta}^{2} }\Bigg{)}\text{ with }H(a,b)=\left\|\hat{b}(z)-b\right\|_{Q_{z}}^{2}+\frac{\left\| \overset{\sim}{\theta}-\hat{\theta}\right\|}{\sigma_{\theta}^{2}}+\sigma_{l}^ {-2}(l-\|b\|) \tag{21}\]  
The correct fixing result cannot always be available for most searched rolls in the region. Some approximate value of the roll angle, by just one or a few values, can yield normally distributed residuals, and then fix the correct ambiguity. In order to retrieve the closest solution to the roll angle, we can take the global minimum value of the ambiguity function, as follows:  
\[j_{0}=\underset{j}{\text{argmin}}F\left(\overset{\sim}{z}_{j}\Big{|}\ \gamma_{j}\right),-N(z,\gamma)\leq j\leq N(z,\gamma) \tag{22}\]  
where \(N(z,\gamma)\) is the searching boundary, which affects the float roll angle and the searching efficiency. So far, we have got the new algorithm, and further discussion is needed. The flowchart of the proposed CLAMBDA-search method is shown in Figure 2, and the corresponding procedures are as follows:  
Step 1: use the code and phase observations to construct double-differenced measurements;  
Step 2: apply the Kalman filter to estimate the multi-baseline unknown parameters;  
Step 3: apply the CLAMBDA for the baseline without correctly fixed ambiguity, and record the current minimum of the fixed ambiguity objective function;  
Step 4: Apply attitude and geometry validation (see validation section). If the conditions are satisfied or the searching procedure is done, output the results. If any of the condition is not satisfied, start roll or pitch searching, re-construct double-differenced measurements, and jump to step 2.