8
Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl´ avio de Almeida Justino [email protected] Instituto Superior T´ ecnico, Universidade de Lisboa, Lisboa, Portugal May 2016 Abstract The main objective of this work is the comparative experimental evaluation of different methods of attitude estimation in order to test and evaluate the performance of one of these methods, the Trace- Based Filter. To that effect, an implementation of this solution is made in two autopilots: Paparazzi and Pixhawk. First, the concept of a quadcopter is introduced. Two quadcopter platforms used for the purposes of this work are presented: QuaVIST and QuadR-ANT. Then, the two mentioned autopilots are introduced in order to make the process of implementation clear and objective. Finally, the results of the implementation in each autopilot are presented and discussed. For the case of Paparazzi, a comparison is made between the implementation of the proposed estimator and one of the autopilot solutions, the complementary filter. The Trace-Based Filter is also implemented in Matlab based on data provided offline by QuaVIST sensors. Posteriorly, an evaluation of the proposed estimator on Pixhawk is made based on data obtained in real-time flight with QuadR-ANT. As a reference for the validation of the estimator in both autopilots, attitude data provided by Robotics Arena, an infrastructure containing a motion capture system capable of returning true ground attitude values, is considered. Keywords: Nonlinear Attitude Estimation, Trace-based Filter, Paparazzi, Complementary Filter, Pix- hawk. 1. Introduction Unmanned Aerial Vehicles (UAV) are becoming very important in our daily life, even if sometimes we have no idea about it. What started to be a military weapon, commonly known as drone, today is way more than that. Drones have a wide range of applications, such as military weapons, surveil- lance and security, archaeological surveying, climate study, search and rescue missions [8] or even for en- tertainment purposes. Drones have been taking an important role in the aircraft technology field as they allow the develop- ment of new ideas that can be applied and tested without any harm to the pilot, that being an impor- tant advantage when developing new control and es- timation algorithms in order to improve efficiency, flexibility and robustness. This work focuses on the problem of attitude es- timation. For feedback control, it is necessary that all variables are observable. It is not always possi- ble to measure variables due to, for example, lack of sensors, and they need to be estimated. Esti- mation also allows to attenuate noise coming from the sensors. Nowadays, there are already estima- tion methods in the market with proven good per- formances. Amongst the most common are the Ex- tended Kalman Filter [2]-[5] and the Complemen- tary Filter (CF) [6]. This work intends to analyse the performance of an attitude estimation solution, the Trace-based Filter (TBF), proposed in [7]. Implementation of the TBF is done in two Autopilots (AP): Paparazzi and Pixhawk. Validation of the implementation is made through two quadcopter platforms, the Qua- VIST, which uses Paparazzi AP, and the QuadR- ANT, which uses Pixhawk AP. The next chapter introduces both platforms, the kinematic model of a quadcopter and the two AP’s. 2. Quadcopters Quadcopters configuration may vary depending on what is their prime mission or application. How- ever, there are some generic components that con- stitute the basics of a quadcopter, such as the frame, motors, propellers, speed controllers, batter- ies, IMU and flight controllers. IMU is the most relevant component for the purpose of attitude es- timation, since it provides sensors such as gyro- scopes, accelerometers and magnetometers that can measure angular velocity, acceleration and magnetic field, respectively, thus providing enough data for attitude estimation. 1

Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino [email protected]

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

Implementation of Estimation and Control Solutions in

Quadcopter Platforms

Flavio de Almeida [email protected]

Instituto Superior Tecnico, Universidade de Lisboa, Lisboa, Portugal

May 2016

Abstract

The main objective of this work is the comparative experimental evaluation of different methods ofattitude estimation in order to test and evaluate the performance of one of these methods, the Trace-Based Filter. To that effect, an implementation of this solution is made in two autopilots: Paparazziand Pixhawk. First, the concept of a quadcopter is introduced. Two quadcopter platforms used for thepurposes of this work are presented: QuaVIST and QuadR-ANT. Then, the two mentioned autopilotsare introduced in order to make the process of implementation clear and objective. Finally, the resultsof the implementation in each autopilot are presented and discussed. For the case of Paparazzi, acomparison is made between the implementation of the proposed estimator and one of the autopilotsolutions, the complementary filter. The Trace-Based Filter is also implemented in Matlab based on dataprovided offline by QuaVIST sensors. Posteriorly, an evaluation of the proposed estimator on Pixhawkis made based on data obtained in real-time flight with QuadR-ANT. As a reference for the validation ofthe estimator in both autopilots, attitude data provided by Robotics Arena, an infrastructure containinga motion capture system capable of returning true ground attitude values, is considered.Keywords: Nonlinear Attitude Estimation, Trace-based Filter, Paparazzi, Complementary Filter, Pix-hawk.

1. Introduction

Unmanned Aerial Vehicles (UAV) are becomingvery important in our daily life, even if sometimeswe have no idea about it. What started to be amilitary weapon, commonly known as drone, todayis way more than that. Drones have a wide rangeof applications, such as military weapons, surveil-lance and security, archaeological surveying, climatestudy, search and rescue missions [8] or even for en-tertainment purposes.

Drones have been taking an important role in theaircraft technology field as they allow the develop-ment of new ideas that can be applied and testedwithout any harm to the pilot, that being an impor-tant advantage when developing new control and es-timation algorithms in order to improve efficiency,flexibility and robustness.

This work focuses on the problem of attitude es-timation. For feedback control, it is necessary thatall variables are observable. It is not always possi-ble to measure variables due to, for example, lackof sensors, and they need to be estimated. Esti-mation also allows to attenuate noise coming fromthe sensors. Nowadays, there are already estima-tion methods in the market with proven good per-formances. Amongst the most common are the Ex-

tended Kalman Filter [2]-[5] and the Complemen-tary Filter (CF) [6].

This work intends to analyse the performanceof an attitude estimation solution, the Trace-basedFilter (TBF), proposed in [7]. Implementation ofthe TBF is done in two Autopilots (AP): Paparazziand Pixhawk. Validation of the implementation ismade through two quadcopter platforms, the Qua-VIST, which uses Paparazzi AP, and the QuadR-ANT, which uses Pixhawk AP. The next chapterintroduces both platforms, the kinematic model ofa quadcopter and the two AP’s.

2. Quadcopters

Quadcopters configuration may vary depending onwhat is their prime mission or application. How-ever, there are some generic components that con-stitute the basics of a quadcopter, such as theframe, motors, propellers, speed controllers, batter-ies, IMU and flight controllers. IMU is the mostrelevant component for the purpose of attitude es-timation, since it provides sensors such as gyro-scopes, accelerometers and magnetometers that canmeasure angular velocity, acceleration and magneticfield, respectively, thus providing enough data forattitude estimation.

1

Page 2: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

2.1. QuaVISTQuaVIST (fig.1) is a commercial custom designedquadcopter. It serves as a research instrumentmainly in the fields of systems control and compu-tational vision. QuaVIST has a robust structure asit features several extra components and providesa wide range of functionalities. It can be controlledmanually or fly autonomously as it is equipped withpath following algorithms. The user can monitorits activities and control some flight parameters inreal time.

Figure 1: QuaVIST platform

Additionally, the QuaVIST platform is customdesigned to feature a computer, PC-104. This ma-chine carries out high level tasks and allows theintroduction of other control and estimation solu-tions.

Telemetry is available in QuaVIST via Paparazziand PC-104. Information about the sensors, mo-tors, trajectories, etc, can be accessed via theGround Control Station (GCS). For this purpose,QuaVIST is equipped with a Xbee series datalink,a wireless communication device. Also, the PC-104can interact directly with the information receivedby QuaVIST and send back new information givenby the user.

The IMU consists, mainly, of a 3-axis ADXRS620gyroscope, 3-axis ADXL335 accelerometer and a 3-axis HMC5883L magnetometer.

Fig.2 shows the flux of communication betweenQuaVIST-PC104 and the GCS.

Figure 2: Communication links with the QuaVIST

2.2. QuadR-ANTQuadR-ANT (fig.3) is a quadcopter prototype de-signed by IST students. It is equipped with four

brushless motors and four speed controllers. Theonboard AP is Pixhawk, an open source hardwareand software flight controller. The landing gear wasmade using 3D printing methods. Communicationwith the GCS is made through MAVLink protocolusing a 3DR radio to provide telemetry. Telemetrycan also be accessed through an onboard SD card.

Figure 3: QuadR-ANT platform

QuadR-ANT is perfect for testing new controllersand estimators in real time flight because most ofthe components are easy and cheap to replace ifsome misbehaviour occurs, opposite to QuaVIST,which has a higher cost and requires full attention.

2.3. Reference Frames

Let I = O; Ix; Iy; Iz denote the inertial frameNorth-East-Down (NED), with center in O, andB the body-fixed frame with center in Ob as infig.4.

The matrix that defines the rotation from the

Figure 4: Body-fixed frame centered in Ob

body-fixed frame to the inertial frame, and usingEuler angles description with Ψ = [φ; θ;ψ]T , is char-acterized as:

2

Page 3: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

IBRΨ =

cθcψ sφsθcψ − cφsψ cφsθcψ + sφsψcθsψ sφsθsψ + cφcψ cφsθsψ − sφcψ−sθ sφcθ cφcθ

(1)

2.4. Inertial Measurement Unit modellingAs described before, IMU consists of a set of sen-sors, namely gyroscope, accelerometer and magne-tometer, that provide measurements in order to es-timate attitude.

2.4.1 Gyroscope

Currently, gyroscopes usually are Micro Electro-Mechanical Systems (MEMS), which are low-cost,small but still very efficient. The gyroscopes areused to measure the angular velocities of the quad-copter in the body-fixed frame, ΩB. Most of thegyroscopes can be modelled considering two kindof disturbances: a stochastic Gaussian noise and aslowly time-variant non-stochastic bias that can beassumed, most of the time, as constant [3].

The model that governs the gyroscope can be de-scribed as:

ΩB =[gp gq gr

]T= ΩB + σω + µω (2)

where ΩB ∈ R3 is the measured angular rate, ΩB ∈R3 is the real angular rate, σω ∈ R3 is the stochasticGaussian noise and µω ∈ R3 is the bias.

2.4.2 Accelerometer

Accelerometers are quite useful to measure the ac-celeration relative to free-fall of a body. This ac-celeration is commonly known as g-force and it isdifferent from the acceleration relative to rate ofchange of velocity. An accelerometer at rest willmeasure a positive acceleration of g = 9.81 m/s2

(1G) upwards while an accelerometer free-fallingout of the sky will measure zero acceleration. Themodel of the accelerometer is as follows:

aB = aB −RTΨ.g + σa + µa (3)

where aB ∈ R3 is the measured acceleration ex-pressed in the body-fixed frame, aB ∈ R3 is thereal acceleration expressed in the body-fixed frame,

g =[0 0 9.81

]T ∈ R3 is the constant gravita-tional vector, σa ∈ R3 is the stochastic Gaussiannoise and µa ∈ R3 is a bias term.

2.4.3 Magnetometer

Magnetometers are used to measure the local Earthmagnetic field. They are also affected by some dis-turbances, such as stochastic Gaussian noise, and

also local magnetic disturbances such as iron dis-turbances, electromagnetic disturbances, etc.

The magnetometer model can be characterizedas:

n = RTΨ.n + σn + en (4)

where n ∈ R3 is the measured magnetic field vec-tor, n ∈ R3 is the real specific local magnetic fieldvector, σn ∈ R3 is the stochastic Gaussian noiseand en ∈ R3 represents general disturbances affect-ing the magnetometer.

3. Attitude EstimationTwo attitude estimation methods are now in-troduced, the Trace-based filter (TBF) and theComplementary filter (CF). For that, it is neces-sary to introduce some mathematical identities inLie-Algebra.

The cross map operation, (·)× : R3 → so(3) is aLie Algebra isomorphism defined by:

ν× =

0 −ν3 ν2

ν3 0 −ν1

−ν2 ν1 0

(5)

for any ν ∈ R3, such that any a ∈ R3 implies ν×a =ν×a. The inverse of the cross map operation is thevee map, (·)∨ : so(3)→ R3.

The trace map operation, tr(·) : Rn×n → R, isdefined by:

tr(A) = A ∈ Rn×n | tr(A) =

n∑i=1

aii (6)

3.1. Direct Attitude MeasurementsThere are different methods to obtain attitudemeasurements from the sensors. The one usedfor the purposes of this work consists of usingaccelerometer measurements directly to calculatepitch and roll, and the magnetometer measure-ments to calculate yaw.

Let a = [ax; ay; az] define the accelerometer mea-surements in each axis. Then:

φ = atan2 (−ay,−az) (7)

θ = atan2(ax,√a2y + a2

z

)(8)

Now, let M = [Mx; My; Mz] define the measure-ments of the magnetometer in each axis. To obtainthe measured yaw angle, the following equation isused [1]:

ψ = atan2(−Mycφ + Mzsφ; Mxcθ + (Mysφ + Mzcφ)sθ

)(9)

The rotation matrix R is then obtained by replac-ing the measured angles in (1).

3

Page 4: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

3.2. Complementary Filter

The main idea behind a CF is to combine theoutputs of the gyroscope and accelerometer in or-der to obtain good angular estimation results. Asdescribed in Chapter 2, both the gyroscopes andaccelerometers suffer from several types of distur-bances that have to be filtered somehow.

The accelerometer measures all accelerationspresent in the aircraft, which means that anychange of the wind or the gravitational field, amongothers, will disturb the measurements. Therefore,the accelerometer data is reliable only on the longterm. So, the information must go through a Low-Pass Filter to be more reliable.

When it comes to the gyroscope, because of theintegration over time, the measurements tend todrift over time, which means that the data is morereliable on the short term. It is necessary to use aHigh-Pass Filter to remove the drifting mean. Thefunction of the CF is to fuse these information inorder to reconstruct the signal.

The CF used by Paparazzi includes a bias esti-mation and its dynamics is given by:

˙R = (R(ω − µ) +KpRλ)×R (10)

with

˙µ = −KIλ (11)

and

λ =1

2(RT R− (RT R)T )∨ (12)

where λ is a correction factor that drives the rota-tion error R = RT R and Kp,KI are positive gains.

3.3. Trace-based Filter

The core of the TBD approach consists in consider-ing an attitude error function Υ : SO(3)×SO(3)→R, an attitude error vector er ∈ R3 and an angularvelocity error vector eω ∈ R3, where SO(3) repre-sents the Special Orthogonal Group in three dimen-sions, [4] and [7]:

Υ(R, R) =1

2tr(

D(I− RTR))

(13)

eR =1

2

[DRTR− RTRD

]∨

(14)

eω = ω − RTRω (15)

where Υ(R, R) is a locally positive-definite aboutR = R and D ∈ R3×3 is a positive definite diagonalweighting matrix.

3.3.1 Continuous Time Formulation

For a known measured rotation matrix R andknown angular velocity measurements ω (gyroscopemeasurements), and based on (13)-(15), the estima-tor dynamics is:

eω = −∆eω −d

2

[DRT R− RT RD

]∨

(16)

R = R [ω]× (17)

for

ω = eω + RT Rω (18)

where ∆ is a positive definite diagonal weightingmatrix and d ∈ R+ is a positive scalar parameter.

3.3.2 Discrete Time Formulation

For the discrete formulation (16)-(17) can be rewrit-ten as:

eω,k+1 = eω,k − ts∆eω,k − tsdeR (19)

Rk+1 = Rk expts[ω]× (20)

where the angular velocity estimation, ωk, is givenby:

ωk = eω,k + RTk Rkωk (21)

for a sampling time ts, and:

expts[ω]× = I + [ω]× sin (ts) + [ω]2× [1− cos (ts)]

(22)

3.4. Gyroscope Bias EstimationAs explained previously in Chapter 2, low costMEMS gyroscopes usually have small disturbances,one of them being a slowly time varying bias, µω,described by (2). It is possible to estimate the gy-roscope bias in order to reduce its impact on theattitude results.

The used bias formulation is the following:

ω = ω + α− µ, ˙µ = −kµα (23)

where α is a correction term based on the vectorialmeasurements and 0 < kµ < 1, [s−1].

One should notice that the TBF has a rotationbetween the frames of ω and ω, so the correctionterm α can be defined as:

α = eω + RT Rµ ∴ ˙µ = −kµ(eω + RT Rµ

)(24)

In the next section, results of the different imple-mentations are shown and some conclusions aredrawn about the performance of the estimators.

4

Page 5: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

4. ResultsAs mentioned earlier, the implementation of theTBF was made in two AP’s: Paparazzi and Pix-hawk.

For the case of Paparazzi, first, some data fromQuaVIST sensors were taken for a known trajectoryin order to reconstruct the TBF in Matlab, with andwithout bias estimation. Then, a comparison wasmade between the Matlab results, the implementedTBF on Paparazzi and the CF on Paparazzi, usingthe true ground attitude values provided by a mo-tion capture system mounted in IST, called Arena.

For the case of Pixhawk, results from the TBFimplementation were taken during a real-time flightand compared against data provided by Arena. Avalidation was not made in Matlab for this case dueto technical difficulties in obtaining valid data fromthe Pixhawk IMU.

In the next subsections, these results are pre-sented and discussed to obtain the proper conclu-sions.

4.1. PaparazziFor the purpose of this validation, data from Qua-VIST sensors, as well attitude estimation from theCF and the implemented TBF, were saved on a SDcard. A simple trajectory was described with Qua-VIST turned off and it consists on small roll andpitch rotations in both directions and yaw rotationsof about 90, also in both directions. The TBF pa-rameters were adjusted manually until good perfor-mance was achieved. Table 1 summarizes the valuesof the TBF used in the implementations, where diagrepresents a diagonal matrix ∈ R3×3. The frequencyof the Arena is 179Hz. At the time of implemen-tation on Paparazzi, Arena was not available. Forthat reason, bias estimation was not implementedsince its impact could not be evaluated relatively tothe true attitude values.

Values of the TBF parametersMatlab Paparazzi

Frequency [Hz] 100 512d 10 4D diag(25) diag(25)∆ diag(45) diag(45)kµ 0.1 0

Table 1: Values of the TBF parameters for the Mat-lab and Paparazzi implementations

Fig.5 illustrates a comparison for all estimatorsfor roll, pitch and yaw rotations, individually. Asthe frequencies of Arena, Paparazzi and implemen-tation in Matlab are different, a resampling wasmade using methods of interpolation and decima-tion, in order to get the same number of samples.

0 10 20 30 40 50 60 70 80−30

−20

−10

0

10

20

30

Time (s)

Ro

ll (º

)

Arena

TBF on Matlab

TBF on Paparazzi

TBF w/ Bias on Matlab

CF Paparazzi

Sensors Attitude

(a) Roll

0 10 20 30 40 50 60 70 80−30

−20

−10

0

10

20

30

Time (s)

Pitch

(º)

Arena

TBF on Matlab

TBF on Paparazzi

TBF w/ Bias on Matlab

CF Paparazzi

Sensors Attitude

(b) Pitch

0 10 20 30 40 50 60 70 80−150

−100

−50

0

50

100

150

Time (s)

Ya

w (

º)

Arena

TBF on Matlab

TBF on Paparazzi

TBF w/ Bias on Matlab

CF Paparazzi

Sensors Attitude

(c) Yaw

Figure 5: Roll, Pitch and Yaw results for Matlaband Paparazzi implementations

In order to obtain a detailed analyse of the perfor-mance of each estimator, a calculation of the Root-Mean-Square Error (RMSE) was made:

RMSE =

√∑ni=1(Ψi − Ψi)2

n(25)

where Ψi represents the true ground values of atti-

5

Page 6: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

tude, in this case provided by Arena, Ψi representsthe estimated values of each solution and n in thenumber of samples. Table.2 summarizes the RMSEof each implementation.

RMSE[] φ θ ψTBF in Matlab 1.218 1.822 15.221TBF on Paparazzi 2.099 2.433 13.838TBF bias on Matlab 1.212 1.854 15.303CF 2.034 2.458 15.966

Table 2: RMSE for Matlab and Paparazzi imple-mentations

It is possible to observe that, from all the pre-sented solutions, the TBF in Matlab is the onewith the best performance, achieving a smaller er-ror when compared to the CF.

The implementation of the TBF on Paparazzipresents good results. However, attitude worsenswhen compared to the implementation in Matlab.Also, this solution appears to contain more noise. Abetter adjustment of the parameters may improveits performance.

The yaw presents a higher error when comparedto pitch and roll. This is most likely due to lack ofcalibration of the magnetometer. It is visible thatfor roll and pitch movements the yaw tends to fol-low their dynamic, increasing the error.

Testing this solution in a real-time flight wouldprovide more information about its behaviour.

It is important to see the effect of the bias pa-rameter, kµ, in the implementation with bias esti-mation. Table.3 shows the RMSE for different kµ.The best performance achieved with bias estimation

RMSE[] φ θ ψ

kµ = 0.1 1.212 1.854 15.303

kµ = 0.2 1.210 1.883 15.433

kµ = 0.5 1.203 1.955 15.917

kµ = 0.8 1.194 2.007 16.394

kµ = 1 1.189 2.034 16.712

Table 3: RMSE for TBF on Matlab, for differentbias parameter, kµ

was for kµ = 0.1. The estimated attitude tends toget worse with the increase of kµ, except for thecase of φ, that improves slightly.

In the next section, an analysis of attitude esti-mation is presented in real-time flight with QuadR-ANT, on Pixhawk.

4.2. PixhawkIn order to test the performance of the TBF in realscenarios, a flight with random trajectories was con-ducted using QuadR-ANT. The attitude data was

taken in real-time and saved into a log file. Trueground values were also taken from Arena to con-clude about TBF performance. However, reliabledata from the sensors could not be obtained in or-der to implement the TBF solution on Matlab andcompare it with the default quaternion estimator ofPixhawk.

Table.4 resumes the values of the parameters im-plemented on Pixhawk for the TBF solution. Thewhole Pixhawk system runs at 250Hz..

Values of the TBF parametersPixhawk implementation

Frequency [Hz] 250d 4D diag(25, 25, 25)∆ diag(45, 45, 45)kµ 0.1

Table 4: Values of the TBF parameters for the Pix-hawk implementation

The estimated and true ground values of attitudeobtained during flight are illustrated in fig.6.

The first conclusion that can be drawn from theseresults is that stabilization was achieved in flightmode, i.e, the quadcopter effectively was able tofly. As it would be expected, during flight the pres-ence of noise is stronger when compared to the pre-vious validations. Noise coming from the motorsare a huge contribution to that fact. However, theestimator seems to perform well under these condi-tions.

We may detect some delay of the TBF com-pared to the true attitude. In fact, during theflight experiment, it was noted that the quadcopterwould perform well for hover movements but wouldbecome unstable for more aggressive and suddenmovements. This delay provokes instability sincethe system is trying to compensate estimated re-sults from a previous action. Despite this fact, thedynamics of TBF estimator was according to whatwas expected. The reason for this delay is mostlikely related to small adjustments of the parame-ters and the frequency of the system. Further im-provements on this theme may include an optimiza-tion of the parameters to achiever better stability.

Like the case described in the previous section, acomparison analysis between the estimated and thetrue attitude values was made by calculating theRMSE, as shown in table.5.

RMSE[] φ θ ψ

TBF on Pixhawk 2.943 1.495 4.342

Table 5: RMSE for Pixhawk TBF implementation

A direct conclusion based on the RMSE values is

6

Page 7: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

0 10 20 30 40 50 60 70 80−8

−6

−4

−2

0

2

4

6

8

Time (s)

Ro

ll (º

)

Arena

TBF on Pixhawk

(a) Roll

0 10 20 30 40 50 60 70 80−8

−6

−4

−2

0

2

4

6

8

Time (s)

Pitch

(º)

Arena

TBF on Pixhawk

(b) Pitch

0 10 20 30 40 50 60 70 80−8

−6

−4

−2

0

2

4

6

8

Time (s)

Ya

w (

º)

Arena

TBF on Pixhawk

(c) Yaw

Figure 6: Roll, Pitch and Yaw results for Pixhawkimplementation

that TBF performs slightly worse when submittedto flight conditions. That was, somehow, expectedbecause of the vibrations coming from the motors.Yaw rotation presents a significant decrease of theerror, which is directly related with the calibrationof the magnetometer. Calibration procedures

took place before the flight experiment in orderto attenuate discrepancies with direct attitudemeasurements. Pixhawk provides a simple andintuitive way to perform this calibration, opposedto Paparazzi.

The worst performing rotation is clearly roll,which presents a considerable error of almost 3.As seen in fig.6(a), the quadcopter was submittedto constant variations in the roll axis. This hap-pens because of the delay explained before thatcause instability to the system. Also, it makesstabilization depending too much on the pilot,which is not recommendable.

In this implementation, particularly, bias estima-tion was of major importance. From the previoussection, a conclusion that the bias estimation has asmall impact on the performance of the estimatormay be evident. However, stabilization during theflight was only achieved for values of kµ very closeto 0.1.

On an overall basis, it was verified that theTBF estimator could be a suitable solution forattitude estimation, providing new alternatives tothe current estimators on the market. It is forsure necessary to improve the implementation byadjusting and optimizing its parameters.

5. ConclusionsDuring the course of this work some results werereached and some final conclusions can be drawn.

The implementations of the TBF in both stud-ied AP’s revealed good overall performances. How-ever, further improvements should be made in or-der to get more accurate and systematic results.Improvements should focus on the optimization ofparameters. Results of the implementation on Pa-parazzi show very good performances for roll andpitch rotations, beating the CF. For yaw rotation,poor results were obtained considering magnetome-ter miscaliberation. Estimation of bias was provento be important for small values of Kµ and tendsto worsen when increased. The bias estimation wascrucial for the Pixhawk implementation, since sta-bility conditions for the flight were only achievedwhen bias estimation was present, with Kµ = 0.1.

A well succeeded flight experiment was achievedfor the Pixhawk implementation, which is, by itself,a good indicator. In this case, the TBF estimatorperforms worse and becomes unstable for suddenand aggressive movements. Although reasonable re-sults were obtained and flight was possible, this doesnot discard future improvements, specially for pur-poses of computational vision and aerial mapping,where stabilization is of maximum importance.

Another interesting improvements that could bemade in the future include combining the TBF

7

Page 8: Implementation of Estimation and Control Solutions in ...€¦ · Implementation of Estimation and Control Solutions in Quadcopter Platforms Fl avio de Almeida Justino avio.justino@tecnico.ulisboa.pt

solution with new control solutions. Substitutingthe PID controllers being used by both AP’s byLQR based solutions would provide new perspec-tives about attitude control and estimation. In thecase of Paparazzi, this improvement may help withthe high level control tasks taking place in PC-104,giving the user more autonomy and flexibility.

Over the course of this work, Pixhawk revealedto be a simpler and more user friendly tool, notonly for the user but also for developers. Thus, in-stalling Pixhawk on QuaVIST may prove to be agood choice. Some of the work done here may helpin this transition.

References[1] J. D. Barton. Fundamentals of Small Unmanned

Aircraft Flight. Johns Hopkins APL TechnicalDigest, 31(2):132–149, 2012.

[2] P. Batista, C. Silvestre, and P. Oliveira.Sensor-Based Complementary Globally Asymp-totically Stable Filters for Attitude Estima-tion: Analysis, Design, and Performance Eval-uation. Automatic Control, IEEE Transactionson, 57(8):2095–2100, February 2012.

[3] M. Euston, P. Coote, R. Mahony, J. Kim, andT. Hamel. A Complementary Filter for Atti-tude Estimation of a Fixed-Wing UAV. In In-telligent Robots and Systems, 2008. IROS 2008.IEEE/RSJ International Conference, pages340–345, Nice, September 2008.

[4] M. Figueiroa. Nonlinear Attitude Estimation inSO(3): Application to a Quadrotor UAV. Mas-ter Thesis, Instituto Superior Tcnico, Universi-dade de Lisboa, May 2014.

[5] B. Henriques. Estimation and Control of aQuadrotor Attitude. Master Thesis, InstitutoSuperior Tcnico, Universidade Tcnica de Lis-boa, June 2011.

[6] R. Mahony, T. Hamel, and J.-M. Pflimlin. Non-linear Complementary Filters on the SpecialOrthogonal Group. Automatic Control, IEEETransactions on, 53(5):1203–1218, June 2008.

[7] A. Moutinho, M. Figueiroa, and J. R. Azin-heira. Attitude Estimation in SO(3): A Com-parative UAV Case Study. Journal of Intelligent& Robotic Systems, 80(3-4):375–384, 2015.

[8] S. Waharte and N. Trigoni. Supporting Searchand Rescue Operations with UAVs. In Emerg-ing Security Technologies (EST), 2010 Inter-national Conference on, pages 142–147. IEEE,2010.

8