Problem Description
On a SINUMERIK 840D sl control, an operator may observe two distinct but related symptoms on a configured spindle channel:
- The spindle actual value and setpoint are displayed in degrees (°) on the HMI basic display, axis monitor, and service screens, instead of the expected revolutions per minute (rev/min or rpm).
- The spindle feedrate override only switches between two states: 50% and 100%, regardless of the rotary switch position on the HMI or the override from the PLC.
In a correctly configured spindle these values are shown as rotary speed (rpm) and the override follows the gray-coded 0%–200% range with discrete steps of 1% (or 0.1% in fine resolution). Both symptoms are caused by the same root cause: the machine axis is recognized as a plain rotary axis and the spindle PLC interface is not properly activated.
Root Cause Analysis
The SINUMERIK 840D sl differentiates between three fundamental axis types that share the same axis container and the same NCK machine data namespace:
- Linear axis – default; no special axis type flag set.
- Rotary axis – geometric values are programmed in degrees (°).
- Spindle – a rotary axis with an additional speed-programming interface (S, M3/M4/M5, SPOS, M19, M70).
When a spindle is set up only as a rotary axis, the NCK displays the current speed as an angle (°/min or °/s, depending on MD 30300 IS_ROT) rather than in revolutions per minute. Additionally, the feedrate/rapid traverse override is processed as a rotary-axis override, which is binary by default (50% / 100% / 150%) unless the dedicated spindle override interface is enabled by the PLC.
The two symptoms therefore point to two missing links:
-
Axis → Spindle assignment is missing. Machine data
MD 35000 $MA_SPIND_ASSIGN_TO_MACHAXmust be set to the spindle index (1…n) for the axis that shall act as spindle 1. -
Spindle override activation is missing. The PLC must set interface signal
DB36.DBX1.7(Override active) for the spindle, otherwise the NCK clamps the override to the minimum value of the OVR rotary switch position (default 50%) and 100%.
Required Machine Data Overview
The following NCK machine data must be consistent for the spindle channel axis. The machine axis index (AX1…AXn) used here is the 6th machine axis. Spindle 1 is being defined on the 6th machine axis.
| MD number | Symbolic name | Value | Purpose |
|---|---|---|---|
| 35000 | SPIND_ASSIGN_TO_MACHAX | 1 | Assigns machine axis AX6 to spindle 1 |
| 30100 | IS_ROT_AX | 1 | Axis is a rotary axis (required for any spindle) |
| 30110 | ROT_IS_MODULO | 1 | Modulo axis for programming (0…360°) |
| 30120 | DISPLAY_IS_MODULO | 1 | Modulo display on HMI (0…360° shown) |
| 30130 | MODULO_RANGE_TOL | 0.0 | Optional: tolerance window for modulo display |
| 30200 | NUM_ENCS | 1 | Number of encoders (1 for typical spindle) |
| 30300 | IS_ROT | 0 | Axis is displayed as linear axis (rotational feedrate) |
| 30310 | ROT_FEED_TORQUE | 0 | Reserved (set default) |
| 31020 | ENC_RESOL | encoder-dependent | Encoder resolution (lines per revolution) |
| 32010 | JOG_VEL_RAPID | 10.0 | Rapid traverse in JOG (mm/min or rev/min) |
| 32020 | JOG_VEL | 10.0 | Traversing speed in JOG (rev/min) |
Sources: SINUMERIK 840D sl Axes and Spindles Function Manual (06/2019) and the SINUMERIK 840D sl List Manual (parameter list of machine data).
-
MD 30100 IS_ROT_AXdeclares the axis as a rotary axis for the NCK internal treatment (axis motion, modulo, end-of-travel). -
MD 30300 IS_ROTcontrols how the HMI and feed calculation display the axis. With30300 = 1the actual value is shown in mm/min; with30300 = 0the actual value is shown in rev/min (or in this case, the speed in rpm). For a spindle, setMD 30300 = 0so that the speed value is treated as a rotation rate and the HMI shows rev/min.
Channel Axis Assignment (CHANAX vs MACHAX)
SINUMERIK 840D sl maintains two tables:
-
Channel axis table (
MD 20070 $MC_AXCONF_MACHAX_USEDandMD 20080 $MC_AXCONF_CHANAX_NAME_TAB) — the logical order of axes inside a channel (channel axes 1…6, sometimes called AX1…AX6 inside the channel). -
Machine axis table — the actual hardware/NCK axes (NC axes 1…n) defined by
MD 30150 $MA_AXCONF_INPUT_AXor default order in the drive assignment.
If the spindle is supposed to be the 6th channel axis (CHANAX index 5, zero-based) but the channel axes are not defined continuously from index 0, a gap is created in the channel axis list. In that case the control ignores axes defined after the gap unless:
MD 11640 $MN_ENABLE_CHAN_AX_GAP = 1
With this MD, the NCK allows the channel axis list to contain undefined entries, so the spindle at channel axis 6 (CHANAX 5) is still recognized. Without it, the control does not bind the spindle to any channel axis, the PLC interface does not fire, and the override defaults to 50% / 100%.
PLC Interface for the Spindle Override
For spindle 1 on the 6th machine axis, the relevant PLC interface is in data block DB36 of the basic PLC program (blocks are typically generated by the SINUMERIK Operate / 840D sl toolbox). The signals are:
| Signal | Type | Meaning |
|---|---|---|
| DB36.DBX0.0 | Input → NCK | Spindle stop (feed stop via PLC) |
| DB36.DBX0.1 | Input → NCK | Spindle start (in conjunction with NC start) |
| DB36.DBX0.2 | Input → NCK | Spindle reset |
| DB36.DBX1.7 | Input → NCK | Override active (must be 1 to enable the override field) |
| DB36.DBB18 | Input → NCK | Spindle override (byte, gray-coded, 0…200% steps of 1%) |
| DB36.DBB0 | Input → NCK | Axis/feed override (byte, gray-coded) |
| DB36.DBB5 | Output ← NCK | Spindle status word (actual direction, speed, etc.) |
| DB36.DBW6 | Output ← NCK | Actual spindle speed (rpm) |
| DB36.DBD8 | Output ← NCK | Setpoint spindle speed (rpm) |
Step-by-Step Configuration Procedure
- Verify the drive assignment. Confirm the spindle drive is configured and the motor is properly assigned via drive parameters (drive parameters are accessible in Start-up → Drive configuration). The drive must be present and commissioned before the NCK accepts a spindle definition.
-
Set the rotary axis MDs on the machine axis used as spindle.
Open Start-up → Machine data → Axis MD and edit:
MD 30100 IS_ROT_AX = 1
MD 30110 ROT_IS_MODULO = 1
MD 30120 DISPLAY_IS_MODULO = 1
MD 30300 IS_ROT = 0 -
Assign the axis to spindle 1.
MD 35000 SPIND_ASSIGN_TO_MACHAX = 1
This is the central link that turns the rotary axis into a spindle. Each channel may have multiple spindles; the value 1 means "this axis is spindle 1". To turn off the spindle assignment, set the value to 0. -
Allow gaps in the channel axis list if needed.
If the 6th channel axis (the spindle) is the last logical axis and indices 0…4 are not defined continuously, set:
MD 11640 ENABLE_CHAN_AX_GAP = 1 -
Save and reset (NCK reset).
The MD changes require a warm restart of the NCK. After reset, the spindle will appear in the HMI's axis/spindle selection list and the actual value will be displayed in rev/min. -
Activate the spindle override from the PLC.
In the basic PLC program (S7-300/400 / S7-1500 soft PLC), write the following signals continuously:
DB36.DBX1.7 := TRUE;// Override active
DB36.DBB18 := GrayCode(OverrideValue);// 0…200%
The override is a gray-coded byte, so the byte 0x00…0xFF is interpreted as 0…200% in 256 gray-coded steps, but only the discrete positions of the rotary switch (typically 32 positions in 5% steps) are valid. -
Compile and download the PLC project.
Use SIMATIC Manager / TIA Portal to build the project. The S7-300 (or S7-1500) must be reset to load the new blocks.
Verification Procedure
- Open the Spindle Service screen from the HMI: Diagnosis → Service displays → Axis/spindle service. The actual speed should now read in rev/min, not degrees.
- Operate the spindle from MDI with
S1500 M3. The actual speed should rise to ~1500 rev/min and the display should read "1500 rev/min" (or simply 1500 with the rpm unit), not a degree-based value. - Turn the spindle feedrate override rotary switch on the HMI to 50%, 75%, 100%, 120%. The actual active override should follow the switch position. If it snaps to 50% or 100% only, the PLC interface signal
DB36.DBX1.7is not being held high continuously — the PLC cycle must not pulse it. - Use the HMI Diagnosis → Trace (or BTrace) to record the
Overridefield and verify the gray-coded value atDB36.DBB18.
How the Override Is Interpreted
The gray-coded byte at DB36.DBB18 is the position of the rotary switch or the override value from a handwheel. It is NOT a linear 0…255 byte. The 840D sl basic PLC decodes the gray code, then the NCK clamps the resulting value:
- If
DB36.DBX1.7 = 0(Override inactive), the NCK internally forces the override to 0% (spindle stop) on the high byte and 50% (50% of programmed speed) on the low active switch position. Hence the binary behavior you see on the HMI: 50% / 100%. - If
DB36.DBX1.7 = 1, the gray-coded byte is decoded and applied; full 0…200% range becomes available.
The behavior is identical for the axis feed override at DB36.DBB0, but the signal that activates the axis override is DBX0.6 on the axis DB (DB31…DB35) — this is a common source of confusion.
Troubleshooting Matrix
| Symptom | Likely cause | Remedy |
|---|---|---|
| Spindle display in degrees | MD 35000 = 0 (axis only) or MD 30300 = 1 | Set MD 35000 = 1, MD 30300 = 0 |
| Spindle override stuck at 50% / 100% | DB36.DBX1.7 = 0 (override not activated) | Set DB36.DBX1.7 = TRUE in PLC |
| Spindle does not appear in HMI at all | Channel axis list has gaps and MD 11640 = 0 | Set MD 11640 = 1 OR remove the gap in CHANAX |
| Spindle visible but S value ignored | MD 35000 set on wrong machine axis | Verify MD 35000 is on the axis driving the spindle motor |
| PLC alarms "spindle interface missing" | DB36 not generated by basic PLC | Import the default basic PLC blocks and rebuild |
| Modulo display shows negative values > -360° | MD 30120 not set | Set MD 30120 = 1 |
| Override does not match the rotary switch | Gray code mapping wrong in PLC | Use FC 19/FC 20 in basic PLC for gray code conversion |
Related Spindle Function Codes
Once the spindle is correctly recognized, additional NC commands are available. Reference: SINUMERIK 840D sl / 828D Fundamentals Programming Manual – Positioning Spindles (SPOS, SPOSA, M19, M70, WAITS).
-
SPOS[1] = 90– positions spindle 1 to 90° (requiresMD 35000link). -
SPOSA– asynchronous spindle positioning, block-change is not delayed. -
M19– orientation stop (legacy, equivalent to SPOS with position fromMD 35300). -
M70– switch to axis mode (positioning axis), then back to spindle via reset. -
WAITS(1)– wait for spindle 1 to reach its commanded speed before continuing.
Safety and Commissioning Notes
- Verify the spindle has a valid measurement system (encoder) before setting
MD 35000. A missing encoder causes the NCK to report "measuring circuit not ready". - Use the NCK tool Commissioning → Axis → Measuring system to confirm
MD 30200 NUM_ENCSandMD 31020 ENC_RESOLmatch the motor encoder. - When switching from rotary axis to spindle with active coupling (e.g., master/slave for rigid tapping), the master axis may also need to be redefined. Always uncouple the axes before changing
MD 35000. - Override 0% is a hard stop command. Do not set
DB36.DBB18 = 0in normal operation unless the spindle must be stopped (e.g., emergency stop).
FAQ
Why does the 840D sl show my spindle speed in degrees instead of rev/min?
Because the axis has been declared as a rotary axis (MD 30100 IS_ROT_AX = 1) but has not been assigned to a spindle. Set MD 35000 SPIND_ASSIGN_TO_MACHAX = 1 on that machine axis and MD 30300 IS_ROT = 0 so the HMI reads back the speed as a rotational rate, not as an angular displacement.
My spindle feed override only switches between 50% and 100% — what PLC signal enables the full 0–200% range?
Set DB36.DBX1.7 to 1 (Override active). The actual override value is in the gray-coded byte DB36.DBB18. If DBX1.7 stays 0, the NCK clamps to the lowest available position of the rotary switch (typically 50%).
Do I need MD 11640 ENABLE_CHAN_AX_GAP if my channel axes are defined continuously?
No. MD 11640 = 1 is only required when the channel axis list has gaps (for example, only CHANAX 1, 2, 3, 6 are defined). If all 6 channel axes are defined in order, leave MD 11640 = 0 — enabling it has no effect on a gap-free list.
Which MD converts a rotary axis into a spindle on 840D sl?
MD 35000 $MA_SPIND_ASSIGN_TO_MACHAX is the central link. Set it to the spindle index (1 for spindle 1, 2 for spindle 2, etc.) on the machine axis that drives the spindle motor. The same axis must already have MD 30100 = 1 and an encoder configured.
My HMI shows the speed in mm/min even after fixing the spindle — why?
MD 30300 IS_ROT is set to 1. With IS_ROT = 1 the HMI treats the axis as a linear axis and displays the speed in mm/min. Set MD 30300 = 0 for a spindle to display rev/min.