Resolving SINAMICS Absolute Encoder Position Loss After Passive

David Krause17 min read
Motion ControlSiemensTroubleshooting
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: Position Drift After Power-Cycle on Passive-Homed SINAMICS Axis

On SINAMICS S120, G120, CU305 PN and similar Drive-CLiQ-based drives, a single-axis configuration with an absolute encoder (e.g. 1FK7/1FT7/1PH8 motors with singleturn or multiturn DRIVE-CLiQ encoders, or external SINAMICS absolute encoders) can be set up to use passive homing (also called set-homing or datum-set). The mechanical home switch and homing ramp are bypassed and the actual position value is overwritten to zero at the moment the home-bit is asserted.

The field symptom on S7-300 + CP 343-1 + SINAMICS CU305 PN installations is consistent:

  1. The axis is referenced using a passive home command (e.g. from a user FB, a STARTER control panel button, or a digital-input driven MC-Home block in SIMOTION).
  2. The drive reports the new actual position correctly (e.g. 1000 LU = current mechanical location).
  3. The 24 V control section and the DC-link are powered down.
  4. On the next power-up, the drive's first actual position value is a different, large number (typically an offset of one or several motor revolutions, or an apparent random multiturn value) instead of 1000 LU.

The drive has not lost the absolute encoder calibration. The encoder is still absolute. What is lost is the load-side zero offset (also called the datum shift, home offset, or in SINAMICS parameter language the encoder adjustment / fine resolution) that the passive-homing procedure wrote to RAM. The new datum therefore never reached the non-volatile area, and the next boot reconstructs the position from the absolute track + the original factory zero.

Root Cause: Active vs. Passive Homing and the Non-Volatile Datum

To fix the symptom you must distinguish three things in the SINAMICS parameter model. All numbers below refer to the standard parameter list for SINAMICS S120 / CU305 (firmware V4.x/V5.x/V6.x) — verify against your SINAMICS S120/S150 List Manual for the exact firmware you run.

Parameter Name Role Volatile?
p2507 LR encoder adjustment / activate encoder calibration Triggers the transfer of the runtime-computed fine resolution (Fn) into the encoder model Yes (write to RAM)
p971 SI copy/activate (save RAM to ROM) Copies all "RAM-only" parameters into the non-volatile memory of the Control Unit No — write is a one-shot action
p2599 Encoder adjustment value (datum offset, FN) Holds the offset between the absolute track zero and the mechanical home position RAM only until p2507 is set
p2525 LR encoder configuration word Bit 0 = encoder adjustment active RAM only until p2507 is set
r2526 / r2527 Status of encoder adjustment Status feedback from the closed-loop controller Read only

With active homing (p2596 = 1) the drive itself executes a motion profile to the home switch, writes the datum, and additionally sets the encoder adjustment bit. The closed-loop firmware applies the runtime offset and — provided the next power-down is "clean" — STARTER's "Copy RAM to ROM" or the operator-panel copy function persist the value.

With passive homing (p2596 = 0, or MC_Home with Mode = 1/3 in SIMOTION) the controller writes a new absolute value at the current mechanical position. The drive accepts it, but the value lives only in the closed-loop control's working data. The moment power is removed, the SINAMICS closed-loop reloads the encoder model from the factory-set absolute track + the last saved datum. If the datum was never saved, the new zero evaporates.

Why STARTER's "Perform absolute value calibration" works: the STARTER button does three things atomically — it sets the encoder adjustment value (p2599), it sets p2507 = 1 to activate the adjustment in the closed-loop model, and it prompts you to copy RAM to ROM (p971 = 1). The combination of all three is what makes the home position survive a power-cycle. Skipping any of them is what gives you the "passive home forgets" symptom.

Preconditions: Hardware, Firmware, and Configuration Checklist

Before changing parameters, confirm the platform baseline. The original installation in the field report was a CPU 314-1AG14-0AB0 (a later 6ES7314-1AG14-0AB0 with PROFINET interface), and a CU305 PN. If your hardware differs, the procedure is the same, only the data route changes.

  1. Drive firmware. The P2507/P971 interface is stable from SINAMICS V4.4 onward. V5.2 SP3, V6.1, and current V6.4 firmwares all expose it identically. Pull up the actual CU305 PN FW with the SINAMICS web server or STARTER (online → drive → Version overview).
  2. STARTER or Startdrive commissioning tool. STARTER V5.6+ or Startdrive V18+ is recommended. Both can talk PROFINET to the CU305 PN.
  3. CPU-side blocks. STEP 7 V5.6+ with the standard library "SIMATIC S7 Blocks" provides SFB 52/53/54/55 (the "Read/write data record" family). Use SFB 52 (RDREC) for reading parameter data records and SFB 53 (WRREC) for writing. The historical names "SFC 58/59" were used in STEP 7 < V5.3 and renamed to SFB 52/53 with the S7-300/400 PROFINET IO model. Always call the SFB version, not the legacy SFC, when the IO device is on PROFINET.
  4. PROFINET slot configuration. CU305 PN exposes its telegram (typically Telegram 105 for the standard SINAMICS drive interface, or 102/103/104 for Servo). Confirm the slot and subslot address — you will need the logical address of the DO (drive object) Parameter access point, normally subslot 0 of the drive sub-module. STARTER shows it in the device view.
  5. Access rights. p971 = 1 is a write that flashes non-volatile memory. The drive may be in follow-up/disabled state when the write completes; sequence it accordingly.

Solution: The Two-Write Sequence (p2507 = 2, then p971 = 1)

The deterministic fix is a two-step parameter write performed on the closed-loop control (DO 1, SERVO or VECTOR depending on configuration). Both writes are data-record writes through the standard SINAMICS parameter channel; they are not a special API and do not require additional firmware options.

Step 1 — Activate the encoder turn-set / encoder adjustment

Write the parameter number 2507 with value 2 (decimal) to the drive. The semantics of value 2 on the SINAMICS axis object are "adopt the actual value of the absolute encoder as the new reference for the adjustment process". Some firmware versions document this as start encoder turn adjustment. After the write, the closed-loop controller re-evaluates the fine resolution (Fn) and writes the new offset into p2599 and the configuration bit into p2525.0.

Step 2 — Save the closed-loop data to the CU's flash

Write parameter number 971 with value 1. This is the SINAMICS "save all parameters from RAM to ROM" command. The drive copies the entire runtime parameter image to the non-volatile CompactFlash / SD card of the Control Unit. The write returns BUSY for several seconds (typical: 2-8 s for a single DO; longer if the entire CU image is being saved). Do not interrupt the CU during this window — a power loss here is the only way to brick the boot image and require a card swap.

Service / safety note. p971 is not the same as the SI copy parameter (p970 in some manuals). On Safety Integrated drives p970 / p971 are separate: p970 copies the SI parameters specifically. For non-SI installations the documented save all knob is p971 = 1. If you are running Safety Integrated (S120 with F-DI and SS1/STO), drive p970 first, then p971.

Why this matches the legacy SIMODRIVE 611U procedure

Engineers who have migrated 611U → SINAMICS notice the same two-step structure. On 611U the equivalent was the MD (machine data) "set absolute value" + the HMI/Startup-Tool "save boot-sector". On SINAMICS the two writes (p2507, p971) replace those operations but in a tighter, drive-object-local form. If your team still runs a 611U cabinet, the migration mapping is direct.

Implementing the Two-Write Sequence from S7-300 via CP 343-1 (SFB 52/53)

The CP 343-1 only acts as a Layer-2 PROFINET IO controller. The actual data-record read/write is performed by the CPU's SFB 52 (RDREC) and SFB 53 (WRREC). Each parameter access is one or two SFB calls:

  1. Build the request data area per the SINAMICS "Parameter Channel" (PKW) interface, even when the configured telegram is PZD-only (Telegram 1/2/3/4/105). The parameter channel uses data records 47 (read) and 48 (write) on the parameter subslot of the drive.
  2. Issue WRREC with the request data. The drive responds asynchronously by writing a corresponding response record. Polling with RDREC, or wiring the SFB 53 DONE output to trigger the read, gives you the new value.
  3. For p971 specifically, the call can take several seconds. Set the SFB 53 TIMEOUT input to 8 s for a single DO; 20 s if the project is large.

PKW request layout for "write p2507 = 2"

The standard PKW write request (8 words / 16 bytes) is laid out as follows. Word 0 is the request header, words 1–3 are the parameter number and index, words 4–7 are the value (DWORD) with byte-order Big-Endian. See the SINAMICS drive object parameter channel description for the byte-exact layout.

Word Field Value (hex) Comment
0 ID / sub-index / length / request 0x1001 0002 Request = write single word, parameter = double-word addressed
1 Parameter number high 0x0000 09CB 2507 decimal = 0x09CB
2 Parameter number low 0x0000 0000 Index 0 (axis-level parameter)
3 Reserved / index extension 0x0000 —
4-5 Value (DWORD, big-endian) 0x0000 0002 Value = 2 (start encoder turn-set)
6-7 Reserved 0x0000 0000 —

PKW request layout for "write p971 = 1"

Word Field Value (hex) Comment
0 ID / sub-index / length / request 0x1001 0002 Write single word
1 Parameter number high 0x0000 03CF 971 decimal = 0x03CF
2 Parameter number low 0x0000 0000 Index 0
3 Reserved 0x0000 —
4-5 Value (DWORD, big-endian) 0x0000 0001 Value = 1 (save RAM to ROM)
6-7 Reserved 0x0000 0000 —

ST example: a "SaveAbsoluteHome" function block

The following Structured-Text skeleton is suitable for STEP 7 V5.x with SCL, or for S7-1200/1500 with a tiny adapter. It calls SFB 53 (WRREC) twice and uses a small state machine. In production you would parametrise the logical base address of the drive subslot and the request headers as IN variables.

FUNCTION_BLOCK FB_PassiveHomeSave
VAR_INPUT
    i_hwDrive : WORD;     // HW ID of the drive parameter subslot (from HW config / SFC5 / iDeviceID)
    i_start   : BOOL;     // Trigger to perform the two-step save
END_VAR
VAR_OUTPUT
    o_busy    : BOOL;
    o_done    : BOOL;
    o_error   : BOOL;
    o_status  : WORD;     // Last STATUS from SFB 53/52
END_VAR
VAR
    s_state  : INT;       // 0=idle, 10=send p2507, 20=wait p2507, 30=send p971, 40=wait p971, 90=done, 99=err
    s_timer  : TON;
    s_wreq   : ARRAY[0..15] OF BYTE;   // WRREC write request, 16 bytes
    s_wrec   : SFB53;                  // WRREC instance
    s_rrec   : SFB52;                  // RDREC instance
    s_wstat  : WORD;                   // Last SFB53 STATUS
END_VAR

CASE s_state OF
0:
    IF i_start THEN
        o_busy := TRUE; o_done := FALSE; o_error := FALSE;
        // build "write p2507 = 2"
        s_wreq[0]:=16#10; s_wreq[1]:=16#01; s_wreq[2]:=16#00; s_wreq[3]:=16#02;
        s_wreq[4]:=16#00; s_wreq[5]:=16#09; s_wreq[6]:=16#CB; s_wreq[7]:=16#00;
        s_wreq[8]:=16#00; s_wreq[9]:=16#00; s_wreq[10]:=16#00;s_wreq[11]:=16#00;
        s_wreq[12]:=16#00;s_wreq[13]:=16#00;s_wreq[14]:=16#00;s_wreq[15]:=16#02;
        s_state := 10;
    END_IF;

10:
    s_wrec(REQ:=TRUE, ID:=i_hwDrive, INDEX:=48, LEN:=16, RECORD:=s_wreq);
    IF s_wrec.DONE THEN s_wstat := s_wrec.STATUS; s_state := 20; END_IF;
    IF s_wrec.ERROR THEN o_status := s_wrec.STATUS; s_state := 99; END_IF;

20:
    s_timer(IN:=FALSE, PT:=T#200ms);
    s_timer(IN:=TRUE);
    IF s_timer.Q THEN s_state := 30; END_IF;

30:
    // build "write p971 = 1"
    s_wreq[0]:=16#10; s_wreq[1]:=16#01; s_wreq[2]:=16#00; s_wreq[3]:=16#02;
    s_wreq[4]:=16#00; s_wreq[5]:=16#03; s_wreq[6]:=16#CF; s_wreq[7]:=16#00;
    s_wreq[8]:=16#00; s_wreq[9]:=16#00; s_wreq[10]:=16#00;s_wreq[11]:=16#00;
    s_wreq[12]:=16#00;s_wreq[13]:=16#00;s_wreq[14]:=16#00;s_wreq[15]:=16#01;
    s_wrec(REQ:=TRUE, ID:=i_hwDrive, INDEX:=48, LEN:=16, RECORD:=s_wreq);
    IF s_wrec.DONE THEN s_wstat := s_wrec.STATUS; s_state := 40; END_IF;
    IF s_wrec.ERROR THEN o_status := s_wrec.STATUS; s_state := 99; END_IF;

40:
    s_timer(IN:=FALSE, PT:=T#8s);
    s_timer(IN:=TRUE);
    IF s_timer.Q THEN s_state := 90; END_IF;

90: o_busy := FALSE; o_done := TRUE;
99: o_busy := FALSE; o_error := TRUE;
END_CASE;
INDEX 48 is the SINAMICS parameter-channel data record for writes; INDEX 47 is the read record. The HW ID is the PROFINET slot+subslot identifier exported by STEP 7 when you compile the HWCN — read it from the device's Properties dialog in HW Config or from the PLC tags view in TIA Portal. The above code is intentionally simple; in production add DONE-acknowledge from the HMI and a re-entrancy guard.

Implementing the Same Two-Write in STARTER / Startdrive

If you only need to fix one machine and do not want to add PLC code, the same two writes can be performed in the commissioning tool. The benefit is that STARTER's control panel does the writes in the right order automatically when you click Copy RAM to ROM after Absolute value calibration — but understanding the underlying parameter flow helps you debug.

  1. Go online to the CU305 PN. Open the drive (DO 1) and navigate to the Commissioning → Encoder work area.
  2. Click Absolute value calibration. This is the GUI button that, behind the scenes, writes p2507 = 2 and reads back r2526/r2527. The drive responds with bit status 7 = 1 (calibration successful).
  3. Now click the toolbar button Copy RAM to ROM. This writes p971 = 1. Wait for the green confirmation message; do not power-cycle the CU before the message appears. The message "Save to memory card successful" confirms persistence.

From this point onward, a passive home command followed by a power cycle should re-appear with the same actual-position value. If it does not, the issue is upstream — see the next section.

Verification: How to Prove the Datum Was Actually Saved

Merely observing the value across a power-cycle is necessary but not sufficient. Use the following checks to confirm the closed-loop model, not just the position display, has the new datum baked in.

  1. Pre-cycle read of p2599. Note the value, perform the passive home + p2507/p971 sequence, then power-cycle. Read p2599 again. It must be unchanged across the cycle.
  2. Read r2521.0 (encoder adjustment active). Bit 0 of r2521 / r2526 should read 1 after the cycle. If it reads 0, the adjustment bit did not survive the cycle and the encoder will re-derive position from the factory zero plus the absolute track only.
  3. Mechanical repeatability test. Move the axis back to the same mechanical reference (e.g. an external dial-indicator) and compare the actual position reading. The reading must be within one encoder increment after every power-cycle; the absolute encoder's singleturn resolution is typically 20-24 bits.
  4. Watch the r970/r971 status. After writing p971 = 1, r970 reads back 0 within ~10 s; r971 reads back 0 within ~10 s. If r971 stays at >0, the save is still in progress — do not interrupt.
  5. Check r997 (last save error code). A non-zero r997 indicates the save failed; refer to the SINAMICS parameter manual for the error code mapping. F30001 (save aborted) is the most common — typically caused by a card-full or by writing to a read-only project file.

Why "Active Homing" Doesn't Have This Problem

For comparison, the active homing sequence in SINAMICS p2596 = 1 behaves as follows:

  1. Operator issues an MC_Home (Mode = 0/6) or STARTER clicks "Home axis".
  2. Drive accelerates, detects the home switch, decelerates, captures the encoder index, and stops at the captured position.
  3. Drive writes the new datum internally and sets the adjustment bit p2525.0.
  4. STARTER displays the new actual position and offers a "Save all" button (which writes p971 = 1).

Active homing does not escape the need to write p971; it simply combines the datum-update step with the mechanical-search step. Engineers often believe that because active homing feels like a "first-time commissioning" step, the value is automatically persistent. It is not — without a p971 write, even an actively homed SINAMICS axis will forget the home on a power-cycle. The "Perform absolute value calibration" button in STARTER pairs both writes, which is why the field test in the source report succeeded on the calibration button but failed on a manual passive home command.

Troubleshooting Matrix: Common Failure Modes

Symptom Likely Cause Fix
Position reverts to a large number after power-cycle, but STARTER calibration works Passive home not followed by p2507 + p971 writes Implement the two-step save sequence
SFB 53 returns STATUS = 0xDF00_DE80 (busy) for p971 longer than 30 s Project is large; first save after firmware update is slower Increase SFB 53 TIMEOUT to 30–60 s; check r997
SFB 53 returns STATUS = 0xDF00_808x HW ID is wrong (subslot vs slot vs device) Re-grab the HW ID from the device Properties; re-compile HW
STARTER calibration button reports "absolute encoder not calibrated" Encoder is set to incremental in p0400 Set p0400 to a value that matches the absolute encoder (10000 series for singleturn, 10001+ for multiturn)
r2526.0 = 0 after p2507 = 2 Encoder still moving, or no-zero-shift blocked by p2513 Stop the axis, check p2513, repeat the write
Value survives power-cycle but drifts by one motor revolution Multiturn overflow (encoder revolutions > 4096) Set p0411 = 1 (configure gear) and p0412 = 1 (configure fine resolution); review the SINAMICS multiturn encoder notes
Position reverts to the same wrong value every power-cycle, with offset 0 only after absolute calibration The encoder adjustment was activated but the wrong parameter was written to ROM Verify p2599 is non-zero before the p971 write
SFB 53 reports STATUS 0x80C3 (access denied) Drive in commissioning mode (STARTER online) holding the write lock Take STARTER offline, or call SFB 52/53 from a CPU that has the write password

Edge Cases and Field-Proven Caveats

Hot-restart vs cold-restart. A brief DC-link undervoltage on a 24 V-backed CU does not reload the encoder model; it re-uses the RAM image. The lost-datum symptom only appears when the CU is fully de-energised long enough for the RAM refresh to drain (typically >5 s after 24 V removal). Diagnostically this is useful: if the symptom is intermittent on a noisy cabinet, look for 24 V dips, not 400 V mains drops.

Multi-axis projects. p971 = 1 saves all DO parameters of the CU. On a CU320-2 with six drives this can take 20-30 s. Do not serialise the saves per DO; one p971 call covers the whole CU. If you only need to save the current DO's parameters you can use p971 = 1 once after the last DO has been homed.

Card wear. The SINAMICS CF/SD card has a finite write endurance. Treat p971 as a maintenance-grade command; do not cycle it on every passive home, only on a controlled re-homing event. For machines that re-home on every cycle, consider keeping the home command in RAM only and accepting the re-homing step on next power-up.

Safety-Integrated drives. SI drives add p970 to the sequence. The recommended order is p970 = 1 (SI save), then p971 = 1 (parameter save). Performing p971 first and then p970 also works, but the SI checksum reconciliation will trigger a startup alarm that must be acknowledged.

Siemens S7-1500 / TIA Portal. The procedure is identical; only the call-block name differs. Use RDREC / WRREC (instructions) instead of the FBs from the standard library. The data record indices and request formats are unchanged.

Third-party controllers. If the master is not a Siemens PLC, drive the writes through the standard PROFINET record-data interface. Most non-Siemens PROFINET masters expose a generic "read/write record" function block. The only payload change is byte order — the SINAMICS parameter channel is fixed Big-Endian per the PROFIdrive profile, so the request bytes in the S7-300 code above are also correct for any PROFINET controller.

FAQ

Why does my SINAMICS absolute encoder forget the zero point after a passive home and power cycle?

Passive homing writes a new datum (p2599) to RAM only. The adjustment is not activated (p2507 is still 0) and not saved to non-volatile memory (p971 has not been written). When the CU powers down the runtime datum is lost, and the next boot reconstructs the position from the absolute encoder track + the last saved datum. Run p2507 = 2 then p971 = 1 to make the new datum survive the cycle.

Do I need SFB 52, SFB 53, or SFC 58/59 to write p2507 and p971 from an S7-300?

Use SFB 52 (RDREC) and SFB 53 (WRREC) for PROFINET devices. SFC 58/59 are the legacy names for PROFIBUS DP — they do not function on PROFINET IO. The SFB variant is correct for the CP 343-1 + CU305 PN combination; the parameter request payload is the same.

What is the difference between the "Perform absolute value calibration" button in STARTER and a passive home command from the PLC?

The STARTER button performs the equivalent of p2507 = 2 (activate encoder adjustment) and then prompts you to copy RAM to ROM (p971 = 1). A plain passive home command only writes the new actual position; it does not activate the adjustment or save it. To replicate the button from the PLC you must issue both parameter writes.

Can I just call p971 = 1 after every passive home to keep the value persistent?

Yes, technically, but it accelerates wear on the CU's CF/SD card. Limit p971 = 1 to deliberate re-homing events (a maintenance switch, an operator action) and avoid issuing it on every motion cycle. If the application re-homes continuously, consider a non-SINAMICS host controller that owns the home and re-derives it on the next boot from a marker switch.

Is this procedure the same on SINAMICS G120, S120, and CU305 PN?

Yes. p2507 and p971 are documented in the SINAMICS family-wide parameter manual and have the same effect on all current SINAMICS drives with absolute encoders. Differences are only in the surrounding parameter context (e.g. p2596 encoder adjustment selection) and in the telegram/sub-slot address exposed to the PROFINET master. Verify the parameter index of the drive object you are addressing — on multi-DO Control Units (CU320-2) the parameter channel is per DO, not per CU.

Back to blog