Contents - Index - Previous - Next


Arcs: The Rules for Coding Them  


The Rules for Coding Arcs
These rules apply when code is prepared by hand. They also apply when configuring the post processor of software, such as AlphaCAM and similar CADCAM programs, which create code on a PC.

When preparing code for arcs, keep in mind the following requirements:
  • arcs are bounded by the four quadrant points at 3 , 6, 9 and 12 o'clock. This means that no single arc can have an included angle greater than 90 degrees.
  • no single arc can go beyond its bounding quadrant points.
  • an arc can start and finish anywhere between its quadrant points;
  • two or more arcs can follow each other to create an arc with an included angle greater than 90 degrees.
    ·
    An arc can start anywhere in its quadrant and must end anywhere in the same quadrant, for example, an arc from 4 to 5 o'clock begins and ends in the same quadrant. A single G2 or G3 command, depending on the direction of the arc, is all that is required to define the arc.

    An arc which starts in one quadrant and ends in the next quadrant must be coded in two parts, ie have two G2 or G3 lines (which of these depends on the direction of the arc). For example, an arc from 4 to 7 o'clock must be done in two parts: from 4 to 6 o'clock and 6 to 7 o'clock. Notice that each of the two arcs, which combine to give the required arc, start and end in the same quadrants.

    An arc which starts in one quadrant and ends in the next-but-one quadrant must be coded in three parts ie have three G2 or G3 lines (which of these depends on the direction of the arc). For example, an arc from 5 to 10 o'clock must be done in three parts: from 5 to 6, 6 to 9 and 9 to 10 o'clock. Notice that each of the three arcs, which combine to give the required arc, start and end in the same quadrants.
     
    Arc Directions
    The convention is that G2 gives a clockwise arc (two syllables) while G3 gives a counter-clockwise arc (three syllables) where the tool motion is viewed from above. This convention applies to milling machines and to lathes with a rear tool turret.
     
    The snag is that the Emco Compact 5CNC and 5PC lathes have a front turret. Therefore, G2, clockwise and G3, counter-clockwise, apply when tool motion is viewed from below, ie looking up at the tool.

    When configuring code creation software, care must be taken to put a G2 or G3 call in the right place. Always do a safe trial run with code created by a newly configured post processor.

    Coding for an Arc
    The line of code before a G2 or G3 command brings the tool to the start of the arc.

    The X and Z co-ordinates in the G2 or G3 line are those for the end of the arc.

    The R value in the G2 or G3 line is the radius of the arc.

    Remember that it is possible for the end of one arc to be the start of another arc.

    A Worked Example

                        


    The picture shows a profile with two arcs. Moving from right to left round the top of the profile, the first arc is counter clockwise (G3). The second arc is clockwise (G2).

    The first arc starts in one quadrant at 3 o
    'clock and ends in another quadrant at approximately 10 o'clock.

    The second arc starts in one quadrant and ends in another. Although the start of this arc is at the end of the first arc, from the point of view of the second arc, its start is at approximately 4 o
    'clock. Its end is at 12 o'clock.

    Because both arcs extend beyond one quadrant they must be subdivided.

    The first part of the first arc starts at the 3 o
    'clock quadrant point end ends at the 12 o'clock quadrant point. The second part of this arc starts at the 12 o'clock quadrant point and ends at roughly 10 o'clock. The picture shows the X and Z co-ordinates of these points.

    The first part of the second arc starts at roughly 4 o
    'clock quadrant end ends at the 6 o'clock quadrant point. The second part of this arc starts at the 6 o'clock quadrant point and ends at the 12 o'clock quadrant point. The picture also shows the X and Z co-ordinates of these points.

    All of these co-ordinates are brought together in the following example arcs code. It illustrates the basic idea of coding for arcs but the complications of reality are explained later:

    %
    *Example Arcs Code (metric)
    N10 T1
    N20 S2400
    N30 G0 X0 Z-1
    'this line brings the tool to the start of the first arc
    N40 G3 X24 Z-13 R12 F100
    'lines 40 and 50 give the counter clockwise arc
    N50 G3 X13 Z-23 R12 F100
    N60 G2 X5 Z-31 R10 F100
    'lines 60 and 70 give the clockwise arc
    N70 G2 X24 Z-41 R10 F100
    N80 G1 X24 Z-49 F100
    'line 80 takes the tool along to the end of the profile
    %

    If you copy this code to the WELturn TurnData folder and simulate it, you will see that the righthand tool, T1, fouls part of the profile. This part of the profile must be cut with a lefthand tool. Therefore the arcs must be further subdivided into parts to be cut with each tool and the X and Z co-ordinates of the change-over points determined. The outcome will be more G2 or G3 commands in the code as well as tool change commands.

    The only tool which could go right round the profile in one go is one with a button tip: but even with this there is a problem. The only tool which can use the code in the example and produce a dimensionally correct profile is a very narrow one with a sharp point with no tip radius. The bigger the radius of a tool tip the greater the dimensional errors of the finished part.

    For dimensional accuracy it is essential to use X and Z co-ordinates which compensate for the tool tip radius.

    CAD Software as an Aid to NC Code Preparation
    Tool Tip Radius Compensation