Warning
You are reading the documentation for an older Pickit release (3.1). Documentation for the latest release (3.4) can be found here.
Fanuc Pickit interface
This article documents the interface of the Fanuc Pickit integration. For installation instructions, please refer to the Fanuc installation and setup article.
Pickit macros
Below you find an overview of the macros defined by Pickit. These are all the macros used in the socket communication between the robot and Pickit. For more details on these macros, refer to Pickit socket interface.
Note
For R-J3iB controllers (V6), the macro names are restricted to 8 charaters. The same macros as described below are provided but under shorter names.
Tip
The macros can be assigned to hotkeys on the teach pendant. This is done in MENU > SETUP > Macro.
System macros
These macros send system-level commands to Pickit.
- PI_OPEN_COMMUNICATION()
Starts the socket communication between the robot and Pickit. Call this macro at the begining of your program.
- PI_RUN()
Check if Pickit is in Robot mode. If Pickit is not in robot mode, the other socket macros will fail. Set R[151:pi status] to 0 if in robot mode.
Detection macros
These macros are used to trigger detections and collect the results.
- PI_LOOK_FOR_OBJECT()
Trigger an image captured followed by an object detection using the currently active setup and product Configuration. This is the recommended detection command for fixed camera setups.
- PI_NEXT_OBJECT()
Request the next detected object.
- PI_CAPTURE_IMAGE()
Trigger Pickit to capture a camera image to be used by a following
PI_PROCESS_IMAGE()
command. This is the recommended detection method for camera-on-robot setups as it waits for the image to be captured. If the camera moves during image capture, a warning will be shown in the web interface.
- PI_PROCESS_IMAGE()
Trigger an object detection on the camera image that was previously captured via
PI_CAPTURE_IMAGE()
command (orPI_LOOK_FOR_OBJECT()
).
- PI_DETECTION_WITH_RETRIES()
Repeatedly trigger a Pickit object detection as long as nothing is found and the ROI is not empty, up to a number of attempts.
- Parameters
AR[1] – Max number of detection retries.
- PI_GET_RESULT()
This routine combines
PI_WAIT()
andPI_GET_PICK_POINT_DATA()
. It is the recommended way to collect the detection result. It should always be the next Pickit command after aPI_LOOK_FOR_OBJECT()
,PI_NEXT_OBJECT()
orPI_DETECTION_WITH_RETRIES()
request.
- PI_GET_PICK_POINT_DATA()
Request the pick point ID and pick point offset of the last requested object. Prefer using
PI_GET_RESULT()
instead.
- PI_WAIT()
Wait for Pickit reply with detection results. Prefer using
PI_GET_RESULT()
instead.
Configuration macros
These macros are used to change the active product and setup configuration.
- PI_CONFIGURE()
Load the specified setup and product Configuration.
- Parameters
AR[1] – Setup id.
AR[2] – Product id.
- PI_SET_CYLINDER()
Reset the dimension of the cylinder model.
- Parameters
AR[1] – Length [mm].
AR[2] – Diameter [mm].
- PI_SAVE_SETUP()
Save the active setup file.
- PI_SAVE_PRODUCT()
Save the active product file.
- PI_BUILD_BACKGROUND()
Build the background cloud used in Advanced filters.
Calibration macros
These macros are used to perform the robot-camera calibration.
- PI_CALIBRATE()
Detect the robot-camera calibration plate.
- PI_CALIB_CONF()
Configure the calibration.
- PI_CALIB_CAL()
Calculate the calibration.
- PI_CALIB_VAL()
Validate the calibration.
Monitoring macros
These macros are used to save data about a running application. This is specially useful when ramping up in production, as the stored data allows detecting eventual issues in the application.
Helper macros
Other macros not directly communicating with Pickit are also available to simplify the pick and place programming.
- PI_SET_PICK_POSE()
Specify the robot configuration to be used for the pick pose (see Run PI_SET_PICK_POSE for details).
- PI_SET_OFFSET()
Create the pose register in PR[PR_id] with all elements set to 0 except Z set to Z_offset. It is useful to create pre and post pick offsets.
- Parameters
AR[1] – Z_offset [mm].
AR[2] – PR_id.
- PI_REACH()
Check if
PR[51]+tool offset PR[1]
(pre pick pose),PR[51]
(pick pose) andPR[51]+tool offset PR[2]
(post pick pose) can be reached by the robot. The tool and user frame active when calling the macro are used for the check. Make sure that they correspond to the ones used for reaching the poses). See Example program for example of usage. For more advanced reachability checks see Low level reachability check.
Pickit registers
Below you find an overview of the variables used by Pickit. When using Pickit these variables cannot be used for anything else. More information about the variables can be found in Pickit socket interface.
Register |
Field name |
Description |
Type |
---|---|---|---|
R[141] |
command |
Command from robot to Pickit. |
Output |
R[142] |
payload 0 |
1st request payload (e.g. setup id). |
Output |
R[143] |
payload 1 |
2nd request payload (e.g. product id). |
Output |
R[144] |
retries |
Maximum number of retries for a Pickit detection. |
Output |
R[145] |
PR payload id |
Id of the Pose Register request payload. PR[id] will be sent as a pose request payload. |
Output |
R[149] |
comm status |
Used to check if socket communication is running. |
Input |
R[150] |
object status |
Pickit status of the object: OBJECT_FOUND, NO_OBJECTS, NO_IMAGE_CAPTURED or EMPTY_ROI. |
Input |
R[151] |
status |
Pickit response to previously received robot commands. |
Input |
R[152] |
obj age |
Time elapsed between the image capture and the moment the object information is sent to the robot. |
Input |
R[153] |
obj remaining |
Number of remaining objects that can be sent in next messages to the robot. |
Input |
R[154]-R[156] |
obj dim 1-3 |
[0]: length or diameter (mm) [1]: width or diameter (mm) [2]: height (mm). |
Input |
R[157] |
model id |
Input |
|
R[158] |
pick id |
ID of the pick point that was selected for the given object. |
Input |
R[159] |
pick ref id |
ID of the selected pick point’s reference pick point. |
Input |
R[160] |
reachability |
Set by PI_REACH to 0 if pre pick, pick and post pick pose are reachable. |
Output |
R[161] |
calib dist err |
Calibration validation distance error [mm]. |
Input |
R[162] |
calib or err |
Calibration validation orientation error [deg]. |
Input |
PR[51] |
pick pose |
Object pose expressed relatively to the robot base frame. |
Input |
PR[52] |
pick offset |
Pick point offset of the last requested object. |
Input |
PR[53] |
x rot |
Helper pose to set the configuration of the pick pose. |
Internal |
Tip
If these registers are already used on your robot, please contact us at support@pickit3d.com, and we will assist you in finding a solution.
Using pick offset in a robot program
To use the pick offset in a robot program, first a fixed pose has to be taught.
Then the offset can be applied to this fixed pose to correct from picking with an offset.
Following example shows how the pose drop off is corrected: J P[3:drop off] 100% FINE Tool_Offset,PR[52:pi pick offset]
.
Low level reachability check
The reachability check is performed by a low level karel program implemented by Pickit, namely PICKIT_REACH. Advance users can directly use it (see documentation below).
PICKIT_REACH (pr_id, offset_id)
Check reachability of "PR[pr_id], Tool_Offset, PR[offset_id]".
Note, currently active uframe and tool are used.
tp_param[1]: input: pr_id , Id of the PR to check the reach.
tp_param[2]: input: offset_id, Id of the tool_offset to add to the pose (OPTIONAL).
Returns results in R[160], 0 if reachable, 1 otherwise.