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. |
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.
- In SCOUT / TIA Portal (with SIMOTION option pack), open the project and navigate to the External Encoder Technology Object in the axis tree.
- Open Configuration → Mechanics.
- Set Type of axis =
ROTARY. The setting is binary; the alternatives areLINEARandROTARY. - Confirm Modulo range =
360°(or the value matching the physical encoder, typically 360° for a single-turn rotary encoder). - 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.
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:
- 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.
- Open the Drive object that was created for the encoder. The default is Sensor Module + Drive pair.
- Confirm the encoder type: Configuration → Encoder → Type should read
Rotary, single-turnorRotary, multiturn, neverLinear. - Confirm Fine resolution (increments per revolution) and Gear factor are at the default 1:1 unless a mechanical ratio is required.
- Save, compile HW Config, and download to the D425.
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:
- Open the External Encoder TO → Configuration → Filter.
- Enable Velocity filter with a time constant
T_filterin the range 1–10 ms (start at 3 ms). - If the slave still follows the residual ripple, add the same filter to the slave axis (TO_Axis_Slave → Position control → Velocity setpoint filter).
- 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:
- Open Trace → New in SCOUT.
- Add the following signals at the IPO-cycle sampling rate (typically 1–4 ms):
TO_EncoderExternal.actualPositionTO_EncoderExternal.actualVelocityTO_Axis_Slave.actualVelocity-
TO_Axis_Slave.positionCommand(slave following error context)
- Record for at least 10 s and trigger on a single modulo rollover.
- Expected result after the fix:
actualVelocityis 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:
- Temporarily set the external encoder TO to LINEAR with no modulo.
- Run the master at a constant speed. The reported position will grow without bound (a 32-bit or 64-bit counter).
- Re-enable gearing with relative gearing on the slave (synchronize once at start-up, then follow deltas).
- If the spike disappears, the modulo handling on the encoder TO is the cause — escalate to Siemens Application Support with the project archive.
- 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:
- Set the External Encoder TO to ROTARY with modulo 360°.
- 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.