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

From 3D scanning Knowledge base - Photoneo wiki
Jump to: navigation, search
Line 1: Line 1:
 
== 1. Prerequisities ==
 
== 1. Prerequisities ==
  
Photoneo ABB Interface is intended for '''RoboTWareOS versions 5.13 and higher'''.  
+
Photoneo ABB Interface is compatible with '''RoboTWareOS versions 5.13 and higher'''.  
  
 
In addition to compliant system version, following conditions must be met:
 
In addition to compliant system version, following conditions must be met:

Revision as of 22:59, 26 January 2018

1. Prerequisities

Photoneo ABB Interface is compatible with RoboTWareOS versions 5.13 and higher.

In addition to compliant system version, following conditions must be met:

- (616-6) PC Interface Module available

- (672-1) Multitasking Module available

Browse to System Info -> System Properties -> Control Module -> Options to check if these options are available within your system:

Pendant options check.png


NOTE: Use of Robot Studio v.6.06 (or higher version) is highly recommended for Photoneo ABB Interface setup.

2. ABB Controller setup

Following tutorial gives a step by step guide how to configure your ABB IRC5 controller and install all necessary RAPID files to get the robot interface for Photoneo Binpicking Solution running.

This tutorial was originally written using the latest RobotWare v.6.06, however it should be compatible with older versions with minor changes.

2.1 Network configuration

Turn on the IRC5 Controller, wait for Initialization Screen to appear, open Menu screen and select Control Panel option:


ABB pendant menu RW6.png


On the Control Panel pane, select Controller Settings:


ABB pendant control panel.png


Select Settings and choose Network option:


ABB pendant network.png


Network settings window should appear. Use the touch panel keypad to set an IP address of the IRC5 WAN port:


ABB pendant IP setup.png


Press OK button and restart the controller to apply new settings:


ABB pendant restart.png


3 Robot Studio Setup

3.1 Connect to IRC5 Controller from Robot Studio

Set your local PC network settings to DHCP, plug Ethernet cable to Service Port of IRC5 Controller and launch Robot Studio.

For direct connection to Robot Controller, select Controller tab and One Click Connect option:


Robot studio connect.png

3.2 Transfer RAPID files

As a first step in installation of Photoneo ABB Interface, you need to copy RAPID files from your PC to the Robot Controller

You can use USB stick and copy files directly via pendant, however the most convenient way is to use Robot Studio File Transfer tool.

Go to Controller tab and select File Transfer tool from the menu:


Robot studio file transfer.png


Photoneo ABB Interface consists of four RAPID files:

- MainModule.mod

- CustomerDefinitions.mod

- PhotoneoStateServer.mod

- PhotoneoCommon.sys

All these files need to be transferred to the HOME:/Photoneo/ folder created within the robot controller file system as shown by the figure below:


Robot studio file transfer 2.png


3.3 Create State Server Task

For correct functionality of State Server, open PhotoneoStateServer.mod and make sure that variables robot_task_id and pho_state_server_port are valid with respect to your system configuration.

(For example multi axes systems use T_ROB1 and T_ROB2 tasks, your network configuration might prevent using port 11005 etc). Keep default values if you are not confident about these changes.


Robot studio state server config2.png


As a next step we need to create State Server Task. State Server Task will run in background and will report current robot state to the Vision Controller.

On the Left pane, click Controller then right click on the Task item in the list and select New Task...:


Robot Studio Task Definition 2.png


Following dialog should appear. Change settings as shown in the figure below:


Robot studio task settings 3.png

3.4 Automatic Loading of Modules

Now we need to configure ABB system to automatically load StateServer.mod during the boot.

Right Click on Automatic Loading of Modules and Select New Automatic Loading of Modules as shown in the figure below:


Robot studio loading modules.png


Configure module for PhotoneoState Server.mod as shown in the figure below:


Robot studio state server automatic loading.png

Repeat the same procedure for PhotoneoCommon.sys as a system module:


Robot studio pho common.png


Repeat the same procedure also for CustomerDefinitions.mod containing user settings:


Robot studio customer definitions.png

3.5 Load Main Module

Now we are ready to manually load MainModule.mod to T_ROB1 task. You can load the MainModule.mod file from your PC or directly from the controller.

Right Click on T_ROB1 task and select Load Module or Load Module From Controller:


Robot studio load module.png


This was the last step in Photoneo ABB Interface installation. Your RAPID left panel should now look like this:


Robot studio final panel2.png

And now lets dig into RAPID code to configure and fine tune your bin picking sequence.

4. RAPID

Photoneo ABB interface was designed to be easily integrated into existing application written in RAPID code. It provides two means which influence the final robot behavior:

- RAPID API - set of RAPID requests (or procedures) used to control the bin picking sequence. Requests are defined in PhotoneoCommon module and used within MainModule

- RAPID CONFIG - CustomerDefinitions.mod holds an application specific settings such as gripper commands, motion speed, precision and overall bin picking sequence definition.

4.1 RAPID API

Following API describes functionality of requests provided by Photoneo ABB Interface. They are intended for high level control of bin picking sequence and usually called in MainModule.mod.


pho_request_init(jointtarget pho_start_bin_picking_pose, jointtarget pho_end_bin_piking_pose) - request to initialize bin picking application on the Vision Controller side. Start and End Pose defined by the operator on the RAPID side are transferred to the Vision Controller and used in the trajectory planning pipeline as a start and terminus points.

pho_wait_for_server() - function to establish connection to the Vision Controller. Blocking function, program does not continue until connection is established properly. If server running on Vision Controller side is not running or not responding, en error is raised and RAPID program is terminated.

pho_request_scan() - request to trigger next scan and localization. Non-blocking request, RAPID program continues immediately at next line

pho_wait_for_scan_completition() - function to wait for scan to be finished. Should be called after triggering the scan, but not immediately

pho_request_trajectory() - request to start trajectory planning for current goal. Non blocking function, RAPID program continues immediately at the next line

pho_receive_trajectory() - function to receive requested bin picking trajectory (consists sequence of trajectory and gripper operations). This is usually called inside pho_bin_picking() function by default. Blocking function - waits for motion data to be received.

pho_request_scan_and_traj() - function to trigger scan, localization and trajectory planning in a single shot. Blocking function, handy for initial bin picking experiments. For actual production it is more convenient to split this sequence into particular actions and call them accordingly (pho_request_scan & pho_request_trajectory).

pho_request_calib_add_point() - request to add calibration point - scan is triggered and calibration is recalculated. Blocking request, program does not continue until calibration result is recalculated and received by the robot controller.

pho_calib_set() - request to set current calibration result to the PhoXi Scanner

pho_calib_reset() - request to reset current calibration and remove all previously added points

pho_bin_picking() - request to execute bin picking operation. It usually receives requested trajectory and perform motion execution. Blocking function, program does not continue until the whole sequence is finished. Always make sure that robot is in pho_start_bin_picking_pose before calling this function.


4.2 RAPID CONFIG

CustomerDefinitions module enables user to configure several bin picking settings, including gripper command implementations, trajectory speed and precision.


- open_gripper() - implement function for opening your gripper here

- close_gripper() - implement function for closing your gripper here

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

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

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

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

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

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

- binpicking_settings() - specify speed and precision settings for bin picking trajectories. Adopt number of trajectories to meet your bin picking setup. (by default 4 trajectories are used)

- pho_bin_picking_simple() - the very basic bin picking sequence (for experimental purposes)

- pho_bin_picking() - standard bin picking sequence. It is flexible, operation based implementation which allows performing bin picking sequences, which consist of various numbers of operations. Do not edit !!!


4.3 RAPID ERROR HANDLING

Photoneo BP solution provides basic error handling. If an error occurs during bin picking operation PHO_OCCURED_ERR flag is set to true. PHO_ERR_CODE variable contains code of specific error, which helps to identify the source of the problem.

PHO_NO_ERR := 0 - Service response from Vision Controller is valid

PHO_SERVICE_ERR := 1 - Service response from Vision Controller is invalid.

PHO_UNKNOWN_REQ := 2 - The Vision Controller received an unknown request.

PHO_COM_FAILURE := 3 - Communication failure due to socket closure.

PHO_BAD_DATA := 4 - Data validation check has failed.

PHO_TIMEOUT := 5 - Communication failure due to socket timeout.

PHO_PLANNING_FAILED := 201 - Trajectory planning has failed

PHO_NO_PART_FOUND := 202 - No part has been localized

PHO_NOT_INITIALIZED := 203 - Bin picking application has not been properly initialized on Vision Controller

PHO_PART_LOST := 204 - Part has been lost during motion execution

PHO_COLLISION_DETECT := 205 - Collision has been detected

PHO_UNKNOWN_ERR := 299 - Unspecified internal error


4.4 MAIN MODULE

Following section provides detail explanation of MainModule.mod - a module where user's application and Photoneo Bin Picking API are integrated together.

4.4.1 main()

The main() procedure is just a selection of which sub-procedure is about to be executed. Comment bin picking if you want to execute calibration and vice versa for bin picking execution.

RAPID main start.png

4.4.2 bin_picking()

This is a basic bin picking template. The main program loop is defined here. User is expected to reteach bin picking start and end positions, set IP Address and Port of Vision Controller and adopt placing part of the code to meet specific workcell and application requirements here.

RAPID bin picking.png

4.4.3 calibration()

Reteach calibration positions and call pho_request_calib_add_point() request after reaching each calibration pose. It is recommended to run calibration in MANUAL mode step by step to have a full control over the process. Always make sure that robot does not collide with the workcell during transitions between specific waypoints.

RAPID calibration.png

4.4.4 err_handling()

Several error situations might occur during bin picking procedure. Some of them are more serious some are less. For example if no part is found or trajectory planning fails, program just tries to repeat the whole sequence. However if communication failure is detected, program is halted immediately. It is possible to adopt this behavior in this procedure if needed

RAPID Error handling.png


5. Runtime

Apply RAPID changes, restart the robot controller and if everything was set correctly you should see following info screen on the pendant:


[[File: ]]


Open Main Menu, browse to Production Window and Set Program pointer to the beginning of the main function:


[[File: ]]


Select if you want to run the application in AUTO or MANUAL mode and adopt the speed override if needed:


[[File: ]]


Make sure that Bin Picking application on Vision Controller side is running and waiting for the connection:


[[File: ]] (Tu asi pride screenshot z webu)


Hit the Play button in AUTO mode or Enable + Play button in MANUAL mode and you should see following application output:


[[File: ]]


You should see the notification that Vision Controller has established successful connection:


[[File: ]] (Tu asi pride screenshot z webu)


TO EDIT:

Appendix - Configuration of I/O

A.1 Preparation

Finalize cabling (tall box on palette with controller), specifically XP1, XP13, XP2 to the bottom side of controller, with their respective connectors on the base of robot.

A.2 Setting up I/O

Various links are accessible on panel inside cabinet. These signals are wired throught XS/XP13 connector underneath the cabinet, throught connection in base of robot to R1(2).CP and R1(2).CS. XT6/6.1 signals 1 to 4 are usually used to power your device (4x1mm2) with link to R1(2).CP and connectors XT5.1, XT5.2 and XT5.3 are used to provide signals for your accessories carried by robot with link to R1(2).CS.

A.3 Accessing signals in program

Usually an I/O slave is included in robotic controller. If not install one inside cabinet and in Configuration - I/O System tab. Once completed a list of device’s Inputs/Outputs may appear in Signals tab. Configure them according to their specific purpose. A example of signal configuration is shown below:

Signals tab robot studio.PNG