Configuring SINUMERIK 840Di sl ADI4 for 90000 ppr Spindle

David Krause14 min read
Motion ControlSiemensTechnical Reference
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

Problem Overview: Lathe Retrofit with High-Resolution Spindle Encoder

Retrofitting a non-standard lathe to a SINUMERIK CNC requires retaining the existing analog servo amplifiers and spindle drive while introducing a digital controller with closed-loop spindle position control. The boundary conditions for this class of retrofit are:

  • Two analog feed axes (X, Z) operating as standard velocity-controlled drives from ±10 V setpoint interfaces.
  • One main spindle analog drive with a direct-mounted high-resolution incremental encoder at 90,000 impulses per revolution (ppr).
  • One tool spindle analog drive without a position feedback device (open-loop speed command).
  • All four analog drive amplifiers must be retained unchanged, which mandates an external digital-to-analog converter module in the SINUMERIK system.

Siemens provides the ADI4 (Analog Drive Interface for 4 Axes) module for exactly this purpose. It converts PROFIdrive setpoints from the NC into ±10 V analog signals for up to four drives and accepts TTL encoder feedback on each axis channel for position and speed feedback to the NCK.

The challenge is the combination of a high pulse count encoder (90,000 ppr) with the bandwidth limitation of the ADI4. Two system choices exist: SINUMERIK 802D sl with integrated ADI4, or SINUMERIK 840Di sl with external ADI4. Each platform handles the encoder resolution differently, and only one of them supports the required 90,000 ppr spindle encoder without violating frequency limits.

ADI4 Module Architecture and Specifications

The ADI4 is a Siemens PROFIdrive-compliant interface module that operates as a slave on PROFIBUS DP. The NCK treats each ADI4 channel as a virtual PROFIdrive axis (PZD telegrams 1, 2, 3, 4, 5, 6, 7, and 102–106 are supported). For each axis, the ADI4 exposes:

Parameter Specification
Axes per module 4 analog setpoint outputs (±10 V, 12-bit DAC resolution typical)
Encoder inputs 4 incremental TTL inputs (RS-422 differential, A/B/N signals)
Maximum input frequency 500 kHz per channel (track A or B frequency)
PROFIBUS connection DP slave, 12 Mbaud max
Power supply 24 V DC logic, ±15 V from drive backplane or external
Encoder type selection Not available / TTL (per Siemens product documentation)
Position resolution Quadruple evaluation of A/B tracks (×4 multiplication)

Per the official Siemens support entry for the SINUMERIK 840D sl / 840Di sl / 802D sl ADI4 – Analog Drive Interface for 4 Axes, the supported encoder type list reduces to two values: "not available" for axes without feedback (the tool spindle in this retrofit), and "TTL" for axes with an RS-422 incremental encoder. Sine-wave 1 Vpp encoders (Heidenhain EnDat, Siemens DRIVE-CLiQ) are not supported on ADI4 — only square-wave TTL signals.

Encoder Frequency Calculation and Spindle Speed Limit

The single most important number in this retrofit is the ADI4 maximum encoder input frequency of 500 kHz per channel. For a rotary spindle with a fixed pulse count, the maximum permissible mechanical speed is:

f_enc [Hz] = (pulses_per_rev × 4) × n [rev/s] = pulses_per_rev × n [rpm] / 15
n_max [rpm] = (f_max_Hz × 60) / pulses_per_rev

For the 90,000 ppr spindle encoder with ×4 quadrature evaluation, the maximum frequency occurs at the top speed:

f_enc(n) = 90000 × n_rpm / 15 = 6000 × n_rpm  [Hz]
f_enc(500 rpm) = 3,000,000 Hz = 3 MHz  → EXCEEDS 500 kHz limit
f_enc(83 rpm)  =   498,000 Hz ≈ 500 kHz  → at limit

More precisely, the absolute theoretical ceiling with 500 kHz hardware limit is:

n_max = (500000 × 60) / 90000 = 333.3 rpm

This is a hard physical limit of the ADI4 hardware; no machine data parameter, firmware version, or NCK configuration can extend it. If the lathe requires spindle speeds above 333 rpm with closed-loop position control, the ADI4 is the wrong interface. Options are listed in the alternatives section below.

Engineering rule: Verify the maximum continuous spindle speed required by the process against n_max before committing to ADI4. For most threading, parting, and finish-turning operations on a lathe, 333 rpm is acceptable for the spindle-controlled operations but is insufficient for roughing passes on larger diameters.

SINUMERIK 802D sl vs. 840Di sl: Encoder Handling Differences

Both controllers accept the ADI4 module, but they diverge in how they assign encoder resolutions and how machine data is structured. The following table captures the functional difference:

Aspect SINUMERIK 802D sl SINUMERIK 840Di sl
ADI4 integration Integrated on the 802D sl base module (no separate PROFIBUS slave required) External ADI4 as PROFIBUS DP slave, configured via SIMATIC Step7 HW Config
Encoder resolution assignment Fixed by MD11240 $MN_PROFIBUS_ENCODER_ASSIGN (system-level MD), with a discrete list of supported ppr values Encoder resolution in Step7 HW Config is informational only; actual resolution is set in NCK machine data
Maximum encoder ppr declared in HW Config Limited to values selectable from MD11240 list (typically 2048, 4096, 8192, 16384, 32768, 65535) Limited to 65535 in Step7 HW Config input field, but not enforced
Actual NCK resolution (set in $MA_ENC_RESOL[AXn]) Constrained by MD11240 — entering 90000 is rejected or interpolated to the closest fixed value Free entry — any positive integer including 90000
Field-proven recommendation NOT suitable for 90000 ppr spindle retrofit Suitable for 90000 ppr spindle retrofit

The 802D sl limitation is documented in the DocOn CD for the controller: the PROFIdrive-to-encoder resolution assignment MD11240 is a system machine data whose valid entries are bound to specific PROFIdrive telegram types. Entering a value outside the supported list causes alarm 26017 "PROFIdrive encoder assignment invalid" or substitutes the nearest default. For non-standard pulse counts such as 90,000 ppr, the 802D sl cannot be configured to interpret the encoder correctly.

The 840Di sl, by contrast, treats the Step7 HW Config encoder resolution as documentation. The PROFIdrive stack accepts any 16-bit value in the slot configuration (cap of 65535 in the field), but the NCK reads the actual conversion factor from $MA_ENC_RESOL and $MA_ENC_PULSE_MULT. Field experience confirms that loading a STEP7 project with the resolution field set to 65535 and overriding $MA_ENC_RESOL[SP1] = 90000 in the NCK startup produces a working closed-loop spindle.

Required Machine Data for the 840Di sl ADI4 Spindle Channel

The following MD list must be set on the SINUMERIK 840Di sl side for a spindle on ADI4 channel 3 with a 90000 ppr encoder:

Machine Data Value Purpose
MD30200 $MA_NUM_ENCS[SP1] 1 Activate one encoder on the spindle
MD30220 $MA_ENC_MODULE_NR[SP1,0] 3 Logical module number of ADI4 channel (1–4)
MD30230 $MA_ENC_INPUT_NR[SP1,0] 1 Encoder input on the ADI4 (always 1 for ADI4)
MD31020 $MA_ENC_RESOL[SP1,0] 90000 Encoder pulses per revolution — free entry
MD31025 $MA_ENC_PULSE_MULT[SP1,0] 4 Quadrature multiplier for TTL A/B evaluation
MD32250 $MA_RATED_OUTVAL[SP1] 100.0 (or per drive spec) Rated output voltage percent at reference speed
MD32260 $MA_RATED_VELO[SP1] machine-dependent Rated motor speed for spindle scaling
MD36200 $MA_AX_VELO_LIMIT[SP1] 333 rpm (or below) Speed limit reflecting the 500 kHz encoder cap
MD36300 $MA_SPIND_DES_VELO_TOL 5.0 % Setpoint tolerance for spindle speed monitoring
MD36910 $MA_SPIND_MAX_VELO 333 rpm Maximum spindle speed
MD36912 $MA_SPIND_MAX_SPEED 333 rpm Hardware-related maximum speed (warning level)
PROFIdrive telegram selection: Use telegram 3 (16-bit position feedback, 32-bit speed) or telegram 4 (32-bit position feedback, 32-bit speed). Telegram 6 with DSC (Dynamic Servo Control) is generally not supported by the ADI4 and should not be selected.

Step-by-Step Configuration Procedure on 840Di sl

  1. Install the ADI4 GSD file into SIMATIC Step7 (HW Config → Options → Install GSD). Restart Step7.
  2. Add the ADI4 to the PROFIBUS DP master system. Slot 1 must contain the standard PROFIdrive PZD slot (1 word output, 1 word input minimum). Slot 2 holds the encoder configuration. Slot 4 (if present) is the second encoder.
  3. Insert one axis object for the spindle on the ADI4. Use the standard telegram type 3. Set the encoder resolution field in HW Config to any legal value — 65535 is acceptable because the NCK overrides it from $MA_ENC_RESOL.
  4. Assign the PROFIBUS node number and logical axis address matching the ADI4 channel. ADI4 channel 3 is typically axis address 5 for the spindle.
  5. Save and compile the STEP7 project. Download to the PCU/NCU of the 840Di sl.
  6. Boot the NCK. From the HMI, navigate to Commissioning → Machine Data → Axis/Spindle and enter the values listed in the table above for the spindle axis.
  7. For the X and Z axes on ADI4 channels 1 and 2, configure $MA_ENC_RESOL[AX1,0] and $MA_ENC_RESOL[AX2,0] to the actual feed axis encoder pulse counts (typically 20000 or 25000 ppr for standard servomotors).
  8. For the tool spindle on ADI4 channel 4 with no encoder, set MD30200 $MA_NUM_ENCS = 0 and set the encoder type to "not available" per the ADI4 documentation.
  9. Verify the wiring: each ADI4 encoder input is a 15-pin D-sub female connector with the standard Siemens pinout. Confirm A, A\, B, B\, N, N\ signals all twisted-pair shielded. Cable shield must be bonded at the ADI4 connector shell, not at the drive end.
  10. Issue NCK reset and verify alarm-free status (no alarm 25000, 26017, 30070, 380001).

Verification and Commissioning

After NCK boot with the MD list applied, perform the following verification sequence before any part-touching operation:

  1. Encoder direction check: Issue a small spindle command (e.g., S100 M3). Verify the actual speed reported in the axis service screen matches the sign of the commanded direction. If inverted, swap A and B wires at the ADI4 encoder connector.
  2. Position feedback check: Reference the spindle using SPOS or use the encoder zero mark (if present) and verify $AA_IM[X] (actual position) increments monotonically with rotation.
  3. Following-error check: Run a speed ramp from 0 to 333 rpm over 5 seconds. Monitor $AA_FOLLOWERR_SP[SP1] — should remain below the configured MD36400 $MA_SPIND_DES_VELO_TOL scaled value (typically 0.05 rev at 333 rpm).
  4. Frequency margin: At 333 rpm, confirm f_enc = 333 × 90000 / 15 = 1,998,000 / 15 = 199,800 Hz? No — recalculate: 90000 ppr × 333 rpm = 29,970,000 pulses per minute / 60 = 499,500 Hz. This is below 500 kHz by exactly 500 Hz. The margin is essentially zero. In practice, set MD36912 to 330 rpm for safe operation.
  5. Alarm test: Command a speed above 333 rpm (e.g., S500 M3). The system should clamp the command to MD36910 / MD36912 and report alarm 22042 "Channel %1 spindle %2 setpoint speed limited". If speed exceeds the limit without an alarm, MD36912 is not active.

Alternative Solutions When Spindle Speed Exceeds 333 rpm

If the lathe application requires higher spindle speeds with position-controlled spindle (threading, rigid tapping, oriented spindle stop), the ADI4 cannot be used. The valid alternatives are:

Solution Description Max Encoder Frequency
SINAMICS S120 with SINUMERIK 840D sl Replace analog drive with digital SINAMICS S120 drive module, encoder wired directly to SMC/SME Sensor Module 500 kHz (TTL), 1 MHz with SMx2x for high-resolution
External pulse multiplier / interpolator Mount a coarser encoder (e.g., 5000 ppr) on the spindle and use a hardware interpolator to electronically multiply ×18 to reach 90000 effective ppr — but latency and thermal drift are concerns Depends on interpolator
Resolver + resolver-to-digital converter Replace the optical encoder with a resolver (typically 1× or 2× resolution) and use a Siemens SMC resolver module Resolvers are speed-limited by their excitation frequency (typ. 200 Hz–10 kHz)
Mechanical gearbox reduction Mount the 90000 ppr encoder on a 2:1 or 3:1 reduction so the encoder sees a slower shaft; spindle speed can then be 666 rpm (2:1) or 999 rpm (3:1) without exceeding the 500 kHz cap Same 500 kHz, but shaft speed limit scales

For a retrofit where the spindle must reach 1500 rpm with closed-loop position, the only practical path is migrating the spindle drive to SINAMICS S120 (or another digital drive) and letting SINUMERIK handle the encoder on the drive side. Keeping the existing analog spindle drive in this scenario is not viable above 333 rpm with closed-loop position control.

Troubleshooting Matrix

Symptom Alarm Code Likely Root Cause Remediation
Spindle does not follow setpoint, encoder counts up but no speed 25000 "Active encoder error" Encoder type not set to TTL, or $MA_ENC_RESOL=0 Confirm encoder type in HW Config is TTL and $MA_ENC_RESOL[SP1,0] = 90000
NCK rejects $MA_ENC_RESOL = 90000 on save — Controller is 802D sl, not 840Di sl Migrate to 840Di sl platform
Following error grows proportionally to speed — Kv factor or MD32260 rated velocity mismatch Tune MD32200 $MA_SPIND_SPEEDCTRL_GAIN (P-gain) and verify MD32260 against drive nameplate
Spindle speed oscillates at low RPM (< 50) — $MA_ENC_PULSE_MULT not set to 4 (quadrature evaluation missing) Set MD31025 $MA_ENC_PULSE_MULT[SP1,0] = 4
Encoder counts correctly, speed limit alarm at low RPM 22042 Frequency limit hit prematurely; encoder wiring picks up noise doubling pulses Check shielding, terminate 120 Ω at ADI4 end, verify A\ and B\ signals are correctly crossed
ADI4 not visible in PROFIBUS diagnostics — GSD file version mismatch with ADI4 firmware Match GSD file to installed ADI4 firmware; use the GSD from Siemens Support entry 47701211
PROFIBUS intermittent faults at high axis velocities — Early ADI4 firmware with PROFIBUS stack bug Upgrade ADI4 firmware and Step7 to current version per Siemens release notes

Firmware and Version Compatibility

Siemens has released multiple firmware updates for the ADI4 (6FC5211-0BA01-0AA4 and successors). The original firmware versions had PROFIBUS stack issues that caused intermittent communication dropouts at high axis velocities. Per the manufacturer support portal for the ADI4 product family, current firmware revisions should be applied before commissioning. The GSD file used in Step7 must match the firmware version installed on the ADI4; mismatched versions will not be rejected at startup but will exhibit intermittent faults under load.

For the 840Di sl NCK software, version 2.7 SP3 or later is recommended for ADI4 integration. Earlier versions had limited support for free-entry encoder resolutions on ADI4-driven axes.

Comparison: 802D sl vs. 840Di sl for Retrofit Projects

Feature SINUMERIK 802D sl SINUMERIK 840Di sl
Display Integrated 10.4" or 8.4" TFT PCU/TCU architecture, separate panel
Programming language G-code + DIN 66025 standard cycles G-code + ShopTurn/ShopMill + high-level language
Maximum axes 5 (with ADI4 integrated) Up to 31 via PROFIBUS/PROFINET
ADI4 support Integrated, MD11240 constraints External, flexible MD
Encoder resolution freedom Restricted by MD11240 list Free via $MA_ENC_RESOL
Best fit for retrofit Low-resolution encoders, axis count < 6 Mixed encoder resolutions, complex retrofits

Engineering Notes and Field-Proven Caveats

  • When wiring the 90000 ppr spindle encoder to the ADI4, keep cable length below 25 m to stay within the 500 kHz / RS-422 signal integrity envelope. For longer runs, use Siemens pre-assembled encoder cables (6FX8002 series) with the specified 100 Ω characteristic impedance and factory-tested shielding.
  • The 802D sl MD11240 $MN_PROFIBUS_ENCODER_ASSIGN list does not include 90000 as a valid value. This is a system machine data, not an axis MD — it applies to all encoders on the PROFIBUS, including spindle and feed axes. There is no workaround by re-saving with a different value; the NCK will clamp to the nearest legal value.
  • When configuring the tool spindle on ADI4 channel 4 without an encoder, set MD30200 $MA_NUM_ENCS = 0 AND set the encoder type for that channel in HW Config to "not available". Mixing "TTL" without an encoder wired causes alarm 25000 on every NCK reset.
  • Following error monitoring on a high-resolution encoder can be set tighter than on a coarse encoder. A typical $MA_SPIND_POSCTRL_DELAY (1 ms) and $MA_SPIND_SPEEDCTRL_GAIN (Kv) of 5–10 are reasonable starting points. Run an autotune via the HMI commissioning menu after the basic wiring is verified.
  • For the analog X and Z axes, the ADI4 setpoint output is a 12-bit DAC (typically). If the existing analog drives are ±10 V with 16-bit input expectation, a one-LSB granularity of about 4.9 mV must be accepted. This is generally adequate for turning but may be noticeable on fine finishing — verify with a circularity test before production release.

What is the maximum spindle speed with 90000 ppr encoder on ADI4?

333 rpm. The ADI4 input frequency limit of 500 kHz combined with 90000 pulses per revolution yields n_max = (500000 × 60) / 90000 = 333.3 rpm. Field practice recommends limiting to 330 rpm for safety margin.

Why does the 802D sl reject encoder resolution 90000?

System machine data MD11240 $MN_PROFIBUS_ENCODER_ASSIGN on the 802D sl defines a fixed list of valid encoder pulse counts. The NCK clamps any user entry to the closest legal value. 90000 is not in the list and cannot be coerced through that MD.

Does the Step7 HW Config encoder resolution affect the 840Di sl?

No. On the 840Di sl the value entered in Step7 HW Config is informational. The NCK reads $MA_ENC_RESOL[ax,enc] and $MA_ENC_PULSE_MULT[ax,enc] to perform the actual conversion. Setting the HW Config field to 65535 is acceptable when the real value is 90000.

Can the ADI4 read sine-wave 1 Vpp encoders like Heidenhain EnDat?

No. The ADI4 encoder inputs are TTL (RS-422) only. EnDat, SSI, sin/cos 1 Vpp, and DRIVE-CLiQ encoders require SINAMICS Sensor Modules (SMC/SME) and a digital SINAMICS drive instead of the analog drive interface.

What is the recommended PROFIdrive telegram type for ADI4 spindle?

Telegram 3 (1 encoder, 16-bit position + 32-bit speed feedback). Telegram 4 (32-bit position) is also supported if the spindle requires higher position resolution for rigid tapping. Telegram 6 with DSC (Dynamic Servo Control) is not supported by ADI4.

Back to blog