Introduction

Attitude is essential information for navigation and control of an aircraft. There are many approaches to estimate the attitude of an aircraft, and the most popular one for manned aircraft is to use the inertial navigation system (INS). However, for small unmanned aerial vehicles (UAVs), which are defined in this study as UAVs with a gross weight of less than 50 kg and a wingspan of 4.5 m or less, the use of a high accuracy INS is not practical due to low-cost, weight and space constraints. Investigations into the attitude estimation with inexpensive, lightweight, and small-sized sensors based on micro electro-mechanical system (MEMS) have been reported in, for example, Wang et al. (2004), Jurman et al. (2007), and Zhu et al. (2007). The known drawbacks of MEMS-based sensors are high noise, drift, and scale factor errors. Most importantly, the vibration and noise of a small UAV driven by piston engine significantly degrade the accuracy of the inertial measurement unit (IMU) especially for MEMS-based sensors (Liu and Randall 2005; Suh 2006).

In order to improve the accuracy and reliability of the attitude estimation methods when dealing with MEMS sensors, fusion algorithms using two or more types of sensors are implemented. The complementary filter (Collinson 1996) is a fusion algorithm, which integrates the gyroscope and inclinometer, thus compensating for the drift of the gyroscope and for the slow dynamics of the inclinometer (Baerveldt and Klang 1997). By fusing gyroscopes, inclinometers, and magnetometer, all the Euler angles including roll, pitch, and yaw angles can be obtained (Tomczyk 2002). The roll and pitch angles, derived from inclinometers, are applied as the corrections in roll and pitch angles, while the yaw angle, derived from the magnetometer, is applied as the correction in yaw angle. Correction is applied to the complementary filter of each Euler angle in order to eliminate the error induced by the drift of the gyroscope.

Another approach of sensor fusion algorithms is the extended Kalman filter (EKF). By using the measurements from the gyroscopes for time propagation of the attitude and using other aiding sensors for the measurement update portion of this filter, the optimal attitude solution can be estimated. These aiding sensors, measuring the Euler angles, may be composed of two inclinometers which serve as absolute attitude measuring devices for roll and pitch drift compensation, and one magnetometer for yaw drift compensation (Setoodeh et al. 2004). The accelerometers can be regarded as inclinometers, which also provide an absolute reference of the attitude by relating the body orientation to the gravity vector, while GPS provides the yaw drift compensation from its heading measurement (Hall et al. 2008).

GPS plays a more important role in attitude estimation because of its long-term accuracy in providing position and velocity. Large errors in low-cost inertial sensors can be compensated by position and velocity updates derived from GPS. Attitude derived from multi-antenna GPS system using differential carrier phase measurements and resolving integer ambiguities has been extensively investigated (Cohen 1996; Gebre-Egziabher et al. 2004). For small-scaled rotary-wing aircraft, an attitude estimation method using the velocity measurements with single antenna GPS was proposed; the time lag of the estimated attitude was compensated with the help of measurements from gyroscopes by using the complementary filter (Tenn et al. 2009).

The above sensor fusion algorithms provide efficient solutions to enhance the accuracy of the attitude estimation. However, these solutions are not applicable to small UAVs because of weight, space, and computing power constraints (Kingston and Beard 2004). For examples, the weight constraint prohibits the implementation of high accuracy INS, the space constraint prohibits the installation of multi-antenna GPS system, and the computing power constraint prohibits the INS/GPS integration running complex algorithms. This study, therefore, focuses on the impact of piston engine vibrations in small UAVs on attitude estimation based on accelerometer, gyroscope, and single antenna GPS sensors. The characteristic of engine vibrations will be modeled.

The proposed method fuses the gyroscopes and single antenna GPS with quaternion-based EKF. Since GPS is already an integral part of the navigation system for small UAVs, the addition of single antenna GPS will not be an additional burden. The pseudo-attitude derived from single antenna GPS is the GPS velocity-based attitude. The pseudo-attitude is drift-free and exhibits good long-term accuracy in contrast to gyroscope-based attitude. However, the pseudo-attitude has a high noise content and slower dynamics with a time lag due to the Kalman filter (Tenn et al. 2009). Therefore, the short-term accuracy of pseudo-attitude is poor and it cannot track the fast dynamics of an aircraft, whereas the gyroscopes, being less sensitive to vibrations relative to accelerometers, can provide good short-term accuracy but suffer from drift, which will induce accumulating errors. Therefore, the integration of both sensors seems optimal. The quaternion-based EKF is applied because it performs better than the complementary filter and suits the computing power of small UAV.

The following section “Attitude estimation methods with different sensors” discusses about three methods namely, gyroscope-based method, accelerometer-based method, and GPS velocity-based method. The next section “vibration of the small UAV” discusses the modeling of engine vibration and the influence of vibrations on the attitude estimation with different sensors. Quaternion attitude representation and sensor fusion algorithm are presented in the section “Fusion of gyroscopes and single antenna GPS with quaternion-based EKF”. The simulation setup and experimental setup are described in the section “Simulation and Experiment”. Three simulations and one flight experiment are given in the section “Results and Discussions”, to be followed by Conclusion section.

Attitude estimation methods with different sensors

Three attitude estimation methods with different sensors will be discussed in this section. The first one is the gyroscope-based method based on measurements of gyroscopes in the body coordinate frame. The second one is the accelerometer-based method derived from measurements of accelerometers with the body orientation related to the gravity vector. The last one is the GPS velocity-based method derived from single antenna GPS by fusing the velocity information with the flight dynamics of the aircraft.

Gyroscope-based method

In strapdown systems, gyroscopes measure the angular rates of three axes of the body with respect to the inertial coordinate frame. The x-axis points to the nose of the aircraft, the y-axis points to the right wing of the aircraft, and the z-axis is directed downward. With these measurements of angular rates in body coordinates, the attitude of the aircraft can be derived by integrating the rigid body kinematic equations, starting from a known initial attitude at a given point in time. The attitude of a body with respect to the inertial coordinate frame is defined by the three Euler angles namely, roll, pitch, and yaw, denoted by the symbols ϕ, θ, and Ψ, respectively. The continuous-time nonlinear rigid body kinematic equation in state-space representation is

$$ \left[ {\begin{array}{*{20}c} {\dot{\phi }} \\ {\dot{\theta }} \\ {\dot{\psi }} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 1 & {\sin \phi \tan \theta } & {\cos \phi \tan \theta } \\ 0 & {\cos \phi } & { - \sin \phi } \\ 0 & {\sin \phi \sec \theta } & {\cos \phi \sec \theta } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} p \\ q \\ r \\ \end{array} } \right] $$
(1)

where p, q, and r are the angular rates measured by gyroscopes in the body coordinate frame. The details of this method can be found in Collinson (1996). Because of the drift, which is a low frequency noise in the output signal of the gyroscopes, the errors will accumulate. This situation makes the gyroscope-based method usable only over a short period of time. This will be validated in the simulations.

Accelerometer-based method

The accelerometers in strapdown systems measure the resultant of gravitational and other accelerations acting on the body to which the sensors are attached. The idea of this method is to regard the accelerometers as inclinometers, which provide an absolute reference of the attitude by relating the body orientation to the gravity vector. It is assumed that the body is not moving or is moving at constant speed that the Coriolis acceleration due to the earth’s rotation is negligible and the gravity is the only source of acceleration. Under these assumptions, the roll and pitch angles can be estimated by the following equations, respectively (Kayton and Fried 1997):

$$ \phi = \tan^{ - 1} \left( {{\frac{{a_{y} }}{{a_{z} }}}} \right) $$
(2)
$$ \theta = \tan^{ - 1} \left( {{\frac{{a_{x} }}{{\sqrt {a_{y}^{2} + a_{z}^{2} } }}}} \right) $$
(3)

where a x , a y, and a z are the accelerations measured by accelerometers in the body coordinate frame. When an aircraft performs high dynamic maneuvers such as acceleration or turning, the assumption that only the gravitational acceleration exists is invalid. The accelerometers can provide very accurate measurements of attitude, but the accelerometer-based attitude is sensitive to external acceleration and vibration. Therefore, this method is not a good option for the attitude estimation and sensor fusion algorithms of small UAVs powered by piston engine.

GPS velocity-based method

This method fuses the attitude information from GPS velocity measurements, acquired from a single antenna GPS receiver, and the flight dynamics of fixed-wing aircraft under the assumptions of coordinated flight, which means no sideslip occurs during turning and banking of the aircraft and uniform wind condition (Kornfeld et al. 1998). The synthesized attitude is termed the pseudo-attitude and consists of an equivalent roll angle about the velocity vector of the aircraft, an equivalent pitch angle defined as the horizontal flight path angle, and an equivalent yaw angle defined as the vertical flight path angle. The differences between the aircraft velocity vector axes and the body axes are the angle of attack in the longitudinal plane and the sideslip angle in the lateral plane. For coordinated flight, the pseudo-roll angle and Euler roll angle are almost identical (Kornfeld et al. 1998).

The pseudo-roll angle \( \tilde{\phi } \) is synthesized from the velocity and acceleration vectors with respect to the ground, denoted as v g and a g, respectively. The acceleration vector, however, is not provided in the receiver navigation solution. Therefore, it has to be estimated. Typically, the discrete Kalman filter is adopted to provide the estimation of the acceleration vector based on the received v g. Then, the angle \( \tilde{\phi } \) is determined as the complement of the angle between a pseudo-lift \( {\tilde{\mathbf{l}}} \) and a local horizontal reference \( {\tilde{\mathbf{p}}}, \)

$$ \tilde{\phi } = \sin^{ - 1} \left( {{\frac{{{\tilde{\mathbf{l}}} \cdot {\tilde{\mathbf{p}}}}}{{\left| {{\tilde{\mathbf{l}}}} \right| \cdot \left| {{\tilde{\mathbf{p}}}} \right|}}}} \right) $$
(4)

where \( {\tilde{\mathbf{l}}} \) is defined as

$$ {\tilde{\mathbf{l}}} = {\tilde{\mathbf{a}}}_{\text{g}}^{n} - {\tilde{\mathbf{g}}}^{n} $$
(5)

The symbols \( {\tilde{\mathbf{a}}}_{\text{g}}^{n} \) and \( {\tilde{\mathbf{g}}}^{n} \) denote the components of a g and the gravitational acceleration g, normal to v g, respectively.

The local horizontal reference is defined by

$$ {\tilde{\mathbf{p}}} = {\mathbf{g}} \times {\mathbf{v}}_{\text{g}} = {\tilde{\mathbf{g}}}^{n} \times {\mathbf{v}}_{\text{g}} $$
(6)

The pseudo-pitch angle \( \tilde{\theta } \) is defined as the angle between v g and the local horizontal plane, and the pseudo-yaw angle \( \tilde{\psi } \) is defined as the angle between the components of v g in the north and east directions,

$$ \tilde{\theta } = \tan^{ - 1} \left( {{\frac{{ - v_{\text{gD}} }}{{\sqrt {v_{\text{gN}}^{2} + v_{\text{gE}}^{2} } }}}} \right) $$
(7)
$$ \tilde{\psi } = \tan^{ - 1} \left( {{\frac{{v_{\text{gE}} }}{{v_{\text{gN}} }}}} \right) $$
(8)

where the subscripts N, E, and D denote, respectively, north, east, and down directions in the NED coordinate frame. The details of the pseudo-attitude and the discrete Kalman filter for estimating the acceleration vector are described in Kornfeld et al. (1998).

However, the assumptions of coordinated flight and uniform wind condition will not hold true during the entire flight of an aircraft. When these assumptions are invalid, the pseudo-roll angle may differ considerably from the Euler roll angle. In this study, these instances are not within the scope of investigation, so the pseudo-roll angle and the Euler roll angle are assumed to be nearly identical. The difference between the pseudo-pitch angle and the Euler pitch angle is negligible as is the difference between the pseudo-yaw angle and the Euler yaw angle. In the simulations and flight experiments, the flight conditions are always maintained in coordinated flight, and the atmosphere conditions are chosen to be nearly uniform with only light breeze.

Vibration of small UAVs

The vibration model of piston engine is assumed to be a forced vibration with damping. In order to validate this assumption, some tests have been carried out on a small-scale radio-controlled (RC) aircraft equipped with a two-stroke glow engine, a MEMS-based IMU and a tachometer. The spectrum analysis of the vibration is performed by using the short-time Fourier transform (STFT) in order to observe the temporal information in the frequency domain (Blanchet and Charbit 2006). Finally, the influences of the vibration on accelerometer-based, gyroscope-based, and GPS velocity-based attitude estimations are examined in flight tests for the same RC aircraft.

Vibration modeling for small UAVs

In forced vibration, the frequency of the vibration is equal to the frequency of the force or motion applied, and the magnitude of vibration depends on the actual mechanical system (Vér and Beranek 2006). The moving parts of a piston engine, such as the piston, connecting rod, and crankshaft, are actuated at the same frequency. The propeller of the vehicle also rotates at that frequency.

Tests were carried out to validate the proposed vibration model of a small UAV by using a MEMS-based IMU including a 3-axes accelerometer (full-scale range of ±3g), three single-axis gyroscopes (full-scale range of ±300°/s), and a homemade tachometer that integrates a photo-interrupter and a microprocessor. These sensors were installed on a small-scale RC aircraft, which is an off-the-shelf almost-ready-to-fly kit and equipped with a two-stroke glow engine. The wingspan of this RC aircraft is 1.65 m. The IMU measures the amplitude and frequency of the vibration induced by the piston engine, and the tachometer measures the rotational rate of the propeller. Measurements of the IMU are in voltages, converted from a 12-bit analog-to-digital converter. The sampling rate of the data acquisition system is 500 Hz, and it is sufficient for most engines of small UAVs since their maximum rotational rates are lower than half of the sampling rate according to the Nyquist–Shannon sampling theorem.

The discrete Fourier transform transforms data in the time domain to the frequency domain. However, in the transformation process the temporal information is lost. In this study, the frequency of the vibration changed over time since the aircraft was operated in different flight conditions. In order to observe the temporal information in frequency domain, the STFT was used to analyze the spectrums.

During the data acquisition, the aircraft was held on the ground, and the throttle was changed over time to control the engine speed. Figure 1 shows the spectrograms of the 3-axes accelerometer outputs in x-, y-, and z-axes. Figure 2 shows the corresponding rotational rate of the propeller over time. As shown in these figures, the dominant frequencies in the spectrograms are identical to the propeller rotational rates. The amplitudes of vibration are different in these spectrograms and so are the noise contents. Therefore, it is legitimate to assume that the vibration of the engine for small UAVs can be treated as the forced vibration of single-degree-of-freedom system with damping. The steady-state solution of the forced vibration system with damping subjected to a sinusoidal force \( F(t) = F\cos (2\pi ft) \) can be expressed as (Vér and Beranek 2006)

$$ x(t) = X\cos (2\pi ft - \varphi ) $$
(9)

where x(t) is the vibration function, X is the amplitude of vibration, f is the vibration frequency, which is the same as the engine operating speed, and φ is the phase. In this study, the phase is negligible because we are not concerned about the influence of the phase on attitude estimation methods.

Fig. 1
figure 1

The spectrograms of the 3-axes accelerometer outputs in x- (a), y- (b), and z-axes (c). The amplitude is indicated by the bar on the right in units of voltage

Fig. 2
figure 2

The rotational rate of the propeller over time

Figure 3 shows the spectrograms from the outputs of three single-axis gyroscopes. Figure 4 shows the corresponding rotational rate of the propeller over time. By comparing Figs. 1 and 3, it is found that the amplitude of vibration in the gyroscope is lower than that in the accelerometer. This shows that the gyroscope is relatively less susceptible to engine vibration.

Fig. 3
figure 3

The spectrograms of the three single-axis gyroscope outputs in x- (a), y- (b), and z-axes (c). The amplitude is indicated by the bar on the right in units of voltage

Fig. 4
figure 4

The rotational rate of the propeller over time

Influence of vibration on attitude estimation methods

In this section, the accelerometer-based, gyroscope-based, and GPS velocity-based attitude estimations will be applied to the flight test data of the same RC aircraft. The experimental apparatus of the flight test was almost the same as the one for the vibration modeling except that one GPS receiver was installed to provide the GPS velocity for estimating the pseudo-attitude. The update rate of the GPS receiver for this test was 10 Hz, and the sampling rate of the IMU was 40 Hz.

We selected a flight segment with a turn. The flight path and altitude are shown in Fig. 5, and the roll and pitch angles estimated from the gyroscope-based, accelerometer-based, and GPS velocity-based methods are shown in Fig. 6. The aircraft made a left turn during two straight and level flights as shown in Fig. 5. As one would expect, the roll and pitch angles of the aircraft are close to zero in straight and level flights and differ from zero during the turn. From Fig. 6, it is obvious that the attitude estimated from GPS velocity-based method was less affected by the vibration, but it has high noise content especially in the pseudo-roll angle. The gyroscope-based attitude exhibits good capability in tracing the high dynamics of the aircraft, but it suffers from the drift and the accumulating error which was unbounded over time as shown at the end of data. The accelerometer-based attitude was apparently disturbed by the vibration, and it cannot describe any maneuver information of the aircraft. Therefore, in this study, only the gyroscope-based and GPS velocity-based attitudes are selected to be fused to obtain more accurate and reliable attitude under the influence of engine vibration.

Fig. 5
figure 5

The flight path and altitude of the flight test

Fig. 6
figure 6

The roll and pitch angles estimated from different methods under the influence of engine vibration

Fusion of gyroscopes and single antenna GPS with quaternion-based EKF

In the quaternion-based EKF, the angular rates, which are measured by gyroscopes, propagate the quaternion and pseudo-attitudes, which are derived from the velocity with respect to the ground measured by GPS, update the measurements. The quaternion was selected to present the states in the EKF rather than the Euler angles because it is free of singularities.

Quaternion attitude representation

The quaternion and Euler angles are both common representations of the attitude. Although the Euler angles have an intuitive nature and versatility in the representation of the attitude, singularities and nonlinearity of kinematic equations cause problems. When Euler angles are inferred by integrating angular rates, singularities will occur at θ = ±90° and thus limit the use of Euler angles (Setoodeh et al. 2004; Hall et al. 2008).

The quaternion, which represents a rotation about a specific axis, is defined in terms of four parameters in a column vector as follows,

$$ {\mathbf{q}} = [\begin{array}{*{20}c} {q_{0} } & {q_{1} } & {q_{2} } & {q_{3} } \\ \end{array} ]^{T} $$
(10)

One essential constraint of the quaternion in the application is that its norm should be equal to unity, i.e.,

$$ \left\| {\mathbf{q}} \right\| = \sqrt {q_{0}^{2} + q_{1}^{2} + q_{2}^{2} + q_{3}^{2} } = 1 $$
(11)

The Euler angles can be derived as

$$ \tan \phi = {\frac{{2(q_{0} q_{1} + q_{2} q_{3} )}}{{q_{0}^{2} - q_{1}^{2} - q_{2}^{2} + q_{3}^{2} }}} $$
(12)
$$ \sin \theta = 2(q_{0} q_{2} - q_{3} q_{1} ) $$
(13)
$$ \tan \psi = {\frac{{2(q_{0} q_{3} + q_{1} q_{2} )}}{{q_{0}^{2} + q_{1}^{2} - q_{2}^{2} - q_{3}^{2} }}} $$
(14)

The rigid body kinematic equations can be described in terms of the quaternion vector by

$$ \left[ {\begin{array}{*{20}c} {\dot{q}_{0} } \\ {\dot{q}_{1} } \\ {\dot{q}_{2} } \\ {\dot{q}_{3} } \\ \end{array} } \right] = \frac{1}{2}\left[ {\begin{array}{*{20}c} { - q_{1} } & { - q_{2} } & { - q_{3} } \\ {q_{0} } & { - q_{3} } & {q_{2} } \\ {q_{3} } & {q_{0} } & { - q_{1} } \\ { - q_{2} } & {q_{1} } & {q_{0} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} p \\ q \\ r \\ \end{array} } \right] $$
(15)

Details are given in Collinson (1996) and Phillips et al. (2001).

Sensor fusion algorithm

Since the drift of gyroscope results in accumulating error, some compensation for the drift is needed to give reliable estimations in the EKF. In this way, the accumulating error of gyroscope could be made to converge to zero. The state vector is given by

$$ {\mathbf{x}} = \left[ {\begin{array}{*{20}c} {\mathbf{q}} \\ {\mathbf{b}} \\ \end{array} } \right] $$
(16)

where q is the quaternion vector and b is the vector that contains the estimated bias of each gyroscope in the body coordinate frame. The drift of the gyroscope can be modeled as a random walk, so the dynamic equation of b is simply \(\dot{\mathbf{{b}}} = {\mathbf{0}} \) (Kingston and Beard 2004). The nonlinear state transition and observation models in the EKF are represented as f(x, w) and h(x), respectively, and given by

$$ {\mathbf{f}}({\mathbf{x}},{\varvec{\upomega}}) = \frac{1}{2}\left[ {\begin{array}{*{20}c} {\left[ {\begin{array}{*{20}c} { - q_{1} } & { - q_{2} } & { - q_{3} } \\ {q_{0} } & { - q_{3} } & {q_{2} } \\ {q_{3} } & {q_{0} } & { - q_{1} } \\ { - q_{2} } & {q_{1} } & {q_{0} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} p \\ q \\ r \\ \end{array} } \right]} \\ {{\mathbf{0}}_{3 \times 1} } \\ \end{array} } \right] $$
(17)
$$ {\mathbf{h}}({\mathbf{x}}) = \left[ {\begin{array}{*{20}c} {\tan^{ - 1} \left( {{\frac{{2(q_{0} q_{1} + q_{2} q_{3)} }}{{q_{0}^{2} - q_{1}^{2} - q_{2}^{2} + q_{3}^{2} }}}} \right)} \\ {\sin^{ - 1} (2(q_{0} q_{2} - q_{3} q_{1} ))} \\ {\tan^{ - 1} \left( {{\frac{{2(q_{0} q_{3} + q_{1} q_{2)} }}{{q_{0}^{2} + q_{1}^{2} - q_{2}^{2} - q_{3}^{2} }}}} \right)} \\ \end{array} } \right] $$
(18)

In this study, the vector h(x) is also the transformation from the quaternion to Euler angle representation.

The process of the proposed sensor fusion algorithm is shown in Fig. 7. The inputs are the angular rates measured by the gyroscopes and the velocity with respect to ground in NED coordinates acquired from the GPS receiver, and the outputs are the estimated roll angle \( \hat{\phi } \), pitch angle \( \hat{\theta } \), and yaw angle \( \hat{\psi } \), computed from the quaternion estimated in the EKF by using Eqs. 1214.

Fig. 7
figure 7

The process of the proposed sensor fusion algorithm

Simulation and experiment

A second-order complementary filter using the fusion of gyroscopes and pseudo-attitude was applied to examine its capability under the influence of engine vibration and to compare its performance with the quaternion-based EKF in both simulations and flight experiment. The basic idea of the complementary filter is to fuse the attitude derived from the gyroscope outputs through a high-pass filter and the attitude derived from the single antenna GPS through a low-pass filter to obtain the estimated attitude, thus compensating for the drifts on the gyroscopes and for the slow dynamics of the pseudo-attitude. Consequently, the estimated attitudes would have both short-term and long-term accuracy. The detail of this fusion algorithm was given in Tenn et al. (2009). As will be shown later, the simulation and experimental results show that the quaternion-based EKF has better accuracy, reliability, and performance than the complementary filter for the same engine vibration and the same drifts on the gyroscopes.

The SP-80 UAV, a recently developed autonomous UAV by Remotely piloted vehicle and Microsatellite Research Laboratory (RMRL), National Cheng Kung University (NCKU) in Taiwan, was adopted to be the aircraft model for simulations and flight experiment. The SP-80 UAV carries a two-stroke 80-cc gasoline engine, and its wing span is 3.5 m as shown in Fig. 8.

Fig. 8
figure 8

The SP-80 UAV

Simulation setup

The X-plane flight simulator for personal computer was adopted in this study to simulate the flight condition of the SP-80 UAV. The virtual SP-80 UAV was created in the X-plane simulator by using the plug-in architecture that allows users to create their own modules. The aircraft in this simulator is capable of communicating with other applications via user datagram protocol (UDP).

The SP-80 UAV in the simulator was operated autonomously by the control of fuzzy logic controller (FLC) coded in Borland C++ Builder (BCB) through the UDP interface. The useful flight information of the SP-80 UAV in the X-plane simulator was also recorded in BCB through the UDP interface. The recorded flight information included angular rates, flight trajectory, velocity with respect to the ground, true attitude of aircraft, and engine rotational rate.

Three simulations were designed to demonstrate the performance of the sensor fusion algorithms and to examine their capabilities under the influence of the engine vibration and the drifts of the gyroscopes. The vibration model used in the simulations was described in the section “Attitude estimation methods with different sensors”. The amplitude and frequency of the vibration were determined from sensor data of the ground test and the recorded engine rotational rate. For simplicity, the drifts of each gyroscope were set to constant values and determined from the recorded data of the flight experiment.

Experiment setup

Autonomous flight experiments can be performed by using the well-developed autonomous SP-80 UAV to collect the data needed for the attitude estimation methods. The major apparatus in the flight experiment for the attitude estimation methods are an onboard computer (OBC), a GPS receiver, and an attitude and heading reference system (AHRS). The OBC of the SP-80 UAV consists of a single board PC/104, an embedded computer standard computer, and its peripheral hardware. All the data of the flight experiment were recorded in the memory card of the OBC for post-process analyzes. The update rate of the GPS receiver on the SP-80 UAV is 10 Hz. The AHRS of the SP-80 UAV is an off-the-shelf MEMS-based product. The output Euler angles of the AHRS serve as the reference attitude for comparison. The performance of this AHRS is superior, but its volume, weight, and price are not affordable for most small UAVs, especially for the low-cost ones. Therefore, it is not a good option for providing the attitude for normal operations of small UAVs.

Results and discussions

Three simulations and one flight experiment were conducted. The same recorded flight data from the simulator were used for all the simulations. The flight experiment was conducted to validate the performance of the proposed fusion algorithm in real flight.

Simulation results

The purpose of the first simulation was to examine the performances of the attitude estimation methods and the sensor fusion algorithms by assuming that noises from the engine vibration and from the drifts are negligible. In order to investigate the influence of engine vibration, the engine vibration was the only error source of the gyroscopes in the second simulation, and the drifts of the gyroscopes are negligible. The drifts of the gyroscopes are the only noise in the third simulation. Therefore, it will be convenient to compare the effects of these two error sources in the attitude estimation methods and the fusion algorithms. The recorded flight data of the SP-80 UAV from the simulator were an autonomous flight. One turn of this flight was extracted to perform these simulations. The flight path and altitude of this turn are shown in Fig. 9.

Fig. 9
figure 9

The flight path and altitude of the simulations

Figure 10 shows the Euler angles derived from different attitude estimation methods for the first simulation. Data denoted as “Reference”, “Gyroscope”, “Pseudo-attitude”, and “EKF” are, respectively, the Euler angles associated with the AHRS reference output, gyroscope-based attitude, pseudo-attitude, and the proposed sensor fusion algorithm with quaternion-based EKF. From Fig. 10, one can observe that these methods perform well both in short-term and long-term accuracy. It also shows that there is a steady error between the pseudo-pitch angle and the reference pitch angle, which is the angle of attack of the aircraft as mentioned previously, but this error is small for the navigation and control of an aircraft. In Fig. 11, the data denoted as “Complementary” are the Euler angles estimated from the complementary filter. In this figure, one can observe that the performances of the quaternion-based EKF and the complementary filter are almost identical. Both of them extract the advantages of the gyroscopes in high dynamics and the single antenna GPS in slow dynamics.

Fig. 10
figure 10

The attitudes estimated from different methods in the first simulation

Fig. 11
figure 11

The comparison between the quaternion-based EKF and the complementary filter in the first simulation

In the second simulation, the simulated data contained the vibration signal generated from the proposed vibration model. Figure 12 shows that the gyroscope-based attitude was contaminated by the engine vibration, so that the accumulating errors become obvious. In Fig. 13, the complementary filter was disturbed by the accumulating errors due to engine vibration, especially in estimation of the pitch angle. It is obvious that when the measurements of the gyroscope drift, the complementary filter will produce large error.

Fig. 12
figure 12

The attitudes estimated from different methods under the influence of the engine vibration in the second simulation

Fig. 13
figure 13

The comparison between the quaternion-based EKF and the complementary filter under the influence of the engine vibration in the second simulation

The last simulation demonstrates the effect of the constant drifts of the gyroscopes on the attitude estimation methods. Figure 14 shows that the accumulating error grows when time elapses, and the trend of this error is unbounded. Even so, the proposed method can perform well and give high long-term and short-term accuracy. However, the estimated roll and pitch angles from the complementary filter, which are shown in Fig. 15, were severely contaminated with by drifts of gyroscopes. From Figs. 12 and 14, it is clear that the noise from the engine vibration and from the drifts of the gyroscopes yields errors in the attitude as has been estimated from the gyroscope-based method and the complementary filter. Moreover, the errors caused by the drifts are larger than those from the vibration. Therefore, estimating the drifts of the gyroscopes is necessary, and this is also the reason why the drift states are included in the proposed method.

Fig. 14
figure 14

The attitudes estimated from different methods under the influence of the drifts in the third simulation

Fig. 15
figure 15

The comparison between the quaternion-based EKF and the complementary filter under the influence of the drifts in the third simulation

It is concluded from these simulations that the feasibility and capability of the proposed sensor fusion algorithm are validated; it performs better than other methods under the influence of the engine vibration and the drifts of the gyroscopes and its accuracy and reliability are better than those of the complementary filter. The simulation results demonstrate the abilities of the proposed algorithm to extract the short-term accuracy of the gyroscope and the long-term accuracy of the GPS and to eliminate their drawbacks. The results also show that the errors caused by the drifts of the gyroscopes are larger than those due to engine vibration and estimating of these drifts is necessary.

Experiment results

The flight experiment was implemented during the autonomous flight of the SP-80 UAV under the influence of engine vibration and drifts of gyroscopes. One turn of this flight was extracted to implement the attitude estimation methods. The flight path and altitude of this turn are shown in Fig. 16.

Fig. 16
figure 16

The flight path and altitude of the flight experiment

Figures 17 and 18 show the attitudes derived from different attitude estimation methods and the comparison between the proposed sensor fusion algorithm and the complementary filter. In Fig. 17, the accumulating errors of gyroscopes are unbounded over time due to the influence of the vibration and the drifts of the gyroscopes in actual flight. These errors significantly affect the performance of the complementary filter as seen in Fig. 18. It demonstrates that the complementary filter cannot accurately estimate the attitude of the aircraft, but the proposed sensor fusion algorithm can estimate the attitude with an acceptable error, when compared to the reference attitude. This error was induced in the pseudo-attitude when the assumptions of coordinated flight and uniform wind condition did not hold true in actual flight. Moreover, it also shows that the pseudo-roll angle contains large disturbances which were induced when the aircraft executed maneuvers, especially turning, and which could violate the assumption of coordinated flight and lower the signal-to-noise ratio of the received GPS signals.

Fig. 17
figure 17

The attitudes estimated from different methods in the flight experiment

Fig. 18
figure 18

The comparison between the quaternion-based EKF and the complementary filter in the flight experiment

The results of this flight experiment are consistent with the simulated ones. The proposed sensor fusion algorithm performs well even under disturbed pseudo-attitude condition, and it has a better performance than the second-order complementary filter for the same disturbance. Moreover, it has been demonstrated that the proposed algorithm suffices to provide accurate and reliable attitude for navigation and control of small UAVs.

Conclusions

An attitude estimation algorithm for small unmanned aerial vehicles under the influence of engine vibration and gyroscope drift has been presented. For the accelerometer-based attitude estimation methods, the accelerometer is very sensitive to not only the vibration induced by the engine but also the external acceleration induced by high dynamic maneuver of the aircraft. Therefore, the accelerometer is not a good option for the attitude estimation and sensor fusion algorithms of a small UAV powered by a piston engine. In order to mitigate the influence of the vibration and the gyroscope drifts, an attitude estimation using the fusion of gyroscopes and single antenna GPS with the quaternion-based EKF has been proposed.

The simulations have been conducted with the virtual SP-80 UAV in a flight simulator to validate the feasibility of the proposed sensor fusion algorithm and its capability under the influence of engine vibration and gyroscope drift. The vibration model has been derived based on spectrum analysis with the short-time Fourier transform to observe the temporal information in the frequency domain. The simulations show that the error caused by the drift is larger than the one from engine vibration and estimating of the drift is necessary. The proposed attitude estimation method has been successfully implemented in an actual flight of the SP-80 UAV. The results of the simulations and the flight experiment demonstrate the ability of the proposed algorithm to extract the short-term accuracy of the gyroscope and the long-term accuracy of the GPS and to eliminate their drawbacks. The proposed sensor fusion algorithm also shows the capability to mitigate the noise from the engine vibration and the drift on the gyroscopes, and it has better accuracy, reliability, and performance than the second-order complementary filter and other attitude estimation methods discussed in this study for the same error sources. The proposed algorithm provides an alternative attitude estimation method for aircrafts with weight, space, and computing power constraints.