Vous êtes sur la page 1sur 9

Robot programming in VRS with RAPID DISA UPV ETSINF

Departamento de Ingeniería de Sistemas y Automática


Robots programming in VRS with
Universidad Politécnica de Valencia
the industrial language RAPID

1. Introduction
In the field of industrial robotics is becoming more important the programming off-line (off-line
programming) in implementing robots in serial production systems. By creating robot programs
Offline the need arises to verify the correct functioning thereof, is of great use graphical
simulation environments of robots such as VirtualRobot Simulator (VRS) developed by the
Department Systems Engineering and Automation (DISA) of the Polytechnic University

Robot programming in Valencia.

EdtRAPID is created as an external tool for communicating VRS with the latter through a
dynamic access library dll call External Access Robot Virtual Library (VREAL). This library

VRS with the industrial provides access to certain features of the software simulation environment developed in C or C,
as is the case EdtRAPID. Making use of the definition file vreal.h and the specification file
vreal.lib for the access to the library, the application EdtRAPID has access in runtime to the

language RAPID simulation environment.

Application purpose and scope

Creating an application off-line programming solution arises as to the necessity of having a


robot simulation environment for teaching in the Departments of Systems Engineering and
*
Automation (DISA) of the Polytechnic University of Valencia and the University of Vigo . The
simulation environment chosen is because VirtualRobot Simulator software quality and its free.

The programming of movements of a robot in the simulator is done through programs


developed in C or C++ that need to be compiled for use. This system makes the simulation of
movements on an exercise in creating a software development environment, running in the
background, the industrial approach is needed in an application of this kind, intended to be used
in teaching courses related to robotics.

Martin Mellado Arteche In all simulations are seeking an approximation to reality with an accuracy determined, and in
this case the purpose of implementation is that students understand the introduction of robots in
industrial systems and the next steps in the design of work cells. At this point another need
arises and is of a shell to pass parameters to it and act upon the simulation environment. If this
interpreter also focuses towards a rapid prototyping application of a new need arises and is to
interpret complex code containing control over the execution sequence and also reusable in
programming a real robot.

In the absence of a textual programming language standard is adopted robots ABB RAPID
language due to how widespread it is in the robot industry implementation of this brand. This will
define the ultimate objectives of the application involving the provision EdtRAPID an external
November, 2009 tool that allows the VRS software offline ABB RAPID language and the simulation of movement
through the implementation of these programs.

*
Some parts of this document has been obtained from the documentation prepared by Diego Pérez
This document is licensed according to the Creative Commons license Losada, from Departamento de Ingeniería de Sistemas y Automática (DISA) of the Universidad de Vigo,
who has implemented the application EdtRAPID.

Robot programming in VRS with the industrial language RAPID 1 2 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

2. The ABB’s RAPID language Data

2.1. RAPID language The types of data can be defined as constants or as variables VAR CONST. Constants may
only be changed manually and must be initialized at the time of declaring them. Unlike variables
RAPID was developed to solve the needs of: are handled normally by the program. A special type of variables is the PERS persistent data
 Flexibility increase. stored in persistent memory area, keeps the data type to exit the program or to a power loss.
 Increased power demand by industry.
Expressions
It was introduced into the market in the first half of nineties and was a huge breakthrough for
ABB. Until then, ABB had offered its customers a relatively simple programming language, the Expressions can be arithmetic or logic, specify a value assessment and are often used in the
ARLA, which had been designed under the philosophy of an easy and fast. This has the following cases:
disadvantage of large customers very quickly discovered its limitations when trying to perform  In assignment statements.
complex tasks.  As a condition of a control statement.
 As an argument of an instruction.
To schedule in ARLA was necessary to have a robot controller, or what is the same, had no  As an argument to a function call.
external development tools and the code was encrypted. It was not possible to see the program
from a personal computer or computer, although this was not too significant a problem because The arithmetic and logical operators used in the evaluation are assigned a priority within the
of the price of computers at the time. chain and may be reassigned by using parentheses. The expressions can include data or
references to previously reported data.
Characteristics of the RAPID language
Automatic error management
The RAPID language consists of a set of instructions describing the tasks to be performed by
the robot. The job description and not of movement implies the existence of an extensive list of The run-time errors can be managed from within the program and avoid having to interrupt the
instructions, to which we must add the functions. execution. These errors can be detected by the robot controller, such as the division of a data
type by zero, or can be detected by the program to incorrect data types.
Generally, the instructions are associated with a number of arguments that define the action to
perform and can be defined in different ways: Multitask
 As a numeric value.
 As a reference to a datum. RAPID has a multitasking mode for program delivery in pseudo-parallel. A program run in
 As an expression. parallel can be in first or second place to the main program can also be level. The plane in
 As a function call. which was found during its execution determines their priority. You can define up to 10 tasks in
 As a string. pseudo-parallel, each consisting of a set of modules, similar to normal programs. All modules
are considered local in each of the tasks.
The RAPID language is highly structured, consisting of a set of modules that in turn can contain
procedures, functions and routines. A program consists of a set of modules, one of them (will be The constants and are considered local variables within a task, unlike the persistent variables
the main module of the program) should be a procedure called main, which will correspond to that are considered global to all tasks. If there are two different data types with the same name
the start of execution of instructions. in different modules and tasks is a persistent value, an error occurs at run time.

Procedures Each task has its own management of interruptions. The tasks have mechanisms of
synchronization and communication between them. There are some restrictions on the use of
The procedures consist of a set of instructions that can be called from other procedures. You the multi-task:
can pass parameters in procedure calls, but did not return any data type.  You can combine programs in parallel with a PLC. You can respond to an interruption of a
program in the background while the foreground program is busy.
Functions  There is only one programming unit, which cannot mix the messages written on the screen
for different tasks.
The functions, unlike procedures, return a value of type specific and are often used as an  Instructions for movement of the robot can operate only on the primary task.
argument of an instruction.  The execution of tasks in pseudo-parallel is detained when the user or other tasks they use
the file system.
Routines  The Teach Pendant programming unit has no access to tasks other than the principal.
Therefore, the development of programs to handle other tasks RAPID is allowed only if the
The routines are a special type of procedure that provides a way to deal with interruptions. If an code is loaded into the main task or offline.
interruption occurs and is served in the program through a routine, this is executed with priority.
Interruptions
Flow control
Interrupts are events defined by the program and identified by numbers that should be preset
Flow control is achieved by implementing control statements similar to those in any high level before the execution. The maximum number of interruptions for each program is 70, the CPU
language. There are sentences repeated instructions (loops of execution) and branching being limited to a maximum of 100 interruptions. During the course of her execution of a
sentences (making decisions). program if an interrupt, it stops the sequential execution of instructions and executes the TRAP
routine care for the interruption. Once the routine implementation of the program is resumed at
the point which was stopped.

Robot programming in VRS with the industrial language RAPID 3 4 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

Signals MODULE <module name>


PROC main()
The controller of a robot can have various boards associated with input / output. Every board …
has several physical analogical or digital channels that must be connected to logic signals ENDPROC
referenced from the program. These signals are defined in the controller, outside language
PROC <procedure name>()
RAPID program. …
ENDPROC
A physical channel may have associated different logic signals, but is not permitted to associate …
the same logic signal to different physical channels. ENDMODULE

2.2. RAPID language syntax Constant data is defined as:


CONST <constant type> <constant name> := <value>
ABB RAPID textual language is a high-level interpreted programming designed for industrial
robots. It basically consists of a set of instructions describing the activity of the robot. These Variable data type is defined as:
instructions may be associated with a set of arguments that define the action to be performed VAR <variable type> <variable name> := <value>
by the robot. Arguments can be specified by:
The possible data types are:
 Numeric value  num: numeric data
 Pointer to a data  robtarget: location of the robot with [pos,confdata,cuaternio,extjoint]
 As an expression  pos: Cartesian coordinates for the robot, that is, values [x,y,z]
 As a function call  confdata: configuration of axes with 4 integer values [cf1,cf2,cf3,cf4]
 As a string value  orient: orientation with a quaternion [q0,q1,q2,q3]
 extjoint: robot external axes, with 6 values, normally:
The program instructions are included within procedures, functions or routines. PROC [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09].
procedures refer to sets of instructions to execute sequentially, a program consists of at least
one main procedure called main from which you can make calls to other procedures. FUNC 2.3. Limitations of EdtRAPID application
functions return a value of data type specific parameters used as directed. TRAP Routines are a
type of special procedures to deal with interruptions. The interpreter EdtRAPID only implements the instructions and data types used most. It uses
only two modules of the program, a system where there are defined the types of data generally
Certain instructions such as the definition of data types can be made outside the procedures, used and the data associated with the tool of the robot, and another user where you should
functions or routines. These types of data can be defined as constants or variables VAR define the main procedures must always be in a program RAPID language. The instructions
CONST. A particular type of data variables are persistent PERS that are stored in a memory implemented are shown below:
area that holds the information to a power failure. Variables can be modified in the program and
need not initialize when you declare the constants on the contrary can not be changed and are Operations with variables
initialized to a value at the time of declaring them.
“:=”. Asignation
The code is structured in a modular program where modules can be loaded at runtime from <name variable> := <expression>
memory storage or removed from the program memory. This structure is given by the memory Interpretable expressions are simple, without parentheses
limitation of the robot controller, thus can handle large programs with limited resources.
Incr. Increment a variable in 1:
The flow control program execution within procedures, functions and routines is by FOR loops Incr <name variable>
and WHILE or IF branch instructions, Compact IF, TEST and GOTO.
Decr. Decrement a variable in 1:
Structure of a RAPID program Decr <name variable>

A RAPID program consists of a module that is stored in an ASCII file, usually with a .prg Add. Add a numerical value to a variable:
extension. The syntax of a module is: Add <name variable, value>

MODULE <module name> Clear. Clear a numerical variable:


… Clear <name variable>
ENDMODULE
Program flow control
A module is necessarily composed of a main procedure and optionally other procedures (from a
procedure may call another, except the main): IF. Definition of instruction IF:
IF <condition> THEN
<instructions>
ENDIF
or also:

Robot programming in VRS with the industrial language RAPID 5 6 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

IF <condition> THEN Control of waits


<instructions>
ELSE WaitTime. Wait time:
<instructions> WaitTime <time in seconds>
ENDIF
WaitDI. Wait until an input digital signal is activated or deactivated:
FOR. Definition of loop FOR: WaitDI <name signal, value>
FOR <index> FROM <start> TO <end> DO
<instructions> WaitDO. Wait until an output digital signal is activated or deactivated:
ENDFOR WaitDO <name signal, value>
or also:
FOR index> FROM <start> TO <end> STEP <step> DO WaitUntil. Wait until a condition is true:
<instructions> WaitUntil <condition for end of wait>
ENDFOR
Robot motion instructions
EXIT. End program execution.
EXIT a) Motions with free trajectories

WHILE. Definition of loop WHILE: MoveJ. Move the robot to a location following a free trajectory:
WHILE <condition> DO MoveJ <robtarget, speeddata, zonedata, tooldata>
<instructions>
ENDWHILE MoveJDO. Move the robot to a location following a free trajectory and activate an output digital
signal when motion is finished:
Break. Interrupt program execution: MoveJDO <robtarget, speeddata, zonedata, tooldata, signal, number>
Break
MoveJSync. Move the robot to a location following a free trajectory and call a procedure when
Write in console the motion is finished:
MoveJSync <robtarget, speeddata, zonedata, tooldata, proc name>
TPWrite. Write in console:
TPWrite <String to show on console> b) Motions with linear trajectories

TPErase. Erase all text shown in console: MoveL. Move the robot to a location following a linear trajectory:
TPErase MoveL <robtarget, speeddata, zonedata, tooldata>

Mechanical unit control MoveLDO. Move the robot to a location following a linear trajectory and activate an output
digital signal when motion is finished:
ActUnit. Activate a mechanical unit: MoveLDO <robtarget, speeddata, zonedata, tooldata, signal, number>
ActUnit <name of mechanical unit>
MoveLSync. Move the robot to a location following a linear trajectory and activate an output
DeactUnit. Deactivate a mechanical unit: digital signal when motion is finished:
DeactUnit <name of mechanical unit> MoveLSync <robtarget, speeddata, zonedata, tooldata, proc name>

Control of digital and analogical output signals


3. The editor for RAPID EdtRAPID
Set. Activate an output digital signal:
Set <name signal> 3.1. EdtRAPID manual
Reset. Deactivate an output digital signal: EdtRAPID is a rapid prototyping tool designed for off-line robot programming language RAPID.
Reset <name signal> It has a text editor to develop the program code which can then be simulated in the
Environments through a VRS interpreter has its own tools for monitoring implementation.
SetDO. Change the value of an output digital signal:
SetDO <name signal, value>
In addition to the utilities needed to program a robot, EdtRAPID has a system of control of
external axes to simulate the transport of parts by automatically tapes and manipulating objects
InvertDO. Invert the value of an output digital signal: using the tools associated with the robot. This section shows the information related to the tools
InvertDO <name signal>
of the editor and its configuration options, beginning with an introduction focusing holding the
GUI management later in the application. Each of the parties described in detail following
SetAO. Change the value of an output analogical signal: configuration examples and implementation of programs in a work cell.
SetAO <name signal, value>

Robot programming in VRS with the industrial language RAPID 7 8 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

User graphical interface running VRS.

The application is divided into three blocks consisting of plain text editor, the tree configuration To disconnect EdtRAPID VRS is only necessary to press the disconnect button (the second
of the robot work cell and the interface of program execution. When starting the application button starting from the left of the connecting rod). Once you disconnect the editor will update
always shows the configuration bar to the left and the program edit zone to the right as shown in the status of the configuration tree, losing all information associated with the robots that are
Figure 1, although this is customizable as the bar can be placed anywhere, even leaving already defined. It should save the changes before disconnecting the editor.
floating as in Figure 2. At the top bar shows the application main menu and two toolbars, the
first one for the editor and the second connection interface with RSV. There are some other
tools such as bar organization in the editor window or the menu text to load or save VRS work
cells that will be explained in detail later.

Figure 3: Connection toolbar Figure 4: Connection dialog

Text editor
Figure 1: General view Figure 2: Moving toolbar EdtRAPID have a multi-document text editor with RAPID code highlighting. The source code is
stored in plain text format and is convenient to save files with ".prg" extension. Figure 5 shows
EdtRAPID can be used as a plain text editor for VRS but being disconnected in this way are the aspect that the editor presents with a document containing source code.
disabled capture tools robot positions, and all settings related to robots and work cells.

The normal mode is to be connected using a simulation environment for either editing or RAPID
program for simulating the same and can use all the opportunities offered by the editor
regarding the capture of positions of the robots Simulation Environments.

All tools related to configuration or definition of the workcell or Programming Environments bots
are disabled while the publisher is disconnected, and some can only be used in local connection
to VRS, were blocked after establishing connections remote.

Connection with VRS

The connection interface with the simulation environment is controlled with the buttons on the
toolbar link. When you run this bar is displayed above the tree configuration.

To connect to VRS is pressed the first button on the toolbar shown in Figure 3, which is active.
The roles that each of the buttons (from left to right):
 Connect with VRS
 Disconnect from VRS
 Update elements in the environment of the configuration tree Figure 5: Edition of a single document
 Get robot location The editor acknowledges RAPID language dynamically highlighting colours. The
 Run program correspondence of commands and colours is:
 Blue: Reserved words in the language used to define the sequence of program execution
Pressing the connect button a dialog as shown in Figure 4 with two options, the first one to and data definition.
establish a connection with RSV executed on the same machine as the editor and a second  Brown: Datatypes.
option for connecting to a remote computer editor VRS running with remote operation mode. If  Green: Assignment Statements.
you make a connection on a remote server need to specify the IP address of computer that is  Violet: language instruction.

Robot programming in VRS with the industrial language RAPID 9 10 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

 Garnet: numeric string.


 Red: Strings. Capture of robot locations
 Gray: Comments are not read by the code interpreter
To enter the code concerning the current position of a robot using the capture button the
The names of data and user defined functions are not stained by the editor, thus being black. connecting rod. Before pressing the button is necessary to place the cursor in the active
The tabulation of the various lines should also be borne by the developer. document at the insertion of code and have selected the desired robot configuration in the tree.

Edition tools

The main toolbar of the environment is the text editor as shown in Figure 6. Below is a
description of the functions implemented (from left to right):
 New Document.  Find next string.
 Open the document.  Search chain.
 Save document.  Replace string.
 Save document as.  Print the document.
 Cut selected text.  About EdtRAPID.
 Copy selected text.  Insert / Remove Bookmark.
 Paste text from clipboard.  Go to the next marker.
 Undo the last action.  Go to previous marker. Figure 8: Capture of a location
 Redo the previously undone action.  Delete all bookmarks in the document
 Search for text string. Once this latter is pressed the button and a dialog appears as shown in Figure 8. The dialog
has a text field for entering the name of the capture point. After entering the name A is pressed
to accept and automatically insert the source code corresponding to the position of the robot as
shown in Figure 9.

Figure 6: Edition toolbar

As you can see the editing tools are standard with any publisher which is not described in detail
its operation.

Markers
Figure 9: Code of a captured location
The markers are used to indicate the status of certain lines of code during editing. A document
with defined markers is shown in Figure 7. To insert a new marker on a line must place the The position of a robot is represented by the RAPID language datatype robtarget which in turn
consists of four types of data, pos for defining the Cartesian coordinates of the robot, confdata
cursor in that line and press the Enter button marker. To remove it you press the same button
again. If you want to go from one bookmark to another using the navigation buttons between that defines axes configuration, orient to define orientation with a quaternion and extjoint
markers and to remove all markers that contains the text uses the last button on the text editing representing the external axes of the robot.
bar.
Work cell
The markers are not included in the saved text document, or are useless in the execution of
code, only used to mark positions within the robot program. The work cell robots simulator defined in VRS but because this has no tools to save the
positions of the robots loaded into the simulation environment includes a tool to save EdtRAPID
A utility of the markers is that if you insert a marker in each head of a proceeding, including the jobs created. In the application menu simulator has two functions (see Figure 10). The first Load
main, be easy to go from one procedure to another program to edit the marker from marker.. cell as its name suggests is to charge a cell working in the simulator which is connected
EdtRAPID, should be disconnected both simulator menu options are disabled. It also only work
cells can be loaded into local environments, if the connection is remote cannot change the cell.
Cell Save The second action can be executed in both local and remote environments to be
necessary in both cases have all the files that make up the cell in the computer running
EdtRAPID.

Figure 10: Simulator menu

Figure 7: Document with markers It is necessary to define a set of parameters in a dialog window as shown in Figure 11. On the

Robot programming in VRS with the industrial language RAPID 11 12 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

left is a list of the items inside the cell, for each of them is necessary to specify the file address should click a button.
that element. This name is selected in the list and then press the button to the right of the text  Perform next step: Run the following command when in run mode step by step.
file to change to select a new route. Once assigned the new address of the item changes colour  Pause execution: Pause execution when in continuous run mode.
to light gray (see items 1 and 3 in Figure 11). When all is assigned an address list will activate  Stop execution: Stop the running program, whether it is continuous or step by step.
the OK button. You can also optionally save the environment of the cell known as the VRS  See the console: Displays the programming console. This screen printing errors and the
environment, this will select the address of the file containing the environment by pressing the impact of program implementation.
button to the right of the text environment.  Reset signal: Put all the signals associated with the execution robot to minimum or zero in
case of digital signals. It is a very important not to lose synchronization on program
The work cell is stored in a plain text file with a .cdt extension and creating a folder with the implementation.
same name where the files are kept for all items containing the cell and the environment if you  Close Window: Terminate execution mode.
chose the option in the window Save dialog Cell.

Figure 14: Dialog to run a program

In addition there are two fields to select the base module and source code:
 Module base: is the file system module contains the definition of the tool and general
constants
 Source code: The file containing the program code to run, usually a prg file that should
Figure 11: Save cell contain the main procedure.
Execution of a program Figure 15 shows an example of a program execution error code. You can see in the first list are
printed messages related to the implementation and give the console error messages. If no
The program execution is independent of the text editor does not run directly the code being incidents occur during program execution, the console only prints out the messages as strings
edited, but you must have defined the configuration of the robots. Once your settings and you inserted from the RAPID code.
can run programs on the simulator using the Run Program button of the connecting rod as
shown in Figure 12.

Figure 12: Execution button

Before running a program is necessary to select a robot in the configuration tree as shown in
Figure 13 (check the box to the left of the name). If you have selected several robots
simultaneously implement the program on the first one is checked.

Figure 13: Selection of a robot

When you press the Run Program button a dialog box appears as shown in Figure 14. This
dialogue has eight tool buttons on the right side corresponding to the shares (from top to
bottom):
 Run / Resume: This button starts the continued implementation of a program on the
simulator. Execution is repeated cyclically, so that the robot run and main procedure
Figure 15: Example of execution of a program
repeated until the required stop, a failure or stop or pause the program execution. If the
program is paused and resumed execution.
 Debug: Mode of stepping (instruction by instruction). To run a program called verification

Robot programming in VRS with the industrial language RAPID 13 14 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID DISA UPV ETSINF

4. Robot programming in VRS with EdtRAPID MODULE EXAMPLE

! Main procedure
4.1. Edition and execution of a program
PROC main()
! Introduce here the gripper control
To perform the first robot program en VRS using EdtRAPID the starting state is as follows:
 VRS must be running with no robot or environment. Otherwise, close environment and ENDPROC
robots with VRS Loader.
 Run EdtRAPID. Its executable file must be in VirtualRobot directory ! Procedure to open the gripper
Applications\Users\EdtRAPID (default installation). PROC Abrir()
Set abrirPinza;
 Try to adjust the size of both windows in order to see both applications in the screen at the Reset cerrarPinza;
same time. ENDPROC

Now do the following actions in EdtRAPID: ! Procedure to close the gripper


1. Open a connection with VRS pressing the button Connect and select the connection type PROC Cerrar()
as local. Set cerrarPinza;
2. With the option Simulador>>Cargar Célula select the file EdtRAPID\Tutorial\Ejemplo1 Reset abrirPinza;
ENDPROC
(extension cdt). Check that in VRS a robot and a table with a part have been loaded.
3. With Archivo>>Abrir entorno select the work-environment pr001 (extension edr). ENDMODULE
4. In the empty file that is open for edition, introduce the following code (without forgetting
the semicolons at the end of the lines):
Note that three procedures have been defined in the module, the main and two more. But so
far, only main will be executed because the others are not called. To call the procedure to open
MODULE EXAMPLE
gripper the required instruction is
VAR num i := 0; Abrir;
Similarly, to close the gripper the required instruction is
! Main procedure Cerrar;
PROC main()
TPWrite "In execution"; Exercise 1:
WaitTime 1;
Incr i;
Modify the previous program so that the gripper is open during 2 seconds and closed during
IF i = 5 THEN three seconds.
TPWrite “Program repeated 5 times”;
WaitTime 2; 4.3. Capture and definition of robot locations
TPErase;
i := 0; For the programming of robot movements in a RAPID program, locations (robtarget) must be
ENDIF
defined and then use in instructions MoveL or MoveJ or as destination locations of the motion.
ENDPROC

ENDMODULE While one can define a location by typing it properly, the easiest way is to move the robot in
VRS with VRS TeachPendant or any other application (VRS PartHandling for example) and
5. Once introduced, save with name Ejemplo.prg. capture locations from EdtRAPID. To do this you should do the following.
6. Check that the robot ABB IRB140 is selected (with its box on the left of the name ticked)  Move the robot in VRS to the desired location to be captured in EdtRAPID
7. Press the button Run program that opens the dialog for execution of programs. Since now,  In EdtRAPID, be sure that the proper robot is selected
you can edit a program in EdtRAPID, save to file, open in the dialog for execution of  Put the editor cursor in the place there the location definition is going to be included.
programs and finally run it on VRS Normally, locations are defined at the beginning of the file, out of the procedures so that
8. Select the file Ejemplo as Código fuente. they can be used from any procedure.
9. Press the button See the console  Press the button to capture a location and introduce a name, for example home.
10. Press the button Run  6 lines will be included to define a location of type robtarget, with a name rob_home
11. Watch the execution. If an error is produced, you must close the dialog for execution of  In the procedures, instructions to move the robot can be added using rob_home as goal
programs, repeating the process (edit in EdtRAPID, save to file, open in the dialog for location of the motion.
execution of programs and run on VRS). If an instruction is not executed, for example, the
text is not written, check that you do not forget the “;” at the end of the line. To verify it, try Exercise 2:
mistakes, as typing instructions as “TPErases;” or “Incr a;” to see what happens*. Define in the previous program the location home (synchro in VRS) and two locations pos1 &
pos2. To do this, move the robot before with VRS TeachPendant.
4.2. Programming the robot tool
New locations can be easily defined relatively to others location, mainly with changes in position
Create a new file or better, start from the previous one, to introduce the following program with (Cartesian coordinates of the point) but with the same orientation. Assuming that for a robot a
two additional procedures, one to open the robot gripper and one to close it. location called is defined with:

! Location for pos1


* CONST pos pos_pos1:=[725.000000,0.000000,712.000000];
The interpreter of EdtRAPID is not complete, so, sometimes an instruction is not executed but
CONST orient ori_pos1:=[0.382683,0.000000,0.923880,0.000000];
no error is shown.

Robot programming in VRS with the industrial language RAPID 15 16 Robot programming in VRS with the industrial language RAPID
Robot programming in VRS with RAPID

CONST confdata conf_pos1:=[0,0,0,0];


CONST extjoint ejes_pos1:=[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09];
CONST robtarget rob_pos1:=[pos_pos1,ori_pos1,conf_pos1,ejes_pos1];

A new approximation location with, for example a distance 100mm in Z axis, only the new
position must be redefined and the locations using the rest of the parameters, that is:

! Location for approxpos1


CONST pos pos_approxpos1:=[725.000000,0.000000,812.000000];
CONST robtarget rob_approxpos1:=[pos_approxpos1,ori_pos1,conf_pos1,ejes_pos1];

Note that only Z-coordinate has been modified in pos_approxpos1 with respect to the definition
of pos_pos1, while that to define rob_approxpos1 the previous values of
ori_pos1,conf_pos1,ejes_pos1 have been used.

Exercise 3:
Define, in the previous program, approximation locations for pos1 & pos2.

4.4. Programming robot motions

Every motion instruction has at least four basic parameters for its interpretation:
 The location to move the robot. This parameter is defined according to the above process.
 The speed of the motion. The robot swill move faster as higher is this parameter. Possible
values are defined in the file basesys.txt, but it can be enough to use, for example, the
values v100 (very slow), v500, v1000, v3000, v5000 & v7000 (very fast).
 The accuracy for the robot motion, understanding in this parameter the deviation margin
allowed to the robot motion to reach a location. Possible values are defined in the file
basesys.txt, but it can be enough to use, for example, the values fine (highest accuracy),
z10, z30, z50, z100, z200 (via locations) although in VRS this parameter is not simulated.
 The tool coordinate used for the robot motion. Possible values are defined in the file
basesys.txt, but only is defined the value tool0.

Examples of correct instructions are:


MoveJ rob_home,v7000,z100,tool0;
MoveL rob_pos1,v1000,z30,tool0;

Exercise 3:
Modify the previous program so that the robot moves between the locations using the
instruction MoveJ.

Exercise 4:
With the help of VRS TraceControl, verify the difference when the robot is moving between the
locations using MoveJ or using MoveL.

Exercise 5:
Change the program so that the robot picks a part, transports it to home location and places it in
another position on the table, repeating the contrary process in order to place it again in the
original position. You can use VRS PartHandling to define adequate locations for picking and
approximation.

Robot programming in VRS with the industrial language RAPID 17

Vous aimerez peut-être aussi