Mitsubishi MELFA CR1D Instruction Manual page 115

Table of Contents

Advertisement

•Program example 2
Correction when posture components are close to +/-180 degrees
1 If Deg(P2.C)<0 Then GoTo *MINUS
2 If Deg(P3.C)<-178 Then P3.C=P3.C+Rad(+360)
3 If Deg(P4.C)<-178 Then P4.C=P4.C+Rad(+360)
4 If Deg(P5.C)<-178 Then P5.C=P5.C+Rad(+360)
5 GoTo *DEFINE
6 *MINUS
7 If Deg(P3.C)<+178 Then P3.C=P3.C-Rad(+360)
8 If Deg(P4.C)<+178 Then P4.C=P4.C-Rad(+360)
9 If Deg(P5.C)<+178 Then P5.C=P5.C-Rad(+360)
10 *DEFINE
11 Def Plt 1, P2, P3, P4, P5, 3, 5, 2
12 M1=1
13 *LOOP
14 Mov P1, -50 *1)
15 Ovrd 50
16 Mvs P1
17 HClose 1
18 Dly 0.5
19 Ovrd 100
20 Mvs , -50 *1)
21 P10=(Plt1,M1)
22 Mov P10, -50 *1)
23 Ovrd 50
24 Mvs P10
25 HOpen 1
26 Dly 0.5
27 Ovrd 100
28 Mvs , -50
29 M1=M1+1
30 If M1<=15 Then *LOOP
31 End
Program
Explanation
'Checks the sign of the posture component (C) of P2 and, if it is -
(negative), jump to the label MINUS line.
'If the posture component (C) of P3 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
'If the posture component (C) of P4 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
'If the posture component (C) of P5 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
'Jumps unconditionally to the label DEFINE line.
'Specifies the label MINUS line as the jump destination.
'If the posture component (C) of P3 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
'If the posture component (C) of P4 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
'If the posture component (C) of P5 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
'Specifies the label DEFINE line as the jump destination.
'Defines the pallet. Pallet No. = 1, start point = P2, end point A =
P3, end point B = P4, diagonal point = P5, quantity A = 3,
quantity B = 5, pallet pattern = 2 (Same direction).
'Substitutes value 1 in numeric variable M1. (M1 is used as a
counter.
'Designates label LOOP at the jump destination.
'Moves with joint interpolation from P1 to a position retracted
50mm in hand direction.
'Sets movement speed to half of the maximum speed.
'Moves linearly to P1. (Goes to grasp workpiece.)
'Closes hand 1. (Grasps workpiece.)
'Waits 0.5 seconds.
'Sets movement speed to maximum speed.
'Moves linearly from current position (P1) to a position retracted
50mm in hand direction. (Lifts up workpiece.)
'Operates the position in pallet No. 1 indicated by the numeric
variable M1, and substitutes the results in P10.
'Moves with joint interpolation from P10 to a position retracted
50mm in hand direction.
'Sets movement speed to half of the maximum speed.
'Moves linearly to P10. (Goes to place workpiece.)
'Opens hand 1. (Places workpiece.)
'Waits 0.5 seconds.
'Sets movement speed to maximum speed.
'Moves linearly from current position (P10) to a position retracted
50mm in hand direction. (Separates from workpiece.)
'Increments numeric variable M1 by 1. (Advances the pallet
counter.)
'If numeric variable M1 value is less than 15, jumps to label
LOOP and repeat process. If more than 15, goes to next step.
'Ends the program.
MELFA-BASIC V functions 4-102
4MELFA-BASIC V

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents