Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with KUKA robots

From 3D scanning Knowledge base - Photoneo wiki
Revision as of 10:36, 27 August 2018 by Durovsky (talk | contribs)

Jump to: navigation, search

NOTE: Users are strongly recommended to read the general introduction to robot interfaces prior to installing specific robot modules.

1. Prerequisities

Photoneo KUKA Interface is compatible with KRC4 systems from v8.3.

In addition to compatible system version, the following conditions must also be met:

- Ethernet KRL Interface v.2.1 or higher installed

Switch to Expert Mode and browse to Menu -> Startup -> Additional Software to check if Ethernet KRL is available on robot controller:

KUKA Setting Up Guide Step 1.png


2. KUKA Controller setup

The following tutorial gives a step by step guide of how to configure your KUKA KRC4 controller and install all necessary files you will need to get the robot interface for Photoneo Binpicking Studio up and running.

This tutorial was originally written using the latest RobotWare v.6.06, however it should be compatible with older versions with minor changes.

2.1 Network configuration

NOTE: The network configuration procedure described below only works with RobotWareOS v.6 or higher. If you have an older version of RobotWareOS and need to change an IP address, please contact local ABB support.

Turn on the IRC5 Controller, wait for the Initialization Screen to appear, open the Menu screen and select the Control Panel option:


[[File:]]


In the Control Panel pane, select Controller Settings:


[[File:]]


Select Settings and choose the Network option:


[[File:]]


The Network Settings window should now appear. Use the Touch Panel Keypad to set the IP address of the IRC5 WAN port:


4. KRL

Photoneo KUKA interface was designed to be easily integrated into existing application written in KRL code. It provides two means which influence the final robot behavior:

- KRL API - set of RAPID requests (or procedures) used to control the bin picking sequence. Requests are defined in PhotoneoCommon module and used within MainModule

- XML CONFIG - CustomerDefinitions.mod holds an application specific settings such as gripper commands, motion speed, precision and overall bin picking sequence definition.

4.1 KRL API

The following API describes the functionality of requests provided by Photoneo KUKA Interface. These requests are intended for high level control of bin picking sequences and are usually called in main_app.src


PHO_RequestInit(start_pose:IN, end_pose:IN) - request to initialize bin picking application on the Vision Controller side. Start and End Poses defined by the operator on the pendant are transferred to the Vision Controller and used in the trajectory planning pipeline as start and terminus points.

PHO_ConnectToVC() - function to establish a connection to the Vision Controller. Blocking function; suspends the program until a proper connection is established. If the server running on the Vision Controller side is not running or does not respond, an error is raised and the RAPID program is terminated.

PHO_RequestScan() - request to trigger the next scan and localization. Non-blocking request; the RAPID program continues immediately at the next line.

PHO_WaitForScan() - function to wait for scan to be finished. This should be called after triggering the scan, but not immediately

PHO_RequestTrajectory() - request to start trajectory planning for current goal. Non-blocking function; the RAPID program continues immediately at the next line.

PHO_ReceiveTrajectory() - function to receive requested bin picking trajectories (consisting of a sequence of trajectory and gripper operations). This is usually called inside pho_bin_picking() function by default. Blocking function; waits for motion data to be received.

PHO_RequestCalibAdd() - request to add calibration point - a scan is triggered and the calibration is recalculated. Blocking request; the program will not continue until the calibration result is recalculated and has been received by the Robot Controller.

PHO_RequestCalibSet() - request to set current calibration result to the PhoXi Scanner

PHO_RequestCalibReset() - request to reset current calibration and remove all previously added points

PHO_PickObject() - request to execute bin picking operation. This usually receives the requested trajectory and performs motion execution. Blocking function; the program does not continue until the whole sequence is finished. Always make sure that the robot is in pho_start_bin_picking_pose before calling this function.


4.2 RAPID CONFIG

customer_definitions.src enables the user to configure several bin picking settings, including gripper command implementations, trajectory speed and precision adjustments.


- PHO_GripperAttach() - implement function for opening your gripper here

- PHO_GripperDeattach() - implement function for closing your gripper here

- PHO_GripperUser_1() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_2() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_3() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_4() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_5() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_6() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_7() - implement custom user gripper command (reserved for future use)

- PHO_GripperUser_8() - implement custom user gripper command (reserved for future use)

- binpicking_settings() - specify speed and precision settings for bin picking trajectories. Adopt the suitable number of trajectories to meet your bin picking setup. (the default setting is 4 trajectories)


4.3 KRL ERROR HANDLING

Photoneo KUKA interface provides basic error handling. If an error occurs during bin picking operations, the PHO_OCCURED_ERR flag is set to true. The PHO_ERR_CODE variable contains the code of the specific error which will helps to identify the source of the problem.

PHO_NO_ERR := 0 - Service response from Vision Controller is valid

PHO_SERVICE_ERR := 1 - Service response from Vision Controller is invalid.

PHO_UNKNOWN_REQ := 2 - The Vision Controller received an unknown request.

PHO_COM_FAILURE := 3 - Communication failure due to socket closure.

PHO_BAD_DATA := 4 - Data validation check has failed.

PHO_TIMEOUT := 5 - Communication failure due to socket timeout.

PHO_UNKNOWN_ERR := 99 - Unspecified internal error

PHO_PLANNING_FAILED := 201 - Trajectory planning has failed

PHO_NO_PART_FOUND := 202 - No part has been localized

PHO_NOT_INITIALIZED := 203 - Bin picking application has not been properly initialized on Vision Controller

PHO_PART_LOST := 204 - Part has been lost during motion execution


4.4 MAIN MODULE

The following section provides a detailed explanation of MainModule.mod - the module through which the user's application and Photoneo Bin Picking API are integrated together.

NOTE: If you use a pre-generated program from Robot Studio simulation do not use MainModule.mod directly. The following description serves only as an example of how to use Photoneo RAPID API.

4.4.1 main()

The main() procedure is simply a selection of which particular sub-procedure is about to be executed. Comment bin picking if you want to execute calibration comment calibration line if you want to execute bin picking.


5. Runtime

Apply RAPID changes, restart the Robot Controller; if everything is set correctly, you should see the following info screen on the Pendant:


Waiting for server 2.png


Make sure that your solution on the Deployment page of Binpicking Studio is running and Binpicking Status is in Waiting for a connection state as shown in the figure below:


ABB tutorial runtime waiting small.png


Open Main Menu, browse to Production Window and Set PP to Main - at the beginning of the main function:


Pp to main 2.png


Choose if you want to run the application in AUTO or MANUAL mode and adopt the speed override if required:


Override vel 2.png


Hit the Play button in AUTO mode or Enable + Play button in MANUAL mode and you should see the following application output:


Binpicking connected.png


You should notice that Binpicking Status has changed to the Connected state. It means that the Vision Controller has established a successful connection to the robot controller:


ABB tutorial runtime running.png


The robot should now start sending requests to the Vision Controller and execute bin picking movements.

NOTE: Ensure that you are ready to halt motion execution immediately. It is strongly recommended to reduce the speed to 10% of maximum during initial bin picking tests.