NCBy Kezuriba Editorial Team

Setting Work Zero and Tool Length on a Machining Center: Edge Finders, Touch Probes, Tool Setters, G54 and G43

Once the G54 + H addition clicks, you can see what causes a crash. Try making mistakes on purpose in the interactive diagram!

Chips, the Kezuriba mascot
Setting Work Zero and Tool Length on a Machining Center: Edge Finders, Touch Probes, Tool Setters, G54 and G43

A commonly cited reason for a machining center tool plunging into the workpiece is a wrong number entered during setup. For example, if you touch the tool off on a 50 mm tool setter and enter the reading as is, the tool goes to a spot 50 mm off. This article walks you step by step through everything from tramming the vise, through measuring with an edge finder, touch probe and tool setter and entering the values in G54 and H, to checking without cutting. It includes a calculator that gets the G54 value from a reading, and an interactive diagram that shows where the tool goes when you make a mistake on purpose. For how to write the program, see Machining Center Programming for Beginners; for centering on bores and bosses, see dial indicator centering.

Start with the addition: program Z + G54 Z + H

Machine Z 0Minus going downGauge lineThis is what movesTop faceProgram Z0True tool lengthGauge line to tipProgram Z
Illustration of a vertical machining center seen from the front. What the machine moves is the gauge line; the tool tip sits below it by the true tool length.

The CNC control works mainly with 3 numbers when it moves the tool. Machine coordinates are fixed to the machine and do not change wherever you put the workpiece. Work coordinates (G54) hold the machine-coordinate position of the work zero. Tool length compensation (G43 H) holds the length information for each tool. In FANUC-style programming, the Z destination comes from this addition[2][5].

Gauge line target (machine Z) = program Z + G54 Z + H (with G43)

G43 adds the offset and G44 subtracts it. If the offset is negative, G43 shifts in the minus direction[2][9]. On a machine whose Z home is at the top of its travel, machine Z goes more negative as the spindle comes down (e.g., Haas)[7]. Once this addition is in your head, you can explain in numbers both “does it go in G54 Z or H?” and “why did it crash?”

Programs are written as if the workpiece stands still and the tool moves. That holds on machines where the table moves too; the idea comes from the machine coordinate system rules in ISO 841 (JIS B 6310)[1].

Setup order: tram, clamp, XY, tool length, Z, verify

  1. Tram the viseWipe the table and the underside of the vise, set the vise down, put the indicator on the fixed jaw and sweep along X.
  2. Clamp the workpieceSet it on parallels, bring it lightly against the fixed jaw, and confirm the faces are seated before tightening.
  3. Set the XY zeroPick up faces or bores with an edge finder or probe, and enter the values in G54 X and Y.
  4. Measure tool lengthMeasure every tool you will use against the same reference and enter it in H.
  5. Set the Z zeroEnter the Z reference, such as the top face of the workpiece, in G54 Z or H to suit your method.
  6. Check without cuttingWith Z raised for an air run, then in single block, check the tools one at a time while watching distance to go.

The order matters because if an earlier step falls apart, the values after it are wasted. Tap the vise and you have to pick up the XY zero again; remount a tool and that tool's length has to be measured again. Conversely, when only the workpiece changes, if you keep true tool lengths, you only need to re-enter G54 (a later section explains this difference).

Tram the vise: sweep the fixed jaw along X

0+0.02Feed the table in XFixed jaw (tilt exaggerated)X axis0.02 mm reading difference ÷ travel = jaw tilt. Tap back the end where the reading rises.
Schematic from above. The indicator is fixed on the spindle side; the spindle does not turn and only the table moves.

The milling machine manual from Japan's Ministry of Health, Labour and Welfare (MHLW) gives this procedure. Wipe the jaws and the reference surface, and stone off any high spots from nicks. Mount a dial indicator on the spindle side, set the contact square against the reference surface of the fixed jaw, and zero the needle. Move the table slowly along X and watch the indicator; if it moves too much, tap the vise with a plastic hammer or similar to correct its direction[17]. For how to set a dial test indicator, see the Dial test indicator (lever type) page.

The same manual's guideline is runout within 0.005 mm. For the vertical direction too, put the contact on, move the table in Z, and check that it opens toward the bottom by no more than 0.005 mm[17]. However, this is the value for a Grade 3 national skill test assignment done on a knee-type milling machine, not a set standard for machining centers. We found no vise maker document that gives a tolerance in the form “so much per 100 mm of length.” Decide the value you need from the drawing tolerance.

The effect of tilt is proportional. If the reading changes 0.02 mm over 100 mm of travel, the end of a 150 mm long workpiece is off by 0.03 mm (our calculation). For example, if you cut a long face using this jaw as the reference, the cut face tilts from X by that amount.

Shop rule of thumb (no maker documents back this up) Snug one bolt lightly as the pivot and tap the other end into line. Tighten the bolts a little at a time, alternating. After final tightening, sweep it once more to confirm. We found no maker document giving the bolt tightening order, but checking after tightening is a habit that pays off well for the effort.

Also sweep the top in XShows lifted parallels or tilt
Illustration of the check after clamping the workpiece. The point of the step is the direction of the check; the shape of the parts is not exact.
  • Seating the workpiece: Set it on 2 parallels, bring it lightly against the fixed jaw, clamp loosely, confirm the bottom and the jaw are seated, then tighten[17]
  • Parallel height: Choose a height that puts the bottom of the workpiece at or below the top of the jaws[18]
  • Don't clamp on one side only: Clamping on one side or above the jaws lifts the jaw and hurts accuracy. If you have to clamp off to one side, add a dummy block[18]
  • Direction of cutting force: Set the vise so the cutting force goes toward the fixed jaw[19]

Set the XY zero: edge finders and adding or subtracting the radius

Machine reading = tool centerTip (stops one radius short)RadiusWorkpiece
Illustration of picking up an X face with an edge finder (front view). The reading is the tool center, so the face is one radius beyond it.

A mechanical (offset) edge finder has its tip slightly offset; you spin it and bring it toward the workpiece. Where it touches the face, the wobble disappears, and if you push further it starts to kick off in one direction. According to the BIG DAISHOWA Accu Center instruction manual, run it at 400–600 min⁻¹, and take the reference from where it starts to kick off, allowing for the tip radius (5 mm for φ10, 2 mm for φ4). The manual also says not to run it at 600 min⁻¹ or above, and that it is not suited to horizontal machines. Repeatability is 3 µm on the product page[20][21]. INSIZE's product is also 400–600 rpm, but we could not confirm speeds for other makers, so follow the manual you have[22].

The electrically conductive (LED) type, which lights up on contact, works differently. BIG DAISHOWA's Point Master is brought in with the spindle stopped, using fine feed. The position where it first lights is the reference, one stylus radius (3 mm for φ6) from the center. Repeatability is ±1 µm (2σ). It won't light on a non-conductive workpiece. The manual also says poor conduction can make measuring impossible or cause errors[23]. For plastics and ceramics, there is a separate model that also works on non-conductive materials[24].

If some runout remains in the stylus, the same manual gives a method: turn the spindle 180°, touch twice, and find the workpiece position with (A + B − stylus diameter) ÷ 2[23].

Calculator: G54 X and Y from a reading

Touching from the − side: face = reading + diameter ÷ 2; from the + side: face = reading − diameter ÷ 2. Zero value = face position + distance from face to zero. Center of both sides = (reading 1 + reading 2) ÷ 2

What you enter is not the reading at the tool center but the machine coordinate of the zero itself. A common mistake is the sign of the radius. When the tool is on the − side of the face (left, for X), add it; when it is on the + side (right), subtract it. Get it backward and the zero is off by the diameter (10 mm for φ10). When you make the center of a bore or boss the zero, touch both sides and take the center, and you don't need to think about the radius. If you also want to see how round the bore is, sweeping it with a dial indicator is the better method.

A tool you spin, or one you keep stopped? Mechanical types are spun and conductive types are used stopped. They may sit on the same shelf, but they are handled the opposite way. Before use, check the type and the speed in the manual.

Touch probes: calibration is the foundation of accuracy

Ball touches work: signalSpindle not running4 values set by calibration① Electrical length (incl. travel to trigger)② Physical length (goes to the tool offset)③ Electrical ball radius (not the actual size)④ Ball XY offset from spindle center
Illustration of measuring a workpiece face with a touch probe (front view). The values set by calibration are from Renishaw's document[27].

A touch probe is a measuring device that goes into the spindle at a tool change and is brought to the workpiece automatically by a CNC cycle. Renishaw's OMP40-2 has a repeatability of 1.00 µm (2σ, at 480 mm/min with a 50 mm stylus), and the radio-type RMP60 has the same value[25][26]. The values can be written straight into G54 X, Y and Z, which cuts down on human misreading and typing errors.

However, this figure assumes the probe has been calibrated. Calculating with the actual ball radius won't match. The stylus moves slightly before the signal goes out, so the “electrical radius” used in the calculation differs from the real value. Renishaw's document sums up the values set by calibration as the 4 in the figure above, and says errors remain until you recalibrate[27].

  1. Remove stylus runoutMeasure with a low-force dial test indicator and adjust with the screws on the shank[27].
  2. Prepare the referencesEnter a test bar of known length in the tool offset, fix a ring gauge or sphere of known diameter, and enter its center and the Z reference in a work coordinate[27].
  3. Run the calibration cycleEnter the probe's approximate length in the tool offset and run it. For the fine details, follow the manual for the probe software[27].

Recalibrate when you change the stylus (even to the same spec), after the machine or probe has hit something, after major machine maintenance, at periodic checks, and when you doubt a measurement result[27]. The documents give no “every so many days” figure.

Touch speed also affects accuracy. Reading scatter comes from “read interval × speed”: with a 4 ms control at 3,000 mm/min it is 0.2 mm. On a slow-responding control, use a two-touch cycle: touch fast, back off a little, and touch again slowly (e.g., 30 mm/min)[28]. Going too fast doesn't help either: above 2,000 mm/min, the deceleration and retract distances grow and cycle time hardly drops (example with a 0.06 s time constant)[29]. The measuring move is G31 (skip): it stops as soon as the signal comes in and discards the rest of the move[2].

Measure tool length: always subtract the setter height

Setter height (e.g. 50 mm)Always subtract from the readingRead machine Z hereBring needle/display to referenceTop face
Illustration of a tool setter (height setter) placed on the top face of the workpiece with the tool touching it (front view). The reading is taken on top of the setter, so the top face is lower by the setter height.

Tool length is measured from the tool holder reference point (gauge line) to the tool tip along the tool axis[8][3]. Because the gauge-line-to-tip value does not change when the machine changes, tools measured off the machine can be shared across multiple machines[11]. If you use the spindle nose as the reference, the value differs from machine to machine by the machining difference in the taper.

MeasurementHow it worksExample values from the documentsWhen it suits / cautions
Paper / feeler gaugePut paper between the tool and the surface, and bring the tool in as far as the paper can still be moved[3]Could not confirm a standard paper thicknessNo special tool needed. A feeler gauge used by hand has its own error; in calibration, include its thickness in the calculation[27]
Tool setter (placed on the workpiece)Lower the tool and bring the needle or display to the referenceHeight 50 mm, ±1 µm (BIG BM-50GH; height tolerance +0.005/0)[30], height 50 mm, repeatability 3 µm, accuracy ±8 µm (Haas electronic type)[31]Small and handy. Subtract the height from the reading. The Haas electronic type returns to factory settings after 8 hours, so redo the zeroing[31]
On-machine contact tool setterTouches a measuring surface on the table automatically and sends the value to H1.00 µm 2σ (Renishaw TS27R)[32], 0.2 µm 2σ (Blum Z-Nano)[34]Can also detect tool breakage. When measuring with the tool turning, spin it opposite to the cutting direction[33]
On-machine laser (non-contact) tool setterDetects the rotating tool blocking the beam±1 µm 2σ (Renishaw NC4, 1 m separation)[35], 0.1 µm 2σ (Blum Nano NT)[37]Strong on small diameters. Coolant on the tip can cause a length difference of up to 100 µm, so dry it off[36]
Offline tool presetterMeasures true length and diameter off the machineCould not confirm official accuracy this timePrepare tools without stopping the machine. Pairs well with the true-length method[11]

The accuracies in the table are the repeatability of the setter itself, not the error of the whole measurement. Machine positioning, thermal movement and how you touch off add to it. With lasers the value also changes with where you measure: in one example, a φ80 face mill measured at its center showed values moving with spindle speed, but shifting 39 mm toward the outer edge stopped that[36].

Three ways to enter tool length: the sum comes out the same

Even on the same machine, how the value is split between G54 Z and H differs from shop to shop. Here we group the methods into 3 broad types. The example is a tool with a true length of 150 mm that touches the top face of the workpiece at machine Z −400, and a tool 20 mm longer that touches at −380.

MethodG54 ZH (tool with true length 150)H (tool with true length 170)What H holdsProsCons
True-length method−550+150+170True tool lengthCan be measured off the machine. H stays the same when the workpiece changes[11][12]Needs a tool to measure true length
Touch-off-on-the-part method0−400−380Machine Z where the tool tip reaches the top faceJust touch the tool off, so it's easy to follow. Haas's procedure takes this form[3]Every tool you use has to be remeasured each time the Z reference changes[12]
Master-tool method−4000+20Length difference from the master toolH stays the same when the workpiece changes. True length isn't neededIf the master tool chips or is replaced, everything shifts (our own grouping)

In all 3, G43 Z0. sends the gauge line to −400 for the tool with a true length of 150 and to −380 for the tool with a true length of 170, and the tool tip lands on the top face. When measuring with a tool setter, use the reading minus the height. If you read −350 on top of a 50 mm setter, the top face is at −400.

About this groupingLynch's column on how to enter tool length compensation lists overall tool length (from the spindle nose), tip to Z-zero surface (G54 Z = 0), and gauge line reference[11]. We found no maker document that spells out a procedure keeping the difference from a master tool, so here we grouped it using shop terms, based on Mitsubishi Electric's explanation (a function that uses the difference between the tool length assumed in programming and the actual length as the offset)[2].

Interactive diagram: make a mistake on purpose and see where the tool goes

Choose a method and tool length, and G54 Z and H are worked out and the tool moves to the program Z. Choose a deliberate mistake to see where the tool goes with a common error. Try it to see how the same mistake gives different results depending on the method. With the true-length method, leaving out G43 plunges the tool by the length of the tool, but with the touch-off-on-the-part method, it tries to go up instead.

Z0

Gauge line target (machine Z) = program Z + G54 Z + H (with G43; with G44, − H). Tool tip height = target − true tool length − machine Z with gauge line at top face (top face = 0)

Differences between controls

ControlWork coordinatesTool lengthCaution
Mitsubishi ElectricG54–G59; additional sets with G54.1 (48 or 96 sets, optional)G43 / G44 H; cancel with G49Enters G49 mode at power-on and M02[2]
HaasG54–G59; additional sets with G154 P1–P99 and G110–G129G43 H. H is a negative value in the touch-off-on-the-part formOn newer software, tool length compensation is always active and switches at tool change. Pressing PART ZERO SET 3 times puts a value in G54 Z, which causes a crash or alarm[6][5][3]
SiemensG54–G57, G505–G599Called by D number (H is not used; G43 H can be used in ISO mode)TOFF is a command that changes the effective tool length within the program; it does not change the value in offset memory[8][9]
Okuma OSPG15 HG56 HMeans something completely different from FANUC-compatible G15 and G56. Okuma's manuals are not public, so this was confirmed from a post processor[10]

FANUC's operator manuals are not public, so we confirmed the G43 sign from Mitsubishi Electric, Haas and Siemens ISO-mode documents. On a real machine, always check that machine's manual.

Check without cutting: how to stop before a crash

The Haas operator's manual names wrong tool offsets, wrong work offsets, and the wrong tool in the spindle as common causes of crashes[4]. Another source points out that tool length errors are not taken into account in pre-run collision checks[38]. In other words, a simulator can show a correct path, but it can't stop a crash if the numbers entered in the machine are wrong. We found no statistics on the share of such crashes, but this is a failure a procedure can prevent.

  1. Run with Z raisedRaise Z in the common offset (EXT) and every move takes place higher than normal[13]. Always put it back afterward.
  2. Run it in dry runWith no workpiece loaded, run with dry run on, rapid override at minimum, and a finger on feed hold. Don't cut in dry run[14][15].
  3. Approach in single blockStop at each tool's first approach and check distance to go. Stopping about 2.5 mm (0.100 in) short of the surface is the approach clearance Lynch gives as a guide[15].
  4. If something looks wrong, stopIn one example where Z seemed to be going too deep, distance to go read 8.3762 in, and the cause was a tool length that had not been entered[14].
  • Check value ranges: With a FANUC-style custom macro you can read G54 Z and the tool length, compare them with machine travel, and catch overtravel before cutting. Decimal point typos also show up in the tool length range check[16]
  • Don't change offsets mid-run and resume: Stopping, changing a tool or offset and resuming isn't safe, and Haas doesn't recommend it either, because on resume the machine comes back using the previous offset[4]
  • Know the limits of Safe Run: Haas's Safe Run reduces damage; it does not prevent crashes. It detects only in rapid and handle jog, not in cutting feed[4]

Tool length moves with heat

The spindle grows as it runs, so a tool length measured in the morning may not hold in the evening. As an example from the literature, a 1999 report on a vertical machining center found Z thermal deformation of up to 110 µm, reduced to 35 µm with a chiller and to within 5 µm with temperature compensation[39]. In Renishaw's document, 30 consecutive non-contact measurements drift about 6–10 µm over a few minutes (values read from the graph)[36]. Both are single-machine examples, not typical values. When the Z tolerance is tight, warm up after a long stop before measuring[36]. For how to measure dimensions, see Measurement error basics; for thermal growth, use the thermal expansion calculator.

FAQ

Should tool length go in G54 Z or H?
Either way, if the sum of program Z + G54 Z + H is right, the tool tip goes to the same place. The true-length method suits measuring off the machine, the touch-off-on-the-part method suits simply touching the tool off, and the master-tool method suits skipping true-length measurement while keeping workpiece changes easy. What matters is picking one for your shop and having everyone use it[11][3].
Do I add or subtract the edge finder radius?
Add it when the tool is on the − side of the face (left for X, front for Y), and subtract it when it is on the + side (right, back). The reading is the tool center, and the face is one radius beyond it. For φ10 that is 5 mm, and with the wrong sign you are off by 10 mm[20].
What happens if I forget to subtract the tool setter height?
You end up entering the top face too high, so the tool tip moves higher by the setter height (e.g., 50 mm) and cuts air. Subtract it twice and it moves 50 mm low and crashes into the workpiece. You can check this in this article's interactive diagram.
How often should a touch probe be calibrated?
Renishaw's document gives no figure in days. It says to calibrate when you change the stylus, after a collision, after major machine maintenance, at periodic checks, and when you doubt the results[27]. Set your periodic check interval to match your shop's tolerances.

For details on the G-codes, see G54–G59 / G43 / G44 / G49 / G52 / G53; for the tools, see Dial indicator / Gauge block / Feeler gauge; for machining overall, see the Machining centers page.

Sources

  1. ISO 841:2001, “Numerical control of machines — Coordinate system and motion nomenclature” (abstract). JIS B 6310:2003 is the identical standard
  2. Mitsubishi Electric, “MITSUBISHI CNC 700/70 Series Programming Manual (Machining Center System),” IB-1500072
  3. Haas Automation, “Mill Operator’s Manual: Part Setup” (8.3 Tooling, 8.4 Set a Tool Offset, 8.6 Set a Work Offset)
  4. Haas Automation, “Mill Operator’s Manual: Operation” (Safe Run, graphics, interrupt and resume)
  5. Haas Automation, "G43 Tool Length Compensation + (Add)"
  6. Haas Automation, "G154 Select Work Coordinates P1-P99"
  7. Haas Automation, “Mill Programming Workbook” (2015)
  8. Siemens, "SINUMERIK 840D sl / 828D Fundamentals Programming Manual"03/2013
  9. Siemens, "SINUMERIK ISO Milling Programming Manual"
  10. Autodesk, “OKUMA milling post processor (okuma.cps)”
  11. Mike Lynch, “Refining Tool Length Compensation Usage,” Modern Machine Shop (2015)
  12. Mike Lynch, “Minimizing Offset Changes From Job To Job,” Modern Machine Shop (1999)
  13. Mike Lynch, “The Point Of Reference For Fixture Offset Entries,” Modern Machine Shop (2005)
  14. Mike Lynch, “Verifying CNC Program Correctness: Step 2,” Modern Machine Shop (2005)
  15. Mike Lynch, “Key CNC Concept #10—Verifying CNC Programs Safely,” Modern Machine Shop (1997)
  16. Mike Lynch, “Checking Cutting Tool Offset Values,” Modern Machine Shop (2019)
  17. MHLW (Japan), “Training Manual Using Grade 3 Skill Test Practical Assignments: Milling Machine Work”
  18. Kurt, “DX6 CrossOver AngLock Vise Operating Instruction Manual” (2024)
  19. U.S. Navy, “Machinery Repairman 3 & 2,” NAVEDTRA 12204 (milling machine chapter)
  20. BIG DAISHOWA, “Accu Center Instruction Manual,” No.0819PA
  21. BIG DAISHOWA, “Accu Center” product page
  22. INSIZE, "Ceramic Edge Finder Operation Instruction"
  23. BIG DAISHOWA, “Point Master Instruction Manual,” No.1018 PS
  24. BIG DAISHOWA, “Point Master” product page
  25. Renishaw, “OMP40-2 optical machine probe” data sheet
  26. Renishaw, "Standard-accuracy machine tool touch probes"
  27. Renishaw, “Machine tool probe calibration,” TE415 (2024)
  28. Renishaw, "One-touch versus two-touch probing strategies"TE412
  29. Renishaw, "Optimising measurement cycle time"TE413
  30. BIG DAISHOWA, “High Performance Tooling Solutions Vol.3” catalog (Base Master)
  31. Haas Automation, "50MM Height Setter Instruction Manual"
  32. Renishaw, “TS27R tool setting probe” data sheet
  33. Renishaw, "TS27R tool setting probe Installation guide"
  34. Blum-Novotest, “Z-Nano series” product page
  35. Renishaw, “NC4 non-contact tool setting system” data sheet
  36. Renishaw, "Understanding non-contact tool setting"PD-4114-9043-02-C
  37. Blum-Novotest, “LaserControl Nano NT” catalog
  38. Denkena et al., "Simulation-based collision detection for CNC machining using sensor-based image recognition," Procedia CIRP 126 (2024)
  39. M.U. Patel, "Innovative thermal error correction of a vertical machining centre spindle head"LAMDAMAP 1999

More articles