Week 02
MFET5023
Robotics and Automation
Lecture – 02
Contents:
• Introduction to Robot Programming
Lecturer
Dr. Habib
Email: [email protected]
Office: P1.43; Phone: 08 8302 6440 1
Main Topics to Cover in this Lecture
Introduction to Robot Programming
Learning Outcomes:
On completion of this section, you will be able to:
Learn the basic evolution of the robot programming language
Understand a brief idea on five different levels of programming
languages;
2
Programming Language Evolution
Robot program - the list of commands that run
within the software of the robot controller and
dictate the actions of the system based on the
logic sorting routine created there in.
– A program is only ever as good as the person
who creates it.
– Often programs are modified several times
before considered ready to go.
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
The first approach for computer programming of the robot involved
using a language designed for the needs of the robot.
– The result was a programming language or technique that was great
for controlling the robot, but difficult for users to work with.
– Complaints from users made this a short-lived method.
– The first generation programming languages was VAL (1973), COBOL,
ALGOL or Fortran. Other examples of first generation robot
languages include SIGLA (1974), ROL (1976), FUNKY(1977) and SERF
(1978).
4
The First Robot Computer Programs
The Next Approach
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.
– These hybrid languages continue to evolve.
– Today, we have systems that no longer require the user to have a computer
programming background.
Different industrial robotic programming 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
Level 2: Direct position control
Level 3: Simple point-to-point
Level 4: Advanced point-to-point
Level 5: Point-to-point with artificial intelligence (AI)
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
To change the operation of these systems, one must
physically change something in the system.
Punch cards
Watch: How to Use a Punch Card with a Silver Reed SK280 Knitting
Machine
10
The 5 Programming Language Levels
Level 2: Direct position control
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
Level 3: Simple point-to-point
The programmer must still enter the motion type,
data gathering, and other aspects of the program
but does not manually enter the positions.
– It is common practice to write the basic program
offline, with each position having a label but no
coordinate data.
– The programmer then uploads the program into
the robot and physically moves the robot to each
point to record the positional data.
Level 3 systems are still around today, like the
Mitsubishi system pictured. If you work with
these systems, you will likely need specialised
training on the robot and software it uses.
12
The 5 Programming Language Levels
Level 4: Advanced point-to-point
With level four languages, writing a program is as simple as
creating a new program, entering a string of points with the
proper motion label to reach those points, and testing out
the program.
– There is no need to memorize the larger number of
movement and logic commands that are required by
simpler programing methods.
– The programmer has to determine the key points of the
program, how the robot moves between those key
points, and any logic filters that might be necessary.
Level 4 programs, like the one pictured, are the
common way we program robots in industry
CNT moves for most points and FINE moves when the currently and you can learn the basics of this style
robot needs to stop to perform a function like gripping of programming in about 40 hours
or releasing a part.
13
The 5 Programming Language Levels
Level 5: Point-to-point with AI
The newest advancement in computer programming is the addition of Artificial
Intelligence (AI) to advanced point-to-point.
– 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
The process of writing a program begins
with planning.
– You need to have a game plan in place
before you start writing a program.
– The level of planning depends on the
complexity of the task that you have in
mind for the robot.
– This is a multistep process.
When building a program for a complex environment
like the one in the picture, proper planning is a must
for programming success.
15
Planning
Step One: Goal Setting
Step one: What do you want the robot to do?
– Before you can start to plan, you have to
know what the goal is!
– Take the time to figure out what you want
the robot to do, from start to finish.
– Make sure that the tasks you have in mind Without proper planning multipass welds like
are not beyond the system’s capabilities. these may look nice, but end up having functional
flaws.
16
Planning
Step Two: Task Mapping
In this step you will ask yourself the following questions:
– Which kind of tooling does the robot need?
– How should the robot move between points?
– Does the robot need to avoid any obstacles?
– What is the robot doing at each point?
– What is the robot doing between each pair of points?
– Do any conditions or other factors in the process
need to be addressed?
– Is the process logical?
Make sure the tooling matches the task(s) you
plan for the robot to perform.
17
Motion Instructions
A motion instruction contains up to five parts:
– Type of motion;
– Position;
– Speed;
– Termination; and
– Options.
The specifics of these will depend on the system.
Here is an example of a FANUC motion instruction:
– JOINT P[X] 100% FINE.
18
Type of Motion
Joint motion
Joint motion is point-to-point, where all the axes
involved move either as fast as they can or at the speed
of the slowest axis, with no correlation between the
separate axes involved.
A method of coordinating the movement of the joints so
that they all arrive at the desired location at the same
time.
The robot movement will generally not be in the straight
line.
19
Type of Motion
Linear motion
Linear motion is where the controller moves all
the axes involved at set speeds to insure
straight-line movement.
Cycle time is slower than a joint motion since
the controller must compute each axis
movement.
Very useful in the applications such as arc
welding, insert pins into holes, or laying
materials along a straight path, etc.
20
Type of Motion
Circular motion
Circular motion is the formation of arcs and full circles
as described by no less than three points.
– For arcs or part of a circle, you need to teach at
least three points: the start point, middle point,
and end point.
– For a full circle, you will need at least four points.
Cycle time is slower than a joint motion since the
controller must compute each joint movement.
21
Type of Motion
Weave motion
Weave motion is straight-line or circular motion
that moves from side to side in an angular
fashion while the whole unit moves from one
point to another.
– To program this kind of motion, you must set
two additional points besides the normal
required points for linear or circular motion.
– These two points determine how far to each
side of the normal motion the robot weaves
as well as the distance it moves forward Weave motion, often used with welding, allows the
between weaving motions. robot to expand the path of the weld and cover more
area
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.
– X is the distance in millimeters along the x-axis from the origin of
the frame.
– Y is the distance in millimeters along the y-axis from the origin of
the frame.
– Z is the distance in millimeters along the z-axis from the origin of
the frame.
– W (yaw) is the rotation in degrees around the x-axis of the tool.
– P (pitch) is the rotation in degrees around the y-axis of the tool.
– R (roll) is the rotation in degrees around the z-axis of the tool.
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?
You have to know why you set each point to make
sure that the robot does what you want.
– Does the robot stop at that point?
– Does it open or close a gripper at that point?
– Do we need to turn on a welder, paint sprayer,
glue dispenser, or other device?
– Do we need the robot to hit that point exactly
or just get near it?
If this robot performs tasks out of sequence,
there is a good chance that it will damage the bag
of chocolate it is working with.
26
Types of Motion Termination
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
The programming for the required task is written on
a remote computer console and then transferred to
the robot controller.
The robot programming language is to make it easy
for this purpose.
Use of production equipment during programming -
productivity not affected.
Creating the program is safer since the programmer
is not in the cell.
Communication with higher level of manufacturing
system (e.g. CAD/CAM) is possible.
Provide greater flexibility and high efficiency.
33
Robot Programming Methods
Off-Line programming
Safety is the main concern for off-line programming.
Most robot accidents do occur
during programming,
program touch-up or refinement,
setup, or
adjustment.
During these operations, the operator may
temporarily be within the robot's working envelope
where unintended operations could result in
injuries.
Requires highly skilled operator – computer
programming + robot language programming.
34
Robot Programming Methods
Robot Simulation
• Off-line programming can provide a
means of programming without
interruption of actual production.
• However, it would cause unintended
movement and in turn serious problems
– collision, or injuries.
• Simulation enables to test new or
modified programs in virtual
environment or even test a new
manufacturing cell before the
construction.
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
What are the dis-advantages?
38
Writing the Program
This is when you must know how your robot works,
how the controller organises information, and most
importantly, how to build a program for the specific
robot that you are using.
Once a person learns how to program one type of
robot, they tend to learn new styles of programming
quickly.
Next you will start the main program.
The specifics of this depend on the system, but the
common options are:
– Naming the program;
– Determining the program type; Programming using the ABB Tech-Pendant
– Designating the frame;
– Picking the proper tooling; and
– Designating offset tables to reference.
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
Interlock: to ensure the certain elements of the work cycle are
completed before other elements are started
EX: WAIT 20 ON or SIGNAL 10 ON
Sensors: open/close
Delay: Wait-Time 2
Communicate: SET DO 1 or RESET DO 1, etc.
49
Computation & Logic Program
GOTO 100
IF (logical decision) GOTO 150
X=X+10
50
Testing and Verifying
Once you finish writing a
program it is crucial to test it
for proper operation.
The system you are working
with will determine what
testing options you have at
your disposal, but most
industrial systems offer a
manual step-by-step testing If you are inside the robot work Be aware of tooling operation during
method and a continuous envelop during testing, remember the testing phase. The last thing you
testing mode. to take the teach pendant with want is tooling to engage when you
you. are not properly protected.
51
Robot Programming
Class Discussion
As a group, discuss an activity that you think
could be automated by using a robot.
Define the tasks that the robot will
perform.
What kind of special tooling is required?
Sketch if you will use any.
Can the activity be justified economically?
Show your development – do not simply
say yes or no.
52
Tasks to do before
next lecture
Review linear algebra
Matrix, and
vector mechanics
53
Referred Books/References
Source of the Lecture Contents:
[a]. Dinwiddie, Keith (2018, 1st Edition). Industrial Robotics.
Cengage Learning US. (chapter 06).
Acknowledgement
Dr Hung-Yao Hsu, UniSA
[a]
54