SINUMERIK 840Di Reversal Jerk Backlash Tuning on Heidenhain

David Krause20 min read
Motion ControlSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

SINUMERIK 840Di Reversal Jerk on Heidenhain Linear Scale Axes: Backlash, Exact Stop, and Kv Tuning

1. Problem Statement

On a Pegard 5-axis + spindle machine controlled by a Siemens SINUMERIK 840Di PL, the X axis is equipped with a Heidenhain external linear scale as the position feedback element. The configured mechanical backlash value in the controller is 0.02 mm. Under the following conditions the axis produces a measurable transient spike:

  • Operating mode: 0.01 mm handwheel (JOG incremental)
  • Command: traverse in the negative direction by 0.01 mm
  • Observed behavior: the dial indicator first shows a displacement of approximately 0.1 mm, then settles back to 0.01 mm
  • Same-direction moves: displacement is correct, no overshoot
  • Reverse-direction moves: 0.1 mm fluctuation on the dial (overshoot of ~10× the commanded distance)

The same 0.1 mm reversal spike is not observed for unidirectional moves. Mechanical slide clearance has been measured at less than 0.02 mm and is therefore ruled out as the root cause. Reducing the position controller gain MD32200 from 0.5 to 0.1 and reducing the drive parameter MD1407 from 12.66 to 10 produced no measurable improvement.

Operational impact: Any reversal step of 0.01 mm produces a 0.1 mm error transient. For a 5-axis contouring application the resulting dynamic following error in reversal regions will be written into the surface finish, which is why the symptom cannot be ignored as a cosmetic display issue.

2. Why the Reversal Spikes: Mechanics of Backlash Compensation

When a CNC axis reverses direction the controller must first take up the lost motion (mechanical backlash) before the actual load-side position begins to move. SINUMERIK handles this in two stages:

  1. Detected lost motion between the motor-side feedback and the load-side feedback (when both are active).
  2. Compensating travel in the form of a programmed position offset, injected as soon as the direction reversal is detected.

If the commanded reversal step is small — for example 10 µm in handwheel mode — and the configured backlash is also small (20 µm), the compensator must still deliver the full lost-motion distance before the 10 µm command becomes visible. The axis will therefore look like it traveled 0.1 mm and then came back to 0.01 mm, because the displayed actual value is the difference between the load-side position and the internally compensated motor position.

The key insight from the field is:

If the axis is on a closed-loop direct-measuring system (linear scale) and the mechanical lost motion is already small, additional software backlash compensation introduces a transient that is larger than the physical defect it is trying to fix.

Setting the backlash value to zero eliminates the corrective travel, and the reversal spike disappears immediately. The trade-off is loss of compensation for thermal growth of the ballscrew and for the actual physical lost motion still present in the drive train.

3. Linear Scale vs. Motor Encoder: Feedback Architecture

The 840Di (and the 840D sl family) supports dual-encoder axes. For each axis there can be up to two feedback channels:

Channel Typical Source Resolution Role
Encoder 1 (motor side) Heidenhain rotary on servomotor ~20 bit / rev (sine 1 Vpp) Current / velocity loop feedback, commutation
Encoder 2 (load side / direct) Heidenhain LC/LS linear scale 0.01–1 µm grating pitch Position loop feedback (closed-loop on the actual axis travel)

Relevant 840Di machine data for encoder configuration includes:

  • MD30200 $MA_NUM_ENCS — number of encoders assigned to the axis (1 or 2)
  • MD30240 $MA_ENC_FEEDBACK_POL[] — feedback polarity of each encoder
  • MD31020 $MA_ENC_RESOL[] — encoder resolution
  • MD32110 $MA_ENC_FEEDBACK_POL[] — feedback polarity for position control
  • MD32900 $MA_DYNAMIC_MATCH_ENABLE — dynamic matching of two encoders

When the linear scale is the position-control feedback (the typical configuration on a precision 5-axis), the actual position reported to the operator and the position used for the position-control loop are derived from the scale. The motor encoder is used only by the speed and current loops inside the drive. In that case the controller already "sees" the true load-side position, and the closed loop is no longer blind to the backlash of the ballscrew.

Rule of thumb: If the axis is closed-loop on the linear scale, the position loop is no longer deceived by the ballscrew lost motion. The need for a software backlash compensation value therefore drops dramatically — but it does not go to zero, because the compensation also covers thermal expansion of the ballscrew and direction-dependent friction errors that the position loop cannot fully model.

4. The Two Backlash Values per Axis

For every axis the SINUMERIK 840D/840Di-sl data block contains two backlash values, indexed [0] and [1]:

Index Scope Description
$MA_BACKLASH[0] Motor-side feedback path Compensation applied when the position loop is closed on the motor encoder.
$MA_BACKLASH[1] Direct / load-side feedback path Compensation applied when the position loop is closed on the linear scale.

This split is a frequent source of confusion. On an axis with a linear scale, the value that drives the reversal transient is $MA_BACKLASH[1]. Verify the active feedback path on the operator panel under Diagnosis > Axis Status (this is also where the active encoder selection is shown for cross-checking). The PLC can switch the active feedback system through the interface DB; on a Pegard 5-axis the active encoder is normally fixed by configuration, but a configuration error in MD30200 or in the NC-PLC interface can leave the axis running on the wrong feedback path with the wrong backlash value active.

5. SINUMERIK 840Di Backlash Machine Data

MD Name Default Function
MD32450 $MA_BACKLASH Backlash 0.0 mm Mechanical lost motion to be compensated on reversal.
MD32452 $MA_BACKLASH_FACTOR Backlash factor 1.0 Multiplier on the compensation travel. Values <1.0 can be used to deliberately under-compensate.
MD32454 $MA_BACKLASH_MODE Backlash mode 0 Defines when the compensation is applied (every reversal, only on reversal with motion, etc.).
MD32456 $MA_BACKLASH_BAND Backlash deadband 0.0 mm Position error below which the compensation is frozen (prevents hunting around zero).
MD32457 Backlash rate / reversal ramp limit site-specific Limits the velocity at which the compensation is applied on reversal. Slowing this ramp softens the reversal transient at the cost of a short following error.
Field practice: On direct-measuring axes (linear scale), if the physical backlash of the ballscrew is < 0.01 mm, setting MD32450 to zero is the cleanest fix. The reversal spike disappears and the residual following error is absorbed by the position loop on the scale. The remaining loss of compensation for thermal growth of the ballscrew is usually small enough to be acceptable below a ballscrew length of ~1.5 m.

6. Drive Parameter MD1407 (Sinamics / 611U-Compatible)

MD1407 is a drive-level parameter visible in the 840Di commissioning tree. On Sinamics S120 drive objects that interoperate with the 840Di (NCU software 1.5 / 2.5 and later) it normally maps to a torque / current loop proportional gain of the inner speed controller, with typical values in the 8–20 ms integral-time / gain range. The original value on the reported machine was 12.66, reduced to 10 during diagnosis. Because MD1407 acts inside the speed-control loop, it cannot remove a reversal transient whose source is in the position-control loop (i.e. backlash compensation). Reducing it generally softens the response of the inner loop and may slightly delay the moment at which the overshoot peaks, but does not eliminate the overshoot itself. This is exactly the symptom observed on the field: 0.5 → 0.1 on MD32200 and 12.66 → 10 on MD1407 produced no improvement.

7. Position Loop Gain MD32200

MD32200 $MA_POSCTRL_GAIN — the position-controller gain factor Kv — sets the proportional relationship between the position error and the velocity command issued to the drive. Units are (m/min) / mm. Typical values:

Axis Class Kv Range Notes
Heavy milling / hobbing 0.3 – 0.8 High inertia, mechanical compliance
Standard 3-axis machining center 0.8 – 1.5 Good balance of stiffness and following error
Precision die / mold (linear scale) 1.0 – 3.0 High stiffness, scale feedback, low friction
High-speed contouring 2.0 – 5.0 Driven by acceleration requirements

The position loop bandwidth in rad/s is approximately Kv / 60 (for Kv in (m/min)/mm). Reducing Kv reduces the closed-loop stiffness and therefore the reversal spike would actually be expected to increase in some configurations, not decrease. This matches the field observation: lowering MD32200 from 0.5 to 0.1 did not solve the issue. The right way to attack a reversal transient that is dominated by backlash compensation is not to reduce the loop gain, but to remove or shape the compensating travel itself.

8. Exact Stop Limits: MD36000 and MD36010

The "in-position" detection of the 840Di is governed by two thresholds per axis:

MD Name Default (mm) Function
MD36000 $MA_STOP_LIMIT_COARSE Coarse exact-stop limit 0.04 Block-change and auxiliary-function advance enable when the axis is within this band of its command position.
MD36010 $MA_EXACT_STOP_LIMIT_FINE Fine exact-stop limit 0.01 Tighter band used for fine-blending and for the FINE / COARSE qualifier in the parts program.

On the reported Y axis these were set to 1.0 mm and 0.5 mm respectively — i.e. very loose. These values do not directly cause the 0.1 mm reversal spike (the spike is a real position overshoot, not a coarse-stop advance). However, leaving the limits loose will mask the symptom in part-program execution because the controller considers the axis "in position" long before the transient settles. Tightening them to 0.5 mm / 0.1 mm — or better, to 0.02 mm / 0.005 mm on a precision 5-axis — ensures that block advance is correctly delayed until the reversal transient has decayed, and that the G09 / G60 exact-stop instructions behave as expected.

Safety check: Tightening MD36000 to 0.5 mm is acceptable on the Y axis; tightening to 0.01 mm or below is not always safe because the position loop has a finite steady-state following error that depends on Kv. A value below 1 / (2 · Kv) mm can lead to permanent "exact stop not reached" alarms (e.g. 20062, 20063) on heavy axes. On a Pegard 5-axis with Kv ≈ 1.0, a fine exact-stop limit of 0.005 mm is realistic if the position loop is closed on the linear scale.

9. Reversal Compensation Ramp (MD32457)

The contributor's note that "MD32457 limits the rate of application of the reversal" is consistent with the SINUMERIK backlash compensation ramp that prevents the compensating travel from being injected as a velocity step into the position loop. Functionally it behaves like a velocity limit on the compensating travel and is expressed in mm/min. The trade-off is the same as for any input shaper:

  • Aggressive (high value): the compensation is applied in one cycle of the position controller — the reversal transient on the load is fast but the displayed actual value will follow the compensating travel immediately.
  • Soft (low value): the compensation is spread over several position-controller cycles — the transient is gentle but the axis can be off-position for tens of milliseconds after a reversal.

If you cannot zero the backlash value (for example because thermal compensation requires the residual value to be retained), MD32457 is the correct knob to soften the spike. A starting point on a precision linear-scale axis is 50% of the present value, then iterate against the dial-indicator reading in 0.01 mm handwheel mode.

10. Step-by-Step Diagnostic Procedure

The following procedure has been used in production to isolate and resolve the same class of reversal transient on 840Di-controlled machines.

  1. Verify the active feedback path. On the operator panel, open Diagnosis > Axis Status. Confirm that the load-side encoder (linear scale) is shown as the active position feedback. If it is not, the axis is closing its position loop on the motor encoder and the linear scale is only used for display — in that case, the entire 0.1 mm spike is real mechanical lost motion, not a compensation artifact.
  2. Read the active backlash values. Display $MA_BACKLASH[0] and $MA_BACKLASH[1] for the affected axis. The active index matches the active encoder. On a direct-measuring axis [1] is the relevant value.
  3. Temporarily zero the backlash value. Set MD32450 = 0 (or the relevant [0] / [1] sub-index) and re-test the 0.01 mm reversal. The spike should disappear, confirming that the compensation travel is the source.
  4. Measure the physical backlash directly. With the compensation value still zero, push the axis against a fixed stop with a dial indicator, apply ~10 N of force in the reverse direction, and read the indicator. This is the true lost motion of the drive train. On a Pegard 5-axis with a Heidenhain LC/LS scale, values of 0.05 – 0.15 mm are typical of a preloaded ballscrew and nut.
  5. Re-enable backlash only if the measured physical lost motion is non-zero and unacceptable. If the physical value is < 0.005 mm, leave MD32450 = 0 and the position loop on the scale will absorb the rest. If the physical value is larger, re-enter the measured value in MD32450 and use MD32457 to soften the reversal ramp.
  6. Tune MD32457 if required. Iterate on MD32457 to find the lowest value that still allows the dial indicator to settle at the commanded position within one handwheel step (typically ~50 ms at 0.01 mm).
  7. Re-check the position loop gain. Restore MD32200 to the value the machine was originally commissioned with (0.5 is conservative for a 5-axis slide). Lowering Kv trades bandwidth for compliance and is the wrong response to a backlash-induced reversal spike.
  8. Tighten the exact-stop limits. Set MD36000 to 0.5 mm and MD36010 to 0.1 mm as a baseline. On a precision 5-axis with Kv = 1.0, MD36010 = 0.005 is achievable but must be verified against the steady-state following error.
  9. Document the final values in the machine's commissioning record with the date, the operator panel version (840Di Operate 4.x / 4.5 / 4.7 / 4.8 — different SP releases default to different backlash algorithms), and the build of the Sinamics drive firmware.

11. Verification Procedure

After the tuning is complete, run the following test sequence and record the results for the machine log:

  1. Dial-indicator test (JOG handwheel): command 0.01 mm in +X, then 0.01 mm in –X, ten times. The indicator must stay within ±0.005 mm of the commanded position at all times. No 0.1 mm spike.
  2. Laser linear test (500 mm stroke): traverse the X axis back and forth over the full 500 mm stroke at feed 1000 mm/min. Compare the axis position reported by the scale to the laser reference. With Kv = 1.0 and a linear-scale feedback, the position error should be < 0.01 mm / 500 mm. A 0.05 mm / 500 mm error indicates a geometric or thermal issue, not a control issue, and is not improved by Kv tuning.
  3. Block-change test (parts program): write a 10-block program that does only 0.01 mm reversals at F500. With MD36000 = 0.5 the block advance must happen in less than 200 ms per block. If "exact stop not reached" alarms appear, increase MD36000 by 0.05 mm until the alarms disappear.
  4. Contour test: run a circular interpolation G02 / G03 program at 1 m/min with a 50 mm radius on the X-Y plane. The circularity error measured with a 3-D probe or a dial indicator must remain < 0.01 mm. The reversal transient will show up as a localized "flat" or "spike" in the contour; the absence of such features confirms the tuning.

12. Positioning Error Compensation: Why 0.05 mm / 500 mm on a Linear-Scale Axis

A residual 0.05 mm error over a 500 mm stroke on an axis that is closed-loop on a Heidenhain linear scale is almost never a control-loop issue. The most common sources, in order of likelihood on a Pegard-class 5-axis:

Cause Signature Counter-measure
Scale mounting error (Abbe offset, cosine error) Error grows linearly with stroke Re-align the scale to the axis of motion to within 0.05 mm over the full length
Thermal expansion mismatch (steel scale vs. cast-iron slide) Error grows with ambient temperature and time of day Add temperature compensation via $MA_TEMP_COMP_TYPE / $MA_TEMP_COMP_REF_VALUE / $MA_TEMP_COMP_SLOT / $MA_TEMP_COMP_VALUE and use Heidenhain LC with a thermal sensor
Scale tape tension (metal tape scales) Error is repeatable, peaks at mid-stroke Re-tension the scale to the manufacturer's specification; verify the mounting brackets are not constraining the tape
Axis straightness / squareness Error has a low-order polynomial shape Use volumetric compensation (MD32710 $MA_CEC_ENABLE / MD38000-MD38600 cross-compensation)
Resolver / encoder interpolation error in the drive Error is repeatable and periodic with the linear grating pitch Check the drive's interpolation factor and the Sinamics firmware version
Mechanical deformation under load Error changes with the weight of the spindle / workpiece Re-measure with a consistent load condition; add a sag compensation table if necessary

Of these, thermal expansion is the most common single cause of a 0.05 mm / 500 mm error. For a steel scale on a cast-iron bed the linear coefficient of expansion difference is about 1–2 µm/m·K. Over 500 mm and a 5 K temperature rise, this is 2.5–5 µm — i.e. not 50 µm, so the 0.05 mm error is more likely to come from a coarse alignment error or from a fixture not yet thermally stabilized at the time of measurement. Always let the machine warm up for at least one full thermal cycle (typically 30–60 min) before performing a laser calibration.

13. Compensation Tools Available in the 840Di

MD Group Function Typical Use
MD32700 $MA_CEC_ENABLE and the MD32710-MD32760 family Compensation of leadscrew error / measuring-system error via interpolation points (SSFK / MSFK) Compensate a known, repeatable scale error curve
MD32780 $MA_CEC_SCALING_SYSTEM Unit system for compensation tables Match the compensation table to the configured measuring system
MD32750 $MA_TEMP_COMP_TYPE / MD32760 $MA_TEMP_COMP_VALUE / MD32770 $MA_TEMP_COMP_SLOT Temperature-dependent axis compensation Compensate thermal expansion of the slide relative to the scale
MD32900 $MA_DYNAMIC_MATCH_ENABLE Dynamic matching between two encoders Keep the motor and load encoders in agreement under acceleration
MD38000-MD38600 (compensation tables) Pitch error, sag, and cross-compensation tables Multi-point error compensation

Use the SSFK / MSFK compensation tables (System Software Floating-point Kompensation / Measuring-System Floating-point Kompensation) to map a measured error curve and let the controller apply the inverse. For a 0.05 mm / 500 mm error, build the table from a Renishaw laser or Heidenhain KK laser measurement, with 9 to 21 reference points, and verify that the residual error after compensation is < 0.01 mm / 500 mm.

14. Troubleshooting Matrix

Symptom Likely Cause First Action Confirming Test
0.1 mm spike on reversal, scales back to 0.01 mm Backlash compensation travel injected as a step Set MD32450 to 0, re-test Dial indicator at 0.01 mm JOG
Spike size proportional to MD32450 Compensation value is correctly applied but oversized for the physical backlash Measure physical backlash; reduce MD32450 to that value Force test against a stop with a dial
Spike unchanged after lowering MD32200 Loop gain is not the dominant factor; compensation is Investigate MD32450 / MD32457 instead Spike disappears with MD32450 = 0
Spike unchanged after lowering MD1407 Drive speed-loop gain does not affect position-loop compensation travel Restore MD1407 to original, retune MD32450 / MD32457 Dial indicator test
Spike present only on one axis, all axes use the same gain Axis-specific backlash value or encoder wiring Compare $MA_BACKLASH[1] across axes Cross-axis swap test if the hardware is identical
Spike present regardless of backlash value Mechanical issue (slide twist, scale bracket, coupling) Inspect scale mounting and slide way; re-test Mechanical inspection with dial on a separate rigid bracket
Spike grows with feed rate Following error is amplified by the position loop dynamics Check MD32200 against the actual axis inertia Step response at different feed rates
Positioning error 0.05 mm / 500 mm on a linear-scale axis Scale alignment, thermal, or sag Laser calibration with warm machine Repeat laser at +5 K ambient, compare

15. Safety and Commissioning Notes

  • Verify before clearing alarms: alarm 20062 ("Axis %1 exact stop not reached") and 20063 ("Axis %1 exact stop not reached during jerk-limited deceleration") are the typical alarms raised if MD36000 or MD36010 are tightened below the steady-state following error. Do not blanket-acknowledge these alarms — tighten the limits only after measuring the actual following error with $AA_FOLLOW_ERR in the axis service display.
  • Direction reversal test under safe conditions: perform the 0.01 mm handwheel test with the spindle in a safe position, the tool clear of the workpiece, and the axis within the mid-stroke of its travel range to avoid the end-of-stroke deceleration region.
  • Backlash vs. friction compensation: SINUMERIK also has a friction-compensation block (MD32500-MD32540) which is independent of backlash compensation. Do not confuse the two. The reversal transient on a linear-scale axis is normally a backlash issue, not a friction issue.
  • Firmware consistency: 840Di Operate 4.5 SP2 and earlier use a backlash-compensation implementation that injects the full compensating travel in one position-controller cycle. 4.7 and later have an additional smoothing option activated through a separate MD. If the machine runs Operate 4.5, the only available knob is MD32457; on 4.7+ the smoothing option is preferred.
  • Mechanical inspection last, not first: always rule out the control-side causes (backlash, gain, exact-stop limits) before disassembling a slide. The field case described here was resolved in software in a few minutes — a slide strip-down would have taken a full day and produced no improvement.

16. Summary of Recommended Values for a Pegard 5-Axis with Heidenhain LC Scale on 840Di

Parameter Recommended Value Rationale
MD32450 $MA_BACKLASH[1] 0 (or measured physical lost motion, 0.05–0.12 mm) Position loop closed on the scale; physical lost motion < 0.01 mm typical
MD32457 (reversal ramp limit) Default; soften only if a residual value is retained in MD32450 Use to shape the reversal transient, not to mask it
MD32200 $MA_POSCTRL_GAIN 1.0 (linear-scale axis) Stiff response; safe with a direct-measuring system
MD1407 (drive speed-loop gain) Restore to 12.66 Original value; reducing it does not help a backlash-induced spike
MD36000 $MA_STOP_LIMIT_COARSE 0.5 mm Tighter than 1.0 mm; safe with Kv = 1.0
MD36010 $MA_EXACT_STOP_LIMIT_FINE 0.1 mm (verify against steady-state following error before going lower) Allows the parts program to use G09 / G60 reliably

17. FAQ

Why does my SINUMERIK 840Di linear-scale axis produce a 0.1 mm spike on direction reversal and then settle to the commanded 0.01 mm?

The controller is injecting the configured backlash-compensation travel as a step on reversal, which shows up on the dial indicator as a 0.1 mm displacement that the position loop then "pulls back" to the actual commanded position. Set MD32450 $MA_BACKLASH to zero (or to the measured physical lost motion) and the spike disappears. Reducing MD32200 or MD1407 does not help because the spike originates in the position-loop compensation, not in the loop gain.

What is the difference between $MA_BACKLASH[0] and $MA_BACKLASH[1] on a 840Di axis?

Index [0] applies when the position loop is closed on the motor-side encoder; index [1] applies when it is closed on the direct / load-side encoder (linear scale). The active encoder is shown in Diagnosis > Axis Status. On a Pegard 5-axis with a Heidenhain LC scale as position feedback, the value that drives the reversal transient is [1].

Should I enter a backlash value on a linear-scale axis?

Only if the physical lost motion of the drive train is larger than what the position loop on the scale can absorb. On a preloaded ballscrew with a measured backlash < 0.01 mm, leave MD32450 = 0. If the physical value is 0.05–0.15 mm and the application cannot tolerate the following error, enter the measured value and use MD32457 to soften the reversal ramp.

What is the difference between MD36000 and MD36010 on the 840Di?

MD36000 $MA_STOP_LIMIT_COARSE defines the band around the command position inside which the axis is considered "in coarse position" — block change and M-function advance are enabled. MD36010 $MA_EXACT_STOP_LIMIT_FINE is a tighter band used for fine-blending and for the FINE / COARSE qualifier. On a linear-scale axis with Kv = 1.0, typical values are 0.5 mm coarse and 0.1 mm fine; 1.0 mm / 0.5 mm (as found on the reported machine) is unnecessarily loose.

Why is there a 0.05 mm positioning error over 500 mm on a linear-scale axis, and can the user compensate it in the controller?

The most likely causes are scale-mounting error (Abbe offset, cosine), thermal expansion mismatch between the steel scale and the cast-iron slide, scale-tape tension on a metal-tape scale, or axis straightness. A 0.05 mm / 500 mm error is too large to be a control-loop issue on an axis with a Heidenhain LC scale. Measure the error with a Renishaw or Heidenhain laser, build a compensation table (SSFK / MSFK) using MD32700 and the MD32710-MD32760 family, and apply temperature compensation through the MD32750-MD32770 family if the error is temperature-dependent.

Will tightening MD36000 to 0.5 mm and MD36010 to 0.1 mm improve positioning accuracy on the Y axis?

Not by itself — these limits govern when the controller declares the axis "in position" for block-change purposes, not the actual positioning accuracy. They will, however, ensure that block advance waits for the reversal transient to settle, which gives a more repeatable part-program behavior. The actual positioning accuracy is governed by the position-loop gain MD32200, the active backlash value, and the residual error after compensation. If you tighten these values below the steady-state following error, expect alarm 20062 / 20063; verify with $AA_FOLLOW_ERR in the service display before committing the change.

Back to blog