;//File_name:O9941. LINE MACHINING Create_data:85/10/23 V1.0 ;//Modifer:Yi_wan Lin Last_modify:11/07 3:05am IF (#13==#0) GOTO 10; @81=#13; N10 #27=$1; //Backup G_grup #28=$3; #29=$7; ;//------------------------------------------------------------- #5=ABS(#5); //extend length. ;//------------------------------------------------------------- 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 120; #4=@96; //default cut depth N120 ; ;//------------------------------------------------------------- IF(#1>=1) GOTO 140; IF(#1<=-1) GOTO 130; #1=0; #31=0; GOTO 150; // N130 #1=-1; // #31:(1) tool offset function ON #31=1; // (0) tool offset function OFF GOTO 150; N140 #1=1; #31=1; N150 ; ;//------------------------------------------------------------- IF (#19!=0) GOTO 160; #19=@95; //use default spindle speed value N160 IF (#19>0) GOTO 170; S-#19M04; GOTO 180; N170 S#19M03; N180; ;//==@81=2 represetn using polar method to determine p2========= IF (@81 < 2 ) GOTO 210; #9=ABS(#9); // Under polar system the vector length must be (+) #12=#24+#5*COS(#10+180); //polar coord data #13=#25+#5*SIN(#10+180); // (#12,#13)..1st point #14=(#24+#9*COS(#10))+#5*COS(#10); // (#14,#15)..2nd point #15=(#25+#9*SIN(#10))+#5*SIN(#10); ;//------------------------------------ IF (#1>=1) GOTO 190; //#1=-1...LEFT #1=0....CENTER #1=1...Right #2=#10+90 ; //#2....angle between tool and line GOTO 200; N190 #2=#10-90; //tool is at line's right hand N200 ; ;//------------------------------------ GOTO 230; ;//++@81=1 represent using 2 points style++++++++ N210 #11=ATAN(#10-#25,#9-#24); //2 point_line's angle #12=#24+#5*COS(#11+180); #13=#25+#5*SIN(#11+180); #14=#9+#5*COS(#11); #15=#10+#5*SIN(#11); ;//------------------------------------ IF (#1>=1) GOTO 220; //#1=-1...LEFT #1=0....CENTER #1=1...Right #2=#11+90 ; //#2....angle between tool and line GOTO 230; N220 #2=#11-90; //tool is at line's right hand N230; ;//============================================================= ;//--CALC tool entry & exit point ----------------------------- #21=#12+#31*#20*0.5*COS(#2); //(#21,#22) tool_1st point #22=#13+#31*#20*0.5*SIN(#2); #17=#14+#31*#20*0.5*COS(#2); //(#17,#18) tool_2nd point #18=#15+#31*#20*0.5*SIN(#2); ;//------------------------------------------------------------- #4=ABS(#4); #8=ABS(#8); IF( (#4==0) || (#8==0) ) GOTO 900; // |D| & |H| must >0 IF (#4<=#8) GOTO 240; #4=#8; N240 ; ;//------------------------------------------------------------- #32=#26; // #32..point to cut_layer.z #33=#26-#8; // #33..target cut_layer.z ;//------------------------------------------------------------- G90G00Z@90; X#24Y#25; // Move to base point X#21Y#22; // To tool_start_point G90G00Z#26; G04P1; M08; ;//============================================================= N500 #32=#32-#4; // #32..point to cut_layer.z G90G01Z#32; G04P1; G90G01X#17Y#18; // to tool_end_point IF( #33==#32) GOTO 900; IF( #33 > (#32-#4) ) GOTO 510; #32=#32-#4; G90G01Z#32; G04P1; G90G01X#21Y#22; // to tool_start_point IF( #33==#32) GOTO 900; IF( #33 > (#32-#4) ) GOTO 520; GOTO 500; ;//============================================================= N510 G90G01Z#33; G04P1; G90G01X#21Y#22; // to tool_start_point GOTO 900; ;//------------------------------------------------------------- N520 G90G01Z#33; G04P1; G90G01X#17Y#18; // to tool_end_point ;//------------------------------------------------------------- N900 G90G00Z@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. */ ;/* File_name:line.oxx ********* Argumet description: ******************/ ;/* A(#1) :Tool direction index; A=1...RIGHT A=0...CENTER A=-1...LEFT */ ;/* D(#4) :Each cut_down depth */ ;/* E(#5) :Extend length */ ;/* F(#6) :Feed rate */ ;/* H(#8) :Total cut_down depth */ ;/* I(#9) :P2.X /Vector length */ ;/* J(#10):P2.Y /Vector angle */ ;/* S(#19):Spindle RPM */ ;/* T(#20):Tool diameter */ ;/* X(#24):P1.X (P1 is a based point of vector ) */ ;/* Y(#25):P1.Y */ ;/* Z(#26):Beginning_cut_layer.z */ ;/* @81 :0-->Use POLOR system to determine p2. 1-->Cartesian system */ ;/* @90 :Escape of point.z */ ;/* @91 :Feedrate */ ;/* @92 :Tool diameter */ ;/* @95 :Spindle RPM */ ;/**********************************************************************/