Firmware-75 Function-116

From I-CubeX Wiki
Revision as of 02:03, 5 October 2017 by Admin (talk | contribs)
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
0 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion W-axis; unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
1 Heading [0..5760]; a signed 16-bit value, where 5760 represents 360 degrees, sent as four 4-bit bytes (MSB .. LSB) Heading [0..90] or [0..11520]; an unsigned 7-bit or 14-bit value, where 90 or 11520 represents 360 degrees, sent as one or two 8-bit bytes (LSB, MSB)
Roll [-1440..1440]; a signed 16-bit value, where 1440 represents 90 degrees, sent as four 4-bit bytes (MSB .. LSB) Roll [19..109] or [2432..13952]; an unsigned 7-bit or 14-bit value, where the extremes represent -90 and 90 degrees, sent as one or two 8-bit bytes (LSB, MSB)
Pitch [-2880..2880]; a signed 16-bit value, where 2880 represents 180 degrees, sent as four 4-bit bytes (MSB .. LSB) Pitch [19..109] or [2432..13952]; an unsigned 7 bit or 14-bit value, where the extremes represent -180 and 180 degrees, sent as one or two 8-bit bytes (LSB, MSB)
2 Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength X-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength Y-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength Z-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
3 Acceleration X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Acceleration X-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Acceleration Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Acceleration Y-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Acceleration Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Acceleration Z-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
4 Gyro X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro X-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Gyro Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro Y-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Gyro Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro Z-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
5 Temperature [-40..85]; a signed 8-bit value sent as two 4-bit bytes (MSB .. LSB) Temperature [44..107] or [5632..13632]; an unsigned 7-bit or 14-bit value where 44 or 5632 and 107 or 13632 represent -40 and 85 ºC sent as one or two 8-bit bytes (LSB, MSB)
9 Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Temperature [-40..85]; a signed 8-bit value sent as two 4-bit bytes (MSB .. LSB)
12 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
13 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Acceleration X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
14 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Gyro X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
19 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Acceleration Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
Gyro Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB)
42 Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength X-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength Y-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Magnetic Field Strength Z-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
44 Gyro X-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro X-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Gyro Y-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro Y-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
Gyro Z-axis; a signed two’s complement 16-bit value sent as four 4-bit bytes (MSB .. LSB) Gyro Z-axis; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB)
100 Quaternion W-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion W-axis; unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion X-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion X-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion Y-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion Y-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
Quaternion Z-axis [0..16383]; an unsigned 16-bit value, where 16383 represents 1, sent as four 4-bit bytes (MSB .. LSB) Quaternion Z-axis [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 1, sent as one or two 8-bit bytes (LSB, MSB)
101 Heading [0..5760]; a signed 16-bit value, where 5760 represents 360 degrees, sent as four 4-bit bytes (MSB .. LSB) Heading [0..90] or [0..11520]; an unsigned 7-bit or 14-bit value, where 90 or 11520 represents 360 degrees, sent as one or two 8-bit bytes (LSB, MSB)
Roll [-1440..1440]; a signed 16-bit value, where 1440 represents 90 degrees, sent as four 4-bit bytes (MSB .. LSB) Roll [19..109] or [2432..13952]; an unsigned 7-bit or 14-bit value, where the extremes represent -90 and 90 degrees, sent as one or two 8-bit bytes (LSB, MSB)
Pitch [-2880..2880]; a signed 16-bit value, where 2880 represents 180 degrees, sent as four 4-bit bytes (MSB .. LSB) Pitch [19..109] or [2432..13952]; an unsigned 7 bit or 14-bit value, where the extremes represent -180 and 180 degrees, sent as one or two 8-bit bytes (LSB, MSB)
Calibration data; 4 bits each for the system, magnetometer, accelerometer and gyroscope sent as four 4-bit bytes Calibration data; an unsigned 7 bit or 14-bit value for the system, magnetometer, accelerometer and gyroscope sent as one or two 8-bit bytes (LSB, MSB)

Example:

In order to enable the Orient4D function to get the heading, pitch and roll data from an Orient3D sensor with I2C device address 40 (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}, 40 {device address}, 116 {Orient4D function}, 1 {heading/pitch/roll}, 247 (F0h, 7Dh, 00h, 08h, 00h, 28h, 74h, 01h, F7h)

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

240, 125, 0 {DEV}, 10 {I2C DATA}, 0 {I2C port}, 40 (device address}, 116 {Orient4D function}, 1 {heading/pitch/roll}, 0 {dddd of heading 1st byte }, 10 {eeee of heading 1st byte}, 8 {dddd of heading 2nd byte}, 12 {eeee of heading 2nd byte}, 2 {dddd of pitch}, 0 {eeee of pitch}, 13 {dddd of roll}, 15 {eeee of roll}, 247 (F0h, 7Dh, 00h, 0Ah, 00h, 28h, 74h, 01h, 00h, 0Ah, 08h, 0Ch, 02h, 00h, 0Dh, 0Fh, F7h)

The heading value from the Orient4D is ( 0 * 16 (ie. 4-bit shift) + 10 ) * 256 (ie. 8-bit shift) + 8 * 16 (i.e. 4-bit shift) + 12 = 2700, corresponding to 270.0 degrees. The pitch value from the Orient4D is 2 * 16 (i.e. 4-bit shift) + 0 = 32 unsigned, so that the two’s complement signed value is also 32, corresponding to 32 * 359 / 255 = 45 degrees. The roll value from the Orient4D is 13 * 16 (i.e. 4-bit shift) + 15 = 223 unsigned, so that the two’s complement signed value is 223 – 256 = -32. Corresponding to -32 * 359 / 255 = -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.