Next Article in Journal
A Risk Assessment System of Toxic Gas Leakages in Metallurgy Based on Fuzzy Evaluation with Comprehensive Weighting
Previous Article in Journal
Prediction of Overall Survival in Cervical Cancer Patients Using PET/CT Radiomic Features
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

UAV Attitude Angle Measurement Method Based on Magnetometer-Satellite Positioning System

1
School of Aeronautics, Northwestern Polytechnical University, Xi’an 710072, China
2
Aircraft Academy, Xi’an Aeronautical Institute, Xi’an 710077, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2022, 12(12), 5947; https://doi.org/10.3390/app12125947
Submission received: 4 May 2022 / Revised: 27 May 2022 / Accepted: 28 May 2022 / Published: 10 June 2022
(This article belongs to the Section Aerospace Science and Engineering)

Abstract

:

Featured Application

Authors are encouraged to provide a concise description of the specific application or a potential application of the work. This section is not mandatory.

Abstract

To improve the measurement accuracy of unmanned aerial vehicles (UAVs), in this study, we proposed a method for measuring the attitude angle of a UAV by the combination of a magnetometer and satellite positioning system. Based on the measurement principle, we established a combined measurement error model, analyzed the root cause of the measurement error, and calibrated the magnetometer using the least-squares algorithm. For handling external or system interference effects, we designed a compensation algorithm that does not depend on environmental information. For handling measurement errors, a “current” statistical model was established, and the continuous-discrete Kalman filter algorithm was used to eliminate measurement errors. The test results showed that after using the compensation algorithm, the measurement error was reduced from 17.80% to 6.86% compared to the average absolute error of the local magnetic field intensity, and the absolute measurement error was reduced by 61.49%. The absolute measurement error was compared after using the compensation + filtering algorithm, and the error after compensation was further reduced by 42.36%. Hence, we proved the feasibility and effectiveness of our method.

1. Introduction

With the advancement of technology, the performance and reliability of microelectromechanical systems (MEMS) have been considerably improved, and the cost of manufacturing and application has also been considerably reduced [1,2]. Therefore, various types of MEMS sensors with small sizes, low power consumption, and low cost are widely used in domains such as navigation [1], aviation [3], weapon equipment [4], and robotics [5]. Although MEMS devices have many advantages, they also have problems such as large accumulated errors and serious zero drift caused by long-term operations. Additionally, they are susceptible to carrier motion acceleration and magnetic field environment interference, resulting in low accuracy of measurement results, poor stability and poor reliability [6,7]. When UAVs make large maneuvers, the gyroscope and accelerometer also face problems such as insufficient anti-overload ability [8,9]. Therefore, for UAV attitude measurement, several researchers have investigated the use of a magnetometer and other sensors to measure the fusion to improve the reliability and measurement accuracy of the measurement program. One of the most commonly used methods is the combination of a magnetometer and satellite system to measure the attitude angle of a UAV.
A magnetometer is a device that uses the Earth’s magnetic field to attain relatively stable magnetic field strength and direction characteristics in a large range of values to measure the motion parameters of moving objects. The measurement signal of the satellite system can provide geographic coordinates to determine the reference information of the local magnetic field strength and eliminate magnetometer drift, interference errors, and other issues. Therefore, the combination of a magnetometer and satellite system to measure the attitude angle can satisfy large-scale, long-term, and high-precision measurement requirements in engineering applications [10,11]. However, in practical applications, the method of measuring the attitude angle by the fusion of magnetometer and satellite positioning information leads to problems such as the influence of three-axis sensitivity deviation, zero-point deviation, environmental influence, measurement error, and other factors, resulting in a certain error in measurement accuracy. Demanding requirements such as high accuracy and high reliability, make it difficult to meet engineering requirements [12,13]. To improve the measurement accuracy [14], a complementary filtering method [15], Kalman filter [16], and gradient descent method [17] have been extensively studied, and a series of good results have been achieved in practical applications. However, these research results may lead to problems such as reduced attitude angle measurement accuracy and slow error convergence under conditions such as large maneuvering flight and strong magnetic interference, which can cause carrier oscillation and spin, thereby affecting flight safety. In view of the above problems, the Kalman filter method can eliminate the measurement noise of different sensors and can estimate and compensate for the error of the sensor. It is one of the most commonly used filtering methods in engineering applications.
In this study, we aim to address the problems of external interference and measurement errors in magnetometer-satellite systems in engineering applications. To achieve this, we established an error model of the combined measurement program and analyzed the impact of measurement accuracy. Based on the calibration of the magnetometer through the least squares fitting algorithm, an interference compensation algorithm and a continuous-discrete Kalman filter algorithm based on the current model were proposed. Finally, UAV attitude angle measurements were conducted and accurate results were achieved.

2. Measurement Principle and Error Analysis

2.1. Principle of Measurement of Attitude Angle Information by the Magnetometer and Satellite System

The basic principle of using a magnetometer and satellite data to measure the attitude angle of a UAV is as follows. The three-axis magnetometer and UAV body are installed by strapdown inertial navigation, and the direction of the sensitive axis of the magnetometer is the same as that of the body coordinate system. During the flight, the magnetometer measures geomagnetic data in real-time. The relationship matrix between the magnetometer measurement data, geomagnetic data, and body attitude angle is:
h b x h b y h b z = cos θ cos ψ cos θ sin ψ sin θ cos γ sin ψ + sin γ sin θ cos ψ cos γ cos ψ + sin γ sin θ sin ψ sin γ cos θ sin γ sin ψ + cos γ sin θ cos ψ sin γ cos ψ + cos γ sin θ sin ψ cos γ cos θ h n x h n y h n z
where h n x , h n y , h n z are the geomagnetic components in the navigation coordinate system; h b x , h b y , h b z are the projection components of the geomagnetic vector in the body coordinate system; and ψ , θ , γ are the yaw angle, pitch angle, and roll angle, respectively, in the navigation coordinate system.
According to Equation (1), the attitude angle of the body can be obtained using numerous feasible solutions, which cannot meet measurement requirements in engineering practice. Therefore, the fusion of satellite measurement data is required to measure the UAV attitude angle.
In the actual stable flight of a UAV, the angle of attack and angle of sideslip are both relatively small. Therefore, in the body coordinate and speed coordinate systems, the following relationship is satisfied:
θ α + θ v ψ β + ψ v
where α and β are the angles of attack and sideslip, respectively, and θ v and ψ v   are the pitch angle and sideslip angle of the body, respectively.
Satellite measurement equipment can measure the longitude, latitude, altitude, and speed of the position of a UAV in real-time. In the speed and navigation coordinate system, the pitch and sideslip angles of the body can be obtained using the speed information provided by the measuring equipment, as shown in the following equation:
θ v = arctan ( v z / v x 2 + v y 2 ) ψ v = arctan ( v y / v x )
where v x , v y , v z are the northward, eastward, and ground speed, respectively.
As the flight angle of attack is small, the pitch and sideslip angles of the body can be approximated as the measurement data of the pitch and yaw angles, respectively.
For low-spin application scenarios, when the yaw angle and pitch angle are known, the value of the roll angle can be uniquely determined using Equation (1):
γ = arctan n h b y m h b z m h b y + n h b z
where:
m = sin ψ h n x + cos ψ h n y n = cos ψ sin θ h n x + sin ψ sin θ h n y + cos θ h n z

2.2. Combined Measurement Error Model

In the combined measurement scheme of the magnetometer and satellite measurement system, the measurement of the pitch angle and yaw angle relies only on the data provided by the satellite measurement system, which is relatively simple. However, the measurement of the roll angle depends on the combination of the magnetometer and satellite measurement system. Hence, the data and measurement accuracy are affected more. To examine this, the roll-angle error model is established in this study.
The measurement method represented by Equation (4) is expressed in the following form:
γ = F ( h b y , h b z , h n x , h n y , θ , ψ )
In the roll angle measurement method represented by Equation (5), in addition to the measurement error of the sensor itself and random error, the main error is derived from the hypothesis of a small angle of attack. The pitch and sideslip angles of the body are considered to be equal to the pitch and yaw angles, respectively. In other words, the pitch and yaw angles used in this method have certain errors. Here, the small angle of attack error and measurement error increment are expressed in the following form:
δ θ = θ θ v δ ψ = ψ ψ v δ h b y = h b y h b y v δ h b z = h b z h b z v
The roll angle error in Equation (5) can be expressed as:
δ γ = F ψ ψ + F θ θ + δ F δ h b y h b y + F h b z h b z
where:
F ψ = n ψ m m ψ n a 2 + b 2
m ψ = cos ψ sin θ h n y sin ψ sin θ h n x
n ψ = cos ψ h n x sin ψ h n y
F θ = n θ m m θ n a 2 + b 2
n θ = cos ψ cos θ h n x + sin ψ cos θ h n y sin θ h n z
m θ = 0
F h b y = 1 1 + w 2 n ( v u ) v 2
F h b z = 1 1 + w 2 m ( v u ) v 2
u = n h b y m h b z
v = m h b y + n h b z
w = u v

2.3. Measurement Error Analysis

In Equation (7), the roll angle error depends on the h b y and h b z errors, pitch angle θ , yaw angle ψ , and incremental errors δ θ and δ ψ measured by the magnetometer.
The measurement errors of the magnetometer mainly include the inconsistency of the sensitivity of each axis, zero drift of the measuring device, interference of external magnetic field sources, interference of internal circuits, the magnetization material of the application object (iron, chromium, nickel and its alloys), and occasional measurement errors and jump points.
The errors in the pitch angle θ and yaw angle ψ mainly originate from the errors of the satellite measurement equipment, including system positioning errors caused by an insufficient number of satellites, external environment interference errors, and system jump points. There are various random errors in the measurement process of satellite positioning systems, which mainly include ephemeris error and satellite clock error related to the performance of the satellite itself; factors related to the propagation path such as stratospheric delay, ionospheric delay, and multiple path effects; receiver-related factors such as receiver antenna phase center deviation and change, receiver clock deviation, and signal delay deviation between different signal channels.
The errors in the pitch angle rate θ ˙ and yaw angle rate ψ ˙ are high-frequency errors, and the incremental errors δ θ and   δ ψ of the pitch angle θ and yaw angle ψ are algorithmic errors.
Generally, errors include the following: external or system interference (external magnetic field source interference, internal circuit interference, and magnetization influence), measurement error (high-frequency error, noise interference, jump points, etc.), system error (different axial sensitivity, zero drift, etc.), and algorithm errors (deviations caused by the assumption of a small angle of attack).
Different solutions must be adopted for different error characteristics to improve the accuracy of the system. Compensation algorithms can be used to compensate for external interference, electromagnetic and magnetization interference of the system itself, and other external or system interferences. These can be processed by filtering algorithms, and system errors can be corrected by data fitting. After processing by various methods, good measurement accuracy can be achieved to meet the needs of engineering practice. This study focuses on methods to eliminate external or system interference and measurement errors.

3. Magnetometer Calibration Based on Least-Squares Fitting Algorithm

In a certain region, the magnetic field of the Earth is uniform. If the three magnetic sensitive devices of the magnetometer are installed in three mutually perpendicular directions along the axis of the UAV body, after collecting sufficient data in each azimuth, the spatial distribution of these data should theoretically be such that the center of a sphere is at the origin of the coordinate sphere. However, owing to the influence of factors such as zero drift of the sensitive device and the different sensitivities of each axis, the originally collected data are neither at the center of the coordinate nor the sphere. To synchronize the measured data relative to the theoretical model, calibration of the original data is necessary. Generally, the calibration process includes two aspects: ellipsoid calibration and spherical calibration.

3.1. Ellipsoid Model

For magnetometers with three sensitive axes installed perpendicular to each other, the originally collected data represents a spatial ellipsoid that is roughly distributed along three axes parallel to the body axis. The aim of ellipsoid calibration is to use statistical methods to determine the ellipsoid equation with the smallest average variance of the collected data. In this study, we used the least-squares method to calibrate the magnetometer.
The general equation of the ellipsoid can be expressed as:
a 1 x 2 + a 2 y 2 + a 3 z 2 + a 4 x y + a 5 x z + a 6 y z + a 7 x + a 8 y + a 9 z = 1
We write the standard equation in the following form:
1 = ( x 2 y 2 z 2 x y x z y z x y z ) a 1 a 9
From a geometric perspective, the points distributed on the ellipsoid can be expressed in the following matrix form:
x c x y c y z c z r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 T λ 1 0 0 0 λ 2 0 0 0 λ 3 r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 x c x y c y z c z = 1 + c x c y c z r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 T λ 1 0 0 0 λ 2 0 0 0 λ 3 r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 c x c y c z
The above equation can be expressed as:
X C M X C T = 1 + C M C T X M X T 2 C M X T + C M C T = 1 + C M C T
where:
X = x y z represents a point on the ellipsoid and C = c x c y c z is the coordinate of the center of the ellipsoid.
M = R T B R = r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 T λ 1 0 0 0 λ 2 0 0 0 λ 3 r 11 r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33 = a 1 a 4 / 2 a 5 / 2 a 4 / 2 a 2 a 6 / 2 a 5 / 2 a 6 / 2 a 3
According to the ellipsoid model, the following ellipsoid parameters can be obtained:
Sphere center coordinates:
C = 0.5 a 7 a 8 a 9 M 1
X - axis length : x s c a l e = S S λ 1 Y - axis length : y s c a l e = S S λ 2 Z - axis length : z s c a l e = S S λ 3
where: S S = C M C T + 1

3.2. Ellipsoid Fitting Based on Least Squares Algorithm

If n sets of data are collected by the magnetometer, the ellipsoid equation can be expressed as:
1 1 1 = x 1 2 y 1 2 z 1 2 x 1 y 1 z 1 x 2 2 y 2 2 z 2 2 x 2 y 2 z 1 x n 2 y n 2 z n 2 x n y n z n a 1 a 2 a 9
We write,
H = x 1 2 y 1 2 z 1 2 x 1 y 1 z 1 x 2 2 y 2 2 z 2 2 x 2 y 2 z 1 x n 2 y n 2 z n 2 x n y n z n
k = a 1 a 2 a 9 T
Ellipsoid fitting determines a set of ellipsoid parameter values K, with the smallest variance based on the original measurement data and equation. According to the least squares algorithm, the ellipsoid parameters that lead to the smallest measurement error are:
k = ( H T H ) 1 H T

3.3. Magnetometer Calibration

The ellipsoid parameters obtained by fitting are used to calibrate the data measured by the magnetometer. First, we calibrate the origin of the ellipsoid coordinates as:
h b t = h b C
After this correction, the measurement data are distributed in an ellipsoid with the coordinate origin as the center of the sphere, which also eliminates the zero-point error.
Simultaneously, to eliminate the difference in the sensitivity of each axis, spherical calibration is required. When performing spherical calibration, a reference axis must be determined first. In the magnetometer-satellite measurement of the UAV attitude angle, the Y-axis is more important. Therefore, the Y-axis can be selected as the reference for spherical correction, namely:
h b = y s c a l e * h b t . * [ x s c a l e y s c a l e z s c a l e ]

4. Interference Compensation Algorithm

4.1. Principle of Interference Compensation

Considering interference conditions such as external magnetic field interference, carrier residual magnetic field, and magnetizing magnetic field interference, the measurement model of the magnetometer can be expressed as:
B m = C B e r + B p + K i C B e r = ( I 3 × 3 + K i ) C B e r + B p
where B m is the value measured by the magnetometer; and C is the conversion matrix from the reference coordinate system to the carrier coordinate system. The reference coordinate system is fixed and can be flexibly defined according to the actual trajectory; B e r is the local geomagnetic vector field, which can generally be regarded as a fixed vector field; B p is the external magnetic field interference and carrier remnant magnetic field; and K i is the magnetic susceptibility matrix.
The formal transformation of Equation (8) can be obtained as:
B m ( I 3 × 3 + K i ) C B e r B p = 0
Let, K = I 3 × 3 + K i 1 and B p k = K B P . Equation (9) can be expressed as:
K B m C B e r B p k = 0
From Equation (10), the following linear homogeneous equations is obtained:
A X = 0 N × 1
where:
A = C 1 B m , 1 T I 3 × 3 I 3 × 3 C 2 B m , 2 T I 3 × 3 I 3 × 3 C N B m , N T I 3 × 3 I 3 × 3 , X = B e r v e c ( K T ) B p k
is the Kronecker product, and v e c represents a matrix algorithm, i.e., a new matrix is formed by stacking the columns of the matrix in order from top to bottom; N is the data obtained by N groups of measurements.
Generally, the total strength of the geomagnetic field is constant and known throughout the entire flight range. Thus, the following equation is obtained:
X T D X = B e r 2
where:
D = I 3 × 3 0 3 × 12 0 12 × 3 0 12 × 12
The solution of the linear homogeneous equations determined by Equation (11) can be transformed into an optimization problem to obtain the minimum X value of the objective function f X = X T A T A X under the constraints of Equation (12).
The Lagrangian multiplier method is used to solve this optimization problem. The Lagrangian function is defined as:
L ( X , λ ) = X T A T A X + λ ( X T D X B e r 2 )
Additionally:
L / X = 0 L / λ = 0
A T A X = λ D X X T D X = B e T 2
As λ is the generalized characteristic root of matrices A T A and D , and X is the eigenvector family corresponding to the characteristic root, we obtain:
X T A T A X = λ B e T 2
Therefore, when λ assumes the minimum value λ m i n in the generalized characteristic root, the value of f x is the smallest. The feature vector family corresponding to X and λ m i n can be expressed as:
X = ω v
where A is the coefficient to be determined, and B is the eigenvector corresponding to the generalized eigenvalue. Incorporating Equation (25) into Equation (20), we obtain:
ω = ± B e r 2 / ( v T D v )

4.2. Coefficient Tuning Independent of Environmental Information

Section 4.1 presents the magnetometer compensation method under the interference conditions of the external magnetic field, carrier residual magnetic field, magnetizing magnetic field, and others. However, regarding the final result, Equation (18) cannot uniquely determine the compensation coefficient. Therefore, it is necessary to determine the compensation coefficient separately.
If the geographic coordinate system is selected as the reference coordinate system, the north component of the geomagnetic vector is generally positive, i.e., the north component of B e r is positive.
B e r ( 1 ) > 0
From Equations (19), (25) and (27), we obtain:
ω v ( 1 ) = X ( 1 ) > 0
From Equation (28), the value of the compensation coefficient can be uniquely determined.
This method can determine the compensation coefficient, but also has limitations. The geographic coordinate system must be selected as the reference coordinate system. Even if this restriction is relaxed, it is necessary to clearly determine the position of the selected reference coordinates relative to the geographic coordinate system. This is inconvenient for practical application. Next, we introduce a compensation coefficient tuning method that does not depend on environmental information.
By using the information of the carrier itself to adjust the compensation coefficient, we can avoid dependence on environmental information. In actual application scenarios of magnetometers, the UAV body generally avoids the use of magnetized materials up to the maximum possible extent. Therefore, the absolute value of each element of matrix k i is significantly less than 1, such that the main diagonal elements of matrix I 3 × 3 + K i are greater than 0. From Equations (19) and (25), we obtain:
K = X ( 4 ) X ( 5 ) X ( 6 ) X ( 7 ) X ( 8 ) X ( 9 ) X ( 10 ) X ( 11 ) X ( 12 ) = ω v ( 4 ) v ( 5 ) v ( 6 ) v ( 7 ) v ( 8 ) v ( 9 ) v ( 10 ) v ( 11 ) v ( 12 )
According to the definition of K :
I 3 × 3 + K i = K 1 = 1 ω v ( 4 ) v ( 5 ) v ( 6 ) v ( 7 ) v ( 8 ) v ( 9 ) v ( 10 ) v ( 11 ) v ( 12 ) 1
It is evident from Equation (30) that the value of ω is the value of all elements (greater than 0) on the main diagonal of the matrix K 1 . After calculating ω , we obtain:
B p k = ω v ( 13 ) v ( 14 ) v ( 15 )
The final compensation result can be written as:
K i = K 1 I 3 × 3 B p = K 1 B p k
From Equations (16), (29), (31) and (32), the geomagnetic vector in the reference frame after compensation can be obtained as:
B m = C B e r + B p + K i C B e r = ( I 3 × 3 + K i ) C B e r + B p

5. Measurement Error Compensation Based on Kalman Filter Algorithm

5.1. “Current” Statistical Motion Model

To eliminate the measurement error of the magnetometer and satellite positioning system, the Kalman filter algorithm is used. The Kalman filter is an effective method of handling measurement errors of dynamic system data, which can considerably improve the accuracy of dynamic measurements. Therefore, Kalman filter technology has been widely used in dynamic positioning.
In the method of combining a magnetometer and satellite positioning to measure attitude data, the state equation of the sensor is continuous, but the measurement equation is discrete. In other words, the measurement information of the sensor is obtained by sampling from the state equation of the sensor in a certain time interval. Therefore, after eliminating the measurement error, a continuous-discrete system model must be established.
According to the actual characteristics of the combined attitude measurement of the magnetometer and satellite positioning system, a continuous state model of the following form is established:
x ˙ ( t ) x ¨ ( t ) x ( t ) = 0 1 0 0 0 1 0 0 N x ( t ) x ˙ ( t ) x ¨ ( t ) + 0 0 1 ϖ ( t )
where x is the state quantity, which is the spatial position of the satellite measurement system. For the magnetometer, it is the change equation of the local geomagnetic intensity in each axis. N is the rate of change of each state, and ω ¯ represents various interference noises for each state.
Equation (34) presents greater difficulties in practical applications. First, the carrier does not move at a standard constant velocity or with constant acceleration, and there is a certain model error. In addition, the magnetic intensity model of each axis must rely on the shooting direction and attitude data of the missile, which are difficult to obtain quickly and accurately. Therefore, there are several limitations in the practical engineering application of the motion model of Equation (34).
In order to solve this problem, in this study, we use the “current” statistical model to optimize the motion model. When a state changes at a certain rate, the change in the rate value at the next moment should be limited, and can only be within the neighborhood of the current value. The “current” statistical model describes the changes in the current probability density of a state with an appropriate function distribution, and its mean value is the predicted value of the “current” rate. The random rate change can also satisfy the first-order time correlation characteristics on the time axis. The “current” statistical model is essentially a non-zero mean time-dependent model.
Based on the “current” statistical model, we can write:
x ¨ ( t ) = ϖ ˜ ( t ) + ϖ ( t )
ϖ ˙ ( t ) = N ϖ ( t ) + ω ( t )
where ω ¯ ˜ t is the “current” average value of the rate of change, which can be regarded as constant within the same sampling period of the sensor.
Hence,
ϖ 1 ( t ) = ϖ ˜ ( t ) + ϖ ( t ) = x ¨ ( t )
ϖ ˙ 1 ( t ) = ϖ ˜ ˙ ( t ) + ϖ ˙ ( t )
In the same sampling period, we can consider that ω ¯ ˜ ˙ t = 0 . Then, ϖ 1 ˙ t = ϖ ˙ t . ϖ t = ϖ 1 t ϖ ˜ ˙ t can be obtained from Equation (29), and FFF can be obtained by substituting this equation and Equation (28) into ϖ 1 ˙ t = ϖ ˙ t .
ϖ ˙ 1 ( t ) = N ϖ 1 ( t ) + N ϖ ˜ ( t ) + ω ( t )
which is expressed as:
x ( t ) = N x ¨ ( t ) + N ϖ ˜ ( t ) + ω ( t )
This is the state equation, which is the “current” statistical model of mobile carriers. At this time, Equation (34) is expressed as:
x ˙ ( t ) x ¨ ( t ) x ( t ) = 0 1 0 0 0 1 0 0 N x ( t ) x ˙ ( t ) x ¨ ( t ) + 0 0 1 ϖ ˜ ( t ) + 0 0 1 ω ( t ) = 0 1 0 0 0 1 0 0 N x ( t ) x ˙ ( t ) x ¨ ( t ) + 0 0 1 ( ϖ ˜ ( t ) + ω ( t ) )

5.2. Continuous-Discrete System Kalman Filter Algorithm

According to Equation (33), the system equation and measurement equation are described in the following form:
X ˙ ( t ) = F ( t ) X ( t ) + G ( t ) W ( t )
Z k = H k X k + V K
The continuous-discrete system Kalman filter equation is expressed as follows. The time correction equation is:
X ^ ˙ ( t ) = F ( t ) X ^ ( t )
P ˙ ( t ) = F ( t ) P ( t ) + P ( t ) F T ( t ) + G ( t ) Q ( t ) Q T ( t )
Here, t k 1 t t k .
The measurement correction equation is:
X ^ ˙ k = X ^ k , k 1 + K k [ Z k H k X ^ k , k 1 ]
K k = P k , k 1 H k T ( H k P k , k 1 H k T + R k ) 1
P k , k 1 = ϕ k , k 1 P k 1 ϕ k , k 1 T + Γ k 1 Q k 1 Γ k 1 T
P k = P k , k 1 K k H k P k , k 1

6. Test and Analysis

In order to verify the validity of the algorithm, a laboratory test method is used, and the test equipment is a three-axis turntable, as shown in Figure 1. Here, the HMR2300R three-axis strapdown magnetometer and BN-250 positioning + antenna integrated module of the Honeywell company are selected as the test equipment. The equipment is shown in Figure 2 and Figure 3.
In order to verify the validity of the algorithm, a laboratory test method is used, and the test equipment is a three-axis turntable, as shown in Figure 1. Here, the HMR2300R three-axis strapdown magnetometer and BN-250 positioning + antenna integrated module of the Honeywell company are selected as the test equipment. The equipment is shown in Figure 2 and Figure 3.
The experimental steps are as follows:
  • Step 1: Connect the direction of the sensor to the turntable and make it consistent;
  • Step 2: Fix the pointing angle of the turntable;
  • Step 3: Adjust the pitch angle of the turntable to be fixed, so that the turntable rolls and records the data;
  • Step 4: Adjust the pitch of the turntable to another angle and fix it to make the turntable roll and record data; repeat this step to collect data at different pitch angles;
  • Step 5: Fix the pitch angle of the turntable;
  • Step 6: Adjust the pointing angle of the turntable to be fixed, so that the turntable rolls and records the data;
  • Step 7: Adjust the pointing of the turntable to another angle and fix it, so that the turntable rolls and records data; repeat this step to collect data at different pointing angles;
The test location and local geomagnetic information are shown in Table 1.
To verify the compensation algorithm, five 10 mm neodymium iron boron high-strength magnets were placed 0.3 m in the horizontal direction on the left side of the turntable.

6.1. Magnetometer Calibration

The magnetometer was strapped in the axial direction of the three-axis turntable and collected 4250 sets of data. The initial distribution of the data is shown in Figure 4, Figure 5 and Figure 6.
From the distribution of the initial measurement data, it can be observed that the three axes of the magnetometer deviate from the theoretical value, and the measurement sensitivity of the three axes is not consistent.
Using the least-squares fitting algorithm, the results of the fitting and calibration of the magnetometer are as follows. For the ellipsoid equation represented by Equation (7), the fitting coefficients are:
a1 = 1/2565.8112; a2=1.8376/2565.8112; a3 = 1.8774/2565.8112; a4 = a5 = a6 = 0; a7 = 101.1578/2565.8112; a8 = 47.3103/2565.8112; a9 = −93.6223/2565.8112
The coordinates of the center of the ellipsoid are: 50.5790 12.8727 24.9344
The x−axis radius is: 38.2640
The y−axis radius is: 28.2269
The z−axis radius is: 27.9265
Using the aforementioned calibration method, the data distribution after the calibration of the magnetometer is shown in Figure 7.
As shown in Figure 4, the spatial distribution of the magnetometer measurement data after calibration is spherical, which is consistent with the theoretical spatial distribution.

6.2. Compensation Algorithm Verification

According to the compensation methods and steps presented in this article, the following compensation results are calculated:
K i = 0.0251 0.0113 0.0087 0.0384 0.3031 0.0034 0.093 0.0074 0.0059 B p = 34.2870 746.2563 67.3204 T
The measurement result of a single axis changes with change in the attitude angle of the carrier. Therefore, the measurement data of a single axis lacks standard comparison data. To solve this problem, we have used the total magnetic intensity to perform an algorithmic effect analysis. The relationship between the three axial magnetic field strengths and total magnetic field strength is:
H b = h b x 2 + h b y 2 + h b z 2
The local magnetic field strength, original measurement data, and compensated data are shown in Figure 8 and Figure 9, respectively.
From the analysis of the data in Figure 8, after using the compensation algorithm, the deviation of the data is considerably reduced compared to the local magnetic field, and the fluctuation of the data is smaller. As shown in Figure 9, the measurement data error is significantly reduced after compensation. After further analysis, it can be observed that the average absolute error of the original measurement data compared to the local magnetic field strength is 17.80%, and the average absolute error of the measurement data compensated by the compensation algorithm is 6.86% compared to the local magnetic field strength. From the data, error distribution, and absolute error analysis results, after using the compensation algorithm, the absolute measurement error of the magnetometer is reduced by 61.49%, which effectively compensates for external or system interference.

6.3. Kalman Filter Algorithm

The measurement accuracy can be improved significantly after external or system interference is compensated. However, the compensated data are still influenced by measurement jump points and noise errors. As shown in Figure 10, in the 7500 sets of measurement data, there are four obvious jump points. Such incorrect measurement jump points can cause hidden dangers to the safe flight of UAVs. At the same time, in Figure 10, there is a greater influence of noise at the beginning and end of the measurement, which reduces the measurement accuracy of the attitude angle.
Using the continuous-discrete model established in this study, the measurement equation step size adopts the sampling period of the sensor, and the error model adopts the uncorrelated white Gaussian noise model. The measurement results and error comparisons before and after filtering are shown in Figure 11 and Figure 12.
From the analysis of the data in Figure 11, it can be observed that after applying the filtering algorithm, the deviation of the data is further reduced compared with the compensated magnetic field data. Additionally, the data fluctuation is weaker, and the impact of jumping points is eliminated. As shown in Figure 12, the measurement data error is further reduced after filtering. The analysis shows that compared to the 6.86% average absolute error of the local magnetic field strength, the measurement data compensated by the compensation algorithm is 3.95% of the average absolute error of the local magnetic field strength. From the data and error distribution, the absolute error analysis result shows that the absolute measurement error of the magnetometer is further reduced by 42.36% compared with the compensated data after filtering. This effectively eliminates the errors caused by jump points and noise.

7. Conclusions

In this study, we focus on the problems of external interference and measurement errors in the measurement of the UAV attitude angle. A combined measurement model is established based on the magnetometer-satellite positioning system combined with the measurement attitude angle program. According to the model, the source of the measurement error is analyzed, and the effects of external or system interference, measurement error, system error, and algorithm error on the final measurement error are clarified. The magnetometer has been tested and calibrated according to the ellipsoid fitting principle of the least squares method. To analyze the characteristics of measurement error factors, we have designed a compensation algorithm that does not depend on environmental information of the influence of external or system interference, which reduces the absolute measurement error of the magnetometer by 61.49% and effectively compensates for external or system interference. The continuous-discrete Kalman filter algorithm of the “current” model is established to reduce the measurement error such that the absolute measurement error of the magnetometer is further reduced by 42.36% relative to the compensated data, which effectively eliminates the error caused by jumping points and noise.
The experimental results show that the combined attitude angle measurement scheme of the magnetometer-satellite positioning system can improve measurement accuracy by effectively compensating for interference and by reducing jumping points or noise error. This proves the feasibility and effectiveness of the scheme, its suitability for UAV attitude angle measurement, and its high engineering application value.

Author Contributions

Literature review and analysis, G.Q. and Z.Z.; writing G.Q. and J.L.; experiment—analysis, Z.Z., Y.D. and Z.S.; experiment—performance G.Q. and A.G. All authors have read and agreed to the published version of the manuscript.

Funding

Shaanxi Province Key R&D Program(2021ZDLGY09-08), Shaanxi Province Natural Science Basic Research Program(2022JQ-060), Defense Fund (2021-JCJQ-JJ-0805 and 2021-JCJQ-JJ-0790), Natural Science Youth Fund project of Shaanxi Province2021JQ-858, General Aviation Technology Center Fund (XHY-2016084), National Defense Science and Technology Key Laboratory Fund (6142101200108), Shaanxi Higher Education Teaching Reform Research Project (21BY163), Youth Science Fund(62103441), Key Projects of Shaanxi Province2022JZ-37, Scientific Research Foundation of Xi’an Aeronautical Institute (2021KY0210 and 2021KY0209), Special scientific Research Project of Education Department of Shaanxi Province21JK0701.

Institutional Review Board Statement

The article does not cover human research, so it does not cover this item.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

The authors would like to acknowledge financial support from Shaanxi Province Key R&D Program(2021ZDLGY09-08), Shaanxi Province Natural Science Basic Research Program(2022JQ-060), Defense Fund (2021-JCJQ-JJ-0805 and 2021-JCJQ-JJ-0790), Natural Science Youth Fund project of Shaanxi Province2021JQ-858, General Aviation Technology Center Fund (XHY-2016084), National Defense Science and Technology Key Laboratory Fund (6142101200108), Shaanxi Higher Education Teaching Reform Research Project (21BY163), Youth Science Fund(62103441), Key Projects of Shaanxi Province2022JZ-37,Scientific Research Foundation of Xi’an Aeronautical Institute (2021KY0210 and 2021KY0209), Special scientific Research Project of Education Department of Shaanxi Province21JK0701.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Sun, Y.L.; Jiang, X. MEMS/Geomagnetism-based adaptive estimation algorithm of UAV heading and attitude. Sens. Microsyst. 2020, 39, 122–125. [Google Scholar]
  2. Ji, H.D.; Jiang, W.G. Simulation research on attitude calculation based on multi-MEMS sensor combination. Instrum. Technol. Sens. 2020, 08, 85–89. [Google Scholar]
  3. Liu, X.H.; Liu, X.X. UAV attitude calculation algorithm based on acceleration correction model. J. Northwest. Polytech. Univ. 2021, 39, 175–181. [Google Scholar] [CrossRef]
  4. Xu, T.T.; Zhao, B.X.; Luo, Y.Z. Attitude data fusion algorithm of MEMS sensor components based on complementary-particle filter. Ordnance Ind. Autom. 2021, 40, 29–32. [Google Scholar]
  5. Yu, C.Y.; Zhang, Z. Spherical robot attitude calculation based on complementary filtering and particle filter fusion. Robot. J. 2021, 43, 340–349. [Google Scholar]
  6. An, L.L.; Wang, L.M.; Zhong, Y. A low-cost method for measuring speed and roll angle with a single-axis magnetic sensor. Ordnance Equip. Eng. J. 2020, 41, 1–4. [Google Scholar]
  7. Shao, W.P.; Sun, L.; Zhang, J.Y. A method for calculating the attitude of a rotating body based on a geomagnetic sensor. Sichuan Armamentary Eng. J. 2020, 41, 62–66. [Google Scholar]
  8. Miao, J.S.; Zhai, Y.C.; Gou, Q.X. Calculation method of missile rolling attitude based on satellite/geomagnetic combination. J. Missile Guid. 2014, 34, 63–66. [Google Scholar]
  9. Wu, Y.; Zou, D.; Liu, P. Dynamic Magnetometer Calibration and Alignment to Inertial Sensors by Kalman Filtering. IEEE Trans. Control. Syst. Technol. 2018, 26, 716–723. [Google Scholar] [CrossRef] [Green Version]
  10. Wu, Y.; Zhu, M.; Yu, W. An Efficient Method for Gyroscope-aided Full Magnetometer Calibration. IEEE Sens. J. 2019, 19, 6355–6361. [Google Scholar]
  11. Gao, L.Z.; Zhang, Y.Y.; Zhang, X.M. Fast calibration algorithm of installation angle for geomagnetic vector information measurement. Ordnance Equip. Eng. J. 2020, 4, 220–224. [Google Scholar]
  12. Cao, P.; Yu, J.Y.; Wang, X.M. Research on high-frequency measurement and system error calculation of high-rotation projectile roll angle based on the combination of geomagnetism and satellite. Acta Armamentari 2014, 35, 795–800. [Google Scholar]
  13. Liu, J.H.; Li, X.H. A universal vector compensation method for carrier interference in magnetometers. Chin. J. Sci. Instrum. 2020, 41, 112–118. [Google Scholar]
  14. Rigatos, G.; Busawon, K.; Pomares, J. Nonlinear optimal control for a spherical rolling robot. Int. J. Intell. Robot. Appl. 2019, 3, 221–237. [Google Scholar] [CrossRef]
  15. Indiveri, G.; Malerba, A. Complementary control for robots with actuator redundancy: An underwater vehicle application. Robot. Int. J. Inf. Educ. Res. Robot. Artif. Intell. 2017, 35, 206–223. [Google Scholar] [CrossRef]
  16. Hu, Z.; Gallacher, B. Extended Kalman filtering based parameter estimation and drift compensation for a MEMS rate integrating gyroscope. Sens. Actuators A. Phys. 2016, 250, 96–105. [Google Scholar] [CrossRef] [Green Version]
  17. Sabet, M.T.; Daniali, H.M.; Fathi, A.; Alizadeh, E. A Low-Cost Dead Reckoning Navigation System for an AUV Using a Robust AHRS: Design and Experimental Analysis. IEEE J. Ocean. Eng. 2017, 43, 927–939. [Google Scholar] [CrossRef]
Figure 1. Three-axis turntable.
Figure 1. Three-axis turntable.
Applsci 12 05947 g001
Figure 2. HMR2300R three axis strapdown magnetometer and carrier plate.
Figure 2. HMR2300R three axis strapdown magnetometer and carrier plate.
Applsci 12 05947 g002
Figure 3. BN-250 positioning + antenna integrated module.
Figure 3. BN-250 positioning + antenna integrated module.
Applsci 12 05947 g003
Figure 4. Spatial distribution of initial measurement data.
Figure 4. Spatial distribution of initial measurement data.
Applsci 12 05947 g004
Figure 5. X−Y plane distribution of initial measurement data.
Figure 5. X−Y plane distribution of initial measurement data.
Applsci 12 05947 g005
Figure 6. Y−Z plane distribution of initial measurement data.
Figure 6. Y−Z plane distribution of initial measurement data.
Applsci 12 05947 g006
Figure 7. Spatial distribution of data after calibration.
Figure 7. Spatial distribution of data after calibration.
Applsci 12 05947 g007
Figure 8. Compensation algorithm effect.
Figure 8. Compensation algorithm effect.
Applsci 12 05947 g008
Figure 9. Data error before and after compensation.
Figure 9. Data error before and after compensation.
Applsci 12 05947 g009
Figure 10. The influence of jumps and noise.
Figure 10. The influence of jumps and noise.
Applsci 12 05947 g010
Figure 11. Data comparison before and after filtering.
Figure 11. Data comparison before and after filtering.
Applsci 12 05947 g011
Figure 12. Data error before and after filtering.
Figure 12. Data error before and after filtering.
Applsci 12 05947 g012
Table 1. Local magnetic field information.
Table 1. Local magnetic field information.
Latitude:31.8597691°
Longitude:117.2710962°
Height:273.00 m
Total field:42965 nT
Magnetic declination:−4.932°
Magnetic inclination:48.453°
X component:28391 nT
Y component:−2450 nT
Z component:32155 nT
Horizontal component:28496 nT
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Qu, G.; Zhou, Z.; Li, J.; Shao, Z.; Dong, Y.; Guo, A. UAV Attitude Angle Measurement Method Based on Magnetometer-Satellite Positioning System. Appl. Sci. 2022, 12, 5947. https://doi.org/10.3390/app12125947

AMA Style

Qu G, Zhou Z, Li J, Shao Z, Dong Y, Guo A. UAV Attitude Angle Measurement Method Based on Magnetometer-Satellite Positioning System. Applied Sciences. 2022; 12(12):5947. https://doi.org/10.3390/app12125947

Chicago/Turabian Style

Qu, Gaomin, Zhou Zhou, Jiguang Li, Zhuang Shao, Yanfei Dong, and An Guo. 2022. "UAV Attitude Angle Measurement Method Based on Magnetometer-Satellite Positioning System" Applied Sciences 12, no. 12: 5947. https://doi.org/10.3390/app12125947

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop