Unit-4 RP
Unit-4 RP
1. CALL
Purpose: Executes a separate program or subroutine from within the main
program.
Example:
tp
CopyEdit
CALL PALLETIZE
This would call a program named PALLETIZE and run it from the current
point in the main program.
2. IF
Purpose: Conditional statement that executes a line if the condition is true.
Example:
tp
CopyEdit
IF R[1]=1,JMP LBL[10]
4. LBL
Purpose: Label used as a marker in the program to jump to using JMP.
Example:
tp
CopyEdit
LBL[20]
! This is a comment or code section at label 20
5. L
Purpose: Linear movement. The robot moves in a straight line from one
point to another.
Example:
tp
CopyEdit
L P[1] 100mm/sec FINE
Move linearly to position P[1] at 100 mm/sec speed with FINE termination
(stop exactly at that point).
6. J
Purpose: Joint movement. The robot moves using joint interpolation (faster
but less predictable path).
Example:
tp
CopyEdit
J P[2] 20% FINE
7. UTOOL
Purpose: Sets the active tool frame (the robot’s understanding of the tool’s
position and orientation).
Example:
tp
CopyEdit
UTOOL_NUM=2
8. UFRAME
Purpose: Sets the active user frame (defines the coordinate system used for
positions).
Example:
tp
CopyEdit
UFRAME_NUM=1
Summary Table
Command Description Example
CALL Call another program CALL PICK_PART
IF Conditional logic IF R[1]=1,JMP LBL[10]
JMP Jump to a label JMP LBL[5]
LBL Label for jumping LBL[5]
L Linear move L P[3] 200mm/sec FINE
J Joint move J P[4] 50% CNT100
UTOOL Set tool frame UTOOL_NUM=1
UFRAME Set user frame UFRAME_NUM=2
WAIT Wait for time or WAIT 1.50(sec) or WAIT
condition DI[1]=ON
Introduction to FANUC Robot Programming
FANUC is one of the leading manufacturers of industrial robots worldwide.
FANUC robots are widely used in industries like automotive, electronics,
packaging, welding, and material handling due to their reliability, flexibility,
and easy integration into manufacturing systems.
What Is FANUC Robot Programming?
FANUC robot programming involves writing instructions that tell the robot
how to move, what tasks to perform, and how to interact with other
equipment. This is done primarily through:
1. Teach Pendant (TP) Programming – Using a handheld controller
with a built-in display.
2. KAREL Programming – A higher-level language similar to Pascal,
used for more complex logic and data handling.
3. Offline Programming – Programming robots using software on a PC
(like RoboGuide) before deploying to the actual robot.
Basic Components of a FANUC TP Program
● Motion Commands: Move the robot to specific positions.
○ J (Joint move)
○ L (Linear move)
● Control Commands: Logic and decision-making.
○ IF, JMP, LBL, CALL
● I/O Commands: Interacting with external devices (sensors,
actuators).
● Tool and Frame Settings: Setting coordinate systems.
○ UTOOL, UFRAME
● Delays/Waiting:
○ WAIT
Explanation:
● Sets tool and user frames.
● Moves to positions P[1] and P[2].
● Waits for a digital input to be ON.
● Calls a subprogram PLACE_PART.
● Jumps to label 10.
🔸 R-30iA Controller
● Next-gen version of R-J3iB.
● Improved processing power and I/O capacity.
● Integrated vision support.
● USB ports added for easy backup.
● Fanuc iPendant available (color screen).
🔸 R-30iB Controller
● Smaller, more compact design.
● More efficient and faster than R-30iA.
● Comes in 3 variations:
○ R-30iB Standard (full-size cabinet)
○ R-30iB Mate (smaller footprint)
○ R-30iB Mini (ultra-compact)
🔹 Standard Cabinet
● Full-size enclosure with complete controller setup.
● Used for large robots and complex systems with multiple I/Os.
● Easy to service and install.
🔹 Mate Cabinet
● Compact version of the standard cabinet.
● Often used with smaller robots (like LR Mate series).
● Saves space while maintaining functionality.
🔹 Mini Cabinet
● Extremely compact.
● Supports lightweight robots in tight spaces.
● Often seen in education or desktop automation setups.
Summary Table
Controller Notes Cabinet Type
R-J3iB Legacy, large, basic UI Standard
R-30iA Ethernet, vision-ready Standard/Mate
R-30iB Compact, improved performance Standard/Mate/
Mini
R-30iB Fast boot, modern UI, touchscreen All sizes
Plus iPendant
R-30iB Small footprint for compact robots Mate
Mate
R-30iB Ultra-compact Mini/Open Air
Mini
A-Cabinet
● Full-size industrial cabinet
● Designed for larger robots or complex systems that require a lot of
I/O, safety hardware, and additional options (like 7th-axis control).
● Comes with more internal space for:
○ Servo amplifiers
○ I/O modules
○ Safety relays
○ External power supplies
● Typically used in fixed-floor installations.
Use Case: Large material handling, welding, or painting robots in
automotive factories.
B-Cabinet
● Medium-sized cabinet
● Slightly more compact than the A-cabinet but still capable of housing
advanced functionality.
● Supports mid-size robots and offers a balance between expandability
and space-saving.
● Often wall- or pedestal-mounted.
Use Case: General industrial automation where space is limited but some
expansion is still needed.
Summary Table
Cabinet Size Expandabi Typical Use Robot Types
Type lity
A-Cabine Large High Large robots, M-20iA,
t complex systems R-2000iC
B-Cabine Mediu Medium Mid-size robots, M-10iA, M-20iB
t m flexible systems
Mate Compa Low Small robots, limited LR Mate 200iD,
Cabinet ct space CRX
Open Air No Customiza OEM integrations, Varies (depends
cabinet ble custom panels on robot)
Common Uses
● Loop counters
● Flags
● Calculation of positions or speeds
● Storing sensor values
What it does:
● Moves the robot to 5 positions, each 100mm apart along X-axis
● Uses R[1] as a counter and to compute new X positions
● PR[1] is updated each loop
Summary Table
Type Syntax Purpose
Numeric R[1] = 10 Store numbers, logic, flags
Register
Position PR[2] = Store robot positions (X, Y,
Register P[5] Z…)
Component PR[2,3] = Set Z-axis of position
Access 150.0
Use Cases
● Simple interlocks between programs
● Monitoring conditions without using numeric registers
● Triggering state changes
Frames
What Are Frames?
Frames define coordinate systems that the robot uses to understand
positions. There are two main types:
Example:
tp
CopyEdit
UTOOL_NUM=1
UFRAME_NUM=3
L P[5] 200mm/sec FINE
Main Routines
What Are Main Routines?
The main routine is the primary program that the robot controller runs first
or uses as an entry point. It typically contains the high-level logic and calls
subprograms as needed.
Syntax Example:
tp
CopyEdit
PROGRAM: MAIN_ROUTINE
CALL PICK_PART
CALL PLACE_PART
JMP LBL[100]
LBL[100]
WAIT DI[1]=ON
CALL MAIN_ROUTINE
Summary Table
Concept Purpose Syntax Example
Flag (F[n]) ON/OFF logic control IF F[1]=ON, JMP
LBL[10]
Use Case:
tp
CopyEdit
CALL PICK_PART
CALL PLACE_PART
Here, the robot calls two subprograms: one to pick a part and another to
place it.
IF – Conditional Execution
Purpose:
IF is used to execute instructions only when a specified condition is true.
It allows decision-making in programs (like branching logic).
Syntax:
tp
CopyEdit
IF R[1]=1, JMP LBL[100]
● If the value in register R[1] is 1, the program will jump to label 100.
Use Case:
tp
CopyEdit
IF DI[1]=ON, CALL START_CONVEYOR
L – Linear Motion
Purpose:
The L command tells the robot to move in a straight line (Cartesian path)
to a specific point in space.
Syntax:
tp
CopyEdit
L P[5] 500mm/sec FINE
Use Case:
Used when the robot must maintain a straight path, such as in welding,
glue dispensing, or avoiding collisions.
J – Joint Motion
Purpose:
The J command makes the robot move using joint interpolation, meaning
each joint moves at its own speed to reach the target. It is usually faster but
not in a straight line.
Syntax:
tp
CopyEdit
J P[2] 30% FINE
Use Case:
● Wait for a part to be placed
● Wait for a machine to finish
● Delay for safety or timing purposes
R[1] = 0
LBL[1]
R[1] = R[1] + 1
PR[1,1] = R[1] * 100 -- Move X axis 100mm per loop
L PR[1] 500mm/sec FINE
LBL[99]
CALL FINISH_ROUTINE
What It Does:
● Sets the tool and user frame.
● Loops 5 times, moving linearly to a new X-position each time.
● Uses a register to calculate position.
● Waits 0.5 seconds between movements.
● Jumps to the end and calls a finishing subroutine.
Key Takeaways
Comma Type Role in Program Logic
nd
CALL Program Calls other programs (subroutines)
Control
IF Logic Conditional decision-making
JMP Logic Jumps to another point in the
program
LBL Logic Label or anchor for jumps and loops
L Motion Linear, precise movement
J Motion Joint (faster, not linear) movement
UTOOL Setup Defines the tool's frame of reference
UFRAME Setup Defines the workspace's coordinate
system
WAIT Timing/Logic Waits for time or condition before
continuing
Robot Programming – Teach Pendant
Teach Pendant, specifically for FANUC robots. The Teach Pendant is the
primary interface between the programmer/operator and the robot, and
mastering it is essential for efficient programming, teaching, and
troubleshooting.
Feature Description
iPendant Modern touchscreen-based version with color
display
F-buttons Soft keys for menus that change contextually
(F1–F5)
Arrow Keys Navigation through menus and code
Shift Key Modifier for accessing alternate commands
Jog Keys Move robot manually in joint, world, tool, or
user frame
Deadman Safety switch that must be held to move robot
Switch
Emergency Immediately halts all motion for safety
Stop 🖥️ Key
Edit Mode T1 (Teach), T2 (Teach High-Speed), AUTO
Selector (Automatic)
Function Keys Access to Data, Status, Program, I/O,
Frames, etc.
Features of the FANUC Teach Pendant
Breakdown:
● Sets the tool and frame
● Moves to positions
● Waits for input from sensor
● Calls subroutine to grip part
● Uses a register as a loop counter
● Loops 5 times then jumps to label 99
Pro Tip:
For complex logic, file operations, or background processes, combine TP
programming with KAREL programming (FANUC's high-level language).
Example
Step 1: Setup
➤ Create 3 Positions:
● P[1]: Home position
● P[2]: Pick position
● P[3]: Place position
Use JOG mode to move the robot to each point, then press SHIFT + F5
(RECORD) to save the position.
➤ OPEN_GRIPPER
tp
CopyEdit
1: DO[1]=OFF ; -- Turn off output to open gripper
2: WAIT 0.50(sec) ;
3: END ;
2.
3. Press SHIFT + FWD to step through the program slowly.
4. Watch for:
○ Correct movement
○ Part sensor triggering (DI[1])
○ Gripper signals (DO[1])
Graphical Programming
What is Graphical Programming in FANUC Robots?
Graphical Programming refers to programming the robot using a visual,
block-based interface rather than traditional line-by-line code. It’s designed
to make robot programming more intuitive, especially for:
● Beginners
● Educational environments
● Quick prototyping
● Collaborative robots (like FANUC CRX series)
In FANUC robots, this concept is realized mainly through:
FANUC's Tablet Teach Pendant
● A modern, touchscreen-based pendant.
● Used with CRX collaborative robots.
● Allows drag-and-drop programming blocks to control motion, I/O,
loops, conditions, etc.
● Programs can be generated graphically and then converted into TP
code in the background.
Key Features of FANUC Graphical Programming
Feature Description
Block-Based Logic Create programs by connecting logic blocks (move,
wait, loop, etc.)
Touchscreen Tap and drag blocks to build the flow visually
Interaction
Real-Time See the robot’s motion paths and simulate behavior
Simulation
Convert to TP The graphical program gets converted into standard
Program Teach Pendant code automatically
Save & Edit Later Graphical programs can be saved and reused or
edited in the future
Each block is a touchable icon that you configure with dropdowns and
values.
Graphical Programming Used?
● FANUC CRX Series Robots – via Tablet Teach Pendant
● Education/Training Environments
● Rapid Deployment Cells
● Collaborative Workspaces – where speed, safety, and simplicity are
crucial
Graphical Simulators
FANUC also provides RoboGuide (PC-based simulation software), which
isn’t fully graphical in the same way as block programming, but supports
offline TP programming with 3D visualization. However, for true
drag-and-drop programming, the Tablet TP is the go-to.
Robot Simulation — a crucial part of modern robotics engineering,
especially when working with FANUC robots.
Main Features
Feature Description
3D Robot Models Load accurate FANUC robot models
TP Programming Create, edit, and run Teach Pendant
programs
Motion Path Testing Visualize movements in real time
Tooling & Fixtures Import CAD models or create objects inside
RoboGuide
Collision Detection Warns if robot collides with anything in the
scene
Cycle Time Analysis Automatically estimates time taken per cycle
Summary Table
Aspect Teach RoboGuide
Pendant Simulation
Programming On robot On PC (offline)
Method
Visual Feedback Text only 3D Visualization
Safety Testing Limited Full collision check
Cycle Time Manual Automatic
Analysis estimate
Real Robot Yes No
Required?
Offline Programming (OLP) in the context of FANUC robots — a powerful
method used in modern industrial automation to develop, test, and
optimize robot programs without stopping production.
○
4. Simulate the Program
○ Check paths, verify no collisions, and test logic.
○ Adjust positions and speeds as needed.
5. Export the Program
○ Save the .TP or .LS file.
○ Transfer via:
■ USB
■ Ethernet/FTP
■ RoboGuide-to-robot integration
6. Run on Real Robot
○ Load program on Teach Pendant.
○ Test in T1 mode for safety.
○ Adjust live if needed.
Application Example
2: WAIT 0.50(sec) ;
3: END ;
This means: when DI[1] turns ON, the robot will run the
GRIPPER_CLOSE program automatically.
Safety Considerations
● Use Macro Lock to prevent unauthorized editing.
● Macros can bypass safety checks — always use interlocks and safe
zones!
● Be careful if triggering macros during robot motion — avoid collisions!
GRIPPER_CLOSE Program:
tp
CopyEdit
1: DO[1] = ON ;
2: WAIT 0.3(sec) ;
4: END ;
Summary
Term Description
This allows the robot to wait for a part presence sensor before picking.
Where Is It Used?
This is common in:
● FANUC CRX series (CRX-10iA, CRX-25iA, etc.)
● FANUC CR series (like CR-15iA, CR-35iA)
● Systems requiring frequent path adjustments or low-volume,
high-mix production
● Environments where non-programmers or operators need to teach
robots quickly
CopyEdit
[Enable Guidance] → [Move Robot by Hand] → [Record Position] →
[Build Sequence] → [Play Program]
Technical Notes
● Positions recorded this way are stored as taught points (P[n]) in the
TP program.
● On CRX, you can use block-based graphical programming or convert
them to standard TP lines.
● Force sensors or internal torque sensing allow the robot to detect
your hand motion.
Advantage Benefit
Concept Description
Messages The data format passed through topics (e.g., sensor values,
position commands)
Component Purpose
Simulation Tools like Gazebo and RViz for testing without real
hardware
Visualization Real-time 3D views of the robot and environment
(using RViz)
Tool Function
+---------------------+
| Your Robot |
| (motors, sensors) |
+----------+----------+
+----------v----------+
| Hardware Drivers |
+----------+----------+
+----------v----------+
| ROS Middleware |
| (topics, nodes...) |
+----------+----------+
+----------v----------+
| High-Level Logic |
| (navigation, vision)|
+----------+----------+
+----------v----------+
| User Interface |
+---------------------+
ROS Versions
Version Notes
ROS 1 (Melodic, Original ROS, widely used; Noetic is the last LTS
Noetic) release
Advantage Description
Summary
Feature ROS
Use Cases
● Autonomous mobile robots (AMRs)
● Robotic arms (pick-and-place, welding)
● Drone control and navigation
● Vision-based robotic inspection
● Human-robot collaboration (cobots)
● Industrial automation with ROS-Industrial