SINUMERIK 840Di Spindle Oscillation Parameters for Gear Change

David Krause18 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

System Context: SINUMERIK 840Di with SIMODRIVE 611 and a 3-Stage Spindle Gearbox

The platform in question is a horizontal boring machine (HBM) controlled by a SINUMERIK 840Di CNC with a SIMODRIVE 611 drive system (modules in the 6SN1123 family). The spindle is a squirrel-cage asynchronous (induction) motor driving a 3-stage mechanical gearbox through a shift-fork and dog-clutch arrangement. The machine has run for two years; the symptom is the desired behavior of the gear-change oscillation, and the question is whether the user can adjust its setpoint.

On a 3-stage gearbox the NC must move the shift fork between discrete ratios (typically 1:1, 1:4, 1:16 or similar) so the asynchronous motor always operates inside its efficient torque envelope. The shift cannot occur at a true stop with the motor in a high-inertia state — the two halves of the dog clutch must meet at a small relative speed. That is the purpose of the spindle oscillation: a closed-loop, low-amplitude, alternating rotation profile commanded by the NC and executed by the SIMODRIVE 611.

The 840Di inherits the full SINUMERIK 840D machine data set. All oscillation-related machine data, all PLC interface bits, and all alarm behavior are identical to a 840D on the same NCK release. The two relevant questions for service are therefore: (1) is the oscillation commanded by the PLC or by the NC, and (2) if by the NC, which machine data values determine the speed, the acceleration, the start direction, and the dwell times.

Mechanical Background: Why a Spindle Must Oscillate During a Gear Change

Positive-engagement dog clutches require a non-zero relative velocity between the two halves at the moment of contact. If the contact velocity is too low, the dog teeth rest on the ramp surface and the shift fork stalls, producing an NC alarm 2200 "Spindle speed not in setpoint range" or alarm 2201 "Gear stage not reached". If the contact velocity is too high, the dog teeth bounce off each other and the shift never completes, also producing alarm 2200 with a long PLC watchdog timeout.

The physical argument is the same as the one used in continuous spindle-speed-modulation (SSM) research for chatter suppression — a small, controlled relative velocity at the meshing interface produces a smooth, repeatable engagement. See Spindle speed variation in turning: Technological effectiveness and applicability to real industrial cases for the broader analysis. The takeaway for service: oscillation speed must be high enough to climb the dog-clutch ramp, low enough not to bounce, and the acceleration between directions must stay inside the SIMODRIVE 611 current limit.

Field-proven envelope on a 3-stage HBM gearbox:

  • Oscillation speed: 8 to 25 rpm
  • Oscillation acceleration: 0.5 to 2.0 rev/s²
  • Dwell per direction: 0.4 to 1.5 s
  • Total cycle (CW ramp + CW dwell + CCW ramp + CCW dwell): 1.5 to 3.0 s
  • Cycles required to engage: 1 to 8, depending on dog-clutch wear

PLC Interface: DB17 Signals and the Oscillation Handshake

The oscillation is requested by the PLC, not by the NC. On a 840D / 840Di the PLC interface to the spindle is in DB17 of the PLC user program (the standard toolbox places the spindle interface at DB17.DBX17). Two bits are decisive for the oscillation profile:

Signal Name Effect when TRUE
DB17.DBX17.5 Request spindle oscillation NC evaluates MD35400..MD35450 and runs the alternating speed profile. The spindle speed setpoint is replaced by the oscillation profile.
DB17.DBX17.4 PLC supplies oscillation time NC reads the CW/CCW dwell from the PLC interface words (typically 32-bit float, seconds) instead of MD35440 / MD35450. Used when the PLC wants to vary the timing by gear stage or temperature.

The full gear-change handshake proceeds in six steps:

  1. The PLC decodes the gear change request — either from M40..M45 in the part program or from a programmed spindle speed outside the active stage's speed window (MD35100 $MA_SPIND_GEAR_STEP_SPEED_FROM / MD35110 / MD35120).
  2. The PLC drops the spindle enable / speed setpoint so the NC ramps to zero using the normal spindle ramp (MD35200 $MA_SPIND_SPEED_RAMP, in older releases MD35210).
  3. Once |n_act| falls below MD36020 $MA_SPIND_STOPPED_THRESHOLD, the NC enters the WAIT_ZERO state.
  4. The PLC asserts DB17.DBX17.5 = 1 to request oscillation. The NC reads MD35400 (oscillation speed) and either MD35440/MD35450 or the PLC timing words, and starts the alternating profile on the SIMODRIVE 611.
  5. The PLC monitors the gear-stage position switches wired to the spindle gearbox. When the new stage is confirmed (debounced digital inputs routed back into the NC), the PLC drops DB17.DBX17.5 = 0.
  6. The NC resumes normal speed control using the new gear data record. The PLC releases the gear-change interlock and the part program continues.

Two commissioning pitfalls are bound up in this interface and are worth flagging up front:

  • If DB17.DBX17.5 is never set by the PLC, gear change will stall — the spindle goes to zero and the NC eventually raises alarm 2200 waiting for oscillation to begin.
  • If DB17.DBX17.4 is high but the PLC never writes the timing words, the NC will run the oscillation using the last value the PLC wrote (typically 0.0 s), which causes the oscillation to chatter at very short dwell and the gear to fail to engage.
Note: The exact location of the spindle handshake bits differs slightly between toolbox versions and between the 840D and 840Di PLC toolboxes. Confirm against the active PLC project's cross-reference. The MD list is identical to the 840D on the same NCK release.

Machine Data Parameter Reference (the MD35400 Series)

Five axis-specific machine data parameterize the oscillation profile. The $MA_ prefix means they belong to the spindle axis (axis 1 in a single-spindle HBM, or the spindle axis index in a multi-spindle channel). All values are loaded from the NCK at power-on and on reset / NEW_CONF.

MD number Identifier Units Typical default Function
MD35400 $MA_SPIND_OSCILL_SPEED_CNTL Oscillation speed rpm 0 Magnitude of spindle speed during oscillation. Effective when the PLC does not override.
MD35410 $MA_SPIND_OSCILL_ACCEL Oscillation acceleration rev/s² 1.0 Slope of the speed ramp between CW and CCW plateaus. Limits current demand on the 611.
MD35430 $MA_SPIND_OSCILL_START_DIR Start direction 3 = CW, 4 = CCW 3 (CW) First leg of the oscillation profile. Mechanical, not electrical.
MD35440 $MA_SPIND_OSCILL_TIME_CW Time CW s 1.0 Dwell at the CW speed plateau. Read by the NC when DB17.DBX17.4 = 0.
MD35450 $MA_SPIND_OSCILL_TIME_CCW Time CCW s 1.0 Dwell at the CCW speed plateau. Read by the NC when DB17.DBX17.4 = 0.

On older NCK releases the speed field is named $MA_SPIND_OSCILL_SPEED; on newer releases it is $MA_SPIND_OSCILL_SPEED_CNTL. Both refer to MD35400 — treat them as synonyms. The field is stored as a 32-bit float in the same unit system as the spindle speed setpoint (typically rpm, configurable per axis).

For the official parameter description, see the SINUMERIK 840D sl / 840Di List Manual (parameter manual) under the spindle axis section. The List Manual is published on the Siemens Industry Online Support portal at support.industry.siemens.com and is the authoritative source for the parameter set on the active NCK release.

Parameter-by-Parameter Function, Ranges, and Field Notes

MD35400 $MA_SPIND_OSCILL_SPEED_CNTL — Oscillation speed

Sets the absolute speed used in both directions. The field-proven range on a 3-stage HBM gearbox is 8 to 25 rpm. Below roughly 5 rpm the dog clutch does not have enough relative motion to overcome spring detent; above roughly 30 rpm the dog teeth tend to bounce and not engage. Always change this parameter in small steps (2 rpm at a time) and verify each step in M40 → M41, M41 → M42, and M42 → M43 transitions.

The value is bounded above by the safe ceiling for the spindle axis; if the configured value is above the ceiling the NC clamps to the ceiling and writes a warning to the NCK diagnostic log. The 611 itself does not impose a separate oscillation speed limit beyond its torque limit on the low-speed current controller.

MD35410 $MA_SPIND_OSCILL_ACCEL — Oscillation acceleration

Defines the slope of the speed ramp between the CW plateau and the CCW plateau. The 611 drive computes the torque demand from this value: T = J · α, where J is the rotating inertia reflected to the motor and α is the angular acceleration. Too high a value trips I²R current on the 6SN1123 module (fault F006 "Overcurrent"); too low a value makes the cycle too long, the gearbox springs bottom out, and the shift fails.

Field rule of thumb: α (rev/s²) ≤ (I_peak_drive / J_motor) · (1 / (2π)) with a 30% safety margin. For a 22 kW asynchronous spindle with J ≈ 0.05 kg·m² and I_peak ≈ 50 A, the bound is roughly α ≤ 159 rev/s². The factory default of 1.0 rev/s² is conservative; commissioning normally lands in the 0.5 to 2.0 range.

Check the 611 drive parameters p1105 (torque limit), p1107 (current limit), and p1108 (peak current limit) in the SIMODRIVE 611 commissioning tool before raising MD35410.

MD35430 $MA_SPIND_OSCILL_START_DIR — Start direction

Selects the first leg of the oscillation profile. The choice is mechanical, not electrical. Some 3-stage gearboxes (particularly those with right-angle drives) engage more reliably starting CCW because of the shift fork ramp angle. On the HBM in question, MD35430 = 3 (CW) is the factory default and is correct for the OEM shift fork geometry — do not change it without consulting the mechanical drawing.

MD35440 $MA_SPIND_OSCILL_TIME_CW and MD35450 $MA_SPIND_OSCILL_TIME_CCW

Define the dwell at the speed plateau. The total time for one full cycle is approximately T_CW + T_CCW + (2 · speed / accel). On a tuned HBM the total cycle is 1.5 to 2.5 s. Setting the dwell to 0 disables that leg of the profile; if both are 0 the NC reports alarm 2200 immediately because the oscillation never satisfies the "speed in setpoint range" check.

If the PLC asserts DB17.DBX17.4, the NC takes the timing from the PLC words (32-bit float, seconds) and ignores MD35440 / MD35450. This is the normal mode when the PLC wants to vary the oscillation based on gearbox temperature, wear, or the specific stage being requested.

Oscillation Sequence and State Machine

Putting the parameters together with the PLC handshake produces the following state machine on the spindle axis during an M40..M45 gear change:

  1. IDLE — spindle at programmed speed in current gear stage. DB17.DBX17.5 = 0.
  2. SPEED_TO_ZERO — NC ramps spindle to 0 rpm using the normal spindle ramp (MD35200 $MA_SPIND_SPEED_RAMP). DB17.DBX17.5 = 0.
  3. WAIT_ZERO — NC waits for |n_act| < MD36020 $MA_SPIND_STOPPED_THRESHOLD. When the condition is met the NC prepares to enter the oscillation profile.
  4. OSCILLATION — DB17.DBX17.5 = 1. The 611 executes the alternating speed profile. The PLC monitors the gear-stage position switches and counts the cycles.
  5. ENGAGED — once the PLC confirms the new gear stage, DB17.DBX17.5 = 0. The NC returns to normal speed control with the new gear data record active.
  6. RESUME — the NC ramps the spindle to the programmed speed using the new stage's max speed and torque limits. The PLC releases the gear-change interlock.
IDLE SPEED_TO_ZERO WAIT_ZERO OSCILLATION MD35400 / MD35410 / MD35440/50 ENGAGED RESUME M40-M45 n≈0 |n_act| PLC confirms stage DB17.DBX17.5=0 new program block

SIMODRIVE 611 Drive-Side Considerations

The 611 receives the speed setpoint from the NCK and the torque / current limit from the active gear data record. Three drive parameters interact directly with the oscillation profile:

  • p1105 (torque limit): clamped to the active gear data record during the entire oscillation phase. The active record's torque limit is computed from the gearbox stage and the motor's continuous torque.
  • p1107 (current limit): the 611's continuous current limit, derived from the motor nameplate and the module's rated current. MD35410 must be consistent with this — high acceleration with low current limit produces a sluggish, incomplete reversal.
  • p1108 (peak current limit): the short-duration current limit, typically 1.5 to 2.0 × continuous. The peak current limit is what protects the IGBT modules during the direction reversal transient.

For the SIMODRIVE 611 family, the relevant drive faults during oscillation are F006 (overcurrent, IGBT desaturation), F007 (overspeed), F008 (encoder fault), and F011 (motor overload I²t). A misconfigured MD35410 typically raises F006 on the first direction reversal; a misconfigured MD35400 with a worn encoder typically raises F008 because the actual speed does not match the setpoint.

M40–M45 Gear Stage Programming and Adjacent Controllers

Auto gear change uses the M40..M45 group. M40 = automatic stage selection by the NC; M41..M45 = explicit request of stages 1..5. Each stage has a separate gear data record in the spindle's axis machine data. The records specify the per-stage max speed, min speed, acceleration, and torque limit, and they tell the NC when to switch stages and which record to activate when it does.

For OEMs that deploy a non-Siemens controller with the same M40..M45 contract (for example a Beckhoff TF5200 retrofit), the M-function contract is identical: Beckhoff TF5200 — Spindle gear change (M40 - M45) documents a separate gear data record parameterised for each gear stage and reused for each of up to six stages. Although the parameter numbers differ, the functional contract (per-stage max/min speed, position-controlled switch-in, oscillation profile) is the same as on the 840Di. This is useful when migrating an HBM from a legacy 840Di to a modern controller, because the mechanical design and the M-code semantics do not need to change.

On the 840Di the per-stage records live in MD35100..MD35150 plus MD35090 $MA_NUM_GEAR_STEPS (defining how many of the six records are populated). The M40..M45 command group is enabled by MD35010 $MA_GEAR_STEP_CHANGE_ENABLE = 1 and MD35020 $MA_GEAR_STEP_USED_IN_AXIS = current stage.

Tuning Procedure Step-by-Step

Prerequisites

  • Operator password or service access to MD35400..MD35450.
  • PG or HMI connected to the 840Di (SINUMERIK HMI Advanced or HMI Operate).
  • PLC project with the spindle interface visible in the cross-reference (DB17.DBX17.4, DB17.DBX17.5, and the timing words if DB17.DBX17.4 is high).
  • SIMODRIVE 611 6SN1123 module healthy: no F006, F007, F008, or F011 faults; motor encoder working; current controller tuned.
  • Mechanical: shift fork free, dog clutch lubricated, gear-stage position switches wired and debounced.

Step-by-step procedure

  1. Switch the HBM to JOG. Open the spindle axis MD display on the HMI.
  2. Read and record the current values of MD35400, MD35410, MD35430, MD35440, MD35450. Typical factory defaults for a 22 kW asynchronous spindle are 0 / 1.0 / 3 / 1.0 / 1.0.
  3. Set MD35410 = 0.5 rev/s² as a safe starting acceleration. This guarantees the 611 does not enter current limit on a healthy gearbox.
  4. Set MD35440 = MD35450 = 0.6 s as starting dwells.
  5. Set MD35430 to the OEM-specified start direction (3 = CW for the HBM in question). Do not change without consulting the mechanical drawing.
  6. Set MD35400 to 10 rpm.
  7. NCK reset (the RESET softkey on HMI) and let the NC come back to OPERATE.
  8. Run a controlled M41 from M40 in MDI; observe the spindle on the HMI's axis/spindle trace. The 840Di spindle trace records the speed setpoint vs actual and marks the M-function time.
  9. Confirm visually and acoustically that one oscillation cycle (one full CW + CCW) results in the gear stage engaging. If not, raise MD35400 in 2 rpm steps up to 25 rpm.
  10. Repeat for the M42 and M43 transitions; on a 3-stage gearbox all three transitions (1↔2, 2↔3, 1↔3) should be tested.
  11. Once the gear changes are clean, run a 30-minute production test with the full part program; record any 2200, 2201, 61219, or 25050 alarms.
  12. If the oscillation feels too aggressive (current spikes on the 611), reduce MD35410 by 0.1 rev/s² and re-test.
  13. Save the working set to the CF card and to the PLC project as a new backup.
Warning: Always test new MD values in MDI with the spindle guard closed and an operator at the emergency stop. A misconfigured oscillation profile can drive the dog clutch at excessive speed, damaging the gearbox and triggering SIMODRIVE 611 overcurrent faults.

Verification and Commissioning Tests

After each parameter change, verify on the spindle trace that:

  • The speed setpoint reaches MD35400 magnitude in both directions and holds for MD35440 / MD35450 seconds.
  • The acceleration between plateaus matches MD35410 / 60 (rev/s² converted to rpm/s).
  • The actual speed tracks the setpoint within the current loop bandwidth. If the 611 reports F006 (overcurrent) the acceleration is too high.
  • The PLC gear-stage feedback bit transitions from "old stage" to "new stage" within 5 to 8 oscillation cycles. If not, the dog clutch is not engaging and the speed or dwell must be raised.
  • No alarm 2200, 2201, 61219, or 25050 is raised during the test. Alarm 25050 "Axis %1 contour monitoring" can be raised if the oscillation acceleration is too high for the configured contour tolerance.

A repeatable sign-off procedure for an HBM with a 3-stage gearbox:

  1. MDI: M41 S100 — engage stage 1 at 100 rpm.
  2. MDI: M42 S800 — auto stage change to stage 2 at 800 rpm.
  3. MDI: M43 S3000 — auto stage change to stage 3 at 3000 rpm.
  4. MDI: M40 S2000 — auto stage change back to stage 1 (or whatever stage the NC picks for 2000 rpm).
  5. Repeat 5 times; record cycle time and any alarm.

Acceptance criterion: all 5 cycles complete without alarm 2200, 2201, or 61219, and the recorded cycle time is within ±15% of the value measured at the original factory acceptance test.

Safety, Monitoring, and Protection Limits

The oscillation profile must respect several cross-axis limits:

  • Contour monitoring (MD36400 $MA_CONTOUR_TOL): the oscillation's rapid speed reversals can trip the contour monitor. If so, raise the contour tolerance by 10% for the spindle axis only, or accept a slower acceleration.
  • Current limit (SIMODRIVE 611): the 611's peak current (p1108 in the drive database) limits the achievable MD35410. Verify with the SIMODRIVE 611 commissioning tool.
  • Spindle zero speed threshold (MD36020 $MA_SPIND_STOPPED_THRESHOLD): the NC will not enter the WAIT_ZERO state above this threshold. A stuck-at-low oscillation that never reaches zero can therefore loop forever in WAIT_ZERO if the threshold is too tight.
  • PLC timeout: most PLC programs watch the gear-stage feedback with a 10 to 30 s timer. If the oscillation is too slow (MD35410 too low, MD35440/50 too high), the PLC raises a custom gear-change alarm before the NC can complete the cycle.
Safety: The spindle oscillation parameter block lives in the axis machine data, not the safety-integrated (SPL / SINUMERIK Safety Integrated) parameters. It does not affect safe stop, safe speed, or safe direction. The SIMODRIVE 611 must be brought to safe stop (terminals 663 / NS1 / NS2 on the 6SN1123 module) before any mechanical work on the gearbox.

Troubleshooting Matrix

Symptom Likely cause First check Fix
Spindle does not oscillate on M41/M42/M43 PLC never sets DB17.DBX17.5 Cross-reference DB17.DBX17.5 in the PLC; verify the bit is set after M40 decode Repair PLC logic; the NC parameters are irrelevant until the bit is set
Oscillates very fast, grinding noise MD35400 too high, or MD35410 too high Trace the speed setpoint vs actual on the HMI Reduce MD35400 in 2 rpm steps; reduce MD35410 in 0.1 rev/s² steps
Gear stage does not engage (no alarm) MD35440 / MD35450 too short, or PLC overrides with 0 Check DB17.DBX17.4 and the PLC timing words Raise the dwells, or fix the PLC timing source
Alarm 2200 "Spindle speed not in setpoint range" after a few cycles Speed not reaching MD35400 due to current limit, or MD36020 too tight Check the 611 current trace Lower MD35410, raise MD35400, or re-tune the 611 current controller
Alarm 61219 "Drive fault, axis %1" during gear change 611 overcurrent during the speed reversal 611 diagnostic buffer (F006 / F007) Reduce MD35410; increase MD35440 / MD35450 (longer dwells, less reversing)
Alarm 25050 contour monitoring Contour tolerance too tight for the reversal MD36400 contour tolerance Raise MD36400 by 10%, or accept lower MD35410
Cycle time too long (PLC gear-change timeout) MD35440 / MD35450 too long PLC timer value Reduce the dwells to 0.4 s
Oscillation runs but reverses direction mid-shift (gearbox wear) Worn dog clutch, insufficient detent Mechanical inspection Mechanical repair; the parameter set can mask but not fix wear

Adjacent Parameters Worth Knowing

When chasing oscillation faults, the following MDs are commonly in scope:

  • MD35010 $MA_GEAR_STEP_CHANGE_ENABLE — per-axis enable of the gear stage change (must be 1 for the spindle to shift).
  • MD35020 $MA_GEAR_STEP_USED_IN_AXIS — which of the configured gear stages is currently active in the axis.
  • MD35090 $MA_NUM_GEAR_STEPS — number of configured gear stages (1 to 5 on 840Di; up to 6 on 840D sl).
  • MD35100 / MD35110 / MD35120 $MA_SPIND_GEAR_STEP_SPEED_FROM / _MIN / _MAX — speed windows that determine when auto gear change fires and which stage is selected.
  • MD35200 $MA_SPIND_SPEED_RAMP — the ramp used outside oscillation when the spindle is moving between two non-zero speeds.
  • MD36020 $MA_SPIND_STOPPED_THRESHOLD — the threshold for the WAIT_ZERO state.
  • MD36400 $MA_CONTOUR_TOL — contour tolerance for the spindle axis.

Always consult the version of the List Manual that matches the NCK software release running on the 840Di; older 840Di NCK releases split the oscillation profile across different MDs than current 840D sl releases, and the field naming ($MA_SPIND_OSCILL_SPEED vs $MA_SPIND_OSCILL_SPEED_CNTL) was harmonised in the 840D sl era.

FAQ

Which machine data controls the spindle oscillation speed on a SINUMERIK 840Di?

MD35400 $MA_SPIND_OSCILL_SPEED_CNTL (named $MA_SPIND_OSCILL_SPEED on older NCK releases) sets the magnitude of the oscillation speed in rpm. It is only active when the PLC asserts DB17.DBX17.5 to request oscillation. Typical values on a 3-stage HBM gearbox are 8 to 25 rpm.

Can the commissioning engineer change the gear-change oscillation speed?

Yes. MD35400, MD35410, MD35430, MD35440, and MD35450 are accessible with the service password. Changes take effect after NCK reset. If the PLC asserts DB17.DBX17.4, the NC takes the oscillation timing from the PLC instead of MD35440 / MD35450 — the PLC program is the more flexible source if the timing needs to vary by gear stage or temperature.

What alarms indicate a misconfigured spindle oscillation profile?

The most common are NC alarm 2200 "Spindle speed not in setpoint range", alarm 2201 "Gear stage not reached", alarm 61219 "Drive fault on axis" (often from SIMODRIVE 611 F006 overcurrent), and alarm 25050 "Axis contour monitoring". A PLC-level gear-change timeout alarm is also common if the cycle is too slow.

Does the spindle oscillation parameter set differ between 840D and 840Di?

No. The 840Di reuses the 840D machine data set. The same MD35400..MD35450 series applies. The PLC interface (DB17 spindle area) is also identical. Only the firmware naming in some 840D sl releases differs ($MA_SPIND_OSCILL_SPEED vs $MA_SPIND_OSCILL_SPEED_CNTL); both refer to MD35400.

How do I know whether the oscillation is driven by NC parameters or by the PLC?

Cross-reference DB17.DBX17.5 in the active PLC project. If the PLC sets this bit, the NC reads MD35400..MD35450 and runs the profile. If the PLC never sets it, the spindle will go to zero on a gear-change request and the NC will eventually raise alarm 2200. If DB17.DBX17.4 is also set, the timing comes from the PLC and MD35440 / MD35450 are bypassed.

Back to blog