0% found this document useful (0 votes)
124 views

Quadcopter Simulation: Jose Carlos Lopez

The document summarizes the derivation of equations of motion for a quadcopter. It begins by describing the quadcopter's kinematics and coordinate frames. It then details the physics behind the quadcopter's brushless motors and how they produce torque and thrust based on current and angular velocity. Finally, it presents the equations that model the total thrust and drag forces acting on the quadcopter based on the individual motor properties.

Uploaded by

imran5705074
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Quadcopter Simulation: Jose Carlos Lopez

The document summarizes the derivation of equations of motion for a quadcopter. It begins by describing the quadcopter's kinematics and coordinate frames. It then details the physics behind the quadcopter's brushless motors and how they produce torque and thrust based on current and angular velocity. Finally, it presents the equations that model the total thrust and drag forces acting on the quadcopter based on the individual motor properties.

Uploaded by

imran5705074
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Quadcopter Simulation

Jose Carlos Lopez

Abstract - The equations of motion for a quadcopter A. Kinematics


are derived, starting with the voltage torque relation
for the brushless motors and then going through the The position and velocity of the quadcopter are

Ű̇ = (Ű̇ , ű̇ , Ų̇ )T. The roll, pitch and yaw angles are in the
quadcopter kinematics and dynamics. Aerodynamic defined in the inertial frame as x = (x,y,z)T and

body frame as Ŵ =(Ź, Ŵ, ŷ)Ƃ , and the angular


effects like blade-flapping and non-zero free streem

velocities are equal to Ŵ= ̇ ƚŹ ̇ , Ŵ,̇ ŷ ̇ Ɯ. The angular


Ƃ
velocity are ignored but air friction as a linear drag

velocity vector Ÿ ≠ Ŵ.̇ The angular velocity is a vector


force in all directions is included. A simulation is

pointing along the axis of rotation, while Ŵ̇ is just the


created using the equations of motion in order to test
and visualize quadcopter control mechanisms. A PID
controller (with minor modifications to prevent wind- time derivative of yaw, pitch, and roll. The rotation
up) is applied on the quadcopter to make it robust matrix in (1) is needed to convert these angular
against disturbances. velocities into the angular velocity vector.

Ÿ = Ɩ0 śŹ śŴŢŹ ̇ ƘŴ
I. INTRODUCTION 1 0 −ŢŴ
A quadrotor helicopter (quadcopter) is a helicopter (1) 0 −ŢŹ śŴśŹ

Where Ÿ is the angular velocity in the body frame. In


that has four rotors that are spaced equally from each
other. They are usually at the corners of a square body.
Quadcopters have become really popular recently order to go from the body frame to the inertial frame
because of the increase in technology. In the past it was the rotation matrix in (2) is used. This matrix is derived
very difficult to control four independent rotors without using the ZYZ Euler angle conventions.

śŹśŷ − śŴŢŹŢŷ −śŹŢŹ − śŹśŴ Ţŷ ŢŴŢŹ


electronic assistance. Because microprocessors have

š =Ɩ śŴśŷŢŹ śŹśŴśŷ − ŢŹŢŷ


become far less expensive, electronic and autonomous
ŢŹŢŴ śŹŢŴ śŴ
−śŷŢŴƘ (2)
control of quadcopters has become possible for
commercial, military, and personal uses.
Controlling quadcopters is a difficult but interesting B. Physics
problem. They have six degrees of freedom, three
An understanding of the physical properties that
translational and three rotational, but only four
govern the system are needed in order to properly
independent inputs (rotor speeds), thus creating an
model the dynamics of the system. First a description
underactuated system. Translational and rotational
of the motors being used will be given, and then energy
motion is couples in order to achieve six degrees of
will be taken into account to derive the forces and
freedom. This results in highly nonlinear dynamics,
thrusts that the motors produce on the entire
especially when taking into account complicated
aerodynamic effects. quadcopter. Since all the motors on the quadcopter are
identical only on will need to be analyzed. The
II. QUADCOPTER DYNAMICS propellers are configured in a way that the adjacent
propellers spin in opposite directions of each other.
There are two coordinate frames that the quadcopter This balances the torques if all the propellers are
will operate in. The inertial frame is defined by the spinning at the same rate.
ground with the z direction pointing opposite of
gravity. The body frame is attached to the orientation C. Motors
of the quadcopter with the rotor axes pointing in the
All quadcopters use brushless motors. The torque
positive z direction and the arms pointing in the x and y
produced in an electric motor is given by (3).
directions.
Ŷ = Ūƈ(ŝ − ŝ ź )
ţ
ŤƄ = Ɵƛ Ɲ
(3)

Where Ŷ is the motor torque, I is the current input, I0 is


(9)
2ŵŚ

in (9) ŵ is the density of the surrounding air and A is


the current with no load on the motor, and kt is the
torque proportionality constant. The voltage that is
measured across the motor is equal to the sum of the the area swept out by the rotor. Combining (7) and (9)
back-EMF and resistive loss as shown in (4). results in (10).

Ť = ŝšƆ + Ş Ɖ Ÿ (4) Ž
ţż
Š =
ƞ2ŵŚ
(10)

motor resistance, Ÿ is the angular velocity of the


Where V is the voltage drop across the motor, Rm is the

constant ratio ŪƎ determined by the blade configuration


Where the torque is proportional to the thrust T by a
motor, and kv is a proportionality constant (indicating
back-EMF generated per RPM). Using (3) and (4) the
and parameters. To solve for the thrust magnitude T, it
power the motor consumes can be calculated as shown
is found that thrust is proportional to the square of
in (5).

(Ŷ + Şƈ ŝź )(Şƈ źŝ šƆ + ŶšƆ + Şƈ Ş Ɖ Ÿ)
angular velocity of the motor as shown in (11).

Š = ŝŤ = ż
Şƈż ŪƉƎŞƞ2ŵŚ
ţ =ƨ ŸƩ = ŪŸż
(5)

Ūƈ
(11)
To simplify the model, the motor resistance in (6) is
neglected. If all the motors are summed, the total thrust on
(Ŷ + Ūƈŝ ź )Ş Ɖ Ÿ
Š=
the quadcopter in the body frame is given by (12).
Şƈ
(6)

ţƀ = Ū ƪ ƫ
0

ơ Ÿƅż
0
assumed to be much smaller than Ŷ which is reasonable
In simplifying the model even further, the term k tI0 is (12)

since I0 is very small. So the final simplified equation


for power is shown in (7). Along with the thrust force, friction as a force

ŞƉ
proportional to the linear velocity is modeled. (13) is a

Š= ŶŸ
Şƈ
simplified model of fluid friction, but will be good
(7)
enough for the model.

D. Forces ŜƁ = [−ŪƃŰ̇ , −Ū ƃű̇ , −Ūƃ Ų̇]Ƃ (13)

From conservation of energy, the energy the motor E. Torques


expends in a given time period is equal to the force
generated on the propeller times the distance that the All the forces acting on the quadcopter have been
air it displaces moves. equivalently, the power is equal computed, now the torques will also be computed.
to the thrust times air velocity as shown in (8). Each rotor adds torque about the z body z axis. This

Š = ţŤƄ
torque is the torque required to keep the propeller
(8) spinning while providing thrust. The drag equation
form fluid dynamics is used in (14).
Assuming vehicle speeds are low, so Vh is the air
Ŝƃ = ŵśƁ Śů ż
velocity when the quadcopter is hovering. The 1
(14)
free stream velocity is also assumed to be zero. 2
Momentum theory gives the equation for hover Where ŵ is the surrounding fluid density, A is the
velocity as a function of thrust. propeller cross section and CD is a dimensionless
ŸƊ̇
Ÿ̇ = ƪ Ƌ̇ ƫ = ŝſŻ ƚŶ − Ÿ × (ŝŸ)Ɯ
Ÿ
constant. Then the torque due to the drag is given by

Ÿƌ̇
(15) . (20)

ŶƁ = šŵśƁ Śůż = šŵś Ɓ Ś (Ÿš)ż = ťŸż (15)


1 1
Where Ÿ is the angular velocity vector, I is the moment
of inertia, and Ŷ is a vector of external torques. To
2 2
Where Ÿ is the angular velocity of the propeller, R is
obtain I, the quadcopter is modeled as two thin uniform
the radius of the propeller, and b is a constant. The total
rods crossed at the origin with a point mass (motor) at
torque about the z axis is given in (16) by summing of
the end of each rod. This produces (21) a diagonal
all the torques from each propeller.

ŶƏ = ť(ŸŻż − Ÿżż + ŸŽż − Ÿžż )


inertia matrix.

ŝƊƊ
(16)
ŝ =ƪ 0 ŝƋƋ 0ƫ
0 0

ŝƌƌ
The roll and pitch torques are taken from standard (21)
mechanics. The pitch torque is given by (17). 0 0

ŶƐ = şŞ(ŸŻż − ŸŽż ) (17) The final equation for the rotations in the body frame
are found in (22).

ŝƋƋ − ŝƌƌ
ŸƋ Ÿƌ ⎤
Where L is the distance from the center of the

ŶƐ ŝƊƊ ŝ
quadcopter to any of the propellers. Adding all of these
ƊƊ

⎢(ŝƌƌ − ŝƊƊ )
ſŻ
Ÿ̇ = ƗŶƍ ŝƋƋ
ſŻ ƙ − ⎢ ŸƊ Ÿƌ ⎥
together gives (18), total torques in the body frame. ⎢ ⎥

şŞ(ŸŻż − ŸŽż ) ŝƋƋ


ŶƏ ŝƌƌ
(22)
Ŷƀ = ƪ şŞ(Ÿżż − Ÿžż ) ƫ ſŻ
⎢ ƊƊ − ŝƋƋ Ÿ Ÿ ⎥
ŝ
⎢ ⎥
ť(ŸŻ − Ÿż + ŸŽ − Ÿž )
ż ż ż ż
ŝƌƌ
(18)
Ɗ Ƌ
⎣ ⎦
This model that has been derived is a highly simplified III. CONTROL
model. Many advanced effects are ignored that make
the model highly nonlinear. Rotational drag forces, The purpose of getting a mathematical model of a
blade flapping, wind, etc. are ignored. quadcopter is to help develop controllers for real
quadcopters. The inputs of the system are the four
F. Equations of Motion angular velocities of the rotors. The system can be
written as a first order differential equation in state
The acceleration of the quadcopter in the inertial
space form as shown in (23).
frame is due to thrust, gravity, and linear friction. So
Ű̇Ż = Űż
the linear motion can be expressed by (19).

Ű̇ż = Ɩ 0 Ƙ + šţƀ + ŜƁ
0
ūŰ̈ = Ɩ 0 Ƙ +šţ +Ŝ ū−ũ ū
0 1 1
ƀ Ɓ(19)
−ŢŴ ſŻ
śŹ śŴŢŹ
−ūũ
Ű̇Ž = Ɩ Ƙ Űž
1 0

0 −ŢŹ śŴśŹ
0 (23)
Where x is the position of the quadcopter, g is the
ŝƋƋ − ŝƌƌ Ÿ
ŸƋ ƌ ⎤
acceleration from gravity, F D is the drag force, and T B
ŝƊƊ
ŶƐ ŝƊƊ
is the thrust vector in the body frame. ⎡

⎢(ŝƌƌ − ŝƊƊ ) Ÿ ⎥
ſŻ
ŝ
Űž̇ = Ɨ Ŷƍ ƋƋ ŸƊ ƌ ⎥
⎢ ⎥
ſŻ ƙ −
It is helpful to have the linear equations of motion in
ŝƋƋ
ŝ
ŶƏ ƌƌ
the inertial frame, but the rotational equations of

⎢ ŝƊƊ − ŝƋƋ ŸƊ ŸƋ ⎥

motion are more easily written in the body frame, so ſŻ ⎢ ⎥

ŝƌƌ
that rotations can be expressed about the center of the
⎣ ⎦
quadcopter. The rotational equations of motion are
found in (20) which are derived from Euler's equations
for rigid body dynamics.
where x1 is the quadcopter position, x2 is the linear Where ųƅ is the angular velocity of each motor squared,
velocity, x3 is the roll, pitch and yaw angles, and x4 is and e is the error. The errors are calculated in (28).
Ƃ Ƃ Ƃ
the angular velocity vector. All of these are vectors
ŨƐ = Ū ƃŹ ̇ + Ū ƇƠ Ź ̇ ŧŮ + Ūƅ Ơ Ơ Ź̇ ŧŮŧŮ
with three elements.
ź ź ź
Ƃ Ƃ Ƃ
In order to control the quadcopter, a PID controller

Ũƍ = Ū ƃŴ+
̇ Ū ƇƠ ŴŧŮ̇ + Ūƅ Ơ Ơ Ŵ̇ ŧŮŧŮ
will be used, with a component proportional to the
(28)
ź ź ź
error between the desired trajectory and the observed
Ƃ Ƃ Ƃ
ŨƏ = Ū ƃŷ ̇ + Ū Ƈ Ơ ŷ ̇ ŧŮ + Ūƅ Ơ Ơ ŷ̇ ŧŮŧŮ
trajectory, and a component proportional to the
ź ź ź
derivative of the error. The quadcopter will be
stabilized in a horizontal position, so the desired
velocities and angles will all be zero. The torques will IV. SIMULATION
be set proportional to the output of the controller as
shown in (24). With the complete equations of motion and the
controller in place, a simulation was built using
Ƃ
⎡−ŝƊƊ(Ū ƃŹ ̇ + ŪƇ Ơ Ź ̇ ŧŮ⎤
simulink as shown in Fig. 1 and Fig. 2.

ŶƐ
ź
Ƃ
⎢ ⎥
Ɩ Ŷƍ Ƙ = ⎢−ŝ ƋƋ (ŪƃŴ+̇ ŪƇ Ơ Ŵ̇ ŧŮ
⎢ ⎥
ŶƏ
(24)
ź

Ƃ
⎢ −ŝ (Ū ŷ ̇ + Ū Ơ ŷ ̇ ŧŮ⎥
⎢ ⎥
ƌƌ ƃ Ƈ
⎣ ź ⎦

Previously the relationship between torque and the


inputs were derived which leads to (25).
Ƃ
⎡−ŝƊƊ(Ū ƃŹ ̇ + ŪƇ Ơ Ź ̇ ŧŮ⎤
Fig. 1. Simulink Model

şŞ(ŸŻż − ŸŽż )
ź
Ƃ
⎢ ⎥
Ŷƀ = ƪ şŞ(Ÿż − Ÿž )
ż ż ƫ = ⎢ −ŝƋƋ(Ū ƃŴ+̇ ŪƇ Ơ Ŵ̇ ŧŮ ⎥(25)
⎢ ⎥

ť(Ÿ
Ż −Ÿ + ż Ÿ − Ž Ÿž
ż ż ż ż ź
Ƃ
⎢ −ŝƌƌ(Ū ƃŷ̇ + ŪƇ Ơ ŷ ̇ ŧŮ⎥
) ⎢ ⎥

⎣ ź ⎦

This gives three equations with four unknowns. The


fourth equation is found by setting the inputs to keep
axis
the quadcopter hovering, so that T = mg. The thrust Z

points along the positive z axis which leads to (26).

ūũ
ţ=
ŦŬŭŴŦŬŭŹ
(26)

four unknowns ųƅ are obtained as shown in (27).


With this extra constraint, four linear equations with ¥ axis X axis

ūũ 2ťŨƐŝ ƊƊ + ŨƏŝ ƌƌŪş


Fig. 2. Quadcopter Simulation

ųŻ = −
ūũ Ũ ŝ ŨŝƋƋ
4ŪŦŬŭŴŦŬŭŹ 4ťŪş
ųż =
Ə ƌƌ ƍ
+ −
ūũ −2ťŨƐŝ ƊƊ + ŨƏŝ ƌƌŪş
4ŪŦŬŭŴŦŬŭŹ 4ť 2Ūş
ųŽ = − (27)
ūũ ƏŨŝƌƌ ƍŨŝƋƋ
4ŪŦŬŭŴŦŬŭŹ 4ťŪş

ųž = + +
4ŪŦŬŭŴŦŬŭŹ 4ť 2Ūş

You might also like