It can be very convenient to be able to execute g-code with the assumption that the coordinate system has been rotated. Consider, for example, a case where you want to repeat a pocket or slot multiple times on a part. The repeats are all laid out on a circle around some center point. This is a perfect excuse to use G68 coordinate system rotation.

G68 Example

Let's suppose we have a part that requires 3 "arched doorway" slots. We write a subprogram to do the arched doorway, and we want to be able to rotate the coordinates as we call the doorway subprogram for each slot. Our code would look like this:

G68 rotated the "arched doorway" slot through 3 calls of a subprogram to create 3 slots...

BTW, those fans in the middle of each pocket are tool entry and exit paths. You'll get a much better finish if your tool arcs into the cut rather than just heading straight in along a line. This is one of the many tricks discussed in our CAM Toolpath Considerations page of the Feeds and Speeds Cookbook.

Syntax for G68 Coordinate System Rotation

The syntax for a G68 is pretty simple. For Fanuc, use:

G68 <alpha> <beta> R<angle>

Where, alpha and beta are words for the 2 coordinates of the circle's center we want to rotate about. For G17, <alpha> is X and <beta> is Y. In the example, we had the circle center at X0Y0. R specifies the angle of rotation in degrees, counterclockwise.

For Mach3, we use a slightly different syntax:

G68 A<center coordinate 1> B<center coordinate 2> R<angle>

Rather than having the coordinate words vary with which plane is selected (G17, G18, or G19), Mach3 just uses the "A" and "B" words. The first G68 in the example would be written like so:

G68 A0B0 R120

To cancel rotation, just use a G69.

As you can see from the example, multiple G68's just replace the R or center values.

There is the option on some controls to make G68's relative, rather than absolute. In this case, rather than having multiple G68's replace the values, they are relative to the values. For most controls, the decision of whether subsequent G68's are relative or absolute is a parameter. For Mach3, it is a function of whether the "I" word is present (think "I" for "Incremental"). The value (address) of the word is ignored, but any I will cause Mach3 to treat the coordinate as relative.

Other Uses for G68 Coordinate Rotation

Beside the obvious usefulness of rotating the coordinates before calling a subprogram so that the same cut may be applied along a circular path, there are other important uses for G68. Here are some examples (for completeness, we include the subprogram example too):

- Simplify your part program by creation of subprograms that repeat cutting operations multiple times along an arc. This will also reduce the memory requirements of the part program.

- Align work that is not exactly aligned to the coordinate system. For example, suppose you wanted to run without tramming in a fixture. If you can probe the fixture to determine its angle, you can apply a G68 to "zero out" that angle and then run the part program. This can reduce setup time by reducing the need to be accurate and trammed in.

- If a part program is written for a bigger machine and has more Y-travel (extents) than X, you may be able to rotate the coordinates so the long axis is aligned with your X and still be able to run it.

- You may be able to nest more parts on your machine table if you can perform arbitrary rotations on them. This is very easy to do with G68.

- A part that is otherwise too large for a machine might fit if you could take advantage of the extra long diagonal dimension. Once again, this is easy to do with G68.

Exercises

1. Write a program similar to the example that takes some cutting operation, puts it in a subprogram, and then uses G68 to rotate it to multiple positions around the circle.