You are on page 1of 2

G40,G41,andG42andFunction56

Introduction
ThissetofGcodesallowsforactivetoolcompensationortoolwearcompensation.GenerallytheCAD
orCAMsoftwareusedtogenerateatoolpathalsogeneratesthetooloffsettoaccountforthediameter
ofthetooling.However,insomeapplicationsthetoolwearsandthediametergetssmaller.Itsvery
inconvenienttohavetoregeneratethetoolpathseverytimethedimensionsgooutofspeccausedby
toolwear.G40,G41,andG42aredesignedtoenabletheoperatortoadjustfortoolwearrightdownon
themachine.
Definitions
G41compensatetotheleftofthecontour.
G42compensatetotherightofthecontour.
G40cancelcompensation.
G41andG42onlycompensateintheXYplanesoG17needstobethedefaultcuttingplane.TheseG
codesdonotworkinG18orG19planesandcompensationisautomaticallycancelled.

G41

G41

G42

G42

Notethatoutsidecornerswillbefilleted,whereasinsidecornersremainsquare.
G0X10Y10
G41
G1Z1
X20
Y20
X10
Y10
G40

Gotostartpoint
Setcompensationleft
GodowntoZ=1

Makeasquarecompensatedleft
Cancelcompensation

OnlyG1,G2,andG3interpolationpathsarecompensated.G0movesarenotcompensated.
G1vertical(Z)movesarecompensatedbythenextGXYmove.ThismeanstheG0movewillmoveto
thestartoftheboxintheexampleabove,thentheXYmoveswillallbecompensatedandpriorto

actuallyexecutingtheZmovedownwardsanextraG0moveisinsertedsotheG1Zmovewillgostraight
downratherthanatanangle.
Function56
Theoperatoradjuststhecompensationforparticulartoolsbyusingfunction56.Theactualtoolnumber
tobecompensatedforisselectedbyadecimalpointinthefunction.Forexample,function56.1sets
tool1compensation,56.2settool2,andsoon.
Positiveornegativecompensationscanbeentered.Anegativecompensationvaluehastheeffectof
switchingsidesofthecompensation.AG41leftcompensationbecomesarightcompensationif
negativecompensationvaluesareused.
SetupGUI
Insteadofusingfunction56thetooltabinthesetupGUIcanalsobeused.Thereisacompensation
entryfieldforeachtoolinthattab.Normallythisisnotparticularlyconvenientfortheoperatorso
function56isusedinstead.
UseasToolCompensation
ThesefeaturescanbeusediftheGcodefilehasnotcompensatedforthediameterofthetool.This
usageisrareasmostCAMprogramsdoaverygoodjobofcompensatingfortooldiametersevenforthe
mostcomplexcontours.However,G41andG42areeffectivetoolstocompensateformostjobswith
therestrictionbeingthatlargecompensationsforverycomplexcontoursarenotrecommendedasthe
A2MCrunsinrealtimeandcannotprocessthecompensationalgorithmsinmultiplepasseslikeaCAM
programcan.
BottomlineisdontuseG41andG42forfullcompensationofverycomplexshapesandcontours.
UseasToolWearCompensation
ThisisthemuchmorecommonuseofG41andG42.Thenominaltooldiameterisprogrammedintothe
NCtoolpathusingtheCAMprogramasitnormallywould.
Withanewtoolthatisatthecorrectnominaldiameterthetoolcompensationissettozero.
Toolwearisnormallydetectedbytheoperatormeasuringpartsonaregularbasis.Asthetoolwears
thepartsbecomelargerbytwotimesthetoolwear.Theoperatorsimplymeasuresthepartanddivides
thedetectederrorbytwo.Heentersthisvalueintofunction56asanegativevalue.Thiswillcausethe
nominalcompensationtodecreasebythewearmeasuredintheparts.
Thepartswillreturnbacktothespecifiedtolerances.

You might also like