G02 and G03 Circular Moves
Overview
The G02 and G03 commands are used for circular interpolation in CNC programming. G02 is for clockwise (CW) circular arcs, and G03 is for counterclockwise (CCW) arcs.
Command Format
#80253 :
G02/G03 X... Y... Z... R... P... F...ORG02/G03 X... Y... Z... I... J... K... P... F...Plane Designation:
G17: Circular arc in the XY planeG18: Circular arc in the ZX planeG19: 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 (absolute 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.0is 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
- Distance from the Start Point to the Center:
- 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 interpolation.
- 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 absolute (G90) values.
- In absolute 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
IJKorRparameter to define the arc center.- If
IJKandRis provided -Rtakes priority andIJKis ignored. - If no
IJKand noRparameters are provided - a previousRvalue is used.
- If
- Feedrate (F Command):
- The feedrate in this circular interpolation mode is shared with the feedrate of G01 commands.
- Controls 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
Pparameter. - If
Pis 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)
- If there is a need to create multiple loops (arc angle > 360 degrees), it is possible to use the
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 (
IJKandR) a previous radius value will be used. - If no
Ploops value is provided, P is assigned a value of 1 (1 or a partial loop). - If no
Ffeedrate value is provided, a previous non-rapid feedrate value will be used.
- If using
Rvalue 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
IJKparameters 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.