Author Topic: counting encoder pulses with a digital input  (Read 224 times)

0 Members and 1 Guest are viewing this topic.

Offline jerbear1960

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
counting encoder pulses with a digital input
« on: August 10, 2017, 11:07:09 PM »
I want to use an incremental encoder to track motor rotation (position is not important, just that the motor turns the correct amount each time it is turned on).  My plan is to use a digital input to count the encoder pulses, but I am not sure how to implement that in the UR program code.  The function would be as follows.
Variable encoder count is set to zero
Robot moves to position, motor is turned on.
motor runs until encoder count reaches a preset value
Motor turns off
Rinse and repeat, probably implemented in a sub-routine that can be called each time the robot moves to the next position.
Any help would be appreciated.