Converting and interpreting the output, Spacepoint quaternions, Table 5-1: scaling of output data – PNI SpacePoint Scout User Manual
Page 12: 5converting and interpreting the output, 1 spacepoint quaternions
PNI Sensor Corporation
Doc #1017545 r03
SpacePoint Scout User Manual
– January 2013
Page 12 of 19
5
Converting and Interpreting the Output
The various outputs provided by the SpacePoint Scout are in an unscaled format. Table 5-1
provides conversion and scaling information for both the UART and I
2
C interfaces. Further
discussion on SpacePoint Quaternions and Cursor Position follows.
Table 5-1: Scaling of Output Data
Output
Interface
Equation
Units or Range
Quaternions
UART & I
2
C
q_scaled = (q_output - 32768)/32768
Range:
–1.0 to 1.0
Acceleration
UART
Accel_g = (Accel_output
–32768)*6/32768
g
Hpos & Vpos
UART
Hpos_scaled = (Hpos_output -32768)/32768
Vpos_scaled = (Vpos_output -32768)/32768
Range:
–0.5 to +0.5
Hpos & Vpos
I
2
C
See IEEE
– 754
Range:
–0.5 to +0.5
5.1 SpacePoint Quaternions
Rotation quaternions are 4 element vectors which describe the rotation of an object with a
single angle, Φ, and a rotation axis, v [vx vy vz]. For the SpacePoint algorithm, the
rotation quaternion is defined as:
q [qx qy qz qw] = [q
0
q
1
q
2
q
3
], where
qx = vx*sin(Φ/2)
qy = vy*sin(Φ/2)
qz = vz*sin(Φ/2)
qw = cos(Φ/2)
Note that qw often is referred to as the scalar term of the quaternion. Also, other definitions
of a rotation quaternion exist, such as q [qw qx qy qz].
For the SpacePoint algorithm, the rotation quaternion represents the absolute rotation from
the NED (North East Down) reference orientation. The NED reference orientation has the x
axis pointed north, the y axis pointed east, and the z axis pointing down. If the SpacePoint
Scout is held level with the front of the device pointing towards magnetic north, then q = [0 0
0 1], since Φ = 0.