formation flying for quadcopters - divakth.diva-portal.org/smash/get/diva2:853494/fulltext01.pdf ·...

30
Formation Flying for Quadcopters Bachelor Thesis PETRA HESSELMAR, KRISTOFFER BRODIN Stockholm 2015 Prof. Xiaoming Hu Division of Optimization and Systems Theory Department of Mathematics Royal Institute of Technology

Upload: hatruc

Post on 10-Sep-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Formation Flying for Quadcopters

Bachelor Thesis

PETRA HESSELMAR, KRISTOFFER BRODIN

Stockholm 2015

Prof. Xiaoming HuDivision of Optimization and Systems Theory

Department of MathematicsRoyal Institute of Technology

Page 2: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Abstract

The purpose of this project is to design a control law to control a groupof quadcopters flying in formation in a specified reference track.

To describe the movements of a quadcopter a mathematical model, basedon Newton-Euler equations, is formed and linearized into a linear state-space model. The control law is then designed by using feedback. Themodel was simulated in MATLAB R○ for different formations and numberof quadcopters, where the designed control law proved to be successfulin stabilizing the system. This report gives a basic investigation of for-mation flying control where several assumptions and simplifications havebeen made. For future work the model can be developed and more factorsbe taken into consideration.

Sammanfattning

Syftet med detta projekt ar att utforma en styrlag for att styra engrupp av quadcoptrar till att flyga i formation runt en given referensbana.

For att beskriva rorelserna hos en quadcopter anvands en matematiskmodell som bygger pa Newton-Eulers ekvationer. Dessa linjariseras foratt bilda en linjar tillstandsmodell. Styrlagen utformas sedan med hjalpav aterkoppling. Modellen simuleras i MATLAB R○ for olika formatio-ner och olika antal quadcoptrar, dar den utformade styrlagen visat sigvara framgangsrik i att stabilisera systemet. I denna rapport gors engrundlaggande undersokning av formationsflygning dar flera antagandenoch forenklingar har gjorts. For framtida studier kan modellen utvecklasoch fler faktorer beaktas.

1

Page 3: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Contents

1 Introduction 3

2 Mathematical Model 52.1 Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Forces and Torques in a Quadcopter . . . . . . . . . . . . . . . . 72.3 Mathematical Description of the Quadcopters Movements by Newton-

Euler Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Control Design 93.1 Linearization of the Mathematical Model and State-Space Mod-

elling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Controllability and Observability . . . . . . . . . . . . . . . . . . 123.3 Definition of Error States and Input Design . . . . . . . . . . . . 133.4 Feedback and Pole Placement Design . . . . . . . . . . . . . . . . 15

4 Simulation 184.1 Formation Flying for a Horizontal Circle Track . . . . . . . . . . 184.2 3-Dimensional Circle Track . . . . . . . . . . . . . . . . . . . . . 20

4.2.1 V-formation for 3 Quadcopters . . . . . . . . . . . . . . . 214.2.2 V-formation for n Quadcopters . . . . . . . . . . . . . . . 224.2.3 Line Formation for n Quadcopters . . . . . . . . . . . . . 23

5 Assumptions and Simplifications 25

6 Conclusion 25

7 Appendix 28

2

Page 4: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

1 Introduction

A quadcopter is a UAV (Unmanned Aerial Vehicle), that is much similar to asmall helicopter but with 4 rotors, see Figure (1). It has a cross-liked form,and each propeller and engine is placed at the end of each arm. A quadcopteris stabilized by making the propellers spin in different direction, two of thepropellers spin clockwise, and the other two propellers spin counter clockwise[1]. Quadcopters are useful in many ways, they have lower costs compared tomanned vehicles and there is no pilot needed. A group of quadcopters flyingin a formation is useful for cooperative transportation, rescue missions, aerialmapping, communication relays and air refuelling [11]. In this report it is in-vestigated how to control a quadcopter and how to make several of them fly information.

Figure 1: A quadcopter. Picture from [10].

The quadcopter has a complicated movement-pattern, since it can movefreely in all dimensions, therefore a good mathematical model is needed beforeconstructing the control law. The control design is based on a linear state-spacemodel and since the mathematical movements of the quadcopter are non-linear alinearization is needed. The main idea for the control design for one quadcopteris to construct a feedback loop which designs the input (the controlled signal)based on how well the output (the quadcopters position) meets the specifiedreference track (the desired position). The formation control is then designedby choosing a leading quadcopter following this reference track and calculatingthe reference track for the other quadcopters by defining an individual distanceto the leader. Finally the control design is tested by simulating in MATLAB R○.The quadcopter formation is tested for a different number of quadcopters, fordifferent reference tracks and for different formations.

The purpose of this project can in conclusion be formulated as; by finding amathematical model to describe the movements of a quadcopter, design a con-trol law to control a group of quadcopters flying in formation in a specifiedreference track and simulate this flight for different number of quadcopter unitsas well as for different formations. The mathematical model is presented in

3

Page 5: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Section (2), the control design is thoroughly described in Section (3) and theresult of the simulation is finally shown in Section (4). In the end of the report,Section (5), there is an analysis of which assumptions and simplifications thathas been made and how this affects the results.

4

Page 6: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

2 Mathematical Model

A mathematical model for the movements of the quadcopter is established byusing standard mechanical laws. Firstly two Cartesian coordinate systems aredefined, one inertial system fixed to the earth and one system fixed to the bodyframe of the quadcopter [2]. It is sometimes easier to describe some motions ina local body-fixed system where the external forces are seen in the quadcopterspoint of view, thus two systems are needed. The quadcopter has 6 degrees offreedom, the translational directions x, y and z and the rotation around thesethree axes, roll angel φ around the x-axis, pitch angel θ around the y-axis andyaw angel ψ around the z-axis [2], see Figure (2). Roll, pitch and yaw movementis defined in Figure (3). Since the body-fixed system is fixed to the frame ofthe quadcopter, the angels φ, θ and ψ also describe how the two coordinatesystems are oriented to each other. The angels can therefor be used to describethe transformation between the systems, using transformation matrices [4], [5].

Figure 2: The body frame and the inertial frame, and the forces of the quad-copter. X, Y, Z is the inertial frame and xB , yB , zB is the body frame.

The coordinates for the position of the quadcopter in the inertial system aredefined in a vector ξ and the angular positions in the vector η, where

ξ =

xyz

,η =

φθψ

. (1)

A definition of the angular velocities in the body frame is also needed andis given by the vector ν as

ν =

pqr

. (2)

5

Page 7: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 3: The yaw, pitch and roll movement, exemplified for an airplane. Theyaw movement is when the airplane is moving from side to side, the pitch move-ment is when the nose is tipping up or down and the roll movement is when theplane is tilting [2][5]. Picture from [6]

2.1 Euler Angles

Before defining the transformation matrices it is necessary to introduce theconcept of Euler angels. The transformation between the body frame and theinertial frame depends on how the quadcopter has rotated, that is, in whichorder the angels φ, θ and ψ have changed [5]. For this project the standardorder of yaw-pitch-roll movement is used, in Figure (4) the behaviour of theEuler angles is illustrated with standard movement order [5].

Figure 4: Euler angles, x, y, z is the inertial frame and xB , yB , zB is the bodyframe. First the x-axis is moved with an angle ψ (Yaw-movement) which givesthe new coordinate system x′, y′, x′ = N,Ny, z. Thereafter the z-axis is movedwith an angle θ (Pitch-movement) and the x′′, y′′, z′′ = N, yB , zB coordinatesystem is obtained. The last rotation is moving the new x-axis, the N-axis, withan angle φ (Roll-movement) and the rotation to the body frame is concluded [4]

.

The transformation matrix for the translational movements RT from the

6

Page 8: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

body frame to the inertial frame is given as

RT =

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

, (3)

where sx = sin(x), cx = cos(x).The matrix is orthogonal and thus RTT =

R−1T [2]. For the rotational movement from inertial frame to the body framethe matrix RR is given as

RR =

1 0 −sθ0 cφ cθsφ0 −sφ cθcφ

(4)

and the inverse is

RR−1 =

1 sφtθ cφtθ0 cφ −sφ0 −sφ/cθ cφ/cθ

, (5)

where tx = tanx [2].

2.2 Forces and Torques in a Quadcopter

The thrust force of rotor i can be described as

fi = kω2i (6)

and the torque around the rotor axis can be described as

τMi= bω2

i + IM ωi, (7)

where k is the lift constant, ωi is the angular velocity of rotor i = 1, .., 4, bis the drag constant, IM is the inertia moment of the rotors ωi is the angularacceleration which often is small and can thus be ignored [2].

The total thrust is

TB =

00T

, (8)

where

T =

4∑i=1

fi = k

4∑i=1

ωi. (9)

The torque around centre of mass is

τB =

τφτθτψ

=

lk(−ω2

2 + ω24)

lk(−ω21 + ω2

3)4∑i=1

τMi

, (10)

where l is the distance between rotor and the centre of mass, k is the liftconstant and τθ,φ,ψ are the torques in the direction of the corresponding bodyframes [2].

7

Page 9: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

2.3 Mathematical Description of the Quadcopters Move-ments by Newton-Euler Equations

There are two different methods to formulate equations for the rotational andtranslational movements of a rigid body, the Newton-Euler equations or Euler-Lagrange equations [2]. For quadcopters, satellites etc., Euler-Lagrange is per-haps the most common method, but in this case, due to the simplicity of theequations, Newton-Euler is used instead. The result is the same for both meth-ods even though Euler-Lagrange, which is based on a more advanced theorywhere the energy of the system is analysed, sometimes makes the calculationseasier for complex problems [7]. In Figure (2) the forces affecting the quadcopterare depicted, using this and Newton’s second law, the translational movementis given by

mξ = G + RTTB, (11)

where ξ = [ x y z ]T is the position of the quadcopter in the inertialsystem, G = mg[ 0 0 −1 ]T is the gravitation vector, m is the mass ofthe quadcopter, g is the gravitational acceleration and the total thrust T istransformed in to the inertial system by multiplying with RT [2].

The rotational movements can be described by the torque equation (Euler-equation), which in the body frame coordinate system gives

Iν + ν × (Iν) + Γ = τB → ν = I−1(τB − ν × (Iν − Γ), (12)

where Iν is the angular acceleration of the inertia, ν × (Iν) is the cen-tripetal forces, Γ are the gyroscopic forces and τ is the external torque [2]. Thegyroscopic force is a force occurring when rotating a body. [2][8].

The angular accelerations are

pqr

=

(Iyy − Izz)qr/Ixx(Izz − Ixx)pr/Iyy(Ixx − Iyy)pq/Izz

− IMωΓ

q/Ixx−p/Iyy

0

+

τφ/Ixxτθ/Iyyτψ/Izz

. (13)

By using the transformations matrix RR the torque equation can be trans-formed into the inertial system as

η =d

dt(RR

−1ν) =d

dt(RR

−1)ν + RR−1ν (14)

and

d

dt(R−1R ) =

0 φcφtθ + θsφ/c2θ −φsφcθ + θcφ/c

0 −φsφ −φcφ0 φcφ/cθ + φsφtθ/cθ −φsφ/cθ + θcφtθ/cθ

, (15)

where tx = tan(x) [2].

8

Page 10: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

3 Control Design

Since the goal is to be able to control a formation of quadcopters for any numberof quadcopter units, a control law where each unit is both stable and indepen-dently controllable at every time t, is needed. It is also essential that new unitscan easily be added to the model . Using state-space feedback, identically de-signed for each quadcopter would satisfy these demands [3]. For a specifiedreference in position r(t) for each quadcopter, the input u(t) is designed usingfeedback control so that the output y(t) (the actual position) meets the refer-ence, r(t) [3]. By then selecting one reference ra(t) for one unit a, which canbe seen as the ”leader” of the formation, the reference for the rest of the unitscan easily be calculated in primer controller for a chosen distance ∆ betweeneach unit. For example if the leader unit a has xref,a as reference in x-positionthen the second quadcopter b would have xref,b = xref,a + ∆ as reference inx-position. The principal behind this control law for 3 units is illustrated inFigure (5). It should be emphasised that the same state-space feedback-loop isused for each quadcopter unit, it is only the reference r(t) that changes betweenthem.

Figure 5: Block diagram of the control design for three quadcopters

A control law is designed using a linear state-space model with feedback.The states are given as

9

Page 11: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

x =

xxyyzzφ

φθ

θψ

ψ

=

x1

x2

x3

x4

x5

x6

x7

x8

x9

x10

x11

x12

(16)

and the input signal, u(t) as

u =

T −mgτφτθτψ

. (17)

From now on the state-space model will be limited to only controlling theposition x, y, z and the yaw angel ψ which are suitable variables to start with. Ifthe control law is successful the model can be expanded to control all 6 degreesof freedom of the quadcopter. This is not done in this report though and isinstead left for future and deeper studies. An output signal y(t) can then bedefined as

y =

xyzψ

. (18)

3.1 Linearization of the Mathematical Model and State-Space Modelling

Equation (11) and Equation (14) are non-linear equations, a linear state-spacemodel written on the form

x = Ax+Bu (19)

therefore requires linearization. This is done using first order Taylor expan-sion

∆xi =

12∑n=1

∂xi∂xn|xn,0∆xn +

4∑m=1

∂xi∂um

|um,0∆um (20)

around a steady point [3], [9].

10

Page 12: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

x1,0 = 0x2,0 = 0x3,0 = 0x4,0 = 0x5,0 = 0x6,0 = 0x7,0 = 0x8,0 = 0x9,0 = 0x10,0 = 0x11,0 = 0x12,0 = 0

, (21)

where ∆xi = xi− xi,0, ∆xn = xn−xn,0 and ∆um = um−um,0. This wouldcorrespond to the quadcopter hovering in the air at some position x, y and z.Analysing Equation (11) at the steady point (21), gives x7,0 = x9,0 = x11,0 =φ0 = θ0 = ψ0 = 0 hence, using the standard Taylor expansion of sinα andcosα around α = 0, where α represents any arbitrary angel, the approximationcosα = 1 and sinα = α, for α = φ0 = θ0 = ψ0 = x7,0 = x9,0 = x11,0 =0, is made. This simplifies the transformation matrices and thereby furthercalculations.

The linearized model is then

∆x = A∆x+B∆u (22)

y = Cx. (23)

where

∆u =

T −mg

∆τφ∆τθ∆τψ

=

T −mgτφ − τφ,0τθ − τθ,0τψ − τψ,0

, (24)

τφ,0 = lk(−ω22,0 + ω2

4,0), τθ,0 = lk(−ω21,0 + ω2

3,0), τψ,0 =4∑i=1

τMi,0 =4∑i=1

bω2i,0

and

A =

0 1 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 g 0 0 00 0 0 1 0 0 0 0 0 0 0 00 0 0 0 0 0 −g 0 0 0 0 00 0 0 0 0 1 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 1 0 0 0 00 0 0 0 0 0 0 0 τψ

IrωΓ

Ixx0 0

0 0 0 0 0 0 0 0 0 1 0 00 0 0 0 0 0 − τψ

IzzIrωΓ

Iyy0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 − τθ

Iyy0 0 0 0 0

, (25)

11

Page 13: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

B =

0 0 0 00 0 0 00 0 0 00 0 0 00 0 0 01m 0 0 00 0 0 00 1

Ixx0 0

0 0 0 00 0 1

Iyy0

0 0 0 00 0 0 1

Izz

, (26)

and

C =

1 0 0 0 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 0 0 0 00 0 0 0 1 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 1 0

. (27)

It should be noticed that the 1st, 3rd and 5th equation in Equation (22) isalready linear which means that x1,0, x3,0 and x3,0 can equally just be set tozero (x1,0 = x3,0 = x3,0 = 0). Using this and x7,0 = x9,0 = x11,0 = 0 (asdescribed above) gives ∆xn = xn − xn,0 = xn for all n=1,...,12. In the sameway using Equation (21) gives ∆xi = xi − xi,0 = xi for all i=1,...,12. Equation(22) can then equally be written as

x = Ax+B∆u, (28)

with the same matrices A, B and the same vector ∆u.

3.2 Controllability and Observability

Before designing a control law using a feedback loop it is suitable to verifythat the Linear Model (23) and (28) is controllable for all states, otherwise thecontrol law, no matter the design, will not stabilize all the states of the system[3]. Let define

S :=[

B BA BA2 . . . BAn−1]

(29)

where n is the number of states. The system is controllable if S has fullrank [3], which in the State-Space Model (28), means that the rank of S mustbe 12 since there are 12 states. This is fulfilled for the System (28), thus it iscontrollable.

From now on it will be assumed that all the states are measurable, hence noobserver to approximate the immeasurable states is needed. For future projectsand perhaps development of the control law it is however interesting to verifythat the Linear Model (23) and (28) is observable as well. Let define

12

Page 14: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Θ :=

C

CA

CA2

...

CAn−1

(30)

where n is the number of states. With the same principal as for controlla-bility, Θ must have full rank for the system to be observable [3], in this case 12.The rank of Θ is 12, thus the System (28) is also observable.

3.3 Definition of Error States and Input Design

By defining errors for x, y, z and ψ the system in Equation (28) can be writtenon a new state-space form with the errors as states. Firstly let for the x-positionof the quadcopter define an error as

e1 := x1,ref − x1 = ex

⇒ e1 = x1,ref − x1 = x1,ref − x2 =: e2

⇒ e2 = x1,ref − x2 = x1,ref − gx9 =: e3

⇒ e3 = x(3)1,ref − gx9 = x

(3)1,ref − gx10 =: e4

⇒ e4 = x(4)1,ref − gx10 = x

(4)1,ref − g

(− τψ,0Izz

x7 +IMωΓ,0

Iyyx8 + 1

Iyyu3

)(31)

and furthermore for the y-position let

e5 := x3,ref − x3 = ey

⇒ e5 = x3,ref − x3 = x3,ref − x4 =: e6

⇒ e6 = x3,ref − x4 = x3,ref + gx7 =: e7

⇒ e7 = x(3)3,ref + gx7 = x

(3)3,ref + gx8 =: e8

⇒ e8 = x(4)3,ref + gx8 = x

(4)3,ref + g

(τψ,0x9 − IMωΓ,0

Izzx10 + 1

Ixxu2

)(32)

and for the z-position let

e9 := x5,ref − x5 = ez

⇒ e9 = x5,ref − x5 = x5,ref − x6 =: e10

⇒ e10 = x5,ref − x6 = x5,ref − 1mu1

(33)

finally for the ψ-position the error can be defined as

13

Page 15: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

e11 := x11,ref − x11 = eψ

⇒ e11 = x11,ref − x11 = x11,ref − x12 =: e12

⇒ e12 = x11,ref − x12 = x11,ref − (− τθ,0Iyyx7 + 1

Izzu4)

(34)

In conclusion this gives

e1 = e2

e2 = e3

e3 = e4

e4 = ε1e5 = e6

e6 = e7

e7 = e8

e8 = ε2e9 = e10

˙e10 = ε3˙e11 = e12

˙e12 = ε4

. (35)

If the input u is designed as

u =

u1

u2

u3

u4

=

m(x5,ref − ε1)

Ixx(−τψ,0x9 +IMωΓ,0

Izzx10 + 1

gx(4)3,ref −

1g ε2)

Iyy(τψ,0Izz

x7 − IMωΓ,0

Iyyx8 + 1

gx(4)1,ref −

1g ε3)

Izz(τθ,0Iyy

x7 + x11,ref − ε4)

, (36)

where ε1, ..., ε4 are arbitrary scalars, forming the vector ε =[ε1 ε2 ε3 ε4

]T,

a new state-space model with the error states e and a new input ε is given by

e = A′e + B′ε, (37)

where

e =

e1

e2

e3

e4

e5

e6

e7

e8

e9

e10

e11

e12

, (38)

14

Page 16: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

A′ =

0 1 0 0 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 1 0 0 0 0 0 00 0 0 0 0 0 1 0 0 0 0 00 0 0 0 0 0 0 1 0 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 1 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0

(39)

and

B′ =

0 0 0 00 0 0 00 0 0 01 0 0 00 0 0 00 0 0 00 0 0 00 1 0 00 0 0 00 0 1 00 0 0 00 0 0 1

. (40)

The output y is now given by

y = Cx =

x1,ref

x5,ref

x9,ref

x11,ref

e1

e5

e9

e11

. (41)

This new model, Equation (37), is also controllable and observable sincerewriting the state-space model, Equation (28), does not change the controlla-bility and observability of the system.

3.4 Feedback and Pole Placement Design

Stabilizing the quadcopter system and making the actual position match thereference position as described in the beginning of Section (3) equals gettingthe error e to converge to zero at steady state (when the transients have diedout). A feedback-loop for all the error-states where the input ε depends on theactual error would probably accomplish this [3], see Figure (6).

15

Page 17: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 6: Block diagram for the New Model (37), with error states.

Let the input ε be written as

ε = −Ke (42)

where

K =

k1 k2 k3 k4 0 0 0 0 0 0 0 00 0 0 0 k5 k6 k7 k8 0 0 0 00 0 0 0 0 0 0 0 k9 k10 0 00 0 0 0 0 0 0 0 0 0 k11 k12

, (43)

and kn, n = 1, ..., 12 are scalars. Inserting Equation (43) in Equation (37)gives

e = (A′ −BK ′)e (44)

The system becomes stable and the error e converges to zero at steady statewhen all the poles of the system are in the left half of the complex plane, whichcorresponds to all the eigenvalues λ to (A′−BK ′) have negative real parts [3].

The speed and other desired properties of the system depend on where moreexactly the poles are placed in left part of the complex plane. By placing themin the cone as is shown by the marked area in Figure (7) the performance of thequadcopter system should meet the requirements of the error e converging tozero arbitrary fast [3]. A more optimal pole placement design is left for futureand more throughout studies.

16

Page 18: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 7: Pole placement

If poles pn, n = 1, ..., 12 are chosen to be placed according to this theory,then the scalars kn, n = 1, ..., 12 in K can be identified from the equation

det(A′ −BK ′) =

12∏n=1

(λn − pn). (45)

17

Page 19: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

4 Simulation

The model is simulated using MATLAB R○. The simulation should verify thatthe error ei converges to zero for all i = 1, ..., 12 and for all quadcopter units. Itshould also be verified that the units hold the desired formation as referenced,that the success of the designed control law is independent of the number ofunits in formation and that the reference track can be varied as well as the for-mation. In the simulation one quadcopter unit is named leader of the formationand the other units are referenced to keep a certain distance to this leader, justas described in the beginning of Section (3). The numerical values used in thesimulation can be found in Table (1).

Parameter Value Unitg 9.81 m/s2

m 0.468 kgl 0.225 mk 2.98 · 10−9 kg ·m/sb 1.140 · 10−7 kg ·m2

IM 3.357 · 10−5 kg ·m2

Ixx 4.856 · 10−3 kg ·m2

Iyy 4.856 · 10−3 kg ·m2

Izz 8.801 · 10−3 kg ·m2

ωΓ,0 0 rad/s

Table 1: Numerical values for parameters used in the simulation, obtained from[2].

4.1 Formation Flying for a Horizontal Circle Track

The model is first tested for a simple horizontal circle track as reference, seeFigure (8). Three units should hold a V-formation where the 2 units in therear keep a constant distance, behind and to the side, of the leader. The refer-ence position for the leader unit, a, following the horizontal circle track can bedescribed as

xa,ref = χcos(ωt)ya,ref = χsin(ωt)

za,ref = hψa,ref = 0

(46)

where χ is the radius of the circle track, t is the time, ω is the angularvelocity in the track (ωt is the velocity of the quadcopter) and h is the desiredheight of the formation. By defining a distance ∆χ as the difference in radiusfor the two following units b and c (the distance right or left of the leader a theyshould keep) and by defining a distance ∆t as the distance b and c should keepbehind the leader a, the reference position for quadcopter b is given as

18

Page 20: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

xb,ref = (χ+ ∆r)cos(ω(t−∆t)yb,ref = (χ+ ∆r)sin(ω(t−∆t)

zb,ref = hψb,ref = 0

(47)

and for quadcopter c the reference position is given as

xc,ref = (χ−∆χ)cos(ω(t−∆t)yc,ref = (χ−∆χsin(ω(t−∆t)

zc,ref = hψc,ref = 0

. (48)

Figure 8: The reference track for the horizontal circle track

In Figure (9) the simulated flight track is illustrated, fixing the position theunits at one specific time. All the errors for each quadcopter in this referencetrack are shown in Figure (10) where they clearly converge to zero.

19

Page 21: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 9: Ordinary horizontal circle track where the three quadcopters hold aV-formation on a constant distant from each other.

Figure 10: The error for each quadcopter

4.2 3-Dimensional Circle Track

When it is verified that the designed control law is working for a rather sim-ple track, it can then be tested for a more complicated track, namely a 3-Dimensional circle track (non-horizontal) with the reference position for theleader unit given as

20

Page 22: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

xa,ref = χcos(ωt)cos(ωt)ya,ref = χcos(ωt)sin(ωt)

za,ref = χsin(ωt).ψa,ref = 0

. (49)

The reference track is illustrated in Figure (11).

Figure 11: The reference track for the 3-dimensional circle track.

4.2.1 V-formation for 3 Quadcopters

For three units in V-formation using the same principal as described by Equa-tions (46), (47) and (48) the reference position for quadcopter b and c is obtained.If the quadcopters are flying on the same height ∆χ = 0 for the reference inzref -position (not for x or y). The simulation is shown in Figure (12). Themodel stabilizes around the reference track since the error e converges to zeroas seen in Figure (13).

21

Page 23: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 12: The circle track with 3 quadcopters in V-formation.

Figure 13: The error for 3 quadcopters.

4.2.2 V-formation for n Quadcopters

Since the control law has been verified to function well for 3 units it is nowsuitable to simulate for a larger number of units, testing that the control designholds when the number of units change. There are several quadcopters followingthe leader a now, all having a specified distance to this leader. The quadcoptersare still flying on the same height. Figure (14) shows 20 following quadcopters(21 including the leading quadcopter) flying in a V-formation.

22

Page 24: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

Figure 14: The circle track with 20 following quadcopters in V-formation.

Figure 15 shows how the errors are converging to zero.

Figure 15: The error for 21 quadcopters.

4.2.3 Line Formation for n Quadcopters

Finally it should be verified that the control law enables different kinds of for-mations. Figure (16) shows the circle track when 21 quadcopters fly in a lineformation where ∆t = 0. Figure (17) shows the same line formation but this

23

Page 25: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

time the quadcopters also fly on different heights having a ∆χ 6= 0 for thezref -position.

Figure 16: The circle track with 20 following quadcopters in a line formation

Figure 17: The circle track with 20 following quadcopters on different heights.

24

Page 26: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

5 Assumptions and Simplifications

In this project some assumptions and simplifications have been made, as alwaysnecessary when modelling reality and solving complex problems. It is impor-tant though to discuss and analyse how these simplifications are affecting theobtained results and when or at which conditions the simplified model is nolonger valid. First of all it is assumed that all states are measurable, which inreality is not always the case. If some of the states in the Linear State-SpaceModel (37), is not measurable, a normal feedback loop as designed in Section(3.4), will not stabilize the system. However since the system (28), and therebyalso the system (37), is observable, as shown in Section (3.2), and observer canbe added to the model and thereby estimate these immeasurable states. Thismakes stabilization of the system possible using feedback. For future work ex-panding on the control law designed in this report, this should be investigatedmore thoroughly and an observer is suitably added to the model.

Another important matter is that the mathematical model of the quadcoptersmovements in Section (2), is not taking aero-dynamical effects into much con-sideration. Neither friction nor side forces, as for example wind, is includedin the model. If the quadcopter model with its designed control law is imple-mented into reality, the system may very well become unstable if there is, forinstance, windy conditions. Consequently this may in the worst-case cause thequadcopters to crash.

The linearization of the non-linear mathematical model is also a simplifica-tion. First order Taylor expansion is based on not moving to far away from thelinearization point, in this case, the steady point. If the position or the angelsof the quadcopter start changing rapidly, the system may perhaps become un-stable.

In the Section (3) the control law was limited to not controlling the angelsφ and θ, thus is there not much angular control for the quadcopters. Also con-trolling these angels may perhaps be necessary if the formation should be ableto change during flight, something that is not investigated in this report. Whenchanging formation during flight there is risk of the quadcopters crashing intoeach other if the reference track for each unit rapidly changes. More angularcontrol and further investigations may be the solution to this.

Finally it should be noted that the control law designed in this report is basedon controlling ε and thereby the input u, which is dependent on the angularvelocities ω of each rotor on the quadcopter. Thus it is assumed that the angu-lar velocities ω can be controlled directly when in reality they are controlled byelectrical circuits themselves. This must also be taken into consideration if thecontrol law is implemented into a real quadcopter.

6 Conclusion

The purpose has been fulfilled with a successful control law stabilizing eachquadcopter around their referenced track following the formation (the errors

25

Page 27: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

are converging to zero), all verified by proper simulations. The control design issimple by using only state-space feedback for each quadcopter, making it easyto implement into reality. The number of units as well as the formation is easilyvaried since the controller is identical for each unit, it is only the reference thathas to be varied between them. This makes the control law robust since if oneunit, for example the leader, starts malfunctioning, the others will remain unaf-fected when their controller is independent of the other. The reference track foreach unit is calculated with the assumption that all units are functioning well,therefore the reference track for all units will always remain the same duringflight no matter what happens.

In this project the model wasn’t implemented into reality, just simulated inMATLAB R○. As long as the theoretical control law is well designed the simu-lation in MATLAB R○ will be successful. If the control law is implemented in toa real quadcopter however, complications can occur as described in Section (5).

The designed control law could also stabilize the quadcopters around their ref-erence track faster if some kind of pole-placement optimization was used. Asmention in Section (3.4) the poles are just chosen so that they fulfil the require-ments towards stabilization, according to Figure (7), no optimization is reallydone. In the mathematical model, see Section (2, two methods to describe thequadcopters movements was mentioned, using the Euler-Lagrange equations orusing the Newton-Euler equations, the choice became to use the Newton-Eulerequations. This however should not affect the stabilization of the quadcopterssince both of these methods should yield the same result, only the calculationsto obtain it differ.

To conclude, in future work and perhaps development of the control law de-signed in this report, the following could be taken into consideration;adding an observer to the state-space model, controlling all 6 degrees of free-dom of the quadcopter, taking aero-dynamical affects into more consideration,optimizing the pole placement design, investigating how to change formationduring flight and perhaps most important the control law would suitably beimplemented into real quadcopters.

26

Page 28: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

References

[1] Quadcopter Reviews and Information on Droneshttp://quadcopterhq.com/what-is-a-quadcopter/

[2] Teppo Luukkonen, Modelling and control of quadcopter, Aalto University,Espoo, 2011, pp. 2-5.

[3] Torkel Glad and Lennart Ljung, Reglerteknik-Grundlaggande teori(Swedish), Studentlitteratur AB,Lund, 1981,2006, pp. 17-21, 173-176,184-185.

[4] Euler Angleshttp://mathworld.wolfram.com/EulerAngles.html.

[5] Understanding Euler Angleshttp://www.chrobotics.com/library/understanding-euler-angles.

[6] The quadcopter : control the orientationhttp://theboredengineers.com/2012/05/the-quadcopter-basics/.

[7] Nicholas Apazids, Mekanik II (Swedish), Studentlitteratur AB, Lund, 2012.

[8] The quadcopter : control the orientationhttp://sheldonbrown.com/brandt/gyro.html.

[9] Ulf Pilz, Andrey Popov and Herbert Werner, Robust Formation Control ofQuad-Rotor Helicopters, Hamburg University of Technology, Hamburg.

[10] Quadcopterhttp://en.wikipedia.org/wiki/Quadcopter/.

[11] Qasim Ali, Nils Gageik and Sergio Montenegro, A Review on DisturbedControl of Cooperating Mini UAVs, Chair Aerospace Information Technol-ogy, University of Wuerzburg, Germany, 2014.

27

Page 29: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

7 Appendix

Nomenclature

ξ Position of the quadcopter in the inertial system

η The angular positions

ν The angular velocities

φ Roll-movement angle

θ Pitch-movement angle

ψ Yaw-movement angle

RT Transformation matrix for the translational movements

RR Transformation matrix for rotational movement

sx sinx

cx cosx

tx tanx

fi Thrust force of rotor i [m/s2]

k Lift constant [(kg ·m)/s]

ωi Angular velocity of rotor i [rad/s]

ωi Angular acceleration of rotor i [rad/s2]

τM Torque around the rotor axis i [Nm]

b Drag constant [kg ·m]

IM Inertia moment of the rotors [kg ×m2]

TB Total thrust [N ]

τB Torque around centre of mass [Nm]

τφ,θ,ψ Torques in the direction of the corresponding body frames [Nm]

l Distance between rotor and the centre of mass [m]

m Mass of quadcopter [kg]

g Gravitational acceleration [m/s2]

G Gravitational vector

I Inertia vector

Ixx,yy,zz Inertia in the corresponding direction [kg ·m2]

Γ Gyroscopic force [N ]

28

Page 30: Formation Flying for Quadcopters - Divakth.diva-portal.org/smash/get/diva2:853494/FULLTEXT01.pdf · Formation Flying for Quadcopters ... d ar den utformade styrlagen visat sig

ωΓ ω1 − ω2 + ω3 − ω4

x The state variables

u The input signal

y The output signal

e The error signal

29