RAPID Basic Commands
RAPID Basic Commands
Mikael Norrlf
Mikael Norrlf
PhDCourse Robot Modeling and Control
Robot safety
The robot control system can be in three distinct
modes
Manual, the speed is reduced to a maximum 250 mm/s
Manual 100%, full performance is reached but the user has
to keep pushed an extra button on the flex pendent
Auto, the robot moves at full speed completely autonomous
Mikael Norrlf
PhDCourse Robot Modeling and Control
Robot hardware
Teach pendent
(FlexPendant)
Emergency stop
button (also available
on the TeachPendant)
Mikael Norrlf
PhDCourse Robot Modeling and Control
Robot hardware
Teach pendant
Mikael Norrlf
PhDCourse Robot Modeling and Control
Robot hardware
Mikael Norrlf
PhDCourse Robot Modeling and Control
Mikael Norrlf
PhDCourse Robot Modeling and Control
Coordinate systems
Tool frame
Base frame
World frame
y
x
Mikael Norrlf
PhDCourse Robot Modeling and Control
Mikael Norrlf
PhDCourse Robot Modeling and Control
Mikael Norrlf
PhDCourse Robot Modeling and Control
MainModule
num length;
num width;
num area;
PROC main()
length := 10;
width := 5;
area := length * width;
TPWrite "The area of the rectangle is \Num:=area;
END
PROCENDMODULE
Mikael Norrlf
PhDCourse Robot Modeling and Control
FOR
FOR i FROM 1 TO 5 DO
TPWrite "Hello";
ENDFOR
WHILE
VAR num sum := 0;
VAR num i := 0;
WHILE sum <= 100 DO
i := i + 1;
sum := sum + i;
ENDWHILE
Mikael Norrlf
PhDCourse Robot Modeling and Control
Mikael Norrlf
PhDCourse Robot Modeling and Control
Syntax comments
A statement in Rapid ends with a semicolon, exceptions are IF
ENDIF, FOR ENDFOR,
A comment in Rapid starts with a !
! Calculate the area of the rectangle
area := length * width;
Mikael Norrlf
PhDCourse Robot Modeling and Control
Move instructions
MoveL p10, v1000, fine, tool0;
p10 specifies the position that the robot shall move to.
v1000 specifies that the speed of the robot shall be 1000 mm/s.
fine specifies that the robot shall go exactly to the specified position
and not cut any corners on its way to the next position.
tool0 specifies that it is the mounting flange at the tip of the robot that
should move to the specified position.
Mikael Norrlf
PhDCourse Robot Modeling and Control
Offset function
With Offs() it is possible to add an offset to a point in the x-, y-,
and z-direction
MoveL Offs(p10,0,0,20), v1000, fine, tool0;
The robot will move to a point 20mm i z-direction relative to p10.
Offs() is a very efficient tool to offline produce a desired motion
given a reference-point.
Mikael Norrlf
PhDCourse Robot Modeling and Control
Configuration supervision
To avoid problems with configuration warning/error it
is possible to use
ConfL \Off; ! For MoveL
ConfJ \Off; ! For MoveJ
Mikael Norrlf
PhDCourse Robot Modeling and Control
Coordinate systems
z
Tool frame
z
y
x
Base frame
World frame
y
x
Mikael Norrlf
PhDCourse Robot Modeling and Control
Mikael Norrlf
PhDCourse Robot Modeling and Control
Lab
Exercise 1.
a) Jog the robot using the teach pendant while testing the different
jog-modes.
b) Try jogging close to a singularity
c) Jog the other mechanical units while using different coordinate
systems.
Mikael Norrlf
PhDCourse Robot Modeling and Control
Lab
Exercise 2.
Program the robot to draw the figure below. The inner geometry is
optional. Simulate that the robot uses a pen by moving to a
specified fixed position before and after the figure is drawn.
It is important that the program uses the right tool and work object.
Try to move the work object (using the positioner) to see how this
affects the program. You can also move the robot using the track
while drawing.
Mikael Norrlf
PhDCourse Robot Modeling and Control
Program template
MODULE MainModule
CONST jointtarget jpos10:=[[0,0,0,0,0,0],[0,0,0,9E+09,9E+09,9E+09]];
TASK PERS wobjdata wobj1:=[FALSE,FALSE,"STN1",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
CONST robtarget p10:=[[200,0,100],[0.7071,0,0.7071,0],[0,0,0,0],[0,0,0,9E+09,9E+09,9E+09]];
CONST robtarget p20:=[[1662.50,0.00,2055.00],[0.707107,0,0.707107,0],[0,0,0,0],[0,0,0,9E+09,9E+09,9E+09]];
PROC main()
MoveAbsJ jpos10\NoEOffs, v1000, z50, tool0;
!MoveJ p10, v1000, z50, tool0\WObj:=wobj1;
ENDPROC
PROC DrawLiuLogo(
PERS tooldata LocalTool,
PERS wobjdata LocalWorkObj)
ENDPROC
PROC TestInterpSingPos()
SingArea\Wrist;
MoveL Offs(p20,0,-400, 0), v100, fine, tool0;
MoveL Offs(p20,0, 400, 0), v100, fine, tool0;
SingArea\Off;
ConfL\Off;
MoveL Offs(p20,0,200, 20), v100, fine, tool0;
MoveL Offs(p20,0, -200, 20), v100, fine, tool0;
ConfL\On;
ENDPROC
ENDMODULE
Mikael Norrlf
PhDCourse Robot Modeling and Control