;//File_name:O9942. Function:Make a Arc machining(line type) ;//Original author:Bing-Shi Lee Modifier:Yi_wan Lin ;//Create_date:85/10/21 Last_modify:85/11/8 #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; //default tool diameter N110 ; 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 220; //direction of cutting #21=2; //CW machining #2=#2+#1; #1=#1+#5 #2=#2-#5; GOTO 230; N220 #21=3; //CCW machining #2=#2+#1; #1=#1-#5; #2=#2+#5; N230 ; @1=COS(#1); @11=SIN(#1); @2=COS(#2); @12=SIN(#2); #20=#20*0.5; //radius of tool(offset value) ;//--by #10 to cal. tool's start_point and end_point -- IF (#10==#18) GOTO 250; IF (#10<#18) GOTO 255; #33=1; // J>R tool is outside the arc GOTO 260; N250 #33=0; // J=R tool offset is OFF GOTO 260; N255 #33=-1; GOTO 260; // J2.5) GOTO 1030; #21=3; GOTO 1040; N1030 #21=2; N1040 ;//----------------------------------- #16=#16-1; IF (#16<0.5) GOTO 1600; #19=#19-#4; #31=#24-$30; #32=#25-$31; G01Z#19; G04P1; G#21X#9Y#10I#31J#32; ;//----------------------------------------- IF (#21>2.5) GOTO 1060; #21=3; GOTO 1070; N1060 #21=2; N1070 ;//----------------------------------- #16=#16-1; GOTO 1080; ;//========================================================= N1500 #26=#26-#8; #31=#24-$30; #32=#25-$31; G01Z#26; G04P1; G#21X#11Y#12I#31J#32; // to end point G04P1; GOTO 9000; ;//----------------------------------------- N1600 #26=#26-#8; #31=#24-$30; #32=#25-$31; G01Z#26; G04P1; G#21X#9Y#10I#31J#32; // to start point G04P1; ;//----------------------------------------- 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 performs the CIRCULAR MACHINING */ ;/* It will move the tool tangential to the specified circular arc. */ ;/* */ ;/* MODIFICATION */ ;/* Additional input parameter r is defined. */ ;/* It indicates inside or outside machining is going to be performed.*/ ;/* */ ;/* INPUT DATA must includes as follows */ ;/* X(#24), Y(#25) : the center of circular arc. */ ;/* R(#18) : the radius of arc */ ;/* A(#1) : the polar angle of first end point of point #1 */ ;/* B(#2) : the angle between point #1 and point #2 */ ;/* r(#10) : initial radius of machining */ ;/* Z(#26) : the height where machining starts */ ;/* H(#8) : the total cut depth */ ;/* D(#4) : the cut depth of each cutting */ ;/* E(#5) : the extesion angle */ ;/* */ ;/**********************************************************************/