One of the things that makes Universal Robots (UR) so easy to program is their graphical programming interface, called Polyscope. It allows you to physically guide the robot around its workspace and record its position as “waypoints.”
But, there’s one thing which causes a problem: it does not integrate well with offline programming software. In many cases, if you wanted to use offline programming, you’d have to give up the benefits of the Polyscope programming and use text-based SCRIPT files.
However, what if we want both the advantages of offline programming and Polyscope’s user friendly programming?
With RoboDK we’ve made it simple!
Robot Programming options for Universal Robots
You can program Universal Robots (UR) using one of the following two methods:
- URP Programs— URP files are created using the teach pendant’s touch screen, using the Polyscope GUI (Graphical User Interface). These programs are easy to generate or modify and they do not require any robot programming experience. A URP program can also include one or more SCRIPT files as subprograms to expand the functionality.
- SCRIPT Programs — Script files use the UR Script programming language. Like any other programming language, UR Script has variables, types, flow of control statements, function etc. Furthermore, UR Script programming language has built-in variables and functions which control the I/O and the movements of the robot.
Both methods have advantages and disadvantages: While you can create URP files from the teach pendant with no programming experience, Script files allow extending their functionality with some programming. Furthermore, Script files can also be streamed through UR’s Remote Control protocol (TCP/IP) to move the robot remotely.
The main issue with Polyscope is that it saves its programs to binary URP files. Most offline programming software could only export to UR robots using the more tricky SCRIPT files.
Offline Programming to URP Programs
Wouldn’t it be great if we could have the advantages of offline programming, but with the ability to update our programs using the Polyscope GUI?
This is possible with RoboDK!
When you program a Universal Robot using RoboDK, you can export the program to both a SCRIPT file and a URP file.
You can then load the URP program to the robot and update it using the Polyscope GUI. You can even send it remotely via FTP and/or start the program remotely!
As an example, let’s assume we are planning to create a program for automated inspection. In this case we could split the main task in the following sub-tasks:
- Safe approach (movement) to the inspection part
- Turn ON inspection (a Digital Output signal)
- Move along the inspection path
- Turn OFF inspection (a Digital Output signal)
- Safely Move back to the home position
You can easily set this up in RoboDK and it allows generating modular programs. Splitting programs this way makes it easier to maintain the application if we have to make modifications in the future.
How to Create a URP File in RoboDK
Follow these steps to generate a URP robot program with RoboDK. If you haven’t got a copy of RoboDK yet, download it here.
I’m going to assume that you have a simulation ready in RoboDK. If you need some help doing this, make sure to check out our Getting Started Guide.
- Right-click the robot and select Select Post Processor.
- Select the Universal_Robots_URP Post Processor (you should update RoboDK if you don’t see it).
- Select Program-Generate Program(s) (F6). This procedure will generate a Script and a URP program for each program selected or available. These program files are generated on the Desktop folder by default (this setting can be changed in Tools-Options-Program-Robot Programs folder).
- Copy the generated URP file(s) to a USB drive. Alternatively, select Explore to transfer the program using FTP transfer (if the robot and the computer are connected).
Then, head over to your UR teach pendant and follow these steps on the robot controller to load the programs.
- Select Program Robot from the main menu in the teach pendant screen.
- Select Load Program.
- Locate the URP file and select Open (make sure that required subprograms are in the same folder and they’ll be automatically linked).
The program will be displayed on the main screen showing the same sequence that was created in RoboDK. You can select the “Play” button to start it.
You can also trigger the program directly from RoboDK if the computer is connected to the robot. This is useful for debugging. You can accomplish this by connecting the robot and using the Send Program to Robot (Ctrl+F6) option.
How to Modify Your Program in Polyscope
Now that you have loaded the URP program into Polyscope, you can easily modify the targets (as we call them, or “waypoints” as UR calls them) directly using the teach pendant or change the sequence of motions.
If you don’t know how to use the Polyscope GUI, it is a bit beyond the scope of this blog article for me to explain it. However, you can find the latest Polyscope user manual at this link.
Universal Robots also has their UR Academy, where you can learn to program using an interactive online tutorial (it requires you to sign up for a free account).