G68 & G69 G Codes: CNC Coordinate Rotation
Introduction
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 G-Code 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:
( Example use of G68 to make 3 slots in a circle ) T10 M6 G0 G90 G54.1 P20 X0 Y0 S8000 M3 G43 Z3 H22 D22 M8 ( First time we don’t rotate the slot )
M98 P0071 ( Second time we rotate 120 degrees )
G68 X0 Y0 R120. M98 P0071 ( Third time we rotate 240 degrees
G68 X0 Y0 R240. M98 P0071 G69 (Turn off coordinate rotation so it doesn’t confuse us later! ) G0 G90 Z250 M9 G0 G91 G28 Z0 Y0 M5 M30
:0071 (SUBPROGRAM FOR SLOT) G0 X0 Y-4. G0 Z-6. G1 Y-16.775 F400 G1 Y-10. G1 G41 X1.51 Y-13.51 G3 X5.01 Y-10. R3.5 G1 Y0 R3 G1 X-5.01 R3 G1 Y-16.775 G3 X5.01 Y-16.775 R5.01 G1 Y-10. G3 X1.51 Y-6.5 R3.5 G1 G40 X0 Y-10. G0 Z3 G0 X0 Y0 M99
