Library description
The library contains functions for parameterization of circular tracking: fnCircTrkParam(), function for recalculation of tracking based on incoming data: fnCircTrkRecalc() and a function implementing the tracking sequence fnTrkCircular(). These functions allow you to start circular tracking with picking or placing a single detail.
Tracking parameterisation - fnCircTrkParam()
With this function, we can set up basic adjustments for tracking. The following is a description of the arguments of the function:
value = fnCircTrkParam(mOffsetZ, mAccel, mDecel, mSyncDly, mTimeout, mHandOpen)
Argument
| Description
|
mOffsetZ
| height of passage over the workpiece (shift in the Z axis)
|
mAccel | acceleration of tracking |
mDecel | deceleration of tracking |
mSyncDly | time delay for synchronising speed between robot and rotary table |
mTimeout | timeout of tracking function - after this time workpiece is dropped from buffer |
mHandOpen
| direction of action of the gripper (0 - closing, 1 - opening)
|
Values returned by functions:
Value
| Description
|
1
| correct parameter setting
|
(other)
| an error in parameter appeared - no need for implementation for now
|
Tracking calibration - fnCircTrkRecalc()
This function is recalibrating tracking zones based on incoming workpiece position.
Pvalue = fnCircTrkRecalc()
This function requires no input parameters. It works on data provided from tracking buffer.
This function has one output value. It returns offseted position of tracking start position.
Output position should be used for next function in order to speed up operation.
Tracking sequence - fnTrkCircular()
value = fnTrkCircular(pWait, pReady, mHandDly, mHandNo)
The function is responsible for the implementation of the sequence of picking / placing the workpiece in tracking movement. The following is a description of the arguments of the function:
Argument
| Description
|
pWait
| position of waiting for workpiece |
pReady | position of the starting the tracking |
mHandDly
| delay for the gripper to maintain operation
|
mHandNo
| gripper (valve) number
|
Values returned by the function:
Value
| Description
|
1
| correct operation |
-1
| Error - workpiece passed while tracking |
-2 | Error - workpiece passed before tracking |
-3 | Error - workpiece radius mismatch |
-4 | Error - buffers count mismatch |
Sample project description
In the attachment there is a workspace which consist of all library files and programs operating on circular tracking. Brief description of included programs is written below.
Program name | Description |
TRK | Main program works in the order to pick workpiece in tracking and place it on the pallet |
A1 | initial configuration program for real application (online) |
CAM | vision sensor program for real application (online) |
VAR | Global variable program |
A1SIM | initial configuration program (simulation) |
CAMSIM | vision sensor program (simulation) |
FUNLIB | Standard functions library |
PARAMSETUP | Initial parameter program |
CIRCLETRKLIB | Conveyer circular arc tracking library |
Starting tracking using the library
Detailed information on how to start tracking can be found in the instructions (file bfp-a3520.pdf).
Provided project can be used in two versions - in order to prepare simulations and for creating real, final application.
Due to no hardware used in simulation some data needs to be generated / provided in different way.
Wiring of encoder
Details in chapter 5 of the instruction manual.
When wiring encoder to the robot controller, keep in mind these few important notes:
- when the TRMODE parameter is set to 0, it makes it impossible to read the encoder pulses. Run PARAMSETUP program or set TRMODE manually.
- table rotation should generate impulses that increases M_enc value. In other case tracking function might not work properly. To switch encoder direction, simply switch A and B phase wiring of encoder.
- external 5V power supply (i.e. from encoder PS) should be provided to robot controller.
Rotary table calibration
It is essential to provide the value of pulses per revolution for the rotary mechanism. This value should be set in A1 program.
Start, end and stop zones should be all in the range of robot movement.
It is recommended to teach positions for zones at the very end of table (marked as black circles).
These points are used to measure the centre of rotation for all following pieces.
Tracking zones should be taught in the fixed order!
Based on the graphics above:
Green zone - Position P_TrkStart
Yellow zone - Position P_TrkEnd
Red zone - Position P_trkStop
If order is wrong, robot might operate on tracking in wrong direction and cause damages to station.
Camera calibration and detection settings
In the case of tracking with a vision system, the camera should be calibrated, as a result of which we will obtain a relationship between the coordinates of the photo and the location of points in the robot space.
An example of how to perform such a procedure for Cognex cameras can be found in the manual (chapter 9).
Then define the task of detecting elements and set the parameters of communication with the robot.
Camera and Buffer Handler
The project includes CAMSIM, and CAM programs used to save positions to the tracking buffer.
CAMSIM simulates operation with camera by generating random position. Inside this program user can modify the region, where workpiece position might be generated. Configured region might be highlighted by selecting all Prange() positions and checking their location on 3D Monitor window.
In the case of the CAM program, communication with the camera is established, functions are used to trigger a photo, as well as to read and process data.
As an output of both programs, position and distance between this position and circle center (movement radius), is loaded on buffers.
It is important to note that for circular tracking 2 tracking buffer are used:
- first buffer is used in a standard way, to provide proper tracking sequence
- second buffer keeps original position sent by Vision sensor or generated by camera simulation. This value is used to calibrate tracking function just before tracking have started. In case of this buffer there should be no value provided for encoder nor selected encoder should not generate pulses.
Tracking application general insights
- TCP point of robot gripper (tool centre point, roughly the position of picking component) should be coaxial or at least close to last rotation axis of robot. When this shift is big and the orientation of handled workpieces changes, it might cause shortage of robot working envelope. When TCP is coaxial with last axis, orientation of the workpiece has no impact on working envelope of robot.
- Function fnCircTrkRecalc() should work seamlessly, but in some cases of application there might be required some simple adjustments inside library, for example adding or subtracting one full rotation of C coordinate (2*M_PI)
- In case of sensor tracking (where input position is fixed), fnCircTrkRecalc() can be triggered only once on the beginning of the program
- There is also additional library, called FUNLIB included in the project. It helps to reduce amount of code for a simple, repetitive operation. User can apply it in many other applications.
The description of the arguments of functions is in the file FUNLIB
Configuring project for making simulation
Required programs:
- PARAMSETUP
- VAR
- A1SIM
- CAMSIM
- TRK
- CIRCLETRKLIB
- FUNLIB
Unused programs:
- A1
- CAM
Follow these steps in order to create circular tracking simulation:
- Import specified programs to your workspace
- Run PARAMSETUP once. This operation is required to be done just once per whole workspace.
- Restart simulation.
- Open A1SIM program and perform configuration based on the description in the code. In case of simulation modification, reopen this program again to adapt simulation layout.
- When saving program, make sure to check last option of saving external (global) variables.
- Run A1SIM once. This operation is required to be done after every startup of simulation.
- Open
- Open TRK program and make sure that CAMSIM program will operate in this application. Update Phome and Pwait positions.
- Perform any further modification based on your needs, like tracking offset, override speed, picking/placing static sequence, etc.
- Run TRK program.
Configuring project for making real application
Required programs:
- PARAMSETUP
- VAR
- A1
- CAM
- TRK
- CIRCLETRKLIB
- FUNLIB
Unused programs:
- A1SIM
- CAMSIM
Follow these steps in order to create circular tracking real application:
- Import specified programs to your workspace
- Run PARAMSETUP once. This operation is required to be done just once per whole workspace.
- Restart robot controller.
- Make sure that encoder is working properly. When rotary table rotates in expected direction, encoder should increase the M_enc() value in robot variables.
- Open A1 program on Teaching Pendant. Go through all the instructions inside the program. This operation is required to be done after each layout modification.
- Perform camera calibration and configuration based on manufacturers documentation.
- Provide camera configuration in Ethernet settings of RC. (Online -> Parameter -> Communication parameter -> Device & Line)
- Open CAM program. Perform modification based on the camera communication configuration and job used.
- Open TRK program and make sure that CAM program will operate in this application. Update Phome and Pwait positions.
- Perform any further modification based on your needs, like tracking offset, override speed, picking/placing static sequence, etc.
- Test TRK program carefully and perform further updates till reaching appropriate effect.
Attachments:
File name
| Description
|
_Circular Vision Tracking Sample.7z
| RTT3 Workspace |
bfp-a3520.pdf | Manual |