Example program · Mill
Internal Thread Milling M12 × 1.75 — G-Code Example
Thread mills an M12 × 1.75 internal thread, 12 mm deep, with an 8 mm single-profile thread mill, climbing from the bottom up.
Thread mills an M12 × 1.75 internal thread, 12 mm deep, with an 8 mm single-profile thread mill, climbing from the bottom up.
| Item | Value |
|---|---|
| Machine | CNC mill / machining centre (Fanuc-style) |
| Units | Metric (G21) |
| Lines | 21 |
Program
O1007 (THREAD MILL M12 X 1.75 INTERNAL RH)
G21 G17 G40 G49 G80 G90
T8 M06 (8 MM THREAD MILL)
G54 G00 X0 Y0
S6000 M03
G43 H08 Z5. M08
G00 Z-12.
G03 X2. Y0 I1. J0 F150. (TANGENTIAL ENTRY)
G03 X2. Y0 Z-10.25 I-2. J0 F300.
G03 X2. Y0 Z-8.5 I-2. J0
G03 X2. Y0 Z-6.75 I-2. J0
G03 X2. Y0 Z-5. I-2. J0
G03 X2. Y0 Z-3.25 I-2. J0
G03 X2. Y0 Z-1.5 I-2. J0
G03 X2. Y0 Z0.25 I-2. J0
G03 X0 Y0 I-1. J0 (TANGENTIAL EXIT)
G00 Z5.
M09
G91 G28 Z0
G90
M30▶ Simulate in the G-code viewer
How it works
- Path radius = (12 − 8) / 2 = 2 mm.
- Centre-line feed is reduced to (12 − 8)/12 of the edge feed — the thread milling calculator does this for you.
- Each full circle rises one pitch (1.75 mm).
Codes used in this program
Always check feeds, speeds, offsets and clearances for your own machine and tooling, and prove new programs with single block and reduced rapid.
More milling programs
- Face Milling Program (Zig-Zag Passes)
- Outside Contour with Cutter Compensation (G41)
- Circular Pocket with Helical Entry
- Bolt Hole Circle with Polar Coordinates (G16)
- Peck Drilling a Hole Grid (G83)
- Rigid Tapping Program (M8 × 1.25)
- Rectangular Pocket in Depth Passes Using a Subprogram
- Machining Multiple Parts with G54–G57
- Counterbore Holes for M6 Socket Head Screws
- Fine Boring a Precision Bore (G76 on a Mill)
- Milling a Slot with Ramping Entry
- Chamfering an Outside Edge with a Chamfer Mill
- Parametric Bolt Circle Macro (WHILE Loop)
- Spindle Warm-Up Program
- Setting a Work Offset Automatically with a Probe (G31)
- GRBL Router: Rectangle Cut-Out in Depth Passes
- GRBL / LinuxCNC Touch Plate Z Probe (G38.2)
- Haas G12 / G13 Circular Pocket in One Line
- Haas M97 Local Subprogram for Repeated Features
- High-Speed Peck Drilling in Aluminum (G73)
- Helical Boring a Ø20 Hole with a 10 mm End Mill