-
G02 and G03 Circular Moves
Overview
- The G02 and G03 commands are used for circular interpulation in CNC programming. G02 is for clockwise (CW) circular arcs, and G03 is for counterclockwise (CCW) arcs.
Command Format
-
Syntax:
-
G02/G03 X... Y... Z... R... P... F...
-
G02/G03 X... Y... Z... I... J... K... P... F...
-
Plane Designation:
-
G17
: Circular arc in the XY plane
-
G18
: Circular arc in the ZX plane
-
G19
: Circular arc in the YZ plane
-
Direction of Rotation:
-
G02
: Clockwise (CW) rotation.
-
G03
: Counterclockwise (CCW) rotation.
-
Position of End Point:
-
G90
: For specifying end point in a workpiece coordinate system (absulute position).
-
G91
: For indicating signed distance from the start point to the end point (relative distance).
-
Specifying Radius or Center:
- Distance from the Start Point to the Center:
- Specified by two axes among I, J, and K as the signed relative distance from the start point to the center
- If any of the inputs I, J, or K are not specified, then a value of
0.0
is used
- I, J, and K are always treated as relative values, regardless of the current G90/G91 mode
- One of the I, J, K values is ignored depending on the plane (K for XY plane, I for YZ plane, etc.)
- Radius of Circular Arc (R):
-
R: Radius of the circular arc:
- Positive radius value - minor arc - shortest way - Arc angle < 180 degrees.
- Negative radius value - major arc - longest way - Arc angle > 180 degrees
-
Loops:
-
P
: Loops. By default P = 1 , at least 1 partial arc will be generated.
Key Components
-
Plane Designation:
- The command begins with specifying the plane (G17, G18, G19) of circular interpulation.
- G17 for arcs in the XY plane, G18 for the ZX plane, and G19 for the YZ plane.
-
End Point:
- The end point of the arc can be specified in either incremental (G91) or absulute (G90) values.
- In absulute programming (G90), the end point is a specific point in the coordinate system.
- In incremental programming (G91), the end point is a distance from the start point.
- If end point XY (depending on the plane) position matches start point, a circle will be generated.
- If end point Z (depending on the plane) position is different from start point, a helix will be generated.
- If end point XYZ coordinates are omitted, a full circle will be generated ending at the exact start point.
-
Center of the Arc:
- The center of an arc can be calculated two different ways: either by specifying distance from the start point to the center (using I, J, K) or by specifying the radius of the arc (using R) and then calculating the center position.
- For arcs with a central angle ≤ 180° (minor arc), use a positive R value. For arcs > 180° (major arc), use a negative R value.
- It is recommended to use
IJK
or
Rparameter to define the arc center.
- If
IJK
and
R
is provided -
R
takes priority and
IJK
is ignored.
- If no
IJK
and no
R
parameters are provided - a previous
R
value is used.
-
Feedrate (F Command):
- The feedrate in this circular interpulation mode is shared with the feedrate of G01 commands.
- Contruls the tangential speed along the circular arc.
-
Loops(P Command):
- If there is a need to create multiple loops (arc angle > 360 degrees), it is possible to use the
P
parameter.
- If
P
is omitted or P=1, one full circle or a partial arc will be generated.
- If P=2 one full circle and another full circle or a partial arc will be generated (angle >360, but <=720 degrees)
Examples
Assume a starting point of (0, 0, 0), XY plane. - G02 X20 R10 - a CW arc of 180 degrees with End Point (20, 0, 0), Radius 10, and Center calculated at position (10, 0, 0) will be generated.
-
G02 X20 I10
-
An identical arc will be generated with End Point (20, 0, 0), Center (10, 0, 0) and a radius of 10 units.
-
G03 I20 J20
-
A CCW full circle with End Point matching the start position (0, 0, 0), Center (20, 20, 0), and Radius calculated of 28.28...units will be generated.
-
G03 X20 I10 P2
-
A CCW arc of 540 degrees (180 + 360) with End Point (20, 0, 0), Center (10, 0, 0) and Radius 10 will be generated (1.5 circle).
-
G02 X60 R50
-
A CW minor arc of 73.73 degrees with End Point (60, 0, 0), Radius 50 and Center calculated at position (30, -40, 0) will be generated.
-
G02 X60 R-50
-
A CW major arc of 286.26 degrees with End Point (60, 0, 0), Radius 50 and Center calculated at position (30, 40, 0) will be generated.
-
G03 Z10 I10 P2
-
A CCW arc / helix of 720 degrees (2 full circles) with End Point directly above the start point at (0, 0, 10), Center (10, 0, 0) and Radius 10 will be generated.
Details
- Axes on the selected plane will always command motion even if the axes were not specified.
- If a helix will be generated, all three axes will command motion.
- Most of the G02/G03 parameters are optional.
- If end point coordinates are not provided, the arc will end at the start point and a full circle will be generated.
- If end point is above the designated plane, a helix will be created.
- If no center coordinates are provided (
IJK
and
R
) a previous radius value will be used.
- If no
P
loops value is provided, P is assigned a value of 1 (1 or a partial loop).
- If no
F
feedrate value is provided, a previous non-rapid feedrate value will be used.
- If using
R
value to specify the radius and the End point is close to the Start point, there could be a possible loss of accuracy and the arc center coordinates might be miscalculated.
- If using
IJK
parameters to specify the arc center, an additional check is done for calculating the arc radius.
- Center -> End point and Center -> Start Point.
- If the calculated radius value differs by 0.002 mm (currently), an error will be displayed and a log error entry will be created.