Chapter 3

Inertial Sensors Data Fusion for Orientation Estimation*

Abstract

Stabilizing a hovering aerial vehicle is the most important task when working with such vehicles. Precise measurement of its orientation and rate is an easy task when using a commercial IMU (Inertial Measurement Unit). Nevertheless, these commercial sensors are generally expensive. Using low-cost inertial sensors, as accelerometers and gyrometers, becomes popular for aerial prototypes. The main problem with these sensors is that they do not include good estimation algorithms and classical techniques are used with great simplicity yielding worse estimation results. In this chapter, different observers are proposed and validated to estimate the attitude of a quadcopter. The main idea is to include the sensor characterization to take into account bias estimation and correct the estimated states. The algorithms are validated in simulation and also in real time. The obtained results are compared with those for a commercial and popular IMU. The KF (Kalman Filter) appears as the most suitable method for UAV purposes.

Keywords

Inertial sensors; Data fusion; Observers; Kalman filter; Orientation estimation

The problem of attitude estimation consists in recovering the true attitude using the signals provided by the gyroscopes and accelerometers. The gyroscopes measure the angular velocity of the body, and thus they can be integrated to obtain the attitude. This approach quickly produces a drift due to the errors introduced by the integration of bias and noise, as will be discussed below [1]. The accelerometers sense the orientation of the gravity acceleration, from which the attitude can be obtained directly. However, the accelerometer signal is highly corrupted by noise due to vibrations, and this approach yields an estimate too noisy to be used in practice. A simple approach that is widely used and provides good results is complementary filtering where the accelerometers are low-pass filtered and the gyroscopes are high-pass filtered [2].

This chapter aims at providing a comparative evaluation of attitude estimation algorithms using low-cost sensors (gyroscopes and accelerometers). Several aspects must be taken into account while choosing the most suitable approach for a given application: singularity existence, convergence guarantee, computational time, bias estimation, etc. The comparison is focused on Kalman filtering methods as they provide a suitable framework for an easy integration in higher level localization techniques based on laser range finders, cameras, or GPS [3]. The results show that it is possible to obtain a performance with a hobbyist-grade IMU similar to that of an industrial-grade IMU. The chapter is ended by explaining in detail the simplified Kalman filtering algorithm, and it is shown that such a proposal is very easy-to-code, computationally efficient, and yet has good performance.

3.1 Attitude Representation

Let us denote by {eˆ1,eˆ2,eˆ3}Image the unit basis vectors of the Earth-centered Earth-fixed (ECEF) reference frame, EImage, which is assumed to be inertial. Let ΩB/EB=[ωx,ωy,ωz]TImage, denoted simply by Ω in what follows, be the angular velocity of the aircraft with respect to EImage expressed in the body frame BImage. Thus the rotational kinematics relating these angular velocities to the Euler angles are expressed as

η˙(t)=[1sinϕtanθcosϕtanθ0cosϕsinϕ0sinϕcosθcosϕcosθ]Ω(t).

Image (3.1)

It is a well-known result that the rate of change of the basis vectors is given by

deˆidt=ΩE/B×eˆi=Ω×eˆi=[Ω]×Teˆi,

Image (3.2)

where the skew-symmetric operator is defined as

[Ω]×=[0ωzωyωz0ωxωyωx0].

Image (3.3)

According to the roll–pitch–yaw sequence of Euler angles, the rotation matrix is expressed as

REB=[cθcψcθsψsθsϕsθcψcϕsψsϕsθsψ+cϕcψsϕcθcϕsθcψ+sϕsψcϕsθsψcϕcψcϕcθ],

Image (3.4)

where REBImage maps vectors from EImage onto BImage. Noticing that REB=[eˆ1eˆ2eˆ3]Image and the time derivative of this rotation matrix can be derived by generalizing (3.2), it follows that the kinematics in terms of the rotation matrix, also referred to as the Direct Cosine Matrix (DCM), is given by

R˙EB(t)=[Ω]×TREB(t).

Image (3.5)

Rotations are also represented using quaternions, which are an extension to the complex numbers. Quaternions are mainly used because they provide a singularity-free representation, and also because quaternion algebra is computationally efficient, see Sect. 2.4 of Chap. 2. The unitary quaternion could be also represented by q=[q¯q0]TImage where q¯Image defines the scalar part of the quaternion and q0=[q1q2q3]TImage represents the vector part. From (2.30) the rigid body angular motion can be written using quaternion notation as

dq(t)dt=Ω˘q(t),

Image (3.6)

where

Ω˘=12[[Ω]×ΩΩT0].

Image (3.7)

The rotation matrix (3.4) expressed in terms of the quaternion components is defined as follows:

REB=[q12q22q32+q422(q1q2q3q4)2(q1q3+q2q4)2(q1q2+q3q4)q12+q22q32+q422(q2q3q1q4)2(q1q3q2q4)2(q2q3q1q4)q12q22+q32+q42].

Image (3.8)

3.2 Sensor Characterization

The output of an MEMS (Micro-Electro-Mechanical System) sensor is corrupted by noise and an offset, and is usually referred to as bias [4]. The bias can be calibrated prior to each flight. However, it is dependent on temperature, causing the bias to drift. This effect is especially noticeable within the first few minutes of operation because of the internal warm-up of the electronic components [5].

For the attitude estimation problem, the biases of the gyroscopes are much more crucial than of the other components because they are time-forward integrated, originating an error that grows linearly with time. Even when considering an ideal scenario without bias, integration of the gyro output corrupted by white noise would give rise to an error growing with the square root of time. As a consequence, a method is needed to correct the errors introduced by the integration of bias and white noise. Regarding the biases of the accelerometers, they are not so important because after calibration they will result only in a small offset with respect to the actual horizontal plane (perpendicular to the gravity vector).

Let us consider the following error models for the sensors:

Ω¯=Ω˜+βΩ+λΩ,a¯=a˜+λa,

Image (3.9)

where the velocity measurement Ω¯Image is composed of its actual value Ω˜Image, bias βΩImage, and noise λΩImage. The same applies to the acceleration measurements but the biases are not included. As mentioned above, these errors are not so critical as they are not integrated over time. The measurement noises are considered subject to a Gaussian representation as follows:

E[λΩ]=0,E[λΩλΩT]=σΩ2I3,E[λa]=0,E[λaλaT]=σa2I3,

Image

where σi2Image defines the variance, I3Image represents the 3×3Image identity matrix, and ΣiImage denotes the diagonal covariance matrix. A random walk process,

β˙Ω=λβ,E[λβ]=0,E[λβλβT]=Σβ=σβ2I3,

Image (3.10)

is used to model the “slowly-varying” biases of the gyros. The variance σβ2Image determines how much the bias drifts.

Now, it is necessary to know how the measurements are related to the variables to be estimated. The relation of the gyroscope measurements with the different representations of the kinematic model of the vehicle have been already presented in (3.1)(3.8). Regarding the accelerometers, they measure the specific force acting on the vehicle expressed in BImage, as they are aligned with the body-fixed reference frame. The measurement can be expressed as

a˜B=1m(fBREB(mg)eˆ3)=v˙BREB(geˆ3),

Image (3.11)

where v˙BImage is the acceleration vector due to the external forces vector fBImage, both of them are expressed in BImage. In case the vehicle is not expected to perform aggressive maneuvers, the linear acceleration (v˙B0Image) can be neglected. If the vector of acceleration measurements is normalized, it can be simply related to the roll and pitch angles as

a˜=a˜B|a˜B|REBeˆ3=[sinθsinϕcosθcosϕcosθ].

Image (3.12)

3.3 Attitude Estimation Algorithms

Several attitude estimation algorithms are compared and presented in the following. The Kalman Filter (KF) approach is used in all of them, regardless of the formulation of the system. If the resulting system is nonlinear then the Extended Kalman Filter (EKF) is applied. Recall that the Kalman Filter is derived under the assumption of Gaussian errors for both the system and the measurement models. Therefore, it is necessary to include the biases in the vector of estimated variables, as they are not removed in the filtering process. The equations of the discrete EKF for a general nonlinear system1

x˙(t)=f(x,u)+λξ,E[λξλξT]=Q,y(t)=h(x)+λv,E[λvλvT]=R

Image

can be found in [6] and are summarized as

xˆk=xˆk1+Tsf(xk,uk),Pk=Ak1Pk1Ak1T+Qk,

Image (3.13)

Sk=HkPkHkT+Rk,Kk=PkHkTSk1,xˆk+=xˆk+Kk(ykh(xˆk))Pk+=(IKkHk)Pk,

Image (3.14)

where

Ak=eATsI+Tsfx|xˆandHk=hx|xˆ.

Image

The KF equations are simply obtained by applying (3.13)(3.14) to a linear system.

All of the algorithms presented in the next section, except for the first one, lead to nonlinear formulations. Some of them are referred to as DCM-based because the elements of the DCM are manipulated directly. Also, formulations using both Euler angles and quaternions are explored.

3.3.1 DCM1-Based

Algorithms based on the DCM directly update the components of the matrix, avoiding the representation by means of Euler angles. The time variation of the elements of the DCM is given by (3.5). Although the whole matrix could be updated, the last column (denoted by r3Image) suffices when providing information about ϕ and θ, as can be seen in (3.4). Using the common notation in control theory, the state vector is denoted by x=r3Image, and the system is described by

x˙=[Ω¯]×x+λξ,E[λξλξT]=Q=qrI,y=I3x+λv,E[λvλvT]=R=σa2I3.

Image (3.15)

Assuming that σa2Image can be identified by analyzing the static output of the accelerometers, there is only one tuning parameter, qrImage, which determines the relative importance of the state propagation with respect to the information recovered from the accelerometers. Notice that this methodology results in a very simple filter, but it would imply the need of zero-velocity updates in practice as the bias of the gyroscopes is not explicitly estimated. For more details about this formulation see [7].

3.3.2 DCM2-Based

The previous filter can be modified to include the bias estimation [8]. According to the measurement model in (3.9), the bias-free angular velocity is given by Ω˜=Ω¯βΩImage. Denoting by x=[r3T,βΩT]TImage the state vector, the resulting system can be expressed as

x˙=A(x)x+λξ,E[λξλξT]=Q,y=Cx+λv,E[λvλvT]=R,

Image

where

A(x)=[[Ω¯βΩ]×000],C=[I30],Q=[qrI300qβI3],R=σa2I3.

Image

Notice that there is an extra parameter, qβImage, accounting for the bias noise. It has a physical meaning as it describes the random walk model for the bias. Although used as a tuning parameter, it has to be small enough to allow only slow variations of the bias, which is known to happen in reality.

3.3.3 New DCM3-Based

In order to improve the angular velocity estimation, the above algorithm can be extended by including the angular velocity in the state vector, x=[r3T,βΩT,ΩT]TImage. The process model for the angular velocities is assumed to be constant, so they are only modified in the updating phase of the Kalman filter. In practice, this will work as a low-pass filter, controlled by the parameter qΩImage. In this case, the matrices describing the system are

A(x)=[00[r3]×000000],C=[I3000I3I3],Q=[qrI3000qβI3000qΩI3],R=[σa2I300σΩ2I3].

Image

3.3.4 Euler EKF

In this algorithm six variables are estimated: three Euler angles and three biases of the gyroscopes. The state vector can be written as x=[ηTβT]TImage. The nonlinear equations are described in a state-space form as

x˙=f(x)+λξ,E[λξλξT]=q,y=h(x)+λv,E[λvλvT]=R,

Image

where

Q=[qηI300qβI3],R=σa2I3.

Image

The process equation is derived from (3.1) by directly incorporating the measurements from the gyroscopes as follows:

f(x)=[(ω¯xβωx)+(ω¯yβωy)sinϕ+(ω¯zβωz)tanθ(ω¯yβωy)cosϕ(ω¯zβωz)sinϕ(ω¯yβωy)sinϕcosθ+(ω¯zβωz)cosϕcosθ000],

Image (3.16)

while the measurement model is given by (3.12), i.e.,

h(x)=[sinθsinϕcosθcosϕcosθ].

Image (3.17)

In this case the parameter qηImage determines how reliable the state propagation (based on gyroscopes measurements) is with respect to the observations made by the accelerometers.

3.3.5 Quaternions

Four quaternions and two biases of the gyroscope variables are estimated in this algorithm. The state vector can be written as x=[qT,βT]TImage. The nonlinear equations are described as

x˙=A(x)x+λξ,E[λξλξT]=Q,y=h(x)+λv,E[λvλvT]=R,

Image (3.18)

where

A(x)=[Ω˘000],C=[I30],Q=[qqI400qβI3],R=σa2I3.

Image

The measurement model is given by the third column of (3.8), namely,

h(x)=[2(q1q3+q2q4)2(q2q3q1q4)q12q22+q32+q42].

Image (3.19)

3.3.6 Comparative Real-Time Analysis in the Quanser Platform

The algorithms presented in the previous section have different levels of complexity, make use of different orientation representations, and even estimate different variables. A comparison was carried out in order to see if the different formulations have a significant impact on the estimation accuracy.

3.3.6.1 Experimental Platform and Devices

The experimental platform used for the comparative analysis is shown in Fig. 3.1. It is the 3D HOVER platform manufactured by Quanser and thought of as a test-bed platform of control algorithms for vertical take-off and landing (VTOL) vehicles, so that the translational degrees of freedom are clamped for convenience [9]. The Euler angles are measured by means of three optical encoders with an accuracy of 0.04 degrees, which can be sampled with a frequency up to 1000 Hz. These encoders provide a reliable pattern for the evaluation and comparison of the algorithms.

Image
Figure 3.1 Experimental platform and devices.

For the sake of comparison, two Inertial Measurement Units (IMU) have been used, the MicroStrain 3DM-GX2 and the Sparkfun Sensor Stick. The 3DM-GX2 has typical inertial sensor sets which are internally processed [10]. The angle estimations can be delivered in either Euler angles or rotational matrix at up to 250 Hz. The Sensor Stick is a hobbyist-level unit which consists of only a plain circuit board that gathers inertial sensors connected to a unique bus [11]. Some of the relevant information about these devices is shown in Table 3.1.

Table 3.1

IMUs specifications

Microstrain 3DM-GX2 Sensor stick MPU-6050
Size 41 × 63 × 32 35 × 10 × 2 21 × 17 × 2
Weight 50 g 1.2 g 6 g
Gyro range ±75 to ±1200 degree/s ±2000 degree/s ±250 to ±2000 degree/s
Gyro bias ±0.2 degree/s Not defined ±20 degree/s
Gyro nonlinearity 0.2% 0.2% 0.2%
Gyro noise performance 0.17 degree/s (rms)a 0.38 degree/s (rms) 0.025 degree/s (rms)
Acc. bias ±5 mg (for ±5 g) Not defined ±50 mg
Acc. nonlinearity 0.2% 0.5% 0.5%
Acc. noise performance 0.6 mg (rms)a 2.9 mg (rms) 1.3 mg (rms)

Image

 a Measured from static output of the sensor.

3.3.6.2 Results

In order to evaluate the performance of the different algorithms, the platform described in Sect. 3.3.6.1 was used to follow alternating step references. These references were tracked using a PD controller. The angular estimates of the encoders and the 3DM-GX2 were stored, along with the information of gyroscopes and accelerometers of the Sensor Stick. The whole sampling procedure was implemented in a single real-time C++ code running at 100 Hz. This frequency was selected since it allows for a reasonable time to run the algorithms in a low-cost microcontroller. The estimation algorithms are executed offline using Matlab and the sampled data.

One of the experiments comparing the attitude measured by the encoders with that of the 3DM-GX2 and the one computed with the Euler EKF algorithm during an experiment with ±2 degree step references is presented in Fig. 3.2. At first sight the angular estimate obtained with the Sensor Stick is fast and noise-free, very similar to the estimate given by the 3DM-GX2.

Image
Figure 3.2 Comparison of the angle measured by the encoders with the one given by the 3DM-GX2 and the estimation of the Euler EKF algorithm during an experiment tracking a ±2 degree input command.

Since it is very difficult to reach any conclusion from the naked eye observations, a set of five experiments like the one in Fig. 3.2 were carried out for different step amplitudes. The root mean square value (rmse) was chosen as a performance index, taking the encoder measurement as the ideal one. This index was averaged over the whole set of experiments for each step amplitude and for every algorithm. For each algorithm an optimization by trial and error was carried out to find the tuning of the parameters leading to the best performance.

The results of these experiments are depicted in Fig. 3.3 where the mean value of the rmse is represented along with its standard deviation. As can be seen, the accuracy of the estimation gets worse as the amplitude of the steps increases. All the algorithms perform very well for low angle oscillations.

Image
Figure 3.3 Root mean square errors and standard deviations.

However, for higher angles the 3DM-GX2 performs slightly better. This is sensible given that higher outputs of the sensors will manifest their imperfections, e.g., scale factor inaccuracy, nonlinearity, or cross-axis sensitivity. In any case, performance is very similar, and the comparison points out that a cheap board like the Sensor Stick and a simple linear KF provides sufficient accuracy for small angles.

Fig. 3.4 shows a situation in which the algorithms did not perform so well. It is possible to observe that one of the main sources of error is the deviation in a stationary position, far from the horizontal. One of the reasons for that is due to small nonlinearities of the accelerometers as they are calibrated using a linear model. There is also another effect, which is not so obvious. The estimation is slightly worse in one of the axes when there is velocity in the other. This is a consequence of the cross-sensitivity of the gyroscopes.

Image
Figure 3.4 Comparison of the angles estimation for ±8 degrees.

Among the evaluated algorithms, the DMC3-based is the only one which includes the angular velocities as estimated variables. Fig. 3.5 shows an example of how the estimation looks like, compared to the angular velocity extracted from the 3DM-GX2. The estimation exhibits less noise, and no delay is appreciated.

Image
Figure 3.5 Comparison of the angular velocities estimation for ±4 degrees.

3.4 A Computationally-Efficient Kalman Filter

Some of the aforementioned algorithms may need a large amount of computational resources. Computationally efficient algorithms are crucial because of two reasons. First of all, the computational resources onboard are limited, especially in small aerial vehicles. Second, the fast rotational dynamics of these vehicles requires high frequency controllers, and thus the measurements should be updated as fast as possible.

After several tests, we have arrived at a computationally efficient algorithm to estimate the attitude of a rotorcraft. The algorithm uses a Kalman filter applied to the kinematics of the vehicle represented by means of the Euler formulation and includes the biases of the gyroscopes into the vector of estimated variables. It was validated in flight tests, and the experimental results were compared with the data coming from a commercial IMU showing good behavior of the estimation algorithm which is presented next; for more details see [12].

3.4.1 Simplified Algorithm

An advantage of the Euler formulation is that the yaw angle can be removed from the equations if the rotation matrix is well defined. Let us denote the vector of variables to be estimated by x=[ϕ,βx,θ,βy]Image. It is reasonable to simplify the equations by assuming non-aggressive maneuvers, sinααImage and cosα1Image, with α={ϕ,θ}Image. From previous considerations, the kinematics of an aerial vehicle and the measurement model can be expressed by (3.1) and (3.12), respectively, which leads to the following linear equations:

x˙=[0100000000010000]Ax+[10000100]Bu+λw,yˆ=[00101000]Hx+λv,

Image (3.20)

where the input vector consists of the angular velocity measurements u=[ω¯x,ω¯y]Image, and y=[a¯x,a¯y]Image contains the acceleration measurements. The third equation of the measurement model which involves the third accelerometer axis has been removed, as it has very low sensitivity with respect to the roll–pitch orientation for small angles.

These simplifications result in a smaller-size linear system, thus reducing the computational load substantially. Furthermore, it will be shown next how the structure of the matrices can also be exploited to reduce the Kalman filter to a set of simple equations. The continuous-time system (3.20) can be discretized with sample time TsImage, assuming zero-order hold of the input, as follows:

xˆk+1=Akxˆk+Bkuk+λwk,E[λwkλwkT]=qk,yk=Hkxˆk+λvk,E[λvkλvkT]=Rk,

Image (3.21)

where

Ak=eATs=[1Ts000100001Ts0001],Bk=(0TseAsds)B=[Ts0000Ts00],Hk=[00101000].

Image

Notice that, as a consequence of the simplifications, the resulting system is decoupled. Therefore, two different Kalman filters could be separately implemented for roll and pitch dynamics. Furthermore, one can take advantage of the fact that matrix P is symmetric, so that only three of its entries need to be stored in the memory. Using (3.13) and (3.14), the following equations for the Kalman filter of the roll angle can be derived:

ϕˆk=ϕˆk1+Ts(ω¯xβxk),βxk=βxk1,p11k=p11k12Tsp12k1+Ts2p22k1+q11k,

Image (3.22)

p12k=p12k1Tsp22k1,p22k=p22k1+q22k,ϕˆk+=(1αϕ)ϕˆkαϕa¯yβxk+=βxkγϕ(a¯y+ϕˆk),p11k+=(1αϕ)p11k,p12k+=(1αϕ)p12k,p22k+=γϕp12k+p22k,

Image (3.23)

where

αϕ=p11k+p11k++r11,γϕ=p12k+p11k++r11k.

Image

In a similar way, the derivation of the Kalman filter equations for the pitch angle leads to the following set of equations:

θˆk=θˆk1+Ts(ω¯xβxk),βyk=βyk1,p11k=p11k12Tsp12k1+Ts2p22k1+q33k,

Image (3.24)

p12k=p12k1Tsp22k1,p22k=p22k1+q44k,θˆk+=(1αϕ)θˆk+αϕa¯y,βyk+=βyk+γϕ(a¯xθˆk),p11k+=(1αθ)p11k,p12k+=(1αθ)p12k,p22k+=γθp12k+p22k,

Image (3.25)

where

αθ=p11k+p11k++r22k,γθ=p12k+p11k++r22k.

Image

3.4.2 Numerical Validation

The Kalman filter algorithm for estimating the roll and pitch angle (Eqs. (3.22)(3.25)) has been first validated using the encoders of the Quanser platform. A commercial IMU (3DM-GX2) and a low cost inertial sensor (MPU6050) were also included in the platform in order to validate and compare the measurements. The MPU6050 is composed of a 3-axis gyroscope and a 3-axis accelerometer. It does not provide the angles of the rigid body, only the raw measurements of the sensors. The characteristics of the both devices are given in Table 3.1.

Since the angles of the experimental platform are unstable, a simple PD controller was used to stabilize the system to constant references of pitch and roll. The system was then perturbed by applying manual disturbances. All data was collected at 333 Hz, and the algorithm equations (3.22)(3.25) were computed offline using Matlab. A trial and error tuning process resulted in the following covariance matrices:

Qk=[0.9410600000.911060000000000],Rk=[0.37000.39].

Image

The estimation obtained by means of this procedure can be seen in Fig. 3.6. At first sight, it can be noticed that the proposed algorithm performs fairly well, thus validating the simplifications made in its derivation.

Image
Figure 3.6 Attitude estimation.

As it is difficult to visually evaluate the quality of both estimations, three performance indexes were chosen, namely, the root mean squared error, the maximum absolute error, and the delay, all of them computed with respect to the estimate given by the encoders (which are assumed to provide a “real” measurement). Table 3.2 gathers the information of these indices for an experiment of several minutes where the system was again stabilized around zero and perturbed manually. Notice that the proposed algorithm performs even better than the 3DM-GX2.

Table 3.2

Performance indices

rmse (degrees) |error|maxImage (degrees) Delay (ms)
3DM-GX2 Roll 0.3 1.56 25
Pitch 0.27 1.46
MPU 6050 Roll 0.14 0.72 15
Pitch 0.19 0.91

Image

The evolution of the bias estimate is shown in Fig. 3.7. The real bias of the gyroscopes was computed by averaging the first few seconds during which the system remains steady. It is possible to see how the estimated bias converges to the real value within a few seconds.

Image
Figure 3.7 Bias estimation.

3.4.3 Flight Tests

Although the platform described above is a suitable scenario for numerical comparison, there are still some handicaps to overcome in real flight, like vibrations and linear accelerations. The estimation algorithm is finally tested online and onboard to compute the roll and pitch angles and to stabilize a quadrotor prototype.

3.4.3.1 UPV Quadrotor Prototype

The quadrotor prototype developed at the UPV (Universidad Politécnica de Valencia, Spain) is depicted in Fig. 3.8. It has a distance of 41 cm between rotors, weighs around 1.3 kg without battery, and is outfitted with the IMU MicroStrain 3DM-GX2 and MPU6050, among other sensors. The basic hardware consists of a MikroKopter frame, YGE 25i electronic speed controllers, RobbeRoxxy 2827-35 brushless motors, and 10×4.5Image plastic propellers. All the computations are made onboard using an Arduino Due which is based on an Atmel SAM3X8E ARM Cortex-M3 microcontroller running at 84 MHz, and an Igep v2 board running Xenomai real-time operating system at 1 GHz.

Image
Figure 3.8 UPV quadrotor prototype.

The Arduino Due is in charge of reading every sensor, computing the Kalman filter and attitude control algorithms, controlling the motor's speed, and sending the data to the Igep board. The control algorithm consists of a PD controller with nested saturations. The Igep board is only used for data storage and also serves as a WiFi bridge. Although the proposed Kalman filter takes only 2 ms to run, the main loop in the microcontroller runs at 333 Hz restricted by the communications with the 3DM-GX2 and Igep board.

3.4.3.2 Experiments

The quadrotor was controlled by adjusting roll and pitch angles using PD controllers computed with the estimated values ϕˆ,θˆ,ϕˆ˙Image, and θˆ˙Image. Furthermore, angular references were sent to the vehicle using a joystick. The yaw angle was stabilized separately with the measurement of the Microstrain sensor, also with a PD controller.

Due to the lack of a motion capture system, the in-flight attitude estimate of the proposed algorithm is compared to that of the 3DM-GX2. Fig. 3.9 shows the attitude estimate during one minute of flight. One can see that both estimates are very similar (an rmse of 2.7 degrees and 1.6 degrees in pitch and roll axes, respectively). Although the 3DM-GX2 is not a fully reliable pattern, it can be seen that the proposed algorithm provides a fast, noise-free, and drift-free estimate. Furthermore, it should be also noticed that the control is computed with the estimated attitude. The small oscillations around the equilibrium point evidence that the attitude and velocity estimates lead to a very good control performance.

Image
Figure 3.9 Comparison of the attitude estimations in-flight.

The angular velocities are shown in Fig. 3.10. The estimated angular velocities consist of the raw gyroscope measurements corrected with the estimated biases. The estimation of the bias avoids the need of correcting the offset of the gyroscopes prior to each flight and allows operating over long time periods. This comparison shows that, in spite of the simplifications, the accuracy of the estimates is fairly good compared to that of a commercial device, at least for non-aggressive flights. Because of the low computational cost of the algorithm, the angular estimates exhibit a very small delay, which also improves control performance.

Image
Figure 3.10 Comparison of the angular velocity estimations in-flight.

3.5 Discussion

Attitude estimation is a serious problem for many research teams working in UAVs. The best solution for some teams is to buy classical IMUs such as MicroStrain; nevertheless, their price (around 2000 USD) demotivates small research groups (also particular researchers). Low-priced arrays of MEMS (accelerometers and gyrometers) can be found on the market; nevertheless, in some cases an estimation algorithm needs to be used. In this chapter the most common estimation algorithms were described and analyzed. When evaluating performance, it is important to take into account the computational load of the algorithms and the available resources onboard, as the controllers must run at very high frequencies. In our results, Kalman filter exhibited a performance that could be compared with a commercial IMU, the Microstrain 3DM-GX2. The performance of these algorithms can be further improved by using other control techniques; for example, in the next chapter, we propose a predictor scheme to restore all the states and improve the precision of the estimation algorithm.

References

[1] K. Nonami, F. Kendoul, S. Suzuki, W. Wang, D. Nakazawa, Autonomous Flying Robots: Unmanned Aerial Vehicles and Micro Aerial Vehicles. Springer; 2010.

[2] A. Tayebi, S. McGilvray, Attitude stabilization of a VTOL quadrotor aircraft, IEEE Transactions on Control Systems Technology 2006;14:562–571.

[3] S. Bouabdallah, R. Siegwart, Full control of a quadrotor, In: International Conference on Intelligent Robots and Systems, IROS, IEEE/RSJ. San Diego, CA, USA. 2007:153–158.

[4] J. Thienel, R.M. Sanner, A coupled nonlinear spacecraft attitude controller and observer with an unknown constant gyro bias and gyro noise, IEEE Transactions on Automatic Control 2003;48:2011–2015.

[5] S. Bonnet, C. Bassompierre, C. Godin, S. Lesecq, A. Barraud, Calibration methods for inertial and magnetic sensors, Sensors and Actuators A, Physical 2009;156:302–311.

[6] J.L. Crassidis, J.L. Junkins, Optimal Estimation of Dynamic Systems, In: CRC Press; 2011;vol. 24.

[7] H. Rehbinder, X. Hu, Drift-free attitude estimation for accelerated rigid bodies, Automatica 2004;40:653–659.

[8] C. Liu, Z. Zhou, X. Fu, Attitude determination for MAVs using a Kalman filter, Tsinghua Science and Technology 2008;13:593–597.

[9] http://www.quanser.com/products/3dof_hover.

[10] http://www.microstrain.com/inertial/3dm-gx2.

[11] https://www.sparkfun.com/products/10724.

[12] R. Sanz, L. Rodenas, P. Garcia, P. Castillo, Improving attitude estimation using inertial sensors for quadrotor control systems, In: International Conference on Unmanned Aircraft Systems, ICUAS. Orlando, FL, USA. 2014.


*  “The results in this chapter were developed in collaboration with R. Sanz Diaz and P. Albertos from the Universidad Politécnica de Valencia, Spain.”

1  “In Chap. 5 the EKF is also used, and the equations are also described given more details.”

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset