O9944; //CIRCULAR FACING #27=$1; #28=$3; #29=$7; #5=ABS(#5); IF (#6!=#0) GOTO 100; #6=@91; //default feed rate N100 F#6; IF (#20!=#0) GOTO 110; #20=@92; N110 #20=#20*0.5; //tool radius IF (#4!=#0) GOTO 130; #4=@96; //default cut depth N130 IF (#19!=#0) GOTO 140; #19=@95; //default spindle speed N140 IF (#19>0) GOTO 150; //start spindle S-#19M04; GOTO 160 ; N150 S#19M03; N160 IF (#2>0) GOTO 170; //direction assignment #21=2; //CW machining #2=#2+#1; #1=#1+#5; #2=#2-#5; GOTO 180; N170 #21=3; //CCW machining #2=#2+#1; #1=#1-#5; #2=#2+#5; N180 #31=#21; //backup the direction of first circular arc @1=COS(#1); @11=SIN(#1); @2=COS(#2); @12=SIN(#2); ; IF (#10<#18+#20) GOTO 190; #18=#18+#20; //TARGET RADIUS #13=(#10-#18)/#23; GOTO 200; N190 IF (#10<#18) GOTO 195; #18=#18+#20; //TARGET RADIUS #10=#18; #13=0; GOTO 200; N195 IF (#10<=#18-#20) GOTO 205; #18=#18-#20; //TARGET RADIUS #10=#18; #23=-#23; //negative means inside cutting, positive outside cutting #13=0; GOTO 200; N205 #18=#18-#20; #13=(#18-#10)/#23; #23=-#23; N200 #14=#24+#10*@1; //(#14,#15) starting point #15=#25+#10*@11; IF (#13!=FIX(#13)) GOTO 220; //check integer #13=#13-1; N220 #13=FIX(#13); IF (#13>=0) GOTO 225; #13=0; N225 #17=#18+#13*#23; //INITIAL RADIUS #32=#13; //backup counter value #33=#17; //BACKUP INITIAL RADIUS #16=#8/#4; IF (#16!=FIX(#16)) GOTO 270; //check interger #16=#16-1; N270 #16=FIX(#16); IF (#16>=0) GOTO 280; #16=0; N280 #19=#26; ; G90G00Z@90M08; N1000 IF (#16<0.5) GOTO 2000; G90G00Z@90; X#14Y#15; //Startting point of machining Z#19; G04P1; #19=#19-#4; G01Z#19; //current height #17=#33; #11=#24+#17*@1; #12=#25+#17*@11; //startting point of G02 or G03 X#11Y#12; //approaching movement G04P1; #9=#24-$30; //displace ment of center relative to point #1 #10=#25-$31; #11=#24+#17*@2; #12=#25+#17*@12; #21=#31; //resume the direction of first G02 or G03 G#21X#11Y#12I#9J#10; //first circular interpolation G04P1; IF (#21>2.5) GOTO 1010; #21=3; GOTO 1020; N1010 #21=2; N1020 #13=#32; //counter initialization #17=#17-#23; //radius refreshment N1030 IF (#13<0.5) GOTO 1100; #11=#24+#17*@2; #12=#25+#17*@12; G01X#11Y#12; G04P1; #11=#24+#17*@1; //relative displacement from point #1 to point #2 #12=#25+#17*@11; #9=#24-$30; #10=#25-$31; //relative displacement from center to point #1 G#21X#11Y#12I#9J#10; G04P1; IF (#21>2.5) GOTO 1040; #21=3; GOTO 1050; N1040 #21=2; N1050 #13=#13-1; #17=#17-#23; IF (#13<0.5) GOTO 1100; #11=#24+#17*@1; #12=#25+#17*@11; G01X#11Y#12; G04P1; #11=#24+#17*@2; #12=#25+#17*@12; #9=#24-$30; #10=#25-$31; G#21X#11Y#12I#9J#10; G04P1; IF (#21>2.5) GOTO 1060; #21=3; GOTO 1070; N1060 #21=2; N1070 #13=#13-1; #17=#17-#23; GOTO 1030; N1100 #16=#16-1; GOTO 1000; N2000 G90G0Z@90; X#14Y#15; //Startting point of machining Z#19; G04P1; #26=#26-#8; G01Z#26; //bottom of machining G04P1; #17=#33; //inital radius of movement #11=#24+#17*@1; #12=#25+#17*@11; X#11Y#12; G04P1; #9=#24-$30; #10=#25-$31; #11=#24+#17*@2; #12=#25+#17*@12; #21=#31; //backup the direction G#21X#11Y#12I#9J#10; G04P1; IF (#21>2.5) GOTO 2010; #21=3; GOTO 2020; N2010 #21=2; N2020 #13=#32; #17=#17-#23; N2030 IF (#13<0.5) GOTO 9000; #11=#24+#17*@2; #12=#25+#17*@12; G01X#11Y#12; G04P1; #11=#24+#17*@1; #12=#25+#17*@11; #9=#24-$30; #10=#25-$31; G#21X#11Y#12I#9J#10; G04P1; IF (#21>2.5) GOTO 2040; #21=3; GOTO 2050; N2040 #21=2; N2050 #13=#13-1; #17=#17-#23; IF (#13<0.5) GOTO 9000; #11=#24+#17*@1; #12=#25+#17*@11; G01X#11Y#12; G04P1; #11=#24+#17*@2; #12=#25+#17*@12; #9=#24-$30; #10=#25-$31; G#21X#11Y#12I#9J#10; G04P1; IF (#21>2.5) GOTO 2060; #21=3; GOTO 2070; N2060 #21=2; N2070 #13=#13-1; #17=#17-#23; GOTO 2030; N9000 G90G0Z@90; ;; M05; ;; M09; ;; X#24Y#25; G#27G#28G#29; M99; ;/**********************************************************************/ ;/* */ ;/* Modified on 1997-02-12 By Bing Shi Lee */ ;/* The timing when coolant turned off is changed. */ ;/* 1996-10-21 By Bing-Shi Lee */ ;/* This MACRO O9944 performs the cutting along part of circle */ ;/* */ ;/* Modification due on this version */ ;/* Additional input parameter r(#10) is defined. */ ;/* r is used to determined inside or outside machining and the */ ;/* position of starting point. */ ;/* */ ;/* INPUT DATA includes: */ ;/* X(#24), Y(#25) : the center of arc */ ;/* R(#18) : radius of arc */ ;/* A(#1), B(#2) : the polar angles of end points of arc */ ;/* r(#10) : initial radius of machining */ ;/* Z(#26) : the reference height of machining */ ;/* H(#8) : the total depth of cutting */ ;/* D(#4) : the depth of each advance in Z direction */ ;/* U(#21) : the direction of movement */ ;/* T(#20) : the diameter of tool */ ;/* F(#6) : feedrate */ ;/* S(#19) : the spindle speed */ ;/* */ ;/* the END POINTS of arc can be specified in three format */ ;/* */ ;/**********************************************************************/