A Sample Program - Facing with G Code
% !!!!!!!!!!!!!!!!!!!!!!THIS ISN'T FINISHED YET DONT USE!!!!!!!!!!!!!!!!!!!!!!! O0501 (Terry's TOP Facing Program with Verbose Comments) G54 G90 G20 (Set WCS, Set Absolute Positioning, Set Inch Mode) T1 M06 (Set Tool to #1 and then change to it) G43 H01 (Turn on compensation for Tool#1) #1= 1.0000 (Z SAFE HEIGHT) #2= 4.0000 (STOCK WIDTH) #3= 4.0000 (STOCK DEPTH) #4= 0.0000 (Z START) #5= -0.0600 (Z FINAL) #6= 0.0250 (Z CUT STEP SIZE) #7= 0.0000 (INITIALIZE Z VARIABLE) #8= 2.5000 (TOOL DIAMETER) #9= 14.0 (XY FEED RATE) #10= 600 (SPINDLE SPEED) #11= 0.0000 (INITIALIZE X VARIABLE) #12= 0.0000 (INITIALIZE Y VARIABLE) S#10 M03 (Spin the Spindle at the SPINDLE SPEED we have set) #7= #4 (Set Z to Start Height) #3= -1.000 * #3 (Set #3 to Y position of bottom of stock) G00 Z#1 (Go Rapid to SAFE HEIGHT) M08 (COOLANT ON) N10 (MAIN PROGRAM ENTRY) #12= -.4 * #8 (Set Y to -.4 times the Tool Diameter which lets 10% of the Tool hang off the back of the stock) #7= #7 - #6 (DECREMENT YOUR CURRENT DEPTH BY YOUR STEP SIZE) IF [ #7 LT #5 ] THEN #7=#5 (IF WE HAVE PASSED OUR ZFINAL, SET Z=ZFINAL FOR FINISHING PASS) M97 P100 (CALL SUB PROG TO FACE AT NEW CURRENT Z) N20 #12 = #12 - [ .9 * #8 ] (Decrement Y) IF [#12 LT #3 ] GOTO11 M97 P100 (CALL SUB PROG TO FACE AT NEW CURRENT Y, SAME OLD CUT DEPTH) GOTO20 N11 (Done with Y) IF [ #7 EQ #5 ] GOTO99 (IF WE HAVE JUST CUT AT ZFINAL THEN WE ARE DONE JUMP TO 99 FOR ENDING) GOTO10 (LOOP TO N10) N99 (CLEAN UP AND END) M05 (SPINDLE OFF) M09 (COOLANT OFF) G00 Z#1 (GO TO SAFE HEIGHT) G00 X-2.0000 Y4.0000 (INSPECTION LOCATION) M30 (END AND REWIND) N100 (FACE SUB PROG) G00 Z#1 (Go Rapid to Safe Height) #11= #8 + #2 (Set X to 1X the Tool Diameter to the RIGHT of the Stock, thereby clearing Stock by 50% of Tool) G00 X#11 Y#12 (Go Rapid to X Right and Y) G00 Z#7 (Plunge to Current Cut Depth) #11= -#8 (Set X to 1X Tool Diameter to LEFT of Stock, thereby clearing Stock by 50% of Tool) G01 X#11 F#9 (Move Normal to New X, RIGHT to LEFT) G00 Z#1 (Go Rapid to Safe Height at LEFT) M99 (RETURN FROM SUB PROG) %
The above program is used to face a top of a block, with our shell cutter.
- First you set the X-Y zeroes at the front/left corner of the fixed(back)jaw of the vise.
- You put your stock in the vise, with left/back corner smooth with the fixed jaw. Use parallels to get the stock at least 1/2 above the vise and yet leave at least 50% in the vise jaws if you can. Tighten and use dead blow hammer to keep the stock tight to the parallels (but don't be THE HULK)
- Load the Shell Cutter as Tool #1 and touch it off to the top of your stock.
- Touch off the Shell Cutter to the top left back corner of your stock.
- We have set Spindle Speed, Feed Rate and Tool Diameter for the Shell Cutter.
- Set the Stock Width and Depth by editing the program.
- Set your Z START at 0 (since we just touched it off) and ZFINAL at what you think will finish it off. Remember to cut a little deeper than an even multiple of your step size to get a light finish pass.
- This will make multiple passes at the same Z for multiple Y to face stock which is deeper than the Shell Cutter diameter.
- If this didn't clean the face, reset ZSTART and ZFINISH and go again. Remember NOT to cut into the vise jaws.
Repeat on all the sides to square. Use the next program to do the right ends which are protruding ("proud") to the right of the vise jaws.
Now lets face the RIGHT SIDE of the block.
% !!!!!!!!!!!!!!!!!!!!!!THIS ISN'T FINISHED YET DONT USE!!!!!!!!!!!!!!!!!!!!!!! O0502 (Terry's SIDE Facing Program to face the RIGHT side of a block extending out at least .500 inch to the RIGHT of vise) G54 G90 G20 (Set WCS, Set Absolute Positioning, Set Inch Mode) T1 M06 (Set Tool to #1 and then change to it) G43 H01 (Turn on compensation for Tool#1) #1= 1.0000 (Z SAFE HEIGHT) #2= 4.0000 (STOCK WIDTH) #3= 4.0000 (STOCK DEPTH) #4= 1.0000 (STOCK THICKNESS) #5= -0.0600 (X TOTAL CUT) #6= 0.0250 (X CUT STEP SIZE) #7= 0.0000 (INITIALIZE XDEPTH VARIABLE) #8= 0.75 (TOOL DIAMETER) #9= 28.0 (XY FEED RATE) #10= 1500 (SPINDLE SPEED) #11= 0.0 -#4 -.25 * #8 (Set ZBOTTOM to clear bottom of stock by 1/4 tool diameter) #12= -#3 - #8 (Set YFRONT to Y position of front of stock - tool diameter) #13= #8 (Set YBACK to Y position of back of stock + tool diameter) #14= #2 (Current X Cutting Position, initialize at RIGHT of stock) S#10 M03 (Spin the Spindle at the SPINDLE SPEED we have set) G00 Z#1 (Go Rapid to SAFE HEIGHT) M08 (COOLANT ON) N10 (MAIN PROGRAM ENTRY) #7= #7 - #6 (DECREMENT YOUR CURRENT X Depth BY YOUR STEP SIZE) IF [ #7 LT #5 ] THEN #7=#5 (IF WE HAVE PASSED OUR ZFINAL, SET Z=ZFINAL FOR FINISHING PASS) #14 = #2 - #7 (Set X to new X cutting position) M97 P100 (CALL SUB PROG TO FACE AT NEW CURRENT X) IF [ #7 EQ #5 ] GOTO99 (IF WE HAVE JUST CUT AT ZFINAL THEN WE ARE DONE JUMP TO 99 FOR ENDING) GOTO10 (LOOP TO N10) N99 (CLEAN UP AND END) M05 (SPINDLE OFF) M09 (COOLANT OFF) G00 Z#1 (GO TO SAFE HEIGHT) G00 X-2.0000 Y4.0000 (INSPECTION LOCATION) M30 (END AND REWIND) N100 (SIDE SUB PROG) G00 Z#1 (Go Rapid to Safe Height) G00 Y#12 (Go Rapid to YFRONT) G00 X#14 (Go Rapid to X Cutting Position) G00 Z#11 (Go RAPID to ZBottom) G01 Y#13 F#9 (Move Normal to Safe Y, FRONT to BACK) G00 Z#1 (Go Rapid to Safe Height at BACK) M99 (RETURN FROM SUB PROG) %
- Make sure you still have the X-Y zeroes at the front/left corner of the fixed(back)jaw of the vise.
- You put your stock in the vise, with left/back corner smooth with the fixed jaw. Use parallels to get the stock at the top the vise approx. Tighten and use dead blow hammer to keep the stock tight to the parallels (but don't be THE HULK)
- Load the 3/4 Flat End Mill as Tool #1 and touch it off to the top of your stock.
- We have set Spindle Speed, Feed Rate and Tool Diameter for the 3/4 End Mill.
- Set the Stock Width, Thickness and Depth by editing the program.
- Set your X TOTAL CUT at what you think will finish it off. Remember to cut a little deeper than an even multiple of your step size to get a light finish pass.
- If this didn't clean the face, edit #6 and #7 and go again. Remember NOT to cut into the vise jaws.
Flip the block and repeat on other side to finish.
Jim's Facing Program
This is the one from class. It is a working version.
% O0020 (Super Facing Prog....) G54 G90 G20 T1 M06 G43 H01 S3000 M03 #1= 0.2500 (Z FEED PLAN) #2= 1.4000 (X START) #3= 0.3750 (Y START) #4= 0.0000 (Z START) #5= -0.1575 (Z FINAL) #6= 0.0300 (Z CUT DEPTH) #7= #4 - #6 (CURRET DEPTH) #8= 1.4000 (X FACE TO LOC) #9= -1.0000 (Y FACE TO LOC) #10= 25.0 (XY FEED RATE) #11= 1.0000 (Z SAFE HEIGHT) G00 Z#11 (SAFE HEIGHT) G00 X#2 Y#3 (START LOC) IF [ #7 LT #5 ] THEN #7= #5 / M08 (COOLANT ON) (...........................) N10 (LOOP TOP...............) IF [ #7 LT #5 ] GOTO200 M97 P100 (CALL SUB PROG) IF [ #7 EQ #5 ] GOTO200 #7= #7 - #6 IF [ #7 GT #5 ] GOTO10 #7= #5 GOTO10 (...........................) N200 (CLEAN UP AND END......) M05 (SPINDLE OFF) M09 (COOLANT OFF) G00 Z#11 G00 X-1.3 Y3.8 (INSPECTION LOC) M30 (END AND REWIND) (...........................) N100 (FACE SUB PROG.........) G00 X#2 Y#3 (XY START LOC) G00 Z#7 (CURRENT CUT DEPTH) (FACE CUT) G01 X#8 Y#9 F#10 G00 Z#1 (Z FEED PLAN) M99 (RETURN FROM SUB PROG) %
!!!!!!!!!!!!!!!!!!!!!!THIS ISN'T FINISHED YET DONT USE!!!!!!!!!!!!!!!!!!!!!!! % O0501 (Terry's TOP Facing Program without Verbose Comments) G54 G90 G20 T1 M06 G43 H01 #1= 1.0000 #2= 4.0000 #3= 4.0000 #4= 0.0000 #5= -0.0600 #6= 0.0250 #7= 0.0000 #8= 2.5000 #9= 14.0 #10= 600 #11= 0.0000 #12= 0.0000 S#10 M03 #7= #4 #3= -1.000 * #3 G00 Z#1 M08 N10 #12= -.4 * #8 #7= #7 - #6 IF [ #7 LT #5 ] THEN #7=#5 M97 P100 N20 #12 = #12 - [ .9 * #8 ] IF [#12 LT #3 ] GOTO11 M97 P100 GOTO20 N11 IF [ #7 EQ #5 ] GOTO99 GOTO10 N99 M05 M09 G00 Z#1 G00 X-2.0000 Y4.0000 M30 N100 G00 Z#1 #11= #8 + #2 G00 X#11 Y#12 G00 Z#7 #11= -#8 G01 X#11 F#9 G00 Z#1 M99 %