Hand writing thread milling and cbore code

I would like to write manual code for counter boring and thread milling in incremental (G91).
It’s an easy way to cut and paste redundant code.

This is an example of a .5" diameter cbore .5" deep using a .25" endmill but the K value is ignored for the pitch. (old fanuc code) Do I have to write 5 lines out with the pitch every G02 line and write 5 G02 lines to create a cbore .5" deep?

G90
G00 X1 Y1 (LOCATION OF FIRST HOLE)
G91
G01 x.25 F20
G02 X0 Y0 Z-.5 I-.25 J0 K-.1 F20
G02 X0 Y0 I-.25 J0 (CLEAN UP PASS)
G01 X-.25 (BACK TO CENTER)
G01 Z.6 F50
G90

You would need to have a line for each interpolation to depth. For example:

(Move to hole location)
(Move to surface of part)
G91
G01 X.25 F20
G02 X0 Y0 Z-.1 I-.25 J0 F20
G02 X0 Y0 Z-.1 I-.25 J0 F20
G02 X0 Y0 Z-.1 I-.25 J0 F20
G02 X0 Y0 Z-.1 I-.25 J0 F20
G02 X0 Y0 Z-.1 I-.25 J0 F20
G02 X0 Y0 I-.25 J0 (CLEAN UP PASS)
G01 X-.25 (BACK TO CENTER)
G01 Z.6 F50
G90

Or swap the last two lines for:
G00 G90 Z1.

I have a few operations that I program in a similar fashion. Thread milling being my number 1.

Thanks for the reply. The K (pitch) value was my best friend back in the 90’s. Should your Z value only be .1 every line or is Z reading absolute?

1 Like

You are correct, I just did a quick copy and paste from the snippet above. I’ll fix my post real quick. Sorry about that :grin:
My brain was thinking absolute haha.

1 Like

Skipshift, any chance you can share a working code snippet from your thread milling program? We have an MR1 at work and I am attempting to do some thread milling with a hand-written program, but can’t get it to work. Thanks!

Thanks Skip for the help!

This an example only. DO NOT USE AS IS!!.
Test your code in MDF, wax or other soft material.
You will have to do some math depending on the diameter of your cutter and the depth of cuts required to make good threads. Speeds and feeds will depend on materials and cutters used.

The number of passes you need will be determined by the material you are cutting and the tool you are using.

The code below will go .5" deep and make 20TPI. 1/TPI = the -Z value of the G2 lines.
Example 1/20=.05
If you needed 18TPI 1/18= .0555. You would replace the -Z value with this.

Practice on soft materials. Cutters are expensive!

(Drill Holes .15" DEEPER ON BLIND HOLES)
(Countersink)
(Move to hole location)
(Move to 0.1"above part)
G91 (Incremental Mode)
G01 X.01 F20 (First Pass)
G02 X0 Y0 Z-.05 I-.01 J0 F10 (all of your I and X values have to be the same in G91 Mode)
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10
G02 X0 Y0 Z-.05 I-.01 J0 F10

G01 X-.01 (BACK TO CENTER. Must be same distance as X value below G91)
G90
G01 Z.1 F50

M00 ( PAUSE BETWEEN EACH PASS TO BLOW OUT CHIPS ON BLIND HOLES)
G91
G01 X.015 F20 (Second Pass)
G02 X0 Y0 Z-.05 I-.015 J0 F10 (all of your I and X values have to be the same in G91 Mode)
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10
G02 X0 Y0 Z-.05 I-.015 J0 F10

G01 X-.015 (BACK TO CENTER. Must be same distance as X value above)
G90
G01 Z.1 F50 (back to .1 above part )
G90 (ABSOLUTE)
(NEXT HOLE LOCATION)

1 Like

@BrianD Has a great example above for a single form cutter.

Here’s a few lines I used to cut 3/4-16 internal thread in some ductile iron a few months back. The tool was a Ø.495" diameter multi-form cutter so I only had to do 1 interpolation per pass, I just pulled the feed rate back from the suggested feed rate to match the MR1’s capabilities.
I also generally thread mill in an upward direction to keep from driving the cutter down into chips toward the bottom of the hole. Even though I did 2 passes here the hole diameter was large enough to let chips evacuate with the flood coolant blasting in the holes.

I also use the first G91 line to control thread depth by cutting upward, so for a different thread depth you’d only have to adjust a single Z in the program.

I’ll follow Brian’s lead and put a disclaimer here: DO NOT USE AS IS
(clipped from the middle of a program so lines and G/M codes are missing - Annotated for a learning example only)

X0 Y0 (HOLE LOCATION)
S3703 M03
M08
G01 Z0. F20. (MOVE TO SURFACE OF HOLE)
(PASS 1)
G91 G01 Z-0.7578 F30.00 (G91 INCREMENTAL - APPROX THD DEPTH PLUS LEAD IN)
G01 X0.0592 Y0.0592 F1.81 (SETUP MOVE FOR LEAD-IN)
G03 X-0.0592 Y0.0592 Z0.0078 I-0.0592 J0.0000 F2.24 (LEAD-IN ARC)
G03 X0.0000 Y0.0000 Z0.0625 I0.0000 J-0.1185 F2.24 (CUT PASS AT 1/16 PITCH)
G03 X-0.0592 Y-0.0592 Z0.0078 I0.0000 J-0.0592 F8.49 (LEAD-OUT ARC)
G01 X0.0592 Y-0.0592 F40.00 (BACK TO HOLE CENTER)
G01 Z-0.0781 (RETURN TO INITIAL DEPTH)
(PASS 2)
G01 X0.0650 Y0.0650 F1.93
G03 X-0.0650 Y0.0650 Z0.0078 I-0.0650 J0.0000 F2.70
G03 X0.0000 Y0.0000 Z0.0625 I0.0000 J-0.1300 F2.70
G03 X-0.0650 Y-0.0650 Z0.0078 I0.0000 J-0.0650 F9.40
G01 X0.0650 Y-0.0650 F40.00
G00 G90 Z1. ( G90 ABSOLUTE - MOVE 1" ABOVE FOR CLEARANCE TO NEXT HOLE)

I vary the path a little depending on the style of tool and of course whatever thread diameter and pitch I’m cutting. This should get you the idea though. Definitely run it through some sort of simulation software. I normally use NC Corrector because it’s a pretty decent program for tool path simulation and program editing with color coded G/M codes and axis. On top of that I usually raise my Z coordinate up high enough to let the tool run above the part when using a new thread program. After they’re proven out and have made a good thread in material I save them in notepad so I can drop them into future programs and save some time having to single block a whole new thread program.
If that’s as clear as mud, feel free to ask any questions and I’ll try and get 'em answered for you.

Thanks to both of you for your help! We eventually figured out what our issue was - the CutControl backplotter just showed a 2D curve in the XY plane and then a step in Z for all of these sample code tests, but the controller itself will read the gcode correctly and do a helix move with the same code. We were getting caught up by the backplotter, but the machine itself was doing the right thing once we tried just running it.

Side note: @Skipshift it looks like you are using G41 cutter compensation in your code snippet, but our CutControl gives an error at that line and says “Unsupported or invalid g-code command found in block.” Have you found a trick to make cutter comp work in CutControl?

1 Like

Yeah the plotter doesn’t show helical interpolations. Langmuir are aware and it’s supposed to be fixed in a “future update”.

I pasted in that code above while at work. I use the same base path for the industrial machines w/ cutter comp. I apparently copy pasted from the wrong file and didn’t catch it at the time. I’ll correct my post so it doesn’t mess with folks in the future.
Side note: I really wish G41 was functional on the MR1. I want to say it’s on a “future update” as well, but may be wrong.

1 Like

Got it, makes sense. Appreciate the info!

I feel the same way about G41 - seems like it would be helpful for non-CAM users, so hopefully they do add it in the future.

1 Like