Computer Numerical Control (CNC)
Name: ______
Note: This packet contains instructional materials we will use to aid in learning to create and interpret Numerical Control (NC) programs, and in learning to program and operate our NC lathe and NC milling machine. It should be brought to lectures, demonstrations, and lab sessions.
Some Common NC Codes:
G00Rapid traverse; point-to-point
G01Linear interpolation
G02Circular interpolation arc CW
G03Circular interpolation arc CCW
G90Absolute dimension input
G91Incremental dimension input
M01Program stop
M02End of program
M03Spindle on CW
M05Spindle off
M06Tool change
NBlock number
FFeed rate (usually in IPM)
SSpindle speed
TTool selection
For a fuller section of the many NC codes available, please consult the CNC lathe or mill operator’s manuals located next to those machines.
Procedure for a typical NC lathe project:
- Determine stock limitations.
- Determine machine & time limitations.
- Sketch the part profile; dimension. (Pay attention to both the geometry of the cutting tool and the need to minimize chatter.)
- Submit your design for approval.
- Cut the stock to length.
- Determine the best sequence of operations.
- Prepare a program manuscript on paper or on a word processor. Please ask the instructor for help. Be sure to save your document as a DOS text file. You may have to rename it later. Its filename should be descriptive, with prefix of up to 8 alphanumeric characters and an extension “.nc”.
- Copy your nc file into our class directory on the lathe control computer’s hard drive.
- Make sure the emergency stop is pulled out and the lathe’s power supply/controller is on, and open the ProLIGHT Lathe Control program.
- Make sure there is no stock in the way of the turret if it were to turn or move to home.
- Select “Tools,” “Operate Turret,” and click the Home icon in the window that opens. After the turret is homed, click “Done.”
- Select “Setup,” “Set/Check Home,” or click the Home icon that appears near the top of the screen. In the window that opens, click the “Home” button.
- Click “Tools,” “Select Tool,” find the correct tool and choose “Select Tool.”
- Open your file and visually check the code.
- Select “Program,” “Verify,” or click the Verify icon near the top of the screen.
- Click “Verify Settings,” then make sure the tool position, stock dimensions, and graphic parameters are appropriate and click “OK.”
- Click “Verify Program.” Dismiss the verify window. Make code corrections, save, and re-verify as needed.
- Insert and tighten your stock in the chuck or collet.
- Move the tool near the stock, and scratch on a place to later be machined. When the scratch goes 1/3 around, measure the Z distance of the scratch. Right click the position window and choose “Set Position.” Enter the new X and Z coordinates.
- For multiple tool programming, check the tool offsets for all tools to be used.
- Back off the tool, then safely move it to its starting position.
- Make sure the spindle speed on the lathe is set to Computer, the shield is down, and you are wearing eye safety.
- Get the lab supervisor’s approval to machine.
- Run the program; ready the emergency stop.
- Repeat as needed for additional parts.
- Clean the lathe and the surrounding area. Vacuum. Put all tools and materials away.
Lathe Feed Rates and Maximum Depths of Cut Recommended by Light Machines Corporation for the ProLight 3000.
Material / Cut Type / Dia. / Feed IPM / Max. Depth of Cut / Spindle RPM
Aluminum / Finish / .375-.5 / 2 / .008 / 2000
.75 / 2 / .005 / 2000
1.5 / 2 / .003 / 2000
Rough / .375-.5 / 2 / .020 / 2000
.75 / 2 / .010 / 2000
1.5 / 2 / .006 / 2000
Brass / Finish / .375-.5 / 2 / .010 / 2000
.75 / 2 / .006 / 2000
1.5 / 2 / .003 / 2000
Rough / .375-.5 / 3 / .022 / 2000
.75 / 3 / .014 / 2000
1.5 / 3 / .007 / 2000
Lathe Problem DEMO1:
From a piece of brass .5" dia. and 2" long, turn the rightmost 1" to a diameter of .450". Next, put a .5" long taper, beginning at the middle of this turned section with a diameter of .450", and ending at the right edge of the piece with a diameter of .420. Cutoff and facing are assigned to another station.
Draw Part and Chuck, Labeling Important Coordinates:
------
Lathe Problem DEMO1:
From a piece of brass .5" dia. and 2" long, turn the rightmost 1" to a diameter of .450". Next, put a .5" long taper, beginning at the middle of this turned section with a diameter of .450", and ending at the right edge of the piece with a diameter of .420. Cutoff and facing are assigned to another station.
Draw Part:
Sequence of Operations for DEMO 1:
1. Note setup (Install stock: .5 dia. x 2 with 1.5 exposed)(Initialize tool position at X=.25, Z=1.6)
2. Select absolute dimensioning
3. Turn on spindle at 2000 RPM
4. Move to home position, as a check.
5. Feed to Z=.5 to remove eccentricity (at X=.25) at 3 inches per minute
6. Back off tool to X=.26
7. Rapid traverse to Z=1.6
8. Cut to X=.23
9. Feed to Z=.5
10. Back off tool
11. Rapid traverse to Z=1.6
12. Cut to X=.225
13. Feed to Z=.5 at 2 inches per minute
14. Back off tool
15. Rapid traverse to Z=1.6
16. Cut to X=.21
17. Feed straight across to Z=1.5, at the right side of the taper.
18. Make a linear interpolation to the end of the taper at X=.225, Z=1.
19. Back off the tool.
20. Turn off the spindle.
21. Traverse to home.
22. End program
N0; DEMO1, INSTALL .5" D X 2" BRASS WITH 1.5 EXPOSED
N1; BEGIN WITH RH TOOL AT X.25 Z1.6
N2G90
N3M3S2000
N4G0X.25Z1.6; HOME
N5G1Z.5F3
N6G0X.26
N7Z1.6
N8G1X.23
N9Z.5
N10G0X.25
N11Z1.6
N12G1X.225
N13Z.5
N14G0X.24
N15Z1.6
N16G1X.21
N17Z1.5F2
N18X.225Z1
N19G0X.25
N20M5
N21G0Z1.6
N22M2
1
Typical CAD/CAM CNC Mill Project Procedure:
- Determine stock limitations.
- Determine machine & time limitations.
- Sketch part; dimension.
- Submit your design for approval.
- Cut the stock to size. You need 1 piece per group member, plus an extra.
- Determine the rough sequence of operations (i.e., plan the tool path).
- Using a Computer Aided Drafting (CAD) program such as AutoCAD or even AutoSketch (possibly witha Mill Template), draw the part.
- Tip: Save both the drawing and an AutoCAD 12 DXF file for your drawing under a new name in our class directory.
- Using a Computer Aided Manufacturing (CAM) program such as SpectraCAM Milling, import your DXF file.
- Specify the material and cutting tool. For each toolpath, specify the parameters carefully, then create the toolpaths and save the NC code
- Using the Mill Control program, load your NC code.
- Change parameters as needed (material size, tool, starting position).
- Verify, edit, and re-verify the code, as needed, saving all changes. Make sure your program functions properly, and that the cutting tool is left at a home position where it began.
- Set up and check the mill; do not install the stock.
- Initialize the tool position far enough above the stock so that it would not be cut, and with the spindle off, run your program to verify the tool path.
- Install the stock securely and evenly.
- Double check that all are wearing safety glasses.
- Move and initialize the tool positionso the stock will be cut.
- Get the lab supervisor's approval to machine.
- Run the program; ready the emergency stop.
- Repeat, as needed.
- If necessary, sand your product to remove burrs.
- Be sure to save your own copy of the control program and of the CAD drawing.
- Remove your stock and clean the mill and surrounding area. Put away all tools.
Circular Interpolation Problem:
The drawing on the right represents a plan view of an arc to be milled from coordinates X=4, Y=4 to coordinates X=2, Y=2. The center of the arc is located at X=4, Y=2. CCW circular interpolation should be used. Assume the top of the workpiece to be at Z=0, the depth of cut to be 0.1 inch and the feed to be 2 IPM. Write the NC code to mill the curved slot.
The format for the circular interpolation line is as follows:
N7G____X____Y____I____J____F___
In the space after the N is the block number.
After the G, 03 indicates counterclockwise circular interpolation (02 for CW).
After the X and Y, the ending coordinates are listed.
After the I and J, the coordinates of the arc's center are listed.
After the F, the feed is listed.
Practice:
Write the next line below that would complete the semicircle:
N8 ______
Write the next line so that the resulting shape is a crescent, using (5,2) as the center of the arc:
N9 ______
(NC Mill TRACE1):
N1G90G0X0Y0Z.1;HOME
N2M03;TURN ON SPINDLE
N3X0.5Y2.1
N4G1Z-0.1F2
N5X0.3
N6Y2.8
N7X.5
N8G2X.5Y2.5I.5J2.65
N9G1X.3
N10X.5
N11G2X.5Y2.1I.5J2.3
N12G0Z.1
N13X.95Y1.65
N14G1Z-.1
N15G3X.8Y1.5I.8J1.65
N16G2X.6Y1.3I.8J1.3
N17G0Z.1
N18X.8Y.8
N19G1Z-.1
N20Y.4
N21G3X1.2Y.4I1J.4
N22G1Y.8
N23G0Z.1
N24X0Y0
N25M02;END OF PROGRAM
Lathe Practice Problem 1:
The piece below is drawn at full scale. Write the annotated nc code to machine the right section of this piece (between centers) from a hardwood dowel. Use a spindle speed of 2000 RPM and a feed rate of 1 foot per minute. The maximum depth of cut is 1/8", and you are to use a right-cut tool (which feeds from right to left). Please begin the tool even with the stock’s circumference and 1/8" to the right. Assume that the leftmost ½" of the stock is placed in the chuck.
Lathe Practice Problem# 2
Parameters: The drawing represents a 2.9" long piece of hardwood, 1" in diameter (not necessarily drawn at full scale.) Assume the use of a right-cut tool (T1) with a maximum depth of cut of 0.1", a spindle speed of 1500 RPM, and a feed rate of 3 inches per minute. Assume ½" of the 2.9" length to be in the chuck, with the chuck face at Z=0. (The Y-axis is labeled assuming ½" is in the chuck.) Start the tool even with the edge of the stock, and 0.1" to the right. Include a cut-off routine (T3, feed rate of 3 IPM) so the final piece is 1.9” long.
Challenge: Write efficient NC code to machine the part on our lathe. First, use absolute coordinates, then write the control code again using relative coordinates. Two separate programs are due.
Lathe Practice Problem 3: Hemisphere
You are to write the program that will use the right-cut tool to cut a hemisphere on one end out of a piece of ½" diameter oak, 2 inches long. The hemisphere is to have a radius of 1/4". The maximum depth of cut is 1/10", and the feed is 4 inches per minute. Please assume that the tool cuts in both directions. Begin with ½" in the chuck, and the origin at the chuck face. The tool is to start just even with the round edge of the stock, but 1/10" to the right. Cut off the hemisphere with Tool 3. Show all of your work. You are to hand in:
1. a sketch of the part showing all tool paths.
2. nc code.
Please also save your nc file as a DOS text file, with the extension .nc so that you can verify your work.
NC Mill Practice Problems 1 & 2
Directions: Draw the exact design that would be cut into the top of each block. The tool begins at the top, front, left of the block
N0G90G0X0Y0Z0;1/8" end mill, 3x2x1" wax
N1G0Z.1
N2M3S2000
N3G0X1Y1.2
N4G1Z-.1F1
N5Z-.05F3
N6X1.5
N7Y.5Z-.2
N8G2X2.1Y1.1I2.1J.5
N9G1X2Y1.5Z.05
N10M5
N11X0Y0
N12Z0
N13M2
N0G91;1/8" end mill, 3x2x1" wax
N1G0Z.1
N2M3S2000
N3G0X.2Y.1
N4G1Y.2Z-.2F1
N5Z-.05
N6X.8
N7Y.5
N8X.5Y.6
N9Z.1
N10G2X0Y-1I0J-.5
N11Y1J.5
N12G0Z.1
N13G0X0Y0
N14G1Z-.2
N15Z0
N16M2
1
1