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
  • NEW Conveyor tracking guide (CB3 ≥ 3.8 and e-Series ≥ 5.2)

NEW Conveyor tracking guide (CB3 ≥ 3.8 and e-Series ≥ 5.2)

The conveyor tracking functionality adjusts robots paths to the motion of a conveyor.

Last modified on Jan 29, 2025

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 CB3 controller but can also be used on e-Series.

Important: Software version must be at least 3.8 (CB3) or 5.2 (e-Series).

For PolyScope versions prior to 3.8 and 5.2 see: https://www.universal-robots.com/articles/ur/programming/legacy-conveyor-tracking-guide-cb3-38-and-e-series-52/

Lower down on this page is an example of a linear and circular setup.

Note:
The CB3 and e-Series controller can decode signals at up to 40kHz

Script codes for conveyor tracking

Script code Description

encoder_enable_pulse_decode(encoder_index, decoder_ type, A, B)

Sets up an encoder hooked up to the pulse decoder of the controller

encoder_enable_set_tick_count(encoder_index, range_id)

Sets up an encoder expecting to be updated with tick counts via the function encoder_set_tick_count.

 encoder_set_tick_count(encoder_index, count) Tells the robot controller the tick count of the encoder. This function is useful for absolute encoders (e.g. MODBUS)
encoder_get_tick_count(encoder_index) Returns the tick count of the designated encod
stop_conveyor_tracking()

Stop tracking the conveyor, started by track_conveyor_linear() or track_conveyor_circular(), and decelerate all joint speeds to zero

track_conveyor_circular(center, ticks_per_revolution, rotate_tool) Makes robot movement follow a circular trajectory
rack_conveyor_linear(direction, ticks_per_meter) Makes robot movement follow a linear trajectory

 

Encoder setup

Conveyor tracking can use both absolute and incremental encoders

  • Incremental Encoders

Use script function encoder_enable_pulse_decode(encoder_index, decoder_ type, A, B) to make the robot controller decode pulses for encoder 0 or encoder 1 on digital input number "A" and "B". The supported types are:

0 : no encoder, pulse decoding is disabled.
1 : quadrature encoder, input A and B must be square waves with 90 degree offset. Direction of the conveyor can be determined.
2 : rising and falling edge on single input (A).
3 : rising edge on single input (A).
4 : falling edge on single input (A).

The controller can decode signals at up to 40kHz

A: Encoder input A pin. Must be 8-11.

B: Encoder input B pin. Must be 8-11.

For a linear conveyor, you can calculate the number of ticks per second with the following formula:

ticks_per_second = conveyor_speed[m/s] * encoder_resolution[ticks/revolution] / (2*pi*encoder_disc_radius[m/revolution])

  • Absolute Encoders

You can input absolute encoder readings into the controller with the function encoder_set_tick_count(encoder_index, count).

Do it in a thread in your program. If MODBUS signal MODBUS_1 contains readings from encoder 0:

Note: The function assumes that encoder 0 or encoder 1 is enabled using encoder_enable_set_tick_count(encoder_index, range_id) first. The “range_id” specifies the range of the encoder and is needed to handle wrapping nicely.

0 is a 32 bit signed encoder, range [-2147483648 ; 2147483647]

1 is a 8 bit unsigned encoder, range [0 ; 255]

2 is a 16 bit unsigned encoder, range [0 ; 65535]

3 is a 24 bit unsigned encoder, range [0 ; 16777215]

4 is a 32 bit unsigned encoder, range [0 ; 4294967295]

  • Check encoder counting

You can check the counting of encoder 0 or encoder 1 with the script function encoder_get_tick_count(encoder_index).



Track linear conveyor SIMULATED

Use the script function track_conveyor_linear(direction, ticks_per_meter) to enable tracking on linear conveyors. Use stop_conveyor_tracking() to return to normal operation. The direction is a pose value, note that only the three positional parameters are used.

The following program makes move along the x-axis of the robot base coordinate system due to the ticks of a simulated encoder in Thread_1:

Download sample program at the buttom of the page. File name is SIMULATED_track_linear_conveyor.urp



 

Track circular conveyor SIMULATED

Use the script function track_conveyor_circular(center, ticks_per_revolution, rotate_tool) to enable tracking on circular conveyors.

Use stop_conveyor_tracking() to return to normal operation.

The center is a pose value, determining the center which the conveyor rotates about.

You can use a feature as the center variable.

rotate_tool determines if the tool should rotate with the conveyor or stay in its original orientation.

Download sample program at the bottom of the page. File name is SIMULATED_track_circular_conveyor.zip

Important: It is required to download and load the installation file, included in the .zip file, as it contains a feature that defines the center of the conveyor

Attached files


CB3 3.8.zip
e-Series 5.2.zip

Attached files

CB3 3.8.zip
e-Series 5.2.zip

Related articles

Conveyor tracking: using encoder that outputs a Modbus register
Conveyor tracking: using encoder with digital pulses
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