MacroMill CNC Automation Software

How CNC Thread Milling Works — From Inputs to the Helix

CNC thread milling in the MacroMill simulator: macro O9022 shows the inputs, calculations and helical toolpath for an internal thread

CNC thread milling cuts a thread by interpolating a helix with a milling cutter, instead of driving a tap into a hole. In this lesson we follow a MacroMill simulator video of macro O9022 and walk the numbers through from the inputs to the toolpath: size and pitch, tool-centre radius, radial passes, and the quarter-turn steps that produce the helix. Thread milling looks straightforward on the surface, but a wrong radius or direction is easy to miss. MacroMill’s simulators and training are there to help you master it to perfection, safely, before the program reaches a real machine.

What CNC thread milling is, and why shops use it

Tapping uses a dedicated tool for one size, turned into the hole at the pitch. It is fast when it works, but a broken tap can scrap a part, and that one tap only covers one diameter and pitch.

Thread milling uses a milling cutter and helical interpolation. The tool follows a circular path in X and Y while Z moves at the thread pitch. With the right cutter you can cut different diameters — and often more than one pitch — and you can choose internal or external, right-hand or left-hand, without a new tap for every size. If something goes wrong, the cutter is usually still free to leave the hole. That is why thread milling is common on larger threads, harder materials, and jobs where a broken tap would be expensive.

The hole (or the boss, for an external thread) is prepared first. The thread mill then forms the thread profile as it winds along the helix.

How helical interpolation builds the thread

A thread is a spiral. On a machining centre that spiral is coordinated motion: the tool centre travels a circle, and Z advances (or retracts) by one pitch for every full turn.

Macro O9022 does not interpolate the whole circle in one block. It steps in 90-degree increments. For a 3 mm pitch, each quarter-turn moves Z by 3 / 4 = 0.750 mm. Four of those steps make one turn, and Z has then moved 3 mm — the pitch.

That quarter-turn repeat is the same kind of loop logic you see in a FANUC macro WHILE loop: test, move, update the angle and Z, then go around again.

Tool-centre radius: you program the cutter centre, not the thread diameter

The control moves the centre of the cutter, not the cutting edge. For an internal thread you must offset the path inward by the cutter radius.

In this example the major diameter is 48 mm, so the major radius is 48 / 2 = 24 mm. The single-row cutter is 9.5 mm, so the cutter radius is 9.5 / 2 = 4.75 mm. The internal tool-centre radius stored in #146 is then:

24 - 4.75 = 19.250 mm

If you programmed a 24 mm radius with a 9.5 mm cutter, the edge would be 4.75 mm past the thread and into the wall. Getting #146 right is the difference between a good thread and a crash.

Radial passes, finish stock and a spring pass

You rarely take the full radial depth in one cut. O9022 is set for 4 radial passes (#113). That is four radial cuts, not four turns. The number of turns comes from the thread length and pitch. The radial passes are successive cuts that work out toward the finished size.

Finish stock #114 = 0.05 mm is left for a finishing pass. A spring pass is also on: the tool repeats the finish size with no further radial infeed, which can clean up deflection. That is why the preview shows 6 passes:

4 rough + 1 finish + 1 spring = 6 passes

The cycle also uses an auto lead-in arc (#116 = 0). The lead arc eases the cutter into the helix instead of entering the wall at full radial depth in one step.

Climb or conventional, and which way the helix runs

#111 = 1 sets a right-hand thread. #112 = 1 sets climb milling.

Climb versus conventional changes which side of the path the cutter bites, and it should match how you want the cutter to enter and leave the thread. Right-hand versus left-hand, together with whether the tool cuts up or down the hole, sets the hand of the helix.

This recording cuts upward: the tool starts at the bottom of the thread and climbs toward the top as it mills. That is a bottom-up climb cut on a right-hand internal thread. Always confirm direction, hand, and climb or conventional together before you run the cycle on a machine.

Walk through macro O9022

The example is an internal, right-hand thread, centre X0 Y0, work offset G54. These are the loaded inputs:

InputVariableValue
Type#102Internal
Major diameter#10348 mm
Pitch#1043 mm
Thread length#10748 mm
Top of thread Z#1080 mm
Cutter diameter#1099.5 mm, single-row
Centre X, Y#100, #1010, 0
Hand#111Right hand
Cut direction#112Climb
Radial passes#1134
Finish stock#1140.05 mm
Spring pass#115On
Lead arc#116Auto (#116 = 0)
Work offset—G54
FANUC Custom Macro page in the MacroMill simulator showing loaded CNC thread milling inputs for macro O9022, including major diameter 48 mm and 3 mm pitch
Verify the loaded inputs on the FANUC Custom Macro page before cycle start. Setup fields map to # variables.

The values below are the calculated results shown in the lesson. Where the arithmetic is written out (radius, pitch step, pass count), those lines are checks to make the numbers make sense. They are not extra lines of macro code. Auto depth is visible as 1.624 mm in #141; its formula is not shown in this lesson, so it is used as a given.

ResultVariableCalculation
Major radius—48 / 2 = 24 mm
Cutter radius—9.5 / 2 = 4.75 mm
Tool-centre radius#14624 − 4.75 = 19.250 mm
Auto depth#1411.624 mm (formula not shown)
Inner limit#14524 − 1.624 = 22.376 mm
Start radial limit#14719.250 − 1.624 = 17.626 mm
Z step per 90°#1443 / 4 = 0.750 mm
Quarter-turns#14348 / 3 × 4 = 64 (16 full turns)
Thread bottom Z#155#108 − #107 = 0 − 48 = −48 mm
Helix start Z—−48 + 0.750 = −47.250 mm
Approach Z#157#108 + #117 = 0 + 5 = +5 mm
Passes in the preview—4 + 1 + 1 = 6
Roughing radius (before finish)—19.250 − 0.050 = 19.200 mm
MacroMill FANUC macro variables highlighting tool-centre radius #146 at 19.250 mm for CNC thread milling of a 48 mm internal thread with a 9.5 mm cutter
#146 = 19.250 mm is the internal tool-centre radius: major radius minus cutter radius.

#147 is the smaller starting radius, before the outward radial passes begin. #155 is the thread bottom, 48 mm below top Z. The helix start is one Z-step above that bottom, at −47.250 mm, so the first quarter-step locates the start of the cut. Approach Z is the 5 mm clearance above the top of the thread.

Live position from the angle

As the loop runs, the angle #163 advances by 90 degrees on each step:

#163=#163+#151*90

In the recording, that update takes #163 from 1530° to 1620°. The tool-centre position uses the roughing radius 19.200 mm (final radius 19.250 minus the 0.05 mm finish stock):

X = #100 + R*COS[#163]
Y = #101 + R*SIN[#163]

With the tool on the centre (#100 = 0, #101 = 0) and R = 19.200 mm:

  • COS[1620°] = −1, so X = −19.200 mm
  • SIN[1620°] = 0, so Y = 0 mm

The tool is left of centre, on the horizontal centreline. Z rises 0.750 mm on every quarter-step, so after four quarter-steps — one full turn — Z has risen 3 mm, which is the pitch. Watch the 3D helix: this recording cuts upward.

3D GRAPH and XY views in the MacroMill simulator showing the CNC thread milling helix, where four quarter-steps of 0.750 mm raise Z by the 3 mm pitch
XY shows the circle. The 3D view shows the axial travel: one 360° turn raises Z by 3 mm, the pitch.

Master it in the simulator, then verify on the machine

Change one input and compare the macro values and the toolpath. That is how you get comfortable with thread milling: see what each variable does, then check the numbers. MacroMill’s simulators and training are built so you can practise this — radii, passes, direction and the helix — until you have mastered it, without risking a machine or a workpiece.

If you want to generate and prove thread programs more broadly, the CNC progressive thread generator in CNC Automation Pro is on the same site, and the MacroMill software page lists the simulators and training. The loop that walks the helix is the same family of Macro B ideas covered in How a FANUC Macro WHILE Loop Works — Tip of the Iceberg.

For training only — always verify tooling, offsets and clearances on your machine.

Try the MacroMill CNC simulators

Try the MacroMill CNC simulators at macromillcnc.com. Open the thread-milling cycle, load the same inputs, and follow the variables into the helix.

MacroMill

Get free CNC macro tips & simulator updates

New tutorials and MacroMill simulator deals, straight to your inbox.

We don’t spam! Read our privacy policy for more info.

Responses

  1. […] from a counter and a test, not from four copied blocks. The same idea scales into work such as CNC thread milling, where the cutter centre radius, radial passes and the Z step per quarter-turn are calculated from […]

  2. […] update — is the kind of logic you see in a FANUC macro WHILE loop. It is a different problem from CNC thread milling, which interpolates a helix with a milling cutter; this is a lathe thread, cut with G32 at a 10 mm […]

Leave a Reply