G73 CNC Code: Mastering the Pattern Repeating Cycle in Turning
Introduction:
CNC turning involves a variety of canned cycles to simplify programming and improve efficiency. While G71 and G72 are well-known for stock removal (longitudinal and facing, respectively), the G73 Pattern Repeating Cycle offers a unique and powerful capability: machining irregular shapes efficiently by repeating a defined pattern. This guide provides a detailed explanation of G73, covering its function, syntax, applications, differences between control systems (Fanuc, Siemens, Haas, Mazatrol, Mitsubishi, Heidenhain, and others), best practices, troubleshooting, and programming examples. This article created for all levels of CNC users.
1. What is the G73 Pattern Repeating Cycle?
The G73 G-code initiates a canned cycle specifically designed for rough turning of irregular shapes or patterns on a CNC lathe. Unlike G71 (which makes cuts parallel to the Z-axis) and G72 (which makes cuts parallel to the X-axis), G73 follows a predefined contour, repeating it with successive cuts, gradually removing material until the final shape is achieved.
Key Concepts:
- Canned Cycle: A pre-programmed sequence of operations.
- Pattern Repeating: The G73 cycle repeats a defined cutting pattern multiple times, with each pass removing a specific amount of material.
- Irregular Shapes: G73 is particularly useful for shapes that are not easily machined with simple linear or circular movements (unlike G71 and G72, which are best for simple steps and tapers).
- Roughing: G73 is primarily a roughing cycle, meaning it’s designed to remove the bulk of the material, leaving a small allowance for a subsequent finishing operation (typically G70).
- Constant Material Removal: G73 maintains a constant amount of material removal on each pass, regardless of the shape of the contour. This is a key difference from G71 and G72.
- P and Q: Like G71 and G72, G73 uses these parameters to define the toolpath.
2. G73 vs. G71 (Longitudinal Stock Removal) and G72 (Facing Stock Removal)
It’s crucial to understand how G73 differs from the more common G71 and G72 cycles:
- G71 (Longitudinal Stock Removal): Makes cuts parallel to the Z-axis (along the length of the workpiece). Best for straight and tapered sections. The depth of cut is defined in the X-axis.
- G72 (Facing Stock Removal): Makes cuts parallel to the X-axis (across the face of the workpiece). Best for facing operations. The depth of cut is defined in the Z-axis.
- G73 (Pattern Repeating): Follows a defined contour, making successive passes that are offset from that contour. The depth of cut is defined along the contour itself, not along a single axis.
Think of it this way:
- G71: Like peeling an onion layer by layer along its length.
- G72: Like slicing an onion layer by layer across its face.
- G73: Like carving a complex shape out of the onion, with each pass removing a consistent amount of material from the entire surface of the shape.
When to use G73:
- Castings or Forgings: When the initial shape of the workpiece is irregular and needs to be gradually brought down to the final contour.
- Complex Contours: When the part has features that cannot be efficiently machined with G71 or G72.
- Pre-Formed Blanks: When starting with a blank that already has a rough shape close to the final part.
- When constant material removal is required.
3. G73 Syntax and Parameters
The G73 command typically uses a two-line format (similar to G71 and G72):
First G73 Block:
G73 U[X Offset] W[Z Offset] R[Number of Passes]
- G73: The G-code for the pattern repeating cycle.
- U[X Offset]: The total amount of material to be removed in the X-axis (diameter). This is not the depth of cut per pass, but the total offset from the starting point to the final profile. This is a signed value (positive for OD, negative for ID).
- W[Z Offset]: The total amount of material to be removed in the Z-axis. This is also a signed value.
- R[Number of Passes]: The total number of roughing passes to be made. The control will automatically divide the
U
andW
offsets byR
to determine the depth of cut for each pass.
Second G73 Block:
G73 P[Start Block] Q[End Block] U[X Allowance] W[Z Allowance] F[Feed Rate] S[Spindle Speed] T[Tool Number]
- G73: Again, the G-code for the pattern repeating cycle.
- P[Start Block]: The starting block number (N-number) of the sequence of blocks that defines the finished profile of the part.
- Q[End Block]: The ending block number (N-number) of the profile definition sequence.
- U[X Allowance]: The amount of material to leave for finishing in the X-axis (diameter). This is a signed value, similar to the
U
in the first block. - W[Z Allowance]: The amount of material to leave for finishing in the Z-axis. This is a signed value.
- F[Feed Rate]: The feed rate for the roughing cuts.
- S[Spindle Speed]: The spindle speed (RPM) or surface speed (if using G96).
- T[Tool Number]: The tool number (often redundant if already selected).
Example:
G73 U10.0 W4.0 R5 ; Total X offset 10mm (diameter), total Z offset 4mm, 5 passes
G73 P100 Q200 U0.4 W0.2 F0.3 S1000 T0101 ; Profile from N100-N200
4. Control System Variations
The implementation of G73 can vary between CNC control manufacturers:
- Fanuc:
- Two-Line Format: The two-line format (described above) is standard.
- Widely Used: Fanuc is a very common control system.
- Type I and Type II: Although G73 is generally used for irregular shapes, some Fanuc controls may have variations similar to Type I and Type II in G71. Refer to your manual.
- Siemens (SINUMERIK):
- CYCLE95 (Stock Removal Cycle): Siemens, like with G71/G72, typically uses
CYCLE95
for stock removal, including pattern repeating. You would define the contour and specify the stock removal parameters within theCYCLE95
call. - Parameters:
CYCLE95
uses a comprehensive set of parameters to control the cutting strategy.
- CYCLE95 (Stock Removal Cycle): Siemens, like with G71/G72, typically uses
- Haas:
- Syntax: Very similar to Fanuc (two-line G73).
- Intuitive Interface: Haas controls are known for being user-friendly.
- Mazatrol (Mazak):
- Conversational Programming: Pattern repeating is usually defined within the conversational programming interface, as part of the overall machining process. You would not typically write a
G73
command directly. - BAR OUT: Mazatrol uses BAR OUT in conversational programming.
- EIA/ISO (G-code): Mazak machines can run standard G-code, and G73 would be used similarly to Fanuc.
- Conversational Programming: Pattern repeating is usually defined within the conversational programming interface, as part of the overall machining process. You would not typically write a
- Mitsubishi:
- Syntax: Similar to Fanuc (two-line G73).
- Parameters: May have additional parameters or settings.
- Heidenhain:
- CYCLE: Heidenhain uses different cycles.
- Other Controls (Okuma, Fagor, etc.): Consult the specific programming manual.
Key Takeaways:
- Fanuc is a common reference: The two-line G73 format is widely used.
- Siemens uses
CYCLE95
: A more comprehensive cycle. - Mazatrol is conversational: Pattern repeating is handled within the conversational interface.
- Always check your machine’s manual! This is crucial.
5. The Profile Definition (P and Q Blocks)
The P
and Q
parameters in the second G73 line define the start and end block numbers of the G-code sequence that describes the finished shape.
Example:
N10 G73 U10.0 W4.0 R5
N20 G73 P100 Q200 U0.4 W0.2 F0.3 S1000 T0101
; ...
N100 G00 X40.0 Z2.0 ; Start of profile (P100) - Rapid in X only
N110 G01 Z0.0 F0.15 ; Feed to Z0
N120 G01 X20.0 Z-10.0 ; Define the shape
N130 G02 X30.0 Z-20.0 R10.0 ; Circular interpolation (CW)
N140 G01 Z-30.0
N150 G03 X50.0 Z-40.0 R10.0 ; Circular interpolation (CCW)
; ... (More profile blocks) ...
N200 G01 X60.0 Z-50.0 ; End of profile (Q200)
; ...
Important Points:
- Allowed Commands: Only G00, G01, G02, and G03 are allowed within the P-Q block sequence.
- First Move: The first move in the P-Q sequence should be a rapid (G00) or feed (G01) move only in X axis.
- The Shape: Machine will cut the material according to P and Q blocks.
- No other G-codes: You can not use different G-codes between P and Q blocks.
6. The G70 Finishing Cycle (After G73)
After the G73 roughing cycle, a G70 Finishing Cycle is typically used to machine the part to its final dimensions and achieve the desired surface finish.
- G70 Syntax:
G70 P[Start Block] Q[End Block]
- Relationship to G73: The
G70
command uses the sameP
andQ
block numbers as the precedingG73
command. - Example (Continuing from previous example):
; ...(G73 roughing cycle and profile definition as above) ...
N210 T0202 ; Select finishing tool
N220 G96 S250 M03 ; Constant Surface Speed for finishing
N230 G70 P100 Q200 ; Finishing cycle (using the same P and Q as G73)
N240 G00 X100.0 Z100.0 ; Rapid retract
N250 M30 ; Program end
7. Best Practices for Using G73
- Correct P and Q Values: Ensure the
P
andQ
values exactly match the start and end block numbers of the profile definition. - Appropriate U, W, and R Values: Choose values for
U
,W
, andR
that are appropriate for the material, tool, and machine. Too large a value forU
orW
can overload the tool. Too small value can lead more cycle time. - Optimize Feed and Speed: Use appropriate feed rates and spindle speeds for roughing.
- Use Coolant: Use appropriate coolant.
- Verify the Toolpath: Always simulate your program (including the G73 and G70 cycles).
- Consider Tool Nose Radius Compensation: You can use G41/G42 in P and Q blocks.
8. Troubleshooting Common G73 Problems
- “Sequence Number Not Found” Alarm:
- Cause: Incorrect
P
orQ
values. - Solution: Double-check the
P
andQ
values.
- Cause: Incorrect
- “Illegal Argument” or “Invalid G-Code” Alarm:
- Cause: Syntax errors or unsupported parameters.
- Solution: Consult your machine’s manual and review the G73 syntax.
- “Non-Monotonic Motion” Alarm (Type I or Type II):
- Cause: The profile violates the monotonicity rules for the selected G73 type.
- Solution: Redesign the profile or use a different machining strategy.
- Incorrect Dimensions:
- Cause: Incorrect
U
andW
values, incorrect tool offsets, or errors in the profile definition. - Solution: Double-check all parameters and offsets, and review the profile definition.
- Cause: Incorrect
- Excessive Tool Wear/Breakage:
- Cause: Too large a depth of cut, excessive feed rate, or inappropriate tool.
- Solution: Reduce the depth of cut/feed rate, use a more robust tool.
- Poor Surface Finish:
- Cause: Excessive depth of cut, incorrect feed, tool vibration.
- Solution: Reduce depth, adjust feed, use different tool.
9. Complete Example Program (Fanuc Style)
O0001 (G73 Example Program)
; --- Tool Setup ---
T0101 ; Select roughing tool (Tool 1, Offset 1)
T0202 ; Select finishing tool (Tool 2, Offset 2)
; --- Work Offset ---
G54 ; Select Work Coordinate System 1
; --- Spindle and Coolant ---
G97 S1000 M03 ; Constant RPM mode, spindle on clockwise at 1000 RPM
M08 ; Coolant on
; --- G73 Roughing Cycle ---
N10 G73 U10.0 W4.0 R5 ;Total X offset 10mm (diameter), total Z offset 4mm, 5 passes
N20 G73 P100 Q200 U0.4 W0.2 F0.3 S1000 ; Define G73 cycle parameters
; --- Profile Definition (Start Block N100, End Block N200) ---
N100 G00 X40.0 Z2.0 ; Rapid to X starting position, outside the final diameter
N110 G01 Z0.0 F0.15 ; Feed to Z0 (face of part)
N120 G01 X20.0 Z-10.0 ; Turn a taper
N130 G03 X30.0 Z-20.0 R10.0 ; Circular interpolation (CCW)
N140 G01 Z-30.0 ; Turn a straight section
N150 G02 X50.0 Z-40.0 R10.0 ; Circular interpolation (CW)
N160 G01 Z-60 ; Turn a straight section
N170 G01 X60 ; Turn a straight section
N180 G01 Z-70 ; Turn a straight section
N190 G01 X70 ; Turn a straight section
N200 G01 Z-80.0 ; End of profile (Q200) - Last point of the *finished* shape
; --- G70 Finishing Cycle ---
N210 T0202 ; Select finishing tool
N220 G96 S250 M03 ; Constant Surface Speed for finishing
N230 G70 P100 Q200 ; Finishing cycle (using the same P and Q as G73)
; --- Retract and End ---
N240 G00 X100.0 Z100.0 ; Rapid retract to a safe position
N250 M30 ; Program end
Explanation of the Complete Example:
- Tool Setup: The program uses two tools: T01 for roughing and T02 for finishing. Each tool has its own offset.
- Work Offset: G54 is used to select the work coordinate system.
- Spindle and Coolant: The spindle is started in constant RPM mode (G97) for roughing, and coolant is turned on.
- G73 (First Line - N10):
U10.0
: Specifies a total X-axis offset of 10mm (diameter). This means the roughing cuts will start 10mm away from the final X-diameter defined in the profile.W4.0
: Specifies a total Z-axis offset of 4mm. The roughing cuts will start 4mm away from the final Z-position defined in the profile.R5
: Specifies 5 roughing passes. The control will divide theU
andW
values by 5 to determine the depth of cut for each pass.
- G73 (Second Line - N20):
P100 Q200
: Defines the start (N100) and end (N200) block numbers of the profile definition.U0.4
: Leaves 0.4mm (diameter) of material in the X-axis for finishing.W0.2
: Leaves 0.2mm of material in the Z-axis for finishing.F0.3
: Sets the feed rate for roughing.S1000
: Sets the spindle speed (used because we are in G97 mode).
- Profile Definition (N100-N200):
N100 G00 X40.0 Z2.0
: The first move is a rapid (G00) to a point outside the final diameter of the part (X40.0) and slightly away from the face (Z2.0). This is the starting point for the roughing cuts. Note: The tool approaches only in X axis.N110
-N200
: These blocks define the finished profile of the part using a combination of linear (G01) and circular (G02, G03) interpolation. The G73 cycle will automatically generate the roughing passes based on this profile and the parameters in the G73 commands.
- G70 Finishing Cycle (N210-N230):
N210 T0202
: The finishing tool (T02) is selected.N220 G96 S250 M03
: Constant Surface Speed (G96) is activated for finishing, with a target surface speed of 250 m/min.N230 G70 P100 Q200
: The G70 finishing cycle is executed. It uses the same profile definition (N100-N200) as the G73 roughing cycle.
- Retract and End (N240-N250): The tool is retracted to a safe position, and the program ends.
This complete example demonstrates the typical workflow for using G73 and G70 together for roughing and finishing a turned part. Remember to adapt the specific parameters (depth of cut, feed rate, spindle speed, etc.) to your specific application, material, tooling, and machine. And always simulate your program before running it on the machine!
10. Conclusion: Efficient Roughing of Complex Shapes
The G73 Pattern Repeating Cycle is a powerful tool for CNC turning, providing an efficient way to rough machine parts with complex or irregular contours. By understanding its parameters, its relationship to G70, the variations between control systems, and best practices, you can significantly improve your machining productivity and part quality. G73 is a valuable tool for handling castings, forgings, and other non-uniform stock materials.