发那科机器人程序例子,双机器人铣削;PNS0001-qq
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
?/PROG PNS0001
/ATTR
OWNER = MNEDITOR;
COMMENT = "MAIN PROGRAM";
PROG_SIZE = 4177;
CREATE = DATE 13-02-19 TIME 20:28:44;
MODIFIED = DATE 13-08-21 TIME 13:27:22;
FILE_NAME = PNS00021;
VERSION = 0;
LINE_COUNT = 167;
MEMORY_SIZE = 4709;
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: !******************************** ;
2: ! MAIN PROGRAM ;
3: !******************************** ;
4: ! PNS0001 PROGRAM ;
5: !******************************** ;
6: ;
7: UTOOL_NUM=1 ;
8: UFRAME_NUM=0 ;
9: ;
10: !******************************** ;
11: ! SET UP START ;
12: !******************************** ;
13: ;
14: !Machine Number? ;
15: R[50:*Machine Select]=1 ;
16: ;
17: !How many position? ;
18: R[51:*Number of POS]=6 ;
19: ;
20: IF R[10:*Teach Mode (-1)]<>(-1),JMP LBL[10] ;
21: IF UO[8:TP enabled]=OFF,JMP LBL[10] ;
22: ;
23: OVERRIDE=10% ;
24:J P[1:DEPART] 50% FINE ;
25:J P[2:POUNCE] 50% FINE ;
26:J P[3:APPROUCH] 50% FINE ;
27:J P[4:STROVE SENS POS] 50% FINE ;
28:J P[13:APPROUCH] 50% FINE ;
29:J P[5:1st POS] 50% FINE ;
30:J P[6:2nd POS] 50% FINE ;
31:J P[7:3rd POS] 50% FINE ;
32:J P[8:4th POS] 50% FINE ;
33:J P[9:5th POS] 50% FINE ;
34:J P[10:6th POS] 50% FINE ;
35:J P[11:7th POS] 50% FINE ;
36:J P[12:8th POS] 50% FINE ;
37: ;
38:J P[3:APPROUCH] 50% FINE ;
39:J P[2:POUNCE] 50% FINE ;
40:J P[15:DEPART] 50% FINE ;
41:J PR[1:HOME POSITION] 50% FINE ;
42: ABORT ;
43: ;
44: !******************************** ;
45: ! SET UP END ;
46: !******************************** ;
47: LBL[10] ;
48: ;
49: UTOOL_NUM=1 ;
50: UFRAME_NUM=0 ;
51: ;
52: R[53:Last POS SPD CAL]=R[50:*Machine Select]*10 ;
53: ;
54: R[52:Last POS SPD]=R[51:*Number of POS]+R[53:Last POS SPD CAL]-1 ;
55: R[54:Last POS SEL]=R[51:*Number of POS]+90-1 ;
56: ;
57: R[81:1-2 SP SEL]=R[53:Last POS SPD CAL]+1 ;
58: R[82:2-3 SP SEL]=R[53:Last POS SPD CAL]+2 ;
59: R[83:3-4 SP SEL]=R[53:Last POS SPD CAL]+3 ;
60: R[84:4-5 SP SEL]=R[53:Last POS SPD CAL]+4 ;
61: R[85:5-6 SP SEL]=R[53:Last POS SPD CAL]+5 ;
62: R[86:6-7 SP SEL]=R[53:Last POS SPD CAL]+6 ;
63: R[87:7-8 SP SEL]=R[53:Last POS SPD CAL]+7 ;
64: ;
65: OVERRIDE=R[18:*OUTPOS*OVERRIDE] ;
66: ;
67: IF (UO[8:TP enabled]=ON),$MCR.$GENOVERRIDE=(20) ;
68: ;
69: R[91:1-2 SP CAL]=R[R[81]] ;
70: IF R[51:*Number of POS]<3,JMP LBL[20] ;
71: R[92:2-3 SP CAL]=R[R[82]] ;
72: IF R[51:*Number of POS]<4,JMP LBL[20] ;
73: R[93:3-4 SP CAL]=R[R[83]] ;
74:
IF R[51:*Number of POS]<5,JMP LBL[20] ;
75: R[94:4-5 SP CAL]=R[R[84]] ;
76: IF R[51:*Number of POS]<6,JMP LBL[20] ;
77: R[95:5-6 SP CAL]=R[R[85]] ;
78: IF R[51:*Number of POS]<7,JMP LBL[20] ;
79: R[96:6-7 SP CAL]=R[R[86]] ;
80: IF R[51:*Number of POS]<8,JMP LBL[20] ;
81: R[97:7-8 SP CAL]=R[R[87]] ;
82: IF R[51:*Number of POS]<9,JMP LBL[20] ;
83: ;
84: LBL[20] ;
85: //R[R[54]]=R[R[52]]-.39 ;
86: R[91:1-2 SP CAL]=R[91:1-2 SP CAL]*1000 ;
87: R[92:2-3 SP CAL]=R[92:2-3 SP CAL]*1000 ;
88: R[93:3-4 SP CAL]=R[93:3-4 SP CAL]*1000 ;
89: R[94:4-5 SP CAL]=R[94:4-5 SP CAL]*1000 ;
90: R[95:5-6 SP CAL]=R[95:5-6 SP CAL]*1000 ;
91: R[96:6-7 SP CAL]=R[96:6-7 SP CAL]*1000 ;
92: R[97:7-8 SP CAL]=R[97:7-8 SP CAL]*1000 ;
93: ;
94: COL GUARD ADJUST R[8] ;
95: CALL CHG_CNT(R[51:*Number of POS]) ;
96: ;
97:J PR[1:HOME POSITION] 100% FINE ;
98:J P[1:DEPART] 80% CNT20 ;
99: WAIT DI[4:First Interlock]=ON ;
100: DO[4:First Interlock]=OFF ;
101: ;
102:J P[2:POUNCE] 100% CNT50 ;
103:J P[3:APPROUCH] 100% CNT30 ;
104:L P[4:STROVE SENS POS] 1500mm/sec FINE ;
105: WAIT 1.00(sec) ;
106: IF DI[8:NO.1 SENS OK ]<>ON,JMP LBL[999] ;
107:L P[3:APPROUCH] 2000mm/sec CNT30 ;
108: OVERRIDE=R[7:MOLD*IN*OVERRIDE] ;
109: ;
110:L P[5:1st POS] 2000mm/sec FINE TA R[40]sec,DO[1:POSITION COMP.]=ON ACC150 ;
111: TIMER[1]=RESET ;
112: TIMER[1]=START ;
113: WAIT .30(sec) ;
114:L P[6:2nd POS] R[91:1-2 SP CAL]msec CNT100 ACC150 ;
115:L P[7:3rd POS] R[92:2-3 SP CAL]msec CNT R[41:3rd CNT] ACC150 ;
116: IF R[51:*Number of POS]=3,JMP LBL[100] ;
117:L P[8:4th POS] R[93:3-4 SP CAL]msec CNT R[42:4th CNT] ACC150 ;
118: IF R[51:*Number of POS]=4,JMP LBL[100] ;
119:L P[9:5th POS] R[94:4-5 SP CAL]msec CNT R[43:5th CNT] ACC150 ;
120: IF R[51:*Number of POS]=5,JMP LBL[100] ;
121:L P[10:6th POS] R[95:5-6 SP CAL]msec CNT R[44:6th CNT] ACC150 ;
122: IF R[51:*Number of POS]=6,JMP LBL[100] ;
123:L P[11:7th POS] R[96:6-7 SP CAL]msec CNT R[45:7th CNT] ACC150 ;
124: IF R[51:*Number of POS]=7,JMP LBL[100] ;
125: ;
126: LBL[100] ;
127: TIMER[1]=STOP ;
128: R[1:Shot Time(sec)]=TIMER[1] ;
129: WAIT DI[1:Shot complete]=ON ;
130: WAIT R[39] ;
131: ;
132: OVERRIDE=100% ;
133: ;
134:J P[2:POUNCE] 100% CNT100 ACC150 ;
135:J P[1:DEPART] 100% CNT100 ACC150 ;
136: DO[4:First Interlock]=ON ;
137: ;
138: OVERRIDE=R[18:*OUTPOS*OVERRIDE] ;
139: ;
140:J P[17:TURN] 70% CNT50 ;
141: ;
142: CALL ATCLEAN ;
143: ;
144: LBL[900] ;
145: DO[1:POSITION COMP.]=OFF ;
146:J PR[1:HOME POSITION] 100% FINE ;
147: DO[7:Work Comp.]=PULSE,1.0sec ;
148: ;
149: END ;
150: ;
151: !******************************** ;
152: ! GO TO HOME ;
153: !******************************** ;
154: ! MOVING TO HOME
POSITION ;
155: !******************************** ;
156: LBL[999] ;
157: OVERRIDE=100% ;
158: ;
159: UFRAME_NUM=0 ;
160: UTOOL_NUM=1 ;
161: ;
162:L P[3:APPROUCH] 1500mm/sec CNT25 ;
163:J P[2:POUNCE] 100% CNT50 ACC150 ;
164:J P[1:DEPART] 100% CNT100 ACC150 ;
165: CALL A_HOME ;
166: DO[7:Work Comp.]=PULSE,1.0sec ;
167: END ;
/POS
P[1:"DEPART"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 68.703 mm, Y = -1590.715 mm, Z = 566.008 mm,
W = 7.209 deg, P = -87.625 deg, R = 83.310 deg
};
P[2:"POUNCE"]{
GP1:
UF : 0, UT : 1,
J1= -83.960 deg, J2= -5.940 deg, J3= -9.617 deg,
J4= -3.916 deg, J5= 9.631 deg, J6= 4.539 deg
};
P[3:"APPROUCH"]{
GP1:
UF : 0, UT : 1,
J1= -79.848 deg, J2= 15.668 deg, J3= -13.821 deg,
J4= -.306 deg, J5= 12.803 deg, J6= .768 deg
};
P[4:"STROVE SENS POS"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 439.568 mm, Y = -2987.723 mm, Z = 513.965 mm,
W = -1.733 deg, P = -78.591 deg, R = 99.471 deg
};
P[5:"1st POS"]{
GP1:
UF : 0, UT : 1,
J1= -104.987 deg, J2= 15.066 deg, J3= -19.895 deg,
J4= 6.527 deg, J5= 18.991 deg, J6= -5.666 deg
};
P[6:"2nd POS"]{
GP1:
UF : 0, UT : 1,
J1= -101.321 deg, J2= 26.060 deg, J3= -16.497 deg,
J4= -5.773 deg, J5= 15.554 deg, J6= 6.006 deg
};
P[7:"3rd POS"]{
GP1:
UF : 0, UT : 1,
J1= -94.448 deg, J2= 26.061 deg, J3= -16.149 deg,
J4= -27.781 deg, J5= 18.305 deg, J6= 26.892 deg
};
P[8:"4th POS"]{
GP1:
UF : 0, UT : 1,
J1= -87.646 deg, J2= 27.081 deg, J3= -15.453 deg,
J4= -47.570 deg, J5= 20.834 deg, J6= 45.830 deg
};
P[9:"5th POS"]{
GP1:
UF : 0, UT : 1,
J1= -82.131 deg, J2= 27.403 deg, J3= -15.464 deg,
J4= -56.134 deg, J5= 25.235 deg, J6= 53.513 deg
};
P[10:"6th POS"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 556.774 mm, Y = -2890.023 mm, Z = 440.785 mm,
W = 155.160 deg, P = -88.880 deg, R = -77.026 deg
};
P[11:"7th POS"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 525.381 mm, Y = -2850.896 mm, Z = 440.785 mm,
W = 155.162 deg, P = -88.880 deg, R = -78.025 deg
};
P[12:"8th POS"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 584.623 mm, Y = -2763.819 mm, Z = 394.983 mm,
W = 176.924 deg, P = -81.197 deg, R = -99.819 deg
};
P[13:"APPROUCH"]{
GP1:
UF : 0, UT : 1,
J1= -79.848 deg, J2= 15.668 deg, J3= -13.821 deg,
J4= -.306 deg, J5= 12.803 deg, J6= .768 deg
};
P[15:"DEPART"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 68.703 mm, Y = -1590.716 mm, Z = 566.008 mm,
W = 7.209 deg, P = -87.625 deg, R = 83.310 deg
};
P[17:"TURN"]{
GP1:
UF : 0, UT : 1, CONFIG : 'F U T, 0, 0, 0',
X = 1351.614 mm, Y = -953.598 mm, Z = 443.
475 mm,
W = 14.943 deg, P = -88.964 deg, R = 127.919 deg
};
/END