G90 CNC Code: The Diameter Cutting Cycle (Turning) Explained
Introduction:
In CNC turning, efficiently and accurately removing material to create cylindrical shapes is a fundamental operation. The G90 Diameter Cutting Cycle (also known as a straight turning cycle or box cycle) is a canned cycle that simplifies the programming of these straight, longitudinal cuts. This guide provides a detailed explanation of the G90 cycle as used in CNC turning, covering its function, syntax, parameters, variations across control systems (Fanuc, Siemens, Haas, Mazatrol, Mitsubishi, Heidenhain, and others), best practices, troubleshooting, and programming examples. It is suitable for all levels of CNC expertise.
1. What is the G90 Diameter Cutting Cycle (in Turning)?
G90, in the context of CNC turning, is a G-code command that initiates a canned cycle for straight turning operations along the Z-axis. It’s designed to remove material from the outer diameter (OD) or inner diameter (ID) of a cylindrical workpiece in a series of simple, rectangular movements. It is not the same as the G90 used for absolute positioning.
Key Concepts:
- Canned Cycle: A pre-programmed sequence of operations that automates a common machining task.
- Straight Turning: Machining a cylindrical surface by moving the tool parallel to the axis of rotation (Z-axis) of the workpiece. This reduces the diameter of the workpiece.
- Diameter Cutting: The G90 cycle specifically controls the diameter (X-axis) to which the material is cut.
- Longitudinal Turning: Turning along the length of the workpiece (Z-axis).
- Facing: Cutting across the end face of the workpiece (perpendicular to the axis of rotation). G90 is not typically used for facing; G94 is used for that.
- X-Axis: Diameter
- Z-Axis: Length
2. How the G90 Cycle Works
The G90 cycle performs the following sequence of operations:
- Rapid to Starting Point: The tool rapidly moves to a starting position that is clear of the workpiece. This starting point is usually defined before the G90 command.
- Feed to X-Diameter: The tool feeds in the X-axis (at the programmed feed rate) to the specified target diameter (
X
value in the G90 command). - Feed to Z-Position: The tool feeds in the Z-axis (at the programmed feed rate) to the specified final Z-position (
Z
value in the G90 command). - Rapid Retract (X): The tool rapidly retracts in the X-axis to the starting X position.
- Rapid Return (Z): The tool rapidly returns in the Z-axis to the starting Z position.
This creates a simple “box” cycle – hence the alternative name “box cycle.” It is important to understand G90 is a modal command.
3. G90 Syntax and Parameters
The basic syntax of the G90 cycle (for turning) is:
G90 X[Target Diameter] Z[Target Z-Position] F[Feed Rate]
- G90: The G-code for the diameter cutting cycle.
- X[Target Diameter]: The final diameter to which the tool will cut. This is an absolute coordinate in diameter mode (most common on lathes).
- Z[Target Z-Position]: The final Z-position to which the tool will cut. This is also an absolute coordinate.
- F[Feed Rate]: The feed rate for the cutting movements (typically in mm/rev or inches/rev on a lathe).
Example (Single Pass):
G00 X50.0 Z5.0 ; Rapid to a starting position (diameter 50mm, 5mm from the face)
G90 X40.0 Z-30.0 F0.2 ; Cut to a diameter of 40mm, ending at Z-30, feed 0.2 mm/rev
G00 X50.0 Z5.0 ; Rapid retract
Explanation:
G00 X50.0 Z5.0
: The tool rapids to a starting position that is outside the final diameter (X50.0) and clear of the face (Z5.0).G90 X40.0 Z-30.0 F0.2
: The G90 cycle is executed:- The tool feeds in the X-axis to a diameter of 40.0 mm.
- The tool feeds in the Z-axis to a position of Z-30.0 mm.
- The tool rapidly retracts in X to the starting X position (X50.0).
- The tool rapidly returns in Z to the starting Z position (Z5.0).
G00 X50.0 Z5.0
: The tool rapids back to the starting position (although this is often redundant after a G90 cycle, as the tool is already there).
4. Multiple Passes with G90
The real power of G90 comes from its ability to perform multiple passes to remove material incrementally. This is done by programming successive G90 commands, each with a smaller X-diameter (for OD turning) or a larger X-diameter (for ID turning).
Example (Multiple Passes):
G00 X50.0 Z5.0 ; Rapid to start
G90 X45.0 Z-30.0 F0.2 ; First pass to diameter 45mm
G90 X40.0 Z-30.0 F0.2 ; Second pass to diameter 40mm
G90 X35.0 Z-30.0 F0.2 ; Third pass to diameter 35mm
G00 X50.0 Z5.0 ; Rapid retract
Explanation:
- This example performs three passes to reduce the diameter from 50mm to 35mm.
- Each
G90
command defines a single rectangular cutting cycle. - The
Z
value remains the same in each pass (because we are turning a straight cylinder). - You could use different
Z
values in each pass to create a stepped or tapered shape, but this is not the typical use of G90. G71 is generally preferred for complex profiles.
5. Control System Variations
While the basic concept of G90 (as a diameter cutting cycle) is relatively consistent, there are variations between control systems:
- Fanuc and Similar (Haas, Mitsubishi): The syntax and behavior are generally as described above. G90 is a modal, canned cycle for straight turning.
- G90 X(U)… Z(W)… R… F… : Some controls can define taper amount by R value.
- Siemens (SINUMERIK):
- CYCLE95 (Stock Removal Cycle): Siemens relies heavily on
CYCLE95
for most turning operations, including straight turning.CYCLE95
is a much more comprehensive cycle than G90 and can handle complex contours, roughing, and finishing. While Siemens controls may recognize G90 in a Fanuc-compatible way,CYCLE95
is the preferred and more powerful method. - G90: You can also use it for absolute dimension programming.
- CYCLE95 (Stock Removal Cycle): Siemens relies heavily on
- Mazatrol (Mazak):
- Conversational Programming: Straight turning operations are defined within the conversational programming interface. You would select a turning process (e.g., “BAR OUT” for OD turning) and specify the starting and ending diameters, the length of the cut, and the cutting parameters. The control automatically generates the necessary toolpath.
- EIA/ISO (G-code): Mazak machines can run standard G-code, and G90 would function as expected.
- Heidenhain:
- CYCLE: Heidenhain uses cycles.
- Other Controls: Always consult your machine’s programming manual.
Key Takeaways:
- Fanuc is the most common reference: The
G90 X... Z... F...
syntax is widely used for the diameter cutting cycle. - Siemens uses
CYCLE95
: This is a much more powerful cycle that encompasses the functionality of G90 and more. - Mazatrol is conversational: Straight turning is defined within the conversational programming environment.
- Always check your machine’s manual!
6. G90 (Diameter Cutting) vs. G94 (Facing Cycle)
It’s important to distinguish between G90 (diameter cutting) and G94 (facing cycle) on CNC lathes:
- G90 (Diameter Cutting): Used for longitudinal turning (reducing the diameter along the Z-axis).
- G94 (Facing Cycle): Used for facing operations (machining the end face of the workpiece, moving primarily in the X-axis).
7. G90 vs. G71 (Rough Turning Cycle)
While G90 can be used for rough turning by programming multiple passes, the G71 Rough Turning Cycle is generally much more efficient for removing large amounts of material and for machining complex profiles.
- G90: Requires you to program each individual pass manually. Best for simple, straight cuts.
- G71: A canned cycle that automatically generates multiple roughing passes based on a defined finished profile. Much more efficient for complex shapes and large stock removal.
Use G90 for simple, straight diameter reductions. Use G71 for more complex roughing operations.
8. Best Practices for Using G90
- Correct Tool: Use a turning tool appropriate for the material and operation (OD or ID turning).
- Appropriate Feed and Speed: Use recommended cutting parameters for the tool and material.
- Safe Starting Position: Position the tool clear of the workpiece before starting the G90 cycle.
- Incremental Cutting: Use multiple G90 passes to gradually reduce the diameter, especially for large amounts of stock removal. This reduces tool load and improves surface finish.
- Coolant: Use appropriate cutting fluid.
- Verify the Toolpath: Always simulate your program.
- Tool Nose Radius Compensation: You can use G41/G42.
9. Troubleshooting Common G90 Problems
- Incorrect Final Diameter:
- Cause: Incorrect
X
value in the G90 command, incorrect tool offset, or tool wear. - Solution: Double-check the
X
value, verify the tool offset, and inspect the tool for wear.
- Cause: Incorrect
- Tapered Cut (Unintentional):
- Cause: Tool deflection, machine misalignment, or incorrect tool setup.
- Solution: Use a more rigid tool setup, check machine alignment, and reduce the depth of cut.
- Poor Surface Finish:
- Cause: Dull tool, incorrect feed/speed, or vibration.
- Solution: Use a sharper tool, adjust feed/speed, and check for machine stability.
- Machine Alarms:
- Cause: Syntax error
- Solution: Check your machine’s manual.
10. Conclusion: A Simple but Essential Turning Cycle
The G90 Diameter Cutting Cycle, while conceptually simple, is a fundamental and frequently used G-code in CNC turning. It provides a straightforward way to program straight, longitudinal cuts to reduce the diameter of a workpiece. While more advanced cycles like G71 are preferred for complex roughing, G90 remains a valuable tool for simple turning operations and is often used in conjunction with other G-codes to create complete part programs.