Integration with UR E-series

This topic introduces the integration with Universal Robots (UR) E-series.

Plugin Installation and Setup

This section introduces the installation and setup of Mech-Mind 3D Vision Interface (URCap plugin) for UR E-series.

Pre-requisites

Verify that you meet the minimum required versions for Mech-Mind vision-series software and Polyscope.

To view the version of Polyscope, press the hamburger menu in the upper-right corner of the UR teach pendant and select About.

../../../../_images/settings_e.png
../../../../_images/about_e.png

Install the URCap Plugin

To install the URCap plugin, follow these steps:

  1. Find the URCap plugin file in the \Robot_Interface\Robot_Plugin\URCAP\ directory of the Mech-Center installation path.

    ../../../../_images/urcap_plugin1.png
  2. Copy the URCap file to a USB drive and insert it into the UR teach pendant.

  3. Press the hamburger menu in the upper-right corner, and select Settings.

    ../../../../_images/settings_e.png
  4. On the Settings screen, select System > URCaps.

    ../../../../_images/system_urcaps_e.png
  5. Press + to navigate to the USB drive to locate the URCap plugin (a .urcap file).

  6. On the Select URCap to install screen, select the URCap plugin and press Open. The URCap plugin will be automatically installed.

    ../../../../_images/install_urcaps_e.png
  7. Press Restart for the change to take effect.

    ../../../../_images/restart_urcaps_e.png

Till now, the URCap plugin is successfully installed on the UR teach pendant.

Use Mech-Mind 3D Vision Interface

Note

Before use, make sure that your Mech-Vision and Mech-Viz (if used) projects are ready to run, and the Mech-Mind IPC is connected to the robot’s network.

To use Mech-Mind 3D Vision Interface, you need to complete the following setup.

Set and Start Interface Service on Mech-Center

  1. Open Mech-Center and click Deployment Settings on the Toolbar.

  2. In the Deployment Settings window, select Mech-Interface on the left panel.

  3. Select the Use Mech-Interface checkbox and select Standard Interface for the Service Type Option parameter.

  4. Set Interface options to TCP Server and ASCII, select the UR robot model for Listed robot, specify the Host Address parameter, and click Save.

    Attention

    The port number needs to be set to 50000.

  5. Click Start Interface on the Toolbar.

Till now, a TCP server interface should have been successfully started, as shown in the following figure.

../../../../_images/start_tcp_server1.png

Connect to Mech-Center

After the TCP server interface has been started on Mech-Center, you can connect to it on the UR teach pendant

  1. On the UR teach pendant, press Installation on the top bar, and then select URCaps > Network Settings. The Network Setting screen of the URCap plugin is displayed.

    ../../../../_images/network_settings_e.png
  2. Set MechMind IPC IP Address and Port No. to the IP address and port number of the Mech-Mind IPC respectively, and press Apply. The port number here and set in Mech-Center must be 50000.

  3. Press Connection Test.

  • When the connection to Mech-Center is established successfully, the return status should look like this:

    ../../../../_images/connection_pass1.png
  • When the connection to the Mech-Center fails to be established, the return status should like this:

    ../../../../_images/connection_failed1.png

Note

The connection test is just for test. Once connected, it will disconnect automatically. Therefore, you will see client online and offline logs on the Log panel of Mech-Center.

Hand-Eye Calibration Using the Plugin

This section introduces the process of calibrating the camera extrinsic parameters using the URCap plugin.

The calibration process consists of four steps:

  1. Create a calibration program.

  2. Teach the calibration start point.

  3. Run the calibration program.

  4. Perform calibration in Mech-Vision.

Pre-requisites

Before proceeding, please make sure that:

  • You have successfully connected to the Mech-Center with the URCap plugin.

  • You are familiar with the contents in Hand-Eye Calibration Guide of Mech-Vision.

Create a Calibration Program

  1. On the top bar of the UR teach pendant, press New and select Program to create a new program.

  2. Press Program on the top bar, and then select URCaps > Mech-Mind Calibrate. An example program node Calibrate is automatically created under the Robot Program program tree on the left panel.

    ../../../../_images/add_calibrate_node_e.png

The created example program node is just a template. You need to further configure the calibration program and teach the calibration start point.

Teach the Calibration Start Point

  1. Select the Calibrate node in the program tree, and set the Receive Point Type from Mech-Vision parameter to “Joint Angle” or “Flange Pose” according to the actual needs on the Command tab of the right panel.

    ../../../../_images/add_calibrate_node_e.png
  2. Select the MOVEJ node in the program tree, set the motion type to “MoveJ”, “MoveL” or “MoveP”, and Set TCP to Ignore Active TCP on the right Move panel to ensure that the waypoint will be recorded as flange pose.

    ../../../../_images/set_movej_e.png
  3. Manually control the robot to move to the start point for the calibration.

  4. Go back to the UR teach pendant, select the start_pose node in the program tree, and press Set Waypoint on the right Waypoint panel. You will be switched to the Move tab.

    ../../../../_images/teach_startpoint_e.png
  5. On the Move tab, confirm that the robot’s current flange pose is proper and press OK.

    ../../../../_images/confirm_waypoint_e.png

Run a Calibration Program

  1. Select the Robot Program program tree on the left panel, and clear the Program Loops Forever checkbox on the right Program panel to ensure that the program is run just once.

    ../../../../_images/run_calibrate_e.png
  2. On the bottom bar, lower the robot speed to a proper value, such as 10%, for safety concerns.

  3. Press run on the bottom bar to run the program.

When the calibration program runs successfully, logs will be printed on the Log panel of Mech-Center, as shown in the following figure.

../../../../_images/run_program_log1.png

Perform Calibration in Mech-Vision

After the URCap plugin has connected to Mech-Center and the calibration program runs successfully, you can perform the hand-eye calibration in Mech-Vision.

Please refer to Calibration Procedure to perform the automatic hand-eye calibration.

To save the calibration program for future use, select Save > Save Program As… on the top bar to save it.

../../../../_images/save_program_e.png

After you complete the hand-eye calibration, you can create pick and place programs to instruct UR robots to execute vision-guided pick and place tasks.

Create Pick and Place Programs

The URCap plugin provides an example Pick and Place program node for you to create pick and place programs with minimal programming efforts.

This Pick and Place program node provides two options:

  • Pick and Place with Mech-Vision: it suits for the scenarios where only a Mech-Vision project is used and the robot does not need Mech-Viz to plan path.

  • Pick and Place with Mech-Viz: it suits for the scenarios where a Mech-Viz project is used together with a Mech-Vision project to provide the collision-free motion path for the robot.

The plugin provides a program template for each option to facilitate the programming.

Note

The following examples assume that the actually used gripper and its TCP have been set for the robot properly.

Create a Pick and Place with Mech-Vision Program

To create a Pick and Place with Mech-Vision program, follow these steps:

  1. Enable the Pick and Place with Mech-Vision option.

    1. On the top bar of the UR teach pendant, press New and select Program to create a new program.

    2. Press Program on the top bar, and then select URCaps > Mech-Mind Pick and Place. An example program node Pick and Place is automatically created under the Robot Program program tree on the left panel.

      ../../../../_images/add_pick_place_node_e.png
    3. On the Command tab of the right panel, press the With Mech-Vision button. A program template is automatically created under the Pick and Place node in the program tree.

      ../../../../_images/select_with_vision_option_e.png
  2. Select the Mech-Mind Connect node in the program tree, verify that the Host IP setting is the IP address of the Mech-Mind IPC on the right Mech-Mind Connect panel.

    ../../../../_images/verify_host_ip_vision_e.png
  3. Set the image capturing pose.

    1. Manually control the robot to move to the proper location where Mech-Vision triggers to capture an image.

    Note

    • For Eye-In-Hand scenario, the robot should be placed above the workpiece.

    • For Eye-To-Hand scenario, the robot should not block the camera view.

    1. Go back to the teach pendant, select the MOVEJ node in the program tree, set the motion type to “MoveJ”, “MoveL” or “MoveP”, and Set TCP to Use active TCP on the right Move panel.

      ../../../../_images/set_movej_capture_e.png
    2. Select the Capture_image node in the program tree, press Set Waypoint on the right Waypoint panel. You will be switched to the Move tab.

      ../../../../_images/set_waypoint_capture_e.png
    3. On the Move tab, confirm that the robot’s current TCP pose is proper and press OK.

      ../../../../_images/confirm_waypoint_e.png
    4. Once the image capturing pose is set, proceed to the next step.

  4. Trigger the Mech-Vision project to run.

    1. Select the Trigger Mech-Vision node in the program tree, set the parameters Send Current Robot Position to Mech-Vision, Mech-Vision Project ID, and Request Vision Point Number on the right Trigger Mech-Vision panel.

      ../../../../_images/trigger_vision_e.png

    Parameter

    Description

    Mech-Vision Project ID

    The index of the Mech-Vision project to trigger. You can find the project ID in Deployment Settings > Mech-Vision of Mech-Center.

    Request Vision Point Number

    The number of vision points that you expect Mech-Vision to output.

    • If it is set to 0, all detected object points, but no more than 20, will be output.

    • If it is set to a number from 1 to 20, Mech-Vision will try to return the fixed number of vision points if the total detected number is greater than the number you expect.

    1. (Optional) Press Set Vision Recipe ID and a Set Recipe ID node is added under the Trigger Mech-Vision node in the program tree.

    2. Select the Set Recipe ID node in the program tree, and set Mech-Vision Recipe ID on the right Set Recipe ID panel.

      ../../../../_images/set_receipe_id_e.png
  5. Set how to receive Mech-Vision results.

    Select the Receive Mech-Vision Result node in the program tree, and set variable names for Pose, Label, Total Received, and Status Code, which are used to save vision results.

    ../../../../_images/receive_vision_result_e.png

    Parameter

    Description

    Pose

    The points of detected parts in XYZ format. The robot can directly move to the point with active TCP. By default, the received points are saved in the array variable “pose[]”, start with array index 1.

    Label

    The object labels of detected parts. The label is an Integer. By default, the labels are saved in the array variable “label[]”, start with array index 1. Labels and Poses are one-to-one paired.

    Total Received

    The total received point number.

    Status Code

    The status code returned from Mech-Center. See the Status Code list for reference. 11xx is normal code, 10xx is error code. By default, the status code is saved in the variable “status_code”.

    Starting at ID

    The start index of the array variables for poses and labels. By default, the index is starting with 1.

    Please note that if you change the default variable names of poses, labels, and etc., the pick node and the place node below will not work. You need to program the pick and place motion by yourself. An example using the default variable “pose[]” is shown below.

    ../../../../_images/default_pick_example1.png
  6. Set the pick task.

    Note

    • If you change the default variable names of poses, labels, and etc. in the node of Receive Mech-Vision Result, the pick node will not work. You need to delete the pick node and program the pick motion by using “pose[]”.

    • A pick task consists of three motions: Pick_above, performs a linear approach to the pick point; Pick, picks the object, and Pick_depart, performs a linear departure away after picking.

    1. Set the parameters Dist and Coordinates for the Pick_above and Pick_depart respectively on the right Mech-Vision Pick panel.

      ../../../../_images/set_distance_coordinates_e.png
    2. Select the MoveJ node under the pick node in the program tree, and keep the default settings on the right Move panel.

    3. Select the pick_above node in the program tree, and keep the default settings on the right Waypoint panel.

    4. Select the MoveL node in the program tree, and keep the default settings on the right Move panel.

    5. Select the pick node in the program tree, and keep the default settings on the right Waypoint panel.

    6. Add gripper control logic for picking after the pick node according to your actual conditions.

    7. Select the second MoveJ node under the pick node in the program tree, and keep the default settings on the right Move panel.

    8. Select the pick_depart node in the program tree, and keep the default settings on the right Waypoint panel.

  7. Set the place task.

    1. Select the MoveJ node under the place node in the program tree, and keep the default settings on the right Move panel.

    2. Manually control the robot to move to the proper location to place the picked object.

    3. Go back to the teach pendant, select the place node under the MoveJ node in the program tree, and press Set Waypoint on the right Waypoint panel. You will be switched to the Move tab.

      ../../../../_images/set_waypoint_place_e.png
    4. On the Move tab, confirm that the robot’s current TCP pose is proper and press OK.

      ../../../../_images/confirm_waypoint_e.png
    5. Once the place pose is set, add gripper control logic for placing after the place node in the program tree according to your actual conditions.

Till now, a simple pick and place program collaborating with a Mech-Vision project has been completed. You can run it by just pressing run on the bottom bar.

Create a Pick and Place with Mech-Viz Program

Before using the plugin with Mech-Viz, select Send TCP pose checkbox in the Others panel of Mech-Viz.

../../../../_images/sent_tcp_pose_ur1.png

To create a Pick and Place with Mech-Viz program, follow these steps:

  1. Enable the Pick and Place with Mech-Viz option.

    1. On the top bar of the UR teach pendant, press New and select Program to create a new program.

    2. Press Program on the top bar, and then select URCaps > Mech-Mind Pick and Place. An example program node Pick and Place is automatically created under the Robot Program program tree on the left panel.

      ../../../../_images/add_pick_place_node_e.png
    3. On the Command tab, and press the With Mech-Viz button on the right panel. A program template is automatically created under the Pick and Place node in the program tree.

      ../../../../_images/select_with_viz_option_e.png
  2. Select the Mech-Mind Connect node in the program tree, verify that the Host IP setting is the IP address of the Mech-Mind IPC on the right Mech-Mind Connect panel.

    ../../../../_images/verify_host_ip_viz_e.png
  3. Set the image capturing pose in reference to Step 3 in Pick and Place with Mech-Vision.

    Note

    The point is where to trigger the Mech-Viz project.

  4. Trigger the Mech-Viz project to run.

    1. Select the Trigger Mech-Viz node in the program tree, set the Send Current Robot Position to Mech-Viz parameter to “Joint Angle” or “Dedicated Point” on the right Trigger Mech-Viz panel.

      ../../../../_images/trigger_viz_e.png

    Note

    • If you want Mech-Viz to plan the path before the robot arrives at the start position, set the Send Current Robot Position to Mech-Viz parameter to “Dedicated Point” and specify a dedicated joint position.

    • If you use the branch task in the Mech-Viz project and want the robot to select the branch out port, press Set Branch Out Port, and proceed to Step b to set the branch out port.

    • If you use a move-class task that has the index parameter, press Set Index Value, and proceed to Step c to set the index value.

    1. (Optional) Select the Set Branch Value node in the program tree, and set Branch Task ID and Branch Out Port on the right Set Branch Value panel.

      ../../../../_images/set_brach_value_e.png
    2. (Optional) Select the Set Index Value node in the program tree, and set Index Task ID and Branch Out Port on the right Set Index Value panel.

      ../../../../_images/set_index_value_e.png
  5. Set how to receive Mech-Viz results.

    Select the Receive Mech-Viz Result node in the program tree, and set variable names for Pose, Label, Speed (%), Total Received, Status Code, and Vision Point Index, which are used to save planned vision results.

    ../../../../_images/receive_viz_result_e.png

    Parameter

    Description

    Pose

    The planned motion path in XYZ format. The robot can directly move to the point with active TCP. By default, the received points are saved in the array variable “pose[]”, start with array index 1.

    Label

    The object labels of detected parts. The label is an integer. For non-vision point, the label should be 0. By default, the labels are saved in the array variable “label[]”, start with array index 1. Labels and Poses are one-to-one paired.

    Speed

    The motion speed of the robot moving to the point in percentage.

    Total Received

    The total received point number.

    Status Code

    The status code returned from Mech-Center. See the Status Code list for reference. 21xx is normal code, 20xx is error code. By default, the status code is saved in the variable “status_code”.

    Vision Point Index

    The index of the visual move in the received points. For example, Mech-Viz sends 3 points in the order of relative_move_1, visual_move_1, relative_move_2, so the vision point index is 2. By default, the vision point index is saved in the variable “vision_point”.

    Starting at ID

    The start index of the array variables for poses and labels. By default, the index is starting with 1.

  6. Configure the motion loop, which drives the robot to follow the path planned by Mech-Viz, that is, approach the object, pick the object, and depart from the pick point (not including placing the object). For how to set MoveL and MoveJ nodes, refer to Steps 6 in Pick and Place with Mech-Vision.

    Note

    • In actual applications, the motion loop may contain several pick_above MoveJ nodes, a pick MoveL node, and several pick_depart MoveJ nodes.

    • If you change the default variable names of poses, labels, and etc. in the node of Receive Mech-Viz Result, you need to change the variables used in this step.

  7. Set the place task by referring to Steps 7 in Pick and Place with Mech-Vision.

Till now, a simple pick and place program collaborating with a Mech-Viz project has been completed. You can run it by just pressing run on the bottom bar.