Industrial Robot Programming
Unit II: Robot Programming Fundamentals
Robot Programming Methods: Lead Through Programming, Teach Pendant, Offline-
Programming, Text-Based Programming
- Programming is the process of creating a set of instructions that a computer or machine can
follow to perform a specific task.
- A program tells the machine what to do, in what order, and under what conditions.
- Robot programming is the process of defining the sequence of movements, operations, and
logic that a robot must follow to perform tasks such as moving, picking objects, welding, painting,
assembling parts, etc.
It includes:
1. Defining motion paths (where the robot should move).
2. Setting operation commands (what actions it should take at each point).
3. Specifying timing, speed, and conditions.
4. Communicating with other devices like sensors and controllers.
Why Programming is important in Robotics?
• Defines the exact sequence of operations a robot must follow.
• Enables task customization to suit different industrial needs.
• Enables automation without manual intervention.
• Gives robots the flexibility to work across different industries and applications.
Differences between Robot-Specific Languages and General-Purpose Languages:
Aspect Robot-Specific Languages General-Purpose Languages
Purpose Direct robot programming (manual
Higher-level tasks (AI, vision, etc.)
control)
Hardware-Specific Yes (designed for specific robot
No (require middleware)
models)
Examples VAL, MELFA, RAPID, KRL, etc.. Python, C, C++, etc..
The main robot programming methods are:
1. Online Programming
- Robot controller is physically connected to a programming device and can receive/execute
commands in real time, means this programming is done while the robot is connected and can
execute commands immediately.
- Lead-Through Programming - Physically moving the robot arm through desired positions
(e.g., by hand-guiding) while the controller records the motion.
- Teach-Pendant Jogging (Point Teaching) - Using the pendant’s jog buttons or joystick to
move joints or TCP (Tool Center Point) to a position and then store that point.
- Teach-Pendant Text Editing - Typing program instructions directly into the pendant’s editor
(writing code on the pendant).
- Text-Based Programming via Connected PC – Writing and sending program code from a PC
software (e.g., MELFA RT Toolbox in Online Mode) to the controller in real time.
(Real time means the PC sends programs directly to the robot controller instantly, and the robot
executes them immediately)
- Simulation Programming (online mode) - Programming the robot while it is physically
moving, and the simulation shows the exact same motion live — both are synchronized.
2. Offline Programming
- Robot controller is not connected to the programming device at that moment means while program
is created/tested.
- PC Offline Text Coding
• Writing the robot program on a PC (in vendor editor) while not connected to the real robot, then
transferring/uploading later.
- Simulation Programming (offline mode)
• Creating paths and logic in a virtual environment, validating offline, then exporting/postprocessin
the program to load on the real robot.
Note:- The offline/online programming categories are about how and where the robot program
is developed.
• Online mode: PC is actively connected to the robot controller.
• Offline mode: PC is not connected to the robot controller.
Lead Through Programming
A method where the human operator physically moves the robot arm through the desired motions
while the system records the path and joint positions.
The robot memorizes the motion and replicates it during execution.
Steps in Lead Through Programming:
1. Preparation:
• Ensure the robot is in a safe and compliant mode to allow physical movement.
• Clear the workspace of obstacles.
2. Guiding the Robot:
• Move the robot's manipulator arm to the desired position or along the desired path.
• Specify key points, such as start, intermediate, and end points.
3. Recording Positions:
• The robot sensors and controllers records the position data, including cartesian coordinates,
joint angles, or tool orientation.
4. Defining Speeds:
• Adjust speeds and accelerations for transitions between points as needed.
5. Execution:
• Playback the recorded program to ensure the robot replicates the taught motion correctly.
Advantages of Lead Through Programming
• Ease of Use: No coding or programming knowledge is required.
• Intuitive: The operator can directly demonstrate complex movements.
• Realistic Path Creation: Especially useful for tasks like welding, painting, or assembly.
Disadvantages
• Requires Operator Presence: The operator must physically manipulate the robot.
• Not Suitable for High Precision Tasks: May lack accuracy for micro-level operations.
• Time-Consuming: Manual guiding can take time for complex paths.
Applications of Lead Through Programming:
1. Pick-and-Place Operations:
- Teaching the robot to move objects between predefined positions.
2. Welding:
- Guiding the robot along a welding path for precision tasks.
3. Painting and Spraying:
- Teaching a continuous motion path for uniform coating. etc…
Teach-Pendant Jogging (Point Teaching) -
Method of manually moving the robot using jog controls on the teach pendant to reach desired
positions, which are then stored as program points.
Steps in Teach-Pendant Jogging
1) Robot switched to jog/teach mode.
2) Operator uses jog buttons/joystick to move each joint or along Cartesian axes.
3) Desired position reached → stored as a point in the program.
4) Sequence of points forms the complete robot path.
Features:
• Jog controls – joint jog, linear jog, tool orientation.
• Point teaching – store positional data in memory.
• Display screen – shows live coordinates & movement status.
Advantages:
• Simple and intuitive to learn.
• Precise manual positioning.
• Allows visual checking of robot movement before saving.
Disadvantages:
• Time-consuming for complex paths.
• Requires operator to be present at robot.
• Not suitable for large-scale program edits.
Applications:
• Teaching pick-up and drop-off points.
• Calibration of robot position.
• Small adjustments in existing programs.
Flex Pendant
A Flex Pendant is a modern handheld device used to program, control, and operate industrial
robots. It provides an interface between the user and the robot, allowing operators to program
tasks, adjust settings, and control movements directly.
Features of a Flex Pendant:
1. Touchscreen Interface:
• Most Flex Pendants come with a user-friendly, high-resolution touchscreen.
• This allows for easy navigation through menus, programs, and robot settings.
2. Jogging Controls:
• Operators can move the robot manually in small steps using jogging buttons or joysticks.
• Jogging modes include Cartesian (XYZ axes), Joint (individual joints), and Tool coordinates.
3. Graphical Programming:
• Simplifies programming with visual tools like drag-and-drop functions or guided wizards.
• Especially useful for users without extensive coding experience.
4. Emergency Stop Button:
• Includes a prominent emergency stop button to immediately halt robot operations for safety.
5. Connectivity:
• Can connect to the robot's controller via wired or wireless connections, depending on the system.
6. Advanced Features:
• Flex Pendants allow operators to simulate tasks, debug programs, or monitor real-time data from
sensors.
Applications of Flex Pendants:
1. Robot Programming: Used to create, edit, and fine-tune robot programs.
2. Task Setup: Define waypoints, trajectories, and tool paths for tasks like welding, painting, or
assembly.
3. Maintenance and Troubleshooting: Diagnose issues, monitor robot performance, and adjust
parameters.
4. Operator Training: Provides an intuitive interface for teaching new operators how to control
robots.
Advantages of Flex Pendants:
1. Ease of Use:
• Intuitive interface reduces the learning curve for new users.
• Graphical tools simplify complex tasks.
2. Portability:
• Compact and lightweight design makes it easy to carry around the worksite.
3. Enhanced Safety:
• Emergency stop and safety interlocks ensure secure operation.
4. Flexibility:
• Supports both manual teaching (e.g., jogging) and advanced programming.
Comparison with Teach Pendants:
Feature Teach Pendant Flex Pendant
Interface Button-based, minimal display Touchscreen with advanced UI
Ease of Use Less user-friendly, requires User-friendly, modern interface
more training
Customization Limited Highly customizable
Advanced Features Basic jogging and programming Simulation, debugging, monitoring
ABB's Flex Pendant
Fanuc's pendant
Teach-Pendant Text Editing
Method of creating or modifying robot programs directly on the teach pendant or flex pendant
using its built-in text editor, without manually moving the robot.
Steps in Teach-Pendant Text Editing
• Robot program opened on teach pendant in text edit mode.
• Instructions typed or edited using pendant keys.
• Syntax follows the robot’s programming language.
• Program saved and later executed in automatic mode.
Features:
• On-screen text editor – insert, delete, or modify lines of code.
• Navigation keys – move through program structure quickly.
• Error checking – shows syntax or logic errors before execution.
Advantages:
• No need to physically move the robot during programming.
• Fast edits for logic or parameter changes.
• Suitable for complex program structures.
Disadvantages:
• Requires understanding of robot programming syntax.
• No immediate visual confirmation of motion until execution.
• More prone to typing errors compared to point teaching.
Applications:
• Editing movement commands, loops, or conditional logic.
• Adding or modifying I/O control statements.
• Debugging existing programs without retaking points.
Text-Based Programming via Connected PC
Creating and editing robot programs on a computer using dedicated programming software, then
transferring them to the robot controller for execution.
Steps in Text-Based Programming
• PC connected to robot controller via Ethernet, USB, or serial cable.
• Program written in robot’s programming language using a PC text editor or dedicated IDE
(e.g., RT ToolBox for MELFA).
• Program sent to controller (online).
• Executed by the robot.
Features:
• Full-size keyboard – faster typing and code editing.
• Advanced software tools – syntax highlighting, search, replace, and debugging.
• Easy file management – save, copy, and version control.
Advantages:
• High programming speed for complex tasks.
• Easier to edit and debug large programs.
• Can integrate with other software tools (CAD, simulation).
Disadvantages:
• Requires PC connection setup and correct software installation.
• Less user-friendly for beginners compared to jog teaching.
• Robot must be switched online for physical testing.
Applications:
• Developing large-scale industrial robot programs.
• Editing existing programs received from other systems.
• Integrating robot control with automation networks.
Simulation Programming (online mode)
In online simulation programming, the robot and the PC simulation are connected in real time so
that actions performed on one are instantly mirrored on the other. This ensures the simulated
model and the physical robot remain perfectly synchronized during programming and operation.
Features
• Real-time synchronization between physical robot and PC simulation.
• Direct execution of simulation programs on the real robot without extra transfer steps.
• Instant visual feedback on the PC while moving the robot.
• Capability to adjust motion paths while observing both virtual and real outputs.
Advantages
• Eliminates guesswork by showing the real robot’s exact behavior in simulation.
• Saves time by testing and implementing changes instantly.
• Reduces errors because real-world and virtual positions match.
• Ideal for fine-tuning trajectories and motion parameters live.
Disadvantages
• Requires the robot to be available and operational during programming.
• Not safe for high-speed or high-payload robots if programming errors occur.
• Can cause downtime if robot is in production while being programmed.
• Higher network and hardware requirements for smooth synchronization.
PC Offline Text Coding
Writing robot programs in text format using the robot manufacturer’s programming language on
a PC, without connecting to the physical robot.
Steps in PC Offline Text Coding
- Open the robot’s offline text programming tool or any text editor.
- Write program code directly, specifying motions, I/O commands, logic, and parameters.
- Save and transfer the file to the robot controller for execution.
Features:
• Text-based code creation and editing.
• No 3D modeling or graphical path planning involved.
• Can be done with just a code editor and robot language knowledge.
Advantages:
• Faster for programmers familiar with the robot’s language.
• Lightweight — does not require high-end simulation software.
• Works well for logic-heavy programs (I/O control, calculations).
Disadvantages:
• No visual verification of robot motion — errors may be found only during physical testing.
• Requires good understanding of coordinate systems and kinematics.
Applications:
• Quick development of small automation tasks.
• Modifying or creating logic-heavy programs remotely.
• Updating production code without stopping the robot for teaching.
Simulation Programming (Offline mode)
A method where robot programs are created and tested in a 3D simulation environment on a PC
before being transferred to the actual robot.
Steps in simulation offline programming
- A virtual model of the robot and workspace is loaded in the simulation software (e.g., MELFA
RT Toolbox3, RoboDK, RobotStudio).
- The user creates motion paths, positions, and commands using graphical tools and menus.
- The program is tested virtually for reachability, collisions, and cycle time.
- Once verified, the program is downloaded to the robot controller for real execution.
Features:
• 3D workspace visualization.
• Tool and workpiece modeling.
• Collision detection and cycle time analysis.
• Direct export of verified code to robot controller.
Advantages:
• No downtime for the real robot during programming.
• Detects errors, collisions, and unreachable points before deployment.
• Speeds up complex path programming.
• Safe for high-speed or hazardous applications.
Disadvantages:
• Requires accurate digital models and calibration.
• Software and licensing costs can be high.
• Some fine-tuning may still be needed on the real robot.
Applications:
• Automotive welding path design.
• Pick-and-place optimization in packaging.
• Painting and coating path planning.
• Palletizing and depalletizing simulations.
Robot Programming Concepts: Motion Control Commands (MOVE, WAIT, SIGNAL,
DELAY), subroutines, branching, error handling
- Programming is the process of writing a set of instructions that a computer or robot can
understand and execute.
- In robotics, programming means defining the sequence of actions, motions, and decisions that
the robot must follow to perform a task.
How is it done?
- Robots are programmed using commands and logic structures similar to computer
programming (like C, Python, etc.).
- These commands tell the robot what to do, when to do it, and how to respond to different
situations.
- Programs define positions, motions, and sequences that allow the robot to perform tasks safely
and repeatedly.
Basic Building Blocks of Robot Programming:
- Motion Control Commands – for moving the robot arm (e.g., MOVE, WAIT, SIGNAL,
DELAY).
- Subroutines – small reusable sections of code to avoid repetition.
- Error Handling – to detect and recover from faults safely.
- Branching (Decision Making) – to allow the robot to react to conditions (e.g., IF-ELSE, loops).
• These building blocks provide the structure needed for robots to execute tasks accurately and
consistently.
• With these, robots can move, make decisions, and recover from errors effectively.
Motion Control Commands
Robot arms ((manipulator joints and end-effector) are moved from one position to another
using motion commands.
1. Mitsubishi MELFA Assista
Command: Mov, Mvs, Mvc
Example:
Mitsubishi Cobot
Mov P1 # Move to position P1 using the fastest joint path (not necessarily a straight line).
Mvs P1, 200 # Move in a straight line to position P1 at 200 mm/sec.
Mvc P1, P2 # Move along a circular path or arc.
2. ABB (RAPID)
Command: MoveJ – Joint movement
MoveL – Linear movement
MoveC – Circular movement
Example:
MoveJ [[100,200,300],[0,0,1,0]], v100, fine, tool1; ABB Industrial Robot
3. KUKA (KRL – KUKA Robot Language)
Command: PTP (Joint), LIN (Linear), CIRC (Circular).
Example:
PTP P1 # Joint move to P1
LIN P2 # Linear move to P2
CIRC P3,P4 # Circular move via P3 to P4
KUKA Industrial Robot
4. FANUC (TP/KAREL)
FANUC TP FANUC KAREL
Motion is defined by selecting
Command: MOVE TO
motion type (J, L, C) in the
pendant. Example:
Example: MOVE TO pos1
J P[1]; #Joint move to P1
L P[2]; #Linear move to P2
FANUC Industrial Robot
Subroutines
- Subroutines are small blocks of reusable code that perform a specific task.
- They help avoid repetition, improve readability, and make programs modular.
- Once defined, they can be called multiple times within the main program
1. Mitsubishi MELFA Assista
• Subroutines are defined using DEF … END.
• They are executed using the CALL statement.
Example:
DEF pickPart
MOV P1
DLY 1
MOV P2
END
CALL pickPart
2. ABB (RAPID)
• Subroutines are defined as procedures using PROC…ENDPROC.
• A procedure is executed by writing its name.
Example:
PROC pickPart()
MoveL p1, v100, fine, tool1;
MoveL p2, v100, fine, tool1;
ENDPROC
pickPart;
3. KUKA (KRL – KUKA Robot Language)
• Subroutines are defined using DEF…END.
• They are executed by calling their name.
Example:
DEF pickPart()
PTP P1;
LIN P2;
END
pickPart()
4. FANUC (TP/KAREL)
• Subroutines are defined using ROUTINE … END.
• They are executed by writing the subroutine name.
Example:
ROUTINE pickPart
MOVE TO pos1;
MOVE TO pos2;
END pickPart
pickPart
Comparison Table for Subroutines:
Robot / Language Define subroutine End keyword How to call it
Mitsubishi MELFA DEF name END CALL name
ABB (RAPID) PROC name() ENDPROC name;
KUKA (KRL) DEF name() END name()
FANUC ROUTINE name END name name
Error Handling
Why Error Handling is Needed?
• Robots may face issues like missing signals, unreachable positions, or sensor failures.
• Without error handling, every issue would stop production and require manual reset.
• Error handling ensures safe, reliable, and continuous operation.
Aspect Emergency Stop Error Handling (Software)
Immediate shutdown in dangerous Manage predictable or minor errors
Purpose
or emergency situations programmatically
Detects, reports, and recovers
Action Cuts power/motion instantly
automatically
Minimal intervention (sometimes
Operator Role Manual reset needed
automatic recovery)
Impact on Reduced downtime, smooth
Full stop downtime (complete halt)
Production continuation
Best Use Safety of humans and equipment Process reliability and fault tolerance
1. Mitsubishi MELFA Assista
- Errors generate error codes displayed on the teach pendant.
- Programs can use ONERR statement to handle errors by jumping to a specific recovery routine.
Example: ONERR GOTO <label> #Activate error trap
MOV P1
MOV P2
END
<label>:
STOP
• ONERR → reserved keyword for error trapping.
• GOTO → reserved keyword for jumping.
• < label > → user-defined label where error recovery or safe stop logic is written.
Note:- Error handling commands can be included even in simple programs such as pick-and-place
operations. However, in practice they are most commonly applied in industrial or production-
level programs, where reliability and safety are critical.
Note:
1) ONERR GOTO <label> arms the error handler from that line onward.
2) The program runs line by line as usual unless an error occurs.
3) If no error occurs in the code that follows, the label: section is never executed; the program
ends normally at END.
4) If an error occurs after ONERR GOTO, the program immediately jumps to the label: section,
skipping any lines below the error point.
5) The label: section serves as the error-handling zone, where actions can include:
• Stopping the robot safely (STOP).
• Moving the robot to a safe position.
• Logging or signaling the error for diagnostics.
6) If an error occurs before the ONERR GOTO line, there is no active handler, and the robot stops
with its default alarm.
7) The error trap remains active until it is reset with ONERR RESET or until the program ends.
8) Use ONERR RESET before the END statement to turn off the error trap and prevent unintended
jumps.
2. ABB (RAPID)
ERROR catches runtime errors and executes recovery code.
Example:
PROC Main()
ERROR ErrWrite is a reserved keyword in ABB RAPID.
ErrWrite "Motion Error Detected"; The message must be inside double quotes.
Stop;
ENDERROR
MoveL p1, v100, fine, tool1;
MoveL p2, v100, fine, tool1;
ENDPROC
Note:
- The ERROR ... ENDERROR block activates an error handler for the entire routine; if any error
occurs in MoveL or later commands, the program jumps automatically into this block.
- If no error occurs, the program runs line by line and skips the error block completely, finishing
the routine normally.
3. KUKA (KRL – KUKA Robot Language)
Program-based error handling uses INTERRUPT or conditional checks.
Example:
DEF Main()
INTERRUPT DECL 1 WHEN $IN[1]==TRUE DO
HALT
INTERRUPT ON 1
PTP P1
PTP P2
INTERRUPT OFF 1
END
Note: In KRL, pre-defined system variables provided by KUKA start with this sign $
4. FANUC (TP/KAREL)
• Provides structured error handling with ON ERROR statements.
• Specific error codes can be caught and processed.
Example:
ON ERROR GOTO errHandle
MOVE TO pos1
errHandle is the user-defined label
errHandle: The message must be written in single quote.
WRITE('Error occurred')
Comparison Table for Error Handling:
Robot Language Start Command End Command
Mitsubishi MELFA ONERR GOTO <label> <label>:
ABB RAPID ERROR ENDERROR
INTERRUPT DECL ... /
KUKA KRL INTERRUPT OFF
INTERRUPT ON
FANUC KAREL ON ERROR GOTO <label> <label>:
Branching (Decision Making)
Branching (also called decision-making) allows a robot program to change its sequence of
execution based on conditions or repeated cycles.
It includes:
1. Conditional Branching (Decision making) → IF, ELSE, SELECT, GOTO
2. Looping Structures (Repetition)→ FOR, WHILE
1. Mitsubishi MELFA Assista
IF SENSOR=1 THEN FOR I=1 TO 3
MOV P1 MOV P1 #Move to pick position
ELSE HCLOSE 3
MOV P2 MOV P2 #Move to place position
END IF HOPEN 3
NEXT
2. ABB (RAPID)
IF di1=1 THEN FOR i FROM 1 TO 3 DO
MoveL p1, v100, z10, tool1; MoveL p1, v100, z10, tool0;
ELSE ENDFOR
MoveL p2, v100, z10, tool1;
(DO → Marks the start of the actions that will repeat,
ENDIF not for digital output)
3. KUKA (KRL – KUKA Robot Language)
IF $IN[1]==TRUE THEN FOR I = 1 TO 3
PTP P1 PTP P1
ELSE ENDFOR
PTP P2
ENDIF
4. FANUC (KAREL)
IF R[1] = 1 THEN FOR i = 1 TO 3 DO
MOVE TO P1 MOVE TO P1
ELSE ENDFOR
MOVE TO P2
ENDIF
Comparison Table for Conditional Branching:
Language Start End
MELFA IF ... THEN END IF
RAPID IF ... THEN ENDIF
KUKA IF ... THEN ENDIF
FANUC KAREL IF ... THEN ENDIF
Comparison Table for Looping:
Language Start End
MELFA FOR ... TO ... NEXT
RAPID FOR ... TO….DO ENDFOR
KUKA FOR ... TO ... ENDFOR
FANUC KAREL FOR ... TO….DO ENDFOR
Robot Programming Languages: Generations of robot languages, introduction to specific
languages and modern trends
Generations of Robot Programming Languages
The evolution of robot programming is better understood as moving from low-level control to
higher levels of abstraction - making programming simpler, smarter, and more task-oriented -
rather than as fixed, rigid generations.
1) Teach/Playback (no real ‘language’)
• How it works: Operator moves the robot (lead-through or pendant jogging); controller records
waypoints and timing.
• Characteristics: No source code, minimal logic; paths are recorded, then replayed.
• Pros: Fast to teach simple motions; low skill barrier.
• Cons: Hard to maintain or reuse; little to no branching/error handling; accuracy depends on
teaching.
• Where used: Painting, welding touch-ups, simple pick-and-place.
2) Motion-/Manipulator-Level Text Languages (vendor specific)
• Idea: Text commands directly control robot motion and I/O.
• Examples: Early VAL, RAIL, later KAREL (FANUC), RAPID (ABB), KRL (KUKA),
INFORM (Yaskawa), AS (Kawasaki).
• Capabilities: Joint/linear/circular moves, speeds/zones, I/O, subroutines, loops, conditionals,
basic error handling.
• Pros: Deterministic, production-ready, supported by teach pendants and OEM tools.
• Cons: Tied to the vendor; portability is limited.
3) Task-/Object-Level Languages
• Idea: Program “what” to do (grasp, assemble, inspect) instead of “how each joint moves.”
• Examples: AML (IBM), RAIL (IBM), higher-level libraries wrapping motion commands.
• Capabilities: Task primitives (pick/place), world models, sensor-driven behaviors.
• Pros: Reuse at the task level; easier to express intent.
• Cons: Needs calibration and lower-level support; adoption varies by vendor/factory.
4) Offline Programming (OLP) & Digital Twins
• Idea: Build and verify programs in a virtual cell; then download to the real controller.
• Tools: RobotStudio (ABB), RoboDK, DELMIA, MELFA RT Toolbox, etc.
• Pros: No production downtime; collision/cycle-time checks; program variants from CAD.
• Cons: Needs accurate models.
5) Middleware/APIs & AI-assisted Programming
• Idea: Use ROS/ROS-Industrial, C++/Python APIs, skills/behavior trees, and vision/ML.
• Pros: Integrates with sensors, planning, cloud/IIoT; supports cobots and adaptive tasks.
• Cons: Systems engineering complexity; certification/safety and real-time concerns.
Introduction to Specific Languages
1) VAL - Variable Assembly Language (Unimation)
• Purpose: First widely used robot programming language developed for PUMA (Programmable
Universal Machine for Assembly) robots.
• Developer: Unimation, the first industrial robot company, founded by George Devol and Joseph
Engelberger.
• Era: Introduced in the late 1970s.
Key Features
• Text-based language - programs can be typed or edited via the teach pendant.
• Structured programming: Supports variables, conditional logic, and subroutines.
• Easy to use: Simple English-like commands for motions and tasks.
• Real-time execution: Can test and adjust commands quickly.
Basic Motion Commands in VAL
Command Function Example
MOVE Move to a defined point (joint or linear, depending on context). MOVE P1
MOVES Move slowly to a point for precision. MOVES P2
APPROACH Move near a point without colliding. APPROACH P3
DEPART Move away from a point safely. DEPART P3
SPEED Set speed of motion. SPEED 50
DELAY Pause the program for a set time. DELAY 2
Example VAL Program
SPEED 50
MOVE P1
DELAY 2
MOVE P2
APPROACH P3
DEPART P3
2) RAIL
• Developed by: IBM (International Business Machines) in the 1980s.
• Purpose: To program IBM industrial robots and automated assembly lines.
Key Features
• Text-based structured language – human-readable and easy to learn.
• Supports decision-making – loops, conditions, and subroutines.
• Integration-friendly – connects with vision, sensors, and automation systems.
• Reusable code blocks – improves efficiency and reduces errors.
Basic Motion Commands in RAIL
Command Function Example
Moves the robot to a specified point (joint or linear, based on
MOVE MOVE P1
configuration).
Moves the robot close to a point, maintaining a safe distance to avoid
APPROACH APPROACH P2
collisions.
DEPART Moves the robot away from the point after completing a task. DEPART P2
SPEED Sets the motion speed as a percentage of maximum speed. SPEED 50
WAIT Pauses execution for a specified time or until a signal is received. WAIT 2
SIGNAL ON 3
SIGNAL Sends or receives signals to/from peripheral devices.
(activate output 3)
TEACH Records a new position point by moving the robot manually. TEACH P3
Example RAIL Program
SPEED 40
MOVE P1
WAIT 1
IF IN1 = ON THEN
MOVE P2
ELSE
MOVE P3
END IF
APPROACH P4
DEPART P4
3) AML – A Manufacturing Language
• Developed by: IBM (International Business Machines)
• Era: Early 1980s
• Purpose: To create a high-level, task-oriented programming language for IBM industrial robots
IBM first created RAIL for motion and integration in their robot systems. Later, they developed
AML to make robot programming more task-focused and user-friendly, building on the
foundation set by RAIL.
Key Difference Summary
Feature RAIL AML
Level Motion-level Task-level
Readability Technical, less intuitive English-like, more intuitive
Integration Basic Advanced (vision, sensors)
Programming Style Movement-centric Task-centric
Ease of Learning Moderate Easier
Use Cases Basic assembly, handling Complex assembly, integrated automation
Motion and Task Commands
Action RAIL Command AML Command
Move to position MOVE P1 MOVE P1
Approach point APPROACH P2 APPROACH P2
Depart point DEPART P2 DEPART P2
Set speed SPEED 50 SPEED 50
Wait / Delay WAIT 2 WAIT 2
GRASP PART / RELEASE PART
Operate gripper SIGNAL ON 3 (activate output)
(simpler and direct)
PROC...ENDPROC for clean,
Define subroutine Loops and labels, but limited readability.
reusable modular code.
Pick and Place
Example RAIL Program Example AML
SPEED 40 SPEED 40
MOVE P1 APPROACH P1
SIGNAL ON 3 :Activate gripper GRASP PART
MOVE P2 MOVE P2
SIGNAL OFF 3 :Release gripper RELEASE PART
DEPART P2
Modern Trends
Why Modern Trends Matter?
Industries now demand robots that are:
• Flexible – can handle multiple tasks.
• Connected – work with sensors, vision systems, and IoT devices.
• Intelligent – use AI and data for decision-making.
This has led to the use of open-source platforms and high-level programming languages like
Python and ROS.
Python in Robot Programming
• High-level, easy-to-learn language used widely in automation and robotics.
• Supported by almost every major robot manufacturer today via APIs or SDKs.
Applications
• Writing scripts for robot control and task automation.
• Data handling from sensors, cameras, or IoT devices.
• Integration with AI and machine learning libraries like TensorFlow and OpenCV.
Advantages
• Beginner-friendly syntax.
• Huge library support (vision, AI, data analytics).
• Works across multiple platforms and robot brands.
Example
# Simple Python script using a robot SDK
robot.move_to(position1)
[Link]()
robot.move_to(position2)
[Link]()
ROS in Robot Programming
• Not an actual operating system but a flexible middleware framework for developing robotic
applications.
• Open-source and widely used in both research and industry.
Key Features
• Modular architecture: Breaks robot software into packages and nodes.
• Communication tools: Nodes can share data using topics and services.
• Simulation: Integrated with tools like Gazebo for virtual testing.
• Language support: Works with Python and C++.
Applications
• Control of mobile robots, manipulators, and drones.
• Sensor integration and data fusion.
• Path planning and motion control.
• AI-based tasks like object detection and navigation.
Advantages of Modern Trends
• Vendor-independent – works across different brands and platforms.
• Scalable – from small research projects to full industrial systems.
• Community support – large open-source communities for troubleshooting and updates.
• Future-ready – integrates easily with AI, IoT, and Industry 4.0 systems.