Set up Universal Robots Controller¶
The Mikado connection for Universal Robots is compatible with UR Controller CB3 from V3.7 or the e-series from V5.1.
You can also find information on the use of a UR in chapter Using UR robots.
Network configuration¶
A network connection between the two systems is required for communication between the robot controller and Mikado Controller. To do this, first connect an Ethernet port of the Universal Robots Controller to an Ethernet port of the Mikado Controller. A fixed IP address and a corresponding subnet mask must then be set for both the Mikado Controller and the robot controller. The network configuration of the Mikado Controller is explained in more detail in section Network adapter.
The IP address of the UR controller can be accessed via the Settings menu (list icon at the top right) of the Polyscope interface. An IP address can be assigned there under the heading System → Network → Static IP address.
Make sure that the IP addresses of the Mikado Controller and Universal Robots Controller are in the same address space and that the subnet masks match. The IP addresses of the devices must not be identical.
Warning
In the Installation area, the Fieldbus → Ethernet/IP interface must not be activated as it interferes with the network connection to the Mikado controller.
Then enter the IP address of the robot controller in the Mikado Assistant under “Robot” -> “Connection” in the corresponding field and save the settings.
Setting up the communication program¶
In order for the robot to be controlled by Mikado, a communication program must be copied to the Universal Robots Controller and set up there. To do this, carry out the following steps:
Copy the URCap “ExternalControl” program to a USB stick. You can find the program via the button in the Mikado Assistant (“Parameters” -> “Robot” -> “Open directory”) or directly in the following directory:
/opt/isys-vision/mikado/share/ur_robot_driver/resources/externalcontrol-X.X.X.urcapInstall URCap on the UR controller:
CB3: Setup Robot → URCaps → + button → select externalcontrol-X.X.X.urcap → Restart
e-series: Top right on the menu icon → Settings → System → URCaps → + button → select externalcontrol-X.X.X.X.urcap → Restart
Configure URCap
Program Robot → Installation → External Control
Enter the IP of the Mikado controller
Create new UR program
Node “External Control” (listed under Structure) insert
Save program (e.g. under the program name mikado)
e-series: Activate Remote Control Mode
Top right on the menu icon → Settings → System → Remote Control → Enable
Settings for remote control mode¶
Exit → Switch mode from Local to Remote Control at the top right
Switch between Local and Remote Control mode¶
Set up autostart¶
Autostart can be activated so that Mikado can control and move the robot directly when the application is started. In this case, Mikado triggers the UR so that the communication program is also started when the robot axes are enabled.
Set up and configure Autostart:
On the UR Controller under Installation → Startup → Check Load default program → Select communication program (e.g. mikado.urp)
Save
If necessary, adjust the following parameters in the corresponding cell in the
launch/manipulator.launch.xmlfile:<param name="enable_autostart" value="true"/> <param name="autostart_ur_program_name" value="mikado.urp"/>
enable_autostart: Enable/disable the autostart function. Mikado waits at program start until a robot status could be read and only then triggers the communication program. (default value: 10s)
autostart_ur_program_name: Program name of the autostart program (usually name of the communication program including .urp extension) (default value: mikado.urp)
Hint
UR offers the option of energizing and enabling the robot directly after the controller start via digital inputs. Use this function (can be found under Installation → Startup) to boot the system into an operational state.
Joint angle limits¶
The Mikado path planning supports joint angle ranges of up to 360°. As a UR has spinning joints, the value range in the robot controller (Polyscope) must be reduced. You can define limits for the Joints in the robot safety settings. Use the same value ranges here as you have set in the configuration (joint_limits.yaml) of Mikado. This prevents you from accidentally teaching robot poses that are outside the limits.
Please note: Give the joint limits in the controller a little more leeway (+/- 4°), as a safety stop can be triggered earlier and the Freedrive counteracts before the limits are reached. Example: Configuration Mikado: from -180° to 180° → Configuration Polyscope: from -184° to 184°
Hint
If you want to go beyond the joint angle value range for certain applications, you can also move the value range. You just need to make sure that the joint angle limits on the controller and the Mikado configuration match.
It is also possible to use a native robot program to enable rotations beyond the limits. For example, you can use the task “Execute robot program” for certain movements in your application and then return control to Mikado.
Speed and acceleration¶
Make sure that you always set a sufficiently low speed/acceleration in Mikado so that the robot cannot exceed the maximum speed/acceleration set in the UR controller. If the UR controller has to limit the speed, this can lead to the error message “Goal distance too high” and the robot may stop before it reaches the planned goal. In this case, you must either increase the limits in the UR controller or reduce the values in Mikado on the Robot control page.
Optional: Execute native robot program¶
Native programs can be executed on the controller using the “Execute robot program” task.
The following steps are necessary for this:
Create a new UR program using the teach pendant
If you want to transfer variables to the program, create the corresponding installation variables:
These can be found under Program Robot → Installation → General → Variables
Do not forget to save the installation configuration with the installation variables as well
UR Installationsvariablen¶
Insert the UR command Stop at the end of your UR program. At this point, the UR program stops and returns control to Mikado.
Example of a native UR program¶
Once you have completed and tested your UR program, load and start the control program again
Now you can use the task “Execute robot program” in Mikado to integrate your native UR program into the process
Example Mikado program with task “Execute robot program”¶
Hint
In the currently available Mikado version, you do not have the option of returning a return value to Mikado. By default, you will receive the value 0 as the return value of the task.
Inverse kinematics: Using robot calibration data¶
If a new Mikado cell is created with the Assistant, an analytical algorithm is used by default to calculate the inverse kinematics. A Universal Robot is usually delivered in a calibrated state so that inaccuracies in the robot kinematics are compensated for. However, the analytical algorithm cannot take this data into account. In many applications, however, these offsets can be compensated for by means of TCP calibration for the corresponding restricted working range.
However, if an application requires greater accuracy, the solution algorithm for inverse kinematics can also be converted to a numerical method. Please note, however, that numerical methods have the serious disadvantage of significantly higher computational effort. A conventional handle search can reach its limits here and lead to long calculation times.
The following steps must be carried out to convert a Mikado cell to numerical inverse kinematics and to read in the calibration data:
Start the UR robot and ensure that there is a connection
To be able to use the (individual) calibration of your UR robot for the calculation of exact inverse kinematics, this is read out from the controller. Open the console and enter the following command (enter the IP of the robot and your cell name at
<ROBOTER IP>and<CELLNAME>):roslaunch ur_calibration calibration_correction.launch robot_ip:=<ROBOTER IP> target_filename:="${HOME}/mikado/cells/<ZELLNAME>/config/ur_calib_data.yaml"
You are welcome to change the file name, but you must also take this into account in the following step. The controller must be switched on and accessible via the network as described above.
The calibration data is now available as a file and still needs to be linked to the robot cell. To do this, open your cell in the Mikado-Assistant and switch to the Model → Global page. Replace the path to the calibration file as shown in the following example:
<xacro:ur10e_robot joint_limited="true" kinematics_file="${load_yaml('$(find ur_e_description)/config/ur10e_default.yaml')}" prefix="${arm_prefix}"/>
is replaced by:
<xacro:ur10e_robot joint_limited="true" kinematics_file="${load_yaml('../config/ur_calib_data.yaml')}" prefix="${arm_prefix}"/>
Furthermore, open the file
launch/manipulator.launch.xmlin the cell directory and replace the line:<arg name="kinematics_config" default="$(find ur_e_description)/config/ur10e_default.yaml" ... />
through:
<arg name="kinematics_config" default="$(dirname)/../config/ur_calib_data.yaml" ... />
Create a new configuration file
config/kinematics.yamlin the cell directory and open it. Copy the following content into the file:manipulator: kinematics_solver: trac_ik_kinematics_plugin/TRAC_IKKinematicsPlugin kinematics_solver_timeout: 0.005 kinematics_solver_attempts: 3 solver_type: Distance
Include the new
kinematics.yamlby opening the filelaunch/planning_context.launch.xmland adapting the following line:<rosparam command="load" file="$(find ur5_e_moveit_config)/config/kinematics.yaml"/>
through:
<rosparam command="load" file="$(dirname)/../config/kinematics.yaml"/>
Now check whether the changes were successful by starting Mikado. If the calibration data is correctly integrated, the following message will appear in the logs when you start Mikado:
Calibration checked successfully.(In the event of an error, the messageThe calibration parameters of the connected robot don't match the ones from the given kinematics config file [...]).Check the active method for calculating the inverse kinematics by entering the following command on the console:
rosparam get /robot_description_kinematics/manipulator/kinematics_solver
The following line should now be displayed:
trac_ik_kinematics_plugin/TRAC_IKKinematicsPlugin
Using UR robots¶
Turning on the robot¶
Start Mikado and robot controller
Energize and unlock the robot
Make sure that the Remote Control mode is selected on the teach pendant at the start time of Mikado
The Remote Control Mode can be selected at the top right of the UR Teach Pendant¶
Load and start the Mikado program on the UR Controller
A connection to Mikado is established. If this is not successful, an error message appears. In the event of an error, check the network connection and start the Mikado interface.
The execution of movements can now be stopped or paused on the teach pendant. However, this can lead to timeouts occurring in Mikado and thus tasks being aborted due to the timeout.
Hint
Note that the Mikado communication program is terminated as soon as you move the robot manually. Restart the program as soon as you want to return control to Mikado.
You can optionally use an autostart for the UR program (see Set up autostart).
Parameters and controls¶
Speed - Acceleration:
Two input fields allow you to set the speed and acceleration factor for robot movements. Please note that maximum values are stored in the System configuration so that you may not be able to exceed a limit value.
Other notes¶
Teaching position:
You can teach positions using either buttons on the teach pendant (polyscope) of the robot or the Freedrive mode.
Click on “Accept current robot pose” in Mikado.
Note that you must restart the UR communication program after manual robot movements so that Mikado can send commands to the robot again.
Troubleshooting Universal Robot¶
The robot cannot be moved via Mikado
Check whether there is a connection to the robot
Are the axles energized?
Is the communication program running on the Teach Pendant?
Is the UR in remote control mode?
Has the communication program entered the address of the Mikado controller as the IP?
The UR communication program cannot be started and displays the error message “The connection to the remote PC could not be established”
Has the communication program entered the address of the Mikado controller as the IP?
Are the IP addresses of the robot and Mikado controller correctly configured and in the same subnet?
The Mikado system status for the robot is red
Check whether the axes are energized and the communication program has started successfully
A native program cannot be started.
Check the program name, variable names and the existence and data type of the installation variables.
Important: The system connects to the UR Controller during the start-up process of the Mikado interface. At this point, the Remote Control Mode must be selected on the teach pendant.
If a robot movement is to be executed in the native program, the first waypoint must match the current robot position. Otherwise you will receive an error.
Autostart of the Mikado communication program does not work
The system connects to the UR Controller during the start-up process of the Mikado interface. At this point, the Remote Control Mode must be selected on the teach pendant