What is a G02 Code? [With Lots of Examples]

The information below is meant for beginners. If you are experienced with CNC programming, then you probably already know this stuff and much more. If you are new to CNC programming, this is the place for you.

Please note that some of the topics below could include more information on the subject. However, in the interest of keeping things simple for those just starting out, they have been left out of this G code guide.

Ready to learn? Let’s go.

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 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.

Absolute vs incremental mode

The second thing to look for is 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 coordinates will move from a set zero location such as your machines home location or a specified location on your part.

Incremental coordinates will move relative to your current position. See our posts on G90 and G91 codes to learn more about the differences between absolute and incremental coordinates.

Start and stop locations

Lastly, make sure you understand 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

Leave a Comment