PLC Simulator
Universal Robots · URScript

Learn Universal Robots Programming & URScript — Free, in Your Browser

Universal Robots (UR) cobots are programmed two ways: the PolyScope teach pendant and the URScript text language. This guide explains both accurately — movej vs movel, waypoints and blends, gripper I/O, TCP and payload — then lets you write real URScript on a simulated UR5e arm. No robot. No install. No vendor license.

A UR-style six-axis robot arm standing in a 3D factory cell in the browser-based robot simulator, with a parts table, safety railing and pallet, used to learn Universal Robots programming with URScript.

The two ways

How you actually program a Universal Robot

Every UR arm — the UR3e, UR5e, UR10e, UR16e and the larger models — ships with the same software, so the programming approach is identical across the range. There are two ways in, and experienced programmers move between them constantly.

1. PolyScope (graphical teach pendant)

PolyScope is the touchscreen interface on the UR teach pendant. You build a program tree by adding nodes — Waypoints, Move blocks (MoveJ / MoveL), I/O actions, and If / Loop logic. Crucially, you teach poses by physically jogging the arm to a position by hand and saving it as a waypoint, rather than typing coordinates. It is the fastest way to get a working program and the way most operators start. Under the hood, PolyScope generates URScript for everything you build.

2. URScript (text programming)

URScript is UR’s text-based language, with a Python-like syntax. You write commands directly — movej, movel, set_digital_out, set_tcp — either inside a Script node in a PolyScope program, sent over a socket from a PC, or as a complete .script file. Text gives you full control: real variables, math, loops, functions, and threads that are awkward to express in the graphical tree. It is the same language whether you are on a UR3e or a UR16e.

The takeaway: PolyScope and URScript are not rival products — they are two views of the same robot. PolyScope is generated URScript with a friendly front end. Learning URScript is what makes you fluent, because it is what the controller actually runs.

How PolyScope nodes map to URScript

Every graphical node you add on the teach pendant compiles to a URScript line. Once you can read that mapping, the two ways stop feeling separate.

PolyScope nodeGenerated URScript
MoveJ waypointmovej(pose, a=1.4, v=1.0)
MoveL waypointmovel(pose, a=1.2, v=0.25)
Set DO actionset_digital_out(0, True)
Wait DIwhile not get_digital_in(2): sync()
Set TCP / Payloadset_tcp(...) / set_payload(...)
Loop / If nodewhile ... : / if ... :
Diagram of a Universal Robots-style six-axis cobot arm with base, links, gripper and tool centre point, the J1–J6 joints you control when programming a URA six-axis articulated robot arm with a base and a two-finger gripper, its six rotary joints labelled J1 through J6.J1J2J3J4J5J6TCP
A UR arm has six rotary joints (J1–J6); both PolyScope and URScript ultimately move this TCP.

URScript essentials

The URScript commands that matter most

You can program a working UR cell with a small core of URScript. Here is the essential vocabulary, used correctly.

Motion: movej vs movel vs movep

  • movej — moves in joint space. Each joint interpolates from its current angle to the target angle. Fast and efficient, but the tool follows a curved path. Best for free-air moves between stations.
  • movel — moves the tool in a straight Cartesian line at a controlled tool speed. Use it for approach, insertion, and any move where the tool’s path matters.
  • movep — moves the tool linearly at a constant speed with circular blends, for process paths like dispensing or gluing where steady tool velocity is required.

Waypoints & blend radius

A waypoint is a taught target pose. By default the arm stops at each one. Add a blend radius and the arm rounds the corner — it never fully stops, so a chain of moves flows smoothly and the cycle time drops. Bigger blend = smoother and faster, but the path cuts the corner more, so blends are a trade-off you tune per move.

I/O & gripper control

set_digital_out(n, True/False) sets a digital output — the usual way to fire a 2-finger gripper or signal a conveyor. get_digital_in(n) reads an input, for example a part-present sensor. Picking something up is just: move to the part, set the gripper output to close, lift.

set_tcp & set_payload

set_tcp(pose) tells the robot where the working point of the tool is relative to the flange, so movel lines are straight at the tool tip, not the wrist. set_payload(mass) tells the robot how heavy the tool-plus-part is so it controls motion accurately and its safety/force monitoring stays correct. Getting both right is essential for accuracy and safe cobot operation.

Diagram of UR movej versus movel: movej curves through joint space while movel keeps the tool on a straight Cartesian line between the same two waypointsTwo tool paths between the same two points: a curved joint move (movej) in cyan and a straight linear move (movel) in amber.ABmovej — joint arcmovel — straight line
movej vs movel
Diagram of UR waypoints and blend radius: stopping at each taught waypoint versus rounding the corners with a blend for a faster cycleA tool path through four waypoints P1 to P4 with a rounded blend radius smoothing the corner at P3 so the robot does not stop.blend rP1P2P3P4
Waypoints & blends
Diagram of UR gripper I/O: set_digital_out closing and opening a two-finger gripper, and get_digital_in reading a part-present sensorA two-finger robot gripper shown open (DO=0) and closed on a part (DO=1), controlled by a digital output signal.OPENDO = 0set DOCLOSEDpartDO = 1DO active
Gripper & I/O
Diagram of UR set_payload: the mass of the tool plus part the cobot must know to move accurately and keep its force monitoring correctA robot arm holding a payload box at its tool centre point, with a mass and centre-of-gravity indicator and a small downward droop hint.3.0 kgCoGdroop
TCP & payload
# A first URScript pick-and-place on a UR5e
set_tcp(p[0, 0, 0.15, 0, 0, 0])      # tool point: 150 mm gripper
set_payload(0.8)                      # 0.8 kg tool + part

movej(home_q, a=1.4, v=1.0)           # joint move to a safe home pose
movel(pick_approach, a=1.2, v=0.3)    # straight line above the pick
movel(pick, a=0.5, v=0.1)             # straight down onto the part
set_digital_out(0, True)              # close the gripper
sleep(0.4)

movel(pick_approach, a=1.2, v=0.3)    # lift straight up
movel(place, a=1.2, v=0.25)           # straight line to place B
set_digital_out(0, False)             # open the gripper
movej(home_q, a=1.4, v=1.0)           # return home

That is real URScript — the exact same commands run on a physical UR controller. In the simulator you write this, the arm solves the inverse kinematics for each pose, and you watch it run under physics.

Diagram of how UR URScript becomes motion: a movel command is parsed, inverse kinematics solves the joint angles for the target pose, the trajectory is planned, and the UR arm movesThree lines of URScript — movej, movel and set_digital_out — each mapped by an arrow to the corresponding motion on the robot arm.program.urpmovej(p1)movel(p2)set_digital_out(0,True)
Each URScript move is parsed, solved with inverse kinematics, planned, and run on the arm.

Learn UR programming

A step-by-step path from zero to a graded cell

You do not learn robot programming by reading — you learn it by writing code and watching the arm move. This is the order that works, and it is the order the lessons follow. Every step runs against a simulated UR arm and is graded against a real goal.

1 · Jog the arm

Move the UR in joint space and Cartesian space; understand base vs tool frames and how the tool centre point (TCP) is defined before you write any code.

2 · Your first moves

Write movej and movel to send the arm between poses; see how acceleration (a) and velocity (v) change the motion, and when each move type is right.

3 · Digital I/O & gripper

Use set_digital_out and read inputs with get_digital_in; open and close a gripper so the arm can actually pick something up.

4 · Pick-and-place A→B

Combine approach, grasp, lift, traverse, place, and release into the core cobot skill — a complete pick-and-place cycle.

5 · Waypoints & blends

Chain waypoints and add a blend radius so the arm flows smoothly through points instead of stopping at each one, for faster cycle times.

6 · Payload & TCP

Configure set_payload and set_tcp correctly and see how they change reach, accuracy, and the safe speed of the arm.

7 · Protective stop & safety

Trigger and avoid a protective stop; understand cobot force limits and safety planes so your program stays within safe limits.

8 · Graded capstone

Program a complete cell — palletise parts into a pattern with no collision, under a cycle-time budget, and within force limits — and earn the pass.

Cobot safety

Protective stops and force limits

Universal Robots are collaborative robots — designed, with a proper risk assessment, to work near people. They achieve that mainly through force and power limiting: the controller monitors joint forces, and if it detects an unexpected contact or exceeds a configured force threshold, it triggers a protective stop — the arm halts immediately. You also define safety planes, speed limits, and reduced-speed zones in the safety configuration.

For a programmer this means two habits: keep the set_payload value accurate so force monitoring works correctly, and design moves that respect the cell’s safety limits. A simulator is the right place to learn this — you can deliberately trigger a protective stop and learn to avoid it without ever damaging a real arm or risking a person. A collaborative rating is never a substitute for a real safety assessment on a deployed cell.

Diagram of UR cobot safety: force limiting, a configured safety plane, and a protective stop triggered when the arm meets an unexpected over-force contact near a personA collaborative robot surrounded by concentric speed-and-separation monitoring zones, with a protective-stop indicator when a person enters the inner zone.warningreduced speedstopPROTECTIVESTOP
A UR cobot force-limits its motion and protective-stops on unexpected contact.

Why a simulator

Practise the real language, with no robot and no risk

vs a real UR arm

A UR arm costs tens of thousands and one bad move can damage tooling. The simulator lets you fail safely and repeat a task endlessly — the only way to actually build skill — at zero cost and zero risk.

vs URSim

UR’s official URSim is the real controller software but ships as a Linux virtual machine that beginners find heavy to install. Ours opens in a browser tab on any computer, with lessons that teach from zero.

Real URScript

You write the same movej, movel, set_digital_out, set_tcp and set_payload you would type into a real UR — so the language and habits transfer straight onto PolyScope and a physical controller.

Keep learning

More on Universal Robots programming

Questions

Universal Robots programming FAQ

There are two ways, and most programmers use both. The first is PolyScope, the graphical interface on the UR teach pendant: you build a program tree by adding nodes (Waypoints, MoveJ/MoveL blocks, I/O actions, If/Loop logic) and you teach poses by physically jogging the arm to a position and saving it as a waypoint. The second is URScript, UR’s text-based programming language: you write commands like movej and movel directly, either inside a Script node in PolyScope or as a complete .script program sent to the controller. PolyScope is faster to start with; URScript gives you full control for complex logic, math, and reuse.

Start programming a UR arm today.

Write real URScript on a simulated UR5e in your browser. No robot, no install, no vendor license — the first lessons are free.