Firmware-75 Function-125

From I-CubeX Wiki
Jump to: navigation, search

ORIENT3D (125, 7Dh)

The Orient3D function enables output of the Orient3D 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:

Orient3D v3.0

FP Data output in host mode Data output in stand-alone mode
1 Heading [0..3599]; an unsigned 16-bit value, representing [0..359.9] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading [0..112] or [0..14396]; an unsigned 7-bit or 14-bit value, representing [0..359.9] degrees,, sent as one or two bytes (LSB, MSB)
Pitch [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Pitch [21..106] or [2688..13632]; an unsigned 7 bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Roll [-85..85]; a signed 8-bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Roll [21..106] or [2688..13632]; an unsigned 7-bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
2 Magnetic Field Strength X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
3 Acceleration X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
9 Magnetic Field Strength X, Y, Z, Acceleration X, Y, Z, in the same formats as above (host mode only) No Output

Orient3D v3.1

FP Data output in host mode Data output in standalone mode
1 or 11 Heading [0..3599]; an unsigned 16-bit value, representing [0..359.9] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading; an unsigned 7-bit or 14-bit value, representing [0..359.9] degrees, sent as one or two bytes (LSB, MSB)
Pitch [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Pitch [21..106] or [2688..13632]; an unsigned 7 bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Roll [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Roll [21..106] or [2688..13632]; an unsigned 7-bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
12 Magnetic Field Strength X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
13 Acceleration X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
14 Gyro X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Gyro X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Gyro Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Gyro Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Gyro Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Gyro Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
19 Magnetic Field Strength X, Y, Z; Acceleration X, Y, Z; Gyro X, Y, Z (in the same format as above) No Output
Temperature; an unsigned 16-bit value sent as two bytes No Output
22 Heading [0..3599]; an unsigned 16-bit value, representing [0..359.9] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading; an unsigned 7-bit or 14-bit value, representing [0..359.9] degrees, sent as one or two bytes (LSB, MSB)
Pitch [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Pitch [21..106] or [2688..13632]; an unsigned 7 bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Roll [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Roll [21..106] or [2688..13632]; an unsigned 7-bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Magnetic Field Strength Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
23 Heading [0..3599]; an unsigned 16-bit value, representing [0..359.9] degrees, sent as nibbles in four bytes (MSB .. LSB) Heading; an unsigned 7-bit or 14-bit value, representing [0..359.9] degrees, sent as one or two bytes (LSB, MSB)
Pitch [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Pitch [21..106] or [2688..13632]; an unsigned 7 bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Roll [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Roll [21..106] or [2688..13632]; an unsigned 7-bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Acceleration X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Acceleration Z-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Acceleration Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
24 Heading [0..3599]; an unsigned 16-bit value, representing [0..359.9], sent as nibbles in four bytes (MSB .. LSB) Heading; an unsigned 7-bit or 14-bit value, representing [0..359.9], sent as one or two bytes (LSB, MSB)
Pitch [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Pitch [21..106] or [2688..13632]; an unsigned 7 bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Roll [-85..85]; a signed 8 bit value, representing [-85..85] degrees, sent as nibbles in two bytes (MSB .. LSB) Roll [21..106] or [2688..13632]; an unsigned 7-bit value or 14-bit value, representing [-85..85] degrees, sent as one or two bytes (LSB, MSB)
Gyro X-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Gyro X-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Gyro Y-axis; a signed two’s complement 16-bit value, sent as nibbles in four bytes (MSB .. LSB) Gyro Y-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
Gyro Z-axis; a signed two’s complement 16-bit value, sent as two bytes Gyro Z-axis; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)
29 Heading, Pitch, Roll (in the same format as above) No Output
Magnetic Field Strength X, Y, Z; Acceleration X, Y, Z; Gyro X, Y, Z (in the same format as above) No Output
Temperature; an unsigned 16-bit value sent as two bytes No Output
60 + N No Output N = number of any of the methods above; If included in the output as defined by method N: Heading, Pitch and Roll (in the same format as above)
No Output N = number of any of the methods above; If included in the output as defined by method N: Magnetic Field Strength X, Y, Z and/or Acceleration X, Y, Z and/or Gyro X, Y, Z are output as their absolute value; an unsigned 7-bit or 14-bit value, sent as one or two bytes (LSB, MSB)

Example:

In order to enable the Orient3D function to get the heading, pitch and roll data from an Orient3D sensor with I2C device address 96 (default Orient3D 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}, 96 {device address}, 125 {Orient3D function}, 1 {heading/pitch/roll}, 247 (F0h, 7Dh, 00h, 08h, 00h, 60h, 7Dh, 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}, 96 (device address}, 125 {Orient3D 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, 64h, 7Dh, 01h, 00h, 0Ah, 08h, 0Ch, 02h, 00h, 0Dh, 0Fh, F7h)

The heading value from the Orient3D 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 Orient3D 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 Orient3D 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 Orient3D 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 Orient3D 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 Orient3D v3.1 webpage.