Difference between revisions of "Firmware-72 Function-122"

From I-CubeX Wiki
Jump to: navigation, search
(Created page with "==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...")
 
(Blanked the page)
Line 1: Line 1:
==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 an I2C DATA message. 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. Since the Orient3D has multiple output parameters the stand-alone mode settings are incremented by one for each extra output parameter. The following methods can be selected using the FUNCTION command’s method/parameter value FP:
 
 
<u>Orient3D v3.0</u>
 
{|
 
|1:
 
|Heading [0..3599]; an unsigned 16-bit value, where 3599 represents 359.9 degrees, sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Pitch [-85..85]; a signed 8 bit value, where 255 represents 359 degrees, sent as one 8-bit byte
 
|-
 
|
 
|Roll [-85..85]; a signed 8-bit value, where 255 represents 359 degrees, sent as one 8-bit byte
 
|-
 
|2:
 
|Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|3:
 
|Acceleration X-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Acceleration Y-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Acceleration Z-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|9:
 
|Magnetic Field Strength X, Y, Z, Acceleration X, Y, Z, in the same formats as above (host mode only)
 
|}
 
 
<u>Orient3D v3.1</u>
 
{|
 
|11:
 
|Heading [0..3599]; an unsigned 16-bit value, where 3599 represents 359.9 degrees, sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Pitch [-90..90]; a signed 8 bit value, where 255 represents 359 degrees, sent as one 8-bit byte
 
|-
 
|
 
|Roll [-90..90]; a signed 8-bit value, where 255 represents 359 degrees, sent as one 8-bit byte
 
|-
 
|12:
 
|Magnetic Field Strength X-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Magnetic Field Strength Y-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Magnetic Field Strength Z-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|13:
 
|Acceleration X-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Acceleration Y-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Acceleration Z-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|14:
 
|Gyro X-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Gyro Y-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes (MSB, LSB)
 
|-
 
|
 
|Gyro Z-axis; a signed two’s complement 16-bit value sent as two 8-bit bytes
 
19: Magnetic Field Strength X, Y, Z, Acceleration X, Y, Z,
 
|-
 
|
 
|Gyro X, Y, Z, in the same formats as above (host mode only)
 
|}
 
 
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 (address of device}, 125 {Orient3D}, 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, 0Bh, 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 data as a 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)
 
 
The sensor parameter’s raw values as output in a I2C DATA message are offset and scaled so as to fit in the channel voice  MIDI value range of either 0-127 (eg. control-change message) or 0-16383 (pitch-bend message).
 
 
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.
 

Revision as of 16:17, 3 November 2015