Resolving SIMOTION D425 External Encoder Gearing Modulo 360°

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

Resolving SIMOTION D425 External Encoder Gearing Modulo 360° Speed Spikes

Electronic gearing on a SIMOTION D425 controller using a Drive-CLiQ external encoder as master and a 1FK7 servo as slave is a common topology for printing, web handling, and converting machinery. When the external encoder is configured as a 360° modulo rotary axis and a sudden velocity/acceleration jump appears exactly at the rollover boundary (359.999° → 0.000°), the slave axis inherits the spike as a real mechanical excursion on the belt. This article walks through the root-cause analysis, the encoder Technology Object (TO) configuration that eliminates the artifact, and the field verification steps.

1. Problem Description

The reported symptoms on the original commissioning platform are:

  • Topology: SIMOTION D425 + SINAMICS S120 (or similar) with one Drive-CLiQ external encoder (absolute, rotary) as the master and a 1FK7042 servo with an absolute encoder as the slave.
  • Application: Electronic gearing. The slave follows the master encoder position with a configurable transmission ratio.
  • Master encoder type: Rotary, modulo 360°.
  • Observed fault: Master speed trace shows a sharp velocity/acceleration excursion at the 0°/360° rollover boundary even though the mechanical rotation is steady.
  • Downstream effect: The 1FK7042 slave reproduces the spike. The connected belt shows a visible jerk at every modulo transition.

Because the disturbance is exactly periodic with the encoder zero transition, it is almost always a software/math artifact in the encoder Technology Object — not a mechanical phenomenon.

2. Root-Cause Analysis

There are four realistic root causes for a modulo rollover spike in a SIMOTION electronic-gearing configuration, ordered by probability for this specific symptom set:

# Cause Diagnostic Signal
1 External encoder TO is configured as LINEAR instead of ROTARY; SIMOTION then wraps the position internally and the wrap arithmetic introduces a derivative discontinuity in velocity. Trace actualPosition of the encoder TO; if the displayed value resets sharply from +max to -max, the TO is linear with modulo wrapping applied as a clamping step.
2 Gearing is implemented as velocity gearing on a rotary modulo axis. SIMOTION velocity-gearing paths expect a non-modulo master and use a transmission ratio GR = 1; derivative-based coupling can spike on rollover. Check the gearing block: PositionGearing vs VelocityGearing; verify GearRatio.Numerator / Denominator.
3 The Drive-CLiQ encoder is configured with an internal gearing factor (load-side vs motor-side resolution) that amplifies the modulo wrap. Open the encoder TO Configuration → Encoder → Gear factor and confirm a 1:1 stage between the physical encoder and the TO.
4 The reported "mechanical" variation is real — backlash, eccentric pulley, or shaft twist in the encoder mount. Disable the slave and capture the master velocity at high sampling rate on a storage scope via trace. If the spike survives without gearing, suspect mechanics.
Field-proven rule: If the spike only appears when a downstream axis follows the encoder, but disappears when the same encoder TO is traced in isolation, the problem is in the gearing path or the encoder TO type, not in the hardware.

3. Confirm the Encoder Technology Object Type

The single most common root cause for this exact symptom is an External Encoder TO that was inserted as LINEAR and later had its modulo values forced on. SIMOTION must be told explicitly that the encoder is rotary so that it performs continuous modulo arithmetic on the position, and continuous (wrapped) differentiation on the velocity.

  1. In SCOUT / TIA Portal (with SIMOTION option pack), open the project and navigate to the External Encoder Technology Object in the axis tree.
  2. Open Configuration → Mechanics.
  3. Set Type of axis = ROTARY. The setting is binary; the alternatives are LINEAR and ROTARY.
  4. Confirm Modulo range = 360° (or the value matching the physical encoder, typically 360° for a single-turn rotary encoder).
  5. Compile and download to the D425.

This procedure and the rotary/linear selector are documented in the SIMATIC AX online manual under the "Configure the type of an external encoder" topic: Configure the type of an external encoder – SIMATIC AX Manual.

Why this works: A rotary TO in SIMOTION uses modulo-2π (or modulo-360°) arithmetic on the actual position. The velocity is computed as a circular difference, not a clamped difference, so the derivative is continuous across the rollover. A linear TO with a "modulo equivalent" set in user code still performs a clamped subtraction, which produces an apparent infinite acceleration spike once per revolution.

4. Select the Correct Gearing Mode

SIMOTION offers two gearing primitives. The choice matters when the master is rotary and modulo:

Parameter _posGearing (PositionGearing) _velGearing (VelocityGearing)
Master type Linear or rotary (modulo or absolute) Linear only; expects non-modulo master
Coupling variable Position Velocity (derivative of master position)
Transmission ratio GR Numerator/Denominator; can be ≠ 1 Effectively 1; derivative-based
Behavior at modulo rollover Smooth — wraps the master position continuously Spikes — differentiation of the modulo transition yields a Dirac-like acceleration pulse
Recommended for this topology Yes No

Implementation in Structured Text on the D425:

// IPO task, called every IPO cycle
IF bEnableGearing THEN
    // _setMasterPosition accepts a rotary-modulo source
    _setMasterPosition(encoder := TO_EncoderExternal,
                       position := TO_EncoderExternal.actualPosition);
    _posGearing(slave := TO_Axis_Slave,
                master := TO_EncoderExternal,
                gearRatioNumerator := 1,
                gearRatioDenominator := 1,
                enable := TRUE);
ELSE
    _posGearing(enable := FALSE);
END_IF;

If the original program is using _velGearing, replace it with _posGearing on a rotary-modulo master. If the application genuinely requires a velocity-coupling behavior, the recommended pattern is to keep _posGearing and instead add a velocity feedforward or a low-pass filter on the slave velocity setpoint (see §6).

5. Check the Encoder Drive-CLiQ Configuration

The Drive-CLiQ encoder is auto-registered in the topology editor when it is plugged into a free Drive-CLiQ port of the D425 or its connected SINAMICS Line Module. Verify the following:

  1. Open Topology in SCOUT. The encoder appears under the D425 (or NX module) with its part number and firmware version. Accept the actual topology if it differs from the offline project.
  2. Open the Drive object that was created for the encoder. The default is Sensor Module + Drive pair.
  3. Confirm the encoder type: Configuration → Encoder → Type should read Rotary, single-turn or Rotary, multiturn, never Linear.
  4. Confirm Fine resolution (increments per revolution) and Gear factor are at the default 1:1 unless a mechanical ratio is required.
  5. Save, compile HW Config, and download to the D425.
Tip: If the Drive object for the external encoder was created with a default "LINEAR" profile, deleting the drive and re-inserting it from the catalog (with the correct rotary catalog entry) is often faster than patching individual parameters.

6. Add a Low-Pass Filter if Mechanical Ripple Remains

After steps 3–5, the modulo-rollover derivative discontinuity is gone. If a smaller, broadband ripple is still present (for example, from an eccentric encoder pulley or from the 1FK7042 load-side coupling), apply a low-pass filter to the encoder TO output:

  1. Open the External Encoder TO → Configuration → Filter.
  2. Enable Velocity filter with a time constant T_filter in the range 1–10 ms (start at 3 ms).
  3. If the slave still follows the residual ripple, add the same filter to the slave axis (TO_Axis_Slave → Position control → Velocity setpoint filter).
  4. Re-trace and confirm.

Do not increase T_filter beyond ~10 ms for a belt-driven slave — the added phase lag shows up as a lag error on every slave position command and can be misinterpreted as a gearing problem on its own.

7. Capture a Verification Trace

Use the SIMOTION trace to confirm the fix:

  1. Open Trace → New in SCOUT.
  2. Add the following signals at the IPO-cycle sampling rate (typically 1–4 ms):
    • TO_EncoderExternal.actualPosition
    • TO_EncoderExternal.actualVelocity
    • TO_Axis_Slave.actualVelocity
    • TO_Axis_Slave.positionCommand (slave following error context)
  3. Record for at least 10 s and trigger on a single modulo rollover.
  4. Expected result after the fix: actualVelocity is a smooth sinusoid (or constant, depending on the master motion), with no impulse at 0°/360°. The slave velocity follows it with a one-cycle delay equal to the filter time constant, but no spike.

8. Fallback Diagnostic: Disable Modulo and Use Relative Gearing

If the spike persists after the encoder TO has been confirmed rotary, perform an isolation test:

  1. Temporarily set the external encoder TO to LINEAR with no modulo.
  2. Run the master at a constant speed. The reported position will grow without bound (a 32-bit or 64-bit counter).
  3. Re-enable gearing with relative gearing on the slave (synchronize once at start-up, then follow deltas).
  4. If the spike disappears, the modulo handling on the encoder TO is the cause — escalate to Siemens Application Support with the project archive.
  5. If the spike remains, the cause is mechanical; inspect the encoder coupling and the belt.

9. Quick-Reference Parameter Table

Parameter / Path Value to set Where
Encoder TO: Type of axis ROTARY TO → Configuration → Mechanics
Encoder TO: Modulo range 360.0° TO → Configuration → Mechanics
Encoder TO: Velocity filter T_filter = 3 ms (start) TO → Configuration → Filter
Drive (Drive-CLiQ encoder): Encoder type Rotary single-turn / multi-turn Drive → Configuration → Encoder
Drive: Fine resolution Default (per encoder datasheet) Drive → Configuration → Encoder
Drive: Gear factor load/motor 1 / 1 (unless mechanical ratio) Drive → Configuration → Encoder
Slave axis: Gearing primitive _posGearing Program / MCC chart
Slave axis: Gear ratio Numerator / Denominator = 1 / 1 (typical) Call site of _posGearing

10. Troubleshooting Matrix

Symptom Likely cause Action
Spike at 0°/360° on master trace alone Encoder TO is LINEAR with modulo imposed in user code Set TO to ROTARY, modulo 360°
Master smooth, slave spiky at rollover Velocity-gearing used on a modulo master Replace _velGearing with _posGearing
Spike visible only when master is stopped or reversing Internal gearing factor on the Drive-CLiQ encoder Reset Gear factor to 1:1
Small, broadband ripple after the fix Mechanical run-out / backlash Add low-pass filter, inspect mechanical coupling
Spike survives every test above Hardware or firmware fault on the Drive-CLiQ encoder Replace encoder; check D425 firmware release notes

11. Summary

A periodic velocity/acceleration jump exactly at the 360° modulo rollover of a Drive-CLiQ external encoder master, on a SIMOTION D425 driving a 1FK7 slave, is in 9 out of 10 cases a Technology Object type mismatch or a velocity-gearing primitive used on a modulo master. The fix is twofold:

  1. Set the External Encoder TO to ROTARY with modulo 360°.
  2. Use _posGearing (position gearing), not _velGearing.

Re-trace both master and slave at IPO cycle, confirm the rollover spike is gone, and apply a 3 ms velocity low-pass filter on the encoder TO if a smaller residual ripple is observed.

Why does my SIMOTION D425 external encoder show a velocity spike at 360° even when the master is rotating at constant speed?

The External Encoder Technology Object is most likely configured as LINEAR with a modulo range forced onto it. SIMOTION then performs a clamped differentiation across the rollover, producing an apparent infinite acceleration pulse once per revolution. Set the TO to ROTARY with a 360° modulo so the position is differentiated as a circular quantity. Reference: SIMATIC AX manual – Configure the type of an external encoder.

Should I use position gearing (_posGearing) or velocity gearing (_velGearing) with a rotary modulo master encoder?

Use _posGearing. Velocity gearing expects a non-modulo master and an effective transmission ratio of 1, and its derivative-based coupling produces a spike at the modulo transition. Position gearing wraps the master position continuously and produces a smooth slave velocity. Reserve velocity gearing for linear, non-modulo masters where the master derivative is well defined.

What Drive-CLiQ encoder parameters must I verify on a SIMOTION D425?

Open the Drive object for the encoder in SCOUT and confirm: encoder type = Rotary (single-turn or multi-turn), fine resolution per the encoder datasheet, and gear factor load/motor = 1/1 unless a mechanical ratio is intended. Recompile HW Config and download to the D425 before re-tracing.

How do I add a low-pass filter to an external encoder on a D425?

In the External Encoder Technology Object, open Configuration → Filter and enable the velocity filter with a time constant T_filter in the 1–10 ms range (start at 3 ms). Apply the same filter to the slave axis velocity setpoint if a residual ripple remains. Keep T_filter ≤ 10 ms to avoid excessive following-error lag on a belt-driven slave.

The spike survives every software check. Is the encoder itself faulty?

If the spike is present on the encoder TO actual velocity with no slave, no gearing, and the TO is correctly set to ROTARY modulo 360°, replace the Drive-CLiQ encoder and re-test. Capture a 10 s trace and escalate to Siemens Application Support with the SCOUT project archive. Mechanical run-out on the encoder coupling or pulley can produce a similar periodic disturbance; verify by rotating the encoder by hand with the machine off and observing the reported position for a true sinusoidal wobble.

Back to blog