How to Program a Universal Robot: A Beginner's Guide (2026)
Universal Robots arms are the most popular collaborative robots in the world, and a big reason is that they are genuinely approachable to program. You do not need a robotics degree to teach a UR arm to pick a part and place it somewhere else. This guide walks you from never having touched a cobot to understanding a complete first program — the concepts, the vocabulary, and the order to learn them in.
What "programming a robot" actually means
A robot program is a sequence of moves and actions, wrapped in logic. That is it.
- Moves take the tool from one pose to another.
- Actions do something at a pose — close a gripper, set a signal, wait.
- Logic decides what happens — if a sensor is on, pick from bin A, else bin B; repeat until the tray is full.
Everything else is detail in service of those three. Keep that frame in mind and the rest stops being intimidating.
The two interfaces: PolyScope and URScript
A UR robot is programmed through the teach pendant — a touchscreen running an interface called PolyScope. You build a program by adding nodes to a tree: a Waypoint here, a Set output there, a Wait, an If.
Underneath PolyScope is a text language called URScript. Every node you add generates URScript that the controller runs. Beginners usually start in PolyScope's graphical tree and move toward writing URScript directly as their programs get more logic-heavy. (If you want the language itself first, read What is URScript?.)
Step 1: Understand frames and the TCP
Before any move makes sense, the robot needs two reference ideas.
- The base frame is the robot's own coordinate system, centred at its base. By default, poses are described relative to it.
- The TCP — Tool Centre Point — is where the working tip of your tool is, relative to the wrist flange. If you bolt on a 150 mm gripper, you tell the robot
set_tcp(...)so it knows the real tip is 150 mm past the flange. Skip this and every Cartesian move is wrong by the length of your tool — the single most common beginner mistake.
You can also define your own feature frames — a coordinate system aligned to a fixture or conveyor — so your program reads in the part's coordinates instead of the robot's. That makes programs easier to write and easier to relocate.
Step 2: Teach waypoints
A waypoint is a saved pose. There are two ways to create one:
- Freedrive — hold the button on the pendant and physically move the arm by hand to where you want it, then save the pose. This hands-on teaching is a signature UR feature and how most people set their first points.
- Jogging — nudge the arm using on-screen arrows, either joint-by-joint or in Cartesian X/Y/Z, then save.
Your first program is essentially a handful of taught waypoints — home, above-pick, pick, above-place, place — strung together with moves.
Step 3: Choose the right move between waypoints
Between two waypoints you pick a move type, and the choice matters:
movej(joint move) — fast, follows a curved path. Use across open space.movel(linear move) — straight Cartesian line. Use near parts and fixtures.
Getting this right is foundational enough that we wrote a whole guide on it: movej vs movel vs movep. For a first program, the rule of thumb is: movej to get close, movel for the final approach and retreat.
Step 4: Add the gripper — digital I/O
A move puts the tool in place; an action makes it do something. The most common action is operating a gripper through a digital output:
set_digital_out(0, True) # close gripper
sleep(0.4) # give it a moment to grip
set_digital_out(0, False) # open gripper
You read sensors the same way with get_digital_in(n) — for example, checking a part-present sensor before you try to pick. This is also exactly how a robot talks to a PLC: digital signals back and forth coordinating the cell. (If you do not know what a PLC is, our PLC simulator is the other half of this skill set.)
Step 5: Your first complete pick-and-place
Put the pieces together and you have a real program. In URScript it reads cleanly:
set_tcp(p[0, 0, 0.15, 0, 0, 0]) # 150 mm gripper
set_payload(0.8) # 0.8 kg part
home = [0, -1.57, 0, -1.57, 0, 0]
pick_approach = p[0.40, -0.20, 0.10, 0, 3.14, 0]
pick = p[0.40, -0.20, 0.02, 0, 3.14, 0]
place = p[0.40, 0.20, 0.02, 0, 3.14, 0]
movej(home, a=1.4, v=1.0)
movel(pick_approach, a=1.2, v=0.4)
movel(pick, a=0.5, v=0.1) # slow, straight down onto the part
set_digital_out(0, True) # grip
sleep(0.4)
movel(pick_approach, a=1.2, v=0.4) # lift straight up
movel(place, a=1.2, v=0.3)
set_digital_out(0, False) # release
movej(home, a=1.4, v=1.0)
Read it top to bottom: set up the tool, define the poses, move home, approach and descend to the pick, grip, lift, move to place, release, go home. That is a working cobot job.
Step 6: Respect safety — the part that makes it a cobot
Universal Robots are collaborative robots, meaning they are designed to work near people. That safety is configured, not assumed:
- Protective stops: if the arm contacts something with more force than the configured limit, it stops automatically. Great safety feature — and also something to design around, because an unexpected protective stop halts production.
- Safety planes and zones: you define virtual boundaries the tool may not cross.
- Speed and force limits: lower limits make the robot safer around people but slower.
Designing a cycle that is fast yet never trips an unintended protective stop — and that behaves safely if it does contact something — is a real skill. It is also dangerous and expensive to learn by trial and error on a physical arm.
Step 7: Practise — ideally without a real robot first
Here is the honest truth about learning robot programming: you learn by repetition, and repetition on a real arm is slow, shared, and risky. Beginners improve fastest when they can run a task fifty times, fail safely, and tweak.
The classic free tool is URSim, UR's official offline simulator — capable, but it runs as a Linux virtual machine that many beginners find hard to set up. Paid desktop tools like RoboDK are excellent but aimed at professional integrators.
We are building a browser-based UR robot simulator to close that gap: write real URScript, run it on a simulated UR arm with live physics, and learn pick-and-place, frames, TCP, waypoints, and safety — graded from zero, with nothing to install. It is the same approach behind our PLC simulator: practise the real skill in the browser, free to start. It is launching soon — join the early-access list on that page and you will be first in.
Key takeaways
- A robot program is just moves + actions + logic.
- Set the TCP first — almost every beginner error traces back to skipping it.
- Teach waypoints with freedrive or jogging, then connect them with the right move type (
movejin open space,movelnear things). - Operate grippers and talk to PLCs through digital I/O.
- Safety (protective stops, planes, force limits) is configured and is core cobot skill.
- You learn fastest by repeating safely in a simulator before touching real hardware.
Next steps
- Foundations: What is URScript?
- The most important motion skill: movej vs movel vs movep
- Join the early-access list for the robot simulator and program your first cobot in the browser.