A 15 degree trapezoidal thread has a flat crest, a flat root and straight 15° walls. In this lesson we follow a MacroMill simulator video of macro O9970 and walk the numbers through from the inputs to the toolpath: twelve values, the centre-root passes, and the Z-shift that forms each 15° flank. Cutting the root and the two walls as three separate phases looks straightforward, but a wrong shift or pass count will leave the wrong form. MacroMill’s simulators and training are there to help you master it safely, before the program reaches a real machine.
What a 15° trapezoidal thread is, and why flank-by-flank cutting matters
A 15° trapezoidal thread is a strong, load-bearing form. The crest is the major diameter, the root is the minor diameter, and each wall is a straight 15° flank rather than the 30° half-angle of a common 60° V-thread.
You cannot cut that form in one plunge. A straight infeed would leave a rectangular groove. The walls have to be built as a staircase: each pass goes a little deeper and a little farther along Z, so the steps lie on a 15° line.
Macro O9970 does that in three phases. First it cuts a centre root, straight down to the minor diameter. Then it cuts the +Z flank, and then a mirrored −Z flank. Root plus two walls makes the trapezoid. The same idea — calculate, loop, 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 pitch.
The setup in the lesson is a Ø60 mm bar in the chuck. That bar size is input #1, the first number the macro reads.
The twelve inputs (the only lines you change)
These twelve numbers are all you change. Every other line is calculated by the macro.
| Input | Variable | Value |
|---|---|---|
| Major / crest diameter | #1 | 60 mm |
| Minor / root diameter | #2 | 49 mm |
| Pitch | #3 | 10 mm |
| Thread length | #4 | 200 mm |
| Root depth step | #5 | 0.5 mm |
| Flank depth step | #6 | 0.5 mm |
| Width taken from the pitch | #7 | 3 mm |
| Second width taken from the pitch | #8 | 3.93 mm |
| Approach feed (G98, mm/min) | #9 | 3000 |
| X clearance | #11 | 5 mm |
| Spindle speed | #19 | 300 RPM (G97) |
| Z start | #26 | 5 mm |

The inputs are copied into working variables #100–#111, and the maths and motion read those copies. The copy order is not simply #1 to #26: #108 is the X clearance (#11), #109 is the spindle speed (#19), and #110 is the approach feed (#9).
How the macro counts the passes
The depth is 60 − 49 = 11 mm on diameter, which is 5.5 mm per side. From the pitch and the two width values, the macro also sets a flank start offset:
#112 = [#102-#106-#107]/2 = [10 − 3 − 3.93] / 2 = 1.535 mm
X clearance is #120 = 60 + 5 = 65. The thread ends at #121 = 5 − 200 = −195. Then comes the pass count for the centre root:
#122 = FIX[[[#100-#101]/[2*#104]]+0.9999] = FIX[(60 − 49) / (2 × 0.5) + 0.9999] = FIX[11.9999] = 11 root passes
FIX drops the decimals. Adding 0.9999 first means any remainder rounds the pass count up, so no pass is ever deeper than the step you asked for. The factor of 2 is there because X is programmed on diameter, so a 0.5 mm step per side is 1 mm on diameter.
Depth per root pass is then #123 = 11 / 11 = 1 mm on diameter (0.5 mm a side). The flanks use the same maths with #6 (0.5), so #124 = 11 and #125 = 1 mm.
The 15° Z-shift that keeps the wall at 15°
This is the line that makes the flanks:
#126 = [#125/2]*TAN[15.]
#125 / 2 = 1 / 2 = 0.5 mm — half the diameter step, which is the radial depth per pass. TAN[15.] = 0.2679, so #126 = 0.5 × 0.2679 = 0.134 mm Z shift per pass.
Every flank pass goes 0.5 mm deeper (radial) and slides 0.134 mm in Z. Radial depth × tan 15° is how far Z moves each pass, so the wall stays at exactly 15°.

The 15° angle is fixed in line 37 (TAN[15.]). This lesson covers the 15° form only.
The three cutting phases
Each pass follows the same pattern: rapid to X65, rapid to the Z start, switch to G98 and feed in with G1 at #110 (3000), switch back to G99, cut the thread with G32 F#102 (pitch 10 mm per revolution), then rapid out to X65.
The setup block is metric (G21), ZX plane, G54, tool T0101, G97 S300 M03 and coolant on, then a rapid to X65 Z5.
Phase 1: Centre root
A WHILE loop counts #130 from 0 to 10, so it runs 11 times. The test is LT (less than #122); at 11 the loop ends.
Pass 1: 60 − 1 × 1 = X59Pass 2: 60 − 2 × 1 = X58Pass 11: 60 − 11 × 1 = X49
Pass 11 reaches the root Ø49 (#2). Every root pass starts at Z5 (#111) and threads to Z−195 (#121).

Phase 2: First 15° flank, +Z side
This loop uses LE (less than or equal), so #140 runs 0 to 11 — 12 passes, not 11.
#141 = #100-[#140*#125] (X depth)#142 = #112-[#140*#126] (Z offset)#143 = #111+#142 (Z start, +Z side)#144 = #143-#103 (Z end = start − 200)
Pass 0: X60, Z start = 5 + 1.535 = 6.535, Z end = 6.535 − 200 = −193.465. Pass 11: X49, Z offset = 1.535 − 11 × 0.134 = 0.061, so Z start = 5 + 0.061 = 5.061.
Every pass is 1 mm deeper on diameter and 0.134 mm back toward the centre. That staircase forms the 15° wall. G0 Z#143 is where the shift is applied.
In the editor screenshots, line 74 is partly hidden behind the status bar. It is the G98 before the G1 infeed of this loop, matching line 54 in the root loop and line 94 in the third loop.
Phase 3: Second 15° flank, −Z side
The depth steps and the 0.134 mm shift are the same. Only the sign of the Z start changes:
#153 = #111-#152
Pass 0: Z start = 5 − 1.535 = 3.465, Z end = 3.465 − 200 = −196.535. Pass 11: Z start = 5 − 0.061 = 4.939.
One minus sign mirrors the first flank and closes the trapezoid. Root + (+Z flank) + (−Z flank) = trapezoid.
At the end the tool retracts to X85 and Z100, coolant off, spindle stop, program end. The simulator shows PITCH 10.00 and ROOT Ø49.00 — the machine cut what the variables asked for: pitch 10 from #3 and root Ø49 from #2.
Practical notes: adapting it for a new thread
- Edit only the twelve inputs (lines 2–13). Set #1 (major Ø), #2 (root Ø), #3 (pitch), #4 (length) and #26 (Z start) for your part.
- Choose your depth steps. #5 sets the root passes and #6 the flank passes. If you change #5 from 0.5 to 0.25, then #122 = FIX[11 / (2 × 0.25) + 0.9999] = 22 root passes, and #123 = 11 / 22 = 0.5 mm per pass on diameter. No other line changes; the macro recalculates everything.
- Re-check #7 and #8 for the new pitch. They set the flank start offset #112 = [#3 − #7 − #8] / 2, so they must suit your thread form and your tool.
- Set the clearance, speed and feed (#11, #19, #9) for your machine, material and tooling.
- Prove it out in the simulator first. Check that the root reaches your #2, that both flanks start where you expect (#143 and #153 in the macro watch), and that the end message shows the pitch and root you asked for.
For training only — always verify tooling, offsets and clearances on your machine.
The full lesson in CNC Automation Pro 2026
This 15 degree trapezoidal thread lesson sits in CNC Automation Pro 2026, in the Macro Design & Development section. Open the course to follow the macro on screen, change the inputs, and see how the three phases build the form.
Try the MacroMill CNC simulators
Try the MacroMill CNC simulators at macromillcnc.com. Write the inputs, step through the loops, and watch the flanks form before a program reaches a real machine.
- MacroMill software — simulators and training, including lathe threading macros.
- Join the MacroMill WhatsApp group for tips and updates: chat.whatsapp.com/Htae97asBiD14QiwMXjGJA
MacroMill

Leave a Reply