How bolt-circle coordinates are calculated
For pitch-circle radius r, center (cx, cy), and hole angle θ, each absolute coordinate is X = cx + r cos(θ) and Y = cy + r sin(θ). Angular spacing is 360° divided by the hole count. This page defines 0° on +X and 90° on +Y; the selected clockwise or counterclockwise direction determines the sign of each angular step.
Chord center spacing is 2r sin(π/n). If a hole diameter is supplied, the adjacent edge-clearance result subtracts that diameter from the chord spacing. It is a 2D proximity check, not a strength, thread-engagement, washer, counterbore, or edge-distance calculation.
What the G-code output includes
The snippet sets absolute distance mode, the XY plane, feed-per-minute mode, units, a selected work offset, and a basic G81 drilling cycle. It explicitly cancels the cycle with G80. These modal roles follow the NIST RS274/NGC reference and the LinuxCNC G-code reference.
The generator moves to the entered safe work Z before the first XY position and inserts an M0 verification stop. That does not establish a safe machine position. The snippet omits tool change, active tool-length offset, spindle direction/speed, coolant, machine-coordinate moves, and ending behavior because those are controller- and setup-specific.
Coordinate and controller conventions
PCD means the diameter through hole centers. Confirm whether a drawing instead gives bolt-circle radius, chord spacing, or a diameter over hole edges. Verify the selected work offset places the entered center where intended, and confirm axis signs while standing in the machine’s defined orientation—not from a flipped drawing or underside view.
G-code dialects differ. Canned-cycle Z and R behavior, G98/G99 returns, comment syntax, accepted precision, block formatting, optional stops, and safety-line expectations can vary. Do not assume “common” syntax means compatible. Backplot and simulate the exact saved file for the target control.
Machining safety checklist
- Confirm the drawing revision, PCD, count, start angle, center, coordinate system, units, and hole order.
- Set and independently indicate the work zero; verify the first coordinate manually.
- Confirm tool, holder, length compensation, spindle, feed, depth, R plane, clamps, stock, and clearance.
- Simulate, dry run above the work, use single block and reduced rapid override, then inspect the first feature.
- Follow the machine manufacturer’s manual, shop procedures, guarding, training, and applicable safety requirements.
Frequently asked questions
Is PCD the same as the outside diameter?
No. PCD or bolt-circle diameter passes through the hole centers. The part’s outside diameter and hole diameter are separate dimensions.
Why are 0° and 90° on the right and top?
The calculator uses the standard XY math convention: 0° is +X and 90° is +Y. Clockwise ordering subtracts the step; counterclockwise ordering adds it.
Can I paste this G-code directly into my machine?
No. It is deliberately an incomplete snippet. Controller dialect, safe machine position, tool and length offset, work zero, spindle, feed, coolant, obstacles, and ending behavior must all be verified and completed.
What is the difference between G98 and G99?
In common drilling-cycle usage, G99 returns to the R plane between holes, while G98 returns to the cycle’s initial Z level. Confirm the exact behavior in the target controller manual.
Why did the generator reject my decimal precision?
If rounded X/Y text makes two distinct holes identical, the generated program would be ambiguous or wrong. Increase coordinate decimals or correct the geometry.
Does the hole diameter change coordinates?
No. Coordinates always locate hole centers on the PCD. Hole diameter only changes the preview and adjacent edge-clearance check.
Browse machining and CNC calculators · Cone flat pattern generator · All ToolQuill tools