Difference between revisions of "Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with KUKA robots"

From 3D scanning Knowledge base - Photoneo wiki
Jump to: navigation, search
Line 9: Line 9:
 
* - '''Ethernet KRL Interface v.2.1 or higher ''' installed  
 
* - '''Ethernet KRL Interface v.2.1 or higher ''' installed  
  
In order to check if Ethernet KRL is available on robot controller Switch to '''Expert Mode''' and browse to '''Menu''' -> '''Startup''' -> '''Additional Software''':
+
In order to check if Ethernet KRL is available on the robot controller, switch to '''Expert Mode''' and browse to '''Menu''' -> '''Startup''' -> '''Additional Software''':
  
  
Line 16: Line 16:
 
== 2. KUKA Controller setup ==
 
== 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.  
+
The following tutorial gives a step by step guide of how to configure your KUKA KRC4 controller and install all the 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 '''KRC4 system version 8.3''' and KUKA AGILUS KR6 R900 sixx robot.  
 
This tutorial was originally written using the latest '''KRC4 system version 8.3''' and KUKA AGILUS KR6 R900 sixx robot.  
Line 24: Line 24:
 
Photoneo KUKA Module utilizes TCP/IP communication for transferring data between KRC4 Robot Controller and Vision Controller.  
 
Photoneo KUKA Module utilizes TCP/IP communication for transferring data between KRC4 Robot Controller and Vision Controller.  
  
As a first step in commissioning, ensure that IP address of KRC4 controller meets your network configuration requirements  
+
As a first step in commissioning, ensure that the IP address of the KRC4 controller meets your network configuration requirements  
  
 
Switch to '''Expert Mode''', open the '''Menu screen''' and select the '''Startup'''-> '''Network Configuration''' option:
 
Switch to '''Expert Mode''', open the '''Menu screen''' and select the '''Startup'''-> '''Network Configuration''' option:
Line 32: Line 32:
  
  
Amend network configuration to meet your requirements:
+
Amend the network configuration to meet your requirements:
  
  
Line 38: Line 38:
  
  
KRC4 Control PC needs to be rebooted in order to apply new network configuration.  
+
KRC4 Control PC needs to be rebooted in order to apply the new network configuration.  
  
 
Open the '''Menu Screen''' and select the '''Shutdown''' -> '''Reboot control PC''' option:
 
Open the '''Menu Screen''' and select the '''Shutdown''' -> '''Reboot control PC''' option:
Line 50: Line 50:
 
The first step in the installation of Photoneo KUKA Module is to '''copy the files from the Photoneo KUKA Module Archive to the Robot Controller'''.
 
The first step in the installation of Photoneo KUKA Module is to '''copy the files from the Photoneo KUKA Module Archive to the Robot Controller'''.
  
The Photoneo KUKA Module consists of following files:
+
The Photoneo KUKA Module consists of the following files:
  
 
* '''Photoneo EthernetKRL Config Folder'''
 
* '''Photoneo EthernetKRL Config Folder'''
Line 72: Line 72:
 
Photoneo EthernetKRL Config folder contains two XML files - ''pho_state_server.xml'' and ''pho_bp_client.xml''.  
 
Photoneo EthernetKRL Config folder contains two XML files - ''pho_state_server.xml'' and ''pho_bp_client.xml''.  
  
Copy these files from USB stick to ''C:\System\KRC\Roboter\Config\User\Common\EthernetKRL\'' as shown in the figure below:
+
Copy these files from the USB stick to ''C:\System\KRC\Roboter\Config\User\Common\EthernetKRL\'' as is shown in the figure below:
  
  
Line 80: Line 80:
 
XML files hold the configuration of EKI communication interface. The only entries that need to be changed are the '''IP address tags'''.
 
XML files hold the configuration of EKI communication interface. The only entries that need to be changed are the '''IP address tags'''.
  
Enter the '''IP address of the Vision Controller to External IP tag''' in ''pho_bp_client.xml'' as shown in the figure below:   
+
Enter the '''IP address of the Vision Controller to External IP tag''' in ''pho_bp_client.xml'' as is shown in the figure below:   
  
  
Line 86: Line 86:
  
  
Enter the '''IP address of the Robot Controller to Internal IP tag''' in ''pho_state_server.xml'' as shown in the figure below:  
+
Enter the '''IP address of the Robot Controller to Internal IP tag''' in ''pho_state_server.xml'' as is shown in the figure below:  
  
  
Line 92: Line 92:
  
  
'''Save the changes and reboot control PC''' again to apply new EthernetKRL interface configuration.
+
'''Save the changes and reboot the control PC''' again to apply the new EthernetKRL interface configuration.
  
 
Ports utilized by Photoneo KUKA Module:
 
Ports utilized by Photoneo KUKA Module:
Line 105: Line 105:
 
* - '''$FLAG[102]''' - Bin Picking Data Received
 
* - '''$FLAG[102]''' - Bin Picking Data Received
  
'''NOTE: Prevent using these flags and ports in the rest of your application!!!'''
+
'''NOTE: Do NOT use these flags and ports in the rest of your application!!!'''
  
 
=== 3.2 Copy Photoneo & Program files===
 
=== 3.2 Copy Photoneo & Program files===
  
Photoneo folder contains internal files that should not be edited by user.  
+
The Photoneo folder contains internal files that should not be edited by user.  
  
'''Copy the whole Photoneo folder from USB Stick to the R1 folder'''/ (Ignore compilation errors now, just copy files):
+
'''Copy the entire content of Photoneo folder from the USB Stick to the R1/Photoneo/ folder'''/ (Compilation errors can be ignored for now - just copy the files):
  
  
Line 117: Line 117:
  
  
'''It is highly recommended to hide Photoneo folder from Operator reach'''.  
+
'''It is highly recommended to hide the Photoneo folder from the Operator's reach'''.  
  
Switch to Expert Mode, and set the '''System''' flag in the Properties of Photoneo folder:
+
Switch to Expert Mode, and set the '''System''' flag in the Properties of the Photoneo folder:
  
  
Line 125: Line 125:
  
  
Program folder contains files which should be adapted by user in order to meet application requirements.  
+
The program folder contains files which should be adapted by the user in order to meet application requirements.  
  
Do not replace the whole program folder, '''only copy three files from Photono_KUKA_Module archive to R1/Program Folder''':  
+
Do not replace the whole program folder, '''only copy three files from the Photono_KUKA_Module archive to R1/Program Folder''':  
  
  
Line 137: Line 137:
 
=== 3.3 State Server configuration ===
 
=== 3.3 State Server configuration ===
  
In order to get State Server up and running, it is necessary to edit Submit Interpreter program '''sps.sub in R1/System'''.
+
In order to get State Server up and running, it is necessary to edit the Submit Interpreter program '''sps.sub in R1/System'''.
  
Switch to '''Expert Mode''' and '''deselect Submit interpreter''' program before doing any changes:  
+
Switch to '''Expert Mode''' and '''deselect the Submit Interpreter''' program before making any changes:  
  
  
Line 145: Line 145:
  
  
As shown in the figure below, add following '''two lines of code to the original sps.sub''' file.  
+
As is shown in the figure below, add the following '''two lines of code to the original sps.sub''' file.  
  
'''PHO_StatePublisherInit()''' goes to the '''USER INI''' section while and '''PHO_PublishState()''' goes to the '''USER PLC''' section:
+
'''PHO_StatePublisherInit()''' goes to the '''USER INI''' section while '''PHO_PublishState()''' goes to the '''USER PLC''' section:
  
  
Line 153: Line 153:
  
  
'''State Server is necessary for calibration and visualization purposes'''. As soon as you '''restart Submit interpreter''' it should be up and waiting for connection from the Vision Controller.  
+
'''State Server is necessary for calibration and visualization purposes'''. As soon as you '''restart Submit Interpreter''', it should be up and waiting for connection from the Vision Controller.  
  
As was mentioned above State Server occupies '''$FLAG[100]''' and listens on the port '''54601'''.  
+
As was mentioned above State Server occupies '''$FLAG[100]''' and listens on port '''54601'''.  
  
 
=== 3.4 Bin Picking Client Configuration ===
 
=== 3.4 Bin Picking Client Configuration ===
  
Bin Picking Client can be launched using ''main_application.src''. The main application contains definitions of fixed robot poses, bin picking initialization and the main bin picking loop.  
+
The Bin Picking Client can be launched using ''main_application.src''. The main application contains the definitions of fixed robot poses, bin picking initialization and the main bin picking loop.  
  
'''User is expected to reteach home, start, end & placing positions, before selecting this file for launch'''. See Section 4 for more info on ''main_application.src''  
+
'''Users are expected to reteach home, start, end & placing positions before selecting this file for launch'''. See Section 4 for more information on ''main_application.src''  
  
As was mentioned above, Bin Picking Client occupies '''$FLAG[101] & FLAG[102]''' and utilizes port '''54602' to connect to bin picking server running on the Vision Controller''.   
+
As was mentioned above, the Bin Picking Client occupies '''$FLAG[101] & FLAG[102]''' and utilizes Port '''54602' to connect to the bin picking server running on the Vision Controller''.   
  
''NOTE: When PLC is used as a high level controller, the code from ''main_applications.src'' can be divided into separate programs and launched directly from cell.src.''  
+
''NOTE: When PLC is used as a high-level controller, the code from ''main_applications.src'' can be divided into separate programs and launched directly from cell.src.''  
  
 
== 4. KRL ==
 
== 4. KRL ==
  
Photoneo KUKA interface was designed to be easily integrated into existing application written in KRL code. KRL API and KRL Config should be used to adapt default bin picking template to the requirements of specific application.     
+
Photoneo KUKA interface was designed to be easily integrated into existing applications written in KRL code. KRL API and KRL Config should be used to adapt default bin picking template to the requirements of specific applications.     
  
- '''KRL API''' - is set of KRL procedures used to control the bin picking sequence. Bin Picking initialization, main loop and error handling are implemented here. Please keep the order of request calls as defined in basic template.   
+
- '''KRL API''' - is set of KRL procedures used to control the bin picking sequence. Bin Picking initialization, main loop and error handling are implemented here. Please retain the order of request calls as defined in basic template.   
  
- '''KRL CONFIG''' - '''customer_definitions.src''' enables user to configure application specific settings such as gripper commands, velocity, acceleration and approximation distances.  
+
- '''KRL CONFIG''' - '''customer_definitions.src''' enables users to configure application specific settings such as gripper commands, velocity, acceleration and approximation distances.  
  
 
=== 4.1 KRL API ===
 
=== 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_application.src''  
+
The following API describes the functionality of requests provided by the Photoneo KUKA Interface. These requests are intended for high level control of bin picking sequences and are usually called in ''main_application.src''  
 
--------------------------------------------------------
 
--------------------------------------------------------
 
'''PHO_ConnectToVC()''' - function to establish a connection to the Vision Controller. Blocking function; suspends the program until a proper connection is established.  
 
'''PHO_ConnectToVC()''' - function to establish a connection to the Vision Controller. Blocking function; suspends the program until a proper connection is established.  
  
'''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_RequestInit(start_pose:IN, end_pose:IN)''' - request to initialize the 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_RequestScan()''' -  request to trigger the next scan and localization. Non-blocking request; the KRL program continues immediately at the next line.
 
'''PHO_RequestScan()''' -  request to trigger the next scan and localization. Non-blocking request; the KRL program continues immediately at the next line.
Line 191: Line 191:
 
'''PHO_ReceiveTrajectory()''' - function to receive requested bin picking operations (consisting of a sequence of trajectories and gripper commands). Blocking function; waits for bin picking data to be received.   
 
'''PHO_ReceiveTrajectory()''' - function to receive requested bin picking operations (consisting of a sequence of trajectories and gripper commands). Blocking function; waits for bin picking 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 not received by the Robot Controller.
+
'''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 received by the Robot Controller.
  
 
'''PHO_RequestCalibSet()''' - request to set current calibration result to the PhoXi Scanner
 
'''PHO_RequestCalibSet()''' - request to set current calibration result to the PhoXi Scanner
Line 224: Line 224:
 
- '''PHO_GripperUser_8()''' - implement custom user gripper command (reserved for future use)
 
- '''PHO_GripperUser_8()''' - implement custom user gripper command (reserved for future use)
  
- '''PHO_BinpickingSettings()''' - specify velocities, accelerations and approximation distances for bin picking trajectories (SPLINE segments). Adapt the number of trajectories to meet your Bin Picking Studio Setup. (by default 4 trajectories are used)  
+
- '''PHO_BinpickingSettings()''' - specify velocities, accelerations and approximation distances for bin picking trajectories (SPLINE segments). Amend the number of trajectories to meet your Bin Picking Studio Setup. (by default 4 trajectories are used)  
 
--------------------------------------------------------
 
--------------------------------------------------------
  
Line 235: Line 235:
 
'''PHO_SERVICE_ERR := 1''' - Service response from Vision Controller is invalid.
 
'''PHO_SERVICE_ERR := 1''' - Service response from Vision Controller is invalid.
  
'''PHO_UNKNOWN_REQ := 2''' - The Vision Controller received an unknown request.
+
'''PHO_UNKNOWN_REQ := 2''' - Vision Controller received an unknown request.
  
 
'''PHO_COM_FAILURE := 3''' - Communication failure due to socket closure.   
 
'''PHO_COM_FAILURE := 3''' - Communication failure due to socket closure.   
Line 256: Line 256:
 
=== 4.4 MAIN MODULE ===
 
=== 4.4 MAIN MODULE ===
  
The following section provides a source code of '''main_application.src''' - the basic template which demonstrates how the user's application and Photoneo Bin Picking API can be integrated together.  
+
The following section provides the source code of '''main_application.src''' - the basic template which demonstrates how the user's application and Photoneo Bin Picking API can be integrated together.  
  
  
Line 263: Line 263:
 
== 5. Runtime ==
 
== 5. Runtime ==
  
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:
+
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 is shown in the figure below:
  
  
Line 277: Line 277:
  
  
Start the program on the robot controller and you should see the program pointer starting to execute program lines:  
+
Start the program on the robot controller and you should see the program pointer start to execute the program lines:  
  
  
Line 283: Line 283:
  
  
You should also 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:
+
You should also notice that '''Binpicking Status''' has changed to the '''Connected''' state. This means that the Vision Controller has established a successful connection to the robot controller:
  
  
Line 291: Line 291:
 
The robot should now start sending requests to the Vision Controller and execute bin picking movements.
 
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.'''
+
'''NOTE: Ensure that you are ready to halt motion execution immediately in case of any problem. It is strongly recommended to reduce the speed to 10% of maximum during initial bin picking tests.'''
  
  
 
== 6. Monitoring bin picking related variables ==
 
== 6. Monitoring bin picking related variables ==
  
Since KUKA UI does not provide a standard "Terminal" utility, it is recommended to use '''Display tool''' to monitor values of specific bin picking related variables:
+
Since KUKA UI does not provide a standard "Terminal" utility, users are recommended to use '''Display tool''' to monitor values of specific bin picking related variables:
  
 
* - '''PHO_DEBUG''' - flag which enables user to turn msgNotify logs ON and OFF
 
* - '''PHO_DEBUG''' - flag which enables user to turn msgNotify logs ON and OFF
Line 304: Line 304:
 
* - '''info_data''' - integer value important for oriented placing is stored in this variable.  
 
* - '''info_data''' - integer value important for oriented placing is stored in this variable.  
  
* - '''binpicking_operations[]''' - array which holds the current sequence of types of bin-picking operations as received from Vision Controller.  
+
* - '''binpicking_operations[]''' - array which holds the current sequence of types of bin-picking operations as received from the Vision Controller.  
  
* - '''trajectory_sizes[]''' - array which hold the information about number of way-points in each particular trajectory in bin picking sequence.
+
* - '''trajectory_sizes[]''' - array which holds information about the number of way-points in each particular trajectory in bin picking sequence.
  
  
 
[[File:  KUKA SettingUpGuide Step16.png]]
 
[[File:  KUKA SettingUpGuide Step16.png]]

Revision as of 15:27, 30 August 2018

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

1. Prerequisities

Photoneo KUKA module prerequisities:

  • - KRC4 system v.8.3 or higher
  • - Ethernet KRL Interface v.2.1 or higher installed

In order to check if Ethernet KRL is available on the robot controller, switch to Expert Mode and browse to Menu -> Startup -> Additional Software:


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 the 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 KRC4 system version 8.3 and KUKA AGILUS KR6 R900 sixx robot.

2.1 Network configuration

Photoneo KUKA Module utilizes TCP/IP communication for transferring data between KRC4 Robot Controller and Vision Controller.

As a first step in commissioning, ensure that the IP address of the KRC4 controller meets your network configuration requirements

Switch to Expert Mode, open the Menu screen and select the Startup-> Network Configuration option:


KUKA SettingUpGuideStep2.png


Amend the network configuration to meet your requirements:


KUKA SettingUpGuideStep3.png


KRC4 Control PC needs to be rebooted in order to apply the new network configuration.

Open the Menu Screen and select the Shutdown -> Reboot control PC option:


KUKA SettingUpGuide Restart.png


3. Photoneo KUKA Module Setup

The first step in the installation of Photoneo KUKA Module is to copy the files from the Photoneo KUKA Module Archive to the Robot Controller.

The Photoneo KUKA Module consists of the following files:

  • Photoneo EthernetKRL Config Folder
  • - pho_bp_client.xml
  • - pho_state_server.xml
  • Photoneo Folder
  • - pho_state_server.src
  • - pho_common.src
  • - pho_motion.src
  • - pho_common.dat
  • - pho_motion.dat
  • Program Folder
  • - customer_definitions.src
  • - main_application.src
  • - main_application.dat

3.1 Ethernet KRL config

Photoneo EthernetKRL Config folder contains two XML files - pho_state_server.xml and pho_bp_client.xml.

Copy these files from the USB stick to C:\System\KRC\Roboter\Config\User\Common\EthernetKRL\ as is shown in the figure below:


KUKA SettingUpGuideStep4 v3.png


XML files hold the configuration of EKI communication interface. The only entries that need to be changed are the IP address tags.

Enter the IP address of the Vision Controller to External IP tag in pho_bp_client.xml as is shown in the figure below:


KUKA SettingUpGuideStep5 v2.png


Enter the IP address of the Robot Controller to Internal IP tag in pho_state_server.xml as is shown in the figure below:


KUKA SettingUpGuideStep6.png


Save the changes and reboot the control PC again to apply the new EthernetKRL interface configuration.

Ports utilized by Photoneo KUKA Module:

  • - State Server Port: 54601
  • - Bin Picking Client Port: 54602

Flags occupied by EthernetKRL functions:

  • - $FLAG[100] - State Server Connection Alive
  • - $FLAG[101] - Bin Picking Connection Alive
  • - $FLAG[102] - Bin Picking Data Received

NOTE: Do NOT use these flags and ports in the rest of your application!!!

3.2 Copy Photoneo & Program files

The Photoneo folder contains internal files that should not be edited by user.

Copy the entire content of Photoneo folder from the USB Stick to the R1/Photoneo/ folder/ (Compilation errors can be ignored for now - just copy the files):


KUKA SettingUpGuideStep7 v2.png


It is highly recommended to hide the Photoneo folder from the Operator's reach.

Switch to Expert Mode, and set the System flag in the Properties of the Photoneo folder:


KUKA SettingUpGuideStep10.png


The program folder contains files which should be adapted by the user in order to meet application requirements.

Do not replace the whole program folder, only copy three files from the Photono_KUKA_Module archive to R1/Program Folder:


KUKA SettingUpGuideStep8 v2.png


NOTE: Compilation errors should disappear after copying all files to the robot controller.

3.3 State Server configuration

In order to get State Server up and running, it is necessary to edit the Submit Interpreter program sps.sub in R1/System.

Switch to Expert Mode and deselect the Submit Interpreter program before making any changes:


KUKA SettingUpGuideStep11.png


As is shown in the figure below, add the following two lines of code to the original sps.sub file.

PHO_StatePublisherInit() goes to the USER INI section while PHO_PublishState() goes to the USER PLC section:


KUKA SettingUpGuideStep12 v2.png


State Server is necessary for calibration and visualization purposes. As soon as you restart Submit Interpreter, it should be up and waiting for connection from the Vision Controller.

As was mentioned above State Server occupies $FLAG[100] and listens on port 54601.

3.4 Bin Picking Client Configuration

The Bin Picking Client can be launched using main_application.src. The main application contains the definitions of fixed robot poses, bin picking initialization and the main bin picking loop.

Users are expected to reteach home, start, end & placing positions before selecting this file for launch. See Section 4 for more information on main_application.src

As was mentioned above, the Bin Picking Client occupies $FLAG[101] & FLAG[102]' and utilizes Port 54602' to connect to the bin picking server running on the Vision Controller.

NOTE: When PLC is used as a high-level controller, the code from main_applications.src can be divided into separate programs and launched directly from cell.src.

4. KRL

Photoneo KUKA interface was designed to be easily integrated into existing applications written in KRL code. KRL API and KRL Config should be used to adapt default bin picking template to the requirements of specific applications.

- KRL API - is set of KRL procedures used to control the bin picking sequence. Bin Picking initialization, main loop and error handling are implemented here. Please retain the order of request calls as defined in basic template.

- KRL CONFIG - customer_definitions.src enables users to configure application specific settings such as gripper commands, velocity, acceleration and approximation distances.

4.1 KRL API

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


PHO_ConnectToVC() - function to establish a connection to the Vision Controller. Blocking function; suspends the program until a proper connection is established.

PHO_RequestInit(start_pose:IN, end_pose:IN) - request to initialize the 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_RequestScan() - request to trigger the next scan and localization. Non-blocking request; the KRL 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. Blocking request; the KRL program waits for response from Vision Controller.

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

PHO_ReceiveTrajectory() - function to receive requested bin picking operations (consisting of a sequence of trajectories and gripper commands). Blocking function; waits for bin picking 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 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 and execute motion. Always make sure that the robot is in Start pose before invoking this function.


4.2 KRL CONFIG

customer_definitions.src enables the user to configure several bin picking settings, including gripper command implementations, trajectory speed and approximation 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)

- PHO_BinpickingSettings() - specify velocities, accelerations and approximation distances for bin picking trajectories (SPLINE segments). Amend the number of trajectories to meet your Bin Picking Studio Setup. (by default 4 trajectories are used)


4.3 KRL ERROR HANDLING

Photoneo KUKA interface provides basic error handling. If an error occurs during bin picking operations, the error_code global_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 - 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 the source code of main_application.src - the basic template which demonstrates how the user's application and Photoneo Bin Picking API can be integrated together.


KUKA SettingUpGuideStep13.png

5. Runtime

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 is shown in the figure below:


[[File: ]]


Choose if you want to run the application in T1, T2 or AUT mode and adopt the speed override if required

Select the main_application.src from the R1/Program/ folder:


KUKA SettingUpGuideStep15.png


Start the program on the robot controller and you should see the program pointer start to execute the program lines:


KUKA SettingUpGuide Step17.png


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


[[File: ]]


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 in case of any problem. It is strongly recommended to reduce the speed to 10% of maximum during initial bin picking tests.


6. Monitoring bin picking related variables

Since KUKA UI does not provide a standard "Terminal" utility, users are recommended to use Display tool to monitor values of specific bin picking related variables:

  • - PHO_DEBUG - flag which enables user to turn msgNotify logs ON and OFF
  • - error_code - if error occurs, the error code from the list above is saved to this variable.
  • - info_data - integer value important for oriented placing is stored in this variable.
  • - binpicking_operations[] - array which holds the current sequence of types of bin-picking operations as received from the Vision Controller.
  • - trajectory_sizes[] - array which holds information about the number of way-points in each particular trajectory in bin picking sequence.


KUKA SettingUpGuide Step16.png