Euler Angles
Preface.
One of the central problem in a flight simulator is the correct determination in every instant of all the cinematic parameters of the Aircraft: this includes position (according to a defined reference system), velocity and acceleration both linear and angular.
This implies the resolution of the differential equations of the motion of the aircraft, once some key parameters are known, like all data related to mass, aerodynamics and engine(s), parameters available only with the collaboration of the aircraft manufacturer.
While the resolution of the problem related to linear position, velocities and accelerations is trivial, the same problem related to the angles (aircraft attitude) presents some peculiarities which need some analysis.
A proper reference system.
As a first step let’s define a reference system for the problem under investigation: the universally accepted reference system in aeronautical matters is the following:
-
generally the origin is the center of gravity of the aircraft
-
the x axis is forward, the rotation around the x axis is named “roll” and the angle of roll is named φ or ɸ (phi)
-
the y axis in along the right wing, the rotation around the y axis is named “pitch” and the angle of pitch is named ϑ or θ (theta)
-
the z axis is downward, the rotation around the z axis is named “yaw” and the yaw angle is named psi (ψ)
All those angles (together with the AoA (Angle of Attack or Incidence ) are of paramount importance for the pilot in order to understand where he is going with the aircraft and above all how the aircraft is positioned respect to the ground (attitude), and need to be shown to the pilot in the cockpit in several redundant way depending on the type of aircraft: on the HUD (Head Up Display), and/or on the MHDD (Multifunction Head Down Display), and/or on the EFIS (Electronic Flight Instrument System), and/or on the ADI (Attitude Director Indicator), etc. They need to be carefully calculated in every condition.
The angles defined above are commonly referred as the "Euler angles", from the famous mathematicians of the 18th century who defined them first.
It is very important to add that by convention, changing from one attitude to another is described applying three different rotations: the first rotation by an angle ψ around the Z axis, then the rotation of an angle θ around the Y axis and finally a rotation of an angle φ around the X axis. The exact sequence of rotations is part of the reference system definition and defines the Euler angles, as standardize in the aeronautical world (in fact the same changes in attitude can be described choosing different sequence of rotation with different angles’ values).
Auxiliary reference system
Now let’s pose the following question: is there a standard definition (absolute definition) for an attitude defined as
The answer is obviously “yes”, and this condition represent an auxiliary reference system in the real world, that we can think always linked to the aircraft, with the x axis oriented to north , the z axis oriented towards the center of the earth and the y axis oriented toward east direction. If we start “measuring” the
Angular velocities
Attitude changes happen when one or more Euler angles change over time, that is when the aircraft is subject to a rotational velocity. Let’s define the three angular velocities associated to the Euler angles as:
psidot angular velocity vector around z axis
thetadot angular velocity vector around y axis after psi rotation
phidot angular velocity vector around x axis after psi rotation and theta rotation
psidot, thetdot and phidot can be represented as three vectors, whose directions represent the rotational axis and the direction of rotation (according to the right hand rule), and the length represent the value of the rotational velocity.
It’s important to say that phidot, thetadot and psidot are not the three component of the global angular velocity vector responsible for changing the attitude of the aircraft, because they are defined in three different reference systems.
The following video explains better the above concept.
As a side note, I developed the software which displays the animation in C/C++ with the support of the OpenSceneGraph Libraries. Who is interested on the source code can contact me. The model is the Development Aircraft (DA) 7, the seventh prototype of Eurofighter, in charge of Alenia (now Leonardo) where I worked many years in the System Operability and Simulation department, where we were in charge to provide simulation tools (real time Flight Simulators) in support of Aircraft development. The 24th of January 1997 was a very exciting day, when DA7 took off for the maiden flight handled by Maurizio Cheli. I remember the work done with Maurizio in preparing the Display for the 1997 Paris air show on Alenia EF Flight Simulator and all the facilities we developed in order to give him the best to prepare the Display, including an accurate reconstruction of the Le Bourget airport to give him the write references to perform correctly the planned maneuvers respecting the assigned space and time.
Coming back to our problem, the described model (Euler Angles) does not represent the real evolution of the aircraft, that normally changes its attitude according to the instantaneous overall angular velocity represented by a vector as explained later, and not with 3 different sequential rotations. But, as already written in the Euler Parameters post, according to the Euler's rotation theorem, the 3 subsequent rotations can be seen as single overall rotation, and vice versa.
Let’s now define:
The three components of
P component of
Q component of
R component of
Of course there is a strict relationship among P, Q, R and phidot, thetadot and psidot, as explained later on.
Euler angles rotation matrices
Let’s now consider the aircraft oriented as the auxiliary reference system (defined above) i.e. with
As a first step let’s apply the first rotation of an angle
This defines a new intermediate reference system that we label X1Y1Z1. The situation is described in the following video, where the aircraft is looked at from below.
In the video we highlight the point P, that in the XYZ reference system has coordinates (0.0,yp,0.0).
From the video is quite obvious that the same point P, in the X1Y1Z has coordinates (yp*sin(ψ),yp*cos(ψ),0.0). Adopting a matrix notation, we can write:
Considering that the rotation is around Z axis, the z coordinates during transformation remain unchanged. This means that c31=c32=0, and c33=1. In addition the matrix is unitary and orthogonal and this ensure that c23=c13=0. So our problem becomes
From the above matrix expression is evident that c12 = sin(ψ) and c22=cos(ψ) and thus
But for the orthogonality condition we have
and for unitary condition
Solving the two condition leads to:
c11=cos(ψ), c21=-sin(ψ)
The transformation matrix becomes:
and x1, y1, and z1 are the coordinates of P in the intermediate reference system X1Y1Z1
Now let’s apply a second rotation of an angle
And now to achieve our result, let’s apply the final rotation of an angle
In order to pass from the original coordinates in the original reference systems to the coordinated in the XvYvZv reference system, we need to substitute relation 1) in 2, then relation 2) in 3), obtaining:
where
We omit the boring work to perform operation in 5), giving just the result, leaving the reader to verify it (and anyway the result can be found in thousands of paper surfing the internet):
Now we have all instrument to put in relation psidot, thetadot and phidot with P,Q and R
Angular velocities relationships
As first approach we try to solve the problem to know the Euler angles, starting from the angular velocities ( psidot, thetadot and phidot). If I know the angular velocities, I should be able, in some way, to find the relative angles, with some sort of integration process. Let’s solve this problem.
As a first step, we need to “transport” all the three velocities in the same reference system. In fact, as explained previously and shown in a previous movie, the three velocities are defined in three different reference system: in order to operate on them all three must be ported in the same reference system, like the last after all three rotations. Fortunately we have the instrument to do that by means of the transformation matrices just defined.
Let’s start considering that for phidot we don’t need to do anything, being phidot already defined in the (Xv, Yv, Zv). Remember that phidot is responsible for the final rotation around the X axis, from (X2, Y2, Z2) to (Xv, Yv, Zv), but having phidot only the X component, it remains unchanged during rotation. The vector phidot , in the reference system (Xv, Yv, Zv), has thus the expression
As far as thetadot is concerned, we need to apply the theta transformation to transport it in the (Xv, Yv, Zv) reference system, i.e:
To transport psidot we need to apply the complete transformation matrix. Anyway, let’s consider that psidot has only the third component different from 0 whose value is
Now the three angular velocities are defined in the same reference system. Summing up (vectorially) these three velocities results in the total angular velocity, whose components are, by definition, P,Q and R, as defined at the beginning of this post.
We can thus write:
From 10) the following equation can be derived:
Fantastic, we reach some results! We have now a relationship which links (P,Q,R) and
Relation 12) is in form
If we left multiply the first and second member of 13) by M-1 we have:
We need to find the inverse of matrix M. It is not a big problem: we need first to obtain the transpose matrix of M, then to make its adjoint matrix a then divide all the members by the determinant of M. Applying these rules leads to:
which leads to the following system of differential equations:
From equation 16a), 16b) and 16c) it is evident the difficulty to solve the problem (remember: find
From Matrix transformation to Euler angles
The work done in this post has not been a waste of time, and it will be useful as soon as we develop a new strategy to solve the problem in the following posts. Let’s assume now to manage to calculate the matrix 6) (
we would have immediately that
Remember also that we are looking for solution able to be integrated in a numerical computer: in all modern HLL (High Level Language) there is the built-in mathematical instruction atant2(x,y) to calculate the
Comments