User Manual

MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
89
2.4.8 Encoder Commands
The following commands are used with the encoder(quadrature and absolute) hardware.
Command Description
16 Read Encoder Count/Value for M1.
17 Read Encoder Count/Value for M2.
18 Read M1 Speed in Encoder Counts Per Second.
19 Read M2 Speed in Encoder Counts Per Second.
20 Resets Encoder Registers for M1 and M2(Quadrature only).
22 Set Encoder 1 Register(Quadrature only).
23 Set Encoder 2 Register(Quadrature only).
30 Read Current M1 Raw Speed
31 Read Current M2 Raw Speed
78 Read Encoders Counts
79 Read Motor Speeds
16 - Read Encoder Count/Value M1
Read M1 encoder count/position.
Send: [Address, 16]
Receive: [Enc1(4 bytes), Status, CRC(2 bytes)]
Quadrature encoders have a range of 0 to 4,294,967,295. Absolute encoder values are converted
from an analog voltage into a value from 0 to 4095 for the full 5.1v range.
The status byte tracks counter underow, direction and overow. The byte value represents:
Bit0 - Counter Underow (1= Underow Occurred, Clear After Reading)
Bit1 - Direction (0 = Forward, 1 = Backwards)
Bit2 - Counter Overow (1= Underow Occurred, Clear After Reading)
Bit3 - Reserved
Bit4 - Reserved
Bit5 - Reserved
Bit6 - Reserved
Bit7 - Reserved