Measuring angular motion can be important in a wide variety of applications, including sports biomechanics and astronomy. In this blog post, I'll go over how to define rotation and what's needed to calculate angular velocity. I’ll then walk you through how to measure rotation and what’s required (including formulas) to calculate angular velocity with an accelerometer. There are a variety of accelerometers and DAQ systems that can help measure both orientation and acceleration, but for this post I’ll be using one of my company’s enDAQ sensors, as it comes equipped with in-built gyroscopes and accelerometers.
I'll cover:
In order to define rotation (and by extension angular velocity and acceleration) it is first necessary to define some terms:
A vector basis is a set of non-coplanar vectors that are used to define orientation. Vector bases may have additional properties such as:
A reference frame is an infinite set of non-collinear points where the distance between any two points is constant. Once again, the term constant implies a sense of time. Reference frames define both position and orientation. A convenient way to define a reference frame N is using a point and an orthonormal vector basis fixed in N. Reference frames can be Newtonian or non-Newtonian:
For the purposes of this guide, we will restrict our focus to 3D orthonormal vector bases. Orientation and its derivatives (angular velocity and acceleration) can be defined without specifying any points, so they can be defined in terms of a pair of vector bases. Since reference frames contain vector bases, orientation can also be defined in terms of two reference frames. Position and its derivatives (velocity and acceleration) are defined between two points, and thus require at least one reference frame to be defined.
The orientation of a rigid body is defined by the alignment between a vector basis attached to the body and another vector basis or reference frame. For the purposes of this guide, we will consider the orientation of a body B (defined by orthonormal basis vectors
Conversion between these forms can be accomplished using the formulas found in this NASA Technical Brief [2].
A quaternion is a hypercomplex number of the form
(1) |
where
(2) |
For the purposes of this document, quaternions will be expressed in bold font. A more convenient way to express (1) is as the sum of a scalar and a vector
(3) |
There are several properties and definitions of quaternions that will be relevant to this analysis.
Table 1: Quaternion Properties and Definitions
Name | Symbol | Definition |
Quaternion Conjugate | ||
Quaternion Norm | ||
Unit Quaternion |
|
|
Pure Quaternion | ||
Quaternion Sum | a + b | |
Quaternion Product | ab | |
Quaternion Time Derivative |
As mentioned previously, quaternions are a convenient way to express Euler parameters (
(4) |
Suppose that
(5) |
Suppose also that the transformation between the body basis B and the world frame W is achieved by the rotation of θ about
(6) |
This operation is known as a frame rotation, because the reference frame is rotating and the vector itself is unchanged. A proof for this relation can be found in [3].
The angular velocity of the body B expressed in the world frame W is denoted as
however, this is only valid if
(7) |
(8) |
the proof of which can be found in [4]. Since
(9) |
where
In addition to calculating the angular velocity, quaternions can also be used to transform the accelerometer data between reference frames. Acceleration is derived from position, and thus must be defined in a reference frame as opposed to a vector basis. The most convenient way to form a reference frame in this case is with a point and a vector basis. The choice of this point is arbitrary, as the acceleration of one reference frame in another does not depend on the absolute distance between any two points. Any vector, such as acceleration, can be transformed from one reference frame to another using Equation (6).
It should be noted that the world reference frame is a non-Newtonian reference frame due to the rotation of the earth. This effect may or may not be relevant to your measurements, depending on the application and length of data acquisition.
enDAQ sensors feature an IMU unit that outputs orientation in the form of an array of quaternions. These quaternions provide the enDAQ sensor vector basis D (defined in Figure 1) in one of two possible reference bases at each data acquisition point.
Figure 1. enDAQ S4 Sensor with basis vectors labeled
The two possible reference bases are related to how the orientation is calculated by the IMU:
More detail on the advantages and disadvantages of these two systems can be found in this enDAQ blog post: Quaternions for Orientation.
The gyroscope in the IMU measures the angular velocity and then integrates to find the orientation. This means that we can differentiate the orientation to find the angular velocity without worrying about amplifying the noise. Figure 2 compares the angular velocity calculated using (9) and the angular velocity measured directly by the IMU. It should be noted that the IMU in the enDAQ sensor cannot simultaneously provide the orientation quaternion and the raw IMU angular velocity, so the data in Figure 2 was taken by two enDAQ sensors mounted to the same rotating surface. The slight variation between them is a result of differing noise levels, as well as imperfections in the cross-correlation of the two signals.
Figure 2. Angular velocity calculated by differentiating the quaternion and pulled directly from the IMU
The quaternion array can also be used to transform the acceleration data from the rotating enDAQ sensor reference frame into a stationary reference frame at each data acquisition point using
where
So that is your overview of angular motion and how to use an enDAQ sensor to measure rotation and angular velocity. I hope you found it helpful. For more content like this, don't forget to subscribe to our blog and if you have any questions, don't hesitate to leave a comment below or contact us directly.
Related Posts:
For more on this topic, visit our dedicated Environmental Sensors resource page. There you’ll find more blog posts, case studies, webinars, software, and products focused on your environmental testing and analysis needs.
[1] Basile Graf. "Quaternions and Dynamics". en. In: arXiv:0811.2889 [math- ph] (Nov. 2008). arXiv: 0811.2889 [math-ph].
[2] D M Henderson. "Euler Angles, Quaternions, and Transformation Matrices". en. In: (1977), p. 42.
[3] Yan-Bin Jia. Quaternions. Sept. 2019.
[4] Paul Mitiguy. Advanced Dynamics and Motion Simulation. 2015.