Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with YASKAWA robots
NOTE: Users are strongly recommended to read the general introduction to robot interfaces prior to installing specific robot modules.
- 1 1. Prerequisites
- 2 2. Yaskawa Controller Setup
- 2.1 2.1 Maintenance & Management Mode
- 2.2 2.2 Set IP Address
- 2.3 2.3 Enable MotoPlus Functionality
- 2.4 2.4 Load MotoPlus Application
- 2.5 3. Photoneo Yaskawa Module Setup
- 2.6 3.1 Copy INFORM JOBS to Robot Controller
- 2.7 3.2 Variable Mapping
- 2.8 3.3 Setting IP Address of Vision Controller
- 2.9 3.4 Set User Frame
- 2.10 3.5 Reteach Start and End Positions
- 2.11 4. INFORM LANGUAGE
- 2.12 4.1 INFORM API
- 2.13 4.2 INFORM CONFIG
- 2.14 4.3 INFORM ERROR HANDLING
- 2.15 4.4 MAIN APPLICATION
- 2.16 5. Runtime
- 2.17 5.1 Restarting the Application
Prior to setup, please ensure that your Yaskawa controller meets the following criteria:
- YRC1000 - the latest controller version. FS100, DX100 and DX200 are not currently supported but support for these version is 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:
2. Yaskawa Controller Setup
2.1 Maintenance & Management Mode
Start the Robot Controller in a Maintenance Mode by holding the Main Menu button while turning the main switch on.
You should hear a short beep during the boot. The Maintenance Mode screen is shown in the figure below:
Switch the Security Level from Editing to Management Mode. Browse to System -> Security and select Management Mode:
The password for accsessing Management Mode is 9999999999999999 (16x9):
Nore the three keys in the top status bar - this indicates that - 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:
Select LAN Interface Setting to enter the Network Configuration pane:
Select Manual Setting for LAN2 Port and amend the IP Address to meet your network requirements:
NOTE: It is recommended to plug the Ethernet cable into the LAN2 port and to attempt to the ping Robot Controller from a PC to validate that the network has been set correctly.
2.3 Enable MotoPlus Functionality
If MotoPlus functionality it not already enabled on Robot Controller, browse to System -> Setup -> Option Functions
Switch MOTOPLUS Func State from NOT USED to USED.
The MotoPlus APL icon should now become visible on the left pane.
Enter the MotoPlus Func. Settings and enable the MotoPlus autostart option:
2.4 Load MotoPlus Application
The 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 must 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.
Confirm the loading of the MotoPlus application by clicking YES:
The Maintenance Mode section of the configuration process is now complete. Restart the Robot Controller into Normal Mode. If the configuration has been performed correctly, no errors should appear after the reboot.
3. Photoneo Yaskawa Module Setup
3.1 Copy INFORM JOBS to Robot Controller
As next step, copy all JOBS from INFORM Folder of the ZIP Archive to the Robot Controller. Use a USB stick or SD Card for the transfer.
Browse to Ex. Memory -> Load and select all available JOBS as is shown in the figure below:
Hit Enter to start the transfer:
All JOB files should now be available in the Robot Controller. Before proceeding further, it is important to understand the concept of variable mapping.
3.2 Variable Mapping
Photoneo Yaskawa Module occupies following data registers:
BYTE REGISTERS (FLAGS):
- B000 - CONNECT_TO_VC - flag set by INFORM JOB to issue a request to the MotoPlus application to a establish connection to VC
- B001 - CONNECTED - flag set by the MotoPlus application to notify INFORM that connection has been established
- B002 - NEW_REQ - flag set by INFORM JOB to notify the MotoPlus application that new request has been issued
- B003 - REQ_FINISHED - flag set by the MotoPlus application to notify INFORM that request has been handled
- B004 - DATA_READY - flag set by the MotoPlus application to notify INFORM that bin picking sequence data are ready for execution
- B005 - OPER_READY - flag set by the MotoPlus application to notify INFORM that data are ready for execution
- B006 - OPER_FINISH - flag set by INFORM JOB to notify the MotoPlus application that an operation has been executed
- B007 - PICK_FINISH - flag set by the MotoPlus application to notify INFORM about the execution of the last bin picking operation
- B008 - PICK_IN_PROGRESS - flag set by the MotoPlus application to notify INFORM about ongoing picking operation
- 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 operations of the 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 - Additional 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 the MotoPlus application according to the content of I031-I040 registers
- I031 - I040 - TRAJ_1_SPEED - TRAJ_10_SPEED - configuration of trajectory speed
- R000 - CALIBRATION_ERROR (not supported in this version)
- R001 - CUSTOMER_DATA_1 - data #1 to be sent as part of a customer request to the Vision Controller
- R002 - CUSTOMER_DATA_2 - data #2 to be sent as part of a customer request to the Vision Controller
- R003 - CUSTOMER_DATA_3 - data #3 to be sent as part of a customer request to the Vision Controller
- R004 - CUSTOMER_DATA_4 - data #4 to be sent as part of a customer request to the Vision Controller
- 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
3.3 Setting IP Address of Vision Controller
Bin Picking Client running on the Robot Controller requires information about the IP Address of the Vision Controller in order to establish a successful connection.
Four integer registers (I000 - I003) are utilized for this purpose. Insert the current IP Address of Vision Controller here:
Ports utilized by Photoneo Yaskawa Module:
- - Bin Picking Client Port: 11003
- - State Serer Port: 11004
3.4 Set User Frame
The Cartesian origin of Yaskawa robots is different to the Cartesian origin of robot models used in the Photoneo Bin Picking Studio.
In order to ensure successful calibration, it is necessary to apply a predefined offset in the Z axis in User Frame.
Press Robot -> User Frame and select the first frame from the list. Press Display -> User Coordinates
Set Z axis offset according to the specific robot model and write the changes.
3.5 Reteach Start and End Positions
A crucial step in 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.
The Home Pose can be modified directly in the PHO_MAIN program. Start and End positions must be stored in Position Registers and cannot be taught only as a local program position variable.
Yaskawa robots use PULSE notation for storing joint robot poses. The easiest way to copy these joint values to Position Registers is to use the PHO_TEACH_START_POSE and PHO_TEACH_END_POSE JOBS:
Jog the 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 the P001 variable. If more vision systems are to be configured, repeat the same procedure with the updated P00X index. (P002 and P003 for Vision System 2 ...)
4. INFORM LANGUAGE
The Photoneo Yaskawa Module has been designed to be easily integrated into existing applications written as INFORM JOBS.
4.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 the 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 the 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 the 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 the 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 the first of all Photoneo Bin Picking API procedures. It should always be followed by the PHO_INIT_REQ function. Failure to do so will result in a communication error.
NOTE #2: The PHO_WAIT_FOR_SCAN should 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 must be finished prior to any further steps. For example - PHO_SCAN_REQ followed by PHO_TRAJ_REQ results in communication error.
4.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.
- PHO_PICK_OBJECT - standard bin picking sequence. This flexible, operation-based implementation allows 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)
4.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 entire bin picking sequence is reinitialized.
If PLANNING_FAILED or NO_PART_FOUND occurs, scanning is repeated.
Users should decide whether the existing error handling facility is sufficient for a particular application or whether it needs to be expanded!
4.4 MAIN APPLICATION
The 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
Ensure that your solution on the Deployment page of Bin Picking Studio is running and Bin Picking Status is in the Waiting for a Connection state as is shown in the figure below:
Using the key pendant switch, set the Robot to AUTO Mode using the icon located in the top left corner.
Browse to JOB -> Select Job and choose the PHO_MAIN JOB.
Turn on the motor power with the SERVO ON button and press the GREEN Circle button to start the application
If the connection between the Robot Controller and the Vision Controller has been established correctly, 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 received, the robot should start executing the motion. Stop the JOB using WHITE Circle button.
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.
5.1 Restarting the Application
After stopping the application using the WHITE Circle or Emergency Button it is necessary to run the PHO_RECOVER JOB to ensure that the connection to the Bin Picking Studio has closed properly and that all important flags have been cleared.
Browse to JOB -> SELECT JOB and search for PHO_RECOVER JOB. Turn SERVO ON and start the program using the GREEN Circle button.
When the program finishes, Disconnected from VC alarm message should appear on the pendant:
This means that the connection to the Bin Picking Studio has been closed properly, all flags are cleared and the system is ready for a new connection.