Kinematic equations in generalized coordinates. Euler, Krylov angles, quaternions

rotary motion solid body around a fixed point its movement is called, in which one point of a rigid body or invariably connected with it remains motionless relative to the chosen reference frame. It is also called spherical motion, since the trajectory of any point of the body lies on the surface of a sphere centered at a fixed point. An example of such a movement is a top, which has a fixed fulcrum.

The number of degrees of freedom of a rigid body freely moving in space is six. If during the movement of the body one of its points remains fixed, then the number of degrees of freedom of such a body during its rotation around this fixed point will be three, and to estimate its position, three independent parameters must be set. This can be done in various ways. For example, A.N. Krylov proposed the so-called ship angles as such parameters, which determine the position of a rigid body (ship) relative to the coordinate system associated with its origin with its center of gravity (Fig. 3.1).

The axes of the fixed coordinate system are taken CXYZ, and for the axles rigidly connected with the ship - Cxyz(Fig. 3.1). Axis SH directed from the stern to the bow of the ship, the axis cz- to its starboard side, and the axis CY forms a right coordinate system with them (vertically upwards). Position of the moving coordinate system Cxyz, invariably associated with the ship, relatively immovable CXYZ for each moment of time is determined by three Krylov angles: trim angle ,bank angle ,yaw angle (Fig. 3.2).

As seen in fig. 3.2, plane CXY crosses the plane xy along some line forming an angle with the axis CX and angle with axle Cx. Plane CYZ crosses the plane Cxy polylines Cy 1 forming an angle with the axis Cy. Consider the transition from the system CXYZ to the system Cxyz made with three turns.

To match the system CXYZ with the system Cxyz enough:

1) rotate system CXYZ around the third of the coordinate axes cz to the trim angle, as a result of which we get the system Cx 1 y 1 z 1 , and cz 1 =cz(Fig. 3.3);

2) rotate the system around the first of the coordinate axes by a roll angle , as a result of which we obtain a system , while (Fig. 3.4);

3) rotate the system around the second of the coordinate axes by the yaw angle (Fig. 3.5), as a result of which we arrive at the system Cxyz.

Coordinate transformation formulas are related by the following relations:

1) from CXYZ to (Fig. 3.3)

X = x 1 cos y - y 1 siny + 0 ,

Y =x 1 sin y + y 1 cos y + 0 , (3.1)

Z = 0 + 0 + z1,

or in matrix form:

[X] =( a 3 y ) t [ x 1 ] , or , (3.2)

where is the matrix transposed to the matrix describing the rotation of the system CXYZ around the third coordinate axis СZ to the trim angle y,

; (3.3)

2) from system to system (Fig. 3.4)

x 1 = x 2 + 0 + 0 ,

y 1 = 0 + y 2 - z 2 , (3.4)

z 1 = 0 + y 2 +z 2 ,

or in matrix form

[x 1 ] = [x 2] , or , (3.5)

where is the matrix transposed to the matrix , which specifies the rotation transformation from the system axes to the system axes around the first of the coordinate axes by the roll angle , with = ,

; (3.6)

3) from coordinate system to system Cxyz(Fig. 3.5)

x 2 = x cos j + 0 + z sinj,

y 2 = 0 + y + 0 , (3.7)

z 2 = -x sin j + 0 + z cosj,

or in matrix form [ x 2 ]= [x], or

. (3.8)

Moreover, the rotation matrix (a 2 j ) t is the matrix transposed to the matrix ( a 2 j ), which specifies the rotation transformation from the system axes to the system axes Cxyz by the yaw angle j around the second of the coordinate axes = , has the form

. (3.9)

For any point M bodies with coordinates x,y,z in a moving coordinate system, rigidly connected with it, and with its own coordinates X,Y,Z– in a fixed coordinate system, it is possible to establish the relationship of the projections of the point vector on the axes of two coordinate systems,

, (3.10)

or in matrix form

or , (3.11)

where the Krylov angles are some functions of time: trim angle , bank angle , yaw angle .

The matrix is ​​transposed to the direction cosine matrix , which defines the rotation transformation from the axes of the fixed system CXYZ to the axes of the moving system Cxyz, invariably associated with the ship. Obviously, when the body moves, the coordinates x,y,z remain constant in contrast to the coordinates X,Y,Z.

Substituting relations (3.5) and (3.8) into (3.2), we obtain:

Comparing (3.11) and (3.12), we find that the desired matrix is ​​the product of three rotation matrices

=

=

.(3.13)

Substituting relation (3.5) into (3.2), we obtain an intermediate relation, which may be needed later, [ X] = [x 2]. The intermediate rotation matrix = is found as the product of two rotation matrices:

=

= (3.13a)

Euler angles

In cases where the angular velocity of rotation in one direction is much greater than in the other two (generators, motors, turbines, gyroscopes), three Euler angles are chosen as three independent parameters to determine the position of the body: precession angle y (t),nutation angle q (t)and angle of rotation (natural rotation) j (t). Their names are borrowed from astronomy.

To set these angles, consider the rotation of a rigid body around a fixed point O. Let some reference system and the fixed coordinate system associated with it be given OXYZ, relative to which the rigid body moves, and the coordinate system associated with the rigid body Oxyz, which moves relative to the first one (Fig. 3.6 ... 3.8). This means that the first and second coordinate systems have a common origin O, and the angles formed by the axes Oxyz with axes OXYZ, change, i.e. system Oxyz
rotates with the rigid body around a fixed point O(Fig. 3.5 ... 3.8).


Rice. 3.6

Kinematic equations in generalized coordinates. Euler, Krylov angles, quaternions.

In the course of theoretical mechanics, spherical motion was given by Euler angles (Fig. 1.2) - the precession angle y (rotation around a fixed axis Oz), nutation angle q (rotation around a semi-movable axis OK- lines of intersection of planes Oxy and Oξη, called the line of nodes) and the angle of proper rotation j (rotation around the axis associated with the body Oz).

Rice. 1.2. System of orientational Euler angles of a rigid body

The Euler angles are listed here in the order of the turns to be made over a fixed frame. Oxyz so that it is compatible with the mobile SC Oξηζ. The use of Euler angles in spherical motion was done to demonstrate the fundamental possibility of solving the corresponding problems of kinematics. Here we have the task of describing such a movement more optimally. Kinematic relations expressing the projections of the angular velocity of the body on the axis of the coupled SC through the angular velocities of the indicated angles are represented for the Euler angles by the formulas (verified with the KIDIM program):

(1.1)

Despite the brevity of such a specification of the position of a body during spherical motion (3 degrees of freedom, 3 coordinates), it is rarely used in modern mechanics. This is explained, in particular, by the fact that the formulas for calculating the generalized velocities through the projections of the angular velocity of the body (inverse kinematic relations) contain singularities and are asymmetric, which complicates the analysis of the results and leads to computational errors. For Euler angles, these relationships are represented by the formulas:

(1.2)

It is more preferable to use Rodrigues-Hamilton parameters, quaternions, Cayley-Klein parameters.

Let's prove d'Alembert-Euler theorem.

Moving a body having a fixed point from one position to another can be done by turning around some axis passing through the fixed point.

The movement of the body is completely determined by the movement of any triangle belonging to the body. Therefore, for spherical motion, this is equivalent to the motion of two points on some sphere whose center coincides with a fixed point, or the motion of an arc connecting these points. Let us assume that as a result of the movement of the body in time D t some point BUT moved across the sphere to a position AT(Fig. 1.3). At the same time, the point that was in position AT, took a new position With.

Rice. 1.3. Plane ABC intersects a fixed sphere in a circle (small or large circle). If a D one of the poles of this circle on the sphere, then , because they are isosceles spherical and , since they are two positions of the same arc of the sphere AB. by construction (equidistant from the pole). Therefore, it can be aligned with by rotation around the axis OD on the corner adb. The theorem has been proven.

Rodrigues-Hamilton parameters. To specify such a rotation, which we will call end turn of the body, obviously, you need to set the position of the axis, direction and angle of rotation. The axis of rotation can be set by a unit vector directed in the direction from which the rotation of the body will be observed counterclockwise. This vector is determined by its projections on the axes of some SC (the direction cosines of its angles with the axes of this SC). Thus, the final rotation is determined by four scalar quantities - the projections of the unit vector of the axis and the value of the angle of the rotation itself around this axis.

To set these four quantities, we use the Rodrigues-Hamilton parameters, which we denote here λ 0 , λ1 , λ2 , λ 3 . The last three parameters are usually combined into a vector =(λ 1 , λ2 , λ 3 ) T. Thus, we will consider a set of scalar and vector quantities λ 0 , . These parameters are entered through the end turn elements and can be defined as follows. Let be the directing vector of the axis around which the rotation is made, and ψ be the value of the angle of rotation. Then

Educational program on quaternions, part 7: integration of angular velocities, Euler-Krylov angles February 27th, 2018

Integration of angular velocities

So we finally got to the main purpose of the quaternions - to the task that they perform most worthily and where no alternative is expected to them.

To begin with, we are kicking a dead horse, in the sense of the Euler and Krylov angles, but one must understand what made people study and apply such an esoteric thing as quaternions (three imaginary units, four-dimensional space, half angles) - couldn’t it have been possible to do with a course-roll -pitch!?

The task is as follows: we know the orientation of our product at the initial moment of time, and we have angular velocity sensors (AVS). These can be old-fashioned mechanical sensors based on gyroscopes (they were miswired on the infamous Proton), or microelectromechanical (MEMS) sensors, or more accurate fiber optics, or laser sensors. The last two are stubbornly called gyroscopes, and indeed, the light runs in a circle there, but this name is still not entirely correct. Using the readings of these sensors, we must track exactly which turn the product has made, in other words, track its orientation.

We hope that the reader already understands that accumulating angles independently along each of the sensor axes is a completely wrong approach. Let's take for example the rotation of the aircraft, considered in.

Initially, the aircraft was flying with zero roll, pitch and heading. He then made a 90-degree bank turn, then a 90-degree yaw turn. As we saw earlier, after these two turns, the plane began to fly vertically down, that is, its pitch became equal to -90 °, although we did not make any turns directly along the pitch axis!

In addition, this orientation of the aircraft exhibits the phenomenon of "frame folding" or "hinged lock". According to GOST 20058-80 and similar DIN 9300 and ISO 1151-2:1985, when we say that the aircraft has a certain heading, pitch and roll, this means: the corresponding orientation in space will be achieved if we start from a horizontal position to the north, then we turn the plane along the course, after that - in pitch and, finally, in roll (see figure). When the pitch is ±90° (the aircraft is "looking" vertically up or vertically down), heading and roll begin to work the same way (heading 0° and bank 90° will give the same attitude as heading 90° and bank 0°, and indefinitely many other combinations), which is called frame folding. If we assume that in this orientation the heading is 90°, and the roll is zero (this is how it is recommended to resolve the ambiguity), then an arbitrarily small turn of the aircraft along the course (in the sense, towards the wing, i.e. when working with the rudder) will force jump heading to 0°, bank to 90°, and the pitch will decrease by this smallest turn. "Jumpy" means an infinite derivative at that point - and this is clearly not good ...

Another unexpected obstacle: books on theoretical mechanics deal with Euler angles and Krylov angles. Euler angles have names: precession, nutation, proper rotation - they have found their way into the description of rapidly rotating things.

Krylov's angles: yaw, trim, roll. Yaw is the same as heading, trim is the nautical term for pitch. It seems that the course-pitch-roll familiar to us is the Krylov angles.

It wasn't there.
Here is how Krylov angles are defined:


(struggled with the temptation to photoshop a swan, crayfish and pike here, pulling in three mutually perpendicular directions)

Here is a quote from the book of Branz V.N. and Shmyglevsky I.P. - Application of quaternions in problems of orientation of a rigid body (1973), p. 79:

The first rotation is performed around the i 3 axis by the heading angle φ, the second rotation occurs along the i` 2 axis by the roll angle ψ, and the third - around the e 1 axis by the pitch angle ϑ.

We can notice that the rotations are not done in the same order as before. The angles determined in this way also have the right to exist, and with small roll and pitch deviations they will not differ from those previously introduced, but already at angles characteristic of civil aviation aircraft, the difference will be noticeable.

Let's take a “degenerate” example after all - the plane flew upside down, while in order not to fall down, it turned its nose up a little. When we describe the position of the aircraft through the Krylov angles, it turns out that the aircraft is flying with a negative pitch, because the roll is performed first, and only then - on the inverted aircraft - the pitch is rotated, which is why it should change sign - it is in this case, the nose will be pulled up.

However, GOST 20058-80 "DYNAMICS OF AIRCRAFT IN THE ATMOSPHERE" (http://docs.cntd.ru/document/gost-20058-80) gives a slightly different definition of pitch:
26. Pitch angle ϑ - the angle between the longitudinal axis OX and the horizontal plane OXgZg of the normal coordinate system.

That is, when the nose is pointing up, the pitch should always be positive, no matter how the plane is banked!

Even with sufficiently smooth turns, such an interdependence of angles will manifest itself, which will lead to an erroneous perception of the orientation of the object in space.

And in general, the kinematic equations for angles are not very happy. We present them for the Euler angles and for the angular velocities measured in a coupled basis (that is, the sensors stand on the object and rotate with it):

Of course, these formulas are not suitable for working with the pitch, heading and roll angles described in GOST 20058-80 - you need to derive others. Let's leave that as an exercise for the most persistent readers.

There are certain advantages to describing the orientation of a rigid body as three corners:
- it is the most compact, requiring only 3 numbers,
- more or less understandable to a person,
- sometimes allows you to find an analytical solution of kinematic equations - for this, Euler once introduced his angles.

Everything else is shortcomings: multi-level formulas with many trigonometric functions, the appearance of special points at which you need to put your “crutches” or give up in advance, saying - do not come here, otherwise we will get lost in space! We can also notice that all angles can grow indefinitely, so it's a good idea to keep each of them within reasonable limits, adding or subtracting 2π as needed. For the pitch, it would not be bad at all to limit ourselves to -π .. π, which requires correction not only of the pitch itself, but also of the course. Almost any work with three angles is difficult - rotating vectors, comparing two positions, composing rotations, etc. - everywhere we stumble upon two-story expressions and singular points.

Euler or Krylov angles (or any others) have never been used in practice in strapdown attitude control systems, but implicitly participated in the operation of gyro platforms. In fact, a gyro platform is a sensor that returns the orientation of the device in space immediately in the form of angles, and as a bonus, it integrates accelerations projected onto fixed axes! The special points of "mathematics" here corresponded to the special points "in the iron" - the folding of the frames, unless special steps were taken, such as the introduction of a fourth (redundant) frame, or even the abandonment of the frames in favor of nested spheres.

Two other representations of rigid body rotation - through rotation matrices and through quaternions - are free from the disadvantages of three angles. All operations turn out to be linear, there are no singular points. To be continued...

Euler-Krylov angles

Three Euler-Krylov angles and counted counterclockwise allow to uniquely set the angular position of a rigid body in space. The figure shows one of the varieties of Krylov's angles - the so-called aircraft angles used in aviation.

Euler-Krylov angles

The fixed frame of reference, in which the angular position of a rigid body (aircraft) is considered, is formed by the right triple of vectors. The axis is directed along the local vertical from the center of the Earth, the axis is located in the horizon plane and is directed to the geographical north (N, North), and the axis complements the coordinate system to the right. With a moving object - for example, an aircraft (LA), - a moving coordinate system is rigidly connected. Its axis is directed along the construction (longitudinal) axis of the aircraft, the axis is along the normal one in the direction of the zenith, and the axis is along the transverse one in the direction of the starboard side of the aircraft. The angular position (orientation) of the aircraft in the coordinate system is given by the course (), pitch () and roll (). The presence of a minus sign in front of the aircraft angles is due to the fact that their positive values, in contrast to the classical Euler-Krylov angles, are counted clockwise. The final position of the aircraft is determined by the sequence of turns

Exhibition on MEMS accelerometer signals

The procedure for determining the initial angular coordinates is called an exhibition. For roll and pitch using a three-axis MEMS accelerometer that produces accelerations, and along the X, Y and Z axes of the associated OXYZ moving coordinate system, the corresponding angles can be found from the projections of the gravitational acceleration vector g=9.81 m/s2 on each of the axes, using the mathematical apparatus of the rotation matrices (3.1)

represents the values ​​from the respective outputs of the triaxial accelerometer.

Let us express from (3.2) the gravitational acceleration vector, for which we multiply both sides of the equality on the left by the matrix:

From the first two equations of system (3.4) we obtain

MEMS Accelerometer Calibration

The error in determining the angular coordinates of an object from the signals of three-axis MEMS accelerometers largely depends on the accuracy of determining the correction factors calculated during calibration.

Triaxial accelerometer (TOA) reading errors are due to three factors:

The presence of a constant bias;

"leakage" of the signal from one channel to another, caused by the non-collinearity of triples of vectors that form two coordinate systems: associated with the OXYZ calibration turntable and associated with TOA (3.4);

Own flicker noises.

Non-collinearity of the axes of object coordinate systems and accelerometer coordinate systems

From this it follows that the mathematical model of the signal of a three-axis MEMS accelerometer will look like this:

where is the vector of accelerometer readings, is the diagonal matrix of scaling factors, is the correction matrix, are the projections of the gravitational acceleration vector on the axes of the right triple of vectors of the coordinate system associated with the accelerometer, is the vector of constant displacements, is the TOA intrinsic noise vector.

Without taking into account the noise, the system of equations (3.6), having performed the operations of multiplying matrices and vectors, can be written as:


From (3.7) it follows that to find the calibration parameters for one of the axes, the number of measurements is required equal to the number of unknown parameters of this axis: for the Z axis - 2, for the Y axis - 3, for the X axis - 4.

Calibration of a three-axis MEMS accelerometer involves setting the sensor to a priori known positions and solving an overdetermined system of equations for its output signals. When performing this procedure, it is customary to set the accelerometer to 12 fixed positions

12 calibration positions MEMS accelerometer

B shows that in order to reduce the estimation error, one should average the calibration coefficients found from the number of combinations. However, in order to reduce the calibration time, only six so-called orthogonal positions can be used: 2), 4), 6), 7), 8) and 11); in this case, a decrease in the number of combinations to leads to an increase in the error in measuring the elements of the matrix of scale factors k and the elements of the displacement vector b by no more than 0.21% and 0.02%, respectively. It should be noted that the error in measuring the elements of the correction matrix T can increase up to hundreds of percent, but since off-diagonal elements T usually do not exceed, at small roll and pitch angles (no more than 30°), the measurement error of these angles increases by no more than 0 .5°.

Euler angles describe the rotation of an object in three-dimensional Euclidean space. In this case, two rectangular coordinate systems are considered that have a common center: a fixed system and a mobile one associated with the object. In Fig.1, the fixed coordinate system is designated XYZ (it is tilted), and the moving coordinate system is designated xyz. Euler angles are the angles through which the moving coordinate system associated with the object is rotated before being aligned with the fixed system. In the classical version, the first rotation occurs through an angle α around the z-axis associated with the object, until the x-axis associated with the object coincides with the XY plane of the fixed system. Such a coincidence will occur along the line of intersection of the XY and xy planes (line N in Fig. 1). The next rotation is carried out by an angle β around the new position of the x-axis associated with the object, until the applicate axes of both rectangular systems coincide. In this case, the y-axis associated with the object will be in the xy-plane of the fixed XYZ coordinate system. The last rotation is made by an angle γ around the new position of the applicate axis of the moving coordinate system (it will coincide with the same axis of the fixed system), after which the XY and xy coordinate axes will coincide.

Rice. 1. Euler angles

Such rotations are non-commutative, and the final position of the moving coordinate system depends on the order in which the rotations are performed.

If the coordinates of the vector R(r x , r y , r z) in the moving coordinate system XYZ are known and the Euler angles (α, β, γ) of the moving coordinate system xyz relative to the fixed one are known, then it is possible to calculate the coordinates of this vector in the fixed coordinate system xyz. To do this, construct matrices of three successive rotations through angles α, β, and γ:

Multiplying these matrices in reverse order, we get the final orthogonal matrix:

T= T 3 ×T2×T1,

which converts the coordinates of the vector R(r x , r y , r z) of the moving coordinate system into the coordinates of the vector N(n x , n y , n z) of the same length in the fixed coordinate system:

N=R,

where N and R are column matrices of the corresponding coordinates.

Euler angles are the most natural and understandable when performing various object rotation operations because they correspond to object rotations seen in the viewports of 3D graphics systems. However, their use in computer animation systems faces a number of difficulties. First of all, it is the need to choose a certain sequence of rotations of the object relative to the axes of the coordinate system. If you rotate an object first around the X axis, then around the Y axis, and finally around the Z axis, then it will not be the same rotation at all if you rotate this object through the same angles, but in a different sequence.

Let's consider another example - creating an animation of a cube when it is rotated around the Z-axis of the world coordinate system by an angle exceeding 360°, for example, by an angle of 450°. Let's try to create two keyframes, between which the cube should rotate by this angle. To do this, create a standard box in the MaxScript program:

b = box()

After that, move the animation timeline slider to frame 10, turn on the Auto Key mode, and then run the command:

b.rotation.z_rotation = 450

Play the animation. The object will only rotate 90° because its 360° rotation will be ignored. Now do the same in the 3ds Max program window. Animation of the object between two keyframes will occur at an angle of 450°. Thus, the use of Euler rotations in computer graphics programs similar to MaxScript is limited to simultaneous rotation through an angle not exceeding 360°. However, this does not prevent you from creating animation manually behind the display screen.

Another problem with Euler angles is the gimbal lock. Its appearance depends on the choice of the rotation order of the object. For example, let's rotate an object first around the Z axis by 140°, then around the X axis by 90°, and then by 130° around the Y axis (Fig. 2).

Rice. 2. Successive object rotations

If we now perform the same sequence of rotations again, for example, 10° around the Z axis, then 90° around the X axis, and then 0° around the Y axis, we get the same result. The problem is that when the rotation around the X axis becomes 90° or -90°, then the local rotation axis Y becomes parallel to the Z axis, but in the opposite direction, and therefore the rotation around it conflicts with the previous rotation around the Z axis.

The hinge lock is absent for matrices and quaternions. Quaternions provide a convenient mathematical notation for the position and rotation of objects in space. Compared to Euler angles, quaternions make it easier to combine rotations, as well as avoid the problem of not being able to rotate around an axis, regardless of the rotation in other axes. Compared to matrices, they have greater computational stability and can be more efficient. Quaternions are used to perform rotations in computer graphics, robotics, game engines, navigation, molecular dynamics, and generally anywhere there are problems with Euler angles or matrices.

Literature

  1. Euler angles and Gimbal lock [Electronic resource] / http://habrahabr.ru - Habrahabr, 2006. - Access mode: http://habrahabr.ru/post/183116/. – Date of access: 10.10.2013.
  2. Quaternions and rotation of space [Electronic resource] / http://ru.wikipedia.org/ - Wikipedia - the free encyclopedia, 2001. - Access mode: http://ru.wikipedia.org/wiki/ Quaternions_and_rotation_of_space. – Date of access: 10/11/2013.