G68 and G69 Explained: Rotating Coordinate Systems in CNC Programming
Need to machine angled slots, holes, or features without using a CAM system?
Use G68 to rotate your coordinate system and G69 to reset it.
This guide shows:
- What G68 and G69 do
- Syntax and parameters
- How to rotate around a point
- Real-world use cases for angled machining
- Safety considerations and best practices
🔄 What Is G68?
G68 rotates the active coordinate system around a defined point and axis.
Instead of rotating the part, you rotate the XY coordinate grid, so that straight G-code moves appear at an angle.
🧠 Why Use G68?
- Machine features at 45°, 60°, or custom angles
- Avoid complex CAM operations
- Simplify code reuse for angled parts
🟢 G68 Syntax
📘 2D Rotation in XY Plane:
G68 X__ Y__ R__
| Code | Meaning |
|---|---|
| X/Y | Rotation center point |
| R | Rotation angle in degrees |
📘 Example:
G68 X0 Y0 R45 ; Rotate coordinate system 45° around (0,0)
G1 X100 Y0 ; Actually moves along 45° diagonal
🚫 G69 – Cancel Rotation
Use G69 to return to the normal coordinate system after you’re done.
G69 ; Cancel rotation
Always use this to prevent unintended behavior in the next operations.
🔁 How It Works (Visual)
- Normally,
G1 X50 Y0moves right. - With
G68 X0 Y0 R45, the same line moves diagonally (northeast). - You’re not rotating the part — just the coordinate grid.
🧪 Practical Example – Slot at 60 Degrees
G54
G0 X0 Y0
G68 X0 Y0 R60 ; Rotate 60° around origin
G1 X50 Y0 F200 ; This will cut along a 60° line
G1 X0 Y0
G69 ; Reset coordinate rotation
✅ Same G-code can be reused for multiple angles by just changing R value.
📏 Use Case: 4 Holes at 45° from Center
G68 X0 Y0 R45
G81 R2 Z-10 X20 Y0 F150
G68 X0 Y0 R135
G81 R2 Z-10 X20 Y0 F150
G68 X0 Y0 R225
G81 R2 Z-10 X20 Y0 F150
G68 X0 Y0 R315
G81 R2 Z-10 X20 Y0 F150
G69
Instead of calculating X/Y manually for each hole, we reuse same position with rotated axes.
⚠️ G68/G69 on 3-Axis Machines
- Only rotates in XY plane by default (Z is unaffected)
- Some controls support 3D rotation with G68.2 (Fanuc 31i, Siemens)
- Not available on all controls — check your machine!
🔐 Safety Tips
| Tip | Why |
|---|---|
Always reset with G69 | Prevent unintended rotated moves |
| Simulate rotated moves | Avoid confusion or crash |
| Use comments generously | Improve future debugging |
| Avoid G68 inside subprograms | Unless fully controlled/reset |
🧩 Summary Table
| Code | Function |
|---|---|
| G68 | Rotate coordinate system |
| G69 | Cancel rotation |
| R | Rotation angle (degrees) |
| X/Y | Center of rotation |
💡 Pro Tips
- Combine
G68with G52 temporary offsets for advanced setups - Great for angle repeat features on fixtures or rotary tables
- Use in macro programs to create dynamic part families
📚 Advanced: Combining G68 with Subprograms
G68 X0 Y0 R30
M98 P1000
G68 X0 Y0 R60
M98 P1000
G68 X0 Y0 R90
M98 P1000
G69
This runs the same pattern 3 times at 30°, 60°, and 90° rotations.
🧠 Conclusion
G68 and G69 allow powerful control of machining angles without rotating your part or rewriting code. When used correctly, they make your G-code modular, reusable, and incredibly efficient.
“Why rotate the part, when you can rotate the world around it?”
✅ Next Suggested Topic:
“Using G10 for Programmatic Work Offsets and Tool Data Input”
Leave a comment