G07 on CNC: Cylindrical and Polar Interpolation (and When Not to Use It)
In CNC programming, you might encounter information suggesting that G07 is a G-code for “imaginary axis interpolation.” This is generally incorrect for modern, mainstream CNC controls. While the concept of “imaginary axis interpolation” is related to some advanced machining techniques, G07 itself is not a standard command for it. Instead, G07, or more commonly a variant like G07.1 (Fanuc) or G107 (Haas), is often associated with cylindrical interpolation.
This article clarifies the situation, explaining:
- The concept of cylindrical interpolation.
- The difference between circular interpolation (G02/G03) and cylindrical interpolation.
- The difference between cylindrical interpolation and polar coordinate programming.
- How cylindrical interpolation is implemented on various control systems (Fanuc, Siemens, Haas, Mazak, Mitsubishi).
- Programming examples.
- Troubleshooting tips.
- The role of CAM software.
Crucial Note: Before using any G-code, always consult the programming manuals for your specific CNC control system and machine tool. Never assume a G-code’s function without verification.
1. Cylindrical Interpolation: Machining on a Curved Surface
Cylindrical interpolation is a powerful CNC feature that allows you to machine features on the surface of a cylinder as if that surface were “unwrapped” and laid flat. Imagine taking the label off a soup can and laying it flat on a table – that’s the basic idea.
Key Concepts:
- Virtual Rotary Axis: Cylindrical interpolation defines a virtual rotary axis. This is often designated as C (on many Fanuc and other controls) or sometimes Y. This virtual axis represents rotation around the workpiece’s central axis (which is usually the Z-axis on a lathe and is often programmed as X or Y on a mill, but can be any of the linear axes.). It’s important to note that your machine may or may not have a physical C-axis. Cylindrical interpolation can often be used even without a physical C-axis, by using a virtual one.
- “Unwrapped” Plane: The control system treats the cylindrical surface as a flat plane. One axis of this plane is the virtual rotary axis (C or Y), and the other is a linear axis (typically Z on a lathe, or X or Y on a mill, depending on setup).
- 2D Programming: You program the desired feature (slot, cam profile, engraving, etc.) as if you were machining it on a flat surface, using G01, G02, G03, and other standard G-codes. The control system then “wraps” this toolpath onto the cylinder.
- Radius is Essential: The cylinder’s radius must be defined correctly for the calculations to work.
Why Use Cylindrical Interpolation?
- Milling on Turned Parts (Lathes with Live Tooling): This is a primary application. It allows you to use live tooling (milling cutters mounted on the lathe’s turret) to mill features around the circumference of a turned part. Examples include:
- Slots
- Keyways
- Flats
- Cam profiles
- Engraving
- Milling Cams (Mills): Cylindrical interpolation is also used on machining centers, typically in conjunction with a 4th axis (rotary axis), to machine cylindrical cams and similar features.
- Simplified Programming: For some features, programming in the “unwrapped” plane is much simpler and more intuitive than calculating the required 3D movements in Cartesian coordinates.
2. Circular Interpolation (G02/G03) vs. Cylindrical Interpolation: The Difference
It’s important to distinguish between circular interpolation (G02/G03) and cylindrical interpolation:
G02/G03 (Circular Interpolation):
- Creates arcs and circles within a single, flat plane (e.g., XY, XZ, or YZ).
- The tool moves in a circular path within that plane.
- Used for creating circular features on flat surfaces (or on the face of a turned part, with live tooling and G17).
Cylindrical Interpolation:
- Creates toolpaths that are “wrapped” around a cylindrical surface.
- Involves a virtual rotary axis and a linear axis.
- Used for creating features on the circumference of a cylindrical part.
3. Polar Coordinate Interpolation (G16/G15): A Different Concept
Polar coordinate interpolation is another CNC feature, often confused with cylindrical interpolation. However, they are distinct:
- Polar Coordinates (G16/G15): Define positions using a radius and an angle, instead of Cartesian coordinates (X, Y, Z). This is useful for features arranged in a circular pattern (e.g., bolt hole circles) or for milling on the face of a turned part (with live tooling). G16 enables polar mode, and G15 cancels it.
- Cylindrical Interpolation: “Unwraps” a cylinder for machining on its circumference.
The key difference is that polar coordinates are still fundamentally planar (although the plane can be rotated), while cylindrical interpolation deals with a curved surface.
4. G07, G07.1, G107, and Other Control-Specific Commands
G07 itself is not a standard G-code for cylindrical interpolation. Here’s how different controls handle it:
Fanuc:
- On some Fanuc controls (often as an option), cylindrical interpolation is enabled using the G07.1 command (sometimes written as G107 – check your manual!). This is not a standard feature on all Fanuc controls.
- Syntax (Conceptual - Check Your Manual):
G07.1 C<radius> ; Enable cylindrical interpolation (C is the virtual rotary axis)
; ... (Program movements using C and a linear axis) ...
G07.1 C0 ; Disable cylindrical interpolation
- C: C designates the virtual rotary axis. is the radius of the cylinder you’re machining in the currently active units. This is a critical parameter.
Siemens:
Siemens controls use the TRANSMIT function for polar coordinate interpolation (milling on the face of a cylindrical workpiece, as if the end of the cylinder were unwrapped). And they use TRACYL for cylindrical interpolation (milling on the circumference of a cylindrical workpiece.). These are not simple G-codes; they are more like specialized cycles or transformations.
Haas:
Haas lathes with live tooling and a C-axis, and mills with a rotary axis, typically use G107 for cylindrical interpolation. It is very similar in operation to Fanuc’s G07.1.
Mazak:
- Mazatrol: Cylindrical interpolation, like most operations, is handled within the conversational programming environment. You would define the cylindrical workpiece and the features, and the control would automatically generate the necessary toolpaths.
- EIA/ISO: Refer to specific machine documentation
Mitsubishi:
Refer to specific machine documentation.
Other Controls:
Always consult your documentation.
5. Programming Examples (Cylindrical Interpolation - Using G07.1/G107)
Here are examples, primarily focusing on Fanuc’s G07.1 (and conceptually similar for Haas G107), for both lathes and mills. Remember to adapt the code to your specific control system and machine configuration.
CNC Lathe Examples (Fanuc G07.1 - with Live Tooling):
Straight Slot Along the Circumference:
; Mill a straight slot 1 inch long along the circumference of a 2-inch diameter cylinder.
; Assume the tool is already positioned at the starting point.
G28 U0 W0 ; Home
T0101 M06; Tool change
G97 S1000 M03; Spindle on (constant RPM)
G00 X2.5 Z1.0 C0 ; Rapid to above the start point. C-Axis Engagement Required.
G07.1 C1.0 ; Enable cylindrical interpolation. C is the rotary axis, radius = 1.0 inch.
G01 Z0.5 F10.0 ; Feed in Z to the start of the slot
G01 C360.0 F50.0 ; Mill the slot (C rotates 360 degrees)
G01 Z1.0 ; Retract in Z
G07.1 C0 ; Disable cylindrical interpolation
G28 U0 W0 ; Home
M30 ; Program end
Curved Slot (Arc) on the Circumference:
; Mill a 90-degree arc slot on the circumference of a 2-inch diameter cylinder.
G28 U0 W0 ; Home
T0101 M06; Tool Change
G97 S1000 M03 ; Spindle on (constant RPM)
G00 X2.5 Z1.0 C0 ; Rapid to above start, C-axis engagement may be required
G07.1 C1.0 ; Enable cylindrical interpolation, radius = 1.0 inch.
G01 Z0.5 F10.0 ; Feed in Z to the start of the slot
G03 C90.0 Z0.0 R0.5 F5.0 ; Mill the arc (C moves 90 degrees counterclockwise)
; We're using G03 and R, just like we would on a flat surface,
; but the C-axis movement is what creates the arc on the cylinder.
G01 Z1.0 ; Retract in Z
G07.1 C0 ; Disable cylindrical interpolation
G28 U0 W0 ; Home
M30 ; Program end
Milling a Flat:
; Mill a flat on 2" diameter
; Assume C-axis is zeroed at the desired flat location
G28 U0 W0 ; Home
T0101 M06; Tool Change
G97 S1000 M03 ; Spindle On
G00 X2.5 Z.1 C0 ; position above work
G07.1 C1.0 ; Enable cylindrical interpolation, radius = 1.0 inch.
G01 Z-.25 F5 ; feed to depth
G1 C45 F10 ; cut to 45 degrees C axis
G1 C-45 ; cut to -45 degrees C axis
G1 Z.1 F50; retract
G07.1 C0 ; Disable cylindrical interpolation
G28 U0 W0 ; Home
M30;
CNC Machining Center Examples (Fanuc G07.1 or Haas G107 - with 4th Axis):
These examples assume a 4th axis (A-axis, rotating around X) with the cylindrical workpiece’s axis parallel to the X-axis. Adapt as needed for your specific setup.
Straight Slot (Mill - 4th Axis):
; Cylinder diameter is 2 inches (radius = 1 inch).
G28 U0 W0 ; Home
T01 M06 ; Tool change
G00 G90 G54 X0 Y0 Z1.0 A0 ; Rapid to safe position
S1000 M03 ; Spindle on
G07.1 A1.0 ; Enable cylindrical interpolation, A is rotary axis, radius = 1.0
G01 Z-0.25 F50 ; Feed to cutting depth
G01 X5.0 F100 ; Mill the slot (along X-axis)
G00 Z1.0 ; Rapid retract
G07.1 A0 ; Disable cylindrical interpolation
G28 U0 W0 ; Home
M30 ; Program end
Curved Slot (Arc) (Mill - 4th Axis):
; Cylinder diameter is 2 inches (radius = 1 inch).
G28 U0 W0; Home
T01 M06 ; Tool change
G00 G90 G54 X0 Y0 Z1.0 A0 ; Rapid to safe position
S1000 M03 ; Spindle on
G07.1 A1.0 ; Enable cylindrical interpolation, A is rotary, radius = 1.0
G01 Z-0.25 F50 ; Feed to cutting depth
G01 Y1.0; Move to Arc Start
G03 A90.0 Y-1.0 R1.0 F50 ; Mill the arc (A rotates 90 degrees clockwise)
G01 Z1.0 ; Rapid retract
G07.1 A0 ; Disable cylindrical interpolation
G28 U0 W0; Home
M30 ; Program end
Engraving (Mill - 4th Axis - Conceptual):
; Cylinder diameter is 2 inches (radius = 1 inch).
G28 U0 W0; Home
T01 M06 ; Tool change (engraving tool)
G00 G90 G54 X... Y... Z1.0 A0 ; Rapid to safe position (adjust X and Y)
S15000 M03 ; Spindle on
G07.1 A1.0 ; Enable cylindrical interpolation
; ... (Series of G01, G02, G03 moves using A and Y for engraving) ...
; (Best generated by CAM software)
G07.1 A0 ; Disable cylindrical interpolation
G28 U0 W0 ; Home
M30 ; Program end
3-Axis Mill, Cylinder Axis Parallel to Y (Conceptual):
In this scenario, imagine a cylinder laid sideways on the table of a 3-axis mill.
G28 U0 W0 ; Home
T0101 M06 ; Tool change
G00 X-1.1 Y0 Z.1
G07.1 Y1.0 ; Cylindrical Interpolation, cylinder axis along Y, 1" radius
G1 Z-.125 F5 ; feed to depth
G1 X5 F50 ; Cut slot along length of cylinder
G1 Z.1 F100; retract
G07.1 Y0 ; cancel cylindrical interpolation
G28 U0 W0; Home
M30
Haas G107 (Similar to Fanuc G07.1):
;Haas example (conceptual) - Straight slot on cylinder mounted on A-axis
G28 U0 W0; Home
T01 M06; Tool change
G00 G90 G54 X0 Y0 Z1.0 A0 ; Rapid to safe position
S1000 M03 ; Spindle On
G107 A1.0 ; Enable cylindrical interpolation, A is rotary axis, radius = 1.0
G01 Z-.25 F50; Feed to depth
G01 X5.0 F100; Mill Slot
G00 Z1.0; Rapid retract
G107 A0; Disable cylindrical interpolation.
G28 U0 W0; Home
M30;
6. Helical Interpolation (G02/G03 with Z) - Not Cylindrical Interpolation
Remember that helical paths (spirals) are created using standard G02 (clockwise) or G03 (counterclockwise) circular interpolation, combined with simultaneous movement in the Z-axis. This is different from cylindrical interpolation.
7. Troubleshooting (Cylindrical Interpolation)
- “Incorrect Radius” or Similar Error: The most common error. Double-check the radius value in G07.1 (or equivalent). Use the radius, not the diameter.
- “Illegal Axis Movement”: Make sure you’re using the correct virtual axis designation (usually C or Y) and the correct linear axis.
- “Mode Not Active”: Make sure you’ve enabled cylindrical interpolation mode (G07.1 C) before attempting to use it.
- Distorted Features: If the feature is stretched or compressed along the circumference, you likely have the wrong radius value, or your C-axis (or equivalent rotary axis) is not properly calibrated.
- Collisions: Ensure all movements are safe.
8. CAM Software: The Preferred Method
For most cylindrical interpolation applications, and especially for complex geometries, CAM software is the strongly recommended approach. CAM systems handle the “unwrapping” calculations automatically, generate optimized toolpaths, and significantly reduce the risk of errors. You define the cylinder and the features, and the software does the rest. You usually don’t need to manually program G07.1 or worry about the virtual axis calculations.
9. Frequently Asked Questions (FAQ)
Q: Is G07 a standard G-code for cylindrical interpolation?
A: No. G07 itself is not standard. G07.1 (Fanuc) and G107 (Haas) are common, but always check your documentation. Siemens uses TRANSMIT/TRACYL.
Q: What’s the difference between circular and cylindrical interpolation?
A: Circular interpolation (G02/G03) creates arcs in a plane. Cylindrical interpolation creates toolpaths on a cylindrical surface.
Q: How do I mill features on a turned part’s circumference?
A: Use cylindrical interpolation (if your machine has it) or CAM software.
Q: How do I mill features on a turned part’s face?
A: Use polar coordinate interpolation (if your machine has it) or CAM software.
Q: How is cylindrical interpolation handled on a mill without a rotary axis?
A: If the cylindrical feature’s axis is aligned with one of your mill’s linear axes, cylindrical interpolation can be used.
10. Conclusion
G07 itself is not a standard G-code for “imaginary axis interpolation.” The key to machining features on cylindrical surfaces is cylindrical interpolation, often implemented using control-specific commands like G07.1 (Fanuc) or G107 (Haas). This feature allows you to program as if the cylinder were unwrapped into a flat plane. Always consult your machine’s documentation to determine the correct commands and procedures for your specific control system. For most applications, and especially for complex geometries, CAM software is the recommended and most efficient approach. It handles the complexities of cylindrical interpolation, allowing you to focus on your part design and machining strategy.