Sure. UTOOL1 is the master tool, and UTOOL2 is the shifted tool, from master.
UFRAME5 is a frame taught in the center of the switch.
The speed you do the search at will impact how accurate the shifted tool is.
The code is slightly different than what I described, as it does 5 searchs, as in roboguide the collision input tends to fliker. Got around it by searching for rising edges only.
/PROG TCP_SET
/ATTR
OWNER = MNEDITOR;
COMMENT = "";
PROG_SIZE = 1430;
CREATE = DATE 22-12-15 TIME 11:09:40;
MODIFIED = DATE 22-12-15 TIME 11:09:40;
FILE_NAME = ;
VERSION = 0;
LINE_COUNT = 30;
MEMORY_SIZE = 1814;
PROTECT = READ_WRITE;
TCD: STACK_SIZE = 0,
TASK_PRIORITY = 50,
TIME_SLICE = 0,
BUSY_LAMP_OFF = 0,
ABORT_REQUEST = 0,
PAUSE_REQUEST = 0;
DEFAULT_GROUP = 1,*,*,*,*;
CONTROL_CODE = 00000000 00000000;
/APPL
/MN
1: UFRAME_NUM=5 ;
2: UTOOL_NUM=1 ;
3:J P[1] 10% FINE ;
4: !Laser Switch. Normally off if no ;
5: SKIP CONDITION DI[10]=ON ;
6: !X direction search ;
7:L P[2] 5mm/sec FINE Skip,LBL[100],PR[20]=LPOS ;
8:L P[2] 100mm/sec FINE ;
9: !Other side of tool, in X ;
10:L P[1] 5mm/sec FINE Skip,LBL[100],PR[21]=LPOS ;
11:L P[1] 100mm/sec FINE ;
12:J P[3] 10% FINE ;
13: !Y direction search ;
14:L P[4] 5mm/sec FINE Skip,LBL[100],PR[22]=LPOS ;
15:L P[4] 100mm/sec FINE ;
16: !Other side of tool, in Y ;
17:L P[3] 5mm/sec FINE Skip,LBL[100],PR[23]=LPOS ;
18: !Calculate the delta from the mas ;
19: R[20:Tool X Shift]=((PR[21,2]+PR[20,2])/2) ;
20: R[21:Tool Y Shift]=((PR[23,2]+PR[22,2])/2) ;
21: PR[25]=UTOOL[1:Master TCP] ;
22: PR[25,1]=(PR[25,1]-R[20:Tool X Shift]) ;
23: PR[25,2]=(PR[25,2]-R[21:Tool Y Shift]) ;
24: UTOOL[2:Shifted TCP]=PR[25] ;
25: UTOOL_NUM=2 ;
26:L P[5] 100mm/sec FINE ;
27: !Do Z search in the shifted TCP. ;
28:L P[6] 2mm/sec FINE Skip,LBL[100],PR[24]=LPOS ;
29: PR[25,3]=(PR[25,3]+PR[24,3]) ;
30: UTOOL[2:Shifted TCP]=PR[25] ;
/POS
P[1]{
GP1:
UF : 5, UT : 1, CONFIG : 'L, 0, 0, 0',
X = 0.000 mm, Y = -10.000 mm, Z = -15.000 mm,
W = 180.000 deg, P = 0.000 deg, R = 90.000 deg
};
P[2]{
GP1:
UF : 5, UT : 1, CONFIG : 'L, 0, 0, 0',
X = 0.000 mm, Y = 10.000 mm, Z = -15.000 mm,
W = 180.000 deg, P = 0.000 deg, R = 90.000 deg
};
P[3]{
GP1:
UF : 5, UT : 1, CONFIG : 'L, 0, 0, 1',
X = 0.000 mm, Y = -10.000 mm, Z = -15.000 mm,
W = 180.000 deg, P = 0.000 deg, R = 180.000 deg
};
P[4]{
GP1:
UF : 5, UT : 1, CONFIG : 'L, 0, 0, 0',
X = 0.000 mm, Y = 10.000 mm, Z = -15.000 mm,
W = 180.000 deg, P = 0.000 deg, R = -180.000 deg
};
P[5]{
GP1:
UF : 5, UT : 2, CONFIG : 'L, 0, 0, 1',
X = 0.000 mm, Y = 0.000 mm, Z = 10.000 mm,
W = 180.000 deg, P = 0.000 deg, R = -180.000 deg
};
P[6]{
GP1:
UF : 5, UT : 2, CONFIG : 'L, 0, 0, 1',
X = 0.000 mm, Y = 0.000 mm, Z = -15.000 mm,
W = 180.000 deg, P = 0.000 deg, R = -180.000 deg
};
/END
Display More