Open topic with navigation
How do you read encoders not attached to motors?
If you are using an encoder as a general position measuring device and do not have it attached to a motor, you can connect the encoder to any spare encoder input channel and read the encoder position using the "Encoder Only" Kinematic Module.
As a convenience, a sample "robot02.pac" and "calib02.pac" file are provided on the System Software Disk. These files configure a second, Encoder Only robot to read encoder channel 10 (the single ended encoder input in the 4th encoder connector) assuming the encoder generates 2048 counts per revolution.
Assuming you only have a single robot currently configured, to read an extra, non-motor encoder do the following:
- Copy the robot02.pac and calib02.pac files from the System Software Disk to the "config" folder in the controller's flash disk drive.
- Using the web interface, go to the Setup tab and access Parameter Database > Controller > System ID.
- Edit the "Robot types" (DataID 116) and add "7" as the second array element to specify that you wish to operate a "Encoder Only" Kinematic Module as your second robot.
- Save your changes to flash and restart the controller.
- If your encoder does not generate 2048 counts per revolution, modify the "Joint to motor scale factors" (DataID 2300) and the "Encoder counts for resolution calc" (DataID 10203) to reflect the proper resolution.
- If you connected the encoder to a channel other than 10, edit the "Encoder hardware channel number" (10026) to specify the correct channel.
- If you modified 10026, save your changes to flash and restart the controller.
- You can now read the encoder using the "Robot.WhereAngles(2)" method.