CNC Lab Assignment
CNC Lab Assignment
CNC Lab Assignment
NC Programming Lab
Goal
You will create NC words and use those words to create an NC part program from a part
drawing. You will verify the NC code tool paths and machine a part on a CNC milling machine.
Materials Required
Graph paper and an NC coding sheet (provided).
2 x 3 raw material stock (provided)
Milling machine (in lab)
1/8 end mill
Activities
Plot the coordinates for the sample part (USA STAR) on a graph using the part drawing
provided. Then, construct an NC program to machine the part, and enter the NC coding for the
program in the coding sheet provided. Type the code into a text file in NC block format.
Introduction and Steps
There are several steps involved in writing an NC program:
1. Sketch the part
2. Draw the part to scale, on graph paper
3. Determine the stock size and select the tool.
4. Determine the feed rate and depth of cut.
5. Determine how to cut the part.
6. Enter the code on a coding sheet.
7. Transfer this code to a text file (use a diskette or USB drive.)
8. Verify that your code produces an acceptable part.
9. Machine the part.
1. Sketch The Part
Your first task is to sketch the part you would like to machine. Sketching the part gives
you your first idea of what the part will look like. You should begin to consider the size, or the
dimensions of the part. You will also decide what material you will use and how to machine it.
(If you are looking at a part drawing, a sketch may not be necessary.) Let us consider creating the
NC code for a part called "ABAR" shown in Figure 34.
2. Draw the Part to Scale on Graph Paper
Once you have a visual idea of the part you would like to make, you have to draw the part
to scale on graph paper (see Figure 35.) The drawing should show the outline of the workpiece
plus a representation of the finished part. Next, you should plot, or locate, the part's coordinates.
The coordinates must be precise so you know the part's exact size. Because they are easier to
calculate, it is best to use decimals instead of fractions to plot the coordinates; for instance, use .5
instead of 1/2.
Since the workpiece will be placed in the machine's clamp with the longest side along the
X axis, the part is drawn in the same manner.
57
Figure 34. ABAR
Figure 35. Sample part plotted on graph paper
58
3. Determine the Stock Size and Select the Tool
When choosing the stock for a part, always try to use the smallest piece possible to
eliminate waste. For the sample part stock, you will be provided material that is approximately a
total size of 3" x 2" x 1 ".
When selecting the cutting tool to use for machining a part, consider the profile of the
milled surface you want. Different kinds of end mills produce different surfaces. For example,
use center-cutting end mills to cut flat surfaces and start cavities, and ball shaped end mills to cut
curved surfaces. After selecting a tool type, the tool size must be determined. As a general
suggestion, select the largest size available of an appropriate tool; large tools can remove more
material than small tools can in the same period of time. For the sample part tool, we will use a
1/8" diameter center-cutting end mill.
4. Determine the Feed Rate and Depth of Cut
The feed rate depends on the stock material. The sample part shown here was designed
to be machined from a soft material. The maximum recommended feed rate for should be no
more than 9 ipm (inches per minute). If we had planned to machine the sample part from a harder
material, like steel, we would have used a slower feed rate (1 ipm). Use a feed rate of 9 ipm to
cut the sample part.
The depth of cut depends on the tool size and the type of material being machined. The
depth of cut for soft material should be no more than .2 inches deep. For the sample part, choose
to make the cuts at a depth of .15 inch (-.15 on the Z axis). You should be able to find the feed
rate, spindle speed and depth of cut information you need in the table below.
This table will help you determine approximate maximum values for feed rates, spindle
speeds and depth of cut for different materials and tool diameters on the milling machine tool.
Experience and experimentation will help you to choose the best values for your particular needs.
5. Determine How to Cut the Part
Before you can write the NC code, you must determine how you will go about cutting the
part. This is a very logical process. You simply map-out each action of the cutter by deciding
where to start cutting, where to insert the tool, where to extract the tool, when to move to a new
59
cutting position, and so on. When you have finished mapping out this sequence, it will be very
easy to translate the information into NC code. The following example shows how the cutting
sequence for the ABAR program planned; the A-contour was cut first and the bar-shaped pocket
second.
Cut the A-Contour (refer to Figure 36.)
The cutter moves to the Start Point. The cutter makes a rapid traverse movement
above the workpiece, not touching the workpiece.
When the cutter reaches the correct X and Y coordinates above point A (X1, Y.5),
the spindle turns on.
The cutter is inserted into the workpiece at point A to the depth (Z-.15) we decided
on earlier.
The cutter moves according to the coordinates on the scaled drawing. It moves up
the leading edge of the A-contour to point B (X2.5, Y1), then down the trailing edge
to point C (X1, Y1.5).
The cutter lifts out of the workpiece (Z .1).
The cutter moves to the next insertion point. The cutter makes a rapid traverse move
to the X and Y coordinates of point D (X1.6, Y1.3)
The cutter is inserted into the workpiece (Z-.15) to the same depth as before.
The cutter moves to point E (X1.6, Y.7).
The cutter lifts out of the workpiece (Z .1).
The cutter moves to point F (X .7, Y1.5). Point F is the start point for the bar-pocket.
Figure 36. Producing the A-countour
Cut the Bar-Pocket
Note: in cutting the pocket, you have to make sure that you overlap each pass and not
leave material between the passes. The incremental movement must be calculated and depends
on the cutter diameter. The maximum movement should be equal to the cutter diameter.
The cutter is inserted at point G (Z-.15).
60
The outline of the pocket is cut. The cutter moves from point G (X .7,Y1.5) to points
H (X .5,Y1.5), J (X.5, Y.5), K (X.7,Y.5) and back to G.
Figure 37. Pocket outline
The cutter moves to point L (X.6, Y1.5).
The cutter moves to point M (X.6, Y.5), removing the center of the pocket.
The cutter lifts out of the workpiece (Z.1).
The cutter returns to the original start point and the spindle is turned off. The
program ends here.
Figure 38. Pocket middle
6. Enter the Code on a Coding Sheet
Now that we have the information necessary to mill the part (the stock size, the part
coordinates, the feed rate, the cutting sequence), we can use this information to create the NC
program codes and write the codes on an NC coding sheet.
An NC coding sheet is a simple form for writing NC code. After the code is written on
this sheet, it is used as a guide for entering the code into the computer. The instructions on the
coding sheet should be in this order:
1. Move the tool to its starting position.
61
2. Specify the programming mode (absolute or incremental).
3. Turn on the spindle.
4. Specify the feed rate.
5. Perform each cut and rapid traverse motion according to the cutting sequence and
coordinates on the graph paper drawing.
6. Return the tool to the starting position.
7. Turn the spindle off.
The coding sheet for the ABAR program is shown in Figure 39. All the necessary
address characters are given as column headings. Each parameter is placed under its appropriate
heading.
For example, the first block in the program has a zero under the N heading, the numbers
zero and 90 under the G heading, and a value of .1 under the Z heading. The comment "Rapid,
Absolute, To Z Start Point" is under the Comments heading as a reminder of what we want this
block of NC code to do.
So, the first block of NC code reads:
NOG0G90Z.1; MOVE TOOL AWAY FROM WORKPIECE
When writing an NC program, there are a few things to remember:
To make a strictly horizontal movement with the tool, place the X or Y
coordinate in a block separate from the Z coordinate.
To make a strictly vertical movement with the tool, place the Z coordinate in a
block separate from the X and Y coordinates.
To move the tool in a diagonal line, place both the X and Y coordinates in the
same block.
To make rapid traverse moves, the cutter must first move in the +Z direction,
away from the workpiece.
Before cutting, the spindle is turned on and the cutter is inserted into the
workpiece in the -Z direction.
Remember: It is very important to remember the positive and negative Z axis directions
and to be aware of the tool's position at all times when milling. If the Z coordinates in your
program are incorrect, the cutter could plunge into the workpiece, possibly breaking the cutter
and damaging the workpiece as well.
Now that you know how to create a part program, you can try writing one on your own.
Provided is a part drawing with dimensions, a graph to plot the coordinates on, and a coding
sheet. Your task is to transfer the drawing to graph paper, plot the coordinates, determine the
cutting sequence and write the NC program.
Do not worry; it is not as hard as it looks. Here is a clue: you only have to cut five
straight lines to mill the star, without lifting the cutter out of the workpiece until you're done, then
cut the letters.
62
Figure 39. Sample worksheet for ABAR
63
USA Star
We have designed this part to be milled on a 3" x 2" x 1 " piece of stock using a 1/8"
end mill. The stock material is a soft material. Determine a feed rate, spindle speed and depth of
cut. Note the origin and the orientation of the X and Y axes.
Figure 40. USA Star
A graph and coding sheet are provided for you to draw the part. You may wish to begin
by placing a small dot at the coordinate for each point on the star, and writing in the coordinates.
Then you can draw the cutting lines from dot to dot. When you've finished, do the same for each
letter.
When you plan the sequence for each cut, do not forget to include the Z axis moves,
when to insert and when to extract the cutter, when to turn the spindle on and off, and when to set
the feed rate.
After your coding is complete, you must create a computer file containing the blocks of
NC code and make sure to save this as a text file. A MS Word document file will not work.
MS Notepad creates text files. If you use MW Word, you can create the text file by choosing
txt option in the Save dialog box.
64
Figure 41. NC graph paper
65
Figure 42. NC coding sheet