-_—_—_ NC Part Programming and Computer Aided Part Programming 293
TABLE 1.
4.1 Some of the Preparatory Punctions
Gol
G02
G90,
G91
G92
G98
G99
Linear interpolation
Are clockwise circular
interpolation (two-dimensional)
Are counterclockwise circular
interpolation (two-dimensional)
Dwell
Inch data input
Metric data input
Reference point return
‘Thread cutting
Tool nose radi
‘Cancel
‘Tool nose radius compensation—
left
compensation,
Tool nose radius compensation—
right
Metric programming
Pattem repeating,
Peck drilling in z-axis
Grooving in x-axis
Thread cutting cycle
Absolute input
Incremental input
Absolute preset
Feed per minute
Feed mmv/rev
14.1.6 Miscellaneous Function ‘M’
Point-to-point positioning at rapid traverse rate
‘A mode of contouring control which uses the information
ined in a block to produce a straight line in which
the vectorial velocity is held constant
An are generated by the coordinate motion of two axes in
Which curvature of the path of the tool w.rt the work
piece is clockwise
An are generated by the coordinate motion of two axes in,
which curvature of the path of the tool watt the work
piece is counterclockwise
A time delay of programmed or established duration
Used by British system
Used by Indian system (metric units)
Used for a new operation
Used for thread cutting (single pass)
Used to deactivate the controller for tool nose radius
‘compensation
Cutter on left side of work surface looking from cutter in
the direction of relative cutter motion with displacement
normal to the cutter path to adjust for the difference
between actual and programmed cutter radii
Cutter on right side of work surface looking from cutter in
the direction relative cutter motion with displacement
normal to the cutter path to adjust for the difference
between actual and programmed cutter radii
Mode for programming in metric units
Used for example profiles
Used for only peck drilling operation
Used for only grooving operation
Used for multiple thread cutting cycle
A control mode in which the data input is in the form of
absolute dimensions
A control mode in which the data input is in the form of
incremental dimensions
mavmin
mre
Miscellaneous NC functions perform a variety of auxiliary commands, such as stopping the
_ Program, starting or stopping the spindle or feed, tool changes, coolant flow, etc. which control
_ the machine tool. They are generally multicharacter ON/OFF codes which select a function
_ controlling the machine tool.
iscellaneous functions are used at the beginning or end of a cycle
and are identified by the letter address ‘M’ followed by a two-digit number.294 Computer Aided Design and Manufacturing
In mos
in the specific block in which they are programmed. I
they must be programm
repeated in succeeding blocks.
Both preparatory
modal, When modal miscellaneous functions such as
functions stich as G81 ( ed, they
blocks until they are replaced by ant
for cancelled as soon as a new miscel
Al non
in the block programmed. If they are needed in suc
4 cases, miscellaneous codes such as M00,
fed in each block, Most other
v classified 3S ii
ei ed Cw) and prepaatory
nid miscellaneous functions are generahy (°°,
pintyy in effect in succeeding
{canned drill cycle) are programm
Ther function code. The mod! | funetion oF code is changed
modal
motetion cove #8 Programmed,
tate. are valid oF operational only
" 06.
modal functions such as M00, MOL, ae ae eke, they must De, Programmed
py the EIA are listed in Table 142.
aneous or preparatory
again, Some miscellaneous functions that have been SUPP!
TABLE 14.2 Some of the Miscellaneous Functions! FANUC Code
Number Operation Definition
MOO Program stop “A caiscetlancous fneton command cancels the Spindle and
ae funetfons and terminate further program execuin
her completion of other commands in the Block
Mot Optional stop Ae ceellaneous function command similar {0 a program
vrop except thatthe control ignores the command unless
the operator has previously validated the command
M02 ——_End of program ‘A miscellaneous function indicating completion of work
piece stops spindle coolant and feed after completion of
all commands in the block
M03. Spindle forward (CW) Starts spindle rotation to advance a right-handed screw
into the work piece
MOs Spindle reverse (CCW) Starts spindle rotation to retract a rightchanded screw
from the work piece
MoS Spindle stop Stops spindle in normal most efficient manner
M06 Tool change Stops spindle and coolant and retracts tool to full react,
boson toute ened in last block of information in
which a given tool is used
M08 Coolant ON Tums coolant ON
M09 Coolant OFF ‘Tums coolant OFF
M10 Chuck open
Mi ck close i
(Chuck clo oma to machine slides work piece, fixtures
M13 Spindle forward coolant si
Mie Spniecene (CEN) andcom ON Sar sl raon sd neh ota ON
aig We carseat Stas spindle otaon and tums the coolant oN
Mais?“ syisihé creo Call fo spi tool which snot used frequently
io ps ac spindle orientation
M21 Spindle indexing
M22 Spindle indexing| Spindle indexing
Spindle indexing]oe
294 Computer Aided Design and Manufacturing
In most cases, miscellaneous codes such as M00,
in the specific block in which they are programmed. If
they must be programmed in each block. Most other
repeated in succeeding blocks.
i i ally cla i Die?
Both preparatory and miscellancous functions are generally Cw) and. prepa
modal, When ‘modal miscellaneous functions such as M03 (spi ratory
is
tay in effect in succeed pont
functions such as G81 (canned drill cycle) are programmed, they 4 y in
fied as either m«
ion or code is ch, pe
7 ‘nodal function or ranged | ¥
blocks uni they are replaced by another function code, THE My code is programmed. | vi Pie
or cancelled as soon as a new miscellaneous or preparatory valid of operational yh
i ‘M02, M06, ete. are only ui gw
All non-modal functions such as MOO, MO1, M02, M06 PX must be programmey | 4 asf
in the Block programmed. If they are needed in suecessive BIOS TAY Tig natal | ut Swe
again. Some miscellaneous functions that have been supplied by 2, Ms ee
TABLE 14.2. Some of the Miscellaneous Functions: FANUC Code waves
wane
Number Operation Definition yg
‘M00 Program stop “A miscellaneous function command cancels the spindle and WS ype
coolant functions and terminate further program execution | st Tie
after completion of other commands in the block ws
MO1 Optional stop ‘A miscellaneous function command similartoa pogan | ys) TE
stop except that the control ignores the command unless | (70
the operator has previously validated the command go Mit
M02 End of program ‘A miscellaneous function indicating completion of work | gs Subt
piece stops spindle coolant and feed after completion of | yg9__ SUI
all commands in the block —_*
M03 Spindle forward (CW) Starts spindle rotation to advance a righthanded seew | W417 Spin
into the work piece
M04 Spindle reverse (CCW) Starts spindle rotation to retract a right-handed screw ln some of th
: from the work piece ‘muchines hav.
MOS Spindle stop ‘Stops spindle in normal most efficient manner ferticular spee
M06 Tool change ‘Stops spindle and coolant and retracts tool to full retract Swed drive at
position. Should be coded in last block of informatio ia ft
which a given tool is used sand
M08 Coolant ON Tums coolant ON lag
M09 Coolant OFF ‘Tums coolant OFF Too
Chuck open ALN
MII Chuck elos Tact
kcloss Can pertain to machine slides work piece, fixtures. a (AT
spindle, etc.
MI3__ Spindle forward (CW) and , Cuttin,
MI6 Special oot ean Cia sPindle rotation and turns the coolant ON epg eA
ae aca alls for a special tool which is not used frequently Pith
iene vn Spindle orientation ee
M21 Spindle indexing tty,
M22 Spindle indexing Spindle indexin d "
M23 ; * Rens
Spindle indexing ‘au Ona
ery
wee ru
*NC Part Programming and Computer Aided Part Programming 295
TABLE 14.2 Some of the Miscellaneous Functions: FANUC Code (Contd)
Sunder _ Operation Definition
M25 Quillextend Extends the quill (tailstock)
M26 Quill retract Retracts the quill (tailstocks)
M29: DNC mode
M30 Program reset and rewind Stops the spindle, turns the coolant OFF terminates the
CNC program and resets it
M38 Door open Opens the door
M39_—_—_Door close Closes the door
M40 Parts catcher Extend
MAL Parts catcher Retract
M43 ‘Swarf conveyor Forward
M44 Swarf conveyor Reverse
M45 Swarf conveyor Stop
M48_—_Lock feed Speed at 100%
M49 Cancel M48 (default)
M52 Threading pull Out angle(90)
M53. Cancel M52
MS6 Internal chucking
M57 External chucking
M68 Turret indexing Only at home position
M69 Turret indexing Anywhere
M70 Mirror in x ON
M80 Mirror in x OFF
M98 Subprogram call
M99 Subprogramexit
14.1.7 Spindle Speed Function ‘S’
In some of the NC machines, speeds are set manually and so are not programmed. Some
machines have stepped drive which can be programmed as Sl, $2, S3,..., and refer to the
Particular speeds available on the corresponding steps. Most NC machines have step less variable
Speed drive and these are programmed as the symbol ‘S’ followed by the speed required, e.g.
$4000 means spindle speed is 4000 rpm.
14.1.8 Tool Change Function ‘T’
All NC machines are generally equipped with turrets or tool magazines with automatic tool
changers (ATC) which enable the positioning of the preset tools in a few seconds. Thus, the ratio
of the cutting time to total machine time is increased. For programming this event, the instruction
in the py block is given by the word ‘T’, followed by the tool number, e.g. T07. In the
it would index bringing tool 7 into a ready position. If the ATC is present it would
sting e . machine spindle and replace it by tool 7.ER ASS
BD PRUU RAIMI ORO aR oe
is are really two systems working together. The programming system
sor. The APT language is a text-based processing system. Master cam,
example of CAD/CAM processing systems, Pro/Engineer is an example
ocessing system, The purpose of the programming system (programming
The programmer's specified information and convert it into a file called a
centre line data fe (CT fle). The CL file contains the cutter centre fine locations of the NC
am along with commands indicating when to turn the spindle ON or OFF, turn the coolant
ON or OFF, turn on cutter diameter compensation and so on.
‘The second system is called the post-processor. The job of the post-processor is to convert
the CL files information into the tape commands that the NC control needs. Most NC shops have
avanety of NC controls, While only one processor, for example, master cam, may be in use in
a given shop, a separate post-processor is required for each machine control.
Regardless of what type of programming system is used (computer aided, CAD/CAM or
solid modelling), each system works in the same basic way that is shown in Fig. 14.20. First
the NC programmer creates a source file. This file or collection files, contains the part geometry,
the tool paths to be developed and any auxiliary statements (turning ON or OFF the spindle,
coolant and so on). The NC programming system then processes this information into a CL file,
\astly the post-processor converts the CL file into the final tape image file that will be loaded into
the NC control
processor) is
CNC PROGRAM EXAMPLES
Prepare CNC programs to machine the part given in Fi
s. 14.21 to 14.25 using lathe.
—
OD
65
Fig. 14.21314. Computer Aided Design and Manufacturing.
}+-——— 40
49
-————_ 33
-/-—————__ 8
Fig. 14.23
8 M12 x2P
[fore
515
Fig. 14.24
Fig, 14.25Setsion, NE Rien Compr Nt ropsig _ TGs
@ The CNC
Program ig
eruner gre 3 follows:
G21 coe
628 UO wo
Mos T2
M03 51200
G00 x22 21
G01 x21
G01 2-25 Fas
G00 x22
Goo z1
Go1 x20
Go1 2-25
Goo x22
Goo zi
Go1 x19
G01 2-25
Goo x22
Goo z1
Gol x18
G01 Z-25
Goo x22
Goo z1
Goi x17
Go1 z-25
Goo x22
Gooza,
Goi x16
G00 x22
Goo z1
Go1 x15
Go1 z~25
G00 x22
Goo z1
G28 vo Wo
‘Mos
M30
The CNC program is as follows: Note that the rod with dia
(BILLET x45 z85
NOl0 G21 G98
No20 G28 vo wo
N030 Moe To2
N040 Mo3 $1200
NOSO Goo x45 21
NO60 G71 U1 RL
No70 G71 Pao Q170 vO.1W0.1 F50
Nogo Go xe
No90 Go1 zo
meter 45 mm is used for machining.~919
‘Solution:
(@ The CNC program is as follows:
(BILLET x22 265
i)
21
G28
Mos
Mo3
Goo
cor
gor
Goo
G00
cor
co
coo
Goo
Go1
Gor
Goo
Goo
co
cor
Goo
Goo
Go1
cor
oo
a98
vo wo
12
51200
X22 2:
x21
2-25
x22
zi
x20
2-25
x22
ZL
x19
2-25
x22
Zz.
xis
2-25
x22
Zz.
x17
2-25
x22
cooz1
cor
Goo
Goo
co1
cor
Goo
Goo
G2
Mos,
M30
x16
x22
za
xis
2-25
x22
Za
vo wo
NC Pare Programming and Computer Al
2
Fas
‘The CNC program is as follows: Note that the rod with diameter 45 mm is used for machining.
(BILLET x45 285
Nolo
No20
W030
No40
Gal
G28
Mos
Mo3
Noso Goo
No6o G71
NO70 G71
Nogo Gor
No90 Go1
G98
vo wo
702
g1200
x45 Z2.
ul RI
go Q170 U0.1W0.1 F50
x8
z0uuter Aided Design and Manufacturing
N100 Goa x12 2-2
N110 Go1 x12 2-14
120 Go1 x20
N130 Goa 2-32
N140 Go1 x24 2-52
NISO G03 X30 2-67 R12.5
N160 GO2 X36 Z-82 R12.5
N170 Go1 x45
N180 G70 P80 Q170
N190 G28 UO WoO
N200 MOS,
N210 M30
Gi) The CNC program is as follows:
(BILLET x38 280
Nolo G22
NO20 G28 UO WO
NO30 G50 $2000
No40 MO6 T2
NOSO G99
NO60 G96 S200
NO70 G00 x38 ZO
NOB0 GO1 X-2 F.05
NO90 GOO x35 22
N100 G 71 U1 RI
N110 G71 P120 Q210 00.1 WO.1 EO7
N120 GO1 x14
130 Go1 zo
N140 GO1 X20 Z-1 FO.05
N150 GO1 2-22
N160 G01 X19 Z-25
N170 G02 X25 Z-40 R30
180 G01 Z-49
N190 GO1 X33 2-53
N200 GO1 2-62
N210 GOO GOO X38 Z2
N220 G42
230 G70 P120 Q210
N240 G40
N2S0 G 28 UO WO
N260 Mos
N270 M30
it a shining.
(iv) The CNC program is as follows: Note that the rod diameter 22 mm is used for mae!
(BILLET x22 265
NO10 G21 G98
NO20 G28 UO WO
NO30 Moe ToO2
NO40 Mo3 $1200
NOSO Goo x23 22
NO60 G 71 U0.5 RIw)
j080 G02
* 090 Go2
N100 Go1
N110 G02
N20 G02
N130 G70
Ni4o G28
Nis0 Mos
N160 M03
N170 Goo
N10 G75,
N10 G28
N200 MOG
N210 M03
N220 GOO
N230 G76
N240 G76
N250 G28
N260 MOS
N270 30
‘The CNC program is as follows:
[BILLET x20 265
Nolo G21
NO20 G28
NO30 Mos
No4o Mo3
No50 Goo
No60 G94
No70z-2
Nogoz-3
Nog0z~4
w100z-5
1102-6
1202-7
1302-8
1402-9
1502-10
N160z-11
170z-12
wigoz-13
wig0z-14
2002-15
210 G00
N220 G94
230 x20
N240 x19
N250 x18
1N260 X17
N270 x16
NC Pare Programming and Ce
“Omputer Aided Pars Programmi
ing. 317.
x10
zo
x12 2-1
2-30
X22 2-35 RS
Pao Qi20
vo wo
Tos
3800
X13 2-23
XB Z-25 PS00 Q500 F50
vo Wo
T04
8500
x13 23
P031560 Q100 RO.15,
X9.850 2-21 Q150 F1.75
UO Wo
98 Gao
uo wo
T02
51500
x21 21
x10 2-1 F50
x20 2-15
20 Z-15 R-15 F50318 Computer Aided Design and Manufacturing
N280 XIS
N290 x14
N300 X13
N310 x12
320 X11
N330 X10
N340 G28 UO WO
N350 M06 TOS
N360 M03 S800
N370 GOO X10 2-10
N380 G90 X9.5 2-13 F30
N390 x9
400 X8.5
N410 xB
N415 Goo x21 21
420 GOO x21 2-50
N430 M98 PO204040
N440 G00 X20
N450 G28 U0 WO
N460 MOS
N470 M30
[PARTING OFF
[CALLING SUB PROGRAM 4040
4040
GOI U-0.8 F30
Wei
U-0.5 F30
WL
M99
MILLING EXAMPLES
Programming using Linear and Circular Interpolation
EXAMPLE 14.1 Write a manual part program for contouring operation for the compost
shown in Fig. 14.26.
A(X = 22.5 Y-37.5)
B(X-37.5 Y-22.5)
C(X-375 Y-22.5)
D(X-225 Y-375)
E(X-22.5 Y-37.5)
F(X-37.5 Y-22.5)
G(K-375 ¥-22.5)
W(X-22.5 Y-37.5)
MX-15 YO)
J(X1S-— YO)F426
7 INEAR INTERPOLATION
(om) CIRCULAR INTERPOLATION CLocKWrsg
co CIRCULAR INTERPOLATION ANT? -cLockyraR
100 ¥100 210 Te define
wae OSH Stns tea sang
the program zero posieien cowiired
billet. fon to the mi
This is usea ¢,
soo.wEF TI D6 Defining tool,
an 694 cnieara® 8PRCkEseD that program Le done in atric
G94 gives the unit of
pn 628 20 628-Go to home
incremental node.
xe x0 YO Go to hone position along x and Y axes.
wos 72 Tool change to Tool No.1.
wt3 $2000 Mo3 makes the spindle rotate in clockwise
direction.
$2000 setting the spindle speed at 2000 xpa.
G00 x0 ¥-37.5 25 690 absolute node.
G00 gives rapid position of the tool to a point
XO ¥-37.5 25 which is just above the billet. This
point is called tool entzy point.
2-1 ¥50 Giving the depth of cut along Z axis at a feed of
50 mm/min.
offset trom
dale of the
‘or simulation,
feed in mm/min.
Position along Z-axis in
X-22.5 Y-37.5
X-37 ¥-22.5 RIS CCW interpolation.
x-37.5
X-37.5 v2.5
X-22.5 Y37.5 RIS
322.5 ¥37.5 f
107.5 22.5 R15 cH interpolation.
307.5 y-22.5
322.5 Y-37.5 RIS
x0 ¥-37.5
2s
“15 Yo
2-1 F50
205 Yo Ris
X18 yo Ris
3% ition.
to home po!
S28 20 Makes the tool to 9°
x0 yo
spindle rotation.
stops the. rewind.
Program stop andGoo
Gol
G02
G03
rapid positioning
linear interpolation
circular interpolation CW
circular interpolation CCW
Dwell
G04
dwell
Table 13.3 G codes
Code
G00
Gor
Gos
G06
Function
Point-to-point positioning, rapid traverse
Linear interpolation
Circular interpolation, clockwise
Circular interpolation, counter-clockwise
Dwell
Hold/delay
Parabolic interpolation
(Cont...)—
Code
G07
G08
G09
G10
Gu
Gi2
G13-G16
Gi7
GIs
G9
G20
G21
622-629
G30
G31
G32
G33
G34
G35
G36-G39
G40
Gal
G42
G43
G44
G45-G52
G53
654.659
G60
G61
G62
G63
G64
G65-G69
G70
on
Ler
Table 13.3 G codes (Cont...)
Function
Unassigned
Acceleration of feed rate
Deceleration of feed rate
Linear interpolation for Jong dimensions (10 inches—100 inches)
Linear interpolation for short dimensions (up to 10 inches)
Unassigned
Axis designation
XY plane designation
ZX plane designation
YZ plane designation
Circular interpolation CW for long dimensions
Circular interpolation CW for short dimensions
Unassigned
Circular interpolation CCW for long dimensions
Circular interpolation CCW for short dimensions
Unassigned
Thread cutting, constant lead
Thread cutting, linearly increasing lead
Thread cutting, linearly decreasing lead
Unassigned
Cutter compensation, cancels to zero
Cutter radius compensation, offset left
Cutter radius compensation, offset right
Cutter radius compensation, positive
Cutter radius compensation, negative
Unassigned
Deletion of zero offset
Datum point/zero shift
Target value, positioning tolerance |
Target value, positioning tolerance 2 or loop cycle
Rapid traverse positioning
Tapping cycle
Change feed rate or speed
Unassigned
Dimensioning in inch units
Dimensioning in metric units
Unassigned