Difference between revisions of "Locator Tutorial: Setting up Locator to work with KUKA robots"
Line 141: | Line 141: | ||
− | Connect to scanner, select '''ZYX_Intrinsic formalism''' (Standard for KUKA robots), adjust '''Sphere radius''' ( | + | Connect to scanner, select '''ZYX_Intrinsic formalism''' (Standard for KUKA robots), adjust '''Sphere radius''' (20 mm in case of standard ping pong ball) and set '''Min visible''' parameter to 40%: |
Line 157: | Line 157: | ||
− | Input the X,Y,Z and A,B,C values of current position to the first line of the point list and repeat the same procedure for at least 5 more points (4 corners of the scanning volume/bin + two positions in the center of the scanning volume). | + | Input the '''X,Y,Z''' and '''A,B,C''' values of current position to the first line of the point list and repeat the same procedure for at least 5 more points (4 corners of the scanning volume/bin + two positions in the center of the scanning volume). |
− | Change the orientation of the tool in all axis to achieve wider range of input values. Press '''Compute''' button after adding last point. For successful calibration ''' | + | Change the orientation of the tool in all axis to achieve wider range of input values. Press '''Compute''' button after adding last point. For successful calibration '''Final error per point should not exceed 2-3 mm'''. (1.089mm in this example case). |
Line 165: | Line 165: | ||
− | In case your Final Error is too high, try to add more points or start the calibration from the beginning again. | + | In case your '''Final Error''' is too high, try to add more points or start the calibration from the beginning again. |
If you are satisfied with results, press '''Set Matrix to PhoXi''' button, to store the reuslts to PhoXi Scanner. | If you are satisfied with results, press '''Set Matrix to PhoXi''' button, to store the reuslts to PhoXi Scanner. | ||
Line 173: | Line 173: | ||
− | Do not forget to switch Coordinate Space in PhoXi Control after successful calibration: | + | Do not forget to switch '''Coordinate Space''' in PhoXi Control after successful calibration: |
Line 187: | Line 187: | ||
− | Select the Tool number which you want to use for validation, set Name (5- | + | Select the Tool number which you want to use for validation, set Name ('''5-VERIFICATION''' in this example) and input the values from misplacement vector: |
Line 205: | Line 205: | ||
− | The values calculated by Calibration Tool should approximately match the values reported by KUKA Pendant: | + | The values calculated by Photoneo Robot Camera Calibration Tool should approximately match the values reported by KUKA Pendant: |
Line 213: | Line 213: | ||
=== 4.2 Tool Calibration === | === 4.2 Tool Calibration === | ||
− | The misplacement vector calculated during Robot Camera calibration determines the center of calibration ball with respect to the Tool Frame selected during calibration. It is convenient for validating calibration | + | The misplacement vector calculated during Robot Camera calibration determines the center of calibration ball with respect to the Tool Frame selected during calibration. It is convenient for validating calibration, however the real gripping point is usually different than the center of calibration ball. In order to enable successful picking it is therefore necessary to calibrate the robot tool. The traditional approach is to use built-in KUKA calibration tools. Following tutorial demonstrates '''Tool calibration''' using XYZ-4 point method. |
Switch to Expert Mode, select '''Start Up''' -> '''Calibration''' -> '''Tool''' -> '''XYZ -4 Point''': | Switch to Expert Mode, select '''Start Up''' -> '''Calibration''' -> '''Tool''' -> '''XYZ -4 Point''': | ||
Line 237: | Line 237: | ||
''NOTE: Basic Locator configuration is BASE Selection = $NULLFRAME, TOOL Selection = YOUR CALIBRATED TOOL'' | ''NOTE: Basic Locator configuration is BASE Selection = $NULLFRAME, TOOL Selection = YOUR CALIBRATED TOOL'' | ||
− | === | + | == 5 Runtime == |
+ | |||
+ | === 5.1 Reteach Start and End poses === | ||
When Robot-Camera and Tool calibration has been finished you can proceed to re-teaching application poses. Ensure that you have selected the right Base and Tool Frame. | When Robot-Camera and Tool calibration has been finished you can proceed to re-teaching application poses. Ensure that you have selected the right Base and Tool Frame. | ||
Line 261: | Line 263: | ||
''NOTE: START and END position should be of PTP Motion type'' | ''NOTE: START and END position should be of PTP Motion type'' | ||
− | == 5 Run Locator == | + | === 5.2 Run Locator === |
You are now ready to run the program. Switch to '''AUT mode''' and '''select 10% speed'''; this option is recommended for safety reasons. | You are now ready to run the program. Switch to '''AUT mode''' and '''select 10% speed'''; this option is recommended for safety reasons. |
Revision as of 16:19, 2 October 2018
It is highly recommended that users read Locator Tutorial: Introduction prior to installation of specific robot interface
Contents
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:
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 Locator 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
The Locator 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:
Amend the network configuration to meet your requirements:
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:
3. Photoneo KUKA Module Setup
The first step in the installation of Locator KUKA Module is to copy the files from the Locator KUKA Module Archive to the Robot Controller.
The Locator KUKA Module consists of the following files:
- Photoneo EthernetKRL Config Folder
- - locator_client.xml
- Photoneo Folder
- - locator_communication.src
- - locator_communication.dat
- Program Folder
- - locator_basic_template.src
- - locator_basic_template.dat
3.1 Ethernet KRL config
EthernetKRL Config folder contains only one XML file - locator_client.xml.
Copy this configuration file from the USB stick to C:\System\KRC\Roboter\Config\User\Common\EthernetKRL\ as is shown in the figure below:
XML file hold the configuration of EKI communication interface. The only entry that need to be changed is the IP address tag.
Enter the IP address of the Vision Controller to External IP tag in locator_client.xml as is shown in the figure below:
Save the changes and reboot the control PC again to apply the new EthernetKRL interface configuration.
Port utilized by Photoneo KUKA Module:
- - Locator Client Port: 54602
Flags occupied by EthernetKRL functions:
- - $FLAG[101] - Locator Connection Alive
- - $FLAG[102] - New Data Received
NOTE: Do NOT use these flags and port in the rest of your application!!!
3.2 Copy Photoneo & Program files
The Photoneo folder contains internal communication sources 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):
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:
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 locator_basic_template files from the Locator_KUKA_Module archive to R1/Program Folder:
NOTE: Compilation errors should disappear after copying all files to the robot controller.
4. Calibration
An inevitable step in Locator configuration is the Robot Camera Calibration. The proper calibration guarantees that the object positions will be calculated directly in Robot Base coordinates.
4.1 Robot - Camera Calibration
Mount the scanner firmly, make sure that scene is properly captured from final position and start Photoneo Robot Camera Calibrator:
Ensure that Base and Tool Selections are set to $NULLFRAME:
Connect to scanner, select ZYX_Intrinsic formalism (Standard for KUKA robots), adjust Sphere radius (20 mm in case of standard ping pong ball) and set Min visible parameter to 40%:
Attach ping-pong ball to the gripper, and jog robot to the first position (usually a closest corner of the bin/ area of interest).
Press Capture button on the first line of list of points in order to capture ball position.
On KUKA Pendant select Main Menu -> Display -> Variable -> Single and input $pos_act variable to get the current tool position with sufficient number of decimals:
Input the X,Y,Z and A,B,C values of current position to the first line of the point list and repeat the same procedure for at least 5 more points (4 corners of the scanning volume/bin + two positions in the center of the scanning volume).
Change the orientation of the tool in all axis to achieve wider range of input values. Press Compute button after adding last point. For successful calibration Final error per point should not exceed 2-3 mm. (1.089mm in this example case).
In case your Final Error is too high, try to add more points or start the calibration from the beginning again.
If you are satisfied with results, press Set Matrix to PhoXi button, to store the reuslts to PhoXi Scanner.
Do not forget to switch Coordinate Space in PhoXi Control after successful calibration:
In addition to the Robot - Camera transformation matrix, the output of calibration is also the Calibration Sphere Misplacement vector which denotes the transformation between the selected Tool ($NULLFRAME) and the center of the sphere (ping-pong ball). This information can be used for calibration verification. First set the KUKA Tool coordinates according to the Misplacement Vector calculated by calibration. Ensure that ping-pong ball has not moved since the end of calibration.
Select Main Menu -> Startup -> Calibration -> Tool -> Numeric Input
Select the Tool number which you want to use for validation, set Name (5-VERIFICATION in this example) and input the values from misplacement vector:
Save the changes, jog robot to the center of the scanning volume and select Test button in Photoneo Robot Camera Calibration Tool:
Compare the position of the ball calculated in Robot Transformation Coordinate Space with $pos_act values:
The values calculated by Photoneo Robot Camera Calibration Tool should approximately match the values reported by KUKA Pendant:
4.2 Tool Calibration
The misplacement vector calculated during Robot Camera calibration determines the center of calibration ball with respect to the Tool Frame selected during calibration. It is convenient for validating calibration, however the real gripping point is usually different than the center of calibration ball. In order to enable successful picking it is therefore necessary to calibrate the robot tool. The traditional approach is to use built-in KUKA calibration tools. Following tutorial demonstrates Tool calibration using XYZ-4 point method.
Switch to Expert Mode, select Start Up -> Calibration -> Tool -> XYZ -4 Point:
Select a Tool Number you want to calibrate and enter a name:
Jog robot to approach referencing point by your gripper tool point from 4 different positions and press Calibrate button to confirm each one.
When finished and satisfied with final error, press Save button to store the results. Refer to [KUKA System Integrator Manual] for more information.
NOTE: Basic Locator configuration is BASE Selection = $NULLFRAME, TOOL Selection = YOUR CALIBRATED TOOL
5 Runtime
5.1 Reteach Start and End poses
When Robot-Camera and Tool calibration has been finished you can proceed to re-teaching application poses. Ensure that you have selected the right Base and Tool Frame.
Switch to Expert Mode and select locator_basic_template.src program as shown in the figure below:
Press Block Selection button to move the program pointer to the current line. Jog robot to the new pose and select Touch Up Button to reteach position:
Select Yes to confirm new position. Repeat the same procedure also for START, END and placing positions:
NOTE: START and END position should be of PTP Motion type
5.2 Run Locator
You are now ready to run the program. Switch to AUT mode and select 10% speed; this option is recommended for safety reasons.
Make sure that you are ready to stop the motion execution immediately if something goes wrong.
Press PLAY button and keep it pressed until robot moves to Start Pose. Release PLAY button and press it again to continue in program execution.
If everything has been configured and calibrated properly, the robot should trigger a first scan, wait for the result and move towards the first localized object.
6. KRL
The Locator KUKA module is a set of KRL procedures which handle socket communication with the Locator and provides basic examples of how to navigate the robot to specific targets.
6.1 Main
The following code is a main loop from the locator_basic_template.src. As can be seen in the figure below, MULTIPLE RESULT MODE is utilized and Locator is requested to return 5 results.
If at least one object pose has been received, program will atempt to execute motion towards returned target/s. Attached object/s will be then placed to predefined positions.
Feel free to adapt this KRL code to meet your application requirements, to change the speed, precision or order of steps in the main loop if needed.
6.2 Communication API
KRL procedures necessary for communication with Locator are available in the locator_communication.src and locator_communication.dat files.
PHO_ConnectToVC() - procedure to establish a connection with the Locator according to the IP address configured in EKI XML config file.
- $FLAG[101] is set to TRUE if communication has been established properly
- $FLAG[102] is set to TRUE is new data has been received from Vision Controller
PHO_TrigLocator(mode:IN, requested_targets:IN) - procedure to trigger the next localization
- mode - two modes are available - SINGLE_RESULT_MODE and MULTIPLE_RESULT_MODE.
- requested_targets - optional parameter used in MULTIPLE_RESULT_MODE - defines the number of results requested by the user.
PHO_WaitForLocatorRes() - procedure to wait for a localization result to be received
- locator_targets[] - global E6POS array defined in locator_communication.dat which stores targets received from Locator. By default the array range is set to 100 targets.
- available_targets = global INT variable defined in locator_communication.dat which holds the number of received targets fromn last localization
6.3 Communication Protocol
Following figures explain Locator - KUKA communication protocol in both Single and Multiple Result Modes.
KUKA EKI Communication is configured to work in STREAM mode and requires combination of terminating signs to be appended after each message.
In current version of communication protocol, 5 terminating signs - TERMI are utilized for this purpose