Contents - Index - Previous - Next


CAD Software as an Aid to NC Code Preparation


Manual preparation of code can involve time-consuming calculation of the co-ordinates of points on the profile of a part. CAD software can make life easier. At the very least, the CAD program needs to be able to report the co-ordinates of points which you then note with pencil and paper. Ideally the software should be able to put the co-ordinates of points on the screen as illustrated below. In the illustrations, note that the origin, X0, Y0, Z0 is the bottom left corner of the billet. All co-ordinates are absolute values from the origin. WELmill requires this convention. (The X -Y origin can be placed elsewhere: see Setting the Origin for Machining)

The following material illustrates how CAD can help with the manual preparation of code.

                              

Example 1: The billet in the picture is 60mm square. An 8mm slot drill (hatched purple circle) is to cut a straight line groove 3mm deep. The centreline of the slot drill is to follow the line from X10, Y10 to X50, Y30. This is the code fragment:

N50 G0 X10 Y10 Z6
'Rapid 6mm above billet: bring centreline of cutter to X10 Y10
N60 G1 X10 Y10 Z-3 F30
'Feed 3mm into billet
N70 G1 X50 Y30 Z-3 F100
'Cut groove
N80 G0 X50 Y30 Z6
'Rapid to 6mm above billet

Example 2: A 8mm slot drill (hatched purple circle) is to cut a circular groove 4mm deep. The centreline of the slot drill is to follow the 15mm radius circle. As the maximum included angle for an arc in WELmill is 180 degrees, the circle must be cut as two arcs. The cut can be made in either direction, clockwise or counter clockwise. This is the code fragment:

N50 G0 X20 Y55 Z6
'Rapid 6mm above billet: bring centreline of cutter to X20 Y55
N60 G1 X20 Y55 Z-4 F30
'Feed 4mm into billet
N70 G2 X20 Y25 Z-4 R15 F100
'Cut first arc clockwise
N80 G2 X20 Y55 Z-4 R15 F100
'Cut second arc clockwise
N90 G0 X20 Y55 Z6
'Rapid to 6mm above billet

                              

Example 3: The billet in the picture is 60mm square. An 8mm slot drill (hatched purple circle) is to cut a pocket 3mm deep bounded by the green rectangle.

Draw a rectangle (purple) offset by 4mm (cutter radius) inside the green rectangle. Further nested offset rectangles are drawn if needed until the whole of the pocket area is covered.

To cut the pocket, the centreline of the cutter follows the purple rectangle: either direction will do but clockwise is used in the code fragment:

N50 G0 X14 Y21 Z6
'Rapid 6mm above billet: bring centreline of cutter to X14 Y21
N60 G1 X14 Y21 Z-3 F30
'Feed 3mm into billet
N70 G1 X46 Y21 Z-3 F100
'Cut first line
N80 G1 X46 Y14 Z-3 F100
'Cut second line
N90 G1 X14 Y14 Z-3 F100
'Cut third line
N100 G1 X14 Y21 Z-3 F100
'Cut fourth line
N110 G0 X14 Y21 Z6
'Rapid to 6mm above billet

Example 4: A 8mm slot drill (hatched purple circle) is to cut a pocket 4mm deep bounded by the green 30mm diameter circle.

Draw nested circles (purple) offset by 4mm (cutter radius) inside the green circle to cover the whole of the pocket area.

To cut the pocket, the centreline of the cutter follows each purple circle in turn. Each circle will be cut as two arcs. Cutting can begin with the smallest circle and work out, or vice versa. Cutting can be clockwise or counter clockwise. Cutting can start at any point on a circle. In the following code fragment, cutting begins with the large purple circle, is clockwise and uses the 12 and 6 o
'clock quadrant points for the start of the arcs:

N50 G0 X30 Y54 Z6
'Rapid 6mm above billet: bring centreline of cutter to X30 Y54
N60 G1 X30 Y54 Z-4 F30
'Feed 4mm into billet
N70 G2 X30 Y32 Z-4 R11 F100
'Cut first arc first circle clockwise
N80 G2 X30 Y54 Z-4 R11 F100
'Cut second arc first circle clockwise
N90 G1 X30 Y50 Z-4 F100
'Feed to start of second circle
N100 G2 X30 Y36 Z-4 R7 F100
'Cut first arc second circle clockwise
N110 G2 X30 Y50 Z-4 R7 F100
'Cut second arc second circle clockwise
N120 G1 X30 Y46 Z-4 F100
'Feed to start of third circle
N130 G2 X30 Y40 Z-4 R3 F100
'Cut first arc third circle clockwise
N140 G2 X30 Y46 Z-4 R3 F100
'Cut second arc third circle clockwise
N150 G0 X30 Y46 Z6
'Rapid to 6mm above billet

Finishing Cuts
In examples 3 and 4, the pockets were cut right up to the green boundary: no material was left in place for a finishing cut. This is easy to arrange. Consider the circular pocket: if the large purple circle was offset by 5mm, 1mm would be left round the pocket for a finishing cut. Circles inside the large purple circle would be still be offset by the cutter radius, 4mm. The code for the finishing cut would be as shown in lines N70 and N80 above.

Cutter Diameter and Code
Remember that the X, Y and Z co-ordinates which comprise a code listing are specific to a particular cutter diameter. If you decide to change the cutter diameter you must recalculate the code.

CNC File Specification for WELmill
Example of Manually Created NC Code
WELmill NC code file extension