Note1. Computer Numerical Control (CNC)
Page(1(
Objectives:
To(understand(the(working(principle(and(applications(of(CNC(machinesU(
To( be( able( to( prepare( CNC( part( programmes( for( machining( 2VD(
workpiecesU(
Content:
Chapter(1( Numerical(Control(Fundamentals(
Chapter(2( CNC(Part(Programming(
Introduction
Computer( Numerical( Control( qCNC'( is( a( specialized( and( versatile( form( of( Soft(
Automation( and( its( applications( cover( many( kindsM( although( it( was( initially(
developed(to(control(the(motion(and(operation(of(machine(toolsU(
Computer( Numerical( Control( may( be( considered( to( be( a( means( of( operating( a(
machine(through(the(use(of(discrete(numerical(values(fed(into(the(machineM(where(
the(required(,input,(technical(information(is(stored(on(a(kind(of(input(media(such(
as( floppy( diskM( hard( diskM( CD( ROMM( DVDM( USB( flash( driveM( or( RAM( card( etcU( The(
machine( follows( a( predetermined( sequence( of( machining( operations( at( the(
predetermined(speeds(necessary(to(produce(a(workpiece(of(the(right(shape(and(
size(and(thus(according(to(completely(predictable(resultsU(A(different(product(can(
be( produced( through( reprogramming( and( a( lowVquantity( production( run( of(
different(products(is(justifiedU(
CCoommppuutteerr(NNuummeerriiccaall(
CCoonnttrrooll(qqCCNNCC''(
2. Computer Numerical Control (CNC)
Pagef2f
Figk1,1f CNCfMachinefCentreffASPINNERfVC65xw
ThefdefinitionfoffCNCfgivenfbyfElectronicfIndustryfAssociationfAEIAwfisfasffollows:f
A system in which actions are controlled by the direct insertion of numerical
data at some point. The system must automatically interpret at least some
portion of this data.
InfafsimplefwordpfafCNCfsystemfreceivesfnumericalfdatapfinterpretfthefdatafandf
thenfcontrolfthefactionfaccordinglykf
Chapter 1. Computer Numerical Control Fundamentals
Objectives:
TofunderstandfthefworkingfprinciplefoffCNCfmachineskf
Tofunderstandfthefcharacteristicsfoffthefdrivingfsystemskf
Tofunderstandfthefcharacteristicsfofftheffeedbackfdeviceskf
TofunderstandfthefapplicationsfoffCNCfmachineskf
1.1 Control Systems
1.1.1 Open Loop Systems
Openfloopfsystemsfhavefnofaccessftofthefrealftimefdatafaboutfthefperformancefoff
thefsystemfandfthereforefnofimmediatefcorrectivefactionfcanfbeftakenfinfcasefoff
systemf disturbancekf Thisf systemf isf normallyf appliedf onlyf tof thef casef wheref thef
outputf isf almostf constantf andf predictablekf Thereforepf anf openf loopf systemf isf
unlikelyftofbefusedftofcontrolfmachineftoolsfsincefthefcuttingfforcefandfloadingfoff
afmachineftoolfisfneverfafconstantkfThefonlyfexceptionfisfthefwirecutfmachinefforf
whichfsomefmachineftoolfbuildersfstillfpreferftofusefanfopenfloopfsystemfbecausef
therefisfvirtuallyfnofcuttingfforcefinfwirecutfmachiningkf
3. Computer Numerical Control (CNC)
PageI3I
Fig6UA2TajI BlockIDiagramIofIanIOpenILoopISystemI
1.1.2 Close Loop Systems
InI aI closeI loopI systemCI feedI backI devicesI closelyI monitorI theI outputI andI anyI
disturbanceIwillIbeIcorrectedIinItheIfirstIinstance6IThereforeIhighIsystemIaccuracyI
isIachievable6IThisIsystemIisImoreIpowerfulIthanItheIopenIloopIsystemIandIcanIbeI
appliedItoItheIcaseIwhereItheIoutputIisIsubjectedItoIfrequentIchange6INowadaysCI
almostIallICNCImachinesIuseIthisIcontrolIsystem6I
Fig6UA2TbjI BlockIDiagramIofIaICloseILoopISystemI
1.2 Elements of a CNC System
AICNCIsystemIconsistsIofItheIfollowingI6ImajorIelements:I
a6I InputIDeviceI
b6I MachineIControlIUnitI
c6I MachineIToolI
d6I DrivingISystemI
e6I FeedbackIDevicesI
f6I DisplayIUnitI
4. Computer Numerical Control (CNC)
Paget4t
FigS1U3t WorkingtPrinciplestoftCNCtMachinest
1.2.1 Input Devices
aStFloppytDisktDrivet
FloppytdisktistatsmalltmagnetictstoragetdevicetfortCNCtdatatinputStItthastbeentthet
mostt commont storaget mediat upt tot thet 197Asxt int termst oft datat transfert speedxt
reliabilityxt storaget sizext datat handlingt andt thet abilityt tot readt andt writeSt
Furthermorextthetdatatwithintatfloppytcouldtbeteasilyteditedtattanytpointtastlongt
astyouthavetthetpropertprogramttotreadtitStHoweverxtthistmethodthastproventtotbet
quitet problematict int thet longt runt ast floppiest havet at tendencyt tot degradet
alarminglytfasttandtaretsensitivettotlargetmagnetictfieldstandtastwelltastthetdustt
andtscratchestthattusuallytexistedtontthetshoptfloorSt
FigS1U4t FloppytDisktDrivetontatCNCtmachinet
bStUSBtFlashtDrivet
AtUSBtflashtdrivetistatremovabletandtrewritabletportablethardtdrivetwithtcompactt
sizetandtbiggertstoragetsizetthantatfloppytdiskStDatatstoredtinsidetthetflashtdrivet
5. Computer Numerical Control (CNC)
PageC)C
areCimperviousCtoCdustCandCscratchesCthatCenableCflashCdrivesCtoCtransferCdataCfromC
placeCtoCplace6CInCrecentCyears3CallCcomputersCsupportCUSBCflashCdrivesCtoCreadCandC
writeCdataCthatCmakeCitCbecomeCmoreCandCmoreCpopularCinCCNCCmachineCcontrolC
unit6C
Fig68M)C USBCFlashCDriveConCaCCNCCmachineC
c6CSerialCcommunicationC
TheC dataC transferC betweenC aC computerC andC aC CNCC machineC toolC isC oftenC
accomplishedC throughC aC serialC communicationC port6C InternationalC standardsC forC
serialCcommunicationsCareCestablishedCsoCthatCinformationCcanCbeCexchangedCinCanC
orderlyCway6CTheCmostCcommonCinterfaceCbetweenCcomputersCandCCNCCmachineC
toolsCisCreferredCtoCtheCEIACStandardCRSM0:06C MostCofCtheCpersonalCcomputersCandC
CNCCmachineCtoolsChaveCbuiltCinCRS0:0CportCandCaCstandardCRSM0:0CcableCisCusedC
toC connectC aC CNCC machineC toC aC computerC whichC enablesC theC dataC transferC inC
reliableCway6C PartCprogramsCcanCbeCdownloadedCintoCtheCmemoryCofCaCmachineC
toolC orC uploadedC toC theC computerC forC temporaryC storageC byC runningC aC
communicationCprogramConCtheCcomputerCandCsettingCupCtheCmachineCcontrolCtoC
interactCwithCtheCcommunicationCsoftware6C
Fig68M6C SerialCcommunicationCportConCaCCNCCmachineC
DirectCNumericalCControlCisCreferredCtoCaCsystemCconnectingCaCsetCofCnumericallyC
controlledCmachinesCtoCaCcommonCmemoryCforCpartCprogramCorCmachineCprogramC
storageCwithCprovisionCforConMdemandCdistributionCofCdataCtoCtheCmachines6CEISOC
08O6:898OACTheCNCCpartCprogramCisCdownloadedCaCblockCorCaCsectionCatCaCtimeCintoC
6. Computer Numerical Control (CNC)
PageD6D
theD controller-D OnceD theD downloadedD sectionD isD executedkD theD sectionD willD beD
discardedD toD leaveD roomD forD otherD sections-D ThisD methodD isD commonlyD usedD forD
machineDtoolsDthatDdoDnotDhaveDenoughDmemoryDorDstorageDbufferDforDlargeDNCD
partDprograms-D
DistributedD NumericalD ControlD isD aD hierarchicalD systemD forD distributingD dataD
betweenDaDproductionDmanagementDcomputerDandDNCDsystems-D1ISODM876:E99A9D
TheD hostD computerD isD linkedD withD aD numberD ofD CNCD machinesD orD computersD
connectingD toD theD CNCD machinesD forD downloadingD partD programs-D TheD
communicationDprogramDinDtheDhostDcomputerDcanDutilizeDtwozwayDdataDtransferD
featuresDforDproductionDdataDcommunicationDincluding:DproductionDschedulekDpartsD
producedDandDmachineDutilizationDetc-D
Fig-Ez7D SerialDcommunicationDinDaDDistributedDNumericalDControlDsystemD
d-DEthernetDcommunicationD
DueDtoDtheDadvancementDofDtheDcomputerDtechnologyDandDtheDdrasticDreductionDofD
theDcostDofDtheDcomputerkDitDisDbecomingDmoreDpracticalDandDeconomicDtoDtransferD
partD programmesD betweenD computersD andD CNCD machinesD viaD anD EthernetD
communicationDcable-DThisDmediaDprovidesDaDmoreDefficientDandDreliableDmeansDinD
partDprogrammeDtransmissionDandDstorage-DMostDcompaniesDnowDbuiltDaDLocalDAreaD
NetworkD1LAN9DasDtheirDinfrastructure-DMoreDandDmoreDCNCDmachineDtoolsDprovideD
anDoptionDofDtheDEthernetDCardDforDdirectDcommunicationDwithinDtheDLAN-D
7. Computer Numerical Control (CNC)
Pagel7l
Fig.1-8l EthernetlportlonlalCNClmachinel
Fig.1-9l EthernetlnetworklinlalDistributedlNumericallControllsysteml
e.lConversationallProgrammingl
Partl programmesl canl bel inputl tol thel controllerl vial thel keyboard.l Built-inl
intelligentlsoftwarelinsidelthelcontrollerlenablesltheloperatorltolenterlthelrequiredl
datal stepl byl step.l Thisl isl al veryl efficientl wayl forl preparingl programmesl forl
relativelylsimplelworkpieceslinvolvinglupltol2½laxislmachining.l
Fig.1-10l ConversationallProgramminglinlalCNClcontrollerl
8. Computer Numerical Control (CNC)
Paged8d
1.2.2 Machine Control Unit (MCU)
ThedmachinedcontroldunitdisdthedheartdofdthedCNCdsystem1dTheredaredtwodsub;unitsd
indthedmachinedcontroldunit:dthedDatadProcessingdUnitd/DPUFdanddthedControldLoopd
Unitd/CLUF1d
a1dDatadProcessingdUnitd
OndreceivingdadpartdprogrammeEdthedDPUdfirstlydinterpretsdanddencodesdthedpartd
programmed intod internald machined codes1d Thed interpolatord ofd thed DPUd thend
calculatedthedintermediatedpositionsdofdthedmotiondindtermsdofdBLUd/basicdlengthd
unitFdwhichdisdthedsmallestdunitdlengthdthatdcandbedhandleddbydthedcontroller1dThed
calculatedddatadaredpasseddtodCLUdfordfurtherdaction1d
b1dControldLoopdUnitd
TheddatadfromdthedDPUdaredconverteddintodelectricaldsignalsdindthedCLUdtodcontrold
thed drivingd systemd tod performd thed requiredd motions1d Otherd functionsd suchd asd
machinedspindledONSOFFEdcoolantdONSOFFEdtooldclampdONSOFFdaredalsodcontrolledd
bydthisdunitdaccordingdtodthedinternaldmachinedcodes1d
1.2.3 Machine Tool
Thisd cand bed anyd typed ofd machined toold ord equipment1d Ind orderd tod obtaind highd
accuracyd andd repeatabilityEd thed designd andd maked ofd thed machined slided andd thed
drivingdleadscrewdofdadCNCdmachinedisdofdvitaldimportance1dThedslidesdaredusuallyd
machineddtodhighdaccuracydanddcoateddwithdanti;frictiondmaterialdsuchdasdPTFEdandd
Turcited ind orderd tod reduced thed stickd andd slipd phenomenon1d Larged diameterd
recirculatingdballdscrewsdaredemployeddtodeliminatedthedbacklashdanddlostdmotion1d
Otherddesigndfeaturesdsuchdasdrigiddanddheavydmachinedstructure;dshortdmachined
tabled overhangEd quickd changed toolingd systemEd etcd alsod contributed tod thed highd
accuracydanddhighdrepeatabilitydofdCNCdmachines1d
Fig11;11/aFd BalldScrewdindadCNCdmachined Fig11;11/bFd Balldscrewdstructured
9. Computer Numerical Control (CNC)
PageS9S
1.2.4 Driving System
TheSdrivingSsystemSisSanSimportantScomponentSofSaSCNCSmachineSasStheSaccuracyS
andSrepeatabilitySdependSverySmuchSonStheScharacteristicsSandSperformanceSofStheS
drivingS system.S TheS requirementS isS thatS theS drivingS systemS hasS toS responseS
accuratelyS accordingS toS theS programmedS instructions.S ThisS systemS usuallyS usesS
electricSmotorsSalthoughShydraulicSmotorsSareSsometimesSusedSforSlargeSmachineS
tools.STheSmotorSisScoupledSeitherSdirectlySorSthroughSaSgearSboxStoStheSmachineS
leadscrewS toS movesS theS machineS slideS orS theS spindle.S ThreeS typesS ofS electricalS
motorsSareScommonlySused.S
a.SDCSServoSMotorS
ThisSisStheSmostScommonStypeSofSfeedSmotorsSusedSinSCNCSmachines.STheSprincipleS
ofS operationS isS basedSonS theS rotationS ofS anS armatureS windingS inS aS permanentlyS
energisedS magneticS field.S TheS armatureS windingS isS connectedS toS aS commutator)S
whichSisSaScylinderSofSinsulatedScopperSsegmentsSmountedSonStheSshaft.SDCScurrentS
isSpassedStoStheScommutatorSthroughScarbonSbrushes)SwhichSareSconnectedStoStheS
machineS terminals.S TheS changeS ofS theS motorS speedS isS byS varyingS theS armatureS
voltageS andS theS controlS ofS motorS torqueS isS achievedS byS controllingS theS motor1sS
armatureS current.S InS orderS toS achieveS theS necessaryS dynamicS behaviourS itS isS
operatedSinSaSclosedSloopSsystemSequippedSwithSsensorsStoSobtainStheSvelocitySandS
positionSfeedbackSsignals.S
Fig.1312S DCSServoSMotorS-CourtesySofSFlexibleSAutomation2S
b.SACSServoSMotorS
InS anS ACS servomotor)S theS rotorS isS aS permanentS magnetS whileS theS statorS isS
equippedSwithS33phaseSwindings.STheSspeedSofStheSrotorSisSequalStoStheSrotationalS
frequencySofStheSmagneticSfieldSofStheSstator)SwhichSisSregulatedSbyStheSfrequencyS
converter.S
ACSmotorsSareSgraduallySreplacingSDCSservomotors.STheSmainSreasonSisSthatSthereS
isSnoScommutatorSorSbrushesSinSACSservomotorSsoSthatSmaintenanceSisSvirtuallySnotS
required.SFurthermore)SACSservosShaveSaSsmallerSpower3to3weightSratioSandSfasterS
response.S
10. Computer Numerical Control (CNC)
PagecWDc
FigXWEWRc ACcServocMotorcHCourtesycofcFlexiblecAutomationwc
cXcSteppingcMotorc
Ac steppingc motorc isc ac devicec thatc convertsc thec electricalc pulsesc intoc discretec
mechanicalcrotationalcmotionscofcthecmotorcshaftXcThisciscthecsimplestcdevicecthatc
canc bec appliedc toc CNCc machinesc sincec itc canc convertc digitalc datac intoc actualc
mechanicalc displacementXc Itc isc notc necessaryc toc havec anyc analogEtoEdigitalc
convertercnorcfeedbackcdevicecforctheccontrolcsystemXcTheycarecideallycsuitedctoc
opencloopcsystemsXc
Howeverqcsteppingcmotorscarecnotccommonlycusedcincmachinectoolscduectocthec
followingc drawbacks:c slowc speedqc lowc torqueqc lowc resolutionc andc easyc toc slipc inc
casecofcoverloadXcExamplescofcsteppingcmotorcapplicationcarecthecmagneticcheadc
ofcfloppyEdisccdrivecandchardcdisccdrivecofccomputerqcdaisyEwheelctypecprinterqcXEYc
tapeccontrolqcandcCNCcEDMcWireEcutcmachineXc
FigXWEWLc SteppingcMotorcHCourtesycRealETimecMicrocomputerwc
dXcLinearcMotorc
AclinearcelectriccmotorciscancACcrotarycmotorclaidcoutcflatXc Thecsamecprinciplecusedc
toc producec torquec inc rotaryc motorsc isc usedc toc producec forcec inc linearc motorsXc
Throughc thec electromagneticc interactionc betweenc ac coilc assemblyc andc ac
permanentc magnetc assemblyqc thec electricalc energyc isc convertedc toc linearc
mechanicalcenergyctocgeneratecaclinearcmotionXc Ascthecmotioncofcthecmotorc isc
linearcinsteadcofcrotationalqcthereforecitcisccalledclinearcmotorXcLinearcmotorschavec
thecadvantagescofchighcspeedsqchighcprecisioncandcfastcresponseXc IncthecW98Dsqc
11. Computer Numerical Control (CNC)
PageR11R
machineR toolR buildersR startedR usingR linearR motorsR withR theR commonR motionR
controlRservoRdrivesRinRtheRmachineRtoolRdesign.R
Fig.1E15R LinearRMotorR3CourtesyRofRRenishawHR
AmongR differentR designsR ofR linearR motors6R permanentR magnetR brushlessR motorsR
demonstrateRaRhighRforceRdensity6RhighRmaximumRspeed6RandRstableRforceRconstant.R
TheR lackR ofR aR brushedR commutatorR assemblyR hasR theR advantagesR ofR fewerR
maintenance6RhigherRreliabilityRandRbetterRsmoothness.
AnRironRcoreRbrushlessRlinearRmotorRisRsimilarRtoRaRconventionalRbrushlessRrotaryR
motorRslitRaxiallyRandRthenRrolledRoutRflat.RTheRunrolledRrotorRisRaRstationaryRplateR
consistingR ofR magnetsR tiledR onR anR ironR backR plateR andR theR unrolledR statorR isR aR
movingRcoilRassemblyRconsistingRofRcoilsRwoundRaroundRaRlaminatedRsteelRcore.RCoilR
windingsR areR typicallyR connectedR inR conventionalR 3R phaseR arrangementR andR
commutationRisRoftenRperformedRbyRHallEeffectRsensorsRorRsinusoidal.R ItRhasRhighR
efficiencyRandRgoodRforRcontinuousRforce.R
AnR ironlessR linearR motorR consistsR ofR aR stationaryR UR shapedR channelR filledR withR
permanentR magnetsR tiledR alongR bothR interiorR walls.R AR movingR coilR assemblyR
traversesR betweenR twoR opposingR rowsR ofR magnets.R CommutationR isR doneR
electronicallyReitherRbyRHallEeffectRsensorsRorRsinusoidal.R TheRironlessRlinearRmotorR
hasR theR advantagesR ofR lowerR coreR mass6R lowerR inductanceR andR noR coggingR forR
smoothR motionR asR theR ironlessR motorsR haveR noR attractiveR forceR betweenR theR
framelessRcomponents.R
Fig.1E16R IroncoreRandRIronlessRLinearRMotorR3CourtesyRofRETELHR
12. Computer Numerical Control (CNC)
Pagew12w
1.2.5 Feedback Device
InworderwtowhavewawCNCwmachinewoperatingwaccuratelyHwthewpositionalwvalueswandw
speedwofwthewaxeswneedwtowbewconstantlywupdatedRw Twowtypeswofwfeedwbackwdevicesw
arewnormallywusedHwpositionalwfeedwbackwdevicewandwvelocitywfeedwbackwdeviceRw
aRwPositionalwFeedwBackwDevicesw
Therewarewtwowtypeswofwpositionalwfeedwbackwdevices:wlinearwtransducerwforwdirectw
positionalw measurementw andw rotaryw encoderw forw angularw orw indirectw linearw
measurementRw
Linearw Transducersw )w Aw linearw transducerw isw aw devicew mountedw onw thew
machinewtablewtowmeasurewthewactualwdisplacementwofwthewslidewinwsuchwaw
waywthatwbacklashwofwscrews;wmotorsHwetcwwouldwnotwcausewanywerrorwinwthew
feedwbackwdataRwThiswdevicewiswconsideredwtowbewofwthewhighestwaccuracywandw
alsowmorewexpensivewinwcomparisonwwithwotherwmeasuringwdeviceswmountedw
onwscrewsworwmotorsRw
FigR1)17w LinearwTransducerwACourtesywofwHeidenhain;
RotarywEncodersw)wAwrotarywencoderwiswawdevicewmountedwatwthewendwofwthew
motorw shaftw orw screww tow measurew thew angularw displacementRw Thisw devicew
cannotwmeasurewlinearwdisplacementwdirectlywsowthatwerrorwmaywoccurwduewtow
thew backlashw ofw screww andw motorw etcRw GenerallyHw thisw errorw canw bew
compensatedw forw byw thew machinew builderw inw thew machinew calibrationw
processRw
13. Computer Numerical Control (CNC)
Pagev13v
Fig.1-18v IncrementalvandvAbsolutevRotaryvEncoderv
b.vVelocityvFeedbackvDevicev
Thev actualv speedv ofv thev motorv canv bev measuredv inv termsv ofv voltagev generatedv
fromv av tachometerv mountedv atv thev endv ofv thev motorv shaft.v DCv tachometerv isv
essentiallyvavsmallvgeneratorvthatvproducesvanvoutputvvoltagevproportionalvtovthev
speed.v Thev voltagev generatedv isv comparedv withv thev commandv voltagev
correspondingv tov thev desiredv speed.v Thev differencev ofv thev voltagesv canv isv thenv
usedvtovactuatevthevmotorvtoveliminatevtheverror.v
Fig.1-19v Tachogeneratorv(CourtesyvofvCallan)v
1.2.6 Display Unit
Thev Displayv Unitv servesv asv anv interactivev devicev betweenv thev machinev andv thev
operator.v Whenv thev machinev isv running,v thev Displayv Unitv displaysv thev presentv
14. Computer Numerical Control (CNC)
Pagev13v
Fig.1-18v IncrementalvandvAbsolutevRotaryvEncoderv
b.vVelocityvFeedbackvDevicev
Thev actualv speedv ofv thev motorv canv bev measuredv inv termsv ofv voltagev generatedv
fromv av tachometerv mountedv atv thev endv ofv thev motorv shaft.v DCv tachometerv isv
essentiallyvavsmallvgeneratorvthatvproducesvanvoutputvvoltagevproportionalvtovthev
speed.v Thev voltagev generatedv isv comparedv withv thev commandv voltagev
correspondingv tov thev desiredv speed.v Thev differencev ofv thev voltagesv canv isv thenv
usedvtovactuatevthevmotorvtoveliminatevtheverror.v
Fig.1-19v Tachogeneratorv(CourtesyvofvCallan)v
1.2.6 Display Unit
Thev Displayv Unitv servesv asv anv interactivev devicev betweenv thev machinev andv thev
operator.v Whenv thev machinev isv running,v thev Displayv Unitv displaysv thev presentv
16. Computer Numerical Control (CNC)
PageC16C
Fig.2-2C IncrementalCSystem
2.2.2 Absolute System
InCanCabsoluteCsystemCallCreferencesCareCmadeCtoCtheCoriginCofCtheCcoCordinateC
system.C AllC commandsC ofC motionC areC definedC byC theC absoluteC coordinateC
referredCtoCtheCorigin.C
Fig.2-3C AbsoluteCSystem
2.3 Definition of Programming
NCCprogrammingCisCwhereCallCtheCmachiningCdataCareCcompiledCandCwhereCtheC
dataC areC translatedC intoC aC languageC whichC canC beC understoodC byC theC controlC
systemCofCtheCmachineCtool.C TheCmachiningCdataCisCasCfollows:C
a.C MachiningCsequenceC classificationCofCprocess,CtoolCstartCupCpoint,CcuttingC
depth,CtoolCpathCetc.C
b.C CuttingCconditionsC spindleCspeed,CfeedCrate,Ccoolant,Cetc.C
c.C SelectionCofCcuttingCtools.C
17. Computer Numerical Control (CNC)
PagewqJw
2.4 Programme Structure
Program
start
Block
#1
Block
#2
Block
#30
Block
#31
End.of
Programme
Sequence
Number
Word.
#1
Word
#2
N002 G01 X12.0
Address Value
G. 01
X. 12.0
FigDyRXw StructurewofwCNCwPartwProgrammew
AwCNCwprogrammewconsistswofwblocks)wwordswandwaddressesDw
aDw Blockw
AwcommandwgivenwtowthewcontrolwunitwiswcalledwawblockDw
bDw Wordw
AwblockwiswcomposedwofwoneworwmorewwordsDw Awwordwiswcomposedwofwanw
identificationwletterwandwawserieswofwnumerals)weDgDwthewcommandwforwawfeedw
ratewofwy::mm'minwiswFy::Dw
cDw Addressw
ThewidentificationwletterwatwthewbeginningwofweachwwordwiswcalledwaddressDw
Thew meaningw ofw thew addressw isw inw accordancew withw EIAw TElectronicw
IndustrieswAssociationEwstandardwRSRyJXRDDwThewmostwcommonw/addresses/w
arewlistedwbelowxw
Function Address
Sequencewnumberw Nw
Preparatorywfunctionw Gw
Cowordinatewwordw X)wY)wZw
ParameterswforwCircularwInterpolationw I)wJ)wKw
Feedwfunctionw Fw
Spindlewfunctionw Sw
Toolwfunctionw Tw
Miscellaneouswfunctionw Mw
Anwexamplewofwawprogrammewiswaswfollowsxw
Ny:w G:qw Xy:DYw Fy::w Sq:::w M:Gw
Nyqw G:yw XG:D:w YX:D:w Iy:DYw JGyD:w
18. ComputerPNumericalPControlPYCNCZP
Pagex9Jx
2.5P ExplanationPofPWordsP
2.5.1P SequencePNumberPYNPAddressZP
Ax sequencex numberx isx usedx tox identifyx thex block-x Itx isx alwaysx placedx atx thex
beginningx ofx thex blockx andx canx bex regardedx asx thex namex ofx thex block-x Thex
sequencex numbersx needx notx bex consecutive-x Thex executionx sequencex ofx thex
programmex isx accordingx tox thex actualx sequencex ofx thex blockx andx notx thex
sequencex ofx thex number-x Inx factx somex CNCx systemsx dox notx requirex sequencex
numbers-x
2.5.2P PreparatoryPFunctionPYGPAddressZP
Axpreparatoryxfunctionxdeterminesxhowxthextoolxisxtoxmovextoxthexprogrammedx
target-x ThexmostxcommonxGxaddressesxarexlistedxbelowXx
Code Function
G77x Pointxtoxpointxpositionxatxrapidxfeedx
G79x Linearxinterpolationx
G7Mx CircularxinterpolationRxclockwisex
G7Dx CircularxinterpolationRxantixclockwisex
G(7x Cutterxcompensationxcancelx
G(9x CutterxcompensationRxLeftx
G(Mx CutterxcompensationRxRightx
G()x5xG(Jx OtherxcutterxcompensationRxifxusedx
GW7x5xGWKx Millingxandxturningxcyclex
GJ7x5xGJKx Drillingxandxtappingxcyclex
GK7x Absolutexdimensioningx
GK9x Incrementalxdimensioningx
2.5.3P CoKordinatePWordPYX/Y/ZPAddressZP
Ax co5ordinatex wordx specifiesx thex targetx pointx ofx thex toolx movementx 2absolutex
dimensionx system,x orx thex distancex tox bex movedx 2incrementalx dimension,-x Thex
wordx isx composedx ofx thex addressx ofx thex axisx tox bex movedx andx thex valuex andx
directionxofxthexmovement-x
ExampleXx X100 Y-200
representsxthexmovementxtox2977RxM77,-xWhetherxthexdimensionsx
arex absolutex orx incrementalx willx havex tox bex definedx previouslyx
2usingxGK7xorxGK9,-x
2.5.4P ParameterPforPCircularPInterpolationPYI/J/KPAddressZP
Thesexparametersxspecifyxthexdistancexmeasuredxfromxthexstartxpointxofxthexarcx
toxthexcentre-xNumeralsxfollowingxIRxJxandxKxarexthexXRxYxandxZxcomponentsxofxthex
distancexrespectively-x
19. Computer Numerical Control (CNC)
Pagex79x
2.5.5 Spindle Function (S Address)
ThexspindlexspeedxisxcommandedxunderxanxSxaddressxandxisxalwaysxinxrevolutionx
perxminute5x Itxcanxbexcalculatedxbyxthexfollowingxformula:x
(mm)meterCutter Dia
1000(m/min)SpeedCuttingSurface
=SpeedSpindle
×
×
π
Thexfollowingxtablexgivesxthexsurfacexcuttingxspeedsxforxsomexcommonxmaterials:x
Example:x S2000 representsxaxspindlexspeedxofx2kkkrpmx
2.5.6 Feed Function (F Address)
ThexfeedxisxprogrammedxunderxanxFxaddressxexceptxforxrapidxtraverse5xThexunitx
mayx bex inx mmx perx minutex /inx thex casex ofx millingx machineAx orx inx mmx perx
revolutionx/inxthexcasexofxturningxmachineA5xThexunitxofxthexfeedratexhasxtoxbex
definedxatxthexbeginningxofxthexprogramme5xThexfeedxratexcanxbexcalculatedxbyx
thexfollowingxformula:x
Feed Rate = Chip Load / tooth No of Tooth Spindle Speed× ×
Thexfollowingxtablexgivesxthexchipxloadxperxtoothxofxmillingxcuttersxcuttingxsomex
commonxmaterials:x
MillingxCutterx Chipxloadxperxtoothx /mmWrevAx
Materialx Alxalloy Brass CastxIron MildxSteelx
HSSx k528x k578x k52kx k573x
SinteredxCarbide k525x k575x k525x k525x
Example:x F200 representsxaxfeedxratexofx2kkmmWminx
2.5.7 Tool Function (T Address)
ThexselectionxofxtoolxisxcommandedxunderxaxTxaddress5x
Example:x T02 representsxtoolxnumberx2x
Cuttingxtool Workpiecexmaterialx
Materialx Alxalloy Brass CastxIron MildxSteelx
HSSx 72kx 75x 78x 3kx
Carbidex 5kkx 78kx 72kx 2kkx
20. ComputerhNumericalhControlh(CNC)h
Pagekxqk
2.5.8h MiscellaneoushFunctionh(MhAddress)h
Thek miscellaneousk functionk isk programmedk tok controlk thek machinek operationk
otherk thank fork cok ordinatek movementjk Thek mostk commonk Mk functionsk arek ask
follows:k
Code Function
Mqqk Programmekstopk
Mq)k Spindlekrotationk clockwisek
MqWk Spindlekrotationk counterclockwisek
MqIk SpindlekSTOPk
MqEk ChangekofkToolk
Mq8k CoolantkONk
Mq9k CoolantkOFFk
M(qk Clampk
M((k Unclampk
M)qk Programmekendkandkreadykforkanotherkstartk
2.6h StepshforhCNChProgramminghandhMachiningh
Thek followingk isk thek proceduresk tok bek followedk ink CNCk programmingk andk
machiningjkThekmostkimportantkpointkisktokverifykthekprogrammekbyktestkrunkitkonk
thekmachinekbeforekthekactualkmachiningkinkorderktokensurekthatkthekprogrammek
iskfreekofkmistakesjk
ajk Studykthekpartkdrawingkcarefullyjk
bjk UnlesskthekdrawingkdimensionskarekCNCkadapted,kselectkaksuitablek
programmek zerok pointk onk thek workk piecejk Thek toolk willk bek
adjustedktokthiskzerokpointkduringkthekmachineksetkupjk
cjk Determinekthekmachiningkoperationskandktheirksequencejk
djk Determinek thek methodk ofk workk clampingk 1vice,k rotaryk table,k
fixturesketcUjk
ejk Selectkcuttingktoolskandkdeterminekspindlekspeedskandkfeedsjk
fjk Writek programmek 1translatek machiningk stepsk intok programmek
blocksUjk Ifkmanyksolutionskarekpossible,ktryktheksimplestksolutionk
firstjkItkiskusuallyklonger,kbutkbetterktokproceedkinkthiskwayjk
gjk Preparek toolk chartk ork diagram,k measurek toolk geometryk 1lengths,k
radiiUkandknotejk
hjk Clampkworkkpiecekandksetkupkmachinejk
ijk Enterkcompensationkvaluekifknecessaryjk
jjk Checkkandktestkprogrammejk Itkiskakgoodkpracticektokdrykrunkthek
programmek 1iUk withoutk thek workpiece,k 1iiUk withoutk thek cuttingk
tools,kork1iiiUkbykraisingkthektoolktokaksafekheightjk
Ifknecessary,kcorrectkandkeditkprogrammekandkcheckkagainjk
kjk Startkmachiningjk
22. Computer Numerical Control (CNC)
Page(SS(
FigXSK6( Linear(Interpolation(
2.7.4 Circular Interpolation (G02/G03)
This( is( to( command( the( cutter( to( move( from( the( existing( point( to( the( target(
point( along( a( circular( arc( in( clockwise( direction( MGZSC( or( counterclockwise(
direction(MGZWCX(
In(this(caseJ(beside(the(target(pointJ(the(radius(or(the(centre(of(the(arc(is(also(
requiredX( Most( of( the( CNC( systems( nowadays( still( require( the( data( of( the( arc(
centre(rather(than(the(radiusX(
The(parameters(of(the(centre(of(the(circular(arc(is(designated(by(the(IJ(J(and(K(
addressesX(I(is(the(distance(along(the(X(axisJ(J(along(the(YJ(and(K(along(the(ZX(This(
parameter(is(defined(as(the(vector(Mmagnitude(and(directionC(from(the(starting(
point(to(the(centre(of(the(arcX(
Programme(Format(
MClockwise(DirectionC(
GZS(
X(
Y(
I(MXC(K(XSC(
J(MYC(K(YSC(
Where(
XC(and(YC(is(the(coordinate(of(the(centreJ(and(
XS(and(YS(is(the(coordinate(of(the(start(point(of(the(arcX(
ProgrammingYExample
ofYAbsoluteYDimensioning:
N.85YG9.
N.9.YG..YXh3.YYh3.YZh2
N.95YG.1YZd6
N1..YG.1YXh11.YYh75
ProgrammingYExample
forYIncrementalYDimensioning
N.85YG..YXh3.YYh3.YZh2
N.9.YG91
N.95YG.1YZd8
N1..YG.1YXh8.YYh45
TheY toolY movesY atY theY specifiedY feedrateY fromY its
currentYpositionYcstartingYpoint4YtoYtheYprogrammed
targetYposition(
23. Computer Numerical Control (CNC)
PageX23X
FigW2y7X CircularXInterpolationXyXClockwise
ProgrammeXFormatX
xCounterclockwiseXDirectionvX
GS3X
XX
YX
IX
JX
FigW2y8XCircularXInterpolationXyXCounterclockwiseX
2.7.5 Cutter Compensation (G40/G41/G42)
InXCNCXmachiningMXifXtheXcutterXaxisXisXmovingXalongXtheXprogrammedXpathMXtheX
dimensionXofXtheXworkpieceXobtainedXwillXbeXincorrectXsinceXtheXdiameterXofXtheX
cutterXhasXnotXbeXtakenXintoXaccountWX
ModernX CNCX systemsX areX capableX ofX doingX thisX typeX ofX calculationX whichX isX
knownXasXcutterXcompensationWXWhatXtheXsystemXrequiresXareXtheXprogrammedX
pathMX theX cutterX diameterX andX theX positionX ofX theX cutterX withX referenceX toX theX
contourWXNormallyMXtheXcutterXdiameterXisXnotXincludedXinXtheXprogrammeWXItXhasX
toXbeXinputXtoXtheXCNCXsystemXinXtheXtoolXsettingXprocessWX
xXcMXYcv
StartXpoint
xXsM Ysv
EndX
X
Y IX
JX
xXcMXYcv
StartXpoint
xXsM Ysv
EndX
pointX
X
Y I
JX
Programming3Example
for3Absolute3Dimensioning:
N0853G90
N0903G003X+553Y+353Z+2
N0953G013Z-5
N1003G023X+953Y+753I+303J+10
24. Computer Numerical Control (CNC)
Page1241
Fig.2-91 Comparison1of1Tool1Path1with1and1without1Cutter1Compensation1
If1the1cutter1is1on1the1left1of1the1contour,1G411is1used.1If1the1cutter1is1on1the1right1
of1the1contour,1G421will1be1used.1G401is1to1cancel1the1compensation1calculation.1
Cutter on the Right of the contour, use G42
Fig.2-101 Direction1of1Cutter1Compensation1
Final1contour1does1not1
Match1with1programme1path
Final1contour1matches
with1programme1path1
Cutter1path1offset1from
the1programme1path1
Programme1
Cutter on the Left of the contour, use G41
25. Computer Numerical Control (CNC)
PageZ6fZ
ProgrammeZExampleZ/Z
Explanation
NF/Z GIFZ AbsoluteZDimensioningZ
NF6Z GFFZ XcCFZYcCFZZ/FFZ RapidZmoveZtoZUXcCF;ZYcCF;ZZ/FF4Z
NFCZ TF/Z UsingZToolZNumberZ/Z
NFhZ GFFZ ZfZS/FFFZMFCZRapidZmoveZtoZZf;Z
startZspindleZclockwiseZatZ/FFFrpmZ
NFfZ GF/Z Zc/FZF/FFZ FeedZtoZZc/FZatZ/FFmmwminZ
NF7Z Gh/ZGF/ZXFZY/fZF6FFZCallZupZcompensation;Z
cutterZonZtheZleftZfeedZtoZ
UXF;ZY/f4ZatZ6FFmmwminZ
NF.Z GF/Z Y77kf7hZ FromZNF.ZtoZN/fZisZtheZcontourZcuttingZ
NF8Z GF6Z X/7k///ZY87k/8CZ
I6FZJFZ
NFIZ GF6Z XICk88IZY87k/8CZ
IC8k88IZJc/I7k/8CZ
N/FZ GF6Z X//FZY77kf7hZ
IcCk88IZJc/Ik7/IZ
N//Z GF/Z Y67k6h.Z
N/6Z GF6Z XI8k886ZY//k.f8Z
Ic/fZJFZ
N/CZ GF/Z XffZYFZ
N/hZ GF/Z X/fZ
N/fZ GF6Z XFZY/fZ
IFZJ/f
N/7ZZZZZGhFZZZZZZXcCFZYcCFZCancelZofZcompensation;Z
ZZZZZZZZZZfeedZtoZUXcCF;ZYcCF4Z
N/.ZZZZZGFFZZ/FFZMCFZRapidZmoveZtoZZ/FF;ZprogrammeZendZ
Programme