Quick Guide to the G02 CNC G Code [Tips and Tricks]

a graphic of a cnc machine with text that says learn g code today g02 circular interpolation

Code

G02

Name

Circular interpolation, clockwise

Type

Modal - stays on until changed

Description

Circular movement at a specified feed rate in a clockwise direction

A G02 code is a clockwise circular movement CNC G code.

It is used to move the CNC table and/or spindle from its current location to an end location along a specified radius (R) in a clockwise direction.

When to use a G02 code?

G02 codes will usually be in the lines of the program that are used to cut the part. The G02 code allows the programmer to cut a full circle or portion of a circle.

F and S codes are used together with a G02 code to specify the feed rate and spindle speed. An R code is used as well to tell the machine what size radius to move along.

What to think about when using a G02 code?

Units

First, make sure you know what units you are working in. Moving 10 inches instead of 10 millimeters is a big difference. A G20 (inches) or G21 (mm) code should identify the units you are working in before your G02 code.

comparison of units of measurement for cnc programming

Absolute vs incremental mode

The second thing to know is how the machine will understand position locations.

This is determined by whether you are working in absolute (G90) or incremental (G91) coordinates. The most recent G90 or G91 code in the program will determine which mode you are in.

Absolute positioning will move from a set zero location such as your machines home location or a specified location on your part.

Incremental positioning will move relative to your current position. 

The images below show the difference between the absolute and incremental positioning modes. The numbers in parentheses are the locations given to the the machine to make the move.

Notice how in absolute mode, all locations are relative to a single location, usually either the workpiece zero or machine home location. 

In incremental mode locations, all locations are relative to the machine’s current location.

graph paper example of absolute positioning with multiple points as examples
graph paper example of incremental positioning with multiple points as examples

Start and stop locations

Lastly, make sure you understand the path that the tool will take from it’s start location to the new location.

Check  where you are currently position wise (X, Y & Z location), where you will be moving to and if there is anything in between the two locations.

The G02 code will move the machine in a circular arc to your new location. You don’t want anything in the way or to miscalculate your stop point. Clamps or vises can be easy to forget about and run into. Crashing your machine is never a good time.

3 G02 code examples and descriptions of what they do

For the examples below, we will assume your machine is in absolute mode (G90). If you are working in incremental mode (G91), the resulting movements will be different.

Check out our guides to G90 and G91 G codes to understand the difference between the two movement types.

Example #1

N035 G02 X4.0 Y4.0 R2.0

This is line number 35 of the program.

G02 sets the movement mode as circular, clockwise.

X4.0 Y4.0 is the location the machine will move to. There is no Z axis movement in this line.

R2.0 specifies the size of the radius that the machine will move along.

Example #2

N090 G02 X7.5 Y1.5 R0.5

This is line number 90 of the program.

G02 sets the movement mode as circular, clockwise.

X7.5 Y1.5 is the location that the machine will move to. There is no Z axis movement in this line.

R0.5 specifies the size of the radius that the machine will move along.

Example #3

N250 G02

This is line number 250 of the program.

G02 sets the movement mode as circular, clockwise.

There is no location specified on this line. The machine will not move based on this code line.

CNC codes that are similar to G02

a comparison of the type of movement created with G00, G01, G02 and G03 cnc g codes

Note that all the movement codes listed below are modal. This means they will stay in the movement mode identified by the code until switched to a different mode.

Want to learn more about G Code for your CNC?

Leave a Comment