## 4 Proposed Method
### Compensation Principle  
According to the foregoing, the magnetic interference vector caused by current can be divided into two parts: the magnetic interference caused by constant current and the magnetic interference caused by changed current and the magnetic interference vector should be projected in the direction of the geomagnetic field. So, we established a compensation model with six coefficients.  
Assume that the magnetic interference vector caused by the current is shown in Equation (9).  
\[\mathbf{H}_{d}(t)=\mathbf{H}_{I}(t)+\mathbf{H}_{f}(t) \tag{9}\]  
where \(\mathbf{H}_{I}(t)\) is the magnetic interference vector linearly dependent on the current, and \(\mathbf{H}_{f}(t)\) is the magnetic interference vector linearly dependent on the time derivative of the current.  
The magnitude of the magnetic anomaly signal measured using the optical pump magnetometer is numerically approximate to the projection of the magnetic anomaly vector in the direction of the geomagnetic field vector. Therefore, the magnetic interference caused by the current can be expressed as follows:  
\[H_{pd}(t)=\begin{bmatrix}H_{I_{x}}(t)&H_{I_{y}}(t)&H_{I_{z}}(t)\end{bmatrix} \cdot\begin{bmatrix}\cos\alpha\\ \cos\beta\\ \cos\gamma\end{bmatrix}+\begin{bmatrix}H_{I_{x}}(t)&H_{I_{y}^{\prime}}(t)&H_{ I_{z}^{\prime}}(t)\end{bmatrix}\cdot\begin{bmatrix}\cos\alpha\\ \cos\beta\\ \cos\gamma\end{bmatrix} \tag{10}\]  
\[\cos\alpha=X(t)/\sqrt{X(t)^{2}+Y(t)^{2}+Z(t)^{2}} \tag{11}\]  
\[\cos\beta=Y(t)/\sqrt{X(t)^{2}+Y(t)^{2}+Z(t)^{2}} \tag{12}\]  
\[\cos\gamma=Z(t)/\sqrt{X(t)^{2}+Y(t)^{2}+Z(t)^{2}} \tag{13}\]where \(H_{I_{x}}(t)\), \(H_{I_{y}}(t)\) and \(H_{I_{z}}(t)\) are, respectively, XYZ three components of \(H_{I}(t)\) in the body coordinate system, while \(H_{I_{x}}(t)\), \(H_{I_{y}^{\prime}}(t)\) and \(H_{I_{z}^{\prime}}(t)\) are, respectively, \(XYZ\) three components of \(H_{I}(t)\) in the body coordinate system. \(X(t)\), \(Y(t)\) and \(Z(t)\) are fluxgate \(XYZ\) triaxial measurements. The \(XYZ\) three components of \(H_{I}(t)\) are all linearly dependent on the current \(I(t)\), and the \(XYZ\) three components of \(H_{I^{\prime}}(t)\) are all linearly dependent on the time reciprocal of the current \(I(t)\). Therefore, Equation (8) can be written as follows:  
\[\begin{split} H_{pd}(t)=\mathbb{C}_{1}I(t)\text{cos}\,\alpha+ \mathbb{C}_{2}I(t)\text{cos}\,\beta+\mathbb{C}_{3}I(t)\text{cos}\,\gamma+\\ \mathbb{C}_{4}I^{{}^{\prime}}(t)\text{cos}\,\alpha+\mathbb{C}_{5} \text{I}^{{}^{\prime}}(t)\text{cos}\,\beta+\mathbb{C}_{6}\text{I}^{{}^{\prime }}(t)\text{cos}\,\gamma\end{split} \tag{14}\]  
where \(I(t)\) is current and \(I^{{}^{\prime}}(t)\) is current derivative to time. Coefficient \(C_{k}(k=1,2,\cdots,6)\) are the magnetic compensation coefficients of UAV electronic equipment. \(\text{Cos}\,\text{cos}\,\beta\text{,cos}\,\gamma\), respectively, represent the direction cosine of the geomagnetic field in the UAV coordinate system. It is expressed in matrix form as follows:  
\[H_{n\times 1}=A_{n\times 6}C_{6\times 1}+Z_{n\times 1} \tag{15}\]  
\[A=\left[I(t)\text{cos}\,\alpha I(t)\text{cos}\,\beta I(t)\text{cos}\,\gamma I ^{{}^{\prime}}(t)\text{cos}\,\alpha I^{{}^{\prime}}(t)\text{cos}\,\beta I^{{ }^{\prime}}(t)\text{cos}\,\gamma\right] \tag{16}\]  
where \(H\) is the interference magnetic field of the UAV platform and \(C\) is the coefficient in the aeromagnetic compensation model. A is the current interference matrix composed of current and current derivative to time and \(Z\) is the model error.  
The above formula is a linear equation, and the compensation coefficients can be solved by ground calibration data using the least square algorithm (LS).  
The least square solution of the compensation coefficients C are as follows [27]:  
\[C=\left(A^{T}A\right)^{-1}A^{T}H_{d} \tag{17}\]