Lecture 2 - Robot Programming
Lecture 2 - Robot Programming
MFET5023
Robotics and Automation
Lecture – 02
Contents:
• Introduction to Robot Programming
Lecturer
Dr. Habib
Email: habibuh@unisa.edu.au
Office: P1.43; Phone: 08 8302 6440 1
Main Topics to Cover in this Lecture
Learning Outcomes:
On completion of this section, you will be able to:
2
Programming Language Evolution
Programming languages - the rules governing how This is the program to control a Panasonic
we enter the program so the robot controller can welding robot
understand the commands.
3
The First Robot Computer Programs
4
The First Robot Computer Programs
This time, the manufacturers started with a known computer language, such as BASIC
(Beginners All-Purpose Symbolic Instruction Code) or Fortran, and added commands
to control the robot.
– The result was a language that computer programmers of the day understood with
data processing capability.
– From the programmer’s side of things, this was terrific.
– It was not the optimal way to control the robot.
– Of the 22 early robot languages, only 8 were still in use and commercially available
by 1982. VAL II was developed in 1982 and was designed as a completely new
programming language, not just an extension of its predecessor VAL. Other
examples of second generation languages include AML (1977), RAIL (1981), HELP
(1982) and Karel (1985).
5
The First Robot Computer Programs
The Winner
Manufactures found a way to give users the best of both worlds by creating
programming languages that combined the efficiency of those specifically
designed for the robot with the established programing flow provided by
common computer languages.
ABB has its RAPID programming language. Kuka has KRL (Kuka Robot Language).
Comau uses PDL2, Yaskawa uses INFORM and Kawasaki uses AS. Then, Fanuc robots
use Karel, Stäubli robots use VAL3 and Universal Robots use URScript.
6
Top 10 Robotics Programming Languages
C/C++
Number 1 programming language in robotics! Many people agree that C and C++ are a good
starting point for new roboticists.
Python
There has been a huge resurgence/resurrection of Python in recent years especially in robotics.
One of the reasons for this is probably that Python (and C++) are the two main programming
languages found in ROS.
Java
Java is a general-purpose computer-programming language that is concurrent, class-based, object-
oriented, and specifically designed to have as few implementation dependencies as possible.
C#/.NET
C# is a proprietary programming language provided by Microsoft. I include C#/.NET here largely
because of the Microsoft Robotics Developer Studio, which uses it as its primary language.
MATLAB
MATLAB, and its open source relatives, such as Octave, is very popular with some robotic engineers
for analysing data and developing control systems.
7
Top 10 Robotics Programming Languages
Assembly
Assembly allows you to program at "the level of ones and zeros”. This is programming
at the lowest level (more or less).
Hardware Description Languages (HDLs)
Hardware Description Languages are basically a programming way of describing
electronics, i.e., Field Programmable Gate Arrays (FPGA).
LISP
LISP is the world's second oldest programming language (FORTRAN is older, but only
by one year).
Industrial Robot Languages
Almost every robot manufacturer has developed their own proprietary robot
programming language. For example, ABB has its RAPID programming language, Kuka
has KRL (Kuka Robot Language). Comau uses PDL2, Yaskawa uses INFORM and
Kawasaki uses AS. Then, Fanuc robots use Karel, Stäubli robots use VAL3 and Universal
Robots use URScript.
BASIC / Pascal
BASIC and Pascal were two of the first programming languages.
8
The 5 Programming Language Levels
Level 1: No processor
9
The 5 Programming Language Levels
Level 1: No processor
These systems lack computer or processor control
– Punch cards
– Peg drums
– Relay logic
– Similar systems lacking a digital processor
Watch: How to Use a Punch Card with a Silver Reed SK280 Knitting
Machine
10
The 5 Programming Language Levels
This level requires the programmer to enter the positional data for each axis
as well as all the motion, processing, and data gathering commands required
to create a program.
– This is the most basic level of processor control and the most labor-
intensive for the programmer.
– This type of programming requires knowledge of the position of each axis
when the robot is in the desired location.
11
The 5 Programming Language Levels
12
The 5 Programming Language Levels
– This takes the convenience of level four languages and adds the ability of
correction for error as well as advanced teaching methods.
– Level five systems use vision or some other advanced sensing method to
determine the difference between where the system should be versus the
taught position and makes the offset.
– Some level 5 systems allow users to physically grab the robot and move it
into whatever position they desire during teaching.
14
Planning
15
Planning
16
Planning
17
Motion Instructions
18
Type of Motion
Joint motion
19
Type of Motion
Linear motion
20
Type of Motion
Circular motion
21
Type of Motion
Weave motion
22
Motion Instructions
Position
A position is handled internally by the robot as a combination of
numbers, one for each axis, representing location and orientation of
the end-of-arm tooling.
23
Motion Instructions
Speed
The speed designator that determines how fast the robot will move along the
prescribed path:
– A percentage of the maximum speed of the robot;
• JOINT P[X] 100% FINE;
– Millimeters per second (mm/s);
– A process-related parameter (e.g., in./s of weld); and
– Something else robot, application, or manufacturer specific.
24
Motion Instructions
Obstacles
Look for anything that the robot might hit along
the way.
The commonly overlooked item here is the
fixturing.
– Fixtures hold parts in place for various industrial
processes by clamping or holding them in some
manner.
Make sure not to leave tools and other objects in
the work envelope, as they may be in the robot’s
path.
Complex fixturing often makes it difficult to
accomplish all the tasks needed during an
operation. In these situations it may take a fair
amount of time to solve all the clearance vs.
needed motion issues.
25
Motion Instructions
What is the Robot Doing at Each Point?
Motion Termination defines how the robot ends the move in the
motion instruction.
Fine: stops at destination position within accuracy of robot: Z0
Continuous termination: slows down but moves past while
“cutting corners”: Z50, Z20, etc
27
Robot Programming
Robot program is
A path in the space to be followed by the manipulator,
combined with peripheral “operational” actions that
supports the work cycle:
Point: location
Step: activity
Series: Collection of steps
Peripheral (operational) actions
Open/close gripper
Logic decision making (IF.. GOTO 10)
Communication
Coordination with other equipment in the robotic cell
(machine, human: SINGAL 10, ON)
28
Robot Programming Methods
Walk-through method
Online programming
Lead-through method
Off-Line programming
Robot Simulation
Walk-through method
A person doing the programming has physical
contacts with the robot arm, actually gains control
and walks the robot's arm through the desired
positions.
Each movement is recorded into the memory
The controller records the joint by sampling
Playing back during actual production
The main concern is on achieving the correct
positioning sequences.
Cycle time and speed can be changed later, when
necessary.
A dead man’s control should be fitted for the safety
reason.
29
Robot Programming Methods
Walk-through method
A high precision in generating paths cannot
be achieved (Manual operation) - Highly
skilled operator required.
Optimum trajectory velocity cannot be
achieved.
Movements (including unintended motion)
are stored - required large memory.
Mainly used in spray painting, arc welding,
grinding, deburring and polishing.
30
Robot Programming Methods
Lead-through method
Teaching the robot via teach pendant that has
toggle switches or contact buttons for
controlling the movement of the robot.
Allows a trained operator physically to lead the
robot through the desired sequence of events
by activating the appropriate pendant buttons.
The controller records the joint positions
When it runs, the controller calls the points
from memory, and send commands to joints
motion
The speed and termination type of the
movement should be specified.
Particularly useful in pick-place, arc welding
applications.
Teach pendant
31
Robot Programming Methods
Lead-through method
Advantages
Readily learn by shop personal
Safety
Disadvantages
Down time during teaching
Limited for logic instruction
Not compatible with modern computer
based techniques
Teach pendant
32
Robot Programming Methods
Off-Line programming
33
Robot Programming Methods
Off-Line programming
34
Robot Programming Methods
Robot Simulation
35
Robot Programming Methods
Robot Simulation
36
Robot Programming Methods
Robot Simulation
• During the simulation the followings to be checked.
– Kinematic reach – robot needs to reach all of items.
– Work-cell layout.
– Collision checking.
– Motion timing.
– Off-line programming – to create robot programs.
– Logic, wiring, and cable connection.
– Special application features – weld width for welding,
paint thickness for paint spraying, etc.
37
Robot Programming Methods
Robot Simulation
Advantage
Verify installation
Try out robot reach
Minimise cycle time
Collision and interference check
Reduce downtime of re-tolling/re-programming
Possible without knowledge of any robot programming
“language”
Software required
38
Writing the Program
39
Writing the Program
Program Instructions
A program consists of two kinds of instructions: motion control instructions and
program control instructions.
The various program control instructions available usually fall into the following
categories:
– Branching;
– Looping;
– Register;
– Input/output;
– Arithmetic;
– Call; and
– Data structures.
40
Writing the Program
Branching
Branching instructions cause the program to jump to another
point in the program and are classified into two broad types:
conditional branching and unconditional branching.
Unconditional branching instructions simply cause the
program to go to another instruction to continue execution
– JUMP or GOTO fall into this category.
Conditional branching instructions test for specific program
conditions before executing a branch
– IF THEN or SELECT fall into this category.
41
Writing the Program
Looping
Looping instructions cause the program to repeat a series of instructions either
for a specified number of times or until a specific program condition is met.
There are three common types of looping instructions:
– for/do (FOR…DO) - causes a program to repeat a series of instructions for a
specific number of cycles or times;
– repeat (REPEAT) - performs a series of instructions, and then tests a program
condition to determine whether it should repeat the instructions;
– while (WHILE) - tests a program condition to determine whether it should
execute a series of instructions and executes the instructions if the condition
is satisfied.
42
Writing the Program
Register
Register instructions allow the programmer to use arithmetic
registers to store and manipulate data.
May be used as part of other instructions, such as conditional
branching instructions or looping instructions, and are sometimes
included within arithmetic instructions.
Registers are a place to store numbers that the program can
manipulate, usually for logical sorting or data reporting reasons.
43
Writing the Program
Arithmetic
Arithmetic instructions are used to perform arithmetic operations.
All basic functions are available in most robots—addition,
subtraction, multiplication, and division.
Some systems may offer trigonometric functions, roots, and
powers.
44
Writing the Program
Call
Call (CALL) instruction - used to call other programs from a
main program and can be considered a type of unconditional
branching instruction.
– Calls another program and turns control of the robot over to
that program, which then executes its instructions; and
– When the called program ends, the controller returns to the
original program and continues with line of instruction
under the call command.
45
Writing the Program
Data structures
Data structure - a collection of related items used to control a process,
often arranged in a table format.
When we use structures to control robot motion and/or other process
parameters, it is easy to make adjustments to the system.
While it may take some time to change structures or create new
structures as the demands of the task change, it is time well spent in the
long run.
46
Functions in Robot Programming
Motion control
Interlock and sensor commands
Computations and logic program
47
Motion Control
Velocity (mm/s)
• Define type of motion: Joint, linear or circular
• Define the positions
• Define the velocity of (TCP) tool centre position
• Example
• MoveL p10, v100, Z10, tool1 Tool(TCP)
Termination type
MoveL: Linear
MoveJ: Joint
MoveC: Circular Destination position: MoveL (1
position), MoveC(2 positions required)
• The origin of the coordinate system
(Tool-Mounting Plate) or the point
of action of the tool attached to the
robot arm.
48
Interlock and Sensor Commands
49
Computation & Logic Program
GOTO 100
IF (logical decision) GOTO 150
X=X+10
50
Testing and Verifying
51
Robot Programming
Class Discussion
52
Tasks to do before
next lecture
Review linear algebra
Matrix, and
vector mechanics
53
Referred Books/References
Acknowledgement
[a]
54