Difference between revisions of "Locator Tutorial: Setting up Locator to work with FANUC robots"

From 3D scanning Knowledge base - Photoneo wiki
Jump to: navigation, search
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Users are strongly recommended to read [http://wiki.photoneo.com/index.php/Locator_Tutorial:_Introduction Locator Tutorial: Introduction] prior to installation of specific robot intere'''
+
'''Users are strongly recommended to read [http://wiki.photoneo.com/index.php/Locator_Tutorial:_Introduction Locator Tutorial: Introduction] prior to installation of specific robot interface'''
  
 
== 1. Prerequisites ==
 
== 1. Prerequisites ==
Line 18: Line 18:
 
=== 2.1 Set IP Addresses of Ethernet Ports ===
 
=== 2.1 Set IP Addresses of Ethernet Ports ===
  
The first step of the process is to configure the IP addresses of the robot controller.
+
The first step of the process is to configure the IP addresses of the Robot Controller.
  
Using Teach Pendant, press '''Menu''' -> '''Setup''' -> '''Host Comm''' -> '''TCP/IP''' -> '''F3[Detail]''':
+
Using the Teach Pendant, press '''Menu''' -> '''Setup''' -> '''Host Comm''' -> '''TCP/IP''' -> '''F3[Detail]''':
  
  
Line 26: Line 26:
  
  
Two Ethernet ports should be available; users are recommended to configure '''Port#1''' for communication with Vision Controller.  
+
Two Ethernet ports should be available; users are recommended to configure '''Port#1''' for communication with the Locator.  
  
Amend the IP address of Port#1 to match your network configuration:
+
Amend the IP address of '''Port#1''' to match your network configuration:
  
  
Line 34: Line 34:
  
  
If you use ROBOGUIDE for workcell commissioning, configure '''Port#2''' for transferring files between the robot controller and your PC.  
+
If you use ROBOGUIDE for workcell commissioning, configure '''Port#2''' for transferring files between the Robot Controller and your PC.  
  
Click '''F3[PORT]''' to switch between Port#1 and Port#2 and amend the IP address of Port#2 to match your network configuration:
+
Click '''F3[PORT]''' to switch between '''Port#1''' and '''Port#2''' and amend the IP address of '''Port#2''' to match your network configuration:
  
  
Line 44: Line 44:
 
=== 2.3 Configure TCP/IP Client ===
 
=== 2.3 Configure TCP/IP Client ===
  
The main Photoneo Bin Picking application works in client mode. Configure the TCP/IP Client for this purpose.
+
The main Locator Fanuc Interface works in client mode. Configure the TCP/IP Client for this purpose.
  
 
Press '''Menu''' -> '''Setup''' -> '''Host Comm''' -> '''F4[SHOW]''' and select '''Clients'''
 
Press '''Menu''' -> '''Setup''' -> '''Host Comm''' -> '''F4[SHOW]''' and select '''Clients'''
Line 52: Line 52:
  
  
'''Select C1 slot'''
+
Select '''C1 slot'''
  
  
Line 58: Line 58:
  
  
Configure the TCP/IP client C3 as is shown in the figure below:
+
Configure the '''TCP/IP Client C1''' as is shown in the figure below:
  
 
'''NOTE: Set the IP address of the Vision Controller to SERVER IP/HOSTNAME'''  
 
'''NOTE: Set the IP address of the Vision Controller to SERVER IP/HOSTNAME'''  
Line 65: Line 65:
 
[[File:Fanuc Locator Setting Up Guide Client Setup.png]]
 
[[File:Fanuc Locator Setting Up Guide Client Setup.png]]
  
 +
== 3. Locator Fanuc Interface Setup ==
  
== 3. Photoneo Fanuc Module Setup ==
+
The Locator Fanuc Interface consists of a Karel binary and four TP programs. All of these files need to be copied to the Robot Controller in order to get the Locator Fanuc Interface up and running. 
  
 +
Extract the Locator Fanuc Interface archive (.zip file) to the USB stick and plug it into the Teach Pendant.
  
 +
Press '''Menu''' -> '''File''' -> '''File''' -> '''F5[UTILS]''' and select '''Set Device''':
  
 +
 +
[[File: Fanuc Locator Setting Up Guide Files 1.png]]
 +
 +
 +
Select the '''USB on TP (UT1:)''' option as is shown in the figure below:
 +
 +
 +
[[File: Fanuc Locator Setting Up Guide Files 2.png]]
 +
 +
 +
Press '''F2[DIR]''' to set the directory subset and select "*.*(all files)" to show all items on the USB.
 +
 +
 +
[[File: Fanuc Locator Setting Up Guide Files 3.png]]
 +
 +
 +
Select the files one by one, press '''F3[LOAD]''' and '''YES''' to load the programs to the Robot Controller:
 +
 +
 +
[[File: Fanuc Locator Setting Up Guide Files 4.png]]
 +
 +
 +
Press '''Select''' button to verify that all of the TP and Karel programs have been loaded successfully:
 +
 +
 +
[[File: Fanuc Locator Setting Up Guide Files 5.png]]
  
 
== 4. Calibration ==
 
== 4. Calibration ==
  
=== 4.1 Robot Camera Calibration ===
+
Robot Camera Calibration is a crucial step in Locator configuration. Accurate calibration guarantees that object positions will be calculated directly in Robot Base coordinates.
 +
 
 +
=== 4.1 Robot - Camera Calibration ===
 +
 
 +
Mount the Scanner firmly, ensure that the scene is properly captured from the final position and start the Photoneo Robot Camera Calibrator:
 +
 
 +
 
 +
[[File: KUKA SettingUp Guide Scanner Calibration 10.png]]
 +
 
 +
 
 +
Users are strongly recommended to clear '''UTOOL''' values prior to calibration.
 +
 
 +
Browse to '''Menu''' -> '''Setup''' -> '''Frames''' and select the one you want to use for calibration; in the example given '''Tool[1]''' was used.
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Frames.png]]
 +
 
 +
 
 +
Ensure that all '''UTOOL''' values are cleared:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Zero Frame.png]]
 +
 
 +
 
 +
Connect to the Scanner, select '''XYZ_Extrinsic formalism''' (Standard for FANUC robots), adjust the '''Sphere radius''' (21.75 mm in this case/ 20.00 mm for a standard ping-pong ball) and set the '''Min visible''' arameter to 40%:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0001.png]]
 +
 
 +
 
 +
Attach a ping-pong ball to the gripper and jog the robot to the first position (usually the nearest corner of the bin/ area of interest).
 +
 
 +
On the Fanuc Pendant press the '''POSN''' button -> '''F4[WORLD]''' to obtain the current '''TOOL[1]''' position with respect to the robot '''WORLD''' frame:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0002.png]]
 +
 
 +
 
 +
Input the '''X,Y,Z''' [mm] and '''W,P,R''' [deg] values of the current position to the first line of the point list and repeat the same procedure for at least 7 more points.
 +
 
 +
The recommended procedure is to cover the four corners  + four positions in the center of the scanning volume.
 +
 
 +
Change the orientation of the tool in all axes to achieve a wider range of input values. Press the '''Compute''' button once you have added the final point.
 +
 
 +
For successful calibration, the '''Final Error per point should not exceed 2-3 mm'''. (0.807mm in this example).
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0005.png]]
 +
 
 +
 
 +
If the final error value is too high, try adding more points or start the calibration from the beginning again. Increasing the orientation of the tool can help to reduce the final error value.
 +
 
 +
Once you are satisfied with the results, press the '''Set Matrix to PhoXi''' button to store the results to the PhoXi Scanner.
 +
 
 +
Do not forget to switch the '''Coordinate Space''' in PhoXi Control after calibration has been completed successfully:
 +
 
 +
 
 +
[[File: KUKA SettingUp Guide Scanner Calibration 20.png]]
 +
 
 +
 
 +
In addition to the Robot - Camera transformation matrix, the calibration process also calculates a '''Calibration Sphere Misplacement vector''' which denotes the transformation between the selected Tool ('''TOOL[1]''') and the center of the sphere (the ping-pong ball). This information can be used for calibration verification.
 +
 
 +
Set the Fanuc Tool coordinates according to the Misplacement Vector as calculated in the calibration process.
 +
 
 +
Ensure that the ping-pong ball has not moved since the end of calibration.
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0006.png]]
 +
 
 +
 
 +
Again, browse to '''Menu''' -> '''Setup''' -> '''Frames'''
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Frames.png]]
 +
 
 +
 
 +
Input the values from the misplacement vector to the TOOL[1]
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0007.png]]
 +
 
 +
 
 +
Save the changes, jog the robot to the center of the scanning volume and select the '''Test''' button in the Photoneo Robot Camera Calibration Tool:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0008.png]]
 +
 
 +
 
 +
Compare the position of the ball calculated in the Robot Transformation Coordinate Space with the '''POSITION''' of '''TOOL[1]''' in the '''WORLD''' frame.
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Calib 0009.png]]
 +
 
 +
 
 +
The values calculated by the Photoneo Robot Camera Calibration Tool should approximately match.
 +
 
  
 
=== 4.2 Tool Calibration ===
 
=== 4.2 Tool Calibration ===
 +
 +
The misplacement vector calculated during the robot camera calibration process determines the center of the calibration ball with respect to the Tool Frame selected during calibration. This is a convenient method for validating the calibration, but in practice the real gripping point is usually different from the center point of the calibration ball. In order to ensure successful picking, the robot tool should also be calibrated. The most commonly used method of achieving this, is to use the built-in FANUC calibration tools. The following section demonstrates tool calibration using the '''Three Point''' method.
 +
 +
Select '''Menu''' -> '''Setup''' -> '''Frames''' and select the tool frame you want to use within your program.
 +
 +
Press '''F2[Method]''' and select the '''Three Point''' calibration method:
  
 +
 +
[[File: Fanuc Locator Setting Up Guide Tool Calib 1.png]]
 +
 +
 +
Jog the robot to approach the referencing point with your gripper tool point from 3 different positions and press the '''SHIFT + RECORD''' button to confirm each one.
 +
 +
If the calibration routine was has been performed correctly, you should see the resulting - tool X,Y,Z coordinates immediately. 
 +
 +
 +
[[File: Fanuc Locator Setting Up Guide Tool Calib 2.png]]
 +
 +
 +
''NOTE: The basic Locator configuration is BASE Selection = WORLD and UTOOL Selection = YOUR CALIBRATED FRAME''
  
 
== 5. Runtime ==
 
== 5. Runtime ==
  
=== 5.1 Reteach Start and End poses ===
+
=== 5.1 Reteach Application poses ===
 +
 
 +
Once the Robot-Camera and Tool calibration processes have been completed, you can proceed to re-teaching the application poses.
 +
 
 +
Prior to starting this process, please ensure that you have selected the correct User and Tool Frame.
 +
 
 +
Go through the '''LOC_SINGLE''' or '''LOC_MULTIPLE''' programs and reteach all '''J P[X]''' poses using the standard procedure as shown in the figure below:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide First Run.png]]
 +
 
 +
 
 +
Do not edit '''L PR[X]''' poses unless you know exactly what you are doing; these are intended to perform motion commands towards the targets received from Locator.
 +
 
 +
=== 5.2 Endiannes ===
 +
 
 +
The endianness in Fanuc Robots is controller specific, while one controller might communicate using Little endian, another may communicate using Big endian. 
 +
 
 +
Configure and run the Locator GUI - you should see that Locator is in the '''Waiting for Connection...''' state.
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Runtime GUI.png]]
 +
 
 +
 
 +
Select the '''LOC_SINGLE''' Program and press '''SHIFT + FWD''' to start the program.
 +
 
 +
If the network configuration has been set properly, the Karel routine should establish a connection to the Locator server and trigger the first scan.
 +
 
 +
If the Robot Controller uses Little-endian (the default config), everything should work fine and the result from Locator should appear in '''PR1[PHO RESERVED]'''.
 +
 
 +
However, if the Robot Controller uses Big-endian, the following error will occur:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Endianess error.png]]
 +
 
 +
 
 +
In order to switch the communication from Little to Big-endian, change the value in '''R[1]''' from 0 to 1. 
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Endianess.png]]
 +
 
 +
 
 +
Repeat the connection attempt and if no error has occurred, the result from Locator should appear in '''PR1[PHO RESERVED]'''.
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide PR.png]]
 +
 
 +
=== 5.3 Run Locator ===
 +
 
 +
You are now ready to run the program. Switch to T1 mode and select 10% speed; this option is recommended for safety reasons.
  
=== 5.2 Run Locator ===
+
Ensure that you are ready to stop the motion execution immediately if something goes wrong.
  
 +
Select the LOC_SINGLE/LOC_MULTIPLE program or another program which you have prepared your own.
  
== 6. TP Progrsam ==
 
  
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.
+
[[File: Fanuc Locator Setting Up Guide Runtime Select.png]]
 +
 
 +
 
 +
If Locator is in the '''Waiting for Connection...''' state, press the '''SHIFT + FWD''' buttons to start the application:
 +
 
 +
 
 +
[[File: Fanuc Locator Setting Up Guide Runtime.png]]
 +
 
 +
 
 +
If everything is working correctly, you should see that the scan has been triggered, the result from Locator has been transmitted to the Robot Controller and the robot is approaching the object.
 +
 
 +
 
 +
== 6. TP Program ==
 +
 
 +
The Locator Fanuc module is a combination of the Karel background routine '''loc_client.pc''' and four TP files. 
 +
 
 +
* - '''loc_client.pc''' - handles communication with Locator and feeds position registers with received data
 +
 
 +
* - '''LOC_SINGLE.TP''' - is a basic template for using Locator Fanuc Module in the Single Result Mode
 +
 
 +
* - '''LOC_MULTIPLE.TP''' - is a basic template for using Locator Fanuc Module in the Multiple Result Mode
 +
 
 +
* - '''LOC_GRIP_ATT.TP''' - users should assign commands required for attaching object to the gripper to this function
 +
 
 +
* - '''LOC_GRIP_DEA.TP''' - users should assign commands required for detaching object from gripper to this function 
  
 
=== 6.1 Main ===
 
=== 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.
+
The following code is the content of the '''LOC_SINGLE.TP'''. As can be seen in the figure below, it clears registers, runs the LOC_CLIENT Karel background routine and waits until the Karel routine has established a connection with Locator. As soon as the connection has been established, a Single Result Mode Trigger is sent to Locator. Locator initializes scanning and localization and if a result is found it is sent back to the Fanuc robot. The Karel routine inputs Cartesian Data received from Locator to '''PR1[PHO_RESERVED]''' and sets '''F4[RES_RECEIVED]''' flag to ON. LOC_SINGLE.TP is waiting for '''F4[RES_RECEIVED]'''; immediately after it is set to ON it performs the motion to the received target. The offset from '''PR100[APPR OFFSET]''' is applied to approaching and de-approaching points. After finalizing the placing, the scan is repeated. In Multiple Result Mode, the scan is repeated after picking all of the received targets.
  
If at least one object pose is received, program will attempt to execute motion towards the returned target/s. Attached object/s will be then placed in predefined positions.
+
 
 +
  1:  !Clear Registers ;
 +
  2:  F[2]=(OFF) ;
 +
  3:  F[3]=(OFF) ;
 +
  4:  F[4]=(OFF) ;
 +
  5:  R[7:PHO LOC STATUS]=99    ;
 +
  6:  R[8:PHO NUM TAR REQ]=0    ;
 +
  7:  R[9:PHO NUM TAR RCV]=0    ;
 +
  8:  !Start Locator Client ;
 +
  9:  RUN LOC_CLIENT ;
 +
  10:  !Move Out of Scanning Volume ;
 +
  11:J P[1] 100% FINE    ;
 +
  12:  !Wait for Establishing Connectio  ;
 +
  13:  WAIT (F[2]=ON)    ;
 +
  14:  !Main Loop ;
 +
  15:  LBL[1] ;
 +
  16:  !Single Result Trigger ;
 +
  17:  R[6:PHO REQ TYPE]=1    ;
 +
  18:  F[3]=(ON) ;
 +
  19:  !Wait For Response ;
 +
  20:  WAIT (F[4]=ON)    ;
 +
  21:  F[4]=(OFF) ;
 +
  22:  !Repeat Scanning if Timeout ;
 +
  23:  IF (R[7:PHO LOC STATUS]=1),JMP LBL[1] ;
 +
  24:  !If OK, Proceed to Picking ;
 +
  25:J P[2] 100% CNT100    ;
 +
  26:L PR[1:PHO RESERVED] 100mm/sec FINE Offset,PR[100:PHO APPR OFFSET]    ;
 +
  27:L PR[1:PHO RESERVED] 1000mm/sec FINE    ;
 +
  28:  CALL LOC_GRIP_ATT    ;
 +
  29:L PR[1:PHO RESERVED] 100mm/sec FINE Offset,PR[100:PHO APPR OFFSET]    ;
 +
  30:  !Move Out of Scanning Volume ;
 +
  31:J P[3] 100% FINE    ;
 +
  32:  !Placing ;
 +
  33:J P[4] 100% CNT100    ;
 +
  34:J P[5] 100% FINE    ;
 +
  35:  CALL LOC_GRIP_DEA    ;
 +
  36:J P[6] 100% CNT100    ;
 +
  37:  !End of Loop ;
 +
  38:  JMP LBL[1] ;
  
 
=== 6.2 Registers Used ===
 
=== 6.2 Registers Used ===
 +
 +
The Locator client occupies the following '''Registers''':
 +
 +
* - '''R1[PHO ENDIAN]''' - Little/Big Endian Switch  Little Endian = 0, Big Endian = 1
 +
 +
* - '''R2[PHO CONNECTED]''' - Connection flag, ON - Connected to Locator, OFF - Disconnected from Locator
 +
 +
* - '''R3[PHO NEW REQ]''' - New Request Flag - used to synchronize action between TP and Karel programs
 +
 +
* - '''R4[PHO RES RECEIVED]''' - Response Received Flag - used to synchronize action between TP and Karel programs
 +
 +
* - '''R5[PHO LOC PORT]''' - Register for configuring the port on which Locator server is listening
 +
 +
* - '''R6[PHO REQ TYPE]''' - Register for storing the Request Type - Single Result Mode = 1, Multiple Result Mode = 2
 +
 +
* - '''R7[PHO LOC STATUS]''' - Register for transferring Locator Status Value from Karel to TP, 0 = LOC_OK, 1 = LOC_TIMEOUT, 2 = LOC_ERROR
 +
 +
* - '''R8[PHO NUM TAR REQ]''' - Register for storing the number of results requested from Locator (only valid for Multiple Result Mode)
 +
 +
* - '''R9[PHO NUM TAR RCV]''' - Register for storing the number of results received from Locator (only valid for Multiple Result Mode)
 +
  
 
[[File: Fanuc Locator Setting Up Guide Registers.png]]
 
[[File: Fanuc Locator Setting Up Guide Registers.png]]
 +
 +
 +
The Locator client occupies the following '''Position Registers''':
 +
 +
* - '''PR1[PHO_RESERVED] - PR99[PHO RESERVED]''' - Position Registers for storing Locator Results
 +
 +
* - '''PR100[PHO APPR OFFSET]''' - Position Registers for storing Approach/Deapproach Pose offset
  
  
 
[[File: Fanuc Locator Setting Up Guide Position Registers.png]]
 
[[File: Fanuc Locator Setting Up Guide Position Registers.png]]
 +
 +
 +
'''PR100[PHO APPR OFFSET]''' is used to configure the offset for approaching the target. The default configuration is (X = 0, Y = 0, Z = 100mm, W = 0, P = 0, R = 0) for approaching directly on the Z axis. 
  
  

Latest revision as of 12:34, 4 March 2019

Users are strongly recommended to read Locator Tutorial: Introduction prior to installation of specific robot interface

1. Prerequisites

Prior to setup, please ensure that your Fanuc controller meets the following criteria:

- System version 8.10 and higher (Versions 6.40 - 7.70 are also supported with certain limitations)

- R648 User Socket Msg - Socket Communication option available

Click Menu -> Next -> Status -> Version ID -> Next -> F3[ORDER FI] to verify that the R648 User Socket Msg option is installed on your robot controller (see figure below):


Fanuc Locator Setting Up Guide Prerequisities.png

2. Fanuc Controller Setup

2.1 Set IP Addresses of Ethernet Ports

The first step of the process is to configure the IP addresses of the Robot Controller.

Using the Teach Pendant, press Menu -> Setup -> Host Comm -> TCP/IP -> F3[Detail]:


Fanuc tutorial Step2.png


Two Ethernet ports should be available; users are recommended to configure Port#1 for communication with the Locator.

Amend the IP address of Port#1 to match your network configuration:


Fanuc Locator Setting Up Guide IP.png


If you use ROBOGUIDE for workcell commissioning, configure Port#2 for transferring files between the Robot Controller and your PC.

Click F3[PORT] to switch between Port#1 and Port#2 and amend the IP address of Port#2 to match your network configuration:


Fanuc tutorial Step3.png


2.3 Configure TCP/IP Client

The main Locator Fanuc Interface works in client mode. Configure the TCP/IP Client for this purpose.

Press Menu -> Setup -> Host Comm -> F4[SHOW] and select Clients


Fanuc Locator Setting Up Guide Clients.png


Select C1 slot


Fanuc Locator Setting Up Guide Clients Select.png


Configure the TCP/IP Client C1 as is shown in the figure below:

NOTE: Set the IP address of the Vision Controller to SERVER IP/HOSTNAME


Fanuc Locator Setting Up Guide Client Setup.png

3. Locator Fanuc Interface Setup

The Locator Fanuc Interface consists of a Karel binary and four TP programs. All of these files need to be copied to the Robot Controller in order to get the Locator Fanuc Interface up and running.

Extract the Locator Fanuc Interface archive (.zip file) to the USB stick and plug it into the Teach Pendant.

Press Menu -> File -> File -> F5[UTILS] and select Set Device:


Fanuc Locator Setting Up Guide Files 1.png


Select the USB on TP (UT1:) option as is shown in the figure below:


Fanuc Locator Setting Up Guide Files 2.png


Press F2[DIR] to set the directory subset and select "*.*(all files)" to show all items on the USB.


Fanuc Locator Setting Up Guide Files 3.png


Select the files one by one, press F3[LOAD] and YES to load the programs to the Robot Controller:


Fanuc Locator Setting Up Guide Files 4.png


Press Select button to verify that all of the TP and Karel programs have been loaded successfully:


Fanuc Locator Setting Up Guide Files 5.png

4. Calibration

Robot Camera Calibration is a crucial step in Locator configuration. Accurate calibration guarantees that object positions will be calculated directly in Robot Base coordinates.

4.1 Robot - Camera Calibration

Mount the Scanner firmly, ensure that the scene is properly captured from the final position and start the Photoneo Robot Camera Calibrator:


KUKA SettingUp Guide Scanner Calibration 10.png


Users are strongly recommended to clear UTOOL values prior to calibration.

Browse to Menu -> Setup -> Frames and select the one you want to use for calibration; in the example given Tool[1] was used.


Fanuc Locator Setting Up Guide Frames.png


Ensure that all UTOOL values are cleared:


Fanuc Locator Setting Up Guide Zero Frame.png


Connect to the Scanner, select XYZ_Extrinsic formalism (Standard for FANUC robots), adjust the Sphere radius (21.75 mm in this case/ 20.00 mm for a standard ping-pong ball) and set the Min visible arameter to 40%:


Fanuc Locator Setting Up Guide Calib 0001.png


Attach a ping-pong ball to the gripper and jog the robot to the first position (usually the nearest corner of the bin/ area of interest).

On the Fanuc Pendant press the POSN button -> F4[WORLD] to obtain the current TOOL[1] position with respect to the robot WORLD frame:


Fanuc Locator Setting Up Guide Calib 0002.png


Input the X,Y,Z [mm] and W,P,R [deg] values of the current position to the first line of the point list and repeat the same procedure for at least 7 more points.

The recommended procedure is to cover the four corners + four positions in the center of the scanning volume.

Change the orientation of the tool in all axes to achieve a wider range of input values. Press the Compute button once you have added the final point.

For successful calibration, the Final Error per point should not exceed 2-3 mm. (0.807mm in this example).


Fanuc Locator Setting Up Guide Calib 0005.png


If the final error value is too high, try adding more points or start the calibration from the beginning again. Increasing the orientation of the tool can help to reduce the final error value.

Once you are satisfied with the results, press the Set Matrix to PhoXi button to store the results to the PhoXi Scanner.

Do not forget to switch the Coordinate Space in PhoXi Control after calibration has been completed successfully:


KUKA SettingUp Guide Scanner Calibration 20.png


In addition to the Robot - Camera transformation matrix, the calibration process also calculates a Calibration Sphere Misplacement vector which denotes the transformation between the selected Tool (TOOL[1]) and the center of the sphere (the ping-pong ball). This information can be used for calibration verification.

Set the Fanuc Tool coordinates according to the Misplacement Vector as calculated in the calibration process.

Ensure that the ping-pong ball has not moved since the end of calibration.


Fanuc Locator Setting Up Guide Calib 0006.png


Again, browse to Menu -> Setup -> Frames


Fanuc Locator Setting Up Guide Frames.png


Input the values from the misplacement vector to the TOOL[1]


Fanuc Locator Setting Up Guide Calib 0007.png


Save the changes, jog the robot to the center of the scanning volume and select the Test button in the Photoneo Robot Camera Calibration Tool:


Fanuc Locator Setting Up Guide Calib 0008.png


Compare the position of the ball calculated in the Robot Transformation Coordinate Space with the POSITION of TOOL[1] in the WORLD frame.


Fanuc Locator Setting Up Guide Calib 0009.png


The values calculated by the Photoneo Robot Camera Calibration Tool should approximately match.


4.2 Tool Calibration

The misplacement vector calculated during the robot camera calibration process determines the center of the calibration ball with respect to the Tool Frame selected during calibration. This is a convenient method for validating the calibration, but in practice the real gripping point is usually different from the center point of the calibration ball. In order to ensure successful picking, the robot tool should also be calibrated. The most commonly used method of achieving this, is to use the built-in FANUC calibration tools. The following section demonstrates tool calibration using the Three Point method.

Select Menu -> Setup -> Frames and select the tool frame you want to use within your program.

Press F2[Method] and select the Three Point calibration method:


Fanuc Locator Setting Up Guide Tool Calib 1.png


Jog the robot to approach the referencing point with your gripper tool point from 3 different positions and press the SHIFT + RECORD button to confirm each one.

If the calibration routine was has been performed correctly, you should see the resulting - tool X,Y,Z coordinates immediately.


Fanuc Locator Setting Up Guide Tool Calib 2.png


NOTE: The basic Locator configuration is BASE Selection = WORLD and UTOOL Selection = YOUR CALIBRATED FRAME

5. Runtime

5.1 Reteach Application poses

Once the Robot-Camera and Tool calibration processes have been completed, you can proceed to re-teaching the application poses.

Prior to starting this process, please ensure that you have selected the correct User and Tool Frame.

Go through the LOC_SINGLE or LOC_MULTIPLE programs and reteach all J P[X] poses using the standard procedure as shown in the figure below:


Fanuc Locator Setting Up Guide First Run.png


Do not edit L PR[X] poses unless you know exactly what you are doing; these are intended to perform motion commands towards the targets received from Locator.

5.2 Endiannes

The endianness in Fanuc Robots is controller specific, while one controller might communicate using Little endian, another may communicate using Big endian.

Configure and run the Locator GUI - you should see that Locator is in the Waiting for Connection... state.


Fanuc Locator Setting Up Guide Runtime GUI.png


Select the LOC_SINGLE Program and press SHIFT + FWD to start the program.

If the network configuration has been set properly, the Karel routine should establish a connection to the Locator server and trigger the first scan.

If the Robot Controller uses Little-endian (the default config), everything should work fine and the result from Locator should appear in PR1[PHO RESERVED].

However, if the Robot Controller uses Big-endian, the following error will occur:


Fanuc Locator Setting Up Guide Endianess error.png


In order to switch the communication from Little to Big-endian, change the value in R[1] from 0 to 1.


Fanuc Locator Setting Up Guide Endianess.png


Repeat the connection attempt and if no error has occurred, the result from Locator should appear in PR1[PHO RESERVED].


Fanuc Locator Setting Up Guide PR.png

5.3 Run Locator

You are now ready to run the program. Switch to T1 mode and select 10% speed; this option is recommended for safety reasons.

Ensure that you are ready to stop the motion execution immediately if something goes wrong.

Select the LOC_SINGLE/LOC_MULTIPLE program or another program which you have prepared your own.


Fanuc Locator Setting Up Guide Runtime Select.png


If Locator is in the Waiting for Connection... state, press the SHIFT + FWD buttons to start the application:


Fanuc Locator Setting Up Guide Runtime.png


If everything is working correctly, you should see that the scan has been triggered, the result from Locator has been transmitted to the Robot Controller and the robot is approaching the object.


6. TP Program

The Locator Fanuc module is a combination of the Karel background routine loc_client.pc and four TP files.

  • - loc_client.pc - handles communication with Locator and feeds position registers with received data
  • - LOC_SINGLE.TP - is a basic template for using Locator Fanuc Module in the Single Result Mode
  • - LOC_MULTIPLE.TP - is a basic template for using Locator Fanuc Module in the Multiple Result Mode
  • - LOC_GRIP_ATT.TP - users should assign commands required for attaching object to the gripper to this function
  • - LOC_GRIP_DEA.TP - users should assign commands required for detaching object from gripper to this function

6.1 Main

The following code is the content of the LOC_SINGLE.TP. As can be seen in the figure below, it clears registers, runs the LOC_CLIENT Karel background routine and waits until the Karel routine has established a connection with Locator. As soon as the connection has been established, a Single Result Mode Trigger is sent to Locator. Locator initializes scanning and localization and if a result is found it is sent back to the Fanuc robot. The Karel routine inputs Cartesian Data received from Locator to PR1[PHO_RESERVED] and sets F4[RES_RECEIVED] flag to ON. LOC_SINGLE.TP is waiting for F4[RES_RECEIVED]; immediately after it is set to ON it performs the motion to the received target. The offset from PR100[APPR OFFSET] is applied to approaching and de-approaching points. After finalizing the placing, the scan is repeated. In Multiple Result Mode, the scan is repeated after picking all of the received targets.


  1:  !Clear Registers ;
  2:  F[2]=(OFF) ;
  3:  F[3]=(OFF) ;
  4:  F[4]=(OFF) ;
  5:  R[7:PHO LOC STATUS]=99    ;
  6:  R[8:PHO NUM TAR REQ]=0    ;
  7:  R[9:PHO NUM TAR RCV]=0    ;
  8:  !Start Locator Client ;
  9:  RUN LOC_CLIENT ;
 10:  !Move Out of Scanning Volume ;
 11:J P[1] 100% FINE    ;
 12:  !Wait for Establishing Connectio  ;
 13:  WAIT (F[2]=ON)    ;
 14:  !Main Loop ;
 15:  LBL[1] ;
 16:  !Single Result Trigger ;
 17:  R[6:PHO REQ TYPE]=1    ;
 18:  F[3]=(ON) ;
 19:  !Wait For Response ;
 20:  WAIT (F[4]=ON)    ;
 21:  F[4]=(OFF) ;
 22:  !Repeat Scanning if Timeout ;
 23:  IF (R[7:PHO LOC STATUS]=1),JMP LBL[1] ;
 24:  !If OK, Proceed to Picking ;
 25:J P[2] 100% CNT100    ;
 26:L PR[1:PHO RESERVED] 100mm/sec FINE Offset,PR[100:PHO APPR OFFSET]    ;
 27:L PR[1:PHO RESERVED] 1000mm/sec FINE    ;
 28:  CALL LOC_GRIP_ATT    ;
 29:L PR[1:PHO RESERVED] 100mm/sec FINE Offset,PR[100:PHO APPR OFFSET]    ;
 30:  !Move Out of Scanning Volume ;
 31:J P[3] 100% FINE    ;
 32:  !Placing ;
 33:J P[4] 100% CNT100    ;
 34:J P[5] 100% FINE    ;
 35:  CALL LOC_GRIP_DEA    ;
 36:J P[6] 100% CNT100    ;
 37:  !End of Loop ;
 38:  JMP LBL[1] ;

6.2 Registers Used

The Locator client occupies the following Registers:

  • - R1[PHO ENDIAN] - Little/Big Endian Switch Little Endian = 0, Big Endian = 1
  • - R2[PHO CONNECTED] - Connection flag, ON - Connected to Locator, OFF - Disconnected from Locator
  • - R3[PHO NEW REQ] - New Request Flag - used to synchronize action between TP and Karel programs
  • - R4[PHO RES RECEIVED] - Response Received Flag - used to synchronize action between TP and Karel programs
  • - R5[PHO LOC PORT] - Register for configuring the port on which Locator server is listening
  • - R6[PHO REQ TYPE] - Register for storing the Request Type - Single Result Mode = 1, Multiple Result Mode = 2
  • - R7[PHO LOC STATUS] - Register for transferring Locator Status Value from Karel to TP, 0 = LOC_OK, 1 = LOC_TIMEOUT, 2 = LOC_ERROR
  • - R8[PHO NUM TAR REQ] - Register for storing the number of results requested from Locator (only valid for Multiple Result Mode)
  • - R9[PHO NUM TAR RCV] - Register for storing the number of results received from Locator (only valid for Multiple Result Mode)


Fanuc Locator Setting Up Guide Registers.png


The Locator client occupies the following Position Registers:

  • - PR1[PHO_RESERVED] - PR99[PHO RESERVED] - Position Registers for storing Locator Results
  • - PR100[PHO APPR OFFSET] - Position Registers for storing Approach/Deapproach Pose offset


Fanuc Locator Setting Up Guide Position Registers.png


PR100[PHO APPR OFFSET] is used to configure the offset for approaching the target. The default configuration is (X = 0, Y = 0, Z = 100mm, W = 0, P = 0, R = 0) for approaching directly on the Z axis.


Fanuc Locator Setting Up Guide Registers Offset.png

6.3 Communication Protocol

The following illustrations explain the Locator - FANUC communication protocol in both Single and Multiple Result Modes.

NOTE #1: Communication is performed in UF - Unformatted mode


Fanuc Locator Setting Up Guide Single Com Protocol.png


Fanuc Locator Setting Up Guide Multiple Com Protocol.png