mathcncg-code

Two possible paths for G-code circles


In G-codes a clockwise arc can be specified by e.g.

G02 X2 Y0 R2

This code should give an arc between the current position and (2,0) with radius=2.

According to several sources (And Math) eg.

There will always be two circles/arcs that satisfies these conditions each with a clockwise arc. enter image description here

Which one is chosen and is it implementation/manufacturer dependent?


Solution

  • According to CNCCookbook's G-code Tutorial, it depends on the controller. Some controller use the sign of the radius to choose, some never lets you make an arc of more than 90°.

    Given the two choices shown, the controller chooses the path based on the sign of the radius. Negative forces the longer arc, positive the shorter. The negative sign forces the controller to seek a viable arc of more than 180 degrees.

    Some controllers are touchier still and will not program an arc that crosses a quadrant line. Hence, the largest angle an arc can follow is 90 degrees, and that angle must not cross 0, 90, 180, or 270 degrees. For angles of 90 degrees that cross a quadrant line, they must be broken into two pieces, with the join between the pieces being right on the quadrant line.