Conveyor tracking: using encoder with digital pulses
Track linear conveyor using encoder with digital pulses
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.
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:
- 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:
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.
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] |
direction = p[0,1,0,0,0,0] |
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.
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):
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()
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:
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:
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:
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