Fanuc Tool Setter / Probe Calibration: Parameters 5015-5018, G31 / G36 / G37 and the O9000 Macro Chain

The short answer: calibrating a tool setter is not one screw – it is three stacked layers of reference parameters, measurement G-codes and protected macro programs. And the most widely repeated claim, "5015 is for ID tools and 5016 for OD tools", is wrong. In the official Fanuc additional manual, 5015 through 5018 are signed distances from the measurement reference position to four contact surfaces (X plus, X minus, Z plus, Z minus), not a split by tool type. Getting this layer wrong means compensating in the wrong direction. This page starts from the official definitions, then gives a six-step field procedure, the G31 / G36 / G37 split, and finally why calibration feed must match production feed.

🚨 Scope and compliance: The four-surface definition of 5015-5018, their data type and valid range come from the official Fanuc additional manual B-63523EN-1/02 (Sauter-Turret with 2nd Geometry Tool Offset Data Function for 16i-TB / 18i-TB / 21i-TB, Measurement section). The skip system variables #5061–#5063, the G36/G37 split, the SKIP signal path, Renishaw Inspection Plus macro numbers, 6200 bit polarity, 5091 / 5092 safety limits and 8133 bit meanings come from published third-party technical sites and service forums; no corresponding official Fanuc manual text was verified here, so all of these are labelled third-party and are not instructions to change parameters. Manual text, bit-definition figures and per-number descriptions are copyright material; this page explains mechanisms, lookup paths and field discipline only, and offers no manual download link, file mirror, archive or bundled package. Every parameter number, bit definition, macro number and unit must be checked against the CNC model, software version, supplied manual and builder specification; measurement functions can be remapped between generations and by the machine builder.

广告

30-Second Triage: Identify Which Case You Have

SymptomMost likely causeStart here
Every tool touching the same face is off by the same constantThat face's reference distance parameter
Error varies from tool to toolStylus locknut, chips on the face, coolant film, drag-chain cable
G31 travels to the endpoint without triggeringSKIP never reaches the CNC
It triggers but you cannot read the positionDid not capture #5061–#5063 in the very next block
Radius measured with G37 (or the reverse)G36 is radial, G37 is axial; they are not interchangeable
Tool length still off by around 0.01 mmCalibration feed differs from production feed
Just need to map a number to its familyRange framework
The number is not in the parameter screen at allOption entitlement, configuration filtering, generation

Table 0 – Eight symptoms and the first diagnostic line

1. What 5015 / 5016 Actually Are: The Manual Defines Four Contact Surfaces

Four contact surfaces for 5015 to 5018: X plus, X minus, Z plus and Z minus, each with its own signed reference distance

This is the most misquoted layer online. Chinese and English reposts routinely say “5015 is for ID (internal) tools, 5016 for OD (external) tools”. But the official Fanuc additional manual B-63523EN-1/02 lists all four numbers in one table under the heading “distance between the measurement reference position and the sensor contact surface”:

ParameterOfficial meaning (touch sensor 1 side)Field reading
5015X1P: distance to the X axis plus contact surfaceReference for tools approaching in +X
5016X1M: distance to the X axis minus contact surfaceReference for tools approaching in -X
5017Z1P: distance to the Z axis plus contact surfaceLength reference for +Z approach
5018Z1M: distance to the Z axis minus contact surfaceLength reference for -Z approach

Table 1 – The 5015-5018 four-surface definition (from `B-63523EN-1/02`, Measurement)

The same table adds four limits that reposts nearly always omit:

  • There is a second set: 5056 / 5057 / 5058 / 5059 are X2P / X2M / Z2P / Z2M for touch sensor 2, and the manual states they are valid only when bit 0 (2NR) of parameter 5051 is 1. On twin-sensor machines, check that bit first.
  • Data type is two-word, valid range −99999999 to 99999999.
  • Units follow the increment system: IS-A 0.01 mm, IS-B 0.001 mm, IS-C 0.0001 mm, with a separate set for inch input. The popular claim “one parameter unit equals one micron” only holds for IS-B metric machines.
  • Axes under diameter programming are set using a diameter value. This decides whether a 5015 correction is a radius difference or a diameter difference – get it wrong and the result is out by a factor of two.

The manual also notes these parameters serve the function “to input tool offset value measured B”. In other words, they describe where the setter hardware sits in the machine coordinate system, not the compensation of any individual tool. Each tool’s compensation still lives in its own geometry / wear offset.

2. Why “5015 = ID / 5016 = OD” Misleads

Tellingly, one third-party technical site contradicts itself across language editions: its Traditional Chinese article follows the official manual (5015 = X+ face, 5016 = X− face, 5017 = Z+ face, 5018 = Z− face), while another article states “5015 is for ID tools, 5016 for OD tools, with Mitsubishi equivalents 2015 / 2016”. The brief that prompted this page quoted the latter.

VersionSource typeProblem
Four contact surfaces 5015-5018, two-word, signed, direction-definedOfficial Fanuc additional manualVerifiable; used as the baseline here
5015 = ID tool / 5016 = OD toolSingle third-party article (its own language editions disagree)Replaces “approach direction” with “tool type” and hides 5017 / 5018 entirely
The block near 5015 is a function-specific area the builder may remapAnother article on the same siteThe warning itself is useful: builders do remap measurement functions

Table 2 – Three circulating versions and their trust boundaries

This is not wordplay. Under the ID/OD reading you would assume editing 5015 only affects boring bars. Under the official definition it affects every tool approaching that face from +X. A classic forum case makes the point: an OD turning tool cut 31.7 mm instead of 30 mm, and the fix was adding or subtracting 1.7 mm at 5015 – an external tool, corrected through the X+ face reference.

🔑 Remember: the parameters are grouped by contact-surface direction, not by tool category. The same third-party source also warns that before editing you must confirm the numbers against the parameter manual for your control and software series, because the block around 5015 is function-specific and builders occasionally remap measurement functions.

3. The Calibration Formula and a Six-Step Field Procedure

Six calibration steps: record the original values, verify repeatability, fix the home position, compute the reference face, approach from one direction, then verify by test cut

Third-party engineering sources give the reference-face calculation as: absolute Z of the setter reference face = current absolute Z of the machine − length of the master tool. In practice, jog a master tool of known length until it just touches the setter top face, read the machine coordinate, subtract the master tool length, and that is the setter face position in machine coordinates. After writing it back, measure a second known master tool and confirm the resulting compensation matches expectation.

What actually decides whether calibration succeeds is the discipline before any edit:

StepActionCriterion / why
1Record the current 5015-5018 (and 5056-5059) values and their signsThe sign reflects the builder's convention and beats any generic rule; it is also your only rollback
2Without touching anything, run five measurement cycles on one tool and log the compensationSpread within 1-2 least input increments means the mechanics are sound; above 0.01 mm, stop
3Confirm the reference return position has not movedA servo battery swap, encoder replacement or edited grid shift moves machine zero, making all four parameters look wrong at once
4Inspect the stylus locknut, arm lock, stop, chips and coolant film on the face, and the drag-chain cableThis is the checklist when step 2 fails – no parameter edit will fix it
5Approach each face from one direction onlyApproaching in reverse adds lost motion into the reading
6Verify with a test cut in aluminium, at the same feed used during calibrationA test cut is the only way to close the loop from calibration value to real part size

Table 3 – Six calibration steps and the criterion for each

Always leave a rollback path: editing CNC parameters carries the real risk that a wrong number or typo immediately changes machine behaviour and can cause a crash or scrap parts. If you are not experienced with parameter edits, the correct move is to contact the machine builder or local dealer rather than probing on a production machine. See Exporting / Printing FANUC Parameter Tables and Ladder for archiving, and FANUC Parameter Write Protect (PWE) for write access.

4. G31 Skip: #5061–#5063 Are System Variables, Not Parameter 5063

Three layers of G31: the SKIP hardware path, the system variables latched at trigger, and the separate numbering of parameters versus macro variables

G31 is the skip function, a one-shot G-code in group 00. Its motion is the same as G01, except that it continuously monitors the SKIP signal; when the signal changes from 0 to 1 it interrupts the block, latches the position and skips to the next block. Third-party sources consistently stress two points:

  1. The trigger position is stored in system variables #5061 (X), #5062 (Y), #5063 (Z), with #5064–#5066 for the 4th / 5th / 6th axes and #5071 reflecting the skip signal bits.
  2. Read them in the very next block and transfer the value, for example G31 Z-50. F300; immediately followed by #100 = #5063;. Reading later risks the variables being refreshed by the decelerated stop position, giving micron-level error; for single-axis probing, read only that axis.
LayerContentCommon confusion
PhysicalProbe trigger → receiver (e.g. OMI-2) → PMC input X → CNC internal SKIPAssuming G31 works as soon as the probe is mounted; receiver and ladder mapping are both required
VariableRead-only system variables #5061–#5063, read inside the programConfusing them with “parameter number 5063” on the parameter screen
Parameter6200 polarity, 5091 / 5092 search limit and feed (third-party)Applying the macro # notation to parameter numbers; the two numbering systems are unrelated

Table 4 – The three G31 layers and the notation most often confused

One widespread trap must be called out: a long third-party Chinese article describes the setter reference position as “parameter No. 5063, note this is not macro variable #5063“, while also writing #5091 with a hash to mean a parameter number. That article mixes macro variable notation with parameter numbers, so this page does not adopt any of its specific number values. The same article calls 8133#5 a “skip function enable bit”, whereas common parameter tables and our own Fanuc Analog Spindle Commissioning treat 8133#5 as spindle-serial-interface related – the two claims conflict, so verify against the supplied manual and copy neither side.

SKIP polarity, multi-step skip (G31 P) and input addresses such as X4.0 all belong to the builder wiring and the supplied connection manual. When G31 does not trigger, check the receiver status LEDs and whether the PMC input bit follows the probe – do not start by editing CNC parameters. See Fanuc 0i-MD PMC Diagnostic Screens and FANUC Diagnostic Number (DGN) Reference for the screen-side work.

5. G36 / G37 and the Safety Envelope: Do Not Mix Them

G36 and G37 are the automatic tool measurement codes Fanuc provides for tool setters. Both are group 00 and behave like G31 (monitoring SKIP during a feed move), but on trigger they automatically write the computed result into a tool offset, whereas G31 only records the position and does nothing further. Third-party sources give this split:

CodeMeasurement directionWhat it writesIf used wrongly
G36Radial (X / Y axis)Geometry or wear offset related to radius / diameterUsing G36 for length writes a value with no length meaning
G37Axial (Z axis)Tool length (H offset)Using G37 for radius produces an unusable result

Table 5 – The G36 / G37 split (third-party; confirm against the supplied manual)

广告

Those sources also note that G36 / G37 provide no safety fence of their own: the search distance and feed that protect the setter are set by parameters such as 5091 / 5092, and exceeding the search distance without a trigger raises an alarm and stops motion. No official manual text was verified here, so no values are given and this is not an operating instruction. The reliable field practice is to cancel tool length compensation first, confirm a safe height, prove the search distance with a low-feed single-block dry run, and only then run with a tool.

The same diagnostic line as G31 applies: every tool touching one face off by the same constant is a parameter problem; tool-to-tool variation is stylus contact geometry, insert nose radius entry or boring bar deflection. That line saves a great deal of pointless parameter editing.

6. The O9000 Macro Chain: Renishaw Numbers Are Not a Fanuc Standard

Three layers of the macro chain: the protected O9000 to O9999 program range, calibration programs P9801/P9802, measurement programs P9811/P9812, and P9810 safe positioning

Packages such as Renishaw Inspection Plus wrap G31 into cycles that can be called directly with G65, stored in CNC memory as programs in the O9000–O9999 range. Two numbering systems must be kept apart: O9000–O9999 is Fanuc’s program number range and protection mechanism, while P9801 / P9810 are numbers defined by the macro package, which can differ between builders and package versions.

CategoryProgram numbers listed by third-party sourcesPurpose
CalibrationP9801 / P9802 / P9804Probe length calibration, probe diameter calibration, combined sphere calibration
Safe positioningP9810Monitored move that stops and alarms if the probe touches anything en route
MeasurementP9811 / P9812 / P9814Single-point surface, bore / boss, sphere verification
StatusP9732Battery level check

Table 6 – Macro numbers by purpose (third-party package; verify against the machine program list)

Two further warnings from those sources: calibration uses P9801 / P9802, measurement uses P9811 / P9812, and treating a measurement cycle as calibration is a common mistake; and a calibration must always be verified against a sphere or ring gauge afterwards, otherwise it is like replacing a battery without checking the device actually powers on. On the protected program range, see Fanuc Tool Change Stuck Recovery and FANUC LADDER III Program Protection. A third-party article labels 3202#4 as NE8 and 3202#0 as NEP, which conflicts with common Fanuc bit naming (NE9 protecting O9000-O9999); this page adopts neither bit name and only insists on one rule: restore the protection bits to locked after loading, because an operator accidentally deleting a safe-move program such as P9810 can lead directly to a crash.

For macro variable partitions, G65 calls and nesting limits see Fanuc Macro B Guide; for getting programs into the CNC see FANUC Program Transfer: RS-232, Memory Card, USB, Ethernet, DNC.

7. Three Field Disciplines That Cost the Most When Ignored

  1. Calibration feed must equal production feed. The trigger is detected at the instant the switch operates, and the overtravel between trigger and stop varies proportionally with feed. Calibrating at 100 mm/min and measuring production tools at 500 mm/min bakes that difference into every compensation value. Position error from electrical delay is a builder- or site-specific figure that must be measured; do not copy millisecond numbers from the web.
  2. Approach each face from one direction only, so reverse backlash is not folded into the reference.
  3. Fix the home position before fixing parameters. After a battery swap, encoder replacement or grid shift edit, all four parameters appear wrong simultaneously; the reference point is upstream.

That also answers the frequent question “tool length is still 0.01 mm out after calibration”: do not edit parameters first. Run the five-cycle repeatability check. If the spread is small but the whole group is shifted, check calibration versus production feed, approach direction and face cleanliness, and only then the reference distance parameters.

8. Tool Setter vs Touch Probe vs Gauge Block

DeviceWhere its parameters liveMain error sourceWhen to use it
In-machine tool setter (Tool Eye)Contact-surface reference distances such as 5015-5018, plus each tool's geometry offsetArm lock, face contamination, approach speedBatch automatic tool setting on lathes, re-check after tool change
Workpiece touch probeProbe length / radius calibration values held in macro-side variables and offsetsPre-travel variation (PTV), bent stylus, batteryOn-machine measurement, work alignment, sphere verification
Gauge block / feelerUsually no CNC parameter at all; only affects manually entered offsetsOperator feel, contact pressure, block wearFallback when no automatic setter is available

Table 7 – Ownership and error sources (accuracy figures belong to the builder spec and on-site measurement; no generic values here)

Heidenhain is a separate system: iTNC 530 uses MP, TNC 640 / TNC7 use Cfg, and tool measurement runs through TCH PROBE 31 / 481. See Heidenhain Touch Probe Calibration and TCH PROBE 31 / 481 Tool Length Measurement. Brand, command set and parameter family all differ, so never carry Fanuc 5015 over to a Heidenhain control. A Renishaw encoder installation case study is also available in the Chinese-language section of this site.

9. Lookup Keys and an Internal Index

Lookup keyQuestion it answersWhere to look
CNC model + software versionWhether the number exists on this control and who owns itSupplied parameter manual cover and SYSTEM version screen
Manual number + section number (not page number)Official definition and data type of 5015-5018Measurement section of the official additional manual
Builder I/O list and ladderWhich X point SKIP lands on, and its polaritySupplied connection manual, PMC cross-reference
Macro program listWhether P98xx is loaded and protection bits restoredCNC program screen and supplied program list

Table 8 – Four lookup keys and the question each answers

Related on this site: Fanuc Parameter Number Map by Range · Why Is a Fanuc Parameter Missing? · Fanuc Override Setup · FANUC Parameter Write Protect (PWE) · FANUC Diagnostic Number (DGN) Reference · Fanuc 0i-MD PMC Diagnostic Screens · How to Export / Print FANUC Parameter Tables and Ladder · Fanuc Macro B Guide · Fanuc Tool Change Stuck Recovery · FANUC LADDER III Program Protection · Fanuc G41/G42 Interference Alarm · FANUC MPG Handwheel Signal Chain · SINUMERIK 828D Common Machine Data.

Frequently Asked Questions

What is the difference between parameter 5015 and 5016?

Per the official Fanuc additional manual B-63523EN-1/02, 5015 is the distance from the measurement reference position to the X axis plus contact surface (X1P) and 5016 is the distance to the X axis minus contact surface (X1M); the same table includes 5017 (Z plus face) and 5018 (Z minus face). The widespread “5015 for ID tools, 5016 for OD tools” claim comes from a third-party article whose own language editions contradict each other. Twin-sensor machines also have 5056-5059, valid only when bit 0 (2NR) of 5051 is 1. All four numbers are two-word, signed, with units that follow the increment system, and axes under diameter programming are set using a diameter value. Record the original values and signs before editing, and confirm the supplied manual has not remapped the measurement function.

Why can I not read the position after a G31 trigger?

The most common reason is not capturing it in the next block. Trigger positions are held in read-only system variables #5061 (X) / #5062 (Y) / #5063 (Z); reading later risks those variables being refreshed by the decelerated stop position. The correct pattern is G31 Z-50. F300; immediately followed by #100 = #5063;. The second class of cause is that SKIP never reached the CNC: probe not optically activated, receiver status LED abnormal, ladder not mapping the X input to SKIP, broken shield causing glitches, or low battery – all present as “travels to the endpoint without triggering”. Note that #5061–#5063 are macro variables and parameter numbers are a separate numbering system; polarity and addresses must be confirmed against the supplied connection manual and builder I/O list.

Tool length is still 0.01 mm out after calibration – parameters or something else?

Do not edit parameters first. Start with repeatability: run five measurement cycles on one tool without touching anything. Spread above 0.01 mm means a mechanical issue (stylus locknut, arm lock, chips and coolant film on the face, drag-chain cable) that no parameter edit will fix. If the spread is small but the group is shifted consistently, check three things in order: whether calibration and production approach feeds match (overtravel scales with feed), whether every face is approached from one direction only (reverse approach adds lost motion), and whether the home position moved after a battery replacement or grid shift edit. Only then consider the 5015-5018 reference distances, and verify each against the supplied manual – never trial-edit without a recorded rollback.

Last updated: 2026-11-15

Beyond tool setter calibration: verify the option legend in the supplied sheet

Beyond probe calibration: where spindle rotational accuracy fits

Where to go next

  • FANUC Troubleshooting — the full guide library: alarms, diagnosis numbers, servo, spindle, PMC and electrical faults, organised by symptom.
  • CNC Repair Tools — which instrument measures what: multimeters, clamp meters, insulation testers and oscilloscopes, with the specification that actually matters.
  • Remote Technical Support — have the readings reviewed with you: alarm reverse lookup, PMC ladder analysis and servo tuning advice by call. Repair companies and integrators welcome.

Read the guide, get the right instrument, or walk the diagnosis through with someone — pick whichever you need.

Also available in Chinese: FANUC 对刀仪 / 测头怎么标定?5015–5018 四个接触面 + G31 / G36 / G37 + O9000 宏程序链
The original Chinese version — same procedure, with the full field notes.
© 版权声明
THE END
喜欢就支持一下吧
点赞5赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容

CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
CNC电气调试问题解答 | 数控机床电气工程师资料共享屋
图片-CNCShare | 数控电气技术中心
图片-CNCShare | 数控电气技术中心
图片-CNCShare | 数控电气技术中心
图片-CNCShare | 数控电气技术中心
图片-CNCShare | 数控电气技术中心
图片-CNCShare | 数控电气技术中心
FANUC 0i-B / 0i-C 老系统报警速查:同号异义 + 920/930/950 换板还是查线-CNCShare | 数控电气技术中心
数控报警号形态与号段总索引:FANUC / 西门子 / 三菱 / 海德汉 / 华中 / 广数 / 新代 / 科德 八品牌对照 + 这条报警该找谁-CNCShare | 数控电气技术中心
Fanuc Alarm, Parameter and Diagnostic Cross-Reference Table: Verified SV / PS / OH Anchors and the Two Numbering Generations-CNCShare | 数控电气技术中心
FANUC 报警号 ↔ 参数号 ↔ 诊断号 三向反查总表:SV / PS / OH 段已核实锚点 + 新老两代编号体系-CNCShare | 数控电气技术中心
FANUC CNC Simulation Software: the Official CNC Guide Family, Hardware-Key Licensing and the Free-Version Myth-CNCShare | 数控电气技术中心
FANUC 仿真软件怎么选?官方 CNC Guide 四件套、授权方式与「免费版」的合规边界-CNCShare | 数控电气技术中心
HEIDENHAIN iTNC 530 Manuals: NC Software Numbers versus Document IDs, the TNCguide Help System and FCL Function Limits-CNCShare | 数控电气技术中心
海德汉 iTNC 530 手册哪里找?NC 软件号与文档号是两套体系 + TNCguide 帮助系统装进机床 + FCL 功能边界-CNCShare | 数控电气技术中心
Spindle Runout: Four-Layer Diagnosis, the Two-Point Test Arbor Split and Taper Contact Pattern Checking-CNCShare | 数控电气技术中心
主轴跳动太大怎么调?四层排查(轴承预紧 / 锥孔接触率 / 刀柄夹紧 / 联轴器同轴度)+ 两点法分流判据与判据来源纪律-CNCShare | 数控电气技术中心
机床打表找正怎么做?检具选择、标准流程、五项常见几何误差的调整部位与「检验 ≠ 找正」分层-CNCShare | 数控电气技术中心
Machine Geometric Accuracy Check and Adjustment Framework: ISO 230-1 vs ISO 230-2, Error Families, Instruments, Tolerance Provenance and Adjustment Locations-CNCShare | 数控电气技术中心
文章精选
专心做好一件事
打造更优雅的WordPress主题-CNCShare | 数控电气技术中心
专心做好一件事
打造更优雅的WordPress主题