Skip to content

G68 and G69: rotating the coordinate system

G68 rotates the coordinate system by an angle around a point in the active plane, and G69 cancels that rotation. It lets you machine an angled geometry, or one repeated in several orientations, without recalculating a single dimension: you write the shape once horizontally and then call it rotated. It is modal and applies on top of the active work offset, so the rotation does not move the part, it moves the axes you program in. On many controls it is an option that may not be installed, and in five-axis milling there are specific variants for tilted planes that are not the same as this flat G68.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Coordinate equivalences
Machine
Milling, Mill-turn
Risk
High
Example
G68 X0 Y0 R45 / G69

Syntax by control

Fanuc (milling)
G17 G68 X50. Y40. R30. ... G69
X and Y are the center of rotation in the active plane and R is the angle, positive counterclockwise. If you leave out X and Y, the center is the current tool position, which tends to cause surprises.
Haas (milling)
G17 G68 X50. Y40. R30. ... G69
Same syntax. On Haas, rotation can be combined with G51 scaling and with mirroring, and it is best to cancel all three before ending the program.
Fanuc (5-axis, tilted plane)
G68.2 X.. Y.. Z.. I.. J.. K..
G68.2 is the tilted working plane defined by Euler angles and has nothing to do with flat G68: it defines a coordinate system in space for machining an angled face. Whether you have it and its format depend on the control and on the option purchased.
Siemens 840D / 828D
ROT RPL=30 ... ROT
Siemens does not use G68: programmable rotation is ROT in the active plane, or AROT if you want it added to an existing frame. It is canceled with ROT with no arguments or with TRANS on its own.
Heidenhain TNC (Klartext)
CYCL DEF 10.0 ROTATION / CYCL DEF 10.1 ROT+30
In Klartext, rotation in the plane is cycle 10, and the center of rotation is the active part zero, so it is combined with the datum shift of cycle 7. It is canceled by setting the angle to zero.

Address letters used with it

LetterWhat it setsUnit
X YCenter of rotation in the active plane, in work offset coordinates. If they are not written, many controls take the current tool position as the center.mm / in
RRotation angle. Positive counterclockwise seen from the positive axis perpendicular to the plane, the same rule as for arcs.degrees
G17 / G18 / G19Plane the rotation happens in. In G17 the rotation is around Z; changing planes with rotation active is a source of errors that are hard to spot.modal, no units
G90 / G91On some controls the R angle can be given in incremental, so it adds to the previous rotation. Check your manual to see whether your control allows it before relying on it.modal, no units

Worked example

A cover with four identical slots spaced every 90 degrees around the center of the part, which is at X50 Y50. The slot is written just once as a subprogram in its horizontal position, then called four times with the system rotated. That way, any change to the slot is made in a single place.

O0402 (CUATRO RANURAS CON G68)
( Program header. )
G21 G17 G40 G49 G80 G69
( Clean state. The G69 in the header is as important as the G40: an inherited rotation turns the whole part. )
G91 G28 Z0.
( Z to the reference point before the change. )
T4 M06
( Slotting end mill. )
G90 G54 G00 X50. Y50.
( Positions over the center of the cover, which will also be the center of rotation. )
G43 H04 Z50. M03 S3000
( T4 length offset and spindle on. )
M08
( Coolant. )
M98 P1000
( First slot, no rotation: subprogram O1000 machines it in its horizontal position. )
G68 X50. Y50. R90.
( Rotates the system 90 degrees counterclockwise around the center of the cover. From here on, the subprogram dimensions are read as rotated. )
M98 P1000
( Second slot: same subprogram, different orientation. )
G68 X50. Y50. R180.
( New absolute G68. On Fanuc, a second G68 replaces the previous one: it is not 90 plus 90, it is 180 from the origin. )
M98 P1000
( Third slot. )
G68 X50. Y50. R270.
( Fourth orientation. )
M98 P1000
( Fourth slot. )
G69
( Cancels the rotation. Without this block, everything after it gets machined rotated 270 degrees. )
G00 Z50. M09
( Retract in Z and coolant off. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( Back to absolute and end. )
Open the simulator to check the example

Practical keys to using G68/G69 in the workshop

What actually rotates and what does not

G68 rotates the coordinate system you program in, not the part or the table. The dimensions you write next are read on rotated axes, while the machine keeps moving along its physical axes. Practical consequence: the position display can show rotated part values and unrotated machine values, and that confuses an operator trying to check a dimension with the handwheel. It is also worth knowing that the rotation applies on top of the active work offset, so switching from G54 to G55 with the rotation on moves the center of rotation along with it.

The center of rotation is the value most often forgotten

If you write G68 with R but no X and Y, many controls take the current tool position as the center, and that is where unexplained out-of-square parts come from: the rotation is fine, but around a point that depends on the previous block. The safe habit is to always write the center explicitly, even if it is X0 Y0, and check it in simulation. In circular patterns that center usually matches the center of the hole circle, and on angled geometry, the corner the print is dimensioned from.

How it combines with subprograms and other transformations

The natural partner for G68 is the subprogram: you write the shape once and call it as many times as it has orientations, changing only the angle. If the shape also repeats at several positions, you combine G52 to move the zero with G68 to rotate it. What you have to keep in mind is the order in which the transformations apply, and that on Fanuc a second G68 replaces the previous one instead of adding to it, unless the control allows an incremental angle. When you finish, G69 and G52 back to zero, so nothing stays active.

Mistakes that cost you a part (or a tool)

  • Forgetting G69 at the end of the program: the next part gets machined rotated and nobody can tell where the misalignment comes from.
  • Writing G68 with R but no X and Y: the control rotates around the current tool position, which depends on the previous block.
  • Assuming two G68 blocks in a row add their angles: on Fanuc the second replaces the first unless it is programmed in incremental and the control allows it.
  • Changing plane from G17 to G18 with rotation active: the rotation now refers to another axis and the geometry ends up somewhere unexpected.
  • Confusing G68 with G68.2: the first rotates within the plane and the second defines a tilted plane in space for five-axis work.
  • Trying to adjust a dimension with the handwheel while reading part coordinates with rotation active: what you see does not match the machine axes.
  • Leaving rotation on for a reference return or a probing measurement: the results come out in the rotated system.

Frequently asked questions

Does G68 move the part or the axes?

Neither: it rotates the programming coordinate system. The machine keeps moving along its physical axes and the part stays where it is; what changes is how the dimensions you write from that block on are interpreted.

How do you cancel the rotation?

With G69 on Fanuc, Haas and compatible controls. On Siemens you write ROT with no arguments or TRANS on its own, and on Heidenhain you call cycle 10 again with the angle at zero. It is worth putting it in the header of the next program as well.

Which way does a positive angle rotate?

Counterclockwise, looking at the active plane from the positive side of the perpendicular axis. In G17 that means looking at the table from above, the same rule used to decide whether an arc is G02 or G03.

Can I use G68 together with cutter compensation?

Yes, and it is the usual thing on angled contours. The recommended order is to turn rotation on before entering the contour and cancel it after compensation has been canceled with G40, so you do not chain two changes in the same block.

Can G68 be used to machine an angled face on five axes?

No: regular G68 rotates within a plane. For working on a face tilted in space there are functions such as G68.2 on Fanuc, CYCLE800 on Siemens or PLANE SPATIAL on Heidenhain, which also orient the machine's rotary axes. Availability depends on the option purchased.

Related codes

G69G52/G92G54-G59TRANS/ROT/SCALE/MIRRORM98/M99

Other codes in Coordinate equivalences

See the full list of G and M codes

Related apps