Articles Download Safety & Security Forum myUR Go to Main Site

Universal Robots A/S
Energivej 51
DK-5260 Odense S

T: +45 8993 8989
sales@universal-robots.com

 
  • Articles
  • Download
  • Safety & Security
  • Forum
  • myUR
  • Go to Main Site
  • Support
  • Articles
  • Conveyor tracking: using encoder with digital pulses

Conveyor tracking: using encoder with digital pulses

Track linear conveyor using encoder with digital pulses

Last modified on Apr 11, 2024

Track linear conveyor using encoder with digital pulses

Step-by-step guide of how to setup conveyor tracking and pick part from conveyor.

The conveyor tracking functionality adjusts robots paths to the motion of a conveyor.
Conveyor tracking for linear and circular conveyors is available from software version 1.8.

This example is based on setup on a CB2 controller but can also be used on CB3.

Conveyor Setup

Initial setup:

  • Determine the desired conveyor tracking type

In this sample the robot will await a trigger signal (photo sensor).

When trigger is activated, the robot will move along a linear conveyor with same speed and pickup an object.

Conclusion: conveyor tracking type will be linear tracking.

  • Specify encoder type

Selected encoder type is an incremental quadrupel encoder from Wachendorff.

Product type is WDG 40A-100-ABN-H24-K2

It has 100 ppr (pulses per revolution) for each channel and outputs two digital signals, one for Channel A and one for channel B.

Datasheet for encoder: shaft-encoder-incremental-quadrature-optical-servo-flange-wdg40a.pdf

  • Hardware interface

Next is to specify the interface to the hardware that is used in the application. One digital input is needed for the photo sensor. Two digital outputs are needed for respectively start/stop the conveyor and open/close the gripper.

All hardware is controlled by CB2 controllers internal 24V DC supply and configured like this:

Description Signal
Trigger DI[0]
Encoder channel A DI[1]
Encoder channel B DI[2]
Conveyor START/STOP DO[0]
Gripper ON/OFF DO[8]

For I/O's on CB3 and e-Series, please consult the USer Manual.

Schematic drawing:

Converyor Drawing

 


The programming:

  • Setup encoder signal

First we need to define the setup of encoder signal.

We will use the script code conveyor_pulse_decode(type,A,B) for this.

This is the definition of the command copied from the script manual:

Conveyor Pulse Decode

Encoder type is quadrupel and we will use both a channel A (DI[1]) and a channel B (DI[2]), so the script code will look this this:
conveyor_pulse_decode(1,1,2)
  • Direction of conveyor

Next the direction of the conveyor must be determined.

Converyor Direction

Direction will be determined with a pose variable p[x,y,z,rx,ry,rz], where the direction can be scaled accordingly.

In this case the direction will be parallel to the X-axis of the robots Base frame, so the variable should look like this:
direction = p[1,0,0,0,0,0,0]
If direction is parallel to Y of Base-frame, it should instead be like:
direction = p[0,1,0,0,0,0]
If direction is angled 45 degrees offset to of Base-frame, it should be like:
direction = p[1,1,0,0,0,0]

So by scaling X, Y and Z value of the pose variable you can specify the direction of conveyor relative to the Base-frame of robot.

Another option to specify the direction of the conveyor is to teach two waypoints along the conveyor and use the script code pose_sub() for automatically calculate the direction.

This is a very easy and user-friendly way to do it:
direction = pose_sub(Waypoint_1,Waypoint_2)
  • Encoder pulses

Finally the amount of encoder pulses must be defined as ticks per meter.
We will use an integer variable for that purpose.

How to calculate ticks per meter:
tpm = rpm * ppr * multiple_per revolution

Where rpm = rotations of encoder disk per meter and ppr = pulses per revolution and where multiple_per_revolution = X1, X2 or X4 depending on the type of quadrature encoder used.

On the encoder used there is mounted a disc with a radius of 65 mm.

This gives the following tpm:
tpm = (1000/(2*phi*65)) * (100*4) = 980

Then we can use the two values for starting the conveyor tracking using the script code track_conveyor_linear(direction, ticks_per_meter):

Track Conveyor Linear

The script code will be inserted after the robot has detected the part with the trigger signal
A little delay is also inserted in order to syncronize the start of the robot with the position of the object (or the trigger sensor can be physically adjusted if preferred)

WAIT

trigger WAIT 0.15

track_conveyor_linear(direction, tpm)

Robot will then follow the speed of conveyor until conveyor tracking is stopped using the script code stop_conveyor_tracking()

Stop Conveyor Tracking

In order for the robot to pickup the object, it is required to insert two positions in the program, a WAIT position and a PICK position.

These positions can be recorded vertically in the same position with only difference the Z-height:

Converyor Side View

When program is running and conveyor tracking activated in the program, you will see that the robot follows the conveyor speed while picking up the object:

Conveyor Tracking

NOTE: direction and tpm will most likely have to be adjusted/optimized in order to obtain the correct speed and to ensure that robot moves parallel with conveyor.

This is how the final sample program looks:

Conveyor Program

Download sample program at the bottom of the page. File name is track_conveyor_linear_digital_pulses.urp

We have also attached a small video example. File name is Conveyor_tracking.mp4

Attached files


Conveyor_tracking.mp4
track_conveyor_linear_digital_pulses.urp

Attached files

Conveyor_tracking.mp4
track_conveyor_linear_digital_pulses.urp

Related articles

Conveyor tracking: using encoder that outputs a Modbus register
Conveyor tracking: FIFO queue
LEGACY Conveyor tracking guide (CB3 ≤ 3.8 and e-Series ≤ 5.2)
logo

Product

  • UR3e Robot
  • UR5e Robot
  • UR10e Robot
  • UR16e Robot
  • UR20 Robot
  • UR+ Products

Company

  • About us
  • Contact us
  • Careers We're hiring
  • UR merchandise

Training / Resources

  • Academy
  • Technical Resources
  • Articles
  • FAQ

Insights

  • Blog
  • Case stories
  • Content library
  • News centre
  • Podcast
  • Webinars & Events

Get in touch

  • Ask an Expert
  • Schedule a no-cost assessment
  • Find a distributor
  • Customer support

Connect with us

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube
  • Instagram
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com
  • Copyright @ Universal Robots 2025
  • Cookie policy
  • Privacy policy
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com

Copyright © Universal Robots 2025

Cookie policy
Privacy policy