|
An attitude quaternion describes an orientation relative to a reference frame. In estimation and control, the more useful quantity is often the orientation difference between an actual attitude and a desired or estimated attitude. Because rotations form a noncommutative group, this difference is not obtained by subtracting quaternion components. It is obtained by forming a relative rotation through quaternion multiplication and inversion.
The resulting unit quaternion is called a relative attitude quaternion or an error quaternion. It is exact for arbitrarily large attitude differences. When the error is small, its vector part reduces naturally to the three component small rotation vector used in many Kalman filters and attitude controllers.
This article continues the PhysicsLibrary convention used in Q00 through Q11:
- right-handed orthonormal frames;
- Hamilton multiplication, so
;
- scalar-first display notation,
 |
(1) |
- the actual attitude quaternion is
 |
(2) |
which maps body coordinates into the inertial or reference frame;
- the desired attitude is denoted by
.
Both and are assumed to be unit quaternions unless stated otherwise.
The component difference
 |
(3) |
is not itself an orientation. It need not have unit norm, it depends on the choice between the equivalent representatives and , and it does not compose with attitude in the correct geometric way.
The correct error must instead satisfy a composition equation. There are two standard choices, depending on whether the correction multiplies the actual attitude on the left or on the right.
Define the left error quaternion by requiring
 |
(4) |
Multiplying on the right by gives
 |
(5) |
This form expresses the relative correction on the inertial or reference side of the attitude map.
Alternatively, define the right error quaternion by
 |
(6) |
Multiplying on the left by gives
 |
(7) |
This form expresses the correction on the body side.
Both quaternions describe the same physical relative rotation. They differ only in the coordinates used for its rotation axis. The two forms are related by
 |
(8) |
Thus the vector part of the error transforms exactly as an ordinary spatial vector under conjugation by the attitude quaternion.
Figure shows the actual and desired orientations and the relative correction between them. The actual frame is rotated into the desired frame by an error rotation with axis
and angle
.
Figure: Relative attitude and the multiplicative error quaternion. The actual attitude and desired attitude are connected by either a left error
or a right error
. The two error quaternions represent the same physical rotation, resolved in different coordinates.
|
|
Any unit error quaternion may be written as
 |
(9) |
Write
 |
(10) |
For a nonzero vector part, the error axis is
 |
(11) |
The exact error angle is most robustly obtained from
 |
(12) |
The quaternions and describe the same physical relative orientation. For feedback and local estimation it is usually convenient to choose the representative whose scalar part is nonnegative:
 |
(13) |
This choice gives the principal rotation angle in the interval
 |
(14) |
A convenient implementation rule is to replace
 |
(15) |
whenever
, except when an application deliberately maintains a different sign continuity convention. Near , the sign choice is intrinsically ambiguous because the scalar part is close to zero.
For small attitude error,
 |
(16) |
so
 |
(17) |
Define the small rotation vector
 |
(18) |
Then
 |
(19) |
when the rotation vector is identified with a pure quaternion. In scalar-first column form,
![$\displaystyle \boxed{ \delta q \approx \begin{bmatrix} 1\\ [2mm] \frac12\delta\boldsymbol\theta \end{bmatrix}. }$ $\displaystyle \boxed{ \delta q \approx \begin{bmatrix} 1\\ [2mm] \frac12\delta\boldsymbol\theta \end{bmatrix}. }$](https://images.physicslibrary.org/cache/objects/1107/l2h/img33.png) |
(20) |
Therefore, provided the error representative has been chosen near ,
 |
(21) |
This three component vector is the standard bridge between exact quaternion error and linearized attitude error models.
From equation (8), a small right error and a small left error satisfy
 |
(22) |
Using the small error form gives
 |
(23) |
The scalar part remains one and the vector part rotates according to Q07, so
 |
(24) |
to first order. Thus the same small physical attitude error can be resolved in inertial coordinates or body coordinates.
Suppose the actual attitude is a yaw and the desired attitude is a yaw. Then
 |
(25) |
and
 |
(26) |
Because both rotations are about the same axis,
Therefore the required correction is exactly a rotation about the positive axis.
Many attitude estimators maintain a full unit quaternion as the nominal attitude but use only three small variables for the local attitude error. A small correction may be formed as
![$\displaystyle \delta q(\delta\boldsymbol\theta) \approx \begin{bmatrix} 1\\ [1mm] \frac12\delta\boldsymbol\theta \end{bmatrix},$ $\displaystyle \delta q(\delta\boldsymbol\theta) \approx \begin{bmatrix} 1\\ [1mm] \frac12\delta\boldsymbol\theta \end{bmatrix},$](https://images.physicslibrary.org/cache/objects/1107/l2h/img45.png) |
(28) |
then injected into the nominal quaternion. A left error estimator uses
 |
(29) |
while a right error estimator uses
 |
(30) |
The estimator equations and covariance must use the same error convention consistently. Mixing a left error covariance model with right error injection is a common implementation mistake.
For control, the vector part of the principal error quaternion provides a bounded directional measure of attitude error. For small error,
 |
(31) |
so a controller based on the error quaternion vector part reduces locally to a controller based on the familiar small rotation vector.
For large errors, the exact quaternion should be retained rather than replacing it with the linear approximation. NASA spacecraft control work has long used quaternion attitude error measures for this reason, including exact nonlinear error formulations and comparisons with direction cosine formulations.
A raw Euler angle difference is not a geometric rotation vector for finite errors. If Euler angles are used for display or commands, convert the two orientations to quaternions or matrices first and form the exact relative rotation. Only after the relative error is known to be small should one use the three component approximation
 |
(32) |
This avoids sequence dependence and Euler angle singularities.
The most common mistakes are:
- subtracting quaternion components instead of forming a relative product;
- confusing the left error
with the right error ;
- using the small angle approximation for a large attitude error;
- forgetting that and represent the same rotation;
- allowing a sign flip to create an artificial error near
when the physical attitude difference is near zero;
- mixing an inertial resolved error vector with a body resolved covariance or controller gain;
- forming an Euler angle difference and treating it as an exact rotation vector.
Q13 develops numerical quaternion propagation. It compares direct numerical integration of quaternion kinematics with exponential updates from sampled gyro increments, discusses normalization drift, and treats quaternion sign continuity in discrete time.
Quaternion attitude error measures are standard in spacecraft estimation and control. Bach and Paielli's NASA Technical Memorandum 102798 develops a quaternion attitude error formulation and shows how its first three components can be used in an exact linear error control construction. The equations in this article are written in the PhysicsLibrary convention rather than copied from that report because error multiplication order and coordinate meaning are convention dependent. The small rotation vector interpretation is also consistent with standard multiplicative attitude estimation practice.
- 1
- R. Bach and R. Paielli, Direct Inversion of Rigid-Body Rotational Dynamics, NASA Technical Memorandum 102798, 1990.
- 2
- M. D. Shuster, “A Survey of Attitude Representations,” The Journal of the Astronautical Sciences, vol. 41, no. 4, pp. 439–517, 1993.
This article is an original synthesis prepared for PhysicsLibrary and intended for release under CC BY-SA 4.0.
|