You are on page 1of 21

Def i ni t i on

Comput er Numeri cal Cont rol (CNC) i s one i n whi ch t he f unct i ons and mot i ons of a machi ne
t ool are cont rol l ed by means of a prepared programcont ai ni ng coded al phanumeri c dat a.
CNCcan cont rol t he mot i ons of t he workpi ece or t ool , t he i nput paramet ers s uch as f eed,
dept h of cut , s peed, and t he f unct i ons s uch as t urni ng s pi ndl e on/ of f , t urni ng cool ant on/ of f .
Appl i cat i ons
The appl i cat i ons of CNCi ncl ude bot h f or machi ne t ool as wel l as non- machi ne t ool areas .
I n t he machi ne t ool cat egory, CNCi s wi del y us ed f or l at he, dri l l pres s , mi l l i ng machi ne,
gri ndi ng uni t , l as er, s heet - met al pres s worki ng machi ne, t ube bendi ng machi ne et c. Hi ghl y
aut omat ed machi ne t ool s s uch as t urni ng cent er andmachi ni ng cent er whi ch change t he
cut t i ng t ool s aut omat i cal l y under CNCcont rol have been devel oped. I n t he non- machi ne t ool
cat egory, CNCappl i cat i ons i ncl ude wel di ng machi nes (arc and res i s t ance), coordi nat e
meas uri ng machi ne, el ect roni c as s embl y, t ape l ayi ng and f i l ament wi ndi ng machi nes f or
compos i t es et c.
Advant ages and Li mi t at i ons
I NTRODUCTI ON
The benef i t s of CNCare (1) hi gh accuracy i n manuf act uri ng, (2) s hort product i on t i me, (3)
great er manuf act uri ng f l exi bi l i t y, (4) s i mpl er f i xt uri ng, (5) cont our machi ni ng (2 t o 5 - axi s
machi ni ng), (6) reduced human error. The drawbacks i ncl ude hi gh cos t , mai nt enance, and t he
requi rement of s ki l l ed part programmer .
ELEMENTSOFA CNC
ACNCs ys t emcons i s t s of t hree bas i c component s (Fi gure 2) :
Part Program
1 .

Part program
2 .

Machi ne Cont rol Uni t (MCU)
3 .

Machi ne t ool (l at he, dri l l pres s , mi l l i ng machi ne et c)
The part programi s a det ai l ed s et of commands t o be f ol l owed by t he machi ne t ool . Each
command s peci f i es a pos i t i on i n t he Cart es i an coordi nat e s ys t em(x, y, z ) or mot i on (workpi ece
t ravel or cut t i ng t ool t ravel ), machi ni ng paramet ers and on/ of f f unct i on. Part programmers
s houl d be wel l vers ed wi t h machi ne t ool s , machi ni ng proces s es , ef f ect s of proces s vari abl es ,
and l i mi t at i ons of CNCcont rol s . The part programi s wri t t en manual l y or by us i ng comput er-
as s i s t ed l anguage s uch as APT(Aut omat ed Programmi ng Tool ) .
Machi ne Cont r ol Uni t
MACHINETOOL
Fi gur e 2. At ypi cal numer i cal cont r ol syst emf or a mi l l i ng machi ne
Themachi necont r ol uni t (MCU) i s a mi cr ocomput er t hat st or es t he pr ogr amand execut es t he
commands i nt o act i ons by t he machi ne t ool . TheMCUconsi st s of t wo mai nuni t s: t he dat a
pr ocessi ng uni t (DPU) and t he cont r ol l oops uni t (CLU) . The DPUsof t war e i ncl udes cont r ol
syst emsof t war e, cal cul at i on al gor i t hms, t r ansl at i on sof t war e t hat conver t s t he par t pr ogr am
i nt o ausabl e f or mat f or t he MCU, i nt er pol at i on al gor i t hmt o achi eve smoot hmot i onof t he
cut t er , edi t i ng of par t pr ogr am(i n case of er r or s and changes) . The DPUpr ocesses t he dat a
f r omt he par t pr ogr amand pr ovi des i t t o t he CLUwhi ch oper at es t he dr i ves at t ached t o t he
machi ne l eadscr ews and r ecei ves f eedback si gnal s ont he act ual posi t i on and vel oci t y of each
one of t he axes. Adr i ver (dc mot or ) and af eedback devi ce ar e at t ached t o t he l eadscr ew.
The CLUconsi st s of t he ci r cui t s f or posi t i on and vel oci t y cont r ol l oops, decel er at i on and
backl ash t ake up, f unct i on cont r ol s suchas spi ndl e on/ of f .
Machi ne Tool
Themachi ne t ool coul d be one of t he f ol l owi ng: l at he, mi l l i ng machi ne, l as er , pl as ma,
coor di nat e meas ur i ng machi ne et c. Fi gur e 3 s hows t hat a r i ght - hand coor di nat e s ys t emi s us ed
t o des cr i be t he mot i ons of a machi ne t ool .

Ther e ar e t hr ee l i near axes ( x, y, z ) , t hr ee r ot at i onal
axes ( i , j , k ) , and ot her axes s uch as t i l t ( 9) ar e pos s i bl e. For exampl e, a 5- axi s machi ne
i mpl i es any combi nat i onof x, y, z , i , j , k , and 6.
Fi gur e 3 . Ri ght - hand coor di nat e s ys t emus ed i n dr i l l pr es s and l at he
5
Basi cLengthUni t (BLU)
EachBLUuni t cor r esponds to theposi ti onr esol uti onof theaxi s of moti on. For exampl e,
1 BLU=0. 0001 " means that theaxi s wi l l move0. 0001 " f or ever y oneel ectr i cal pul se
r ecei ved by themotor . TheBLUi s al so r ef er r ed to as Bi t (bi nar y di gi t).
Pul se=BLU=Bi t
Poi nt- to- Poi nt Systems
Poi nt- to- poi nt systems ar ethosethat movethetool or thewor kpi ecef r omonepoi nt to
another and thenthetool per f or ms ther equi r ed task. Uponcompl eti on, thetool (or
wor kpi ece) moves to thenext posi ti onand the cycl ei s r epeated (Fi gur e4). Thesi mpl est
exampl ef or thi s typeof systemi s adr i l l i ngmachi newher ethewor kpi ecemoves.
I nthi s system, thef eed r ateand thepathof the cutti ngtool (or wor kpi ece) haveno
si gni f i cance onthemachi ni ngpr ocess. Theaccur acy of posi ti oni ngdepends onthesystem' s
r esol uti oni nter ms of BLU(basi c l engthuni t) whi chi s gener al l y between0 . 001 " and 0. 0001 " .
PRI NCI PLES OF CNC
Fi gur e4. Cutter pathbetweenhol es i napoi nt- to- poi nt system
Exampl e1
TheXYtabl eof a dr i l l i ngmachi nehas to bemoved f r omthepoi nt (1 , 1 ) to thepoi nt
(6, 3). Eachaxi s canmoveat avel oci ty of 0. 5"/ sec, and theBLUi s 0. 0001 ", f i nd the
tr avel ti meand r esol uti on.
Tr avel ti mei nX- axi s i s (6- 1 )/ 0. 5 =1 0 sec, i nY- axi s i s (3- 1 )/ 0. 5=4 sec.
Tr avel ti me=1 0 sec
Resol uti on=BLU=0. 0001
Wor kpi ece
Cont i nuous Pat h Syst ems ( St r ai ght cut andCont our i ng syst ems)
These syst ems pr ovi de cont i nuous pat h such t hat t he t ool can per f or mwhi l e t he axes ar e
movi ng, enabl i ng t he syst emt o gener at e angul ar sur f aces, t wo- di mensi onal cur ves, or t hr ee-
di mensi onal cont our s . Exampl e i s a mi l l i ng machi ne wher e such t asks ar e accompl i shed
( Fi gur e 5) . Each axi s mi ght move cont i nuousl y at a di f f er ent vel oci t y. Vel oci t y er r or i s
si gni f i cant i n af f ect i ng t he posi t i ons of t he cut t er ( Fi gur e 5) . I t i s much mor e i mpor t ant i n
ci r cul ar cont our cut t i ng wher e one axi s f ol l ows si ne f unct i on whi l e t he ot her f ol l ows cosi ne
f unct i on. Fi gur e 6 i l l ust r at es poi nt - t o- poi nt and cont i nuous pat h f or var i ous machi nes .
Fi gur e 5. ( a) Cont i nuous pat h cut t i ng and ( b) Posi t i on er r or caused by t he vel oci t y er r or
Exampl e 2
ACNC mi l l i ng machi ne has t o cut a sl ot l ocat ed bet ween t he poi nt s ( 0, 0) and ( 4, 3)
on t he XY- pl ane wher e t he di mensi ons ar e i n i nches. I f t he speed al ong t he sl ot i s t o
be 0. 1 i n/ sec, f i nd t he cut t i ng t i me and axi al vel oci t i es .
Di st ance t r avel ed al ong t he sl ot =( 16+9) ' "2 =5"
Cut t i ng t i me =5/ 0 . 1 =50 sec
Vx =xV/ ( x2
+y2) "
=4( 0. 1) / 5 =0. 08 i n/ sec
Vy =yV/ ( x2+y2) ' "2 =3( 0 . 1) / 5 =0. 06 i n/ sec
I f t he vel oci t y i s Y- axi s i s of f by 10%, what woul d be t he newposi t i on ?
Newvel oci t y i n y i s 0. 9 x 0 . 06 =0. 054 i n/ sec
I n 50 sec, t he y- wi l l move a di st ance [ 50( 0 . 054) ] =2. 7 i n.
Poi nt - t o- poi nt

Poi nt - t o- poi nt and
Dr i l l i ng and
bor i ng
2- axi s cont our i ngwi t h
swi t chabl epl ane
st r ai ght l i ne
3- ar i s cont our i ng
oont i nuous pat h
2- axi s cont our
mi l l i ng

mi l l i ng
Fi gur e 6. Schemat i c i l l ust r at i on of dr i l l i ng, bor i ng, and mi l l i ng wi t h var i ous pat hs .
I nt er pol at or
The i nput speed of l i n/ sec i n exampl e 2 i s conver t ed i nt o t he vel oci t y component s by an
i nt er pol at or cal l ed t he l i near i nt er pol at or whose f unct i on i s t o pr ovi de t he vel oci t y si gnal s t o x
and y di r ect i ons . Si mi l ar l y we have ci r cul ar and par abol i c i nt er pol at or s .

See Fi gur e 7.
i ' f

Quadr ant ~- - - -

Ful l
ci r cl e
Fi gur e 7.

Types of i nt er pol at i on ( a) l i near , ( b) cont i nuous pat h appr oxi mat ed by
i ncr ement al st r ai ght l i nes, and ( c) ci r cul ar
I ncr ement al andAbsol ut e syst ems
CNCsyst ems ar e f ur t her di vi ded i nt o i ncr ement al and absol ut e syst ems ( Fi gur e 8) . I n
i ncr ement al mode, t he di st ance i s measur ed f r omone poi nt t o t he next . For exampl e, i f you
want t o dr i l l f i ve hol es at di f f er ent l ocat i ons, t he x- posi t i on commands ar e x +500, +
200, +
600, - 300, - 700, - 300. An absol ut e syst emi s one i n whi ch al l t he movi ng commands ar e
r ef er r ed f r oma r ef er ence poi nt ( zer o poi nt or or i gi n) . For t he above case, t he x- posi t i on
commands ar e x 500, 700, 1300, 1000, 300, 0. ( Fi gur e 8) . Bot h syst ems ar e i ncor por at ed i n
most CNCsyst ems. For an i nexper i encedoper at or , i t i s wi se t o use i ncr ement al mode.
Fi gur e 8.
10
8
6
( b) Dr i l l i ng 5- hol es at di f f er ent l ocat i ons
( a) Absol ut e ver sus i ncr ement al ; I n absol ut e posi t i oni ng, t he move i s speci f i ed
by x =6, y =8 ; i n i ncr ement al , t he move i s speci f i ed by x=4, y=5 f or t he t ool
t o be movedf r om( 2, 3) t o ( 6, 8)
The absol ut e syst emhas t wo si gni f i cant advant ages over t he i ncr ement al syst em:
I nt er r upt i ons causedby, f or exampl e, t ool br eakage ( or t ool change, or checki ng
t he par t s) , woul dnot af f ect t he posi t i on at t he i nt er r upt i on.
I f a t ool i s t o be r epl aced at some st age, t he oper at or manual l y moves t he t abl e, exchanges t he
t ool , and has t o r et ur n t he t abl e t o t he begi nni ng of t he segment i n whi ch t he i nt er r upt i on has
occur r ed. I n t he absol ut e mode, t he t ool i s aut omat i cal l y r et ur ned t o t he posi t i on. I n
i ncr ement al mode, i t i s al most i mpossi bl e t o br i ng i t pr eci sel y t o t hat l ocat i on unl ess you
r epeat t he par t pr ogr am
2.

Easy change of di mensi onal dat a
Thei ncr ement al mode has t wo advant ages over t he absol ut e mode.
1 .

I nspect i on of t hepr ogr ami s easi er because t he sumof posi t i on commands f or each
axi s must be zer o. Anonzer o sumi ndi cat es an er r or . Such an i nspect i on i s i mpossi bl e
wi t h t he absol ut e syst em.
2.

Mi r r or i magepr ogr ammi ng ( f or exampl e, symmet r i cal geomet r y of t hepar t s) i s si mpl e
by changi ng t he si gns of t he posi t i on commands.
Open Loop Cont r ol Syst ems
The open- l oop cont r ol means t hat t her e i s no f eedback anduses st eppi ng mot or s f or dr i vi ng
t he l eadscr ew. Ast eppi ng mot or i s a devi ce whose out put shaf t r ot at es t hr ough a f i xed angl e
i n r esponse t o an i nput pul se ( Fi gur e 9) . The accur acy of t he syst emdepends on t he mot or ' s
abi l i t y t o st ep t hr ough t he exact number . The f r equency of t he st eppi ng mot or depends on t he
l oadt or que. Thehi gher t he l oad t or que, l ower woul dbe t he f r equency. Excessi ve l oad t or que
may occur i n mot or s due t o t he cut t i ng f or ces i n machi ne t ool s . Hencet hi s syst emi s mor e
sui t abl e f or cases wher e t he t ool f or ce does not exi st ( Exampl e: l aser cut t i ng) .
Pul se
t r ai n a st eppi ng
mot or
A=n ( 360/ N) , degr ees
x =p( n/ N)
Wor k t abl e
Leadscr ew
Fi gur e 9.

Open l oop cont r ol syst em
The st eppi ng mot or i s dr i ven by a ser i es of el ect r i cal pul ses gener at ed by t he MCU. Each
pul se causes t he mot or t o r ot at e a f r act i on of oner evol ut i on. Thef r act i on i s expr essedi n
t er ms of t he st ep angl e, oc, gi ven by
a =360/ N, degr ees wher eN=number of pul ses r equi r ed f or oner evol ut i on
I f t he mot or r ecei ves " n" number of pul ses t hen t he t ot al angl e,
I n t er ms of t he number of r evol ut i ons, i t woul dbe ( n/ N)
I f t her e i s a 1 : 1 gear r at i o bet ween t he mot or andt he l eadscr ew, t hen t he l eadscr ewhas ( n/ N)
r evol ut i ons .

I f t he pi t ch of l eadscr ewi s p ( i n/ r ev) , t hen t he di st ance t r avel edaxi al l y, say x,
can be used t o achi eve a speci f i ed x- i ncr ement i n a poi nt - t o- poi nt syst em.
1 0
The pul se f r equency, f , i n pul ses/ sec det er mi nes t he t r avel speed of t he t ool or t he wor kpi ece.
60 f =N(RPM) wher e N=number of pul ses per r evol ut i on,
RPM=RPMof t he l ead scr ew
The t r avel speed, V, i s t hen gi ven by V=p (RPM) wher e p pi t ch i n i n/ r ev
Exampl e 3
Ast eppi ng mot or has N=150, p =0. 2"/ r ev ; I f n =2250 pul ses, what i s t he di st ance
t r avel ed i n x- di r ect i on ? What shoul d be t he pul se f r equency f or a t r avel speed of 16
i n. / mi n ?
x =(0. 2) (2250)/ 150 =3"
16' =0. 2 (RPM), f r omwhi ch, RPM=80
f =(150) (80)/ 60 =200 Hz
Exampl e 4
Ast eppi ng mot or of 200 st eps per r evol ut i on i s mount ed on t he l eadscr ewof a
dr i l l i ng machi ne. I f t he pi t ch i s 0. 1 i n/ r ev. ,
a.
b.
a .
b.
What i s t he BLU?
I f t he mot or r ecei ves a pul se f r equency of 2000 Hz, what i s t he speed of t he
t abl e ?
BLU=0. 1/ 200 =0. 0005"
Tabl e speed =(p) (RPM) =(0. 1) (60) (2000)/ 200 =60 i n/ mi n
Cl osed- l oop Cont r ol Syst ems
Cl osed - l oop NCsyst ems ar e appr opr i at e when t her e i s a f or ce r esi st i ng t he movement of t he
t ool / wor kpi ece. Mi l l i ng and t ur ni ng ar e t ypi cal exampl es . I n t hese syst ems (Fi gur e 10) t he DC
ser vomot or s and f eedback devi ces ar e used t o ensur e t hat t he desi r ed posi t i on i s achi eved.
The f eedback sensor used i s an opt i cal encoder shown i n Fi gur e 11 . The encoder consi st s of
a l i ght sour ce, a phot odet ect or , and a di sk cont ai ni ng a ser i es of sl ot s . The encoder i s
connect ed t o t he l eadscr ew. As t he scr ewt ur ns, t he sl ot s cause t he l i ght t o be seen by t he
phot odet ect or as a ser i es of f l ashs whi ch ar e conver t ed i nt o an equi val ent ser i es of el ect r i cal
pul ses whi ch ar e t hen used t o char act er i ze t he posi t i on and t he speed. The equat i ons r emai n
essent i al l y t he same as open- l oop except t hat t he angl e bet ween t he sl ot s i n t he di sk i s t he
st ep angl e, a.
Bot h t he i nput t o t he cont r ol l oop and t he f eedback si gnal s ar e a sequence of pul ses, each
pul se r epr esent i ng a BLUuni t . The t wo sequences ar e cor r el at ed by a compar at or and gi ves
a si gnal , by means of a di gi t al - t o- anal og conver t er , ( a si gnal r epr esent i ng t he posi t i on er r or ) ,
t o oper at e t he dr i ve mot or ( DCser vomot or ) .
I nput
Compar at or DAC
do
ser vomot or
Feedback si gnal
Fi gur e 10. Cl osed l oop cont r ol syst em
1 2
Gear
Wor k t abl e
Phot ocel l
( a)

( b)
Posi t i on
sensor
Si gnal pul ses
Ti me
Fi gur e 11 . Opt i cal Encoder ( a) Devi ce ( b) Ser i es of pul ses emi t t ed
Exampl e 5
Consi der a CNCwor kt abl e dr i ven by a cl osed- l oop cont r ol syst emconsi st i ng of a
ser vomot or , l eadscr ew, and opt i cal encoder . The l eadscr ewhas api t ch, p =0. 2" and
i s coupl ed t o t he mot or shaf t wi t hascr ewt o mot or gear r at i o of 1 : 4 . The encoder
gener at es 150 pul ses per r evol ut i on of t he l eadscr ew. I f t he number of pul ses and t he
pul se r at e r ecei ved by t he cont r ol syst emar e 2250 and 200Hz r espect i vel y, cal cul at e
a.

Tabl e speed
b.

Mot or speed i n RPM
c.

Di st ance t r avel ed by t he t abl e
a.

V=p(RPM) =0. 2(RPM) =(0. 2) (60 f )/ N=(0. 2) (60) (200)/ 150 =16 i n/ mi n
b.

RPMof t he l eadscr ew=(60) (200)/ (150) =80
RPMof t he mot or =320
c.

x=p(n/ N) =(0. 2) (2250)/ 150 =3"
Exampl e 6
Ado ser vomot or i s coupl ed t o al eadscr ewwhi chdr i ves t he t abl e of aCNCmachi ne
t ool . Adi gi t al encoder , mount ed at t he end of t he scr ew, emi t s 500 pul ses per
r evol ut i on. I f t he pi t chi s 5 mmper r ev, and t he mot or r ot at es 600 r pm(1 : 1 gear
r at i o), cal cul at e t he
a.

Tabl e speed
b. BLU
c.

Fr equency of pul ses t r ansmi t t ed by t he encoder
a.

V=p(RPM) =5 (600) = 3000 mm/ mi n =3 m/ mi n
b.

BLU=5/ 500 =0. 01 mm
c.

RPM=600=(60f )/ N=60 f / 500 f r omwhi ch f =5000 Hz
1 3
o Resol ut i on
o Accuracy
o Repeat abi l i t y
PRECI SI ONI NCNCMACHI NI NG
The combi ned charact eri st i cs of t he machi ne t ool and t he cont rol det ermi ne t he preci si on of
posi t i oni ng. Three cri t i cal measures of preci si on are :
Cont rol resol ut i on (BLU) i s t he di st ance separat i ng t wo adj acent poi nt s i n t he axi s movement
(t he smal l est change i n t he posi t i on) . The el ect romechani cal component s of t he posi t i oni ng
syst emt hat af f ect t he resol ut i on are t he l eadscrewpi t ch, t he gear rat i o, and t he st ep angl e i n
t he st eppi ng mot or (open l oop) or t he angl e bet ween t he sl ot s i n t he encoder (cl osed- l oop) .
The cont rol resol ut i on f or a 1 : 1 gear rat i o of a st epped mot or i s,
Resol ut i on =p/ N

where p =pi t ch, and N=360/ a
Feat ures smal l er t han t he cont rol resol ut i on coul d not be produced. The programmi ng
resol ut i on can not exceed t he cont rol resol ut i on.
Accuracy of a CNCsyst emdepends on t he resol ut i on, t he comput er cont rol al gori t hms, and
t he machi ne i naccuraci es . The i naccuracy due t o t he resol ut i on i s consi dered t o be (1 / 2)BLU
on t he average. The cont rol al gori t hmi naccuracy i s due t o t he roundi ng of f t he errors i n t he
comput er whi ch i s i nsi gni f i cant . The machi ne i naccuracy coul d be due t o several reasons
(descri bed bel ow) . The desi gner mi ni mi zes t hi s i naccuracy t o be under (1 / 2)BLUand hence
Machi ni ng I naccuracy
Accuracy =(1 / 2) Resol ut i on +Machi ni ng i naccuracy =BLU
Repeat abi l i t y i s a st at i st i cal t ermassoci at ed wi t h accuracy. I t ref ers t o t he capabi l i t y of a
posi t i oni ng syst emt o ret urn t o a programmedpoi nt , and i s measured i n t erms of t he errors
associ at ed wi t h t he programmed poi nt . The devi at i on f romt he cont rol poi nt (error) usual l y
f ol l ows a normal di st ri but i on i n whi chcase t he repeat abi l i t y may be gi ven as +/ - 3a where a
i s t he st andard devi at i on. The repeat abi l i t y i s al ways bet t er t han t he accuracy. The mechani cal
i naccuracy can be consi dered as t he repeat abi l i t y. Fi gure 1 2 shows t he di f f erence bet ween t he
accuracy and t he repeat abi l i t y.
Cut t i ng t ool def l ect i on, machi ne t ool chat t er, mechani cal l i nkage bet ween t he l eadscrewand
t he t ool , and t hermal def ormat i ons are t he chi ef cont ri but i ng f act ors . The l eadscrewt ransmi t s
t he power t o t he t abl e or t ool hol der by means of a nut t hat engages t he l eadscrew.

Thi s wi l l
creat e what i s known as "backl ash"due t o t he f ri ct i on bet ween t he screwand t he nut . I f t he
nut consi st s of bal l beari ngs, t he f ri ct i on i s reduced. Thermal def ormat i ons are si gni f i cant .
For exampl e, a t emperat ure di f f erence of 1 Cal ong 1 000 mmcan cause an error of 0. 01 mm.
1 4
EMEMOMME
MOMEMENN
MMMMMMMM
MENNOMME
MEMEN
MI No
MMEMEMEN
LowAccuracy
LowRepeat abi l i t y
MEMEME"O
MEN"E"""
MMOMMOME
EMMMOMME
........
MEMMEME"
MOMMOMME
MEMEMMEN
LowAccuracy
Hi gh Repeat abi l i t y
Fi gure 12. Di agramshowi ng t he di f f erence bet ween accuracy and repeat abi l i t y
s
ONNEEMEN
EMOMMEN
IMMEMENE
M"MMIMSN
...LO...
MMMMMMMM
M"""M"N
""""MM""
Hi gh Accuracy
Hi gh Repeat abi l i t y
Exampl e 7
What i s t he cont rol resol ut i on f or a 4 : 1 gear rat i o(mot or: l eadscrew) , pi t ch of
l eadscrew0.2 i n/ rev, and t he mot or recei ves 600 pul ses per revol ut i on
Si nce t he mot or shaf t rot at es 4 t i mes f ast er t han t he l eadscrew, N=600/ 4 =150
Resol ut i on =0.2/ 150 =0.001333"
What woul d be t he accuracy and repeat abi l i t y i f t he machi ni ng i naccuracy i s about
(1/ 2) BLU ?
Accuracy =0.001333/ 2
+
0.001333/ 2=0.001333"
Repeat abi l i t y =+/ - 0.00067"
1 5
Thet r ansf er of an engi neer i ng bl uepr i nt of a pr oduct t o a par t pr ogr amcan be per f or med
manual l y usi ng a cal cul at or or wi t h t he assi st ance of a comput er l anguage. Apar t pr ogr ammer
must have an ext ensi ve knowl edgeof t he machi ni ng pr ocesses and t he capabi l i t i es of t he
machi net ool s . I n t hi s sect i on, we descr i be howt he par t pr ogr ammer s execut e manual l y t he
par t pr ogr ams .
Fi r st , t he machi ni ng par amet er s ar e det er mi ned. Second, t he opt i mal sequence of oper at i ons
i s eval uat ed. Thi r d, t he t ool pat h i s cal cul at ed. Four t h, a pr ogr ami s wr i t t en. Each l i ne of t he
pr ogr am, r ef er r ed t o as a bl ock, cont ai ns t he r equi r ed dat a f or t r ansf er f r omone poi nt t o t he
next .
At ypi cal l i ne f or a pr ogr ami s gi ven bel ow.
N100G91 X- 5. 0 Y7. 0 F100 S200T01 M03(EOB)
The si gni f i cance of each t er mi s expl ai ned bel ow.
Sequence Number , N
Consi st i ng of t ypi cal l y t hr ee di gi t s, i t s pur pose i s t o i dent i f y t he speci f i c machi ni ng oper at i on
t hr ough t he bl ock number par t i cul ar l y when t est i ng a par t pr ogr am.
Pr epar at or y Funct i on, G
I t pr epar es t he MCUci r cui t s t o per f or ma speci f i c oper at i on . TheG- codes (some) ar e shown
i n Tabl e 1 . G91 i mpl i es i ncr ement al mode of oper at i on.
Di mensi on Wor ds
1 .

Di st ance di mensi on wor ds, X, Y, Z
2.

Ci r cul ar di mensi on wor ds, I , J , K f or di st ances t o t he ar c cent er
3.

Angul ar di mensi ons, A, B. C
PARTPROGRAMMI NGFORCNC
Whi l e (1) and (3) ar e expr essed ei t her by i ncr ement al or absol ut e mode, (2) i s al ways i n gi ven
i n i ncr ement al mode. Al l angul ar di mensi ons ar e speci f i ed i n r evol ut i ons or degr ees .
I n t he above bl ock, Xmoves a di st ance of 5 i n. i n t he negat i ve di r ect i on whi l e Ymoves a
di st ance of 7i n. i n t he posi t i ve di r ect i on.

Ot her axes r emai n st at i onar y. I n some syst ems,
act ual di st ances ar e used. I n ot her s, t he di mensi on wor ds ar e pr ogr ammed i n BLUs .
16
Feedr at e, F
I t i s expr es s ed i n i n/ mi n or mm/ mi n and, i s us ed i n cont our i ng or poi nt - t o- poi nt or s t r ai ght - cut
s ys t ems . For exampl e, a f eedr at e of F100i mpl i es 100 i n/ mi n or 100mm/ mi n. Feedr at es ar e
i ndependent of s pi ndl e s peed.
I n l i near mot i ons , t he f eedr at e of t he cut t i ng t ool i s not cor r ect ed f or t he cut t er r adi us .

But
i n ci r cul ar mot i ons , t he f eedr at e s houl d be cor r ect ed f or t he t ool r adi us as f ol l ows :
For cut t i ng ar ound t he out s i de of a ci r cl e, t he pl us s i gn i n t he above equat i on i s us ed, and t he
f eedr at e i s i ncr eas ed. For cut t i ng ar ound t he i ns i de of a ci r cl e, t he mi nus s i gn i s us ed, and t he
f eedr at e i s decr eas ed.
Exampl e 8
See Fi gur e 5( a) . I f t he r equi r ed f eedr at e i s 6 i n/ mi n, par t cont our r adi us i s 1. 5 i n,
and t he cut t er di amet er i s 1 i n, what i s t he f eedr at e at he t op and bot t omci r cl es ?
Feedr at e at t he t op i s t o be 8 i n/ mi n and at t he bot t omi s t o be 4 i n/ mi n.
Spi ndl e s peed, S
Pr ogr ammed i n r ev/ mi n, i t i s expr es s ed as RPMor by a t hr ee- di gi t code number t hat i s
r el at ed t o t he RPM.
Tool wor d, T
Cons i s t i ng of a maxi mumof f i ve di gi t s , each cut t i ng t ool has a di f f er ent code number . The
t ool i s aut omat i cal l y s el ect ed by t he aut omat i c t ool changer when t he code number i s
pr ogr ammed i n a bl ock.
Mi s cel l aneous Funct i on, M
Cons i s t i ng of t wo di gi t s , t hi s wor d r el at es t o t he movement of t he machi ne i n t er ms of s pi ndl e
on/ of f , cool ant on/ of f et c s hown i n Tabl e 2.
EOB
F =[ ( par t cont our r adi us t ool r adi us ) / par t cont our r adi us ] ( r equi r ed f eedr at e)
The EOB char act er i s us ed at t he end of each bl ock t o compl et e a l i ne.
1 7
Tabl e .

. 1

Pr epar at or y commands ( G- code)
G00

Poi nt - t o- poi nt posi t i oni ng
G01

Li near i nt er pol at i on
G02

Cl ockwi se ci r cul ar i nt er pol at i on
G03

Count er - cl ockwi se ci r cul ar i nt er pol at i on
G04 Dwel l
G05 Hol d
G33

Thr ead cut t i ng, const ant l ead
G40

Cancel t ool nose r adi us compensat i on
G41

Tool nose r adi us compensat i on- l ef t
G42

Tool nose r adi us compensat i on- r i ght
G43

Cut t er l engt h compensat i on
G44

Cancel cut t er l engt h compensat i on
G70

Di mensi ons i n i nches
G71

Met r i c di mensi ons
G90

Absol ut e di mensi ons
G91

I ncr ement al di mensi ons
G92

Dat umof f set
Tabl e .

. 2

Mi scel l aneous commands ( M- code)
M00

Pr ogr amst op
M01

Opt i onal st op
M02

Endof pr ogr am
M03

Spi ndl e st ar t cl ockwi se
M04

Spi ndl e st ar t count er - cl ockwi se
M05

Spi ndl e st op
M06

Tool change
M07

Mi st cool ant on
M08

Fl ood cool ant on
M09

Cool ant of f
M1 0 Cl amp
Ml l Uncl amp
M1 3

Spi ndl e cl ockwi se, cool ant on
M1 4

Spi ndl e count er - cl ockwi se, cool ant on
M30

Endof t ape, r ewi nd
Tabl es 1 and 2:

Gand Mcodes used i n CNCsyst ems
1 8
4-7-2 G Functi ons (SEI COS-MI I )
G codes wi th "

" are set when the power i s. turned
on.
G40, G49 and G80 are set by resetti ng the NC uni t .
G code Group Functi on
GOO Posi ti oni ng (rapi d traverse)
GO1
01
Li near i nterpol ati on (cutti ng feed) .
G02 Ci rcul ar i nterpol ati on CW
G03 Ci rcul ar i nterpol ati on CCW
G04 Dwel l
G07 00 SI N i nterpol ati on (desi gnati on of vi rtual axi s)
G09 Exact stop check
G10 Offset amount and work zero poi nt offset amount setti ng
G17 Desi gnati on of X-Y pl ane
G18 02 Desi gnati on of Z-X pl ane
G19 Desi gnati on of Y-Z pl ane
G20 06 I nch i nput
G21 Metri c i nput;
G22
04~
Stored stroke, l i mi t, ON
G23 Stored' --stroke"- l i mi t OFF
G27 Return to reference pai nt
G28 Return to reference-pant: _ -_ . . .
G29 00 Return fromreference poi nt ` '
G30 Return to 2nd reference poi nt
4
G31 Ski p functi on
G40 07 Tool di ameter compensati on cancel
G41 Tool di ameter compensati on to l eft
G42 Tool di ameter compensati on to ri ght
G43 Tool l ength compensati on
G44 08 Tool l ength compensati on
G49 Tool l ength compensati on cancel
G45 Tool offset expansi on
G46 00 Tool offset reducti on
G47 Tool offset doubl e expansi on
G48 Tool offset doubl e reducti on
G50 11 Scal i ng cancel
G51 Scal i ng
4 - 30
Gcode Group Functi on
G52 00 . Local coordi nate systemsetti ng
G53 Machi ne coordi nate systemsel ecti on
G54 Work coordi nate system1 sel ecti on
G55 12 Work coordi nate system2 sel ecti on
G56 Work coordi nate system3 sel ecti on
G57 Work coordi nate system4 sel ecti on
G58 Work coordi nate system5 sel ecti on
G59 Work coordi nate system. 6 sel ecti on
G60 00 I One di recti onal posi ti oni ng
G61 Exact stop check mode
G63 13 I Tappi ng mode
G64 Conti nuous cutti ng mode
G65 00 Macro cal l
G66 14 Macro modal cal l A
G67~
C
Macro modal cal l cancel
G73 + Peck dri l l i ng cycl e
G74 Reverse tappi ng cycl e
G76 I Fi ne bori ng
G80 ` Canned cycl e cancel
G81' Dr i l l i ng cycl e, spot bori ng
G82 Dri l l i ng cycl e, counter bori ng
G83 09 Peck dri l l i ng cycl e
G84 ( Tappi ng cycl e
G85 Bori ng cycl e
G86 I Bori ng cycl e
G87
r
Back bori ng cycl e - ' "
G88 Bori ng cycl e
G89 I Bori ng cycl e
G90 03 L Absol ute programmi ng
G91 I ncremental programmi ng
G92 00 Programmi ng of absol ute zero poi nt
G98 10 I I ni ti al l evel return ( canned cycl e)
G99 Rpoi nt l evel return ( canned cycl e)
G501 15 Programmabl e mi rror i mage cancel
G511 Programmabl e mi rror i mage
4-7-3 MFuncti ons
( * : Opti onal functi on)
M I Functi on name M Functi on name
00 Programstop *33
I dl e cutti ng ti me reducti on
( modal )
01 Opti onal stop *34
( I dl e cutti ng ti me reducti on
( unmodal )
02 End of program *35 Automati c start ON
03 ( Spi ndl e forward *36 Automati c start OFF
04 Spi ndl e reverse *37
05 ( Spi ndl e stop *38
Spi ndl e no-l oad detect functi on
stop
06 Tool change ATC *39 M38 cancel
*07 Mi st cool ant start *40 Tool nose ai r bl owON
08 Fl ood cool ant start *41 Tool nose ai r bl owOFF
09 ( Mi st cool ant stop *42
*10 Mi st cool ant atti tude 1 *43
*11 Mi st cool ant atti tude 2 *44
*12 Work count *45 Spare tool offset enabl ed
13 Spi ndl e forward & cool ant start ' ' *46 ( Spare tool offset di sabl ed
14 Spi ndl e reverse & cool ant start *47 J et cool ant start
15 M13/M14 stop 48 ( Feed rate overri de enabl ed
*16i Measurement ai r bl owON 49 Feed rate overri de 100%
*17 Measurement ai r bl owOFF *50 Oi l hol e cool ant start
*18~Measuri ng spi ndl e ori entati on *51
19 Spi ndl e ori entati on *52 Tool breakage detect
*20~Machi ni ng ti me moni tori ng *53
*21 *54
*22 *55
*23 *56
*24 *57
*25 *58
*26 Mel odi a ( 1) *59
*27 Mel odi a ( 2) *60 Work change APC
*28 Setti ng l oad l evel 0 *61
*29 Setti ng l oad l evel 1 *62
30 End of tape *63
*31 Chi p conveyor start *641
*32 M33 cancel *65
4- 3 2
M Functi on name M Functi on name
*66
*67
*68 Addi ti onal axi s cl amp
*69 Addi ti onal axi s uncl i mp
*70 M70 output
*71 M71 output
*72 M72 output
*73 M73 output
*74 Ski p sel ecti on OFF
*75 Ski p sel ecti on ON
*76 .
*77
*78 Addi ti onal axi s cl amp
*79 Addi ti onal axi s uncl amp
*80 Tool nose ai r bl owON
*81
*82
*83
i
*84
*85
*86
Measurement NGtool breakage
detect
*87
*90
*91
*92
*93
*94
*95
*96
*97
98 Subprogramcal l
99 End of subprogram
4-33
M Mai ntenance mode
*1001 Armswi ng-i n to spi ndl e si de
*101
*102. Armadvance
*103 Armturn CW
*104 Armturn CCW
*105 Armretract
*106 Armsl i de to home posi ti on__
*107
*108 Armsl i de to magazi ne si de
*109
*110
*111
*112
*113
*114
*115
*116
*117
*118
*119 Ori entati on
*120 Magazi ne posi ti oni ng pi n OUT
*121 Magazi ne posi ti oni ng pi n I N 1
*122
*123,
*124 Pal l et sl i der advance (APC)
*125 Pal l et uncl amp (APC)
*1261 Pal l et sl i der retract (APC)
*1271 Pal l et ri ght turn (APC)
*128 Pal l et l eft turn (APC)
1
-
*129 Pal l et uncl amp (APC)

You might also like