The Bolt Circle

Combine R-parameters, trig, a loop and indirect addressing into one parametric routine.

This is where it all comes together. Read the circle centre from the machine, loop over the holes, compute each one's X with trig, and stash the results in a table using indirect addressing — R[10 + R5] lands hole n in R(10+n). Change the count, the radius or the setup and nothing else moves.

Read firstCoordinate Systems & Work OffsetsA cross-control primer on CNC coordinate systems: machine vs work coordinates, the reference point, work offsets G54–G59 and the extended set, G52/G92/external offsets, how each control (Fanuc, Haas, Mazak, Mitsubishi, Siemens, Heidenhain, Okuma) names its offset registers, and how to set an offset manually, with G10, or from a macro.

Your turn

Drill a bolt circle centred on the live machine X ($AA_IM[X]). The hole count is in R1 and the radius in R2. Loop with R5 as the index from 0; for each hole compute the angle (R5 * 360 / R1) and store its X — centre plus radius times the cosine of the angle — into R[10 + R5]. So hole 0 lands in R10, hole 1 in R11, and so on.

The machine gives you

4 holes, 40 mm radius, centre at X100:$AA_IM[X] = 100R1 = 4R2 = 40
the same program with the centre at X0:$AA_IM[X] = 0R1 = 4R2 = 40

Your program is run once for each set of conditions. It has to work for all of them.

Loading...

This is a learning simulation — always prove out a program on the actual control before you cut metal.