Title: Manufacturing Automation Computer Numerical Control CNC
1Manufacturing AutomationComputer Numerical
Control (CNC)
Dr. L. K. Gaafar
2Numerical Control
Numerical Control is the operation of a machine
using coded instructions which consists of
letters, numbers, punctuation marks, and other
symbols. This coded information is known as the
Part Program These types of systems are referred
to as hardwire controls and were popular from
the 1950s to 1970s.
3Components of Numerical Control
Machine Part Program Machine Control Unit (MCU)
4Engineering design of a part
Develop manufacturing plan for the part
The basic NC Process From Bedworth et al. 1991
Program numerical control instructions to allow
the part to be manufactured according to the plan
Process the program to develop cutter location
data set
Post Process for a specific machine tool
5Computer Numerical Control CNC
NC machine with a microprocessor as an integral
part of the MCU. Data handling, control
sequences, and response to input is determined by
the integrated microprocessor. Started in the
1970s
6CNC Advantages
Increased Program storage capability at the
machine Program editing at the machine Control
systems upgrades possible Option -resident CAM
system at machine tool Tool path verification
7NC Words (Codes)
N Code - Sequence NumberG Code - Control
FunctionsF Code - Feed Rate S Code - Spindle
SpeedT Code - Tool Selection M Code -
Miscellaneous functions X, Y, Z Code - Coordinate
position
8Programming Example Cylindrical Part
F 25
Raw Material
70
F 22.5
Finished Part
F 17.5
20
9Programming Example Cylindrical Part
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500N0100 G84 X17.5
Z-20.0 D0200 D2200 D3650N0110 G00 Z2.0N0120
X50.0 Z50.0 T00N0130 M30
Please sign up to the lab demo and watch this
program running
10Program Interpretation
O0013Program identification number
11Program Interpretation
O0013N0010 T0404 N0010 Sequence numberT0404
Select tool number 404
12Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.0 Z0.0 S500
M04 G57 PS0G00 Rapid movement (no cutting)X26.0
X location (as a diameter 13 form zero)Z0.0 Z
locationS500 Spindle speed is 500 rpmM04 Rotate
spindle counterclockwise
x
ve
z
ve
(0,0)
13Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100 G01 Linear
interpolation (cutting)X-0.20 Move only in x
direction until you pass the center
by 0.1 mm (facing)F100 Set feed rate to 100
mm/min.
14Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0 G00 Move rapidly away from workpiece (no
cutting)Z2.0 the movement is 2 mm away from the
face.
15Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0 Go to a safe location
away from the workpiece x 50 (25 from zero), z
50 to change the tool.
16Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404 T0404 Select
tool number 404 Since we are using the same tool
(404)for both turning and facing, N0050, N0060
are not needed
17Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04 G57 PS0 G00 Rapid
movement (no cutting)X25.0 X location (as a
diameter 12.5 form zero)Z2.0 Z locationS500
Spindle speed is 500 rpmM04 Rotate spindle
counterclockwise
18Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100 G01 Linear interpolation (cutting)Z-70 Move
only in z direction (external turning)F100 Set
feed rate to 100 mm/min.
19Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500 G00 Move rapidly
away from workpiece (no cutting) to location x
26.0 (13.0 from zero) and z 2.0.
20Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500N0100 G84 X17.5
Z-20.0 D0200 D2200 D3650 G84 Turning cycle for
machining the stepX17.5 final diameterZ-20
length of step is 20 mmD0200 Finish allowance
in X direction (0.2 mm) D2200 Finish allowance
in Z direction (0.2 mm)D3650 Depth of cut in
each pass (0.65 mm)
21Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500N0100 G84 X17.5
Z-20.0 D0200 D2200 D3650N0110 G00 Z2.0 G00
Move rapidly away from workpiece (no
cutting)Z2.0 the movement is 2 mm away from the
face.
22Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500N0100 G84 X17.5
Z-20.0 D0200 D2200 D3650N0110 G00 Z2.0N0120
X50.0 Z50.0 T00 X50.0 Z50.0 Move to the tool
changing locationT00 cancel tool selection
23Program Interpretation
O0013N0010 T0404N0020 G57 G00 X26.00 Z0.0
S500 M04N0030 G01 X-0.20 F100N0040 G00
Z2.0N0050 X50.0 Z50.0N0060 T0404N0070 G57
G00 X25.00 Z2.0 S500 M04N0080 G01 X22.5 Z-70.0
F100N0090 G00 X26.0 Z2.0 S500N0100 G84 X17.5
Z-20.0 D0200 D2200 D3650N0110 G00 Z2.0N0120
X50.0 Z50.0 T00N0130 M30 M30 Program End
24Sample Geometry Statements
APT Vocabulary POINTLINEPLANECIRCLEPATERNCYL
NDR
25Programming Example
Raw Material
Finished Part
26Programming Example
y
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75N009 G01 X0 Y0 Z-0.5 XYFeed 75 N010
G81 R3 E9 N7 Z-0.5N011 M05N012 M02
x
27Programming Example
y
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 N011 G01 X50 Y45 Z-10 ZFeed 75 N012 G01 X50
Y45 Z10 ZFeed 150 N013 M05N014 M02
x
28Program Interpretation
G55 X200 Y80 Setting the datum to the lower left
corner of the work piece
29Program Interpretation
G55 X200 Y80 Program 1 Program Identification
Number
30Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N001
Sequence Number M06 Tool Change (End Mill with
Diameter12mm T1 Tool Number
31Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400 Start rotating the spindle clockwise with
400 rpm
32Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 Go to Safe
Position with feed 150mm/min
33Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 Lower the end mill to
determine the depth of cut
34Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75 Move from the lower left corner of the work
piece to the right lower one cutting with
feed75mm/min
35Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75 Move from
the lower left corner of the work piece to the
right lower one cutting with feed75mm/min
36Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75Cutting the horizontally
up to X30
37Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75Cutting to X0 Y40
38Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75N009 G01 X0 Y0 Z-0.5 XYFeed
75 Complete the countering
39Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75N009 G01 X0 Y0 Z-0.5 XYFeed 75 N010
G81 R3 E9 N7 Z-0.5Repeat 7 times blocks from
N003 to N009 with incremental offset of Z-0.5
40Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75N009 G01 X0 Y0 Z-0.5 XYFeed 75 N010
G81 R3 E9 N7 Z-0.5N011 M05 Spindle Off
41Program Interpretation
G55 X200 Y80 Program 1 N001 M06 T1N002 M03 rpm
400N003 G01 X-8 Y0 Z0 XYFeed 150 N004 G01 X-8
Y0 Z-0.5 ZFeed 150 N005 G01 X70 Y0 Z-0.5 XYFeed
75N006 G01 X70 Y60 Z-0.5 XYFeed 75N007 G01
X30 Y60 Z-0.5 XYFeed 75N008 G01 X0 Y40 Z-0.5
XYFeed 75N009 G01 X0 Y0 Z-0.5 XYFeed 75 N010
G81 R3 E9 N7 Z-0.5N011 M05N012 M02End
Program
42Program Interpretation
Tool Change Changing the tool
43Program Interpretation
Tool Change G55 X200 Y80 Setting the datum to the
lower left corner of the work piece
44Program Interpretation
Tool Change G55 X200 Y80 Program 2 Program
Identification Number
45Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2 N001 Sequence Number M06 Tool Change (Drill
with Diameter6mm T2 Tool Number
46Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400 Start rotating the spindle
clockwise with 400 rpm
47Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 Go to Safe Position with feed 150mm/min
48Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 Stop above the center of the first hole
49Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75 Start Drill
the first hole
50Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150 Retract to a position above
the hole
51Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150 Stop above the center of the second hole
52Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75 Drill the
second hole
53Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 Retract to a position above
the second hole
54Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 Stop above the center of the third hole
55Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 N011 G01 X50 Y45 Z-10 ZFeed 75 Drill the
third hole
56Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 N011 G01 X50 Y45 Z-10 ZFeed 75 N012 G01 X50
Y45 Z10 ZFeed 150 Retract to a position above
the third hole
57Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 N011 G01 X50 Y45 Z-10 ZFeed 75 N012 G01 X50
Y45 Z10 ZFeed 150 N013 M05 Spindle off
58Program Interpretation
Tool Change G55 X200 Y80 Program 2 N001 M06
T2N002 M03 rpm 400N003 G01 X-8 Y0 Z0 XYFeed
150 N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed
150 N005 G01 X20 Y15 Z-10 ZFeed 75N006 G01 X20
Y15 Z10 ZFeed 150N007 G01 X50 Y15 Z10 ZFeed
150N008 G01 X50 Y15 Z-10 ZFeed 75N009 G01 X50
Y15 Z10 ZFeed 150 N010 G01 X50 Y45 Z10 ZFeed
150 N011 G01 X50 Y45 Z-10 ZFeed 75 N012 G01 X50
Y45 Z10 ZFeed 150 N013 M05N014 M02End Program