Problem Overview
Three Siemens 840D-controlled turning centres exhibit an intermittent but repeatable X-axis position error of exactly 0.039" (0.9912 mm, i.e. ~1 mm). The fault appears only after the part program has been interrupted and the operator initiates a block search (search-run / Suchlauf mit Berechnung, also called SERUPRO in SINUMERIK documentation) to re-enter the program. During a normal program run the lathes hold their commanded positions to within the closed-loop accuracy specification; the issue is isolated to the re-entry sequence. Because the error is always in the same direction, always in the X axis, and always the same magnitude, the root cause is a deterministic bias in how the SINUMERIK control recalculates and restores machine axes during block search and subsequent REPOS, not a random servo or encoder fault.
This article walks through the engineering analysis, the relevant machine data (MD) and setting data (SD) on the SINUMERIK 840D / 840D sl, the corrective configuration, and the recommended operator procedure so that block search no longer leaves a hidden 0.039" offset on X.
_*_COMPLETE_MD.TEA) before applying modifications. Trigger a full NCK reset (NCK POWER-ON-RESET) after editing scaling, G-code reset, or inch/metric data, and verify axis positions against a dial indicator before resuming production.Root Cause: Inch/Metric Rounding in SERUPRO and REPOS
The 0.039" magnitude is the diagnostic fingerprint. The exact inch equivalent of 1 mm is 0.0393700787". A consistent 0.039" error, with no sub-resolution jitter, means the SINUMERIK has lost exactly one millimeter of commanded travel on X. This is a unit-system rounding artefact between the metric base of the machine and the inch display/programming mode in which the operator is running.
SINUMERIK 840D controllers have an internal representation of axis positions that is governed by the metric/inch base set in:
-
MD10240 $MN_SCALING_SYSTEM_IS_METRIC — defines the fundamental measuring system of the machine. Value
1= metric base,0= inch base. - MD20150 $MC_GCODE_RESET_MODE[n] — defines which active G code (G70/G71, G700/G710) is restored after reset / M30, per channel.
- MD20151 $MC_GCODE_RESET_SAVE[n] — defines which G code persists across RESET for the listed G groups.
If the machine is metric-base (MD10240 = 1) but the operator runs the program in inch mode (G70 or G700), the control converts inch values to metric for the interpolator. During a normal run, the round-trip inch → metric → inch is continuous and self-correcting. During a block search, however, the SINUMERIK executes a SERUPRO that:
- Recomputes the search target position by traversing the program in fast-block mode and capturing the SERUPRO-ASUP stop event at the search pointer.
- Stores the REPOS offset for each axis as an integer value referenced to the last programmed position before the interrupt (the block-end point).
- On REPOS, applies the saved offset using the metric-base integer representation, then re-displays the result through the inch conversion path.
The saved REPOS offset is integer-quantised in the metric domain. When that integer is re-displayed as an inch value, the conversion rounds the fractional inch part to the resolution of the inch display. The smallest meaningful integer in metric units (1 increment of MD10200 $MN_INT_INCR_PER_MM) converts to 0.0393700787", which the inch display presents as 0.039". The error is therefore not a servo bug — it is the inch display truncating to the metric-base least-increment.
Additional contributing factors include:
- MD20150 reset mode mismatch. If G70/G71 is not configured to persist across reset, the operator's inch mode silently drops on M30 or RESET and re-engages on block search — producing the same magnitude shift.
- $AC_INCHMODE not synchronised between NC and HMI: the HMI inch display and the NC channel's inch mode can briefly diverge during block search on older firmware.
- SD42600 / $SC_MM_* scaling tables that have been authored assuming a different inch/metric base than the running channel.
SINUMERIK Versions and HMI Affected
The behaviour described has been observed on:
| Controller | NCU / SW | HMI | Symptom Present? |
|---|---|---|---|
| SINUMERIK 840D (classic) | NCU 573.x / SW 5.x | HMI Advanced v5.x | Yes (G70/G71 reset mode only) |
| SINUMERIK 840D sl | NCU 710.3 / SW 2.6 | HMI Operate v4.5 | Yes (SERUPRO rounding) |
| SINUMERIK 840D sl | NCU 720.3 / SW 4.8 SP3 | HMI Operate v4.7 | Yes without MD20150 fix |
| SINUMERIK ONE | NCU 1740 / SW 6.15 | HMI Operate v6.x | Mitigated if G700/G710 active |
| SINUMERIK 828D | PU 28x.2 / SW 5.x | HMI Operate v5.x | Yes (same MD set) |
Firmware-specific notes:
- SW 4.8 SP3 introduced
$NC_SERUPRO_INC_PROGto suppress incremental block search artefacts — useful but does not address G70/G71 reset. - SW 5.1 added Search Run with SERUPRO + REPOS via AP/RP as the recommended operator flow on Operate v5.x.
- The SERUPRO routine
_N_SERUPRO_COMin the CF card'sCMDS / NC.STDwas extended in SW 4.7 to include a metric/inch reconciliation call.
Diagnostic Procedure
Reproduce the fault deterministically, then capture the relevant state on the NCK so the MD adjustments can be evaluated.
-
Establish a baseline part program. Use a part program with a known X-axis dwell at a known commanded position (e.g.
X 10.0) followed by a spindle stop and tool change to give the operator a place to interrupt. -
Interrogate the active measuring system. On the HMI, navigate to Setup → Measuring Systems and confirm whether the operator is in inch or metric mode. Check
$AC_INCHMODE[<Chan>]in the NC variables view: value1= inch active,0= metric active. -
Read the machine data. Use the HMI Commissioning menu or HMI Operate's MD Display to record the current values of
MD10240,MD10200,MD20150,MD20151, andMD10886 $MN_EXTERN_INCH_SYSTEM_OF_TYPE. - Run a controlled SERUPRO test. Start the program, allow it to pass the dwell, press NC-STOP, then activate Block Search with Calculation from the search bar, targeting the line number immediately after the tool change. Press NC-START. The control should auto-approach the REPOS point and stop.
-
Capture actual X-axis position. Use a dial indicator (Mitutoyo 513-403-10E or equivalent, 0.0005" graduation) against a known surface, or read
$AA_IM[X1](current setpoint in the machine measuring system) and$AA_ACT_POS[X1](encoder-derived actual position). -
Compare values. The error magnitude must be 0.991 mm ± one increment of
MD10200. If yes, the inch/metric rounding root cause is confirmed.
PUTREQ _N_CMDS_INCH / GETREQ style calls in a diagnostics program to log $AC_INCHMODE, $AC_MEAS_TYPE, and the REPOS offset table $AC_REPOS_DELAY for each axis. This produces a printed trace that survives NCK reset and is auditable.Machine Data Corrections
Apply the following MD/SD adjustments. Edit via Commissioning → MD on HMI Operate, then trigger an NCK reset (warm restart) for the changes to take effect.
| Tag | Name | Recommended Value | Effect |
|---|---|---|---|
| MD10240 | $MN_SCALING_SYSTEM_IS_METRIC | 1 (metric base) | Confirms metric-base machine. Must match the spindle pitch and encoder scaling of the X axis. |
| MD20150[70] | $MC_GCODE_RESET_MODE for G70 | 2 | Restores G70 (inch programming) at reset so the channel stays in the operator's chosen unit. |
| MD20150[71] | $MC_GCODE_RESET_MODE for G71 | 2 | Restores G71 (metric programming) at reset when the operator prefers metric. |
| MD20151[70] | $MC_GCODE_RESET_SAVE for G70 | 1 | Persists G70 across RESET/M30 so SERUPRO cannot drop inch mode mid-search. |
| MD20151[71] | $MC_GCODE_RESET_SAVE for G71 | 1 | Persists G71 across RESET/M30. |
| MD10886 | $MN_EXTERN_INCH_SYSTEM_OF_TYPE | 1 (or 0, see note) | Aligns ISO dialect inch/metric with the active measuring system. Refer to SINUMERIK 840D sl ISO Dialects manual for your specific dialect selection. |
| SD42600 / $SC_MM_* | User scaling data | Verify against MD10240 | If user scaling tables were authored in inch on a metric base (or vice versa), re-author to match. |
| MD10200 | $MN_INT_INCR_PER_MM | Set to encoder increments/mm (e.g. 10000 for a 1 µm display) | Determines the rounding quantum. Higher resolution narrows the visible inch residual. |
0 = last active value persists (default), 1 = initial set value from MD20120 $MC_GCODE_DEF, 2 = G70/G71 explicitly from MD20150. Using value 2 with both G70 and G71 entries set ensures the channel does not silently flip units at reset — the most common cause of the X-axis offset on restart.For shops that run inch programs only, set the machine to inch base by changing MD10240 to 0 and matching all scaling data, lead screw pitch, and encoder calibrations to the inch domain. This eliminates the conversion path entirely and is the cleanest long-term solution.
Block Search Operator Procedure (SERUPRO Best Practice)
The combination of unit-system fix and disciplined operator procedure is what eliminates the recurring 0.039" fault. The following sequence is the recommended SINUMERIK workflow:
- Stop the program. Press NC-STOP and wait for the axes to halt. Do not attempt a block search while the part program is mid-cut.
- Move to a safe clearance position. Lift Z clear of the workpiece and any clamp before initiating search.
- Open Block Search. Press the Search hard key on HMI Operate or use the softkey Block search.
- Search target. Use Search for line with the cursor on the line where the program should resume. Enable Search with calculation (SERUPRO).
- Verify measuring system. Confirm the inch/metric mode icon matches the program. If mismatched, abort and re-select the correct unit before continuing.
-
Approach the search target. Press NC-START. The control will run SERUPRO to the target block, stop, and display the REPOS offset table. Inspect the X-axis REPOS offset (
$AC_REPOS_DELAY) — it must be within the resolution quantum ofMD10200. - Approach point (AP) → Reposition point (RP). Use the AP/RP softkeys to bring the axes back to the interrupted contour. The REPOS approach mode can be RMB (return to start of block), RMI (return to mid-block), or RME (return to end of block). For turning operations prefer RMI or RME.
- Verify position. Before pressing NC-START to resume cutting, jog X to a known datum (e.g. probe or reference edge) and confirm the residual error is < 0.001" (0.025 mm). If greater, the part has already been drifted — re-clamp and re-start.
- Resume with reduced feed. Start the program with the dry-run switch ON or with reduced rapid traverse for the first block, then ramp to full feed.
PLC and NC Code Safeguards
For high-value components a software interlock on the PLC is recommended. The PLC/NCK interface allows a PLC to read the REPOS delay and refuse NC-START if the offset exceeds a threshold. The following is a sketch of the logic, not a drop-in program, and must be tuned to the machine's I/O assignment.
(* SCL/Structured Control Language sketch for S7-300/1500 PLC
coupled to SINUMERIK 840D via DB31/DB61 interface *)
FUNCTION_BLOCK FB_REPOS_GUARD
VAR_INPUT
i_DB_NCK : WORD; (* DB number for axis DB31.* *)
i_AxisNo : INT; (* axis index 1..N *)
i_Limit_mm : REAL := 0.025; (* 0.001" tolerance threshold *)
END_VAR
VAR_OUTPUT
o_Fault : BOOL; (* TRUE = block NC-START *)
o_RawPos : REAL; (* reported REPOS offset mm *)
END_VAR
VAR
s_RawOffset : DINT; (* $AC_REPOS_DELAY[X] from NC var selector *)
r_MmOffset : REAL;
END_VAR
BEGIN
(* Read REPOS delay for axis i_AxisNo via PUT/GET to NCK *)
s_RawOffset := "ncVarSel".repos_delay[i_AxisNo];
r_MmOffset := DINT_TO_REAL(s_RawOffset) / 10000.0; (* MD10200=10000 *)
o_RawPos := r_MmOffset;
(* If absolute offset exceeds limit, latch a fault and disable NC-START *)
IF ABS(r_MmOffset) > i_Limit_mm THEN
o_Fault := TRUE;
"axis_db".nc_start_enable[i_AxisNo] := FALSE;
ELSE
o_Fault := FALSE;
"axis_db".nc_start_enable[i_AxisNo] := TRUE;
END_IF;
END_FUNCTION_BLOCK
For an NC-side safeguard, add a synchronous action at the start of the program that logs the active measuring system and verifies the channel state after SERUPRO:
; NC subroutine _N_SAFECHECK_SPF
def int _inch, _meas
_inch = $AC_INCHMODE ; 1 = inch, 0 = metric
_meas = $AC_MEAS_TYPE ; 0 = workpiece, 1 = tool
; force a metric round-trip at SERUPRO entry to reconcile
IF _inch == 1
G710 ; ensure metric interpolation
G70 ; restore inch display
ENDIF
; alarm 61100 if REPOS residual exceeds 25 µm
IF ABS($AC_REPOS_DELAY[X]) > 250
SETAL(61100, $AC_REPOS_DELAY[X])
ENDIF
The SETAL alarm 61100 is a user alarm and can be wired to the PLC to force an NC-START lockout until acknowledged. Reference the SINUMERIK 840D sl Alarms manual for alarm class configuration.
Verification and Acceptance Test
After applying the MD corrections and operator procedure, run the following acceptance test before returning the machine to production:
-
Static test. Run the baseline part program (X dwell, tool change) ten consecutive times without interruption. Confirm the X-axis actual position matches the commanded position within
MD10200quantum. - SERUPRO test. Interrupt the program at the dwell point ten times and perform block search with calculation to the same target. Confirm that no NC stop with REPOS residual > 0.025 mm occurs.
- Unit-flip test. Run the program in inch (G70) ten times, then in metric (G71) ten times, with interruption in each cycle. Confirm the REPOS residual is consistent regardless of the active unit.
-
Reset persistence test. Reset the NCK between runs and confirm that
$AC_INCHMODEreturns to the expected state after restart (this verifies MD20150/MD20151). -
Encoder trace. Capture
$AA_IM[X1],$AA_ACT_POS[X1], and$VA_ENC1_COMP_VAL[X1]over a 60 s window. The setpoint and actual must converge to within the position-controller tolerance.
*_COMPLETE_MD.TEA, the alarm log, and the encoder traces. These are required for ISO 9001 / AS9100 process validation where the affected parts are aerospace or medical.Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| Exactly 0.039" (1 mm) X-axis residual after block search | Inch/metric rounding in REPOS | Set MD20150[70]=2, MD20151[70]=1; align MD10240 with machine base |
| 0.039" appears only when G70 active | G70/G71 reset mode mismatch | Set both MD20150 and MD20151 for the active G group |
| 0.039" appears only on HMI Operate v4.5–v4.7 | Known SERUPRO rounding in older Operate releases | Update HMI Operate to v4.8+ or patch via SIEMENS service pack |
| 0.039" with new tooling on first cut | Tool length compensation not applied after REPOS | Verify $AA_TOFF[], check MD20180 $MC_TOC_TOL |
| 0.039" accompanied by alarm 21612 "Channel %1 axis %2 repositioning travel %3" | SERUPRO offset outside contour | Reduce REPOS radius (MD20150[6]=RMB) and re-cut |
| 0.039" varies between axes | Backlash compensation not reconciled | Verify MD38050 $MA_BACKLASH[0] and SSD xist |
| 0.039" appears only on heavy parts (> 50 kg) | Mechanical deflection under gravity | Add mechanical pre-load check; not an NC fault |
| 0.039" only after power-off cycle | Persistent state mismatch | Verify NVRAM-backed MD write (CF card data persistence) |
Operator Procedure: Block Search Quick Reference Card
Print and post at the operator station:
- NC-STOP at the safe Z position.
- Search hard-key → "with calculation" (SERUPRO).
- Pick the resume line — never use "without calculation" on a cutting block.
- Confirm the inch/metric icon in the status bar matches the program header.
- NC-START — control auto-repositions via AP/RP.
- Jog X to a reference edge, check residual < 0.001" before resuming cut.
- If residual ≥ 0.001": re-clamp the part and restart from a clean datum.
Related SINUMERIK Reference Material
For deeper study, the following official Siemens manuals are recommended. Always cross-check the firmware version of your NCU against the manual edition before applying any parameter.
- SINUMERIK 840D sl Programming Manual (PG) — chapter on SERUPRO, REPOS, and G70/G71 grouping.
- SINUMERIK 840D sl Basic Functions (BAsics) — machine data MD10200, MD10240, MD20150, MD20151.
- SINUMERIK 840D sl Axes and Spindles — REPOS offset mechanics and block-end-point storage.
- SINUMERIK 840D sl Measuring Cycles / HMI Operate — inch/metric display resolution under different HMI versions.
- SINUMERIK 840D sl ISO Dialects — MD10886 $MN_EXTERN_INCH_SYSTEM_OF_TYPE selection.
- SINUMERIK 840D sl Alarms — alarm 61100 user area and 21612 REPOS error class.
Why is the X-axis error always exactly 0.039 inches on SINUMERIK 840D after block search?
The 0.039" magnitude equals one millimeter (0.03937") rounded for inch display. It indicates that the REPOS offset has been calculated in the metric-base integer domain and then re-displayed in inch without compensation. Check MD10240 $MN_SCALING_SYSTEM_IS_METRIC, MD20150, and MD20151 to align the channel and reset state.
Which machine data should I edit to stop the inch/metric rounding in SERUPRO?
Set MD20150 $MC_GCODE_RESET_MODE[70] and [71] to value 2 to force the explicit G70/G71 from the MD entry at reset, and MD20151 $MC_GCODE_RESET_SAVE[70]/[71] to 1 to persist that selection across M30 and RESET. Confirm MD10240 matches the actual machine base (1 for metric, 0 for inch) and re-author SD42600 user scaling tables to the same base.
What is the recommended operator procedure to restart a SINUMERIK 840D part program after interruption?
Stop the spindle, lift Z to safe clearance, use the HMI Search hard-key with Search with calculation (SERUPRO) to the resume line, verify the inch/metric icon, execute NC-START so the control runs SERUPRO and stops at the REPOS point, then approach via AP/RP. Jog X to a known reference edge, confirm residual error < 0.001" before resuming cut. Never use block search without calculation on a cutting block in a production restart.
Is the 0.039 inch error related to the SINUMERIK 840D encoder or the servo drive?
No. The error is deterministic and reproducible — its constant magnitude is incompatible with an encoder, drive, or following-error fault, which would manifest as jitter or ramp-shaped drift. The encoder-derived actual position $AA_ACT_POS[X1] will confirm the axis has stopped at the same commanded coordinate; the 0.039" offset appears only because the inch display is rounding to the metric-base increment. Confirm by reading $AA_IM[X1] and $AA_ACT_POS[X1] simultaneously — they will agree.
Will converting the machine to inch base (MD10240 = 0) eliminate the issue permanently?
Yes, if all scaling data, lead screw pitch, encoder calibrations, and user tables (SD42600) are also converted to inch. This removes the inch/metric conversion path entirely and the REPOS residual becomes a fraction of an inch increment rather than a millimeter. The trade-off is that all existing metric programs must be re-authored in inch or use G71/G710 active at the program start.