O9911; /*X BIDIRECTIONAL FACING*/ IF( @90 <= #26 ) GOTO 9055; // ESCAPE.Z LOWER THEN R IF( #4 <=0 ) GOTO 9053; IF( #8 <=0 ) GOTO 9054; IF( #23 <=0 ) GOTO 9056; #27=$1; //backup GROUP 1 #28=$3; //GROUP 3 #29=$7; //GROUP 7 IF (#6!=#0) GOTO 100; #6=@91; //default feedrate N100 IF (#6<=0) GOTO 9052; F#6; IF (#20!=#0) GOTO 120; #20=@92; //default tool diameter N120 IF( #20 <= 0 ) GOTO 9050; // CAN'T ACCEPT PHI <= 0 IF (#23!=#0) GOTO 140; #23=#20*@93*0.01; //default cut width N140 IF (#23<0.1) GOTO 9000; IF (#19!=#0) GOTO 160; #19=@95; //default spindle speed N160 IF (#19<0) GOTO 180; //start spindle G97S#19M03; GOTO 200; N180 G97S-#19M04; ; N200 IF (#10<0) GOTO 600; #2=#25-#20*0.5+#23; //J>0 GOTO 640; N600 #2=#25+#20*0.5-#23; //J<0 #23=-#23; N640 IF (#9<0) GOTO 500; IF (#5<0) GOTO 540; #1=#24-#5-#20*0.5; //I>0 and E>0 #15=#9+#20+#5+#5; //initial span of X movement #12=#15; //regular span of X movement GOTO 580; N540 #1=#24+#5-#20*0.5; //I>0 and E<0 #15=#9-#5-#5+#20*0.5; #12=#9-#5-#5; GOTO 580; N500 IF (#5<0) GOTO 620; #1=#24+#5+#20*0.5; //I<0 and E>0 #15=#9-#20-#5-#5; #12=#15; GOTO 580; N620 #1=#24-#5+#20*0.5; //I<0 and E<0 #15=#9+#5+#5-#20*0.5; #12=#9+#5+#5; ; N580 #11=ABS(#10/#23); IF (#11>FIX(#11)+0.01) GOTO 220; //check integer #11=#11-1; N220 #11=FIX(#11); //number of passes along X direction IF (@94<0.5) GOTO 240; #23=#10/(#11+1); //CONSTANT CUT WIDTH function N240 #3=#8/#4; //number of passes in Z axis(unnormalized) IF (#3>FIX(#3)+0.01) GOTO 260; #3=#3-1; N260 #3=FIX(#3); //number of passes in Z direction #17=#26-#4; G40M08; //coolant N1000 IF(#3<0.5) GOTO 2000; //loop controlling the Z movement starts here G90G00G40Z@90; X#1Y#2; //starting point Z#17; #13=#11; //counter initialization G91G01X#15; //initial cut from -X toward +X N1100 IF(#13<0.5) GOTO 1110; G01Y#23; X-#12; //cutting from +X toward -X #13=#13-1; IF(#13<0.5) GOTO 1110; G01Y#23; X#12; //cutting from -X toward +X #13=#13-1; GOTO 1100; //loop controlling XY plane movement ends here N1110 #3=#3-1; //finiish current plane #17=#17-#4; //advance to next plane GOTO 1000; N2000 #17=#26-#8; //last plane of machining G90G0Z@90; X#1Y#2; //starting position Z#17; #13=#11; G91G01X#15; N2050 IF(#13<0.5) GOTO 9000; G01Y#23; X-#12; #13=#13-1; IF(#13<0.5) GOTO 9000; G01Y#23; X#12; #13=#13-1; GOTO 2050; N9000 G90G0Z@90; //all machining is finished ;;M05; ;;M09; ;;X#24Y#25; G#27G#28G#29; //restore original modes M99; ;//---------------------------------------------------------------------------- N9050 $599=50; N9051 $599=51; N9052 $599=52; N9053 $599=53; N9054 $599=54; N9055 $599=55; N9056 $599=56; ;/**********************************************************************/ ;/* Original on 1997-02-12 Bu Bing Shi Lee */ ;/* update by Yi-Wan Lin 06/26/1998 10:19:09 */ ;/* */ ;/* O9911 performs the BIDIRECTIONAL FACING along X axis. */ ;/* It means the tool moves along X axis back and forth to remove */ ;/* material from work piece. */ ;/* I>0 J>0 means the datum point is the lower left corner. */ ;/* I>0 J<0 means the datum point is the upper left corner. */ ;/* I<0 J>0 means the datum point is the lower right corner. */ ;/* I<0 J<0 means the datum point is the upper right corner. */ ;/* */ ;/* The tool keeps E length away from workpiece both the beginning */ ;/* and ending of cutting along X axis (E>0). */ ;/* The tool keeps E length away from workpiece only at the starting */ ;/* of the first cutting along X axis. It no longer keeps the E */ ;/* length for further cutting along X axis for the sake of saving */ ;/* time (E<0). */ ;/* */ ;/* X(#24), Y(#25) : the coordnates of datum point of facing */ ;/* Z(#26) : the height where facing starts */ ;/* I(#9), J(#10) : the length and width of the face */ ;/* H(#8) : the total depth of Z movement */ ;/* D(#4) : the cut depth in Z direction */ ;/* F(#6) : the feedrate */ ;/* W(#23) : the cut width for each cutting */ ;/* E(#5) : ESCAPE WIDTH */ ;/* */ ;/* #1, #2 : the start point of each facing ct current plane */ ;/* #3 : number of passes in Z direction */ ;/* #11 : number of passes in XY place facing */ ;/* #12 : regular displacement along X direction */ ;/* #15 : initial displacement along X direction */ ;/* #13, #14 : counter of XY plane and Z movement */ ;/* #17 : keeps the Z coord */ ;/**********************************************************************/