G02 G03 CNC Mill Programming with Example
When we work on metal to give it a specific shape, we perform most operations using straight-line movements (linear interpolation). We use G-codes for these movements. When the design includes bends, circles, or arcs, we use G02 and G03 instead.
It is very important for any machinist to understand these codes so that it is not difficult for him to make any complex part.
G02 is used when we need to rotate the tool clockwise and go3 is used to move the tool counter clockwise. Both these codes create smoothness in the machining process.
To work on the machine, only G02 and G03 are not enough, but it is also necessary to know where the center of this circle is or what its radius is. For example, G02 X20 Y20 R5 F100. Here R5 means to create a circle with a radius of 5 mm.
It is very important to take care of the feed rate during circular cutting. Selecting the appropriate ‘F’ value with G02 and G03 ensures the surface finish. The CNC programmer has to calculate how much speed to keep according to the hardness of the material so as not to put unnecessary strain on the machine.
Square Block G02 G03 Example CNC Mill
To round all four corners of a square block, we need to combine linear moves (G01) and circular moves (G02).
We have a 100mm x 100mm block and we want to round every corner with a 10mm radius.

G21 G90 G17
G00 Z5.0
G00 X0 Y10.0
G01 Z-2.0 F100
G02 X10.0 Y20.0 R10.0 F150
G01 X90.0 Y20.0
G02 X100.0 Y10.0 R10.0
G01 X100.0 Y-90.0
G02 X90.0 Y-100.0 R10.0
G01 X10.0 Y-100.0
G02 X0.0 Y-90.0 R10.0
G01 X0 Y10.0
G00 Z5.0
M30
Codes Explanation
| Command | Function |
G21 G90 G17 | Setup |
G00 Z5.0 | Rapid Lift |
G00 X0 Y10.0 | Rapid Positioning |
G01 Z-2.0 F100 | Linear Cut |
G02 X10.0 Y20.0 R10.0 | CW Arc (Corner 1) |
G01 X90.0 Y20.0 | Linear Cut |
G02 X100.0 Y10.0 R10.0 | CW Arc (Corner 2) |
G01 X100.0 Y-90.0 | Linear Cut |
G02 X90.0 Y-100.0 R10.0 | CW Arc (Corner 3) |
G01 X10.0 Y-100.0 | Linear Cut |
G02 X0.0 Y-90.0 R10.0 | CW Arc (Corner 4) |
G01 X0 Y10.0 | Linear Cut |
G00 Z5.0 | Retract |
M30 | End Program |
Read Also: G00 vs G01: Simple CNC example
