SINAMICS S120 Print Mark Registration: Achieving 0.5 mm Repeatability with Probe Input and SINA_POS FB284
1. Problem Statement
A continuous label-film perforation station uses a SINAMICS S120 servo (CU320-2 DP) driving an index roller, with a mechanical perforation ram mounted on a separate mechanism. A registration sensor (contrast or color-mark detector, 24 V PNP) detects the printed mark on the film, and the operator wants the axis to stop with the perforation tip aligned to the mark edge. Target positional repeatability is 0.5 mm across cycles; reported field repeatability is 1-3 mm, which causes the perforation tip to drift off the printed image area.
Compensation is implemented on a S7-1500 CPU over PROFINET (IRT) using SINA_POS (FB284) and telegram 111. The PLC reads the mark input bit through the CU I/Os word at the end of the receive telegram and reads a position value over the same bus, then computes a positional correction for the next index cycle.
Before tuning the drive, verify the swing is not mechanical. Nip-roller bearings, gear-coupling slip, and back-lash in the index mechanism reproduce the identical swing pattern regardless of drive tuning. Establish a free-spin baseline by rotating one full revolution by hand against a mechanical reference mark and reading back the encoder value.
2. System Architecture and Latency Layers
Print-mark registration on a moving web is deterministic only when three steps are deterministic on every cycle: a trigger event (mark edge), a timestamp event (latch the encoder position at the trigger), and a compensation event (move to a fixed LU offset from the latched value). Each layer between the trigger and the axis contributes variance:
| Layer | Step | Typical contribution at 1 m/s web speed |
|---|---|---|
| Mark sensor | Edge response time | 20-500 µs → 20-500 µm |
| SINAMICS DI / probe latch | Current-controller cycle (125 µs) | ~125 µm |
| SINAMICS position filter | p2534 smoothing time constant | 1-8 ms → 1-8 mm |
| PROFINET IRT | Send-clock and phase jitter | 0.3-1 ms → 0.3-1 mm |
| S7-1500 OB | OB1 / OB35 / OB61 cycle and FB runtime | 1-2 ms → 1-2 mm |
| SINA_POS propagation | Control word → drive setpoint | 0.5-1 ms → 0.5-1 mm |
Stacked, expected swing is 3-12 mm at 1 m/s — close to the observed 1-3 mm. The fix is to perform timestamping at the drive firmware layer (current-controller cycle, ~125 µs) and reduce PROFINET propagation to a confirmation word, not a measurement word.
3. Root Cause: Smoothing Filter and Bus Jitter
The as-built configuration reads r2521 as the mark position reference. r2521 is the actual position value processed by the position controller after the actual-value smoothing time constant p2534. The closed loop deliberately smooths the input to reduce acoustic noise and following-error ripple on the analog setpoint; it is not a deterministic capture of where the encoder was when the mark fired.
When the PLC value is the smoothed controller input instead of the raw encoder position, two error sources combine:
- Filter phase lag introduced by
p2534; scales linearly with web speed - Time-stamp misalignment from PROFINET send-clock jitter and S7-1500 OB1 execution jitter (1-2 ms typical)
A 0.5 mm target at 1 m/s permits a 0.5 ms total error budget. There is no room for a 1-8 ms position filter plus a bus plus an OB inside that budget. The objective is to read the position at the source (drive firmware) and ship only the resulting offset to the PLC.
4. Capture Strategy 1: Read r2523, Not r2521
The first, lowest-effort change is to switch the read parameter from r2521 (smoothed actual) to r2523. r2523 is the actual value of the measuring-gear position with no closed-loop filtering — the direct encoder value scaled by the load-side measuring-gear factor (p2504, p2505).
| Parameter | Meaning | Suitability for mark registration |
|---|---|---|
r2521 |
Actual position value in closed-loop control (smoothed) | No — filter lag |
r2522 |
Actual value at the smoothing filter output | No — setpoint-side delay |
r2523 |
Actual value of measuring-gear position, no smoothing | Yes — direct reference for PLC compensation |
4.1 Read Path on PROFINET
Telegram 111's receive position word is mapped to a fixed signal source in the drive firmware and cannot be re-mapped from telegram configuration alone. Extend the telegram with a supplementary data slot in TIA Portal: SINAMICS drive → Properties → Telegram configuration → Supplementary data → add one word with source = r2523. After compile and download the S7-1500 sees the unsmoothed value in the supplementary receive slot.
Verify the active SINAMICS firmware release against the current SINAMICS S120/S150 List Manual before commissioning: parameter numbers, scaling, and the receive position word's ownership in the loop may shift between firmware branches.
5. Capture Strategy 2: Drive-Level Probe Measurement (Recommended)
SINAMICS S120 supports two measurement probes per encoder that latch the encoder position on a configurable DI edge with current-controller time-base resolution. The probes are independent of position-controller smoothing and run at the same 125 µs time base as the current controller — roughly an order of magnitude faster than a 1 ms PROFINET IRT send clock.
5.1 Probe Subsystem Function
- Input selection: configure the DI on the Control Unit or on the Sensor Module that triggers the probe
- Edge selection: rising, falling, or both edges; single-shot or continuous
- Latch register: encoder value at the trigger edge, scaled to load-side linear units (LU)
- Status flags: probe-valid bits in the SINAMICS control/status word or in the extended telegram status
The probe is the preferred measurement source for any touch-trigger application: flying saw, registration mark, edge detector, and length measurement. Configurable parameters are grouped under the Measurement subtree in the List Manual; indexes depend on the active firmware. Confirm against the active List Manual entry (search measuring probe in Siemens Industry Online Support) before commissioning.
5.2 Reading Probe Values on PROFINET
The probe latched value appears as a parameter (commonly routed through the encoder-level probe subsystem, e.g. registers in the 47xx range depending on firmware). To bring the value into the S7-1500 cycle, add a supplementary slot in telegram 111 mapped to that parameter. The valid-measurement status bit can also be mapped into the receive status word so the PLC knows when a new latched value is available.
6. Capture Strategy 3: EPOS Passive Homing + MDI
SINAMICS S120 in basic-positioner (EPOS) mode supports passive homing triggered by a configurable event. With a probe wired as the homing switch, the drive resets its position reference to the latched encoder value the moment the mark fires. Compensation becomes a fixed LU offset that the drive itself applies through MDI (Manual Data Input) absolute positioning.
- Configure EPOS active homing at start-up (one-time, encoder reference to a permanent home)
- Configure passive homing on the probe input (per cycle, initiated by the mark sensor)
- Set MDI mode with absolute setpoint = (computed offset to perforation target) every cycle
- The drive moves from the freshly latched homing reference to the absolute target inside the same firmware cycle
This removes the PLC from the capture-to-actuate path. The S7-1500 sends the position setpoint and the stop command; the mark edge is consumed by the drive firmware. PROFINET jitter no longer enters the compensation error budget.
EPOS basic positioner is licensed as a runtime option on many S120 drives. Confirm the license key contains the basic-positioner option before commissioning — without it the EPOS function group is greyed out in the project navigator of STARTER or Startdrive.
7. Wiring the Registration Sensor
Wire the sensor directly to the CU320-2 DI, not into a S7-1500 DI module. Three reasons:
- Drive-firmware latch has shorter, deterministic latency than PLC input-map copy
- Eliminates a single-point-of-failure mode during PROFINET phase-up and removal
- Allows the engineer to trace mark-edge vs encoder value inside Startdrive without involving the PLC
| Wire | Terminal on CU320-2 | Notes |
|---|---|---|
| +24 V supply | X122.7 / X132.7 | Short-circuit protected; total sensor + encoder load ≤ 500 mA per group |
| Sensor output (PNP) | X122.1 (DI 0) or X132.x | Match DI configuration to PNP sourcing |
| Sensor 0 V | X122.8 / X132.8 | Dedicated return, not chassis |
| Shield | Cabinet PE rail, one end only | Avoid earth-loop current through shield |
Configure the DI for PNP sourcing input (default on CU320-2). If the sensor uses a push-pull output, set the corresponding input filter / sensor type to match — otherwise a static-high may latch a wrong probe state on every cycle.
8. Telegram 111 Layout and Supplementary Slots
Telegram 111 is the standard telegram for SINA_POS. Default receive direction: status word 1, status word 2, actual position, actual speed, actual torque, CU I/Os (last word). Default transmit direction: control word 1, control word 2, position setpoint, override, MDI additional setpoints.
| Process data word | Direction | Standard content |
|---|---|---|
| 1 | RX (drive → PLC) | Status word 1 (ZSW1) |
| 2 | RX | Status word 2 (ZSW2) |
| 3 | RX | Actual position (loop value) |
| 4 | RX | Actual speed |
| 5 | RX | Actual torque |
| 6 | RX | CU I/Os (mark sensor bit) |
| 1 | TX (PLC → drive) | Control word 1 (STW1) |
| 2 | TX | Control word 2 (STW2) |
| 3 | TX | Position setpoint (LU) |
| 4 | TX | Velocity override |
| 5 | TX | MDI additional setpoints |
| 6 | TX | MDI mode / control bits |
Place supplementary slots to add:
- Unsmoothed position reference (
r2523) - Probe latched actual value
- Probe valid bit, if not already in ZSW2
The SINA_POS basic-positioner documentation covers the modes carried by telegram 111. The exact receive-word mapping is firmware-dependent — verify against the active firmware's List Manual entry before commissioning.
9. SINA_POS (FB284) Implementation in TIA Portal
SINA_POS (FB284) is the standard Siemens function block for S120 basic-positioner operation from a S7-1500. The block encapsulates the handshake required to drive telegram 111 in modes 1 to 6 (jogging, MDI absolute, MDI relative, traversing blocks, homing, setup). The block documentation is bundled with the SINAMICS Blocks library inside the DriveLib package — open the FB Help inside TIA Portal for full pin assignment and control-word sequencing.
9.1 Pattern for Print-Mark Compensation
- Issue SINA_POS with
ModePosconfigured for the active compensation mode on cycle start - Read the probe latched position from the supplementary slot when its valid bit transitions true
- Compute compensated setpoint = latched value + target offset (LU)
- Re-issue SINA_POS with the MDI-absolute mode carrying the new setpoint
- Trigger the stop on the perforation synchronism output before the setpoint is reached
9.2 Worked Example (LU Math)
Assume the load-side measuring gear is 1 LU = 1 µm. At each mark edge the drive latches probe_value = 124000 (124.000 mm). The wanted perforation tip is 142.000 mm after the mark. The compensated setpoint for the next MDI absolute move is:
Position_next = probe_value + offset_LU = 124000 + 18000 = 142000 (= 142.000 mm)
If the next mark latched at 124150 (50 µm higher), the next setpoint becomes 142150 — the perforation tip is shifted by 50 µm upstream to compensate exactly for the same drift the next mark sensed. This is the closed loop.
Always reset the homing state via the SINA_POS control word if the absolute homing reference was lost during the cycle. A lost homing state with a relative MDI moves the axis to a wrong LU target and crashes the perforation ram against the mechanical stop.
10. Commissioning Trace Procedure
- Open Startdrive (preferred for TIA Portal engineering of CU320-2 with newer GSD) or STARTER for legacy GSD-based commissioning
- Configure a long-term trace: encoder 1 actual position, position controller input, position controller output speed, probe latched value, DI state on the mark input
- Trigger on the DI rising (or falling) edge matching the configured probe edge
- Run 100 production cycles and observe the spread of the probe latched value
- Cross-check the value the PLC records two OB1 cycles later against the trace to measure PROFINET propagation lag
- Compute the histogram and 6 σ; compare against the 0.5 mm target
| Trace metric | Target | Action if not met |
|---|---|---|
| Probe latched repeatability (6 σ over 100 cycles) | ≤ 50 µm in LU | Mechanically isolate sensor mount; verify web tension; increase sensor debounce |
| PLC read lag vs latched | ≤ 1 IRT send clock (1 ms) | Run SINA_POS in OB61 (fast OB); re-check IRT topology in TIA Portal |
| Position controller overshoot at mark | < 0.3 mm | Reduce Kp of position loop; pre-shape velocity profile with EPOS acceleration |
| Settling time at mark | < 2 cycles | Reduce approach velocity; verify friction-compensation model |
| Following error in steady-state | < 100 µm LU | Verify Kv factor; check load inertia vs motor inertia ratio |
If the probe latched value still drifts more than 50 µm across cycles after the drive trace is clean, the cause is mechanical: encoder coupling slip, belt stretch, or sensor-mount deflection. Verify against a hardware reference (hand-index one revolution) before further controller tuning — premature tuning of the position loop masks mechanical faults.
11. Acceptance Test for 0.5 mm Repeatability
- Run 100 production cycles at full web speed
- Log latched position at probe edge and final perforation position measured by a non-contact laser micrometer or vision system over the perforation tip
- Compute system repeatability as 6 σ and as maximum deviation across the 100 cycles
- Verify both metrics are within 0.5 mm
- Repeat at minimum web speed, at maximum web speed, and after a 30-minute warm-state test to confirm thermal stability
- Repeat after a PROFINET phase-down / phase-up cycle to confirm robustness against bus re-initialization
The sensor itself has its own repeatability specification — typical contrast sensors 50-200 µm, capacitive 20-50 µm, optical color mark 20-100 µm. Combined system repeatability is the root-sum-square of the dominant error contributions unless one source is dominant. SICK's print-mark-detection reference describes the sensor-side trade-offs in more detail. Track the histogram for at least 100 cycles before judging the system ready.
12. Troubleshooting Matrix
| Symptom | Likely cause | First check |
|---|---|---|
| Probe never fires | DI not wired into probe input; wrong sensor type configured | Run Startdrive trace on the DI; verify input filter matches sensor output (PNP/NPN) |
| Probe fires intermittently | Sensor bouncing or web flutter | Add debounce (100-500 µs typical); shroud sensor from reflected light; verify web tension stable |
| Deterministic 1 mm offset per cycle | Wrong LU scaling (p2502, p2504) or wrong measuring-gear ratio |
Rotate the load exactly one revolution; compare encoder revolutions in LU vs mechanical revolution |
| Swing grows with web speed | Position-loop bandwidth too low | Re-tune Kp and pre-control; reduce p2534 actual-value smoothing only if no other dependency on it |
| Compensation overshoots every cycle | MDI setpoint origin set every cycle from the wrong reference | Switch MDI setpoint origin to the probe latched reference for the cycle, not the absolute home |
| Drift after warm restart | PROFINET phase-up shifted the IRT phase | Recheck PROFINET topology; force a fresh startup with explicit IRT phase assignment in TIA Portal |
| Slow drift over hours | Encoder coupling slip / wear | Field inspection; replace coupling; re-verify mechanical repeatability |
| Repeatable oscillation on every cycle | Mechanical resonance with controller gain | Reduce Kp; add a low-pass on speed setpoint; check filter cut-off vs structural mode |
| Rapid deceleration overshoots perforation target | Position controller overshoot at endpoint | Lower deceleration in MDI block; activate pre-control / feed-forward |
| Perforation stops working in burst mode | Homing reference lost between cycles | Verify SINA_POS control word sequencing; capture homing-state bit in trace |
13. Frequently Asked Questions
Why does the SINAMICS S120 swing 1-3 mm on print-mark registration over PROFINET?
Compensation error is dominated by the lag of the loop-smoothed position value plus PROFINET send-clock jitter and the S7-1500 OB cycle. At 1 m/s web speed, every 1 ms of jitter is 1 mm of swing. Read r2523 instead of r2521, and add a drive-level measurement probe so the encoder value is latched at the mark edge inside the drive firmware, not at the PLC scan.
Which parameter replaces r2521 for mark-correlated position feedback?
Read r2523 (actual value of measuring-gear position, no smoothing) through a supplementary telegram slot, or read the probe latched value through a different supplementary slot. The default mapping of telegram 111 carries the loop-smoothed actual position and cannot be re-mapped from device configuration alone.
How do I wire a PNP registration sensor into the SINAMICS CU320-2?
Connect the PNP output to an X122 or X132 digital input. Configure the drive DI to PNP sourcing and route the DI into the measurement probe input through the drive project. Use shielded twisted pair with one-end shield termination to cabinet PE. Add debounce on the probe signal (100-500 µs typical) to reject sensor bounce.
Should I use SINA_POS FB284 with telegram 111 or build a custom block?
SINA_POS (FB284) is the supported path. It encapsulates the handshake of telegram 111, supports modes 1 to 6 (jog, MDI absolute, MDI relative, traversing blocks, homing, setup), is maintained across firmware versions, and is documented in the DriveLib help inside TIA Portal. Manual parsing of telegram words is fragile because receive-word mappings shift between firmware versions.
How much repeatability is realistic from an S120 measurement probe at 1 m/s web speed?
With a 24-bit encoder and a properly tuned drive, the drive-level latched value repeats at the LU granularity of the encoder. After mechanical sources are excluded (slip, sensor-mount deflection, web flutter), 50 µm repeatability is typical. Verify with a Startdrive / STARTER trace over 100 cycles and confirm the histogram before changing controller tuning — premature tuning of the position loop masks mechanical faults.