Difference between revisions of "Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with FANUC robots"
Line 199: | Line 199: | ||
In order to switch from Standard Registers to Position Registers press '''F1[TYPE]''' -> '''Position Registers''' | In order to switch from Standard Registers to Position Registers press '''F1[TYPE]''' -> '''Position Registers''' | ||
+ | NOTE: The default range of position registers is usually PR[1] - PR[100]. For proper functionality of Photoneo Fanuc Module it is highly recommended to increase the range up to 120 position registers or more. Since this is a maintenance operation, please contact your local Fanuc support to help you with this step. Be careful since you might loose your previously taught positions and other register data during this operation! | ||
[[File:Fanuc tutorial Step23.png]] | [[File:Fanuc tutorial Step23.png]] | ||
− | Similarly to Standard Registers, Photoneo Fanuc Module has automatically added comments to Position Registers utilized for bin picking application. As you can see in the figure below - Photoneo Fanuc Module utilize '''PR[1]-PR[9]''' for Home, Start, End + calibration positions PR[4]-PR[9] and PR[20]-PR[120] for trajectory transfers. PR[10]-PR[19] are free for user application. | + | Similarly to Standard Registers, Photoneo Fanuc Module has automatically added comments to Position Registers utilized for bin picking application. As you can see in the figure below - Photoneo Fanuc Module utilize '''PR[1]-PR[9]''' for Home, Start, End + calibration positions '''PR[4]-PR[9]''' for calibration positions and '''PR[20]-PR[120]''' for trajectory transfers. '''PR[10]-PR[19]''' are free for user application. |
− | |||
− | |||
In order to teach Home position jog robot to required Home position, select register '''PR[1]''' and press '''Shift''' + '''F3[RECORD]''' to record position. | In order to teach Home position jog robot to required Home position, select register '''PR[1]''' and press '''Shift''' + '''F3[RECORD]''' to record position. | ||
Line 215: | Line 214: | ||
− | For proper operation internal representation of | + | For proper operation of binpicking, internal representation of Home, Start and End needs to be switched from '''Cartesian''' to '''Joint'''. In order to achieve that press '''F4[Position]''' ->'''F5[REPRE]''' -> '''Joint''' |
Line 221: | Line 220: | ||
− | Confirm switching representation | + | Confirm switching representation by pressing '''Continue'''. Repeat the same procedure also for '''Start''' and '''End''' poses. |
''NOTE: If you utilize Calibration poses in your application, these don't need to be switched to Joint representation.'' | ''NOTE: If you utilize Calibration poses in your application, these don't need to be switched to Joint representation.'' | ||
Line 233: | Line 232: | ||
== 3. TP API == | == 3. TP API == | ||
+ | The Photoneo Fanuc Module was designed to be easily integrated into existing applications written as TP programs. | ||
+ | |||
+ | |||
+ | |||
+ | === 4.3 TP ERROR HANDLING === | ||
+ | |||
+ | The Photoneo FANUC interface provides basic error handling. If an error occurs during bin picking operations, an error code is returned in Register '''R[19] - PHO ERROR DATA'''. | ||
+ | |||
+ | Following is the list of potential binpicking error codes: | ||
+ | |||
+ | '''OK = 0''' - Service response from Vision Controller is valid | ||
+ | |||
+ | '''SERVICE_ERR = 1''' - Service response from Vision Controller is invalid. | ||
+ | |||
+ | '''UNKNOWN_REQ = 2''' - The Vision Controller received an unknown request. | ||
+ | |||
+ | '''COMM_FAILURE = 3''' - Communication failure due to socket closure. | ||
+ | |||
+ | '''BAD_DATA = 4''' - Data validation check has failed. | ||
+ | |||
+ | '''TIMEOUT = 5''' - Communication failure due to socket timeout. | ||
+ | |||
+ | '''PLANNING_FAILED = 201''' - Trajectory planning has failed | ||
+ | |||
+ | '''NO_PART_FOUND = 202''' - No part has been localized | ||
+ | |||
+ | '''NOT_INIT = 203''' - Binpicking application has not been properly initialized on Vision Controller | ||
+ | |||
+ | '''UNKNOWN_ERR = 299''' - Unspecified internal error | ||
+ | Photoneo Fanuc Interface by default performs basic error handling right after '''TRAJ_RECV''' program call. If '''NOT_INIT''' or '''SERVICE_ERR''' occurs, the whole bin picking is reinitialized. If '''PLANNING_FAILED''' or '''NO_PART_FOUND''' occurs, scanning is repeated. It is up to user to decide if other error has to be also covered or if existing error handling is sufficient for his application. | ||
Revision as of 13:26, 12 July 2018
1. Prerequisites
Please make sure that your Fanuc controller meets following criteria:
- System version 8.10 and higher (Versions 6.40 - 7.70 are also supported with certain limitations)
- R632 Karel - Karel option available
- R648 User Socket Msg - Socket Communication option available
Click Menu -> Status -> Version ID -> Next -> F3[ORDER FI] to verify that required options are installed on your robot controller (see figure below):
2. Fanuc Controller Setup
2.1 Set IP Addresses of Ethernet Ports
As a first step, configure IP addresses of robot controller.
On Pendant Press Menu -> Setup -> Host Comm -> TCP/IP:
Two Ethernet ports should be available, it is recommended to configure Port#1 for communication with Vision Controller.
Adapt an IP address of Port#1 to meet you network configuration:
If you use ROBOGUIDE for workcell commisioning, configure Port#2 for transferring files between robot controller and your PC.
Adapt an IP address of Port#2 to meet you network configuration:
2.2 Configure TCP/IP Server
Photoneo Fanuc Module requires State Server to run as a background task on the robot controller. Configured TCP/IP server is necessary for this purpose.
Press Menu -> Setup -> Host Comm -> F4[SHOW] and select Servers
Select S3 slot - we keep S1 and S2 slots reserved for user application.
Configure TCP/IP server S3 as shown in the figure below:
2.3 Configure TCP/IP Client
The main Photoneo Bin Picking application works in a client mode. Configure TCP/IP Client for this purpose.
Press Menu -> Setup -> Host Comm -> F4[SHOW] and select Clients
Select C3 slot - we keep C1 and C2 slots reserved for user application.
Configure TCP/IP client C3 as shown in the figure below:
NOTE: Set an IP address of Vision Controller to SERVER IP/HOSTNAME
2.4 Change Cartesian Origin of Robot
The Cartesian origin of Fanuc robots is different than the Cartesian origin of robot models used in the Photoneo Binpicking Studio.
In order to ensure successful calibration, we need to apply predefined offset in Z axis in UFRAME.
Press Menu -> Next -> System -> Variables and scroll down until you find system variable named GROUP. (Use Shift button to speed up scrolling)
Press Enter to open GROUP menu and select UFRAME option as shown in the figure below:
Edit the Z value of UFRAME according to the Offset table below.
A table of Z axis offsets for specific robot models:
NOTE: Be careful since this change might affect your previously taught Cartesian positions !!!
2.5 Load Photoneo Fanuc Module Files
The Photoneo Fanuc Interface consists of two Karel binaries and approximately 20 TP programs. All these files needs to be copied to the robot controller in order to get Photoneo Fanuc Module up and running.
Extract Photoneo Fanuc Module archive (.zip file) which you received with Photoneo Bin Picking Studio to the USB stick and plug it to Teach Pendant.
Press Menu -> File -> File -> F5[UTILS] and select Set Device:
Select USB on TP (UT1:) option as shown in the figure below:
Press F2[DIR] to open Photoneo Fanuc Module directory:
Select *.*(all files) and press F3[LOAD] and YES to load all the files from Photoneo Fanuc Module to the robot controller:
Press Select button to verify that all TP and Karel programs were successfully loaded:
2.6 Enable Autostart of State Server
As a next step we need to configure State Server to start automatically after boot.
Press Menu -> Next -> System -> Variables and scroll down to find SHELL_CFG variable
Edit SHELL_NAME and SHELL_EXT to the state as shown in the figure below:
Cycle power to apply all changes. Press FCTN -> NEXT -> CYCLE POWER and confirm YES.
If everything was set correctly you should see PHOSTATE: Waiting for connection... on the User screen immediately after the boot:
2.7 Teach Home, Start and End positions
A crucial step of bin picking configuration is related to teaching home, start, and end poses. Home position of robot should be taught in a way that robot is outside of the scanning area. Start position should be taught in a way in which robot gripper is approximately above the center of the bin. End position can be similar to start position or slightly shifted towards placing area. Do not place end pose far away from bin since it might significantly affect dynamic trajectory planning, increase total planning time and cause planning errors.
Press Data to visualize Data Registers screen. As you can see in the figure below, Photoneo Fanuc Module has automatically added comments to Data Registers R[1] - R[24] that are utilized for bin picking application.
NOTE: Prevent using registers R[1]-R[24] in your application!!!
In order to switch from Standard Registers to Position Registers press F1[TYPE] -> Position Registers
NOTE: The default range of position registers is usually PR[1] - PR[100]. For proper functionality of Photoneo Fanuc Module it is highly recommended to increase the range up to 120 position registers or more. Since this is a maintenance operation, please contact your local Fanuc support to help you with this step. Be careful since you might loose your previously taught positions and other register data during this operation!
Similarly to Standard Registers, Photoneo Fanuc Module has automatically added comments to Position Registers utilized for bin picking application. As you can see in the figure below - Photoneo Fanuc Module utilize PR[1]-PR[9] for Home, Start, End + calibration positions PR[4]-PR[9] for calibration positions and PR[20]-PR[120] for trajectory transfers. PR[10]-PR[19] are free for user application.
In order to teach Home position jog robot to required Home position, select register PR[1] and press Shift + F3[RECORD] to record position.
You should see that asterisk has changed to R sign after successful operation.
For proper operation of binpicking, internal representation of Home, Start and End needs to be switched from Cartesian to Joint. In order to achieve that press F4[Position] ->F5[REPRE] -> Joint
Confirm switching representation by pressing Continue. Repeat the same procedure also for Start and End poses.
NOTE: If you utilize Calibration poses in your application, these don't need to be switched to Joint representation.
At this point your Robot Controller is configured to work with Photoneo Binpicking Studio. However you should adapt the TP code to meet the precise requirements of your application. This may involve updating part placing, gripper commands or application logic. The following section of the tutorial provides some basic examples of how this can be programmed as well as a detailed explanation of the Photoneo TP API.
3. TP API
The Photoneo Fanuc Module was designed to be easily integrated into existing applications written as TP programs.
4.3 TP ERROR HANDLING
The Photoneo FANUC interface provides basic error handling. If an error occurs during bin picking operations, an error code is returned in Register R[19] - PHO ERROR DATA.
Following is the list of potential binpicking error codes:
OK = 0 - Service response from Vision Controller is valid
SERVICE_ERR = 1 - Service response from Vision Controller is invalid.
UNKNOWN_REQ = 2 - The Vision Controller received an unknown request.
COMM_FAILURE = 3 - Communication failure due to socket closure.
BAD_DATA = 4 - Data validation check has failed.
TIMEOUT = 5 - Communication failure due to socket timeout.
PLANNING_FAILED = 201 - Trajectory planning has failed
NO_PART_FOUND = 202 - No part has been localized
NOT_INIT = 203 - Binpicking application has not been properly initialized on Vision Controller
UNKNOWN_ERR = 299 - Unspecified internal error
Photoneo Fanuc Interface by default performs basic error handling right after TRAJ_RECV program call. If NOT_INIT or SERVICE_ERR occurs, the whole bin picking is reinitialized. If PLANNING_FAILED or NO_PART_FOUND occurs, scanning is repeated. It is up to user to decide if other error has to be also covered or if existing error handling is sufficient for his application.
4. Runtime
Now you are ready to start the bin picking application. Press Select button and choose PHO_MAIN program:
Make sure that the Bin Picking application on the Vision Controller side is running and waiting for a connection:
Start the PHO_MAIN program in Manual or Auto mode and if everything was configured properly you should see that PHOCLIENT has established connection with Vision Controller:
If the connection between the robot controller and the vision controller has been established properly, the robot should move to the Home position and the Bin picking status should show: Connected
As soon as the trajectory to the first localized object is calculated, the robot should start executing motion.
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.