Melfa Basic Iv: Main Main Characteristics of Characteristics of RV-2AJ

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Robot Programming Language - MELFA

MELFA BASIC IV
Mitsubishi robots use their own programming
language for the robot controller, MELFA Basic IV.
The robot programming language MELFA BASIC IV
is powerful yet easy to learn, ensuring that users
can start producing their own powerful and efficient
robot programs in a very short time.

CosiRob is programming environment for all


Mitsubishi robots

Dr eng. Piotr Kohut

Main Main characteristics of Robot system components

characteristics of RV-2AJ
Manufacturer Mitsubishi-Electric
θ3 No DOF 5
Robot weight 17 [kg]

θ5 ramge 410 [mm] Extension option cards:


Repeatability +/- 0.02 [mm]
θ2 Max. load 2 [kg]
θ4 Max. speed 2100 [mm/s]
Max. No of Tasks 32
Max. No inputs / outputs 240 / 240
θ1 AC power 230 [V] / 50 [Hz]

It is ideal for the applications (testing, material handling, training...), it opens


up a completely new range of possibilities with a speed of up to 2,100 mm/s,
significantly improved repeatability of ±0.02 mm and a handling payload of up to 2 kg
3

Example of a robot system configurations

Multitasking function for parallel execution of multiple tasks. A 64-bit RISC processor with
DSP provides ample power for 3-D circular and linear interpolation, and for multitasking with
up to 32 programs running in parallel.

Mitsubishi robots has multitasking operating system that can perform other tasks at the same
time as executing the robot’s movement sequences. For example, the robot can simultaneously
control peripheral equipment, read in position data from a camera system and control additional
robot DOF, significantly enhancing the overall efficiency of applications.

1
Robot controller CR-1 Controller CR-1 – Teaching Pendant

The robot controller has a 64-bit RISC processor and can be programmed
quickly and easily in MELFA BASIC IV.

Robot

TeachBox
Controller CR1

7 8

Joint space – JOINT jog

Adjusts the coordinates


of each axis
independently in angle
units
Robot controlling by means of
TeachBox

Frame Coordinate Systems


(Spaces in which the robot can be controlled )

Cartesian space – XYZ jog Three axes XYZ jog

Adjusts the X, Y, and Z axis


Adjusts the axis coordinates coordinates along the direction
along the direction of the of the robot coordinate system in
robot coordinate system. the same way as in XYZ jog
The X, Y, and Z axis feed.
coordinates are adjusted in
mm units. The J4, J5, and J6 axes are
The A, B, and C axis adjusted independently in the
coordinates are adjusted in same way as in JOINT jog feed.
angle units.
The X, Y, and Z axis coordinates
are adjusted in mm units.
The J4, J5, and J6 axis
coordinates are adjusted in
angle units.

2
TOOL jog CYLINDER jog
Adjusts the coordinates of each axes along the direction of the hand tip. Adjusting the X-axis coordinate
The X, Y, and Z axis coordinates are adjusted in mm units. moves the hand in the radial
The A, B, and C axis coordinates are adjusted in angle units. direction away from the robot's
origin. Adjusting the Y-axis
coordinate rotates the arm
around the J1 axis. Adjusting the
Z-axis coordinate moves the
hand in the Z direction of the
robot coordinate system.

Adjusting coordinates of the A,


B, and C axes moves the hand in
the same way as in XYZ jog feed.

The X and Z axis coordinates are


adjusted in mm units.
The Y, A, B, and C axis
coordinates are adjusted in angle
units

Programming

• Programming by MELFA BASIC IV


using COSIROP/COSIMIR

15

3
Declaration of variables Positions variables
Names for variables of the type position, joint, arithmetic, and character string begin Variables whose names begin with character P are considered position
with a certain character. variables. If it is defined by the DEF POS instruction, it is possible to specify a
name beginning with a character other than P.
The rule is:
It is possible to reference individual coordinate data of position variables.
In this case, add "." and the name of a coordinate axis, e.g. "X," after the
P = Positional variable variable name.
J = Joint variable
P1.X, P1.Y, P1.Z, P1.A, P1.B P1.C, P1.L1, P1.L2
M = Arithmetic variable
The unit of the angular coordinate axes A, B, and C is radians. Use the DEG
C = Character string function to convert it to degrees.

Example)
P1=(110,-227,-148,45,180,0,0)
M1 = P1. X (Unit : mm)
M2 = DEG(P1. A) (Unit : degree)
DEG POS L10
MOV L10

Positional Joints variables


The syntax for position constants is as shown below.
A character string variable should start with J. If it is defined by the DEF JNT
instruction, it is possible to specify a name beginning with a character other than J.
It is possible to reference individual coordinate data of joint variables.
In this case, add "." and the name of a coordinate axis, e.g. "J1," after the variable
name.
JDATA.J1, JDATA.J2, JDATA.J3, JDATA.J4, JDATA.J5, JDATA.J6, JDATA.J7,
JDATA.J8

The unit of the angular coordinate axes A, B, and C is radians. Use the DEG
function to convert it to degrees.

P1 = ( 300, 100, 400, 180, 0, 180, 0, 0 ) ( 7, 0 ) Example)


JSTARAT = ( 10, 30, 90, 0, 90)
JDATA = JSTART
DIM J3 (10)
M1 = J1.J1 (Unit : radian)
M2 = DEG (J1.J2)
DEF JNT K10
MOV K 10

Joint
The syntax for the joint is the following: Programming: MELFA BASIC IV

SYNTAX

10 MOV P1 WTH M_OUT(17)=1

1. 2. 3. 4.
1. - Line Nos. can be any integer from 1 to 32767. One line can have up to 127 characters
2. - Command statement
3. - Command parameter
4. - Appended statement (MOV, MVS, MVR, MVR2, MVR3, MVC)

Example)
6 axis robot J1 = ( 0, 10, 80, 10, 90, 0 )
6 axis + Additional axis J1 = ( 0, 10, 80, 10, 90, 0, 10, 10 )
5 axis robot J1 = ( 0, 10, 80, 0, 90)
5 axis + Additional axis J1 = ( 0, 10, 80, 0, 90, 0, 10, 10 )
24

4
Joint interpolation movement(MOV)

Joint interpolation movement (MOV)


The robot moves with joint axis unit interpolation to the designated position. (The robot
interpolates with a joint axis unit, so the end path is irrelevant.)
MOV - The robot moves to the designated position with joint interpolation. An appended
statement WTH or WTHIF can be designated.

Motion Commands MOV P1 'Moves to P1.

MOV P1+P2 ' Moves to the position obtained by adding the P1 and P2 coordinate elements.

MOV P1,-50 ‘ Moves from P1 to a position retracted 50mm in the hand direction.

MOV P1 WTH M_OUT(17)=1.


' Starts movement toward P1, and simultaneously turns output signal bit 17 ON.

MOV P1 WTHIF M_IN(20)=1,SKIP


'If the input signal bit 20 turns ON during movement to P1, the movement to P1 is stopped,
‘and the program proceeds to the next stop.

10 MOV P1
Program Explanation
‘ (1) Moves to P1 with joint interpolation.
Linear interpolation movement(MVS)
20 MOV P2, -50 ' (2) Moves from P2 to a position retracted 50 mm in the hand
direction The end of the hand is moved with linear interpolation to the designated position.
30 MOV P2 ' (3) Moves to P2 with joint interpolation MVS - The robot moves to the designated position with linear interpolation. An appended
40 MOV P3, -100 WTH M_OUT(17) = 1 ' (4) Starts movement form P3 to a position retracted 100 mm statement WTH or WTHIF can be designated.
in the hand direction and turns ON output signal bit (at
the same time) .
MVS - The robot moves to the designated position with linear interpolation. An appended
50 MOV P3 ' (5) Moves to P3 statement WTH or WTHIF can be designated.
60 MOV P3 ,-100 ' (6) Returns from P3 to a position retracted 100mm in the
Statement example
hand direction
70 END ‘ Ends the program MVS P1. ' Moves to P1

MVS P1+P2 ' Moves to the position obtained by adding the P1 and P2 coordinate elements.

MVS P1,-50 ' Moves from P1 to a position retracted 50mm in the hand direction.

MVS P1 WTH M_OUT(17)=1


' Starts movement toward P1, and simultaneously turns output signal bit 17 ON.

MVS P1 WTHIF M_IN(20)=1,SKIP


' If the input signal bit 20 turns ON during movement to P1, the movement to P1 is stopped,
and ‘ the program proceeds to the next stop.

Program Explanation

10 MVS P1, -50 ‘ (1) Moves with linear interpolation from P1 to a position Circular interpolation movement (MVR)
retracted 50mm in the hand direct.

20 MVS P1 ' (2) Moves to P1 with linear interpolation

30 MVS P1 ,-50 ' (3). Moves with linear interpolation from the current position Circular interpolation movement
(P1) to a position retracted 50 mm in the hand direction
The robot moves along an arc designated with three points using 3D circular
40 MVS P2, -100 WTH M_OUT(17) = 1 ' (4) Outout signal bit 17 is turned on at the same time as the
robot starts moving interpolation. If the current position is separated from the start point when
starting circular movement, the robot will move to the start point with linear
50 MVS P2 ' (5) Moves to P2 with linear interpolation
operation and then begin circular interpolation.
60 MVS P2 ,-100 ' Moves with linear interpolation from the current position (P2)
to a position retracted 100 mm in the hand direction

70 END ‘ Ends the program

5
Command Explanation
MVR3 Designates the start point, end point and center point, and moves the robot with
MVR Designates the start point, transit point and end point, and moves the robot with circular interpolation from the start point to the end point. The fan angle from the
circular interpolation in order of the start point→transit point → end point An start point to the end point is 0 deg. < fan angle < 180 deg. An appended statement
appended statement WTH or WTHIF can be designated WTH or WTHIF can be designated
MVR P1,P2,P3 MVR3 P1, P3, P2
P1 P2
P1

P3
P2 P3
MVC Designates the start point (end point), transit point 1 and transit point 2, and moves
the robot with circular interpolation in order of the start point → transit point 1 →
MVR2 Designates the start point, end point and reference point, and moves the robot with transit point 2 → end point. An appended statement WTH or WTHIF can be
circular interpolation from the start point → end point without passing through the designated.
reference point. An appended statement WTH or WTHIF can be designated
MVC P1,P2,P3
MVR2 P1,P3,P2 P3
P1 P2

P1

P2
P3

Program Explanation
10 MVR P1, P2, P3
WTH M_OUT(18) = 1
‘ (1) Moves between P1 . P2 . P3 as an arc. The robot current position before movement is
separated from the start point, so first the robot will move with linear operation to the start
point. (P1) output signal bit 18 turns ON simultaneously with the start of circular movement.
Motion types: Continuous movement (CNT)
20 MVR P3,P4,P5 ' (2) Moves between P3 . P4 . P5 as an arc.

30 MVR2 P5,P7,P6 ' (3) Moves as an arc over the circumference on which the start point (P5), reference point Continuous movement (CNT)
(P6) and end point (P7) in the direction that the reference point is not passed between the
start point and end point. The robot continuously moves to multiple movement positions without stopping at each
40 MVR3 P7,P9,P8 ' (4) Moves as an arc from the start point to the end point along the circumference on which movement position. The start and end of the continuous movement are designated with the
the center point (P8), start point (P7) and end point (P9) are designated. command statement. The speed can be changed even during continuous movement.

50 MVC P9,P10,P11 ' (5) Moves between P9 . P10 . P11 . P9 as an arc. The robot current position before CNT denotes the start and end of the continuous movement.
movement is separated from the start point, so first the robot will move with linear operation
to the start point.(1 cycle operation) CNT 1 denotes the start and end of the continuous movement.

' Ends the program


CNT 1, 200, 300 - Designates the start of the continuous movement, and designates that the
60 END.
start point neighborhood distance is 200mm, and the end point neighborhood
distance is 300mm
CNT 0 denotes the end of the continuous movement.

Acceleration/deceleration time and speed control

The percentage of the acceleration/deceleration in respect to the maximum


acceleration/deceleration, and the movement speed can be designated.

10 CNT 0 ‘ invalidate continuous movement


ACCEL Designates the acceleration during movement and the deceleration as a
20 MOV P1 ‘ axis interpolation to position 1 percentage (%) in respect to the maximum acceleration/deceleration speed. or
disabled
30 MOV P3 ‘ axis interpolation to position 3 .
40 CNT 1,200,300 ‘ validate continuous movement OVRD Designates the movement speed applied on the entire program as a percentage
(%) in respect to the maximum speed
50 MVS P5 ‘ linear interpolation to position 5
60 CNT 0 ‘ invalidate continuous movement JOVRD Designates the joint interpolation speed as a percentage (%) in respect to the
maximum speed
70 END ‘ program end
SPD Designate the linear and circular interpolation speed with the hand end speed
(mm/s)
OADL This instruction specifies whether the optimum acceleration/deceleration function
should be enabled

6
ACCEL. Sets both the acceleration and deceleration to 100%. SPEED evaluation:
ACCELL 60,80 Sets the acceleration to 60% and the deceleration to 80
50
OVRD 50 Sets the joint interpolation, linear interpolation and circular interpolation to
50% of the maximum speed.
JOVRD 70 Set the joint interpolation operation to 70% of the maximum speed.

SPD 30 Sets the linear interpolation and circular interpolation speed to 30mm/s.

OADL ON This instruction enables the optimum acceleration/deceleration function. For joint interpolated movement

Movement speed during joint interpolation Controller (T/B) setting value ×


OVRD command setting value × JOVRD command setting value.·
10 ACCEL 100,50 ‘ 100 means 100% = 0.2s acceleration;
‘ 50 means 200% = 0.4s deceleration
20 MOV P1 ‘ axis interpolation to position 1 For linear interpolated movement
30 MOV P2 ‘ axis interpolation to position 2
Movement speed during linear and circular interpolation Controller (T/B)
100 %
t= ⋅ 0,2s setting value ×OVRD command setting value × SPD command setting value.
A [%] Where A – ACCEL command’s parameter

Hand control Timer (DLY)

Command Explanation
The program can be delayed by the designated time, and the output
HOPEN x Opens the designated hand x
signal can be output with pulses at a designated time width
HCLOSE x Close the designated hand x
Syntax:
DLY xxx Wait for the xxx seconds for the completion a previous task DLY value where value - time value (from 0.01s)

Ex
100 DLY 1 -’ Waits for only 1 second

110 M_OUT(4)=1 DLY 0.5 – ’Turns on output signal bit 10 for only
Command Explanation 0.5 seconds.
HOPEN 1 Opens hand No1
HOPEN 2 Opens hand No1
120 HOPEN 1
HCLOSE 1 Closes hand No1
130 DLY 0.5 - -’ Waits for only 0.5 seconds

Inputting and outputting external signals


This section explains the general methods for signal control when controlling the robot via
an external device (e.g., PLC)
Input signals
Signals can be retrieved from an external device, such as a programmable logic controller. Example:
The input signal is confirmed with a robot status variable (M_IN(), Input signals
Output signals
M1 = M_IN(18) ‘ M1 will contain the value of the input signal 18 (0 or 1)
Signals can be output to an external device, such as a programmable logic controller. The
signal is output with the robot status variable (M_OUT(), etc.) WAIT M_IN(1)=1 Waits for the input signal bit 1 to turn ON.

Command Describtion
Output signals
M_IN(xx) returns the value of the input signal
M_OUT –writes or references external output signal
M_OUT(xx) writes or references external output signal M_OUT(18) = 1 Turns ON output signal bit 18 .
WAIT Waits for the input signal to reach the designated state CLR 1 Clears based on the output reset pattern.

CLR Clears the general-purpose output signal according to the M_OUT(1)=1 Turns the output signal bit 1 ON.
output signal reset pattern in the parameter

7
'ABSTRACT: The following MELFA BASIC IV program is used to:
'1) Pick up object from location Pos1 and place it to the conveyor (location Pos4)
'ABSTRACT: The '2) Start conveyor
following MELFA BASIC conveyor
'3) Pick up new part from the conveyor
IV program is used to:
'1) Pick up object from
location Pos1 and place it
to the conveyor (location Sensor : Input sig#6
Pos4) Conveyor Sensor; Input sig #7

'2) Start conveyor


'3) Pick up new part from
Pos4
the conveyor

Output singals:
M_OUT(5)= 1
Pos1
M_OUT(4)= 1

110 'object is placed on the conveyor


'ABSTRACT: The following MELFA BASIC IV program is used to: 120 MVS Pos4, -100
'1) Pick up object from location Pos1 and place it to the conveyor (location Pos4) 130 MVS Pos4 ‘object is placed (linear interpolation movement)
'2) Start conveyor 140 DLY 0.5
'3) Pick up new part from the conveyor 150 HOPEN 1 Pos4

160 DLY 0.5


‘ Pick up object from location Pos1 and place it to the conveyor (location Pos4) 170 MVS Pos4,-100
10 Pos1 = (172.95, -354.35,108.92,-48.06,177.55,0,0) 'Position definitions:
20 Pos4 = (1,353.09,101.06,-178.93,179.77,0,0) 180 'conveyor control
30 HOPEN 1 ‘open the gripper ' turn ON external digital output signal No 4 – movement of the conveyor belt (right direction)
40 OVRD 80 ‘relative robot speed 190 M_OUT(4) = 1 DLY 2
Conveyo
r
Sensor; Sensor;
50 'Program start: object is picked up 200 M_OUT(4)= 0 Input sig #6 Input sig #7
Pos4
60 MOV Pos1, -100 ‘move from Pos1 to a position retracted 100 ‘mm in the hand direction 210 DLY 5 Output singals:
M_OUT(5)= 1
70 MOV Pos1 220 WAIT M_IN(7)=1 ‘wait for conveyor signal M_OUT(4)= 1
80 DLY 0.5
Pos1 ' turn ON external digital output signal No 5 – movement of the conveyor belt (left direction)
90 HCLOSE 1 object is picked up 230 M_OUT(5)=1 DLY 2
100 DLY 0.5 240 M_OUT(5)=0
240 WAIT M_IN(6)=1

260 MOV Pos4,-100


270 MOV Pos4 'new object is picked up
280 DLY 0.5
Pos4
290 HCLOSE 1
300 DLY 0.5

310 MOV Pos4, -100

320 MOV Pos1, -100


330 MOV Pos1 'new object is placed
340 DLY 0.5
350 HOPEN 1
360 DLY 0.5
Pos1
370 MOV Pos1,-100
380 DLY 5
390 END

You might also like