Example program · Mill
Rigid Tapping Program (M8 × 1.25) — G-Code Example
Spot drills, drills Ø6.8 and rigid-taps four M8 × 1.25 holes, 15 mm deep.
Spot drills, drills Ø6.8 and rigid-taps four M8 × 1.25 holes, 15 mm deep.
| Item | Value |
|---|---|
| Machine | CNC mill / machining centre (Fanuc-style) |
| Units | Metric (G21) |
| Lines | 26 |
Program
O1006 (M8 X 1.25 TAPPED HOLES)
G21 G17 G40 G49 G80 G90
T6 M06 (6.8 MM DRILL)
G54 G00 X15. Y15.
S1400 M03
G43 H06 Z25. M08
G98 G83 Z-20. R2. Q6. F150.
X45.
Y45.
X15.
G80
G91 G28 Z0
G90
T7 M06 (M8 X 1.25 SPIRAL FLUTE TAP)
G54 G00 X15. Y15.
G43 H07 Z25. M08
M29 S500
G98 G84 Z-15. R5. F625.
X45.
Y45.
X15.
G80
M09
G91 G28 Z0
G90
M30▶ Simulate in the G-code viewer
How it works
- Feed = 500 RPM × 1.25 mm = 625 mm/min, exactly.
- Drill depth is 5 mm deeper than the thread so the tap does not bottom.
- Haas: omit M29 — rigid tapping is automatic with G84.
Codes used in this program
- G84 — Tapping Cycle (Right-Hand)
- M29 — Rigid Tapping Mode (Fanuc)
- G83 — Peck Drilling Cycle (Deep Hole)
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)
- Internal Thread Milling M12 × 1.75
- 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