;//O9933...Track pocket by Yi-Wan LIN 10/09/1998 #1=#5; IF (#13==#0) GOTO 10; @81=#13; N10 #6=ABS(#6); #6=FIX(#6); @91=ABS(@91); @91=FIX(@91); IF(#6>0) GOTO 50; IF (@91<=0) GOTO 9052; #6=@91; //use default feed rate N50 F#6; //--------#6 FROM HERE HAS ANOTHER MEANS----------------- @1=#6; #21=ABS(#21); IF (#21 >0.5) GOTO 60; #21=2; // U=0..G02 GOTO 61; N60 #21=3; // U=1..G03 ; ;//--------------------------------- N61 IF(@90<#26) GOTO 9055; //@90 must large then #26 #4=ABS(#4); #8=ABS(#8); IF(#4==0) GOTO 9053; IF(#8==0) GOTO 9054; IF(#4 <= #8) GOTO 70; #4=#8; ; //-------------------------------------------------------- N70 IF ( #20 != #0 ) GOTO 75; // 87.10.7 ADDED ..'T' argument #20=@92; N75 #20=ABS(#20); // Phi must + // REPLACE ALL @92 TO #20 BEGIN HERE #18=ABS(#18); // R must + #22=ABS(#22); // V must + IF( #20==0 ) GOTO 9050; IF( (#18-#22) < (#20/2) ) GOTO 9081; #6=SQRT( (#24-#9)*(#24-#9)+(#25-#10)*(#25-#10) )/2; IF( #6<=0 ) GOTO 9080; //#6:distance(p1,p2)/2 IF( #22 >#20 ) GOTO 9072; IF( @81<1 || @81>2) GOTO 9999; #11=#8/#4;;//-----cal. cut-down counts-------------------------------- IF( (#11-FIX(#11))==0) GOTO 80; #11=#11+1; #11=FIX(#11); // #11:-z Feed count N80 IF( @81==2 )GOTO 200; // finish machining skip 'W' process IF( (#18-#22) <= (#20/2) ) GOTO 9082;// @81=1 there have 'W' process #23=ABS(#23); //W @93=ABS(@93); //percent of tool Dia. IF( #23>0 ) GOTO 100; #23=#20*@93*0.01; //XY PLANE CUTTING dw(#23) IF( #23==0 ) GOTO 9056; N100 IF( #23<=#20 ) GOTO 110; #23=#20; // Maximum W=#20 to prevent W>phi ; N110 #5=#18-#22-(#20/2); //#5:machining length.;//------------------------- IF( #5<=0 ) GOTO 9082; @94=ABS(@94); IF(@94<0.5) GOTO 130; #33= #5 /#23; IF( (#33-FIX(#33))==0) GOTO 130; #33=#33+1; #33=FIX(#33); #23=#5/#33; // wanna constant cutting!! ; N130 IF(#23 <= #5 ) GOTO 140; #23=#5; // #23 can't large than work length. N140 #2=#5/#23;;//-----CAL cut-xy counts --------------------------------- IF( (#2-FIX(#2))==0) GOTO 200; #2=#2+1; #2=FIX(#2); N200 #19=FIX(#19);;//-----Spindle running----------------------------------- @95=FIX(@95); IF(#19==#0) GOTO 210; @95=#19; IF (@95==0) GOTO 9051; N210 IF (@95>0) GOTO 220; IF (@95==0) GOTO 9051; M04S-@95; M08; GOTO 221; N220 M03S@95; M08; N221 #16=(#24+#9)/2; //Center of p1p2.X; ------------------------------- #17=(#25+#10)/2; //Center of p1p2.Y #31=#9-#24; // delta.X #32=#10-#25; // delta.Y #7=ATAN(#32,#31); G68G90X#16Y#17R#7; // Coord. rotation. IF(@81==1) GOTO 300; // rough IF(@81==2) GOTO 600; // finish GOTO 9999; N300 G90G00Z@90;;//-----LOOP for rough machining.--- @81=1 --------- G90G00X#16Y#17; G90G00Z#26; #12=1; //Loop Z-cut .....for(#12=1;#12<=#11;#12++) N310 IF( #12 > #11) GOTO 360; G90G00X#16Y#17; IF(#12!=#11) GOTO 315; #31=#26-#8; GOTO 316; N315 #31=#26-(#12*#4); ; N316 G90G01Z#31F#1; F@1; G91G01X-#6; // G91G01X#6; // initial movement G91G01X#6; // G91G01X-#6; #3=1; // Loop of x-y cut ;//------------------------------------ N330 IF(#3 > #2 ) GOTO 350; IF(#3!=#2) GOTO 335; #13=#5; GOTO 336; N335 #13=#3*#23; N336 #33=#17+#13; #32=2*#13; G90G01Y#33; IF(#21==3) GOTO 340; ;//---CW Direction:G02 -------- G91G01X#6; G02Y-#32R#13; G01X-#6; G01X-#6; G02Y#32R#13; G91G01X#6; GOTO 341; ;//---CCW Direction:G03 --------- N340 G91G01X-#6; G03Y-#32R#13; G01X#6; G01X#6; G03Y#32R#13; G91G01X-#6; ; N341 #3=#3+1; // #3.. A counter ;//------------------------------ GOTO 330; // that point out what x-y path be cutting. N350 #12=#12+1; // Eof x-y cut LOOP ;//---------------------------------- GOTO 310; N360 GOTO 9999;//Eof of Z_cut----LOOP:finish machining(@81=2)With soft move- N600 IF( #22 > (#20/2) ) GOTO 700; //check if sofe-move wanted IF( (2*#18) < (1.5*#20+#22) ) GOTO 700; IF(#21==3) GOTO 610; #14=#16-#20/2; //G02..soft Entry point.x #15=#17+(#18-#20); //G02..soft Entry point.y GOTO 611; N610 #14=#16+#20/2; //G03..soft Entry point.x #15=#17+(#18-#20); //G03..soft Entry point.y ; N611 G90G00Z@90; G90G00X#14Y#15; G90G00Z#26; #30=#20/2; // soft_in radius=1/2 phi #28=#18-#20/2; //..radius of machining. #29=2*#28; //.. #12=1;;//------Loop of Z_cut------- N620 IF(#12 > #11) GOTO 650; IF(#12!=#11) GOTO 630; #31=#26-#8; GOTO 631; N630 #31=#26-(#12*#4); N631 IF(#21==3) GOTO 640; G90G01X#14Y#15; //use G01 for safe G90G01Z#31F#1; F@1; G91G02X#30Y#30R#30; //soft_in G01X#6; G02Y-#29R#28; G01X-#6; G01X-#6; G02Y#29R#28; G01X#6; G91G02X#30Y-#30R#30; //soft_out GOTO 641; N640 G90G01X#14Y#15; //use G01 for safe G90G01Z#31F#1; F@1; G91G03X-#30Y#30R#30; //soft_in G01X-#6; G03Y-#29R#28; G01X#6; G01X#6; G03Y#29R#28; G01X-#6; G91G03X-#30Y-#30R#30; //soft_out N641 #12=#12+1; GOTO 620; N650 IF(@96 == 1) GOTO 651; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N651 G90G00X#16Y#17; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N700 G90G00Z@90;//--LOOP for finish machining. @81=2 Without soft move-- G90G00X#16Y#17; G90G00Z#26; #30=#20/2; // soft_in radius=1/2 phi #28=#18-#20/2; //..radius of machining. #29=2*#28; // #27=#17+#28; // Entry point.Y #12=1;;//------Loop of Z_cut------- N720 IF(#12 > #11) GOTO 750; IF(#12!=#11) GOTO 730; #31=#26-#8; GOTO 731; N730 #31=#26-(#12*#4); ; N731 IF(#21==3) GOTO 740; G90G00X#16Y#17; // Center of workpice G90G01Z#31F#1; F@1; G90G01X#16Y#27; G91G01X#6; G02Y-#29R#28; G01X-#6; G01X-#6; G02Y#29R#28; G01X#6; GOTO 741; N740 G90G01X#16Y#17; // Center of workpice G90G01Z#31F#1; F@1; G90G01X#16Y#27; G91G01X-#6; G03Y-#29R#28; G01X#6; G01X#6; G03Y#29R#28; G01X-#6; ; N741 #12=#12+1; GOTO 720; N750 IF (@96 == 1) GOTO 751; G90G00Z#26; //------Eof Z-cut LOOP------- GOTO 9999; N751 G90G00X#16Y#17; G90G00Z#26; //------Eof Z-cut LOOP------- GOTO 9999; N9999 IF (@96 == 1) GOTO 99991; G90G00Z@90; GOTO 99992; N99991 G90G00X#16Y#17; G90G00Z@90;//======================================================== ;; M5; //Turn-OFF spindle and coolant ;; M9; ;; G90G00X#16Y#17; N99992 G69; M99; ;//---------------------------------------------------------------------------- N8888 ;//Program done with wrong argument given ;; M5; //stop spindle and coolant ;; M9; G69; M99; ;//---------------------------------------------------------------------------- N9050 $599=50; N9051 $599=51; N9052 $599=52; N9053 $599=53; N9054 $599=54; N9055 $599=55; N9056 $599=56; N9072 $599=72; N9080 $599=80; N9081 $599=81; N9082 $599=82; GOTO 8888; ;//-------------------------------------------------------- ;// Track pocket cutting ;// FORMAT : @90 ---> ESCAPE Z AXIS DATA ;// @91 ---> FEEDRATE ;// @92 ---> TOOL DIAMETER ;// @93 ---> CUT WIDTH % ;// @94 ---> CONSTANT CUT WIDTH ;// @95 ---> SPINDLE SPEED (100%) ;// @96 ---> RETURN PATH SELECTION ;// @81 ---> 1)ROUGH_INNER 2)FINISH_INNER ;// Soft_IN RAD=@92/2 ;// X(#24): X coord. of reference point1.X ;// Y(#25): Y coord. of reference point1.Y ;// I(#24): X coord. of reference point2.X ;// J(#25): Y coord. of reference point2.Y ;// Z(#26): The top surface of the work piece ;// R(#18): radius of corner ;// T(#20): @92(low priority),TOOL DIA ;// W(#23): the cut width of each movement in xy plane ;// U(#21): cutting direction 0:G02 1:G03 ;// V(#22): finish cutting allowance ;// H( #8): total Cut Depth ;// D( #4): the cut depth of each -Z advance ;// F( #6): feedrate ;//-------------------------------------------------------------------