Siemens 840D sl U/W Axis Setpoint Exchange Configuration Guide

David Krause18 min read
Application NoteMotion ControlSiemens
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

Siemens 840D sl U/W Axis Setpoint Exchange for a Shared Servo Motor

On a horizontal borer retrofit, seven NC axes (X, Y, Z, V, B, U, W) plus a spindle (SP) are driven from a single Sinumerik 840D sl controller. U and W are mechanically independent slides (each with its own external feedback encoder) but they share one servo motor through a clutch mechanism: when the clutch is engaged to the U side, the motor drives U; when engaged to the W side, the motor drives W. Only one of the two axes can be torque-producing at any instant, yet both must be visible on the HMI and both must be programmable.

The Siemens mechanism that satisfies this requirement is the NCK Setpoint Exchange function, documented in the Special Functions (S9) section of the DOCON CD / Programming and Operating Manual for 840D sl. The same end-result can be obtained with the newer Container Axes feature on SW 4.7 SP2 and later, but on a typical retrofit with an existing basic PLC program the classic S9 setpoint exchange remains the most common and most portable solution.

This reference covers the NC configuration, PLC interface, clutch sequencing, HMI display of both axes, and the verification steps required to bring the U/W pair up on a 840D sl retrofit.

1. Application Topology

The hardware topology for the U/W pair is shown below. Both axes feed back to the NCK through separate encoder modules; only one of the two axes is logically "active" on the drive side at a time.

840D sl NCK + PLC NC axis U (AX5) $MA_CTRLOUT_MODULE_NR NC axis W (AX6) $MA_CTRLOUT_MODULE_NR Servo Motor (1FN / 1FK) Single drive, shared stator U slide + Ext. encoder Clutch U / W selector W slide + Ext. encoder

The dashed arrows from the W axis and from the W slide represent the inactive state: the setpoint exchange logic in the NCK only routes the velocity command and controller enable to the drive for the active axis, while the inactive axis remains in follow-up mode and continues to display its position from its own external encoder.

2. Functional Concept of Setpoint Exchange

Setpoint exchange does not multiplex the drive at hardware level. Inside the NCK, two distinct axis objects exist (AX5 = U, AX6 = W). Only one of them is bound to the drive's setpoint slot at any moment; the other is parked. The PLC triggers the switchover through the axis-VDI interface, and the NCK then performs an orderly hand-off:

  1. Controller enable of the outgoing axis is revoked (DB31..DBX2.1 falls).
  2. Pulse enable of the outgoing axis is revoked (DB31..DBX21.7 falls).
  3. Position feedback of the outgoing axis is frozen in follow-up mode.
  4. The drive's setpoint and enable lines are reassigned to the incoming axis.
  5. The incoming axis is brought to its current actual position, controller enable is granted, and pulses are enabled.
  6. The exchange-complete status bit is set in the VDI of the incoming axis.

The clutch itself is a mechanical device outside the NCK. The PLC must engage the clutch to the new side before requesting the setpoint exchange, and confirm engagement through a position-proximity or pressure-switch feedback before releasing the old axis. Allowing the NCK to drive through an unselected gear would produce a position lag and a 25050 (axis contour monitoring) alarm within a few milliseconds.

Field note: Treat the clutch engagement and the NCK setpoint exchange as a single atomic operation. The PLC must hold both sides of the exchange in a defined interlock so a second exchange cannot be requested before the first completes. Use a state machine, not two independent bits.

3. Prerequisites

  • Option bit: Setpoint exchange requires the Special Functions option to be enabled on the CF card. Verify with MD11500 $MN_PREP_TASK_CODE and the option screen under Commissioning > Options in Sinumerik Operate. The option string usually reads Setpoint exchange / additional axis or appears under the S9 family.
  • Drive slot: One drive on the DRIVE-CLiQ bus (e.g. SINAMICS S120 with one Motor Module and one SMC/SME for the motor encoder, plus two additional encoder modules for the U and W external encoders).
  • Topology: The motor must remain visible to the drive, while the two encoders appear as separate encoder objects so each NC axis can bind to its own actual value.
  • PLC program: The basic PLC program (840D sl base PLC, FB1/FB2/FC100 family) must include the setpoint exchange handling block. On SW 4.5 and later, the block is part of the standard template and only the application-specific state machine needs to be added.
  • Safety: If the machine has a Safety Integrated (SPL) configuration, the U/W pair must be modelled as a single drive for the safe stop path (SS1/STO). The two mechanical axes cannot have independent safe stop signals; the shared drive dictates a shared STO.

4. NC Configuration: Machine Data

The U/W pair is set up as two fully-fledged NC axes. The single drive is referenced by both axes' setpoint machine data. The actual-value machine data is unique per axis because each axis has its own external encoder.

4.1 Channel and axis assignment

MD Name Value (example) Comment
MD10000[0..7] $MN_AXCONF_MACHAX_NAME_TAB "X1","Y1","Z1","V1","B1","U1","W1","SP1" Machine axis names
MD20070[0..6] $MC_AXCONF_MACHAX_USED 1,2,3,4,5,6,7 Channel uses axes 1..7
MD20080[0..6] $MC_AXCONF_CHANAX_NAME_TAB "X","Y","Z","V","B","U","W" Channel axis names
MD20150[5] $MC_GCODE_DEFAULT[5] ... Default G code for U channel axis

4.2 Axis-specific setpoint and actual-value data

MD Name U axis (AX5) W axis (AX6) Comment
MD30110 $MA_CTRLOUT_MODULE_NR 5 5 Same drive number; NCK performs the exchange
MD30130 $MA_CTRLOUT_TYPE 1 1 1 = analog/HSI via PROFIdrive, 0 = simulation
MD30220 $MA_ENC_MODULE_NR[0] 6 7 Separate encoder modules for U and W
MD30240 $MA_ENC_TYPE[0] 1 1 Incremental encoder
MD31020 $MA_ENC_RESOL per encoder per encoder Lines per motor/encoder revolution
MD32200 $MA_POSCTRL_GAIN per axis per axis Kv for each axis
MD32000 $MA_MAX_AX_VELO per axis per axis Different limits typical for U vs W
MD32300 $MA_MAX_AX_ACCEL per axis per axis Acceleration limit
MD36200 $MA_AX_VELO_LIMIT per axis per axis Software limit on velocity
MD36010 $MA_STOP_LIMIT_FINE per axis per axis Exact-stop fine
MD36020 $MA_POSITIONING_TIME per axis per axis Positioning dwell
Critical: MD30110 $MA_CTRLOUT_MODULE_NR is the same for both U and W. This is the heart of the setpoint exchange concept. If both MDs are not identical, the NCK will not perform the exchange and instead the second axis will be parked with alarm 20050 Axis %1 is not assigned to a drive.

4.3 Setpoint-exchange enabling bits

MD Name Value Comment
MD11500 $MN_PREP_TASK_CODE Setpoint exchange enable ... Per-axis enabling in the option code
MD20140 $MC_RESET_MODE_MASK Reset behaviour 0x4001 Keep controller enable through reset for the parked axis
MD20150 $MC_GCODE_DEFAULT Default G codes ... Same across the pair to keep NC programs portable

5. PLC Configuration: VDI Interface and Setpoint Exchange

Each NC axis has a 32-byte VDI image in DB31.. (DB31 = axis 1, DB32 = axis 2, ... DB36 = axis 6 = W, DB37 = axis 7 = spindle, etc. The exact DB number is set by MD13050 $MN_AXIS_EXTENSION_VDI or by the basic PLC program's axis mapping).

5.1 VDI bits used by the setpoint exchange

DB / Byte.Bit Direction Name Used for
DB31/DBB0 NCK → PLC Axis status word Read back
DB31/DBX2.1 PLC → NCK Controller enable Drives the active axis
DB31/DBX21.7 PLC → NCK Pulse enable Drives the active axis
DB31/DBX68.0 NCK → PLC Setpoint exchange request from NCK (option) Optional for NC-driven exchange
DB31/DBB68 PLC → NCK Axis exchange commands Bit 0/1 trigger the exchange
DB31/DBB69 NCK → PLC Axis exchange status Bit 0/1 acknowledge

On the basic PLC template (FB2/FC100 family), the setpoint exchange is implemented as a small ladder block that coordinates the clutch outputs and the VDI bits. The application only needs to call the FB and pass the desired axis identity.

5.2 Structured-text state machine for the clutch + exchange

The pattern below is typical for an 840D sl retrofit using SCL in the basic PLC. It assumes a single output ClutchCmdU (true = engage clutch to U) and a single feedback ClutchAtU from a pressure switch or proximity sensor.

// U/W setpoint exchange state machine
CASE iState OF
  0:  // Idle - no axis active
      ClutchCmdU := FALSE; ClutchCmdW := FALSE;
      AxisU_Enable := FALSE; AxisW_Enable := FALSE;
      IF bSelectU OR bSelectW THEN
          IF bSelectU THEN iState := 10; ELSE iState := 20; END_IF;
      END_IF;

 10:  // Engage clutch to U
      ClutchCmdU := TRUE; ClutchCmdW := FALSE;
      AxisU_Enable := FALSE; AxisW_Enable := FALSE;
      IF ClutchAtU AND NOT ClutchAtW THEN iState := 11; END_IF;

 11:  // Grant controller + pulse enable to U
      AxisU_Enable := TRUE;  // DB31 / axis U / DBB2 = controller enable
      AxisU_Pulse  := TRUE;  // DB31 / axis U / DBB21 = pulse enable
      AxisW_Enable := FALSE; AxisW_Pulse := FALSE;
      IF bSelectW AND NOT bSelectU THEN iState := 12; END_IF;

 12:  // Switch from U to W
      AxisU_Enable := FALSE; AxisU_Pulse := FALSE;
      // wait for NCK to release the active axis; status bit DB31.DBB69.0
      IF NOT AxisU_Active THEN iState := 20; END_IF;

 20:  // Engage clutch to W
      ClutchCmdU := FALSE; ClutchCmdW := TRUE;
      AxisU_Enable := FALSE; AxisW_Enable := FALSE;
      IF ClutchAtW AND NOT ClutchAtU THEN iState := 21; END_IF;

 21:  // Grant enable to W
      AxisU_Enable := FALSE; AxisU_Pulse := FALSE;
      AxisW_Enable := TRUE; AxisW_Pulse := TRUE;
      IF bSelectU AND NOT bSelectW THEN iState := 22; END_IF;

 22:  // Switch from W to U
      AxisW_Enable := FALSE; AxisW_Pulse := FALSE;
      IF NOT AxisW_Active THEN iState := 10; END_IF;

END_CASE;
Field note: Use the exclusive OR pattern on the selector (bSelectU XOR bSelectW) and require both states to agree with the clutch feedback for at least one PLC cycle before advancing. This eliminates a 1-cycle race that produces an immediate 25050 contour-monitoring alarm on the first swap.

6. HMI Display of Both U and W Axes

The Sinumerik Operate HMI displays all NC axes defined in the channel. The parked axis shows its actual position (from its own external encoder) but its setpoint is frozen; the controller enable and pulse enable indicators are off. This satisfies the requirement to "display U and W separately on the monitor".

6.1 What the operator sees

Axis Position actual Position setpoint Controller enable Pulse enable Follow-up mode
U (active) Live Live On On Off
W (parked) Live (from W encoder) Frozen at last setpoint Off Off On

6.2 HMI configuration

  • Axis name in the channel axis list is taken from MD20080 $MC_AXCONF_CHANAX_NAME_TAB; both U and W appear in the axis list because both are referenced in MD20070 $MC_AXCONF_MACHAX_USED.
  • Operator can press the axis-select key on the HMI to switch the axis-view focus between U and W. The setpoint exchange is then driven by the PLC state machine, not by the HMI key.
  • To add an additional user-defined axis indicator (e.g. "U active" lamp), bind an HMI variable to a flag set inside the state machine above.
  • If a custom soft-key or extended display is required, use the standard Operate configuration in sl > config > operator panel and add the U/W indicator under Diagnostics > Axis.

7. NC Part-Program Behaviour

From the NC program perspective, both U and W are normal channel axes. The setpoint exchange is invisible to the part program as long as the PLC has the correct axis active. The NCK automatically stops in the same block if the desired axis is not the active one and the setpoint exchange is part of the channel reset sequence.

Typical pattern (DIN/ISO):

; Bore with U axis (cross-slide in)
G1 G94 F200 U50.0
G0 U0

; ... wait for PLC to switch to W axis ...
M61          ; user-defined M-code: "select W axis, engage clutch, wait for ready"

; Bore with W axis (outboard slide)
G1 G94 F200 W40.0
G0 W0
M62          ; user-defined M-code: "switch back to U axis"

The M-codes M61 and M62 in this example are user-defined; they call the PLC state machine above via the basic PLC M-code decoder (default mapping in DB250 / DB251). On completion, the NC program continues only after the M-code acknowledge is returned, which the state machine should hold off until the new axis is fully released and the new axis is active.

Caution: Never call a motion command on W while U is still active. The PLC must hold off the M-code acknowledge until the setpoint exchange is complete, otherwise the NCK will try to feed the W axis with the drive still assigned to U, which trips 25050 immediately.

8. Safety Considerations

  • Both U and W are tied to the same Motor Module from a Safety Integrated (SI) perspective. The STO/SS1 path is shared; the safe brake management must be modelled accordingly.
  • The clutch feedback must be hard-wired to a safety-relevant input if a category-1 stop is required. A drifting clutch under STO is unacceptable: the parked axis could become mechanically loaded while the drive is de-energised.
  • The PLC must interlock the M-codes that drive the U/W swap with the active safety stop. If SS1 is active, the swap must be blocked.
  • External encoders on both axes should be monitored for plausibility against the motor encoder. A divergence beyond a configurable threshold indicates a clutch that failed to engage fully.

9. Commissioning Procedure

  1. Drive and encoder topology. In Sinumerik Commissioning Tool / Startdrive, confirm that one drive and two encoder objects are present, and that the U and W encoders are physically distinct modules.
  2. NC machine data. Set MD10000, MD20070, MD20080 to include U and W; set MD30110 to the same drive number for both; set MD30220 to the two distinct encoder module numbers.
  3. Option enable. Verify the setpoint exchange option is enabled under Commissioning > Options. Without the option, the NCK ignores the duplicated MD30110 and the second axis becomes a simulation axis.
  4. PLC state machine. Implement the state machine above; load and download the PLC project; bring the controller up in PLC stop first and observe the state transitions in the watch table.
  5. Dry test (no NC motion). Manually request a U-to-W exchange from the watch table; verify the VDI status bits flip, the clutch feedback matches, and both axes display their actual positions correctly.
  6. Motion test. Run a small part program that moves U, exchanges, moves W, and exchanges back. Monitor the contour deviation in the axis service screen; a healthy exchange shows < 2 mm transient on the parked axis (no real motion, but the setpoint freeze transition is visible).
  7. Full axis service screen. Open Diagnostics > Axis on the HMI for both U and W; confirm Kv, follow-up mode, controller enable, and pulse enable all read as expected.
  8. Safety test. Trigger SS1 from the safety test selector; confirm the drive de-energises and the clutch is held in its current position (typically a spring-applied brake on the gear side).

10. Diagnostics and Alarms

The most common alarms when the setpoint exchange is misconfigured are listed below. These are taken from the Sinumerik 840D sl Diagnostics Manual.

Alarm Meaning Likely cause Action
20050 Axis %1 is not assigned to a drive MD30110 does not match between U and W, or option not enabled Equalise MD30110; verify option
20140 Setpoint exchange active for axis %1 Informational; the exchange is in progress Wait for completion; check PLC state
25050 Axis %1 contour monitoring Exchange attempted before clutch engaged, or wrong axis released Inspect clutch feedback timing; extend interlock dwell
26074 Controller enable missing for axis %1 PLC has not set DBB2.1 on the new active axis Check state machine; verify VDI wiring
300613 SINAMICS: encoder fault on U External encoder wiring or power loss Inspect encoder cable and DRIVE-CLiQ topology
300614 SINAMICS: encoder fault on W Same as above on the W encoder Same as above

10.1 Live diagnostics checklist

  • Commissioning > Axis > Axis U: controller enable on, pulse enable on, follow-up off, Kv matches commissioning sheet.
  • Commissioning > Axis > Axis W (parked): controller enable off, pulse enable off, follow-up on, position actual updates as the slide is moved by hand.
  • PLC watch table: ClutchAtU XOR ClutchAtW is always true; both never true, both never false (clutch must not be in a mid-position state).
  • Drive trace: trace the velocity setpoint during an exchange; the setpoint for U should ramp to 0 inside 200 ms, then a brief flat, then the W setpoint ramps in.

11. Troubleshooting Matrix

Symptom Probable root cause Diagnostic Corrective action
W axis always shows simulation mode Setpoint exchange option not enabled on CF card Operate > Commissioning > Options Order option, install on CF, restart NCK
25050 immediately on first exchange Clutch feedback wired to wrong NCK variable, or feedback polarity inverted Watch table on ClutchAtU / ClutchAtW Re-wire feedback or invert in PLC symbol table
HMI shows only one axis MD20070 does not reference both U and W Display MD in MD view Set MD20070 to include both indices
Both axes show position, but neither can be moved MD30110 different between U and W, but option enabled → NCK is uncertain which owns the drive Display MD in MD view Set both MD30110 to the same drive number
Motor stalls when exchanging under load Clutch slips because engage dwell is too short Trace clutch pressure feedback Add 100 ms dwell after ClutchAtU / ClutchAtW
Position jumps on parked axis at exchange Encoder phasing wrong on external encoder (W) Reference the parked axis; check MD34100 Re-commission encoder; set MD34200 $MA_ENC_REFP_MARKER
20140 alarm at every program start NCK sees a request but PLC hasn't released the parked axis Watch DBB69 of parked axis Initialise state machine in OB100; do not leave the parked axis enabled from a previous session

12. Alternative: Container Axes (SW 4.7 SP2 and later)

On 840D sl SW 4.7 SP2 and later, the same problem can be solved more declaratively using Container Axes. A container is a logical group of axes of which only one is active. The exchange is configured by NCK commands and does not require a manual PLC state machine for the VDI bits. Container axes are the recommended long-term approach for new retrofits, but the classic setpoint exchange remains the supported, documented mechanism for the existing installed base.

Key MDs for container axes:

  • MD12750 $MN_AXCT_NAME_TAB - container names
  • MD12751 $MN_AXCT_AXCONF_ASSIGN_TAB - slot assignments
  • MD12752 $MN_AXCT_DEFAULT_AXCONF - default assignment after reset
  • NC commands AXCTSW (axis container switch) and AXCTSWC (axis container switch with check)
Recommendation: For a horizontal borer retrofit that is being placed on an existing 840D sl CPU that may be SW 4.4 / 4.5, implement the setpoint exchange pattern documented in the S9 special function manual. If the controller is SW 4.7 SP2 or newer and the project is greenfield, prefer container axes for the simpler NC program flow.

13. Verification Checklist

Before signing off the U/W axis pair, confirm every item below.

  • Both U and W visible in the channel axis list on the HMI.
  • Position actual on both axes updates when the corresponding slide is hand-cranked (clutch disengaged, drive de-energised).
  • Referencing of U works; referencing of W works; referencing of W after a U-to-W exchange returns to the same machine zero within the encoder resolution.
  • Clutch engage time measured at < 200 ms; PLC dwell after feedback set to at least 1.5× the worst-case engage time.
  • No 25050 contour-monitoring alarm during 100 consecutive exchanges under load.
  • No 20140 alarm latches in the alarm log after a power cycle.
  • SS1 from the safety test selector drops the drive and the clutch is held (no drift on the parked axis).
  • The NC program that uses both U and W runs the test part to print with no deviation on the diameter or surface.

14. Related Siemens Documentation

Refer to the official Siemens documentation for the latest MDs and PLC blocks:

FAQ

Do U and W need to share the same MD30110 $MA_CTRLOUT_MODULE_NR?

Yes. Both U and W must point to the same drive number in MD30110; this is the configuration the NCK uses to perform the setpoint exchange. If the MDs differ, the second axis is parked with alarm 20050 Axis %1 is not assigned to a drive.

Which Siemens software option enables the setpoint exchange?

The Setpoint exchange / additional axis option (S9 family) must be enabled on the CF card. Without it, the NCK treats the second axis as a simulation axis even when MD30110 is identical. Verify the option under Commissioning > Options in Sinumerik Operate.

Can both U and W be displayed on the HMI at the same time?

Yes. Define both as channel axes in MD20070 and MD20080, and the HMI will show both. The active axis shows live setpoint and enables, the parked axis shows its actual position from its own encoder with the controller enable / pulse enable off and follow-up mode on.

What is the difference between setpoint exchange and container axes?

Setpoint exchange is a PLC-driven VDI-level mechanism that has been available since the early 840D sl SW 4.x. Container axes (SW 4.7 SP2 and later) move the switching logic into the NCK and use NC commands AXCTSW and AXCTSWC. For new projects on SW 4.7+, container axes are simpler; for existing 840D sl retrofits, the S9 setpoint exchange is the standard documented approach.

Why does the parked axis show its actual position even with the drive de-energised?

Each axis has its own external encoder wired to a dedicated SINAMICS encoder module, bound to the axis through MD30220. The position is read from the encoder regardless of the drive enable state, so the parked axis continues to display a live actual value as the slide is hand-cranked.

How long should the PLC dwell after the clutch engages before the setpoint exchange is requested?

Measure the worst-case clutch engagement time with a cold, aged, and pressure-loss condition, then add a 50% margin. For typical pneumatic or hydraulic clutches this falls in the 100-200 ms range. Holding for less than 1.5× the measured time risks a clutch-still-slipping exchange and a 25050 contour-monitoring alarm.

Back to blog