Configuring Siemens External Encoder TO Fine Resolution

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

Configuring Siemens External Encoder TO Fine Resolution: Heidenhain AT1218

The Heidenhain AT1218 absolute linear encoder exposes a 23 nm position value through an EnDat 2.2 interface. When the encoder is connected to a SIMATIC S7-1500 or S7-1200 controller over PROFINET through an EnDat-to-PROFINET gateway using PROFIdrive telegram 81, the drive-side process data is consumed by the External Encoder technology object (TO). A common commissioning failure is that the measured actual position reported by the TO appears scaled incorrectly. In the case documented in field service, a 12 mm mechanical motion produced a 6 µm reported value because the fine resolution parameter in the TO did not match the fine resolution bits actually published in the PROFIdrive process data. This reference explains the underlying PROFIdrive mechanics, the TO configuration parameters, the verification procedure, and the field-proven fix.

Problem Overview: Symptom and Initial Observations

The reported field case used a Heidenhain AT1218 absolute linear encoder (23 nm resolution) connected through a PROFINET gateway to a SIMATIC S7-1500. Telegram 81 was selected on the gateway so the encoder could be mapped as a position-only PROFIdrive axis. The commissioning engineer used the G1_XIST1 cyclic process word to verify the raw counts:

  • Initial G1_XIST1: 2,445,108 increments
  • Final G1_XIST1: 2,998,420 increments
  • Increment delta: 553,312
  • Mechanical travel: 12 mm (12,000,000 nm)
  • Computed travel from raw counts: 553,312 × 23 nm = 12,726,176 nm ≈ 12.73 mm

The raw PROFIdrive counts were therefore correct. The fault appeared inside the technology object: the TO's ActualPosition read only 6 µm for the same 12 mm of mechanical travel. The ratio of the two values (12 mm / 6 µm = 2000) is the diagnostic fingerprint of a fine-resolution factor that is exactly 2,000× too high. This is the precise signature of a fine resolution mismatch between the encoder's EnDat fine bits and the TO's configured fine resolution.

Symptom fingerprint: the raw G1_XIST1 increment delta multiplied by the encoder's data-sheet resolution matches the mechanical travel to within sub-micron accuracy, while the TO's ActualPosition returns a value that is an integer power of two smaller. The scaling factor is almost always of the form 2n × 1, 2, 5, or 10, which is the diagnostic for an incorrect fine resolution parameter.

PROFIdrive Telegram 81: G1_XIST1 and G1_XIST2 Architecture

Telegram 81 is a compact, encoder-only PROFIdrive frame defined in the PROFIdrive profile (PNO order no. 3.172). It is intended for passive encoders, position-only devices, and gateways that publish raw or pre-scaled position values. The two principal process data words are:

Process word Direction Length Content Purpose
STW1_ENC Controller → Encoder 16 bits Encoder control word Find reference mark, freeze, etc.
G1_XIST1 Encoder → Controller 32 bits Position value 1 (coarse + optional fine) Cyclic actual position
G1_XIST2 Encoder → Controller 32 bits Position value 2 (fine resolution bits) Optional fine resolution, alarm, status
ZSW1_ENC Encoder → Controller 16 bits Encoder status word Status / error bits

Two key points are often misunderstood. First, G1_XIST1 is the cyclic position the controller uses for closed-loop control. Second, the fine resolution of the encoder is an attribute of G1_XIST1 and/or G1_XIST2, not of the encoder's physical line count. The fine resolution specifies how many of the least-significant bits (LSBs) of G1_XIST1 represent the encoder's sub-incremental fine interpolation. For a Heidenhain EnDat 2.2 encoder that produces 23 nm of mechanical resolution per increment and publishes the position in nanometers, the gateway must decide how to break that 32-bit word into coarse and fine portions. The TO must be told how the gateway decided.

Engineering rule: in PROFIdrive, the fine resolution is an attribute of the process interface, not of the encoder mechanics. Two gateways connected to the same physical encoder can publish it with different fine resolution settings. The controller must therefore be configured to match the specific gateway's behaviour, not the encoder's data sheet.

Understanding Fine Resolution in PROFIdrive Encoders

Fine resolution describes how many LSBs of G1_XIST1 the controller must right-shift to recover the coarse (integer-multiple) part of the position. The PROFIdrive profile allows a range of 0 to 16 fine bits. Typical field values are:

  • 0 fine bits: the entire 32-bit word is coarse; no fine interpolation is exposed.
  • 2 fine bits: useful for resolvers and incremental encoders with ×4 hardware interpolation.
  • 10 to 13 fine bits: common for high-resolution EnDat or SSI absolute encoders where the lower bits represent sub-incremental interpolation.
  • 16 fine bits: the maximum allowed by PROFIdrive; lower 16 bits are fine, upper 16 bits are coarse.

The TO uses the configured fine resolution to mask the lower bits of G1_XIST1 before scaling the count into the user's length unit. The formula the TO applies internally is:

ActualPosition [LU] = (G1_XIST1_raw >> FineResolution_bits) × LengthUnit_per_Increment

If G1_XIST1_raw is already expressed in 23 nm increments and the gateway does not shift the value, then the correct value of FineResolution_bits is the value the gateway has already applied. If the gateway already left-shifts the lower 11 bits into the upper word, the TO must be told that the fine resolution is 0 — the lower bits are not sub-incremental fine interpolation, they are part of the coarse position.

Root Cause: Fine Resolution Mismatch in the TO Configuration

In the documented case, the gateway pre-formatted the AT1218 EnDat 23 nm increments into G1_XIST1 without leaving additional fine bits reserved. The TO, however, was configured with a non-zero fine resolution (a default 11- or 12-bit value commonly used for direct EnDat masters). The TO then double-shifted the value, throwing away 2,000× the actual count, which produced the 12 mm → 6 µm error. The root cause is therefore not in the encoder, not in the gateway, and not in the wiring — it is in the TO's interpretation of the gateway's process data.

The field-proven fix is to set the TO's Fine resolution parameter to 0 (or, more generally, to the exact number of fine bits the gateway is publishing in G1_XIST1). This is documented in the official Siemens FAQ referenced in the support.industry.siemens.com portal: Siemens Support Entry 109486133 – Configuration of external encoders for S7-1500 Motion Control, section 4.2.2.

Configuring the External Encoder TO in TIA Portal

The External Encoder technology object is added from the project tree under Technology Objects → Add new object → Motion Control → External Encoder. The configuration dialog exposes the parameters that govern the position interpretation:

Parameter Default Field-relevant value (AT1218 case) Meaning
Encoder type Incremental Absolute (PROFIdrive) Selects whether G1_XIST1 is treated as a wrap-around counter or an absolute value.
Data length of the position value 32 bits 32 bits Bit width of G1_XIST1 as published by the gateway.
Fine resolution 0 (display depends on firmware) 0 Number of LSBs in G1_XIST1 representing fine interpolation.
Resolution per increment 1 23 nm / 1 nm = 0.023 µm or 23 in 1 nm unit Mechanical length per encoder increment. Must match the gateway's interpretation of the encoder's resolution.
Denominator / Numerator 1 / 1 1 / 1 Optional rational scaling factor between raw count and user length unit.
Number of revolutions / Measuring range 1 / 1 Not used for linear Only for rotary / multi-turn devices.
Unit trap: when Resolution per increment is set to 23 in the unit nm, the TO multiplies the count by 23 to obtain the position in nanometres. If the unit is µm, set the value to 0.023. Mixing the unit system of the HMI/Pole with the TO's internal representation is the second most common cause of off-by-1000 errors on this type of system.

The Fine resolution field accepts integer values from 0 to 16. For S7-1500 firmware versions 2.5 and later (motion control V4.0 and above), the parameter is editable in the configuration dialog. For older TIA Portal V13/V14 projects against S7-1500 firmware 1.x, the value is read from the encoder's G1_XIST2 and the parameter is greyed out; in that case the gateway must be reconfigured to publish zero fine bits.

Step-by-Step Resolution Procedure

  1. Stop the axis. Bring the axis to a safe state, disable the controller enable on the TO, and place the CPU in STOP only if the gateway configuration requires a download. Cyclic reads of G1_XIST1 are non-disruptive and can be performed in RUN.
  2. Verify the mechanical travel with a gauge block or laser interferometer. Move the axis a known distance (the field case used 12 mm). Record the value before and after the motion.
  3. Read G1_XIST1 before and after the motion. Use a watch table on the I/O address of G1_XIST1 (typically mapped as a DWORD on the PROFINET slot) or use the online diagnostics of the gateway's GSDML. Compute the increment delta Δ.
  4. Compute the implied increment resolution: resolution = mechanical_travel / Δ. For the documented case this is 12,000,000 nm / 553,312 = 21.69 nm ≈ 23 nm, confirming the gateway is publishing 23 nm increments.
  5. Open the External Encoder TO configuration in TIA Portal. Navigate to Configuration → Encoder parameters → Fine resolution.
  6. Set Fine resolution = 0 (or, if the gateway is documented to publish a different number of fine bits, set the parameter to that exact value). Compile and download the project.
  7. Set Resolution per increment to the unit-correct value. For nanometre units and 23 nm increments, enter 23. For micrometre units, enter 0.023.
  8. Re-initialize the TO. In RUN, perform a TO reset on the External Encoder, then re-enable and re-home the axis if the application uses absolute referencing.
  9. Repeat the verification move from step 2 and confirm the TO's ActualPosition reports the correct travel within the encoder's specified accuracy class.
Always restart the technology object after changing the Fine resolution parameter. The TO caches the fine bit mask at initialization; simply recompiling and downloading without a TO restart leaves the old mask active, and the symptom will appear to persist.

Verification Procedure and Acceptance Test

After applying the fix, perform a quantitative acceptance test before returning the machine to production:

  1. Move the axis exactly one full encoder measuring length (for the AT1218 this is the length printed on the scale housing, not the test distance). Read the TO's ActualPosition delta. The expected value is the data-sheet measuring length within the encoder's accuracy class (typically ±2 µm to ±5 µm for the AT1218 depending on the grade).
  2. Compute the scaling error: error = (TO_delta - reference_travel) / reference_travel × 106 ppm. Acceptable error is below the encoder's accuracy class plus the laser interferometer uncertainty (typically 1–2 µm on a 12 mm to 3 m travel).
  3. Repeat the test in both directions and at multiple positions across the measuring length. A non-zero fine resolution parameter typically shows a constant scaling factor (no position-dependent drift), so a single good test is usually sufficient, but a five-position test catches wiring polarity errors and noise-induced LSB jitter.
  4. Verify the TO's StatusWord reports Encoder_OK and that PositioningStatus.EncoderHomed is true if the application uses absolute referencing.

EnDat-to-PROFINET Gateway Behaviour

The Heidenhain AT1218 uses the EnDat 2.2 serial protocol. Direct EnDat masters are available on certain Siemens drives and on the SIMOTION / SINUMERIK product lines, but the S7-1500 / S7-1200 External Encoder TO requires a PROFINET interface. A gateway — Heidenhain's own EnDat-to-PROFINET bridge, or third-party gateways from Hilscher, Helmholz, and others — converts the EnDat frames to PROFIdrive. The gateway is responsible for:

  • Decoding the EnDat 2.2 position value and transmitting it to the controller as G1_XIST1.
  • Choosing how many bits of G1_XIST1 represent fine resolution. Different vendors make different default choices, and the value is usually configurable in the gateway's web interface or GSDML-based parameter editor.
  • Periodically refreshing the EnDat position and flagging a Position error bit in ZSW1_ENC if the EnDat link is disturbed.

The first action during commissioning should always be to open the gateway's configuration tool and record the published fine resolution. If the gateway cannot be inspected, the empirical procedure in step 3 of the resolution list above is sufficient: compute the implied increment resolution and reconcile it with the data-sheet value.

Vendor-specific defaults: a Heidenhain EnDat-to-PROFINET gateway typically publishes zero fine bits when configured for direct-nanometre mode. Some third-party gateways default to 10–12 fine bits and assume the controller will right-shift. Always verify the gateway's documentation rather than relying on the TO's default.

Heidenhain AT1218 Linear Encoder Specifications

The AT1218 belongs to Heidenhain's exposed linear encoder family. It is a small-format absolute linear scale with the following data-sheet characteristics (verify against the current Heidenhain product documentation before commissioning, as specifications change between catalogue revisions):

Parameter Value Notes
Measuring standard Steel scale tape, exposed Susceptible to contamination; requires sealing in dirty environments.
Interface EnDat 2.2 Serial, bidirectional; supports incremental and absolute position.
Resolution 23 nm (≈ 0.023 µm) Set by the EnDat interpolation factor inside the scanning head.
Accuracy grade ±2 µm to ±5 µm (per measuring length) Depends on the chosen accuracy class; check the scale housing label.
Measuring length 70 mm to 3,040 mm (model-dependent) The '12 mm' in the field case was a test motion, not the encoder's full range.
Power supply 3.6 V to 14 V DC (EnDat spec) Provided by the gateway or master.
Clock frequency ≤ 8 MHz (EnDat 2.2) Cable length derating applies; ≤ 40 m total.

For general background on how linear encoder resolution is defined and differs from rotary pulse-per-revolution metrics, see Encoders Explained (AutomationDirect Technical Library, Issue 25, 2013). The reference explains that linear resolution is expressed in increments per unit length, and that the same nominal nm value can be achieved by different physical grating pitches depending on the interpolation factor inside the scanning head.

Field-Proven Diagnostics and Common Pitfalls

The following matrix maps the most common commissioning errors on a Siemens External Encoder TO with a Heidenhain absolute linear encoder, the symptom each produces, and the first diagnostic step.

Symptom Most likely cause Diagnostic step
Position off by a power of 2 (e.g. ×2, ×4, ×2048) Fine resolution parameter set incorrectly Compute implied resolution from G1_XIST1 delta and mechanical travel; set Fine resolution to 0 if the gateway already removed the fine bits.
Position off by 1000× Unit mismatch (mm vs µm vs nm) Verify the Length unit system in the TO configuration and the HMI scaling block.
Position jumps by 360° at each power-up Modulo configured for a rotary axis on a linear encoder Disable Modulo / set Endless axis = No on the TO.
Position drifts continuously while the axis is stationary Electromagnetic interference on the EnDat cable, or shield not terminated at the gateway gland Check the cable shielding, separation from VFD power cables, and the gateway's diagnostic counters.
TO reports Encoder error / Data invalid after each power cycle Encoder reference not acknowledged, or absolute position not yet read across the EnDat link Wait one EnDat cycle (typically 50–200 ms), or perform a homing reference run if the application does not require absolute start-up.
Position correct at cold start, drifts 1–2 µm per hour Thermal expansion mismatch between scale and machine Check the compensation table in the TO, or the machine's reference temperature; consider a thermal compensation sensor input.
TO reports position but axis cannot be enabled Encoder not assigned to a positioning axis / TO is not linked Verify the Encoder interconnection on the axis TO and the symbolic link to the External Encoder TO.
Do not change the Fine resolution parameter while the axis is enabled. The TO's diagnostic interface logs the parameter change, but the cached mask is not refreshed until the next initialization. This produces a confusing state where the configuration shows the new value but the runtime behaviour reflects the old one. Always cycle the TO enable after a Fine resolution change.

Summary of Field-Proven Best Practices

  • Always record the raw G1_XIST1 delta for a known mechanical travel before changing any TO parameter. This single measurement isolates the encoder and the gateway from the TO's interpretation layer.
  • If the computed increment resolution matches the data sheet, the gateway is correct. The fault is then in the TO, almost always in the Fine resolution parameter.
  • If the computed increment resolution does not match the data sheet, the gateway's parameterization is wrong; fix it on the gateway side and re-test before touching the TO.
  • Treat the Fine resolution parameter as the contract between the gateway and the TO. It must be the exact number of fine bits the gateway leaves in the lower portion of G1_XIST1, not the fine bits the encoder itself produces.
  • When in doubt, set the Fine resolution to 0 and the Resolution per increment to the data-sheet value in the chosen length unit. This is the safest starting point for any 23 nm EnDat encoder wired through a Heidenhain EnDat-to-PROFINET gateway.

Why does my Siemens External Encoder TO show exactly 6 µm of travel when the axis moves 12 mm with a 23 nm Heidenhain AT1218?

This 2000:1 ratio is the diagnostic fingerprint of a fine resolution parameter that is set too high. The raw G1_XIST1 counts are correct (12 mm × 553,312 increments × 23 nm verifies the encoder and gateway). The TO is right-shifting the value by 11 bits (211 = 2048) more than it should. Set the TO's Fine resolution to 0 if the gateway publishes zero fine bits, recompile, and re-initialize the TO.

How do I know whether the fine resolution should be 0 or a non-zero value on my External Encoder TO?

Move the axis a known mechanical distance, read the G1_XIST1 delta, and compute the implied increment resolution. If it matches the encoder data sheet (23 nm for the AT1218), the gateway has already removed any fine bits and the TO should be set to 0. If the implied resolution is smaller than the data sheet by a power of 2, the gateway is leaving fine bits in G1_XIST1 and the TO must be set to that exact bit count.

Where is the Fine resolution parameter exposed in TIA Portal?

Open the External Encoder technology object, navigate to Configuration → Encoder parameters → Data length / Fine resolution. The parameter is editable on S7-1500 CPUs with motion control firmware V4.0 and above (TIA Portal V15.1 and later). For older firmware, the value is read from G1_XIST2 and the parameter is greyed out; in that case the gateway must be reconfigured.

Do I need an absolute homing run after changing the Fine resolution parameter?

Yes, if the axis uses absolute referencing. The TO clears its absolute position reference on parameter changes that affect position interpretation, and the next power-up or restart will require a re-home. Incremental applications that re-reference on every cycle do not need a special procedure beyond the standard re-homing motion.

What is the difference between Fine resolution and Resolution per increment in the TO?

Fine resolution is the number of lower bits in G1_XIST1 that the TO must mask off as sub-incremental fine interpolation. Resolution per increment is the mechanical length (in the chosen length unit) of one full coarse increment. For the AT1218, Resolution per increment is 23 when the unit is nanometres, or 0.023 when the unit is micrometres. The two parameters multiply together; getting either one wrong produces a scaled but stable error.

Back to blog