Helical interpolation G-code

Writes an example program that bores a round hole by moving an end mill round a helix (G3 with Z) and finishes with one flat turn at the bottom.

Example code – check it and dry-run it, at your own risk. This program is a generic example, not written for your machine or control. Read every line against your control’s manual, simulate it, then run it above the work in single block with reduced rapids and feed before cutting. Check the work offset, tool length offset, units and clearance heights. See the terms of use.
How it works, guides and notes

How it works

The tool centre follows a circle of radius (hole − tool)/2. Each G3 block is one full turn: it ends at the same X/Y it started from, I is minus the radius and J is zero (I and J are measured from the start of the arc), and Z drops by the step. The number of turns is rounded up so each step is never bigger than you asked for. G3 with the spindle running forwards (M3) climb-mills the wall.

Hand check: 20 mm hole, 12 mm tool: radius = (20 − 12)/2 = 4.000. 10 mm deep at 1 mm a turn = 10 turns, each G3 X4.0 Y0.0 Z… I-4.0 J0.0, Z going −1, −2 … −10.

A tool smaller than half the hole leaves a core in the middle. Follow the tool maker’s ramp angle limit.

FANUC, Haas, Siemens, Heidenhain, LinuxCNC and Grbl are names or trademarks of their respective owners. They are mentioned only to describe which controls a code format relates to. Lathe Calculator is not affiliated with or endorsed by any of them. Trademarks.

Spotted a mistake? Report an error.