How do I use absolute encoders on my Arm?
What are absolute encoders?
Absolute Encoders are encoders which read one rotation and persists between power cycles and reboots.
External Encoders
SmartMotorController s are only able to use the same encoders as the brand of the SmartMotorController. If you are using the wrong brand YAMS will through an exception.
Limitations of Absolute Encoders
Absolute encoders can only read from 0 rotations to 1 rotation. If you traverse the discontinuity point it will wrap back around. It does not travel past 1!
Check your gear ratio and mount!
Using the vendor hardware client ensure that the absolute encoder NEVER goes beyond 1 rotation. You will see that it goes beyond 1 rotation by the position wraps around from 1rotation to 0rotations. If this happens more than once the gear ratio is invalid and your SmartMotorController cannot use the absolute encoder as the primary feedback device.
You can use SmartMotorControllerConfig.withExternalEncoderGearing(1.0) to set the reduction gear ratio on the absolute encoder.
This could also be caused when the absolute encoders discontinuity point is within the range of movement, to solve this take the absolute encoder off and rotate the bearing to ensure it never reaches that discontinuity point during the range of motion.
Last updated
