Configuring a Virtual Axis on SINUMERIK 840D sl After Encoder

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

Configuring a Virtual Axis on SINUMERIK 840D sl After Encoder Failure

When a position encoder is removed from a SINUMERIK 840D sl axis, the control immediately reports a zero actual position, the NCK raises encoder-related alarms, and the axis can no longer be jogged or programmed. Operators sometimes need to keep the rest of the machine productive while a replacement encoder is on order, or they need a known safe position before the mechanical service crew can enter the working area. Configuring the affected axis as a virtual axis (sometimes called a simulation axis) lets the NCK continue to issue setpoints, accept NC program commands, and respond to the PLC interface as if the drive and feedback hardware were still in place — even though the loop is mathematically open.

This reference documents the machine data required to convert a real linear or rotary axis (B axis in the case described) into a virtual axis on SINUMERIK 840D sl / SINUMERIK ONE, the PLC signals that must be supplied, the alarms to expect during the change, and the procedure to restore real-axis operation once the encoder is replaced. The same procedure applies to 840D powerline with minor differences in machine-data ranges.

Problem Overview

Symptom cluster reported on the affected axis:

  • Actual position value (load-side or direct-measuring system) freezes at 0.0 deg / mm.
  • Axis cannot be jogged in any mode (JOG, JOG-INC, MDI, AUTO).
  • NCK raises 25000 "Active encoder hardware defective" or 25100 "Measuring system error", followed by 21612 "Channel %1 axis %2 reset" when the controller is re-initialized.
  • If a second encoder is configured, it may also be ignored because the closed-loop monitor expects consistent position.

The root cause is that the NCK requires at least one valid actual-value source (MD30200 $MA_NUM_ENC) to be present for the axis to leave the not referenced state. With the encoder hardware removed and MD30200 still set to 1, the drive sets the controller enable but no position is captured, and the position-monitoring logic trips on the first motion command.

Virtual Axis vs Simulation Axis: Conceptual Differences

SINUMERIK distinguishes two related but distinct operating modes that allow an axis to be run without live drive or feedback hardware:

Mode Activation MD Value Behavior
Virtual axis MD30132 $MA_IS_VIRTUAL_AX 1 No setpoint output, no encoder, no closed loop. Used as a master reference for synchronous axes, cams, and electronic gearing.
Simulation axis MD30350 $MA_SIMU_AX_VDI_OUTPUT 1 Setpoints are computed and written to the PLC interface (DB31, ... DBX8..9) as simulated analog values; PLC can still see "drive" output.

The original question asked specifically about leaving the axis at a non-zero position so the rest of the program can continue, which maps to a simulation axis. The term "virtual axis" in Siemens documentation for S7-1500T (see TIA Portal: Virtual axis S7-1500/S7-1500T) is the controller-level concept; on 840D sl the equivalent is the simulation axis when you need the NCK to keep tracking setpoints, and a pure virtual axis when you only need a mathematical reference without any PLC output.

Field-proven rule of thumb:

  • If the B axis is a master for slaves (cams, coupled axes, electronic gearbox) — use virtual axis (MD30132=1).
  • If the B axis is a stand-alone axis whose setpoint must still appear in the PLC interface and in the HMI actual-value display — use simulation axis (MD30350=1).
  • If the B axis is the slave of a coupling and only needs a credible position to be reported back to the NCK — either mode works; simulation is preferred because the operator can still see the value updating.

Required Machine Data Parameters

The following machine data must be checked and adjusted. All addresses assume the axis index [AX2] (B axis is the third axis in a standard 3-axis configuration; verify the axis number in your channel-specific MD20050 $MC_AXCONF_MACHAX_USED).

MD Symbolic name Standard value (real axis) Simulation value Effect
MD30130[AX2] $MA_CTRLOUT_MODULE_NR drive slot number (e.g. 4) 0 Disables setpoint output to PROFIdrive / analog module.
MD30150[AX2] $MA_CTRLOUT_SEGMENT_NR segment index 0 Clears the bus segment reference.
MD30200[AX2] $MA_NUM_ENC 1 or 2 0 Tells the NCK that no encoder is configured.
MD30240[AX2] $MA_ENC_TYPE 1, 2, 3, 4 (drive-side, linear, etc.) 0 No actual-value processing.
MD30132[AX2] $MA_IS_VIRTUAL_AX 0 1 (alternative) Activates the virtual-axis operating mode.
MD30350[AX2] $MA_SIMU_AX_VDI_OUTPUT 0 1 (alternative) Activates the simulation axis with VDI output.
MD32100[AX2] $MA_AX_MOTION_DIR 0 or 1 leave unchanged Direction of motion (still relevant in simulation).
MD32300[AX2] $MA_MA_AX_MAX_VELO machine limit leave unchanged Maximum axis velocity (clamped in simulation).
MD36000[AX2] $MA_IDLE_DIST 0.0 leave unchanged Limit for stop detection.
Field note: MD30130 and MD30200 are the only two data the user must change to enter simulation mode. Modifying MD30132=1 OR MD30350=1 alone is not sufficient — the NCK will still raise 21612 because the drive telegram handshake fails if MD30130 points at a real drive that is no longer responding.

Preconditions: PLC Interface and Safety

A virtual or simulation axis still requires the PLC application to release it. The minimum signals on the axis DB (DB31 for the first axis, DB32 for the second, DB33 for B) are:

DB offset Bit / type Signal Required state
DBX1.0 BOOL Drive enable (Auftrag) — DB31,DBX1.0 TRUE
DBX1.1 BOOL Pulse enable — DB31,DBX1.1 TRUE
DBX2.1 BOOL Controller enable — DB31,DBX2.1 TRUE
DBX12.7 / DBX12.6 BOOL Hardware limit switches +/- TRUE (NCK ignores them in simulation but PLC-side HW-Sperre must be released)
DBX136.0 BOOL Power-on completed by PLC TRUE

If any of these signals are latched off because the missing encoder removes the "drives ready" handshake from the SINAMICS drive, the simulation axis will report 25050 "Axis %1 controller enable" on the first jog attempt. The PLC logic must therefore be modified to:

  1. Force DB3x.DBX1.0, DBX1.1, and DBX2.1 to TRUE for the B axis while in service mode.
  2. Bypass any "encoder OK" diagnostic bit that reads back DB3x.DBX60.2 / DBX60.3 (encoder coarse/fine position valid) — these are always FALSE in simulation.
  3. Block the operator from jogging any other axis that depends on the B axis in a coupled grouping.
Safety warning: A virtual or simulation axis has no closed-loop monitoring. The drive will not react to collision, stall, or following error. The B axis MUST be mechanically locked, unclamped, or hand-pinned to a fixed safe position before commissioning. The following-error limit (MD36020 $MA_POS_LIMIT_MONITOR, default 20 mm) is still evaluated in simulation but only against the setpoint, not against reality.

Step-by-Step Configuration Procedure

Apply the changes in the order shown. A backup of the NCK data is mandatory.

  1. Backup the current NCK data. Use the HMI menu Start-up → Archive → NCK data or the command line pi_service ac_save. Save the archive to a network share that is independent of the controller.
  2. Bring the machine to a safe state. All axes stopped, controllers disabled, doors closed, EMERGENCY-STOP circuit intact. Acknowledge all alarms with Cancel on the HMI.
  3. Switch the NCU to a higher access level. On the HMI: Start-up → Password → Manufacturer and enter the access password. Verification: the additional MD fields become visible in the startup tree.
  4. Edit MD30130[AX2] = 0. Open the axis tree Start-up → Machine Data → Axis-specific → Setpoint/Actual values. After entry, the NCK will raise 21612 "Channel 1 axis B reset" on the next reset — this is expected.
  5. Edit MD30200[AX2] = 0. With this change the NCK no longer expects an encoder. Re-trigger an NCK reset (HMI Reset button or PLC DB21.DBX7.7) and acknowledge any remaining alarms.
  6. Edit MD30240[AX2] = 0. This clears the encoder type and stops the NCK from issuing the drive telegram configuration for the missing feedback channel.
  7. Edit MD30350[AX2] = 1 (simulation axis with VDI output) OR MD30132[AX2] = 1 (pure virtual axis). Choose based on the matrix in the "Virtual vs Simulation" section. Most users want MD30350 = 1 because the HMI then continues to display a believable setpoint value.
  8. Issue an NCK reset and power-on again. HMI: Reset (po) → Power On. The NCK re-initializes the axis and the alarm list should now be empty.
  9. Set the axis to "referenced" state. The simulation axis still requires the referenced bit to be set. In MDI run:
    ROT B = 0
    then execute ROT B = DC(0) or use HMI Set actual value with the encoder absent. Verify DB3x.DBX60.4 ("referenced / synchronized") becomes TRUE.
  10. Update the PLC. Force the enable signals listed in the previous section. A temporary set of BV (BOOL true) markers in the axis FC block is acceptable for the duration of the service window.
  11. Smoke-test in JOG. Select the B axis on the HMI, set jog override to 5 %, and jog in the positive and negative directions. The setpoint display should change in DB3x,DBD0 (axis position setpoint) and the HMI actual-value field should follow the command. The motor must remain stationary.
  12. Smoke-test in MDI. Run G01 B=10 F500 in MDI. The setpoint ramps to 10 deg, the actual value follows, and no following-error alarm should appear because MD36020 evaluates setpoint-vs-actual in simulation as identity.
  13. Smoke-test in AUTO with a dry-run NC program. Use DRYRUN and ROTZ to verify the part program completes without referencing the missing encoder.

Manual Positioning and Setpoint Override

The original poster needed to leave the B axis at a non-zero position by hand. With simulation active the operator has two options:

  1. Mechanical set + NCK set actual value. Move the cone-forming axis by hand to the desired angular position. With the encoder physically removed, the mechanical position is unknown to the NCK. Use HMI Set actual value (German: Istwert setzen) and enter the real mechanical angle. The NCK writes this value to DB3x,DBD0 and clears the not referenced flag.
  2. Command-based positioning. Run an MDI block that programs the desired setpoint:
    B=12.5 F2000
    followed by SETMS(2) to lock the B axis as a master. Because the simulation axis does not have a closed loop, the NCK accepts the value as the new actual position after POSA B=12.5 completes.

If the B axis is mechanically clamped, the operator should still set the actual value in the NCK so that coupled axes compute the correct offset when the clamp is released and the gear is engaged.

Verification and Commissioning Checks

After the configuration change, run the following acceptance checklist before releasing the machine to production:

Check How to verify Expected result
MD consistency HMI → Diagnostics → MD compare MD30130, MD30150, MD30200, MD30240, MD30350 (or MD30132) flagged as "simulation".
Alarm list HMI → Alarm log No active alarms; only historical 21612 from the reset.
Axis status word Online → Axis DB3x,DBB68 Bit 0 (position reached) = 1 after MDI move.
Axis referenced DB3x,DBX60.4 TRUE
Setpoint tracks command Trace DB3x,DBD0 vs command position Difference < 1 increment at standstill.
Drive module health SINAMICS online → Telegram diagnostics Drive may report "no encoder configured" — this is acceptable.
Hardware limit switches Manually approach and trip one limit NCK acknowledges but does not stop the axis in simulation; PLC-side HW-Sperre must be active.

Restoring Real Encoder Operation

When the new encoder is installed, revert the change in the reverse order:

  1. Stop the NCK (HMI Reset) and disconnect the drive enable.
  2. Restore MD30130[AX2] to the original drive slot number.
  3. Restore MD30150[AX2] to the original segment number.
  4. Set MD30200[AX2] = 1 (or 2 if a second encoder is installed).
  5. Set MD30240[AX2] to the matching encoder type (1 = incremental, 2 = absolute SSI, 4 = EnDat, etc.).
  6. Set MD30350[AX2] = 0 and, if it was used, MD30132[AX2] = 0.
  7. NCK power-on, wait for SINAMICS to establish the encoder telegram, then run the standard referencing sequence (HMI Reference point or part-program G74).
  8. Restore the PLC enable logic to the original, non-forced version.
  9. Recommission the safety chain, including the cross-check between the encoder fine/coarse valid bits in the safety PLC.
Warning: After the encoder replacement the actual value jumps to whatever the new sensor reports. Verify the mechanical reference marker offset (MD34090 $MA_REFP_MOVE_DIST_CORR) before running any NC program that uses absolute coordinates.

Common Faults and Diagnostic Alarms

Alarm Cause after the configuration change Resolution
21612 "Channel %1 axis %2 reset" Expected on the first NCK reset after MD change. Acknowledge; it will not reappear.
25000 "Active encoder hardware defective" MD30240 still references a sensor type. Set MD30240 = 0 before the next reset.
25050 "Axis %1 controller enable" PLC did not release DB3x,DBX2.1. Check the axis enable FC; confirm the B-axis service-mode bit is wired.
26000 "Axis %1 clamping monitoring" MD36040 $MA_STANDSTILL_POS_TOL exceeded because no real motion occurs. Raise MD36040 to a value larger than the simulation tracking error, or suppress clamping monitoring with MD36030 = 0.
26100 "Axis %1 drive fault" SINAMICS telegram is not disabled (MD30130 still set). Confirm MD30130 = 0 and the drive module has been parked in SINAMICS topology.
380040 "Encoder 1: zero mark failure" Drives-side encoder still configured. Either physically remove the encoder from the SINAMICS topology or re-parameter the drive to a non-feedback mode.

Operational Notes and Edge Cases

  • Coupled axes: If the B axis is a master for a synchronous slave (electronic gear, cam), the slave receives a stable position only if MD30132=1 is used together with MD30350=1. Using only MD30132 leaves the slave without a master, and the NCK raises 16720 "Channel %1 axis %2 slave axis not synchronized".
  • PROFIdrive telegrams: A standard Siemens telegram 3 (encoder + 1 position setpoint) requires a valid encoder configuration. The simulation must downshift the drive to telegram 0 (no encoder) or remove the drive entirely from the PROFIBUS/PROFINET configuration, otherwise the bus startup will stall with 0130000 "Device %1 sign-of-life missing".
  • Safety Integrated: Simulation axis mode is not compatible with SI motion monitoring. The F-PLC must be put into passivation mode for the B axis (DB18.DBX36.1 = 1) before the NCK accepts the change. SINUMERIK Safety Integrated will not permit a virtual axis as a safe axis.
  • HMI display: The actual-value field on SINUMERIK Operate shows the setpoint when the axis is a simulation axis. Operators may mistakenly believe the encoder is working. Add a sticky banner to the HMI through the "Machine Identification" field until the encoder is restored.
  • Persistent storage: The MD changes survive an NCK reset but not a firmware upgrade. After any software install, reapply the simulation values and re-acknowledge the alarms.

Frequently Asked Questions

What is the difference between MD30132 and MD30350 on SINUMERIK 840D sl?

MD30132 $MA_IS_VIRTUAL_AX = 1 makes the axis a pure mathematical reference with no setpoint output and no PLC interface. MD30350 $MA_SIMU_AX_VDI_OUTPUT = 1 makes the NCK compute the setpoint and write it to the PLC VDI interface (DB31..DB61) so the HMI and a coupled slave axis continue to see a credible position. Use MD30132 for cam/gearbox masters, MD30350 for stand-alone or slave axes.

Do I need to touch MD30240 if the encoder is already physically removed?

Yes. MD30240 $MA_ENC_TYPE = 0 is required. Leaving the original value (1, 2, 3, or 4) makes the NCK still expect the matching encoder telegram and raises 25000 "Active encoder hardware defective" on every reset.

Why does the axis not move in JOG after I set MD30130=0 and MD30200=0?

Two reasons are most common. First, the PLC enable chain (DB31..DB61,DBX1.0 / DBX2.1) is still FALSE because the SINAMICS drive reports "encoder not configured". Force these bits in the axis FC for the duration of the service window. Second, the axis has not been set to "referenced" — use HMI Set actual value or MDI SETMS to mark it referenced, otherwise jog commands are blocked by 20090 "Axis %1 referencing not possible".

Can I keep Safety Integrated active on a virtual B axis?

No. SINUMERIK Safety Integrated does not support a virtual axis as a safe monitored axis. The F-PLC must passivate the B axis (DB18,DBX36.1 = 1) and the safe stop functions for B must be downgraded to STO without safe position monitoring for the duration of the simulation. Re-enable full SI after the real encoder is back in service.

Will the simulation settings survive a NCK power-on?

Yes — the values are written to the CFast card and are loaded at next power-on. They do not survive a software install or CFast replacement; archive the MD set with Start-up → Archive → NCK data and reapply after the install.

Back to blog