You are on page 1of 2

Modelling JDrones Hexacopter with Simulink

Roman Hofstetter
March 16, 2013

1 Model of the Copter


Note that the numbering of the blades is different in this model than in Ar-
ducopter.

6 4

1.1 Equations
The earth frame E has x to the front, y to the left and z up. First it is turned
with around the z-axis, next with around the new y-axis and finally with
around the again new x-axis. Over Lagrange II one can get the following
equations:
x = b lC sin(60 ) 23 + 26 24 25


y = b lC 22 21 + cos(60 ) 23 + 25 24 26
 

z = d 21 + 23 + 25 22 24 26


r = 2 + 4 + 6 1 3 5
1 h i
= (Iyy Izz ) Jr r + x
Ixx
1 h i
= (Izz Ixx ) + Jr r + y
Iyy

1
1 h i
= (Ixx Iyy ) + z
Izz
" 6
#
1 X
2
x = [cos() sin() cos() + sin() sin()] b i
mC i=1
" 6
#
1 X
y = [sin() sin() cos() cos() sin()] b 2i
mC i=1
" 6
#
1 X
z = [cos() cos()] d 2i g
mC i=1

2 Modelling the controller


First the three angles and the translation in z-axis should be stabilized. Looking
at these four equations, one can sum up the input of the system as follows:

U1 = b(21 + 22 + 23 + 24 + 25 + 26 ) (1)

3 2
3 24 25 + 26

U2 = b lC (2)
 2 
2 2 1 2 2 2 2

U3 = b lC 1 + 2 + 4 + 5 6 (3)
2 3
U4 = d(21 22 + 23 24 + 25 26 ) (4)

So now for instance the PID for controlling the pitch angle will return us U3 .
To get the commands sent to the ESCs the above equations need to be inverted
and solved for each 2 . In the Arducopter code this is done like this:

roll f actor = cos(angle+90 ) pitch f actor = cos(angle) yaw f actor = direction

For the hexa setup this results in the following solution. Note that the equations
are written in my model. This means, that my rotor six is Ardus number five
and my pitch is positive for forward flight.
2 1 1 1

1 0
22 1
0 1 1
U1
2 3 1
3 1 2 2 1 U2
2 = 3 1 (5)
4 1
1 U3
2 2
2
5 1 3 1
1 U4

2 2
26 1 3
1
1
2 2

You might also like