|OFFICIAL Answers - Ask the VEX Staff! Can't find the answer you're looking for in the FAQs? Post NEW questions here to get an official tech-support response from a VEX Staff Member!|
VEX I2C Integrated motor Encoder Device Spec
The Integrated Motor Encoder (IME) defaults to address 0x60 and is terminated (on power-up). Once the address of the 1st device in the chain has been changed (via REG 0x4D), the terminator must be disabled (via REG 0x4B) in order to communicate to the next device in the chain. When the IME is in the "Disable Terminator" state, it passes the I2C Clock and Data lines to the next device in the I2C chain. When a device is in the "Enable Terminator" state, it does not pass on the I2C Clock and Data lines. The last device in the chain must be terminated (via REG 0x4C).
The suggested address range must be from 0x20 to 0x5E and each device address must be an even number. All devices in the chain can be reset by using a general call address (0x00) followed by a reset command sequence (via REG 0x4E). All device configurations can be erased using the proper command sequence during a general call.
Once the device is powered up, the LED will remain yellow until a new address has been received (via REG 0x4D).
The following is a description of each read only (RO) or write only (WO) register.
Register Address (RO unless specified)
0x00-0x07 Version (Ascii Version #)
0x08-0x0F Vendor (Ascii Vendor “VEX”)
0x10-0x18 Device ID (Ascii Device ID)
0x20 Read Device Information
Byte0 Version #
Byte1 Type (1: IME)
Byte2 Board Id (2: Small IME, 3: Large IME)
Byte3 Device Status
Bit 0 Termination (0:Not Terminated, 1:Terminated)
Bit 1 Overflow (0:No Overflow, 1:Overflow Occurred)
Bit 2 Diagnostic Mode (0: off, 1: on)
Bits 3-7 N/A
0x40-0x47 Read Device Data (Rotation tics 48bits, Velocity 16bits)
0x40 Rotation tics bits 15-08 (Msb)
0x41 Rotation tics bits 07-00 (Lsb)
0x42 Rotation tics bits 31-24 (Msb)
0x43 Rotation tics bits 23-16 (Lsb)
0x44 Velocity bits 15-08 (Msb)
0x45 Velocity bits 07-00 (Lsb)
0x46 Rotation tics bits 47-40 (Msb)
0x47 Rotation tics bits 39-32 (Lsb)
0x4A (WO) Clear Device Counters
0x4B (WO) Disable Terminator (so next device on chain can be seen)
0x4C (WO) Enable Terminator (Default, device is last in chain)
0x4D (WO) Change device address
Byte0 New address (Range from 0x20 – 0x5E)
*** Note: if the device is reset it will revert to factor default address
0x60-9B (RO) Read Scratch Pad Data (60 bytes)
0xA0-DB (WO) Write Scratch Pad Data (60 bytes)
This register will only operate on a General Call Address (0x00)
0x4E (WO) Reset ALL VEX Devices
Byte0 = 0xCA (Command Byte)
Byte1 = 0x03 Reset Device
The following is a description of LED patterns:
Yellow - not initialized (default Address)
Every 3 sec
Slow Green Blip - initialized and in neutral
Slow Green Double Blip - initialized, neutral and terminated
Slow Green Micro Blip - initialized, device is idle
Blinking Green - relative to speed
Solid Green - full speed in either direction
Yellow (same as Green patterns) - counter overflow
Solid Red - data is being written to EEprom (1sec)
Blinking Red - address range error (a valid address will clear error)
Last edited by JVN; 03-08-2012 at 02:32 PM.
Re: VEX I2C Integrated motor Encoder Device Spec
The "velocity bits" are really delta-time per encoder gear revolution, so 1/speed. The units are in 64 microsecond tics per encoder revolution for the 269 IME and 64 microsecond tics per encoder half-revolution for the 393 IME. The values increase as the rotation rate slows, with stopped for more than 4 seconds being reported as 0xFFFF. The values are only Magnitude and do not include a Sign bit for direction. Doing sequential Rotation reads can get you direction.
For the 269 IME, the encoder wheel turns 30.056 times per output revolution. To get velocity bits into rpm, do the following. Multiple the value (in tics / encoder rev) times 0.000064 (seconds / tic) to get a value in (seconds / encoder rev). Take the reciprocal to get a value in (encoder rev / second). Multiply by 60 (seconds / minute) and 1/30.056 (output rev / encoder rev) to get your value in (output rev / minute).
For the 393 IME with the factory (torque) gearing, the encoder wheel turns 39.2 times per output revolution. To get velocity bits into rpm, do the following. Multiple the value (in tics / half-encoder rev) times 0.000064 (seconds / tic) and times 2 (half-encoder rev / encoder-rev) to get a value in (seconds / encoder rev). Take the reciprocal to get a value in (encoder rev / second). Multiply by 60 (seconds / minute) and 1/39.2 (output rev / encoder rev) to get your value in (output rev / minute).
For the 393 IME with the speed gearing, the encoder wheel turns 24.5 times per output revolution. To get velocity bits into rpm, do the following. Multiple the value (in tics / half-encoder rev) times 0.000064 (seconds / tic) and times 2 (half-encoder rev / encoder-rev) to get a value in (seconds / encoder rev). Take the reciprocal to get a value in (encoder rev / second). Multiply by 60 (seconds / minute) and 1/24.5 (output rev / encoder rev) to get your value in (output rev / minute).
Processor and reprogrammability:
The processor is currently an STM8S103F3. It has EEPROM, but user access to it is not supported other than as listed in the specification. The FASTROM factory programming is not currently used. The firmware is not upgradeable via I2C. The part is in-circuit programmed via the SWIM port, but the source code is proprietary.
125 kHz rate:
The 0.000064 seconds per encoder revolution does correlate to a 125 kHz rate with four each black to white and white to black transitions of the encoder.
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|