;//O9931:Circle Pocket cutting..Yi-Wan LIN 10/09/1998 IF (#13==#0) GOTO 10; @81=#13; N10 #27=$1; //backup modal command G00 G01 #28=$3; //backup modal command G90 G91 ;//---------------------------- #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; ;//-------------------------------------------------------- #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 #18=ABS(#18); // R must + IF( #20!=#0 ) GOTO 72; #20=@92; // 10/09/1998 ADD 'T' ARGUMENT N72 #20=ABS(#20); // Phi must + REPLACE ALL @92 WITH #20 IF( #18==0 ) GOTO 9070; IF( #20==0 ) GOTO 9050; IF ( #18 <= (#20/2) ) GOTO 9071; //R must > (#20/2) IF( @81<1 || @81>2) GOTO 9999; ;//-----cal. cut-down counts------------ #11=#8/#4; IF( (#11-FIX(#11))==0) GOTO 80; #11=#11+1; #11=FIX(#11); // #11:-z Feed count ; ;//--------------------------- N80 #22=ABS(#22); // V must + IF (#22>#20) GOTO 9072; IF( @81==2 )GOTO 200;//=====When @81=1 there have 'W' procress======= IF( (#18-#22) <= (#20/2) ) GOTO 9082; #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 @94=ABS(@94); IF(@94<0.5) GOTO 130; #33=(#18-#22-#20/2)/#23; IF( (#33-FIX(#33))==0) GOTO 130; #33=#33+1; #33=FIX(#33); N120 #23=(#18-#22-#20/2)/#33; // wanna constant cutting!! ; N130 IF(#23 <= (#18-#22-#20/2) ) GOTO 140; #23=(#18-#22-#20/2); ;//-----cal cut-xy counts ---------------------- N140 #1=(#18-#22-#20/2)/#23; IF( (#1-FIX(#1))==0) GOTO 200; #1=#1+1; #1=FIX(#1); ;//-----Spindle running---------------------------------- N200 #19=FIX(#19); @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 IF(@81==1) GOTO 300; // rough IF(@81==2) GOTO 600; // finish GOTO 9999; ;//-----LOOP for rought machining.--- @81=1 ---------------- N300 G90G00Z@90; G90G00X#24Y#25; G90G00Z#26; #12=1; //Loop Z-cut .....for(#12=1;#12<=#11;#12++) N310 IF( #12 > #11) GOTO 360; G90G00X#24Y#25; IF(#12!=#11) GOTO 315; #16=#26-#8; GOTO 316; N315 #16=#26-(#12*#4); ; N316 G90G01Z#16F#5; F#6; #2=1; // Loop of x-y cut N330 IF(#2 > #1 ) GOTO 350; IF(#2!=#1) GOTO 356; #32=#18-#22-(#20/2); GOTO 357; N356 #32=#2*#23; ; N357 #33=#25+#32; G90G01X#24Y#33; G#21J-#32 #2=#2+1; GOTO 330; N350 #12=#12+1; // Eof x-y cut LOOP ;//----------------------------- GOTO 310; N360 GOTO 9999; ; //Eof of Z_cut ;//--LOOP_ finish machining.---- @81=2 --- N600 IF( #18 <= ( #20) ) GOTO 700; // to another process!! #30=SQRT( (#18-#20)*(#18-#20) + (0.25*#20*#20) )+ (#20/2); #30=#18-#30; // V<=R-[SQRT{ (R-phi)*(R-phi)+(0.5Phi)*(0.5Phi) }+Phi/2] IF( #22 > #30 ) GOTO 700; IF(#21==3) GOTO 610; #9=#24-#20/2; //G02..Entry point.x #10=#25+#18-#20; //G02..Entry point.y GOTO 611; N610 #9=#24+#20/2; //G03..Entry point.x #10=#25+#18-#20; //G03..Entry point.y ; N611 G90G00Z@90; G90G00X#9Y#10; G90G00Z#26; #32=#18-#20/2; // G02,G03 'J' value #15=#20/2; // soft_in radius=1/2 phi ;//------Loop of Z_cut------- #12=1; N620 IF(#12 > #11) GOTO 650; IF(#12!=#11) GOTO 630; #33=#26-#8; GOTO 631; N630 #33=#26-(#12*#4); ; N631 IF(#21==3) GOTO 640; G90G01X#9Y#10; G90G01Z#33F#5; //use G01 for safe & prevent from Depth change!! F#6; G91G02X#15Y#15R#15; //soft_in IF(#12!=#11) GOTO 635; N635 G02J-#32; // G02 G91G02X#15Y-#15R#15; //soft_out GOTO 641; N640 G90G01X#9Y#10; G90G01Z#33F#5; F#6; G91G03X-#15Y#15R#15; //soft_in IF(#12!=#11) GOTO 637; N637 G03J-#32; // G03 G91G03X-#15Y-#15R#15; //soft_out ; N641 #12=#12+1; GOTO 620; ; N650 IF (@96 == 1) GOTO 651; G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; N651 G90G00X#24Y#25 G90G00Z#26; ;//------Eof Z-cut LOOP------- GOTO 9999; ;//--LOOP:finish (FOR @81=2 && R<=Phi but 2R> PHi)--- N700 #9=#24; // ..Entry point.x #10=#25+#18-(#20/2); // ..Entry point.y G90G00Z@90; G90G00X#24Y#25; G90G00Z#26; #32=#18-#20/2; //tool machining radius:'J' #12=1; ;//------Loop of cut_down------- N720 IF(#12 > #11) GOTO 750; IF(#12!=#11) GOTO 730; #33=#26-#8; GOTO 731; N730 #33=#26-(#12*#4); ; N731 G90G00X#24Y#25; G90G01Z#33F#5; F#6; G90G01X#9Y#10; IF(#12!=#11) GOTO 735; N735 G#21J-#32; // G02 #12=#12+1; GOTO 720; ; N750 IF (@96 == 1) GOTO 751; G90G00Z#26; ;//------Eof cut_down LOOP------- GOTO 9999; N751 G90G00X#24Y#25 G90G00Z#26; ;//------Eof cut_down LOOP------- GOTO 9999; ;//======================================================== N9999 IF (@96 == 1) GOTO 99991; G90G00Z@90; GOTO 99992; N99991 G90G00X#24Y#25 G90G00Z@90; ;; M5; //stop spindle and coolant ;; M9; ;; G90G00X#24Y#25; N99992 G#27G#28; //restore original modes 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; N9070 $599=70; N9071 $599=71; N9072 $599=72; N9082 $599=82; GOTO 8888; ;//-------------------------------------------------------- ;// Circle 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 ;// Z(#26): The top surface of the work piece ;// T(#20): @92(low priority),TOOL DIA ;// R(#18): work piece redius ;// 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 ;//-------------------------------------------------------------------