G-code bolt hole circle generator
Writes an example drilling program for holes spaced evenly round a pitch circle diameter (PCD), using a G81 drill cycle or a G83 peck cycle, and reads it back to draw the holes.
How it works, guides and notes
How it works
Hole i sits at angle θ = start + i × 360°/N, so X = centre X + (PCD/2)·cos θ and Y = centre Y + (PCD/2)·sin θ. Positions are rounded to 0.001 mm (or 0.0001 in). The first line of the cycle carries Z, R, Q and F; most controls then drill one hole for each following X/Y line until G80 cancels the cycle.
G98 makes the drill return to the height it started from (the safe Z) between holes, which clears clamps. G99 would return only to the R plane. On many lathes G98 and G99 mean something else (feed per minute and per revolution). See the G-code reference.
Need the positions only, or a chord for dividers? Use the PCD calculator.
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.