;//.Rectangle pocket (fillet)...O9932 Yi-Wan LIN 10/09/1998 ;//-Note:This files large than 14k so DNC size must also large '14' @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 BEGIN HERE HAS ANOTHER MEANS------------------- @2=#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; ; ;//-----cal. cut-down counts------------------------ N70 #11=#8/#4; IF( (#11-FIX(#11))==0) GOTO 80; #11=#11+1; #11=FIX(#11); // #11:-z Feed count ; ;; --- Phi must + ;//-----total limitation check------ N80 IF ( #20 != #0 ) GOTO 82; // 87.10.7 ADDED ..'T' argument #20=@92; N82 #20=ABS(#20); // Phi must + // REPLACE ALL @92 TO #20 BEGIN HERE #18=ABS(#18); // R must + #9=ABS(#9); // I must + #10=ABS(#10); // J must + #22=ABS(#22); // V must + IF( #20==0 ) GOTO 9050; IF( #18 >= (#20/2) ) GOTO 85; #18=#20/2; N85 IF( #9 <=(2*#18) ) GOTO 9077; IF( #10 <=(2*#18) ) GOTO 9077; IF( #22 >#20 ) GOTO 9072; IF( @81<1 || @81>2) GOTO 9999; ;//-individual limitation check-@81=2 IF( @81!=2 ) GOTO 90; // below is FINISH MACHINING.. @81=2 IF( (#9<=#20) || (#10<=#20) ) GOTO 9999; // below is 'finish' check!! ;;IF( #9 <= (2*#22) ) GOTO 9999; // 'I' must >2v ;;IF( #10 <= (2*#22) ) GOTO 9999; // 'J' must >2v IF( (#9-(2*#22)) < #20 ) GOTO 9079; //must fit:I-2V>=phi IF( (#10-(2*#22)) < #20 ) GOTO 9079; //must fit:J-2V>=phi GOTO 200; // finish machining skip 'W' process N90 IF( (#9/2-#22)<= (#20/2)|| (#10/2-#22)<= (#20/2) ) GOTO 9083; #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 IF(#9>=#10) GOTO 115; #30=(#9/2)-#22-(#20/2); //#30:machining length GOTO 116; N115 #30=(#10/2)-#22-(#20/2); ; N116 @94=ABS(@94); IF(@94<0.5) GOTO 130; #33= #30 /#23; IF( (#33-FIX(#33))==0) GOTO 130; #33=#33+1; #33=FIX(#33); #23=#30/#33; // wanna constant cutting!! ; N130 IF(#23 <= #30 ) GOTO 140; #23=#30; // let #23 can't large than work length. ; N140 #2=#30/#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 G68G90X#24Y#25R#1; // Coord. rotation. IF(@81==1) GOTO 300; // rough IF(@81==2) GOTO 600; // finish GOTO 9999; N300 IF(#9 < #10) GOTO 400;//--LOOP for rough machining.--- @81=1 & I>=J - #27=#24+#9/2; #28=#25+#10/2; //(#27,#28) workpiece.CEN #14=ABS(#9-#10)/2; //initial movement.x #15=0; //initial movement.y #7=#30-#18+#22; //Critical length G90G00Z@90; G90G00X#27Y#28; G90G00Z#26; #12=1; //Loop Z-cut .....for(#12=1;#12<=#11;#12++) N310 IF( #12 > #11) GOTO 360; G90G00X#27Y#28; IF(#12!=#11) GOTO 315; #31=#26-#8; GOTO 316; N315 #31=#26-(#12*#4); N316 G90G01Z#31F@1; F@2; G91G01X-#14; // G91G01X#14; // initial movement G91G01X#14; // G91G01X-#14; // ;//-------------------------------------- #3=1; // Loop of x-y cut N330 IF(#3 > #2 ) GOTO 350; IF(#3!=#2) GOTO 335; #29=#30; GOTO 336; N335 #29=#3*#23; N336 IF( (#29-#7-#20/2) >0 ) GOTO 337; //check radius machining need ? #6=0; // G02,G03 Radius #16=#14+#29; // present work length.x #17=#15+#29; // present work length.y GOTO 338; N337 #6=#29-#7-(#20/2); // G02,G03 Radius #16=#9/2-#18; // present work length.x #17=#10/2-#18; // present work length.y N338 ; #33=#28+#29; G90G01Y#33; ;//---CW Direction:G02 -------- IF(#21==3) GOTO 340; G91G01X#16; G02X#6Y-#6R#6; G01Y-#17; G01Y-#17; G02X-#6Y-#6R#6; G01X-#16; G01X-#16; G02X-#6Y#6R#6; G01Y#17; G01Y#17; G02X#6Y#6R#6; G91G01X#16; GOTO 341; N340 G91G01X-#16; ;//---CCW Direction:G03 --------- G03X-#6Y-#6R#6; G01Y-#17; G01Y-#17; G03X#6Y-#6R#6; G01X#16; G01X#16; G03X#6Y#6R#6; G01Y#17; G01Y#17; G03X-#6Y#6R#6; G91G01X-#16; ; 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 ; //Eof of Z_cut GOTO 9999; N400 #27=#24+#9/2; //=====LOOP for rough machining.--- @81=1 & I #11) GOTO 460; G90G00X#27Y#28; IF(#12!=#11) GOTO 415; #31=#26-#8; GOTO 416; N415 #31=#26-(#12*#4); ; N416 G90G01Z#31F@1; F@2; G91G01Y-#15; // G91G01Y#15; // initial movement G91G01Y#15; // G91G01Y-#15; // ;-------------------------------------- #3=1; // Loop of x-y cut N430 IF(#3 > #2 ) GOTO 450; IF(#3!=#2) GOTO 435; #29=#30; GOTO 436; N435 #29=#3*#23; //below check if radius machining need or not N436 IF( (#29-#7-#20/2) >0 ) GOTO 437; #6=0; // G02,G03 Radius #16=#14+#29; // present work length.x #17=#15+#29; // present work length.y GOTO 438; N437 #6=#29-#7-(#20/2); // G02,G03 Radius #16=#9/2-#18; // present work length.x #17=#10/2-#18; // present work length.y ; N438 #33=#27+#29; G90G01X#33; IF(#21==3) GOTO 440;;//---CW Direction:G02 -------- G91G01Y-#17; G02X-#6Y-#6R#6; G01X-#16; G01X-#16; G02X-#6Y#6R#6; G01Y#17; G01Y#17; G02X#6Y#6R#6; G01X#16; G01X#16; G02X#6Y-#6R#6; G91G01Y-#17; GOTO 441; N440 G91G01Y#17; ;//---CCW Direction:G03 --------- G03X-#6Y#6R#6; G01X-#16; G01X-#16; G03X-#6Y-#6R#6; G01Y-#17; G01Y-#17; G03X#6Y-#6R#6; G01X#16; G01X#16; G03X#6Y#6R#6; G91G01Y#17; ;//------------------------------ N441 #3=#3+1; //#3.a counter GOTO 430; // that point out what x-y path is cutting. N450 #12=#12+1; // Eof x-y cut LOOP ------------------------------------ GOTO 410; N460 GOTO 9999; ; //Eof of Z_cut ;//----LOOP for finish machining. @81=2 With soft move--- N600 IF( #9 < (2*(#20+#22)) ) GOTO 700; // with no soft movement IF( #10 < (2*(#20+#22)) ) GOTO 700; // when IorJ < (2phi+2v) #27=#24+#9/2; #28=#25+#10/2; //(#27,#28) workpiece.CEN IF(#21==3) GOTO 610; #16=#27-#20/2; //G02..soft Entry point.x #17=#28+(#10/2-#20); //G02..soft Entry point.y GOTO 611; N610 #16=#27+#20/2; //G03..soft Entry point.x #17=#28+(#10/2-#20); //G03..soft Entry point.y ; N611 IF( #18 <= (#20/2) ) GOTO 615; #6=#18-(#20/2); //#6: corner radius. #14=(#9/2)-#18; //#14: half machining.x #15=(#10/2)-#18; //#15: half machining.y GOTO 616; N615 #6=0; //#6: corner radius. #14=(#9/2)-(#20/2); //#14: half machining.x #15=(#10/2)-(#20/2);//#15: half machining.y ; N616 G90G00Z@90; G90G00X#16Y#17; G90G00Z#26; #5=#20/2; // soft_in radius=1/2 phi #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#16Y#17; //use G01 for safe G90G01Z#31F@1; F@2; G91G02X#5Y#5R#5; //soft_in G01X#14; G02X#6Y-#6R#6; G01Y-#15; G01Y-#15; G02X-#6Y-#6R#6; G01X-#14; G01X-#14; G02X-#6Y#6R#6; G01Y#15; G01Y#15; G02X#6Y#6R#6; G01X#14; G91G02X#5Y-#5R#5; //soft_out GOTO 641; N640 G90G01X#16Y#17; //use G01 for safe G90G01Z#31F@1; F@2; G91G03X-#5Y#5R#5; //soft_in G01X-#14; G03X-#6Y-#6R#6; G01Y-#15; G01Y-#15; G03X#6Y-#6R#6; G01X#14; G01X#14; G03X#6Y#6R#6; G01Y#15; G01Y#15; G03X-#6Y#6R#6; G01X-#14; G91G03X-#5Y-#5R#5; //soft_out N641 #12=#12+1; GOTO 620; ; N650 IF(@96 == 1) GOTO 651; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N651 G90G00X#27Y#28; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N700 #27=#24+#9/2;//--LOOP for finish machining. @81=2 Without soft move- #28=#25+#10/2; //(#27,#28) workpiece.CEN IF( #18 <= (#20/2) ) GOTO 715; #6=#18-(#20/2); //#6: corner radius. #14=(#9/2)-#18; //#14: half machining.x #15=(#10/2)-#18; //#15: half machining.y GOTO 716; N715 #6=0; //#6: corner radius. #14=(#9/2)-(#20/2); //#14: half machining.x #15=(#10/2)-(#20/2);//#15: half machining.y N716 #32=(#10/2)-(#20/2)+#28; //absolute Entry.Y G90G00Z@90; G90G00X#27Y#28; G90G00Z#26; #5=#20/2; // soft_in radius=1/2 phi #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#27Y#28; G90G01Z#31F@1; F@2; G90G01X#27Y#32; G91G01X#14; G02X#6Y-#6R#6; G01Y-#15; G01Y-#15; G02X-#6Y-#6R#6; G01X-#14; G01X-#14; G02X-#6Y#6R#6; G01Y#15; G01Y#15; G02X#6Y#6R#6; G91G01X#14; GOTO 741; N740 G90G00X#27Y#28; G90G01Z#31F@1; F@2; G90G01X#27Y#32; G91G01X-#14; G03X-#6Y-#6R#6; G01Y-#15; G01Y-#15; G03X#6Y-#6R#6; G01X#14; G01X#14; G03X#6Y#6R#6; G01Y#15; G01Y#15; G03X-#6Y#6R#6; G91G01X-#14; N741 #12=#12+1; GOTO 720; N750 IF(@96 == 1) GOTO 751; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N751 G90G00X#27Y#28; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; ;//======================================================== N9999 IF (@96 == 1) GOTO 99991; G90G00Z@90; GOTO 99992; N99991 G90G00X#27Y#28; G90G00Z@90; ;; M5; //Turn-OFF spindle and coolant ;; M9; ;; G90G00X#24Y#25; 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; N9077 $599=77; N9079 $599=79; N9083 $599=83; GOTO 8888; ;//-------------------------------------------------------- ;// Rectangle 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 point ;// Y(#25): Y coord. of reference point ;// I(#9 ): Length of workpiece.x ;// J(#10): Width of workpiece.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 ;//-------------------------------------------------------------------