Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with YASKAWA robots

From 3D scanning Knowledge base - Photoneo wiki
Revision as of 21:03, 2 March 2019 by Durovsky (talk | contribs)

Jump to: navigation, search

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


NOTE: It is recommended to plug Ethernet cable to the LAN2 port and try to ping Robot Controller from a PC to validate proper network 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.

3. Photoneo Yaskawa Module Setup

3.1 Copy INFORM JOBS to Robot Controller

As a next step, copy all JOBS from INFORM Folder of ZIP Archive 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 3.1.1


Hit Enter to start the transfer:


Alt text
Figure 3.1.2


All JOB files are now available in the Robot Controller. Before proceeding further, it is important to understand 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 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

3.3 Setting IP Address of Vision Controller

Bin Picking Client running on the robot controller requires information about the 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 3.3.1


Ports utilized by Photoneo Yaskawa Module:

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

3.4 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 3.4.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 index. (P002 and P003 for Vision System 2 ...)

4. INFORM LANGUAGE

The Photoneo Yaskawa Module was 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 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.


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.

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)


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 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!

4.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


Switch Robot to AUTO Mode using the key pendant switch located in the top left corner.

Browse to JOB -> Select Job and choose the PHO_MAIN JOB.

Turn on the motor power usig SERVO ON button and press the GREEN Circle button to start the application


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. 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 Application

After stopping the application by WHITE Circle or Emergency Button it is necessary to run PHO_RECOVER JOB to ensure that the connection to the Bin Picking Studio is closed properly and all important flags are cleared.

Browse to JOB -> SELECT JOB and search for PHO_RECOVER JOB. Turn SERVO ON and Start the program using GREEN Circle button.


Alt text
Figure 5.1.1


When the program finishes, an alarm message Disconnected from VC should appear on the pendant:


Alt text
Figure 5.1.2


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.