Referencing Absolute Encoders on Siemens Masterdrive MC Drives

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

Referencing Absolute Encoders on Siemens Masterdrive MC Drives

An absolute encoder is defined by its ability to retain shaft position across power cycles, which in theory eliminates the homing ritual demanded by incremental encoders. In practice, the answer to "do I still need to reference an absolute encoder?" is almost always yes, because what an absolute encoder really eliminates is the need to re-find the absolute position, not the need to align that absolute value to a machine zero. On the Siemens Masterdrive MC, this distinction is handled by a dedicated zero-offset parameter (P146) and a separate procedure that lets a maintenance technician or PLC redefine machine zero without disturbing the encoder itself.

This reference documents three field-proven methods for re-referencing the absolute encoder of a Siemens Masterdrive MC servomotor: mechanical endstop with torque sensing, reference-initiator homing via fast digital inputs, and direct modification of the encoder zero offset. Each method is mapped to the Masterdrive parameter set (P-numbers, KK connectors, FP free parameters) referenced in the MC V1.6 compendium, section 9.4.6 "Multiturn Encoder Evaluation".

1. Absolute vs Incremental Encoder Referencing Fundamentals

An incremental encoder reports relative motion; its output is a count of pulses that resets to zero at power-up. The controller has no way of knowing where the shaft actually sits in space until a homing routine drives the axis against a hard stop or index pulse and writes a zero mark into the controller's position variable. An absolute encoder, by contrast, reports a unique digital word for every shaft angle within its revolution range. For multi-turn devices this word extends across the entire travel of the axis. After a power cycle the controller re-reads the absolute word and resumes operation with the same position it had before.

The catch is the word "absolute" describes the encoder's view of the shaft, not the machine builder's view of the axis. Mechanical zero, the place where the operator wants position zero to be, rarely coincides with the encoder's internal zero. The Masterdrive MC solves this by treating the encoder's absolute value as the raw position and adding a software offset to produce the displayed and used position. That offset is parameter P146.1 (zero offset for encoder 1) per the Siemens Industry Online Support Masterdrive MC documentation.

For resolver-based absolute encoders, the reference (or primary) winding on the resolver rotor provides the absolute position information. Parker's encoder feedback overview describes how this reference winding is located on the resolver rotor and rotated by the servo motor shaft, providing a single-turn absolute reference even when multiturn battery-backed schemes are unavailable.

2. Why Re-Referencing an "Absolute" Encoder is Sometimes Necessary

The original field question was an apparently contradictory one: "My motor has an absolute encoder, so why do I ever need to re-home it?" The reason lies in three real-world failure modes:

  1. Mechanical slip or backlash shift. Coupling flex, gear backlash, or a loose pulley can let the load move a few encoder counts (or, in the worst case, many turns) relative to where the encoder last reported. The encoder is still absolute; it knows where the shaft is, but the shaft is no longer where the machine thinks it is.
  2. Lost machine zero after commissioning. During build, the machine builder set P146.1 to align encoder zero with mechanical zero. If the motor is later removed, replaced, or the absolute encoder's battery-backed multiturn counter has been allowed to discharge, the offset must be re-established.
  3. Process-induced drift. Belts stretch, gear teeth wear, and preloaded ballscrews develop backlash. An axis that was "perfectly" referenced on day one can be off by several millimetres a year later. The operator needs a one-button re-home that re-asserts machine zero without a full re-commissioning.

None of these conditions destroy the absolute value the encoder returns; they simply invalidate the relationship between the encoder value and machine coordinates. The Masterdrive MC lets you repair that relationship without rewiring the encoder, provided you choose the right procedure.

3. Method 1 — Mechanical Endstop with Torque-Limited Approach (P263)

This is the most universally applicable method because it requires no extra hardware beyond the mechanical endstop that already exists on most axes. The principle is to drive the motor slowly into the endstop under strict torque limiting, observe the torque build-up that signals mechanical contact, and at that moment write a new zero offset.

3.1 Sequence of operations

  1. Disable the position controller by clearing P210 (position controller enable) before the move.
  2. Set P263 (torque limitation) to a low value. 10% of rated motor torque is a typical starting point, then increase if the motor cannot overcome friction.
  3. Command the drive to run in speed-controlled mode toward the endstop.
  4. Monitor actual torque. A sharp rise above the baseline friction level signals contact with the endstop.
  5. At the moment of contact, set the new zero offset. The new value is calculated as:
    new_offset = old_offset - KK120
    where KK120 is the connector carrying the actual position value (raw or scaled per your configuration).
  6. Stop the drive, re-enable P210, and resume normal operation.

3.2 Why torque-limit rather than hard stop

A direct hard stop at full torque risks gear damage, belt stretch, and on a vertical axis a brief loss of control as the controller commands torque against an immovable object. Torque-limited approach lets the controller maintain a defined maximum force at the contact moment, which is well below the structural rating of the mechanical chain. The 10% figure is a conservative default; the actual value must be high enough to overcome static friction in the drivetrain but low enough to register a measurable torque bump when the endstop is reached.

3.3 Wiring P184 for the offset write

P184 is the position-offset parameter when written over Profibus. It accepts a DWORD (32-bit signed) that is loaded into the offset on the next permissible edge. The PLC must write old_offset - KK120 while the position controller is disabled (P210 = 0) or the drive is in standstill. Writing the offset while the controller is active will produce a position jump that the controller will attempt to follow as a step command, which is almost never what you want.

4. Method 2 — Reference Initiator Homing via Fast Digital Inputs (DI4/DI5)

Where a hardware reference initiator (proximity switch, limit switch, or zero-pulse) is available at a known machine position, the Masterdrive MC can latch the current position on a configurable edge and store it in a free parameter for later transfer to the offset. This is the closest analogue to incremental-encoder homing and is the method of choice for repeatable, automatic commissioning.

4.1 Hardware requirements

  • DI4 or DI5 on the Masterdrive MC terminal strip. These are the fast inputs, capable of latching within one T4 cycle.
  • A reference initiator wired to the selected DI. The initiator must be positioned so the load reaches it at low speed and the initiator's position relative to mechanical zero is mechanically repeatable.

4.2 Parameter configuration

  1. Configure DI4 or DI5 as a fast input via P647 or P648 respectively. Set the desired edge (rising for normally-open initiator, falling for normally-closed) per FP90.
  2. Enable the positioning sense memory by setting bit P179. The sense memory (FP330) latches the actual position on the configured edge.
  3. Move the axis toward the reference initiator in inch mode (low speed) with the position controller disabled.
  4. On the configured edge, output B212 is set for one T4 cycle (3.2 ms). The latched position value is available in connector KK122.
  5. Capture B212 in the PLC using an RS flip-flop. A single-cycle pulse of 3.2 ms is too short for most PLC scan cycles, so the flip-flop is mandatory. Without it, the event will be missed on all but the most precisely timed scan.
  6. Write the inverted KK122 value as the new positioning offset (P184 via Profibus, with the controller disabled).
Timing constraint: T4 on the Masterdrive MC is 3.2 ms. PLC scan cycles on S7-300/400 with default OB1 typically run 5-10 ms. The RS flip-flop is not optional. Without it, the B212 pulse will fall between two PLC scans and the homing event will be silently lost.

4.3 KK122 polarity

KK122 carries the position latched by the sense memory. The "inverted" qualifier in the source procedure means the new offset is the negation of KK122, or equivalently, the difference between the desired machine-zero value and the latched position. The exact sign convention depends on your scaling configuration. In commissioning, always verify the new position is zero at the initiator before saving the parameter set.

5. Method 3 — Direct Zero Offset Modification (P146.1)

For axes that never lose mechanical zero but need a software zero shift, because, for example, the workpiece datum on a CNC table was redefined, Method 3 is the lightest touch. It does not move the motor at all; it simply rewrites P146.1.

5.1 When to use this method

  • The mechanical relationship between encoder and load is intact.
  • You only need to redefine machine zero in software.
  • The axis is stationary and the position controller is disabled during the write.

5.2 Procedure

  1. Bring the axis to a controlled stop.
  2. Disable the position controller (P210 = 0).
  3. Read KK120 (actual position) from the drive.
  4. Calculate new_P146.1 = current_P146.1 - KK120 if you want the displayed position to read zero at the current shaft angle, or apply any desired shift.
  5. Write the new value to P146.1 via the parameterisation interface (Profibus, SIMOVIS, or the BOP).
  6. Verify by reading KK120 again; it should now report zero (or the value you intended).
  7. Re-enable P210.

Section 9.4.6 of the Masterdrive MC V1.6 compendium ("Multiturn Encoder Evaluation") and its sample calculation cover the same arithmetic for the case where the encoder is multiturn and the offset must remain within the encoder's revolution range to avoid a wrap.

6. Masterdrive MC Parameter Reference Table

The following table consolidates every parameter referenced in the three procedures above. Use it as a quick lookup during commissioning or troubleshooting. Parameter numbers and connector designations follow the Siemens Masterdrive MC parameter list as documented in the V1.6 compendium.

Parameter Function Used In Method Notes
P146.1 Zero offset for encoder 1 Method 3 Software zero; persists across power cycles if saved.
P179 Enable positioning sense memory Method 2 Bit parameter; must be set before homing move.
P184 Position offset (Profibus DWORD) Methods 1 and 2 Write only; never write while controller active.
P210 Position controller enable All methods Clear before any offset write.
P263 Torque limitation Method 1 10% default; tune to drivetrain friction.
P647 DI4 configuration (rising edge) Method 2 FP90 selects edge type.
P648 DI5 configuration (falling edge) Method 2 FP90 selects edge type.
KK120 Connector: actual position Methods 1 and 3 Read for offset calculation.
KK122 Connector: sense memory value Method 2 Read after B212 fires; use inverted value.
B212 Output: reference point stored Method 2 3.2 ms pulse; latch in PLC.
FP90 Free parameter: edge type Method 2 Configures DI4/DI5 trigger edge.
FP330 Free parameter: position sense memory Method 2 Latches on enabled edge.
T4 Time base: 3.2 ms Method 2 Defines B212 pulse width.

7. Profibus Integration and PLC Code

All three methods require the PLC to write to P184 (Profibus position offset) or P146.1 (zero offset) at the right moment in the sequence. On a Profibus class-2 connection, parameters are accessed via the standard PKW (Parameter-Kennung-Wert) mechanism. The offset parameter is a DWORD; the zero offset may be a 32-bit integer or a fixed-point value depending on the scaling you have configured. Always check the parameter list in the V1.6 compendium for the exact data type and scaling before writing.

7.1 Sequence for Method 1 in S7 STL

// Method 1 - Endstop homing sequence
// Assumes Profibus-DP connection, Masterdrive MC at PROFIBUS address 4

// 1. Disable position controller
     L     0
     T     DB10.DBX 4.0      // Control word to drive - clear P210 enable bit

// 2. Set torque limit to 10% via P263 (read-modify-write if other bits used)
     L     100
     T     DB10.DBW 10       // P263 = 10.0 % (scaling per parameter list)

// 3. Start speed-controlled move toward endstop
     SET
     S     DB10.DBX 6.0      // Speed-controlled operation bit

// 4. Wait for torque threshold (monitor drive-specific torque connector)
//    Application-specific delay or torque-level check here.

// 5. Compute new offset: old_offset - KK120
     L     DB10.DBD 20       // Old offset (cached locally)
     L     DB10.DBD 24       // KK120 actual position
     -D
     T     DB10.DBD 28       // New offset

// 6. Write new offset to P184 via PKW
     CALL  FB  100, DB100    // Standard Siemens DP write FB for PKW
      PKE   := W#16#00B8     // P184 - verify PKE against live parameter list
      IND   := B#16#0
      PWE   := DB10.DBD 28   // New offset DWORD
      ...

// 7. Stop drive, re-enable position controller
     CLR
     R     DB10.DBX 6.0      // Stop
     L     1
     T     DB10.DBX 4.0      // Set P210 enable bit
Production code: The snippet above is illustrative. Production homing logic must include timeout handling, abort conditions, and explicit state machine management. The Profibus PKE for P184 is shown as a placeholder; verify the exact value against the live parameter list for your firmware version (V1.6 compendium or later).

7.2 Capturing B212 with an RS flip-flop

The 3.2 ms pulse on B212 is shorter than one OB1 scan on most S7-300/400 configurations. The standard remedy is to latch the pulse in the PLC with an RS flip-flop polled on every scan, then clear the flip-flop from the homing-sequence logic once KK122 has been read. For S7-1200/S7-1500 on Profinet-to-Profibus gateways, use a hardware interrupt OB or a fast input on the CPU in addition to the flip-flop, so the B212 edge cannot be missed regardless of OB1 phase.

8. Verification and Commissioning Checks

After any of the three procedures, the following verification sequence confirms the new reference is correct and the drive is safe to return to automatic operation.

  1. Read back the new offset. Confirm P146.1 (Method 3) or P184 (Methods 1 and 2) holds the value you wrote. A failed PKW write typically leaves the old value and reports an error code in the parameter channel.
  2. Move to a known mechanical position. Jog the axis to a datum point that has a physical reference (a marked position, a gauge block, or a known tool offset). Read KK120; it should equal the expected machine coordinate at that point.
  3. Cycle power. Power down and back up to confirm the new offset is retained (it will be if you saved the parameter set) and that the absolute encoder reads the expected value at the same physical position.
  4. Run a full travel move. Command a move across the full working range with the position controller enabled. Verify the displayed position matches expected coordinates at start, mid-travel, and end.
  5. Check fault buffer. Read the drive's fault buffer (typically via the parameterisation interface). A reference write attempted while the controller was enabled produces a fault that must be cleared before resuming automatic operation.

9. Troubleshooting Matrix

Symptom Likely Cause Diagnostic Step Corrective Action
Position jumps after homing P184 written while position controller was active (P210 = 1) Check fault buffer for "parameter write during operation" event Repeat procedure with P210 cleared; verify drive is in standstill before PKW write
Reference initiator event lost PLC scan missed the 3.2 ms B212 pulse Check RS flip-flop state; trace B212 with scope or HMI trace Add RS flip-flop; use fast input or hardware interrupt on S7-1200/1500
New offset not retained after power cycle Parameter set not saved Read P146.1 after power cycle; compare to value written Save parameter set to non-volatile memory (SIMOVIS or Profibus save command)
Endstop torque not detected P263 set too low to overcome static friction Monitor actual torque during approach; compare to friction baseline Increase P263 in 5% increments until contact torque is detectable
Drive faults on homing move Speed setpoint too high or torque limit too low Check fault code against Masterdrive MC fault list Reduce inch-mode speed; raise torque limit slightly
KK122 reads garbage after B212 Sense memory not enabled (P179 bit clear) Read P179; verify bit is set before homing move Set P179 enable bit; repeat homing move
Offset wraps past encoder range P146.1 set outside multiturn encoder's revolution window Check absolute encoder revolutions against P146.1 value Apply modulo reduction per MC V1.6 compendium section 9.4.6

10. Practical Field Notes

Three operational lessons that consistently surface during commissioning of Masterdrive MC absolute-encoder axes:

Save the parameter set after every successful reference. A new P146.1 written over Profibus lives in volatile memory until explicitly saved. A power cycle without the save step throws the new reference away. Train operators to confirm the save, not just the write.

Prefer Method 2 for repeatable production axes. The reference initiator approach is deterministic, independent of friction or load variations, and easy to verify with a trace. Methods 1 and 3 are appropriate for commissioning and one-off re-references but introduce operator-dependent variability that is hard to repeat in a high-mix production environment.

Multiturn wrap is the silent failure mode. If the machine zero shift you apply to a multiturn absolute encoder pushes the offset past the encoder's revolution window, the drive will not fault; it will silently wrap the position. The axis will then be off by the encoder's full revolution count (for example 4096 or 8192 counts) and the operator will not notice until the next move exits the working envelope. Section 9.4.6 of the V1.6 compendium gives the modulo calculation that prevents this.

Frequently Asked Questions

Do I need to home an absolute encoder on a Masterdrive MC?

No, not in the incremental-encoder sense. The absolute value is retained across power cycles. However, you do need to define the offset (P146.1) that maps the encoder's internal zero to your machine zero, and you may need to re-establish that offset if the mechanical relationship changes due to load shift, belt stretch, or component replacement.

Which parameter holds the zero offset on the Masterdrive MC?

P146.1 (zero offset for encoder 1). This is a software offset added to the encoder's absolute position to produce the displayed and used position. Section 9.4.6 of the MC V1.6 compendium covers the parameter and provides a sample calculation for multiturn encoders.

Can I write the new offset while the drive is running?

No. Writing P184 (Profibus position offset) or P146.1 (zero offset) while P210 (position controller enable) is set will produce a position step that the controller will attempt to follow as a commanded move. Always disable P210 and bring the drive to a controlled stop before any offset write.

How do I catch the 3.2 ms B212 pulse in a PLC?

B212 is high for exactly one T4 cycle (3.2 ms) when the positioning sense memory is triggered. On S7-300/400 with default scan times of 5 to 10 ms, the pulse will almost certainly fall between two OB1 scans. Latch B212 with an RS flip-flop read every cycle, then clear the flip-flop from your homing-sequence logic once you have read KK122. On S7-1200/1500, also wire a hardware interrupt OB or use a fast CPU input for redundancy.

What torque limit should I use for the endstop approach in Method 1?

Start at 10% of rated motor torque and adjust. The value must be high enough to overcome static friction in the drivetrain (belt preload, gear mesh, ballscrew preload) but low enough that a sharp torque rise is detectable when the endstop is contacted. If no torque rise is visible, increase P263 in 5% steps until contact is clearly distinguishable from friction baseline.

Back to blog