Journal of Sensors

Volume 2018, Article ID 9684326, 8 pages

https://doi.org/10.1155/2018/9684326

## On the Interpretation of 3D Gyroscope Measurements

Faculty of Electrical Engineering, University of Ljubljana, Tržaška 25, Ljubljana, Slovenia

Correspondence should be addressed to Sara Stančin; is.jl-inu.ef@nicnats.aras

Received 5 September 2017; Accepted 7 February 2018; Published 22 March 2018

Academic Editor: Carmine Granata

Copyright © 2018 Sara Stančin and Sašo Tomažič. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

We demonstrate that the common interpretation of angular velocities measured by a 3D gyroscope as being sequential Euler rotations introduces a systematic error in the sensor orientation calculated during motion tracking. For small rotation angles, this systematic error is relatively small and can be mistakenly attributed to different sources of sensor inaccuracies, including output bias drift, inaccurate sensitivities, and alignments of the sensor sensitivity axes as well as measurement noise. However, even for such small angles, due to accumulation over time, the erroneous rotation interpretation can have a significant negative impact on the accuracy of the computed angular orientation. We confirm our findings using real-case measurements in which the described systematic error just worsens the deleterious effects typically attributed to an inaccurate sensor and random measurement noise. We demonstrate that, in general, significant improvement in the angular orientation accuracy can be achieved if the measured angular velocities are correctly interpreted as simultaneous and not as sequential rotations.

#### 1. Introduction

With the ongoing developments in gyroscope-manufacturing technology, their use in various fields is observably increasing [1–29]. 3D gyroscopes are integral components of inertial navigation units [5–8]; have been shown feasible for motion capture, classification, and analysis [9–24]; and are essential elements of the assistive, rehabilitative, and wearable health technology [21, 22]. However, the utility of 3D gyroscopes can be diminished without an associated meaningful interpretation of the measured values and computation of the angular orientation.

A 3D gyroscope measures the angular velocity of its rotation in a reference frame along its three sensitivity axes. For an ideal sensor, these outputs are equal to the projections of the rotation angular velocity on the sensitivity, that is, intrinsic coordinate system axes. In the measurement context, the sensor is hence simultaneously rotating around its three coordinate system axes. Properly combined, these three rotations are equivalent to the actual rotation of the sensor in the reference frame.

Misleading practices arise from interpreting the three measured angular velocities as being sequential, that is, Euler rotations. As the three angular velocities that a 3D gyroscope provides represent simultaneous rotations, in general, the use of Euler angles introduces a systematic error in the calculated angular orientation. It is only in the case of infinitesimal rotations, which are shown to be commutative, that the sequential and simultaneous rotations around orthogonal axes result in the same angular orientation [30, 31].

There are a number of literature contributions [23–28] that present otherwise promising applications of 3D gyroscopes that adopt the above-emphasized misleading interpretations. For this reason, we find it necessary to emphasize in more detail the realistic effects of the gyroscope measurement interpretation. Our objective is therefore to investigate the systematic error that arises from erroneously interpreting the 3D gyroscope measurements and quantify its effect on the accuracy of the computed angular orientation.

The paper is organized as follows. In Section 2, we resolve the problem of the correct interpretation of 3D gyroscope measurements by invoking the expressions for the rotation that is equivalent to the three simultaneous orthogonal rotations measured by a 3D gyroscope, as derived in [30], and present proper means for computing the angular orientation.

To isolate and quantify the deleterious effect of the erroneous rotation interpretation on the angular orientation accuracy, we consider, in Section 3, an ideal 3D gyroscope and a simple rotation at a constant angular velocity around a fixed rotation axis. In Section 4, we present angular orientation error reduction that can be achieved when using a real, imperfect 3D gyroscope in real-case measurements in which the described systematic error obfuscates the accuracy of the computed angular orientation along with typical errors attributed to an inaccurate sensor and random measurement noise.

Although the manufacturing technologies of low-cost gyroscopes is improving rapidly, these sensors have been shown to suffer from output bias drift and inaccurate sensitivities and alignments of the sensor sensitivity axes. As it is our aim to quantify the deleterious effect of the erroneous rotation interpretation, we here consider a properly calibrated sensor. Improving the accuracy of 3D gyroscopes has been the subject of a number of ongoing research works and is presented elsewhere [32–35]. Finally, in Section 5, we summarize our results and draw the conclusions.

In all subsequent sections, we obey the following notation rules: bold letters denote matrices and vectors, and large and small italics denote scalars.

#### 2. 3D Gyroscope Measurements Interpretation

##### 2.1. Simultaneous Rotations

Let us consider an ideal 3D gyroscope that rotates at constant angular velocity *ω* around a rotation axis **v** in a 3D reference frame. It provides measurements of simultaneous angular velocities *ω _{x}*,

*ω*, and

_{y}*ω*around its three orthogonal sensor intrinsic coordinate system axes,

_{z}*x*,

*y*, and

*z*, respectively. In [30, 36], we have derived a rotation vector

**Φ**called Simultaneous Orthogonal Rotation Angle (SORA), which we can use to interpret the measured values correctly. The components of this vector are equal to the rotation angles of the three simultaneous rotations around the sensor axes: where

*ω*,

_{x}*ω*, and

_{y}*ω*are the three measured angular velocities;

_{z}*φ*,

_{x}*φ*, and

_{y}*φ*are the rotation angles; and

_{z}*T*is the measurement interval.

As long as the axis **v** of rotation is constant during the measurement interval *T*, the orientation and magnitude of vector SORA **Φ** (1) are respectively equal to the axis and angle of the actual rotation of the gyroscope. It holds that

From (1)–(3), we can conclude that the gyroscope measures the projections of its rotation angular velocity vector on its sensitivity axes. Note that, in general, due to rotation noncommutativity, the rotation (1) and angular velocity vectors (4) cannot be considered as real vectors. This is possible only in the particular case of a constant rotation axis.

Using the rotation axis (2) and angle (3), we can compute the angular orientation of the sensor intrinsic coordinate system axes in the reference frame. We introduce **R**(*φ*,**v**) to denote a 3 × 3 rotation matrix associated with the axis (2) and angle (3) of rotation:
where *c* and *s* respectively denote cos(*φ*) and sin(*φ*).

We further introduce 3 × 3 matrices **S**_{init} and to represent the sensor initial and final orientation in the reference frame. The columns of **S**_{init} and are 3 × 1 unit vectors representing the initial and final orientations, respectively, of the sensor coordinate axes. We can write

The order of matrices **S**_{init} and **R**(*φ*,**v**) in multiplication in (6) accounts for the fact that the rotation axis **v** (2) is given in the 3D gyroscope intrinsic coordinate system.

##### 2.2. Sequential Rotations

As opposed to the three rotations represented with SORA (1), Euler angles represent a sequence of three elemental rotations, that is, rotations about the axes of the (intrinsic or reference) coordinate system. If only rotations around different intrinsic coordinate system axes are considered, six sequences are possible: *x*-*y*-*z*, *y*-*z*-*x*, *z*-*x*-*y*, *x*-*z*-*y*, *z*-*y*-*x*, and *y*-*x*-*z*. Because rotations are in general not commutative, each of these six sequences brings to a different final angular orientation, none of which is correct when all three rotations are simultaneous, as is the case when the 3D gyroscope rotates around an arbitrary axis. Using any of these sequences in calculating the angular orientation of the sensor introduces a systematic error.

As the three coordinate axes of the sensor are equivalent, we can use any of the aforementioned sequences to quantify the error in the calculated angular orientation. We chose the sequence *z*-*y*-*x*, also known as the aerospace sequence with rotation angles called yaw, pitch, and roll.

Using angles *φ*_{z,}* φ _{y}*, and

*φ*obtained with a 3D gyroscope in place of the yaw, pitch, and roll, respectively, we can calculate the final orientation of the sensor according to the sequential rotation interpretation as

_{x}**R**_{E}(*φ _{z}*,

*φ*,

_{y}*φ*) (7) denotes a 3 × 3 Euler rotation matrix composite: where s

_{x}*and c*

_{k}*respectively denote sin(*

_{k}*φ*) and cos(

_{k}*φ*), k representing one of the axes,

_{k}*x*,

*y*, or

*z*.

The orientation of an aircraft may indeed be represented in a convenient and intuitive way with the three Euler orientations. However, Euler angles are not equal to the angles measured with a 3D gyroscope, and obviously, their use in this context is erroneous. Comparing (5) and (8), we can conclude that rotation matrices for simultaneous (5) and sequential (8) rotation interpretations are not equal and that relying on the latter will not yield the correct result in the case of 3D gyroscope measurements.

Let us look at a simple illustrative example. Suppose that the sensor rotates with an angular velocity *ω* = 360°/s around the unit axis
for *T* = 1 s. After this rotation time, the orientation of the sensor is obviously equal to its initial orientation; thus, the rotation matrix for the simultaneous interpretation (5) is actually, in this case, the identity matrix. We can write

By considering (1)–(4), we can conclude that, in this case, the angles measured with an ideal gyroscope would be

Substituting these angles for the yaw, pitch, and roll Euler angles in (8) yields

The obtained rotation matrix **R**_{E}(*φ _{z}*,

*φ*,

_{y}*φ*) is not equal to the identity matrix

_{x}**I**and would obviously bring to an incorrect angular orientation:

In practice, much smaller angles of rotations are used in calculations of final angular orientation. As the rotation angles become ever smaller, the difference between the simultaneous and sequential rotation results becomes ever more negligible. However, even for small angles, the error in the computed angular orientation accumulates over time and can become significant, as we will present and discuss in the next sections.

#### 3. Angular Orientation Systematic Error

##### 3.1. Angular Orientation Error Measures

We express the angular orientation error *ε* in terms of the orientation deviation angle, that is, the angle of a rotation that would correct the calculated orientation of the sensor:
where **S**_{fin} is the 3 × 3 matrix of the actual final orientation and is the 3 × 3 matrix of the calculated state.

Due to integration, the error in the computed angular orientation accumulates over time. To make the results comparable across different simulations and measurements, we normalize the deviation angle *ε* (14) with respect to the total time of rotation *T*:

##### 3.2. Methodology

To isolate the effect of the erroneous rotation interpretation, we consider an ideal 3D gyroscope that provides time-discrete samples of angular velocities at sample moments *nT*_{s}, where *T*_{s} is the sampling interval:
and *f*_{s} is the sampling rate. We thus obtain *N* = *T f*_{s} samples of the angular velocity vector **ω** (4).

We further consider the sensor and reference frame coordinate axes to be initially aligned. The initial orientation of the sensor is hence given by the identity matrix:

For this investigation, we finally consider that the sensor rotates for *T =* 1 s with a constant angular velocity *ω* = 360°/s, around the unit axis:

For this example, the initial and actual final orientations of the sensor are hence identical. We can write

For each of the *N* rotation samples, the sensor rotates for an angle Δ*φ* **=** 360°/*N* around the constant axis **v**. As we are assuming the gyroscope is accurate and the rotation axis is constant throughout the rotation, we can conclude that all samples of the measured angular velocities are equal to
and that all angles of rotations around the sensor axes are equal to

We can finally conclude that for all samples *n*, the angle of rotation calculated according to (3) is equal to

It is obvious that combining all *N* rotations in a single rotation matrix would yield the identity matrix **I**. Considering this and (19) for calculating the resulting angular orientation (6), we can hence write

This implies that interpreting the rotations as simultaneous by considering SORA (1)–(4) does not produce an error in the calculated angular orientation.

To calculate the final angular orientation of the sensor according to the sequential rotation interpretation (7), we multiply the Euler rotation matrix **R**_{E}(Δ*φ*_{s}, Δ*φ*_{s}, Δ*φ*_{s}) (8) by itself *N* − 1 times:

By substituting for in (14), we can calculate the angular orientation error for the sequential rotation interpretation. Because both the initial and actual final angular orientations of the sensor are given with the identity matrix (19), (14) simplifies to

Total measurement time is set to *T* = 1 s, so the normalized deviation angle (15) is equal to

As Δ*φ*_{s} decreases with the sampling rate and as small enough angle rotations become nearly commutative, we expect both error measures, *ε* (25) and *ε*_{norm} (26), to decrease with the sampling rate too.

##### 3.3. Results and Discussion

The normalized orientation deviation angles *ε*_{norm} obtained according to (26) for different sampling frequencies decreasing from 10,000 Hz to 4 Hz in a logarithmic scale are presented in Figure 1. Different sampling frequencies correspond to different angles of the gyroscope rotations Δ*φ*, increasing from 0.036° to 90°.