Universal Robots (UR) can be programmed with RoboDK using two different methods:
Graphical User-Interface Level (URP files):
The URP programs are created through the teach pendant’s touch screen of the robot. A URP program can have one or more SCRIPT files as subprograms. URP programs are transformed into SCRIPT programs behind the scenes on the robot controller before execution.
Level (SCRIPT files):
Script programs use the UR Script programming language. Like any other programming language, UR Script has variables, types, flow of control statements, function etc. In addition, UR Script has several built-in variables and functions which control the I/O and the movements of the robot.
RoboDK is a simulator and offline programming software for industrial robots. RoboDK can generate SCRIPT and URP files which can be executed by a UR robot. Additionally, it is possible to execute programs on the robot from RoboDK if the robot is connected to the computer.
RoboDK can also import SCRIPT files to the simulator. This allows to simulate existing SCRIPT programs, modify them and re-export them.
The UR’s teach pendant Graphical User Interface is called PolyScope (as shown in the following image). Refer to the URScript Programming Language manual for more information.
The IP of the robot is required execute programs directly from the RoboDK simulator. It is also possible to transfer program files through FTP.
The IP of the robot can be retrieved from the About menu in the UR’s teach pendant main screen.
The robot must be connected to the computer through an Ethernet connection (direct connection or through a network). A Ping test allows testing if the Network link has properly been stablished.
Robot drivers provide an alternative to Offline Programming (where a program is generated, then, transferred to the robot and executed). With robot drivers, it is possible to run a simulation directly on the robot (Online Programming). More information available in the Robot Drivers section.
Robot Programs can be executed directly from RoboDK to the real robot if a Network connection has been established.
1. Right click the robot in RoboDK
2. Select: Connect to robot…
3. Enter the IP of the robot
4. Select Connect.
There should be a green message displaying Ready if the connection succeeded.
The robot can be moved by selecting Get robot joints, Move Joints and Move Linear, from the connection menu.
Tip: If the robot becomes unresponsive, double clicking Disconnect forces the driver process to stop. Then, selecting Connect should restart the connection properly.
There are two different methods to run the program from the PC to the robot:
Run on robot step
by step with feedback in RoboDK (Online Programming):
This method uses the robot as a server and each instruction is sent to the robot step by step as it is executed in the simulator. This method is useful for debugging purposes.
a. Right click the program (Print3D in this example)
b. Select Run on robot
c. Double click the program to start it (or right click and select Run)
Once this option is checked it will connect to the real robot every time we double click a program (or right click, then, select Run)
These operations are also available from the RoboDK API and it allows integrating robot programming with other applications. The API is available in Python and C# and other programming languages.
2. Start on robot generates the complete program, transfers it to the robot and starts the program on the real robot (Robot Offline Programming):
a. Right click the program (Print3D in this example)
b. Select Start on robot (F8).
There is a macro available in the library that allows monitoring the state of a UR robot. Select:
1. Select File➔Open
2. Load the Macro UR_ActivateMonitoring.py from: C:/RoboDK/Library/Macros/. A new Python object will we added in the station.
3. Make sure the IP of the robot is properly provided in the robot connection parameters.
4. Double click the macro to start monitoring.
The simulator will update the position of the robot and will create targets as the real robot is moved. Among other things, it is possible to monitor the robot speed, acceleration and motor currents.
Once a program is ready in RoboDK it is possible to generate a SCRIPT and/or a URP program. These two files can be executed by the robot controller. Follow these steps to generate a SCRIPT and a URP program from a RoboDK simulation:
1. Right click a program (Print3D in this example)
2. Select Generate robot program F6
After a successful program generation, the program will be displayed on a text editor. This behavior can be changed in the menu: Tools➔Options➔Other.
Note: It is possible to select among different post processors or customize post processors to define the way programs are generated (for example, to support a gripper through certain program calls), or to avoid generating a URP program.
Transferring the SCRIPT and URP files can be done through FTP transfer or a USB drive.
Note: URP programs can be executed directly on the robot, however, SCRIPT programs must be executed from another URP program.
The following images and steps summarize the procedure to execute a SCRIPT program on the robot:
1. Select Program Robot on the main screen of the teach pendant
2. Select Empty Program
3. Select the Structure tab
4. Select the Advanced tab
5. Select Script code
6. Select File (as shown in the image)
7. Select the script file generated by RoboDK
8. Select the play icon to run the program
9. Select File➔Save to save the changes
10. Finally, the program can be executed
A SCRIPT program generated from RoboDK (such as by pressing F6) can be transferred to the robot using a USB disk or by FTP transfer if the robot and the computer are connected.
It is recommended to install FileZilla Client on the default path or directly inside the RoboDK install folder so that it is detected automatically by RoboDK:
C:\RoboDK\FileZilla FTP Client\
To transfer a file through FTP:
1. Right click a robot
2. Select Connect to robot...
3. Select Explore. FileZilla Client will open (software for FTP transfer).
4. Select File➔Site Manager...
5. Select Universal Robot sample, in Predefined Sites.
6. Select Duplicate. A copy of the Universal Robot setting will be created.
7. Enter the IP of the robot (192.168.1.66 in this example).
8. Select Connect.
9. Transfer the SCRIPT file previously generated to the robot.
The SCRIPT programs are usually stored in the folder /Programs/ on the robot controller.
Note: The communication port might have to be changed to 22 and the UR controller might only accept SFTP connection.
Following the steps in this section is optional and only required under certain circumstances when accuracy is required in offline programming. This section explains how to input unique kinematic values from the UR robot in RoboDK to accurately simulate and generate robot programs.
UR robot kinematics differ in 6 distance values from one robot to another and from default simulator values. Depending on how the robot is programmed it may be important to take these values into account.
The accurate Kinematics from a specific UR robot can be used in RoboDK by following these steps:
1. Get the file urcontrol.conf.[UR3/UR5/UR10] from a folder called URControl inside the robot controller. The file can be transferred using a USB disk, or through FTP connection as shown in the previous section.
2. Open the file in a text editor and look for the [DH] values as shown in the image.
3. Open the robot parameters window from RoboDK by double clicking the robot and selecting “Parameters”.
4. Select “Unlock advanced options” to be able to edit the 6 distance values.
5. Enter the 6 values marked in red from the DH table in the urcontrol.conf.ur10 file to RoboDK, as shown in the image.
When completed, we can right click a robot and select Save as .robot. These parameters are saved with the robot file.
Note: The a parameters must be multiplied by -1000 (change from meters to millimeters and change the sign). The d parameters must be multiplied by 1000 (change from meters to millimeters).
UR kinematics change from one robot to another one because each robot is calibrated in the factory. Other brands like KUKA, ABB, Motoman or Fanuc do not calibrate their robots unless the so-called Absolute Accuracy option is purchased. The Absolute Accuracy options may take into account up to 40 calibration parameters or more.