G Code for Turning Radius: Syntax, Example, and Tips
In CNC turning, the radius of a curve is controlled using
G02 or G03 commands for clockwise or counterclockwise arcs, respectively. The radius is specified with the R parameter, which defines the arc's radius directly in the program.Syntax
The basic syntax to program a turning radius in G code uses G02 or G03 for circular interpolation. The R parameter sets the radius of the arc.
G02: Clockwise arc movementG03: Counterclockwise arc movementX,Z: Target coordinates for the arc end pointR: Radius of the arc
Example syntax: G02 X... Z... R...
gcode
G02 X20 Z-10 R5Example
This example shows a clockwise arc with a radius of 5 units from the current tool position to the point X20 Z-10.
gcode
N10 G00 X10 Z0 ; Rapid move to start point N20 G01 Z-5 F0.1 ; Linear move to start arc N30 G02 X20 Z-10 R5 ; Clockwise arc with radius 5 N40 G00 X50 Z0 ; Rapid move away
Common Pitfalls
Common mistakes when programming turning radius include:
- Using
Rwith the wrong sign or value, causing the arc to move in an unexpected direction. - Confusing
G02andG03, which changes the arc direction. - Not setting the correct start point before the arc command, leading to incorrect tool paths.
- Forcing arcs with a radius too small for the machine or tool, causing errors.
Always verify the arc direction and radius with a dry run or simulation.
gcode
N30 G03 X20 Z-10 R5 ; Wrong: counterclockwise instead of clockwise N30 G02 X20 Z-10 R-5 ; Wrong: negative radius may cause error N30 G02 X20 Z-10 R5 ; Correct: clockwise arc with positive radius
Quick Reference
| Command | Description | Parameter |
|---|---|---|
| G02 | Clockwise arc movement | X, Z, R |
| G03 | Counterclockwise arc movement | X, Z, R |
| R | Radius of the arc | Positive number |
| X | End point X coordinate | Coordinate value |
| Z | End point Z coordinate | Coordinate value |
Key Takeaways
Use G02 for clockwise and G03 for counterclockwise arcs to control turning radius.
Specify the radius directly with the R parameter in the arc command.
Ensure the start point is correctly set before programming the arc.
Avoid negative or zero radius values to prevent errors.
Simulate or dry run your program to verify arc direction and radius.