Firmware-75 Function-116

From I-CubeX Wiki
Jump to: navigation, search

ORIENT4D (116, 74h)

The Orient4D function enables output of the Orient4D sensor data in both host and stand-alone modes using a number of methods. In host mode the sensor data is output as I2C DATA messages. In stand-alone mode the sensor data is output according to the stand-alone mode settings of the input number that equals the I2C port number. The following methods can be selected using the FUNCTION command’s method/parameter FP:

Orient4D v1.0

FP Data output in host mode Data output in standalone mode
default Quaternion W-axis [-8192..8191]; a signed two’s complement 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion W-axis [0..127] or [0..16383]; unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion X-axis [-8192..8191]; a signed two’s complement 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion Y-axis [-8192..8191]; a signed two’s complement 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion Z-axis [-8192..8191]; a signed two’s complement 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
1 Heading [0..5760]; a signed two’s complement 16-bit value, representing [0..360] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading [0..90] or [0..11520]; an unsigned 7-bit or 14-bit value, representing [0..360] degrees, sent as one or two bytes (LSB, MSB)
Roll [-1440..1440]; a signed two’s complement 16-bit value, representing [-90..90] degrees, sent as nibbles in four bytes (MSB .. LSB) Roll [19..109] or [2432..13952]; an unsigned 7-bit or 14-bit value, representing [-90..90] degrees, sent as one or two bytes (LSB, MSB)
Pitch [-2880..2880]; a signed two’s complement 16-bit value,, representing [-180..180] degrees, sent as nibbles in four bytes (MSB .. LSB) Pitch [19..109] or [2432..13952]; an unsigned 7 bit or 14-bit value, representing [-180..180] degrees, sent as one or two bytes (LSB, MSB)
2 Magnetic Field Strength X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] µT, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] µT, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] µT, sent as one or two bytes (LSB, MSB)
3 Acceleration X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB) Acceleration X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-4..4] G, sent as one or two bytes (LSB, MSB)
Acceleration Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB) Acceleration Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-4..4] G, sent as one or two bytes (LSB, MSB)
Acceleration Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB) Acceleration Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-4..4] G, sent as one or two bytes (LSB, MSB)
4 Gyro X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB) Gyro X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] º/s, sent as one or two bytes (LSB, MSB)
Gyro Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB) Gyro Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] º/s, sent as one or two bytes (LSB, MSB)
Gyro Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB) Gyro Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-512..512] º/s, sent as one or two bytes (LSB, MSB)
5 Temperature [-40..85]; a signed 8-bit value, representing [-40..85] ºC, sent as nibbles in two bytes (MSB .. LSB) Temperature [44..107] or [5632..13632]; an unsigned 7-bit or 14-bit value, representing [-40..85] ºC, sent as one or two bytes (LSB, MSB)
9 Magnetic Field Strength X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB) See default
Magnetic Field Strength Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Acceleration X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Gyro X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Temperature [-40..85]; a signed 8-bit value, representing [-40..85] ºC, sent as nibbles in two bytes (MSB .. LSB)
12 Quaternion W-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) See default
Quaternion X-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Y-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Z-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT,, sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
13 Quaternion W-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) See default
Quaternion X-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Y-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Z-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Acceleration X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
14 Quaternion W-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) See default
Quaternion X-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Y-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Z-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Gyro X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
19 Quaternion W-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) See default
Quaternion X-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Y-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Quaternion Z-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Magnetic Field Strength Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] µT, sent as nibbles in four bytes (MSB .. LSB)
Acceleration X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Acceleration Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-4..4] G, sent as nibbles in four bytes (MSB .. LSB)
Gyro X-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Y-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
Gyro Z-axis [-32768..32767]; a signed two’s complement 16-bit value, representing [-2048..2048] º/s, sent as nibbles in four bytes (MSB .. LSB)
42 See default Magnetic Field Strength X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] µT, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] µT, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] µT, sent as one or two bytes (LSB, MSB)
44 See default Gyro X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] º/s, sent as one or two bytes (LSB, MSB)
Gyro Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] º/s, sent as one or two bytes (LSB, MSB)
Gyro Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [-2048..2048] º/s, sent as one or two bytes (LSB, MSB)
100 Quaternion W-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion W-axis [0..127] or [0..16383]; unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion X-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion Y-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Quaternion Z-axis [-8192..8191]; a signed 16-bit value, representing [-1..1], sent as nibbles in four bytes (MSB .. LSB) Quaternion Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1], sent as one or two bytes (LSB, MSB)
Calibration data [0..3]; 4 bits each for the system, magnetometer, accelerometer and gyroscope (higher values represent better calibration) sent as nibbles in four bytes Calibration data [0..127] or [0..16383]; an unsigned 7 bit or 14-bit value for the system, magnetometer, accelerometer and gyroscope (higher values represent better calibration) sent as one or two bytes (LSB, MSB)
101 Heading [0..5760]; a signed 16-bit value, representing [0..360] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading [0..90] or [0..11520]; an unsigned 7-bit or 14-bit value, representing [0..360] degrees, sent as one or two bytes (LSB, MSB)
Roll [-1440..1440]; a signed 16-bit value, representing [-90..90] degrees, sent as nibbles in four bytes (MSB .. LSB) Roll [19..109] or [2432..13952]; an unsigned 7-bit or 14-bit value, representing [-90..90] degrees, sent as one or two bytes (LSB, MSB)
Pitch [-2880..2880]; a signed 16-bit value, representing [-180..180] degrees, sent as nibbles in four bytes (MSB .. LSB) Pitch [19..109] or [2432..13952]; an unsigned 7 bit or 14-bit value, representing [-180..180] degrees, sent as one or two bytes (LSB, MSB)
Calibration data [0..3]; 4 bits each for the system, magnetometer, accelerometer and gyroscope (higher values represent better calibration) sent as nibbles in four bytes Calibration data [0..127] or [0..16383]; an unsigned 7 bit or 14-bit value for the system, magnetometer, accelerometer and gyroscope (higher values represent better calibration) sent as one or two bytes (LSB, MSB)

Example:

In order to enable the Orient4D function to get the heading, pitch and roll data from an Orient4D sensor with I2C device address 41 (default Orient4D I2C device address) connected to the 1st I2C port, the following message is sent (see also the FUNCTION command):

240, 125, 0 {DEV}, 8 {FUNCTION}, 0 {yyy = 0}, 41 {device address}, 116 {Orient4D function}, 1 {heading/roll/pitch}, 247 (F0h, 7Dh, 00h, 08h, 00h, 29h, 74h, 01h, F7h)

The WiDig acquires the value 90 (heading east), -45 (roll to the right) and 45 (pitch down). The WiDig sends the following message in host mode:

240, 125, 0 {DEV}, 10 {I2C DATA}, 0 {I2C port}, 41 (device address}, 116 {Orient4D function}, 1 {heading/roll/pitch}, 0 {dddd of heading 1st byte }, 5 {eeee of heading 1st byte}, 10 {dddd of heading 2nd byte}, 0 {eeee of heading 2nd byte}, 15 {dddd of pitch 1st byte}, 13 {eeee of pitch 1st byte}, 3 {dddd of pitch 2nd byte}, 0 {eeee of pitch 2nd byte}, 0 {dddd of roll 1st byte}, 2 {eeee of roll 1st byte}, 13 {dddd of roll 2nd byte}, 0 {eeee of roll 2nd byte}, 247 (F0h, 7Dh, 00h, 0Ah, 00h, 29h, 74h, 01h, 00h, 05h, 0Ah, 00h, 0Fh, 0Dh, 03h, 00h, 00h, 02h, 0Dh, 00h, F7h)

The heading value from the Orient4D is ( 0 * 16 (ie. 4-bit shift) + 5 ) * 256 (ie. 8-bit shift) + 10 * 16 (i.e. 4-bit shift) + 0 = 1440 unsigned, so that the two’s complement signed value is also 1440, corresponding to 1440 / 16 = 90.00 degrees. The roll value from the Orient4D is ( 15 * 16 (ie. 4-bit shift) + 13 ) * 256 (ie. 8-bit shift) + 3 * 16 (i.e. 4-bit shift) + 0 = 64816 unsigned, so that the two’s complement signed value is 64816 – 65536 = -720. Corresponding to -720 / 16 = -45 degrees. The pitch value from the Orient4D is ( 0 * 16 (ie. 4-bit shift) + 2 ) * 256 (ie. 8-bit shift) + 13 * 16 (i.e. 4-bit shift) + 0 = 720 unsigned, so that the two’s complement signed value is also 720, corresponding to 720 / 16 = 45 degrees.

In host mode raw sensor data will be output immediately in I2C DATA messages.

In stand-alone mode a suitable configuration has to be set using the EDIT CONFIG command before any MIDI messages will be output. For example to output the Orient4D heading as MIDI controller 64 messages, the following message is sent:

240, 125, 0 {DEV}, 106 {EDIT CONFIG}, 1 {configuration number}, 0 {input}, 48 {control-change message}, 64 {controller number}, 1 {continuous signal processing}, 0 {threshold}, 127 {top}, 0 {noisegate}, 0 {time window}, 247 (F0h, 7Dh, 00h, 6Ah, 01h, 00h, 30h, 40h, 01h, 00h, 7Fh, 00h, 00h, F7h)

Other settings of the Orient4D sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ, which can be sent in both host and stand-alone mode. See also the datasheet linked from the Orient4D v1.0 webpage.