how do I use the REV through bore encoder
Wiring and Connection
To use the REV Through Bore Encoder, plug it into the encoder ports located near the motor ports on the expansion hub . Because the encoder has a high number of Counts per Revolution (CPR), it can lose steps if plugged into ports 1 or 2 .
Operating Mode
In the FIRST Tech Challenge control system, the REV Through Bore Encoder is used as a relative, incremental encoder using the quadrature communication protocol . Although the encoder supports absolute positioning, this capability is only available over PWM, which is inaccessible within the FTC control system .
Programming and Reading Data
- Reading Position: Call the
getCurrentPosition()method on theDcMotorobject associated with the port where the encoder is plugged in . - Resetting Position: Use
STOP_AND_RESET_ENCODERSto reset the encoder position to zero at the beginning of an OpMode . Otherwise, the position remains relative to the initial position of the shaft when the robot was powered on . - Velocity Warning: Avoid calling
getVelocity()on aDcMotorExobject with this encoder, as its high CPR can cause the returned 16-bit signed integer to overflow .
Additional Resources
For more specific details on different versions and control systems, refer to these restricted documents:
Was this right?