Master CNC
Blog · 5 min read · 26 Oct 2026

G68 coordinate rotation

G68 rotates the coordinate system by an angle around a point. Program a feature once at 0°, then rotate it to 30°, 60°, 90° and so on. It also helps when a part is clamped slightly crooked and you know the angle.

The format

G17 G68 X_ Y_ R_  (rotate in the XY plane)
...
G69  (cancel)
  • X Y: centre of rotation, in the current work coordinates.
  • R: angle in degrees. Positive = counter-clockwise.
  • All following moves in that plane are rotated until G69.
G68 X50 Y50 R30 rotates the programmed feature by 30 degrees; G69 cancels
One feature program, rotated to every position.

Example: six slots around a hub

O3000 cuts one radial slot along +X from the hub centre at X50 Y50. The main program rotates it:

G90 G54 G17
#1 = 0
WHILE [#1 LT 360] DO1
  G68 X50. Y50. R#1
  M98 P3000
  G69
  #1 = #1 + 60.
END1

Without macros, write six lines with R0., R60., R120. and so on. Each slot is then at its own angle, and the slot program stays simple.

Correcting a crooked part

If a probe or indicator shows the part edge is 0.5° off, G68 X0 Y0 R0.5 lines the program up with the part. It is better to clamp the part square, but for a single part this can save a re-setup.

Rules

  • Use absolute coordinates for the first move after G68.
  • Cancel G68 before tool changes, G28 and the end of the program.
  • Cutter compensation can be used inside a rotated section, but switch it on and off inside the same rotated section.
  • G68 is an option on some controls.

Common mistakes

  1. Rotating about the wrong centre (the part zero instead of the hub centre).
  2. Clockwise angle on the drawing entered as positive.
  3. No G69 before the next tool: everything after is rotated.

Scaling and mirror image work in a similar way: see the G51 post in this series. Check rotated programs in graphics first.

Try it in Master CNC

Calculators, process sheet to program, simulation, codes and lessons. Free to start, no sign-in, on phone and laptop.

Open the app