What type of data does an AHRS output?
FollowData output is instantaneous heading, pitch, roll, acceleration, magnetometer- and gyro data, and orientation matrices. The orientation output can be specified in one of three ways; as quaternions, as Euler angles or as rotation matrices. These parameters are output for each data package, which means that with an AHRS the memory requirements goes up compared to the standard sensor.
Internal processing of the AHRS output
The sensor itself collects raw data from the Gyroscopes, Accelerometers, and Magnetometers. These are processed by the on-board digital signal processor and transformed into Quaternions.
A quaternion is a way to represent 3D rotations. Instead of using angles (like pitch, roll, heading) or rotation matrices, quaternions give you a more stable and compact way to handle rotations.
A quaternion is made up of 4 numbers:
- One real part:
w
- Three imaginary parts:
x
,y
,z
It’s usually written like this:
\begin{equation} q = w + xi + yj + zk \end{equation} |
(1) |
For example: q = (0.707, 0.0, 0.707, 0.0) would represent a 90° rotation around the Y-axis.
The quaternions produced by the AHRS are received by the ADCP and transformed into the output format specified: Eulerian Angles or a Rotation matrix.
Quaternion to Rotation matrix
A quaternion an be converted to a 3×3 rotation matrix R using this formula:
\begin{equation} R = \begin{bmatrix} 1 - 2(y^2 + z^2) & 2(xy - wz) & 2(xz + wy) \\ 2(xy + wz) & 1 - 2(x^2 + z^2) & 2(yz - wx) \\ 2(xz - wy) & 2(yz + wx) & 1 - 2(x^2 + y^2) \end{bmatrix} \end{equation} |
(2) |
This matrix can be used to rotate a vector [X;Y;Z] via standard matrix multiplication.
Quaternion to Eulerian angles
The eulerian angles describe the rotation around the instruments axis:
-
Roll (ϕ) — rotation around the X-axis
-
Pitch (θ) — rotation around the Y-axis
-
Yaw (ψ) — rotation around the Z-axis
To derive these angles from the quaternion output of the AHRS, the following equations are used:
\begin{equation} \phi = \arctan2\left(2(w x + y z), 1 - 2(x^2 + y^2)\right) \end{equation} |
(3) |
\begin{equation} \theta = \arcsin\left(2(w y - z x)\right) \end{equation} |
(4) |
\begin{equation} \psi = \arctan2\left(2(w z + x y), 1 - 2(y^2 + z^2)\right) \end{equation} |
(5) |
The Rotation Matrix or Eulerian Coordinates can be used when transforming the collected velocity data from XYZ to ENU coordinates. This is only necessary if choosing to process your data manually!
For the theory behind coordinate system transformation as well as Python/ Matlab scripts to carry these out manually, please see this FAQ.
Comments
0 comments
Please sign in to leave a comment.