Robot programming: teach pendant and offline programming
Lead-through, teach-pendant and offline programming: frames (tool, user), motion instructions, pendant safety features and when to use each method.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Programming is where most of the cost and downtime of a robot cell lies. Teaching points by hand on the shop floor is quick for simple jobs, while offline programming in a simulator lets engineers build and verify complex programs without stopping production. Knowing frames, motion types and the strengths of each method is essential for anyone commissioning or maintaining robots.
Key ideas
Programming methods.
- Lead-through / walk-through (manual teaching) — the operator physically guides the arm (common for spray painting and for collaborative robots in hand-guiding mode); the controller records the path.
- Teach pendant programming (online) — the operator jogs the robot with the pendant's keys or joystick to each required pose, stores it as a point, and builds the program with motion and logic instructions. Positions automatically match the real cell, but the robot is out of production while being taught.
- Offline programming (OLP) — the cell is modelled in simulation software (robot, tooling, fixtures, CAD of the part). Paths are generated, often directly from CAD edges and surfaces, checked for reach, collisions, singularities and cycle time, then post-processed into the robot's language and downloaded. Requires calibration so the virtual cell matches the real one; final points are usually "touched up" with the pendant.
Teach pendant essentials. Display and keys, jog modes (joint, world/base, tool, user frame), speed override, an enabling (dead-man's) switch — three-position: motion only in the middle position, so both letting go and squeezing in panic stop the robot — and an emergency stop. In manual (teach) mode, tool speed is limited to a reduced value (250 mm/s is the usual limit in robot safety standards).
Coordinate frames used in programs.
- Joint — individual axis angles.
- World/base — fixed frame at the robot base.
- Tool frame (TCP) — defined at the tool tip; calibrated by touching a fixed point from several orientations. All linear moves and reorientations act about the TCP.
- User/work-object frame — attached to a fixture or part. Points taught relative to it can be reused when the fixture moves: re-teach only the frame (typically 3 points), not every point.
Motion instructions (names differ by vendor):
- Joint (PTP, MOVJ, MoveJ) — fastest; tool path not straight.
- Linear (LIN, MOVL, MoveL) — straight TCP path; for welding, gluing, insertion.
- Circular (CIRC, MOVC, MoveC) — arc through a via point.
- Speed, acceleration and blending/zone (fine point vs fly-by) parameters accompany each move.
Program structure. Motion instructions, I/O (gripper open/close, wait for sensor), logic (IF, loops, subroutines), registers/variables, and communication with a PLC. Typical languages: RAPID (ABB), KRL (KUKA), Karel/TP (FANUC), INFORM (Yaskawa), URScript (UR), plus ROS-based programming.
Choosing a method. Teach pendant: few points, frequent small changes, simple pick-and-place. OLP: many points or complex 3-D paths (welding, deburring, painting), multi-robot cells, new lines planned before the hardware arrives, minimum downtime.
Formulas
ᴮp = ᴮT_U · ᵁp — point taught in user frame {U} expressed in base frame {B}
- ᴮT_U — 4 × 4 transform of the user frame in the base frame; p in mm or m.
TCP position: p_TCP = p_flange + R_flange · t_tool
- t_tool — tool offset vector in the flange frame (mm).
Trapezoidal linear move (distance d, max speed v, acceleration a), if d ≥ v²/a:
t_a = v / a, d_a = v² / (2a), t_move = (d − 2·d_a) / v + 2·t_a = d/v + v/a
Worked examples
Example 1 (standard). A point is taught at ᵁp = (100, 50, 0) mm in a user frame whose origin is at (800, 200, 300) mm in the base frame and whose x-axis is rotated 90° about the base z-axis. Find the point in base coordinates.
- ᴮR_U = R_z(90°) = [[0, −1, 0], [1, 0, 0], [0, 0, 1]].
- ᴮR_U · ᵁp = (0·100 − 1·50, 1·100 + 0·50, 0) = (−50, 100, 0) mm.
- Add the origin: (−50 + 800, 100 + 200, 0 + 300) = (750, 300, 300) mm.
Answer: (750, 300, 300) mm. If the fixture is moved, only ᴮT_U is re-taught; all points follow.
Example 2 (GATE level). A linear move of 0.6 m is programmed at 0.5 m/s with acceleration and deceleration of 2 m/s². Estimate the move time. Would the same move be allowed at that speed in manual teach mode?
- Check: v²/a = 0.25/2 = 0.125 m ≤ 0.6 m, so the profile is trapezoidal.
- t_a = 0.5 / 2 = 0.25 s; d_a = 0.5² / (2 × 2) = 0.0625 m.
- Cruise distance = 0.6 − 2 × 0.0625 = 0.475 m; cruise time = 0.475 / 0.5 = 0.95 s.
- t_move = 0.95 + 2 × 0.25 = 1.45 s (check: d/v + v/a = 1.2 + 0.25 = 1.45 s ✓).
- In manual mode the TCP speed is limited to about 0.25 m/s, so the controller would run it slower.
Answer: 1.45 s in automatic; not at 0.5 m/s in teach mode.
Example 3 (tool offset). The flange is at (500, 0, 400) mm pointing straight down (flange z along −z_base) and the TCP is 150 mm along the flange z-axis. p_TCP = (500, 0, 400) + 150·(0, 0, −1) = (500, 0, 250) mm.
Common mistakes
- Teaching with the wrong tool or user frame active — points then shift when frames change.
- Using joint moves where the tool path matters (welding), or linear moves through singular regions.
- Forgetting fine points (zero zone) where the robot must stop exactly, e.g. before closing a gripper.
- Trusting an offline program without calibration and touch-up of key points.
- Holding the enabling switch fully pressed and expecting motion — the middle position enables, fully pressed stops.
- Ignoring reduced speed limits and safety procedures when teaching inside the cell.
For GATE ME
Questions are mainly conceptual: teach pendant vs offline vs lead-through programming, advantages of each, motion instruction types, frames, and safety features of the pendant. Simple numericals can appear on frame transformation of taught points or move times. Practise explaining when each method is appropriate.
Quick check
- Which motion type gives a straight tool path?
- Why are points taught in a user frame?
- What does the three-position enabling switch do?
- Name two advantages of offline programming.
- What must be done before running an offline program on the real cell?
Answers: 1. Linear (LIN/MOVL); 2. So the whole program can be shifted by re-teaching only the frame when the fixture moves; 3. Allows motion only in its middle position — releasing or squeezing it stops the robot; 4. No production downtime, collision and reach checking in simulation (also cycle-time optimisation, CAD-based paths); 5. Calibrate the cell (TCP, user frames) and touch up/verify points at reduced speed.
Interview questions
All Robotics interview questionsTry answering each one aloud before you open it.
1.What is a teach pendant in the context of robot programming?Concept
A teach pendant is a handheld device used to control and program industrial robots. It allows operators to manually guide the robot through a series of movements, which can then be recorded and replayed. Teach pendants typically include a display screen and a set of controls, such as joysticks or buttons, to facilitate the programming process.
2.Explain the concept of offline programming in robotics.Concept
Offline programming involves creating and testing robot programs on a computer without using the actual robot. This method allows for the simulation of robot tasks in a virtual environment, which can help in optimizing the program before deploying it on the physical robot. Offline programming can save time and reduce the risk of errors during the actual operation.
3.How does a teach pendant differ from offline programming?Concept
A teach pendant is used for direct, manual programming of a robot by guiding it through tasks, whereas offline programming is done on a computer without the need for the physical robot. Teach pendants are typically used for simple tasks and adjustments, while offline programming is suited for complex tasks that require simulation and optimization before implementation.
4.Why is offline programming preferred in certain industrial applications?Application
Offline programming is preferred in applications where downtime needs to be minimized, as it allows for program development and testing without halting production. It is also beneficial in complex tasks that require detailed simulation and optimization, reducing the risk of errors and improving efficiency when the program is deployed on the actual robot.
5.What are the risks and drawbacks of programming a robot with a teach pendant?Application
The programmer works inside the cell near a powered robot, so the main risk is injury. This is managed by reduced manual-mode speed (typically 250 mm/s at the TCP), a three-position enabling switch, an emergency stop and following lock-out procedures. The robot is out of production while being taught, complex 3-D paths with many points are slow and error-prone to teach by jogging, and taught points depend on the active tool and user frames, so a wrong frame or TCP gives a shifted program.
6.What happens if a robot program developed offline is not properly calibrated with the actual robot?Application
If a robot program developed offline is not properly calibrated with the actual robot, it can lead to misalignment and errors in the robot's movements. This can result in collisions, damage to the robot or workpieces, and inefficient task execution. Proper calibration and testing are essential to ensure the program functions correctly in the real-world environment.
7.In what scenarios would a teach pendant be more advantageous than offline programming?Application
A teach pendant is more advantageous in scenarios where quick adjustments or simple tasks are needed, as it allows for immediate, hands-on programming. It is also useful in environments where the robot's tasks are frequently changing and require on-the-fly modifications that can be easily handled with manual input.
8.Explain how simulation in offline programming can improve safety in robotic operations.Application
Simulation in offline programming allows for the testing and validation of robot programs in a virtual environment, which helps identify potential errors or collisions before deploying the program on the actual robot. This reduces the risk of accidents and damage during real-world operations, enhancing overall safety.
9.Why do robot programmers teach points in a user (work-object) frame and calibrate the tool centre point?Concept
Points stored relative to a user frame attached to the fixture move with it: if the fixture is relocated or a second identical fixture is added, you re-teach only the frame, usually with three points, and the whole program follows. Calibrating the TCP, typically by touching a fixed point from four or more orientations, makes linear moves, speeds and reorientations act about the actual tool tip. It also means a replaced or bent tool needs only a TCP re-calibration, not a re-taught program.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?