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

From 3D scanning Knowledge base - Photoneo wiki
Jump to: navigation, search
Line 9: Line 9:
 
- '''MotoPlus Runtime option''' - This option needs to be enabled on robot controller in order to get Photoneo Yaskawa interface up and running.
 
- '''MotoPlus Runtime option''' - This option needs to be enabled on robot controller in order to get Photoneo Yaskawa interface up and running.
  
The Photoneo Yaskawa Interface was originally developed using '''GP8''' manipulator and '''YRC1000 Controller''' with the following version:
+
The Photoneo Yaskawa Interface was originally developed using '''GP8''' manipulator and '''YRC1000 Controller''' with the following firmware version:
  
  
Line 18: Line 18:
 
=== 2.1 Maintenance & Management Mode ===
 
=== 2.1 Maintenance & Management Mode ===
  
When configuring Yaskawa controller for Photoneo Interface it is necessary to boot into the '''Maintenance Mode''' and switch to the '''Management''' Security level. Following procedure describes the steps necessary to enter this mode.
+
Start the Robot Controller into a Maintenance Mode by holding the '''Main Menu''' button while turning the main switch on.  
  
Start the Robot Controller into a Maintenance Mode by holding the '''Main Menu''' button while turning the main switch on. You should hear a short beep during a boot. Maintenance mode screen is shown in the figure below:
+
You should hear a short beep during the boot. Maintenance mode screen is shown in the figure below:
  
  
Line 38: Line 38:
  
  
Notice '''three keys''' in the top status bar - this means that '''Management Mode is Active.'''
+
Notice '''three keys''' in the top status bar - this means - '''Management Mode is Active.'''
  
 
=== 2.2 Set IP Address ===
 
=== 2.2 Set IP Address ===
Line 59: Line 59:
 
[[File: 20190225075559.jpg|frame|none|alt=Alt text| Figure 2.2.3]]
 
[[File: 20190225075559.jpg|frame|none|alt=Alt text| Figure 2.2.3]]
  
 +
 +
Plug Ethernet cable to the LAN2 port and try to ping Robot Controller from a PC to validate proper configuration. 
  
 
=== 2.3 Enable MotoPlus Functionality ===
 
=== 2.3 Enable MotoPlus Functionality ===
Line 70: Line 72:
  
  
'''MotoPlus APL''' icon should be now visible on the left pane. Enter the '''MotoPlus Func. Settings''' to configure MotoPlus autostart option:
+
'''MotoPlus APL''' icon should now become visible on the left pane.  
 +
 
 +
Enter the '''MotoPlus Func. Settings''' and enable MotoPlus autostart option:
  
  
Line 78: Line 82:
 
=== 2.4 Load MotoPlus Application ===
 
=== 2.4 Load MotoPlus Application ===
  
Photoneo Yaskawa Module consists of several JOB Files and one ''PhotoneoBP_CONTROLLER_v_x_y_z.out'' file. This OUT file needs to be loaded to the Robot Controller  
+
Photoneo Yaskawa Module ZIP Archive contains several JOB files and single ''PhotoneoBP_CONTROLLER_v_x_y_z.out'' file. The OUT file is a MotoPlus binary and needs to be loaded to the Robot Controller in Maintenance Mode. 
  
 
Select '''MOTOPLUS Apl.''' -> '''Load (User Application)''' and select the ''PhotoneoBP_CONTROLLER_v_x_y_z.out'' file.
 
Select '''MOTOPLUS Apl.''' -> '''Load (User Application)''' and select the ''PhotoneoBP_CONTROLLER_v_x_y_z.out'' file.
Line 86: Line 90:
  
  
Confirm loading the application by clicking '''YES''':  
+
Confirm loading the MotoPlus application by clicking '''YES''':  
  
  
Line 92: Line 96:
  
  
"Maintenance mode" part of the configuration is finished now. Restart the robot controller into Normal Mode. No error should appear after the reboot.  
+
Maintenance mode part of the configuration is finished now. Restart the Robot Controller into Normal Mode. No error should appear after the reboot.  
  
 
=== 2.5 Copy INFORM JOBS to Robot Controller===
 
=== 2.5 Copy INFORM JOBS to Robot Controller===
  
As a next step, all JOBS from INFORM Folder needs to be copied from USB to the robot controller.
+
As a next step, copy all JOBS from INFORM Folder of ZIP Archive to to the robot controller. Use USB or SD Card for transfer.  
  
 
Browse to '''Ex. Memory''' -> '''Load'''  and select all available JOBS as shown in the figure below:
 
Browse to '''Ex. Memory''' -> '''Load'''  and select all available JOBS as shown in the figure below:
Line 112: Line 116:
 
All JOB files are now available in the Robot Controller. Before proceeding further, it is important to understand variable mapping.  
 
All JOB files are now available in the Robot Controller. Before proceeding further, it is important to understand variable mapping.  
  
=== 2.6 Variables used ===
+
=== 2.6 Variable Mapping ===
  
 
Photoneo Yaskawa Module occupies following data registers:
 
Photoneo Yaskawa Module occupies following data registers:
Line 118: Line 122:
 
'''BYTE REGISTERS (FLAGS):'''  
 
'''BYTE REGISTERS (FLAGS):'''  
  
* '''B000''' - CONNECT_TO_VC - flag set by INFORM JOB to notify MotoPlus application to establish connection to VC
+
* '''B000''' - CONNECT_TO_VC - flag set by INFORM JOB to issue MotoPlus application to establish connection to VC
  
 
* '''B001''' - CONNECTED - flag set by MotoPlus application to notify INFORM that connection has been established
 
* '''B001''' - CONNECTED - flag set by MotoPlus application to notify INFORM that connection has been established
Line 220: Line 224:
 
* '''P010 - P0110''' - Reserved for trajectory execution
 
* '''P010 - P0110''' - Reserved for trajectory execution
  
 +
=== 2.7 Setting IP Address of Vision Controller ===
  
Before starting to using the module, you have to change the first four integer registers : '''I000''','''I001''','''I002''','''I003''', setting the IP adress of Vision Controller.
+
Bin Picking Client running on robot controller requires an information about IP Address of Vision Controller in order to establish a successful connection.
[[File: Server ip adress.jpg|frame|none|alt=Alt text| Figure 2.6.4]]
 
  
=== 2.7 Reteach Start and End Positions===
+
Four integer registers (I000 - I003) are utilized for this purpose. Insert current IP Address of Vision Controller here:
  
A crucial step of bin picking configuration is the teaching of home, start, and end poses. The home position of the robot should be taught in such a way that the robot remains outside the scanning area. The start position should be taught in such a way that the robot gripper is approximately above the center of the bin. The end position can be similar to the start position or slightly shifted towards the placing area. Do not position the end pose too far from the bin as this might significantly affect dynamic trajectory planning, increase total planning time and cause planning errors.
 
  
Start and End positions must be stored in Position Registers, it cannot be just a local program position variable.  
+
[[File: Server ip adress.jpg|frame|none|alt=Alt text| Figure 2.6.4]]
  
The easiest way how to set values to Position Registers is to use '''PHO_TEACH_START_POSE''' and '''PHO_TEACH_END_POSE''' JOBS as shown in the figure below:
 
  
 +
Ports utilized by Photoneo Yaskawa Module:
  
[[File: 20190225103001.jpg|frame|none|alt=Alt text| Figure 2.7.1]]
+
* - '''Bin Picking Client Port: 11003'''
  
 +
* - '''State Serer Port: 11004'''
  
Jog robot to the Start Pose, reteach the only MOVJ Command in the '''PHO_TEACH_START_POSE''' JOB and run the program. This procedure sets the current Joint Position to the P000 variable.
+
=== 2.8 Reteach Start and End Positions===
  
Repeat the same step with '''PHO_TEACH_END_POSE JOB''' to set P001 variable. If needed repeat the same procedure for other vision systems - do not forget to rewrite the P00X number in JOB in such a scenario.  
+
A crucial step of bin picking configuration is the teaching of home, start, and end poses. The home position of the robot should be taught in such a way that the robot remains outside the scanning area. The start position should be taught in such a way that the robot gripper is approximately above the center of the bin. The end position can be similar to the start position or slightly shifted towards the placing area. Do not position the end pose too far from the bin as this might significantly affect dynamic trajectory planning, increase total planning time and cause planning errors.
 
 
=== 2.8 Runtime problems ===
 
  
If during runtime you encounter any problems regarding connection with Vision Controller, open the "select job" panel and select the '''PHO_RECOVER''' and run it. This program will end all communication with server.  
+
Home Pose can be modified directly in PHO_MAIN program. Start and End positions must be stored in Position Registers, it cannot be taught only as a local program position variable.  
  
[[File:Recover select.jpg|frame|none|alt=Alt text| Figure 2.8.1]]
+
Yaskawa robots use PULSE notation for storing joint robot poses. The easiest way how to copy these joint values to Position Registers is to use '''PHO_TEACH_START_POSE''' and '''PHO_TEACH_END_POSE''' JOBS:
  
When the program has ended, you should see an alarm message "Disconnected from VC". This is the correct response.
 
  
 +
[[File: 20190225103001.jpg|frame|none|alt=Alt text| Figure 2.7.1]]
  
[[File:Desirable outcome recover.jpg|frame|none|alt=Alt text| Figure 2.8.2]]
 
  
 +
Jog robot to the Start Pose, modify the only MOVJ Command in the '''PHO_TEACH_START_POSE''' JOB using the '''MODIFY''' button and run the program. This procedure sets the current Joint Position to the P000 variable.
  
Last thing before you end your work with the robot, you have to execute '''PHO_RECOVER''' to end the communicaton channels. Otherwise the port, on which the communication was, will be occupied and you'll have to restart the Vision Controller.  
+
Repeat the same step with '''PHO_TEACH_END_POSE JOB''' to set P001 variable. If more vision systems are to be configured, repeat the same procedure with updated P00X number. (P002 and P003 for Vision System 2 ...)
  
 
=== 3. INFORM LANGUAGE ===
 
=== 3. INFORM LANGUAGE ===
Line 304: Line 306:
 
- '''PHO_PLACE_OBJECT''' - placing operation. Adapt placing sequence and poses to meet your application requirements
 
- '''PHO_PLACE_OBJECT''' - placing operation. Adapt placing sequence and poses to meet your application requirements
  
- '''PHO_GRIPPER_ATTACH'''   - implement function for attaching object to the gripper here   
+
- '''PHO_GRIPPER_ATTACH''' - implement function for attaching object to the gripper here   
  
- '''PHO_GRIPPER_DETACH''' - implement function for detaching object from the gripper here
+
- '''PHO_GRIPPER_DETACH''' - implement function for detaching object from the gripper here
  
 
- '''PHO_GRIPPER_USER_1''' - implement custom user gripper command (reserved for future use)
 
- '''PHO_GRIPPER_USER_1''' - implement custom user gripper command (reserved for future use)
Line 354: Line 356:
  
  
Photoneo Yaskawa Interface by default performs basic error handling immediately after the '''PHO_TRAJ_REQ''' call.  
+
Photoneo Yaskawa Interface by default performs basic error handling after the '''PHO_INIT_REQ''' call.
 +
 
 +
If '''NOT_INIT''' or '''SERVICE_ERR''' occurs, the whole bin picking is reinitialized.
 +
 
 +
 
 +
Photoneo Yaskawa Interface by default performs basic error handling after the '''PHO_WAIT_FOR_SCAN''' and '''PHO_TRAJ_REQ''' calls.  
  
 
If '''NOT_INIT''' or '''SERVICE_ERR''' occurs, the whole bin picking is reinitialized.  
 
If '''NOT_INIT''' or '''SERVICE_ERR''' occurs, the whole bin picking is reinitialized.  
Line 360: Line 367:
 
If '''PLANNING_FAILED''' or '''NO_PART_FOUND''' occurs, scanning is repeated.  
 
If '''PLANNING_FAILED''' or '''NO_PART_FOUND''' occurs, scanning is repeated.  
  
It is up to the user to decide if existing error handling is sufficient for a particular application or if it needs to be expanded.
+
 
 +
'''It is up to the user to decide if existing error handling is sufficient for a particular application or if it needs to be expanded!'''
  
 
=== 3.4 MAIN APPLICATION ===
 
=== 3.4 MAIN APPLICATION ===
Line 398: Line 406:
 
         JUMP *TRAJ
 
         JUMP *TRAJ
 
     ENDIF
 
     ENDIF
 +
    ABORT
 
      
 
      
 
     'REQUEST TRAJ
 
     'REQUEST TRAJ
Line 433: Line 442:
  
  
=== 4. Runtime ===
+
=== 5. Runtime ===
  
Now you are ready to start the bin picking application. '''Browse to '''JOB''' -> '''Select Job''' and choose the '''PHO_MAIN''' program:  
+
Make sure that your solution on the Deployment page of Bin Picking Studio is running and Bin Picking Status is in '''Waiting for a connection''' state as is shown in the figure below:
  
[[File: 20190225132927.jpg|frame|none|alt=Alt text| Figure 4.1]]
+
 
 +
[[File:Fanuc tutorial Step waiting.png|frame|none|alt=Alt text| Figure 4.2]]
  
  
Ensure that the Bin Picking application on the Vision Controller side is running and waiting for a connection:
+
'''Browse to '''JOB''' -> '''Select Job''' and choose the '''PHO_MAIN''' program:  
  
  
[[File:Fanuc tutorial Step waiting.png|frame|none|alt=Alt text| Figure 4.2]]
+
[[File: 20190225132927.jpg|frame|none|alt=Alt text| Figure 4.1]]
  
  
Line 452: Line 462:
  
  
As soon as the trajectory to the first localized object is calculated, the robot should start executing the motion.
+
As soon as the trajectory to the first localized object is received, the robot should start executing the motion.
  
  
 
'''NOTE: Ensure that you are prepared to halt the motion execution immediately if any problem arises. It is strongly recommended to reduce the speed to 10% of maximum during initial bin picking tests.'''
 
'''NOTE: Ensure that you are prepared to halt the motion execution immediately if any problem arises. It is strongly recommended to reduce the speed to 10% of maximum during initial bin picking tests.'''
 +
 +
=== 4.1 Connection/Disconnection and Restarting Application ===
 +
 +
If during runtime you encounter any problems regarding connection with Vision Controller, open the "select job" panel and select the '''PHO_RECOVER''' and run it. This program will end all communication with server.
 +
 +
[[File:Recover select.jpg|frame|none|alt=Alt text| Figure 2.8.1]]
 +
 +
When the program has ended, you should see an alarm message "Disconnected from VC". This is the correct response.
 +
 +
 +
[[File:Desirable outcome recover.jpg|frame|none|alt=Alt text| Figure 2.8.2]]
 +
 +
 +
Last thing before you end your work with the robot, you have to execute '''PHO_RECOVER''' to end the communicaton channels. Otherwise the port, on which the communication was, will be occupied and you'll have to restart the Vision Controller.

Revision as of 20:13, 2 March 2019

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

1. Prerequisites

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

- YRC1000 - the latest controller version. FS100, DX100 and DX200 are currently not supported but available on demand. NX100 is deprecated!

- MotoPlus Runtime option - This option needs to be enabled on robot controller in order to get Photoneo Yaskawa interface up and running.

The Photoneo Yaskawa Interface was originally developed using GP8 manipulator and YRC1000 Controller with the following firmware version:


Alt text
Figure 1.0.1

2. Yaskawa Controller Setup

2.1 Maintenance & Management Mode

Start the Robot Controller into a Maintenance Mode by holding the Main Menu button while turning the main switch on.

You should hear a short beep during the boot. Maintenance mode screen is shown in the figure below:


Alt text
Figure 2.1.1


Switch Security Level from Editing to Management Mode. Browse to System -> Security and select Management Mode:


Alt text
Figure 2.1.2


Password to management mode is 9999999999999999 (16x9):


Alt text
Figure 2.1.3


Notice three keys in the top status bar - this means - Management Mode is Active.

2.2 Set IP Address

Configure the IP address of the robot controller. In Maintenance mode, browse to System -> Setup -> Option Functions:


Alt text
Figure 2.2.1


Select LAN Interface Setting to enter the Network Configuration pane:


Alt text
Figure 2.2.2


Select Manual Setting for LAN2 Port and amend the IP Address to meet your network requirements:


Alt text
Figure 2.2.3


Plug Ethernet cable to the LAN2 port and try to ping Robot Controller from a PC to validate proper configuration.

2.3 Enable MotoPlus Functionality

If MotoPlus functionality has not been enabled on robot controller before, browse to System -> Setup -> Option Functions

Switch MOTOPLUS Func State from NOT USED to USED.


Alt text
Figure 2.3.1


MotoPlus APL icon should now become visible on the left pane.

Enter the MotoPlus Func. Settings and enable MotoPlus autostart option:


Alt text
Figure 2.3.2


2.4 Load MotoPlus Application

Photoneo Yaskawa Module ZIP Archive contains several JOB files and single PhotoneoBP_CONTROLLER_v_x_y_z.out file. The OUT file is a MotoPlus binary and needs to be loaded to the Robot Controller in Maintenance Mode.

Select MOTOPLUS Apl. -> Load (User Application) and select the PhotoneoBP_CONTROLLER_v_x_y_z.out file.


Alt text
Figure 2.4.1


Confirm loading the MotoPlus application by clicking YES:


Alt text
Figure 2.4.2


Maintenance mode part of the configuration is finished now. Restart the Robot Controller into Normal Mode. No error should appear after the reboot.

2.5 Copy INFORM JOBS to Robot Controller

As a next step, copy all JOBS from INFORM Folder of ZIP Archive to to the robot controller. Use USB or SD Card for transfer.

Browse to Ex. Memory -> Load and select all available JOBS as shown in the figure below:


Alt text
Figure 2.5.1


Hit Enter to start the transfer:


Alt text
Figure 2.5.2


All JOB files are now available in the Robot Controller. Before proceeding further, it is important to understand variable mapping.

2.6 Variable Mapping

Photoneo Yaskawa Module occupies following data registers:

BYTE REGISTERS (FLAGS):

  • B000 - CONNECT_TO_VC - flag set by INFORM JOB to issue MotoPlus application to establish connection to VC
  • B001 - CONNECTED - flag set by MotoPlus application to notify INFORM that connection has been established
  • B002 - NEW_REQ - flag set by INFORM JOB to notify MotoPlus application that new request has been issued
  • B003 - REQ_FINISHED - flag set by MotoPlus application to notify INFORM that request has been handled
  • B004 - DATA_READY - flag set by MotoPlus application to notify INFORM that bin picking sequence data are ready for execution
  • B005 - OPER_READY - flag set by MotoPlus application to notify INFORM that data are ready for execution
  • B006 - OPER_FINISH - flag set by INFORM JOB to notify MotoPlus application that operation has been executed
  • B007 - PICK_FINISH - flag set by MotoPlus application to notify INFORM about executing the last bin picking operation
  • B008 - PICK_IN_PROGRESS - flag set by MotoPlus application to notify INFORM about ongoing picking operation


Alt text
Figure 2.6.1


INTEGER RESIGTERS:

  • I000 - VC_IP_ADDRESS_1 - First Part of Vision Controller IP Address
  • I001 - VC_IP_ADDRESS_2 - Second Part of Vision Controller IP Address
  • I002 - VC_IP_ADDRESS_3 - Third Part of Vision Controller IP Address
  • I003 - VC_IP_ADDRESS_4 - Fourth Part of Vision Controller IP Address
  • I004 - VISION_SYSTEM_ID - Vision System ID
  • I005 - REQUEST_TYPE - Type of request which is currently being handled
  • I006 - RESPONSE_STATUS - Response status for the last request
  • I007 - NUM_OF_OPER - Number of executed operation of current bin picking sequence
  • I008 - OPER_TYPE - Type of operation in execution
  • I009 - GRIPPER_ACTION - Type of gripper action in execution
  • I010 - TRAJ_SIZE - Size of trajectory in execution
  • I011 - TOOL_INVARIANCE - Tool Invariance for current pick
  • I012 - GRIP_POINT_ID - Gripping Point ID for current pick
  • I013 - GRIP_INVARIANCE - Gripping Point Invariance for current pick
  • I014 - I023 - INFO DATA 1-10 - Another info data received from Bin Picking Studio
  • I024 - CUSTOMER REQUEST - Num of data for customer request
  • I025 - NEXT SOLUTION ID - ID of solution that should be activated by PHO_CHANGE_SOL_REQ
  • I030 - TRAJ_CURRENT - Current trajectory speed - this is set automatically by MotoPlus application according to the content of I031-I040 registers
  • I031 - I040 - TRAJ_1_SPEED - TRAJ_10_SPEED - configuration of trajectory speed


Alt text
Figure 2.6.2


REAL REGISTERS:

  • R000 - CALIBRATION_ERROR (not supported in this version)
  • R001 - CUSTOMER_DATA_1 - data #1 to be send as a part of customer request to the Vision Controller
  • R002 - CUSTOMER_DATA_2 - data #2 to be send as a part of customer request to the Vision Controller
  • R003 - CUSTOMER_DATA_3 - data #3 to be send as a part of customer request to the Vision Controller
  • R004 - CUSTOMER_DATA_4 - data #4 to be send as a part of customer request to the Vision Controller


Alt text
Figure 2.6.3


POSITION REGISTERS:

  • P000 - Start Pose for Vision System 1
  • P001 - End Pose for Vision System 1
  • P002 - Start Pose for Vision System 2
  • P003 - End Pose for Vision System 2
  • P004 - Start Pose for Vision System 3
  • P005 - End Pose for Vision System 3
  • P006 - Start Pose for Vision System 4
  • P007 - End Pose for Vision System 4
  • P010 - P0110 - Reserved for trajectory execution

2.7 Setting IP Address of Vision Controller

Bin Picking Client running on robot controller requires an information about IP Address of Vision Controller in order to establish a successful connection.

Four integer registers (I000 - I003) are utilized for this purpose. Insert current IP Address of Vision Controller here:


Alt text
Figure 2.6.4


Ports utilized by Photoneo Yaskawa Module:

  • - Bin Picking Client Port: 11003
  • - State Serer Port: 11004

2.8 Reteach Start and End Positions

A crucial step of bin picking configuration is the teaching of home, start, and end poses. The home position of the robot should be taught in such a way that the robot remains outside the scanning area. The start position should be taught in such a way that the robot gripper is approximately above the center of the bin. The end position can be similar to the start position or slightly shifted towards the placing area. Do not position the end pose too far from the bin as this might significantly affect dynamic trajectory planning, increase total planning time and cause planning errors.

Home Pose can be modified directly in PHO_MAIN program. Start and End positions must be stored in Position Registers, it cannot be taught only as a local program position variable.

Yaskawa robots use PULSE notation for storing joint robot poses. The easiest way how to copy these joint values to Position Registers is to use PHO_TEACH_START_POSE and PHO_TEACH_END_POSE JOBS:


Alt text
Figure 2.7.1


Jog robot to the Start Pose, modify the only MOVJ Command in the PHO_TEACH_START_POSE JOB using the MODIFY button and run the program. This procedure sets the current Joint Position to the P000 variable.

Repeat the same step with PHO_TEACH_END_POSE JOB to set P001 variable. If more vision systems are to be configured, repeat the same procedure with updated P00X number. (P002 and P003 for Vision System 2 ...)

3. INFORM LANGUAGE

The Photoneo Yaskawa Module was designed to be easily integrated into existing applications written as INFORM JOBS.

3.1 INFORM API

The Photoneo YASKAWA INFORM API is comprised of the following programs. These are intended for high-level level control of bin picking sequences and are usually called in PHO_MAIN program.

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

PHO_SCAN_REQ - request to trigger the next scan and localization. Non-blocking request; the INFORM program continues immediately at the next line.

PHO_WAIT_FOR_SCAN - function to wait for scan to be finished. This should be called after triggering the scan but does not have to be called immediately. Blocking function, waits for the response from the BP Studio.

PHO_TRAJ_REQ - request to receive requested bin picking trajectories (consisting of a sequence of trajectory and gripper operations). Blocking function; waits for motion data to be received.

PHO_INIT_REQ - request to initialize bin picking application from the Vision Controller side. Start and End Poses defined by the operator from Teach Pendant are transferred to the Vision Controller and used in the trajectory planning pipeline as start and terminus points.

PHO_CHANGE_SOL_REQ - request to change currently deployed solution.

PHO_CALIB_START_REQ - request to start current calibration for selected vision system and remove all previously added points (Not supported in this version)

PHO_CALIB_ADD_POINT_REQ - request to add calibration point - a scan is triggered and the calibration is recalculated. (Not supported in this version)

PHO_CALIB_SET_REQ - request to save current calibration result to selected Vision System (Not supported in this version)

PHO_CALIB_RESET_REQ - request to reset current calibration and remove all previously added points (Not supported in this version)

PHO_BIN_LOCATOR - request to localize bin position in the environment (Reserved for future use)

PHO_PICK_FAILED - request to notify bin picking studio that object picking has failed (Reserved for future use)


NOTE #1: The PHO_CONNECT_TO_VC function should always be called as a first of Photoneo Bin Picking API procedures. It should always be followed by PHO_INIT_REQ function. Not obeying this order will result in a communication error.


NOTE #2: The PHO_WAIT_FOR_SCAN has to be called after the PHO_SCAN_REQ. A user can perform standard robotic commands between these two calls but cannot perform any other Photoneo Bin Picking API calls. The PHO_WAIT_FOR_SCAN function has to be finished first. For example - PHO_SCAN_REQ followed by PHO_TRAJ_REQ results in communication error.


3.2 INFORM CONFIG

The following JOBS enable the user to configure several bin picking settings, to implement gripper commands and to amend the placing of the attached object.

4.2.1 ROUTINES

- PHO_PICK_OBJECT - standard bin picking sequence. This flexible, operation-based implementation allows performing bin picking sequences, which consist of various operations to be performed. Do not edit !!!

- PHO_PLACE_OBJECT - placing operation. Adapt placing sequence and poses to meet your application requirements

- PHO_GRIPPER_ATTACH - implement function for attaching object to the gripper here

- PHO_GRIPPER_DETACH - implement function for detaching object from the gripper here

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

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

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

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

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

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

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

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


3.3 INFORM ERROR HANDLING

The Photoneo YASKAWA interface provides basic error handling. If an error occurs during bin picking operations, an error code is returned in Register I006 - RESPONSE STATUS.

The following list shows the potential bin picking error codes:

OK = 0 - Service response from Bin Picking Studio is valid

SERVICE_ERR = 1 - Service response from Bin Picking Studio is invalid.

UNKNOWN_REQ = 2 - The Bin Picking Studio 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.

UNKNOWN_ERR = 99 - Unspecified internal error

PLANNING_FAILED = 201 - Trajectory planning has failed

NO_PART_FOUND = 202 - No part has been localized

NOT_INIT = 203 - Bin picking application has not been properly initialized on the Bin Picking Studio side.

WRONG_BP_CONFIG = 255 - Wrong Bin Picking Configuration - Check Log Console in the Bin Picking Studio


Photoneo Yaskawa Interface by default performs basic error handling after the PHO_INIT_REQ call.

If NOT_INIT or SERVICE_ERR occurs, the whole bin picking is reinitialized.


Photoneo Yaskawa Interface by default performs basic error handling after the PHO_WAIT_FOR_SCAN and PHO_TRAJ_REQ calls.

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 the user to decide if existing error handling is sufficient for a particular application or if it needs to be expanded!

3.4 MAIN APPLICATION

PHO_MAIN program can be considered as a basic bin picking template. The main program loop with basic error handling is implemented here. The user can amend the details to meet their application requirements.

   NOP
   'CONNECT TO VC
   *CONNECT
   CALL JOB:PHO_CONNECT_TO_VC
   
   'SEND INITIALIZE REQUEST
   *INIT
   CALL JOB:PHO_INIT_REQ
   'CHECK RESPONSE
   IFTHENEXP I006<>0
       ABORT
   ENDIF
   
   *SCAN
   'MOVE TO HOME POSE
   MOVJ C00000 VJ=I026
   'REQUEST FIRST SCAN
   CALL JOB:PHO_SCAN_REQ
   'INITIAL WAIT
   WAIT T=10.00
   
   'MAIN LOOP
   *MAIN
   'WAIT FOR SCAN
   CALL JOB:PHO_WAIT_FOR_SCAN
   'CHECK RESPONSE
   IFTHENEXP I006=1 OREXP I006=203 OREXP I006=255
       JUMP *INIT
   ENDIF
   IFTHENEXP I006=0  
       JUMP *TRAJ
   ENDIF
   ABORT
   
   'REQUEST TRAJ
   *TRAJ
   CALL JOB:PHO_TRAJ_REQ
   'IF ERROR THEN REINIT
   IFTHENEXP I006=1 OREXP I006=203 OREXP I006=255
       JUMP *INIT
   ENDIF
   'IF NO TRAJ THEN RESCAN
   IFTHENEXP I006=201 OREXP I006=202
       JUMP *RESCAN
   ENDIF
   
   'IF OK THEN CONTINUE
   IFTHENEXP I006=0
       'MOVE TO START POSE
       MOVJ P000 VJ=I026
       'PICK OBJECT 
       CALL JOB:PHO_PICK_OBJECT 
       'TRIGGER NEXT SCAN
       CALL JOB:PHO_SCAN_REQ
       'PLACE OBJECT
       CALL JOB:PHO_PLACE_OBJECT
       'JUMP BACK TO MAIN LOOP
       JUMP *MAIN
   ENDIF
   
   'NEXT SCAN
   *RESCAN
   CALL JOB:PHO_SCAN_REQ
   'JUMP BACK TO MAIN LOOP
   JUMP *MAIN
   END


5. Runtime

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


Alt text
Figure 4.2


Browse to JOB -> Select Job and choose the PHO_MAIN program:


Alt text
Figure 4.1


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


Alt text
Figure 4.4


As soon as the trajectory to the first localized object is received, the robot should start executing the motion.


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

4.1 Connection/Disconnection and Restarting Application

If during runtime you encounter any problems regarding connection with Vision Controller, open the "select job" panel and select the PHO_RECOVER and run it. This program will end all communication with server.

Alt text
Figure 2.8.1

When the program has ended, you should see an alarm message "Disconnected from VC". This is the correct response.


Alt text
Figure 2.8.2


Last thing before you end your work with the robot, you have to execute PHO_RECOVER to end the communicaton channels. Otherwise the port, on which the communication was, will be occupied and you'll have to restart the Vision Controller.