NC Part Programming
NC Part Programming
10 - 1
Agenda
Introduction Elements of NC Program NC Words (G, M, T, S, Codes) Examples Cutter Compensation and Offsets Conclusions
10 - 2
COORDINATE SYSTEMS
y y z x
10 - 3
10 - 4
10 - 5
10 - 6
Introduction to NC programming
Manual part programming Computer-assisted part programming
PROGRAM STORAGE
Paper tape Paper or Mylar coated paper. Diskettes From other computers through RS 232 or local area network (LAN)
10 - 7
NC WORDS
A G-code program consists the following words: N, G, X, Y, Z, A, B, C, I, J, K, F, S, T, R, M An EIA standard, RS-273 defines a set of standard codes.
10 - 8
10 - 9
NC WORDS
N code. sequence number N0010 G code. preparatory word.
10 - 10
NC WORDS (continue)
X, Y, Z, A, B, C Codes. coordinate positions of the tool. The coordinates may be specified in decimal number (Decimal Programming), or integer number (BLU Programming). BLU programming: leading zero, trailing zero. In the leading zero format: X00112 Y002275 Z001 In the trailing zero format, the program looks like: X11200 Y22750 Z10000
10 - 11
NC WORDS (continue)
Circular Interpolation: (5.000,4.000)
(7.000,2.000) (5.000,2.000)
10 - 12
NC WORDS (continue)
F Code. feed speed. inch/min (ipm), or ipr. F code must be given before either G01, G02, or G03 can be used. N0100 G02 X7.000 Y2.000 I5.000 J2.000 F6.00 S Code. cutting speed code. It is programmed in rpm. S code does not turn on the spindle, spindle is turned on by a M code. N0010 S1000
10 - 13
NC WORDS (continue)
T Code. tool number. Actual tool change does not occur until a tool change M code is specified. R Code. cycle parameter.
1 (1,2,2) Initial height 2 R plane 0.3" 1" 3
0.7"
The cycle may be programmed in one block, such as: (cycle programming is vendor specific.)
5 Z point 4
10 - 14
NC WORDS (continue)
M Code. miscellaneous word.
10 - 15
NC part-program manuscript
10 - 16
10 - 17
PART DRAWING
10 - 18
SOLUTION TO EXAMPLE
Solution: The cutting parameters need be converted into rpm and ipm. Milling:
Drilling:
10 - 19
p9 p1
(0,0,0)
Drill
End mill
Vise jaw
(0,0,0)
10 - 20
CUTTER LOCATIONS
The coordinates of each point (cutter location) are calculated below: p1': ( 1.75+0.375, -0.1-0.375, 4.00) = (2.125, -0.475, 4.000) p1: (2.125,-0.475, 2.000-0.500) = (2.125,-0.475,1.500) p2: (2.125,4.000+0.100,1.500) = (2.125,4.100,1.500) p3: (3.000-0.375,4.100,1.500) = (2.625,4.100,1.500) p4: (2.625,1.375,1.500) p5: (3.000,2.000-1.000+0.375,1.500) = (3.000,1.375,1.500) p6: (3.000,2.625,1.500) p7: (3.000,2.000,1.500) p8: (2.625,2.000,1.500) p9: (2.625,-0.100,1.500) p9': (2.625,-0.100,4.000)
10 - 21
PART PROGRAM
10 - 22
CNCS VERIFICATION
10 - 23
CNCS 3D DRAWING
10 - 24
Offsets
Fixture
G10, G54, ..
Diameter Tool
Length compensation Part-Edge compensation
10 - 25
10 - 26
(a) Tool compensation left, (b) tool compensationright, (c) additional block for external curves, (d) go to the machining point when cutting external curves.
10 - 27
(a) Ramp on block, (b) tool compensation -effective from the start
10 - 28
TOOL-RADIUS COMPENSATION
Start of Compensation.
(a) G41 (b) G42
G41 (or G42) and G01 in the same block ramp takes place at block (0.5, 1.7) N0010. N0010 G01 G42 X0.500 Y1.700 N0020 G01 X1.500
G41 G42
(1.5, 1.7)
G41 (or G42) and G01 in separate blocks the compensation is effective from the start. N0010 G41 N0020 G01 X0.500 Y1.700 N0030 G01 X1.500
G42 G41
10 - 29
TOOL-RADIUS COMPENSATION
Inside Corner. Cutter path is inside a corner, stops at the inside cutting point N0010 G41 N0020 G01 X1.500 Y2.000 N0030 G01 X0.000 Y1.600
(0, 1.6) (1.5, 2.0)
G42
Use of M96 and M97. Cutting tool that is larger than the height of the step, M97 must be used
G41 M96
N0010 G41 N0020 G01 X1.000 Y1.000 N0030 G01 Y0.800 M97 N0040 G01 X2.000
G41
(1,1) (1,0.8)
(2,0.8)
M97
10 - 30
TOOL-RADIUS COMPENSATION
G41 G40
Cancel Tool Compensation. G40 in the same block ramp off block. N0060 G40 X2.000 Y1.700 M02
G42
(2.000, 1.700)
G40 in a block following the last motion, the compensation is effective to the end point (2.000,1.700). N0060 X2.000 Y1.700 N0070 G40 M02
G41
G40 G42
(2.000, 1.700)
10 - 31
EXAMPLE
A square 2.0 in. x 2.0 in. is to be milled using a 1/2 in. end milling cutter. Write an NC part program to make the square. Solution Let us set up the lower left corner of the square at (6.0,6.0). Using tool-radius compensation, the square can be produced.
2.000
2.000
(6,6)
10 - 32
PART PROGRAM
10 - 33
TURNING
2.875 .250 .625 1.125 R.125 1.000 2.125 2.875
Z X
Part design
Cutter path
Tool
Cutter path
10 - 34
POCKETING
10 - 35
10 - 36