Resolving S7-313C FB41 PI Instability on Cable Spooler Winder

David Krause13 min read
PID 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

Problem Statement: S7-313C FB41 Spooler Instability

A common field complaint on SIMATIC S7-313C systems using FB41 "CONT_C" to regulate a cable spooler is that the loop is stable only when the reel is full. Between empty reel and mid-build diameter, the same proportional/integral set (GAIN = 0.08, TI = 510 ms) yields visible tension oscillation, while the same settings become stable once the reel approaches its outer diameter.

The symptom is not a defective FB41 instance, nor an undersized CPU. It is the expected behavior of a fixed-gain PI regulator controlling a process whose gain is itself a function of the roll diameter. This article describes the root cause, the FB41 parameter mappings involved, and three engineering solutions: gain scheduling in the PLC, drive-integrated PID on the SIMOREG 6RA70, and the PID Self Tuner available for S7-300/S7-400.

Safety first: Tension oscillation on a cable winder can produce cable slap, broken strands, or dancer over-travel. Verify the dancer / load-cell wiring, mechanical brake, and E-stop path before changing controller parameters.

S7-313C Hardware Reference and FB41 Block Layout

The CPU 313C (6ES7313-5BF03-0AB0 and successors in the 313C-2 DP / 313C-2 PtP family) provides 32 KB of work memory, 0.1 µs bit execution, and 16 integrated DI / 16 DO. It supports the full PID library FB41/FB42/FB43 from the Standard Library > PID Control Blocks package.

The relevant I/O for a winder loop is typically:

Signal Source PLC Address (example) FB41 Terminal
Tension setpoint Operator panel / recipe DB20.DBD0 (REAL) SP_INT
Tension feedback (load cell) AI4 channel 0 (4-20 mA) PIW 752 PV_PER via PVPER_ON=TRUE
Dancer position / diameter AI4 channel 1 / counter PIW 754 / ID 0 External variable (DB)
Line speed reference PROFIBUS / analog PQW 752 Reference to drive
Torque / speed command Analog output to 6RA70 PQW 754 LMN_PER (or scaled LMN)

FB41 inputs that matter for spooler tuning:

Parameter Type Function Winder Starting Value
GAIN REAL Proportional gain Kp 0.05 - 0.2
TI TIME Integral action time (ms) 300 - 1500 ms
TD TIME Derivative action time (ms) 0 (PI typical)
DEADB_W REAL Deadband width on error 0.5 - 2.0 % of span
LMN_HLM / LMN_LLM REAL Output saturation clamps +100.0 / -100.0 %
CYCLE TIME Sampling time 100 ms (cable winder)
P_SEL / I_SEL / D_SEL BOOL Enable P, I, D branches TRUE / TRUE / FALSE
PV_FAC / PV_OFF REAL Input normalization Scaled to load-cell engineering units
LMN_FAC / LMN_OFF REAL Output scaling Match 6RA70 setpoint range

Reference: SIMATIC S7-300 CPU 31xC Technological Functions manual (entry ID 12429336 in the Siemens Industry Online Support). Detailed FB41 description: Standard Library - PID Control Blocks, also part of the S7-300 documentation set.

Setpoint SP_INT FB41 CONT_C GAIN / TI / TD S7-313C OB35 CYCLE = 100 ms 6RA70 SIMOREG DC DC Motor Spooler Load Cell Tension PV

Figure 1 - FB41 inside OB35 of the S7-313C closes the tension loop around a SIMOREG 6RA70 DC drive and a load-cell-fed tension process variable.

Why a Cable Winder is a Non-Linear Process

A spooler couples a DC motor (via the 6RA70) to a growing roll of cable. Three physical quantities are explicit functions of the instantaneous roll radius r:

  1. Process gain (torque to tension): T = F · r. For a given tension error, the motor torque that must be added scales linearly with r.
  2. Reflected inertia: J = J_core + ½ · ρ · L · (r⁴ - r_core⁴). At empty reel, J is small; at full reel, J can be 10× to 30× larger.
  3. Line-speed to angular-speed ratio: ω = v / r. For the same linear cable speed the motor must run faster when the reel is empty.

The consequence is that the open-loop gain between FB41's output (torque command) and the process variable (tension) varies roughly as 1/r at constant line speed, plus an additional inertia-dependent acceleration term:

K_process(r) ≈ 1 / (r · J_total)

With the supplied PI fixed at GAIN=0.08 and TI=510 ms, the closed-loop gain GAIN × K_process exceeds stability margins on an empty reel (high K_process) but is well-damped on a full reel (low K_process). The exact crossover where oscillation appears depends on line speed, cable cross-section, and dancer stiffness, but the symptom pattern - instability at small r and stability at large r - is the diagnostic fingerprint.

Loop gain Stability limit r (reel radius) → Empty Mid Full Empty reel loop gain exceeds limit → oscillates Stable

Figure 2 - Closed-loop gain as a function of roll radius. Stability margin is consumed in the empty-to-mid region and recovered only at full reel.

Root Cause Analysis: Variable Process Gain

Using FB41 with constant GAIN and TI assumes the plant is linear. The cable winder is not. Three concrete observations support the diagnosis:

Observation Indication Conclusion
Empty reel: rapid tension oscillation at fixed line speed Closed-loop gain too high for current K_process Reduce Kp at small r or compensate by r
Full reel: smooth response, slight steady-state offset Loop gain falls naturally as r grows Acceptable, but integrator may need bump-up
Step change in setpoint is followed by ringing only below mid-diameter Phase margin collapses in empty region Confirm dead-band; review TI (lower TI = faster but can destabilize)
Frequency of oscillation increases with line speed Open-loop pole from inertia + line-speed gain Schedule parameters also with line speed, not only r

Because the symptom is geometric (radius dependent), the fix must be geometric as well. Three field-proven remedies follow.

Solution 1 - Gain Scheduling with Multiple PI Sets in FB41

Maintain a parameter table indexed by roll-diameter bands. Move the controller from one PI set to another in OB35 based on a measured (or computed) diameter. This is the most common retro-fit on an existing S7-313C and requires no drive changes.

Recommended parameter table stored in a global DB (e.g. DB50):

Band Index Diameter range (mm) GAIN TI (ms) TD (ms) DEADB_W
1 (empty) 0 - 120 0.03 900 0 1.5
2 120 - 220 0.05 700 0 1.0
3 220 - 320 0.07 600 0 0.7
4 320 - 420 0.08 510 0 0.5
5 (full) 420 - 500 0.10 450 0 0.5

Structured-text selector inside OB35 (run at 100 ms cycle, matching FB41 CYCLE):

// OB35 - 100 ms cyclic task
CASE "DB50".band OF
    1:  "FB41".GAIN  := "DB50".gain[1];
        "FB41".TI    := "DB50".ti[1];
    2:  "FB41".GAIN  := "DB50".gain[2];
        "FB41".TI    := "DB50".ti[2];
    3:  "FB41".GAIN  := "DB50".gain[3];
        "FB41".TI    := "DB50".ti[3];
    4:  "FB41".GAIN  := "DB50".gain[4];
        "FB41".TI    := "DB50".ti[4];
    5:  "FB41".GAIN  := "DB50".gain[5];
        "FB41".TI    := "DB50".ti[5];
END_CASE;
"FB41".CYCLE := T#100ms;
"FB41"();   // call FB41 with the active PI set

To avoid bump transfers, ramp GAIN and TI linearly between bands over a few seconds (e.g. 3 s transition window). Force I_ITL_ON := TRUE and load ITN_VAL with the previous output during the transfer to prevent integrator wind-up jumps.

IDLE / Empty Band 1 (0-120) Band 2 (120-220) Band 3 (220-320) Band 4 (320-420) Band 5 Full

Figure 3 - Diameter-driven gain-scheduling state machine. Transitions are debounced (50-100 ms) to prevent hysteresis flicker near a band edge.

Pitfall: Do not load new PI values directly into FB41 without a smooth ramp - abrupt Kp steps cause the integrator output to be wrong for the new gain and produce a step on the manipulated variable.

Solution 2 - Drive-Based PID on SIMOREG 6RA70

For new installations, the more robust solution is to push the tension loop down into the 6RA70 itself. The 6RA70 contains internal PID structures (parameter groups nXXX for speed, PXXX for current/torque) plus a configurable technology controller. Reference: the SIMOREG 6RA70 parameter list and the Siemens application note Center Winder with SIMOREG 6RA70 (entry 9716319 in the Siemens Industry Online Support).

6RA70 Parameter Function Winder Starting Value
P100 / P101 Speed setpoint source / scaling Analog from PLC or PROFIBUS
P150 / P151 Torque setpoint source / scaling Output of internal PID
P220 Function selection - technology controller Tension / dancer control
P225 / P226 PID proportional gain / integral time Adapted to radius (see below)
P040 / P041 Acceleration / deceleration ramps 0.5 - 2.0 s depending on material
P462 Speed feedback source Encoder on motor
P740 - P748 Free function blocks for diameter model Compute r from line speed and turns

Wiring: the 6RA70 receives the cable tension setpoint (analog 0-10 V or PROFIBUS word) and the load-cell feedback. The drive closes the loop at 1-2 ms internally; the S7-313C is reduced to supervision, recipe selection, and diameter tracking. Use the drive's free function blocks (or a structured PLC function block on the S7-313C) to compute:

r = sqrt(r_core² + (N · d_cable · 2) / π)

where N is the turn count from an encoder and d_cable the cable diameter. Feed r back to the drive as a scaling factor for P225 (gain) using the 6RA70's internal multiplier. This way the gain-scheduling is performed inside the drive's fast loop without PLC scan delay.

Solution 3 - PID Self Tuner for S7-300 / S7-400

For engineers who prefer an automatic tuning routine rather than manual band-by-band adjustment, the PID Self Tuner integrated in the TIA Portal PID control package for S7-300/S7-400 identifies the process during a controlled step and computes Kp, TI, TD. The tuning pass can be executed once per diameter band; the resulting parameters are stored in DB50 and loaded by the gain-scheduling selector described above.

Tuner Step Action Acceptance Criterion
1. Pre-tune check Drive at steady state, tension within ±2 % of setpoint PV stable for 5 s
2. Step injection Controller applies 10 % output step on top of current LMN PV responds monotonically
3. Identification Tool fits PTn model to PV trace Fit error < 5 %
4. Controller design Compute Kp, TI for chosen criterion (e.g. Chien-Hrones-Reswick) Designed overshoot < 5 %
5. Validation Closed-loop run with new parameters Settling time < 4 × Tu
6. Storage Write result to DB50.gain[i] / DB50.ti[i] Persisted to recipe

Repeat steps 1-6 for each diameter band. The Self Tuner is preferable to manual Ziegler-Nichols for non-linear plants because it explicitly models the dead-time and time constant that change with r.

Tension and Torque Compensation Formulas

Regardless of which solution is chosen, the loop should apply diameter compensation explicitly. The two compensation terms added in front of the drive's torque reference are:

Term Equation Function
Tension torque T_F = F_set · r Converts linear tension into motor torque
Acceleration torque T_acc = J(r) · dω/dt Compensates inertial mass during ramp
Friction torque T_f = c_visc · ω + T_Coulomb Static + viscous losses
Total torque ref T\* = T_F + T_acc + T_f + T_windup Output of FB41 / drive PID

Implement these as look-up tables in the PLC or as 6RA70 free blocks. With compensation in place, the residual that FB41 must close is the tension error only - a small-signal linear term that is far easier to tune with a single PI set.

Step-by-Step Commissioning Procedure

  1. Validate the I/O. Force PV_PER from the S7-313C and confirm in STEP 7 / TIA Portal that the load-cell signal tracks the cable tension over the full reel range.
  2. Run open-loop step test. Set MAN_ON := TRUE, hold MAN at 30 %, then at 60 % of motor rated torque. Record PV on the HMI trend for two diameter bands.
  3. Compute process gain. K_process = ΔPV / ΔLMN for each band. Expect K_process(empty) > 3 × K_process(full).
  4. Compile a band table. Populate DB50 with five PI sets using the Kp_r = Kp_full × r_full / r as a starting rule, and TI scaled proportionally to the inverse of the natural frequency.
  5. Enable gain scheduling. Implement the CASE selector inside OB35 with the same cycle as CYCLE.
  6. Switch to closed loop. Set MAN_ON := FALSE; verify LMN_HLM and LMN_LLM clamp the drive within safe current limits.
  7. Run a step response per band. Apply a 5 % setpoint step at each diameter. Acceptable: overshoot < 8 %, settling time < 5 s, no oscillation.
  8. Run a full-reel transition test. From empty to full at constant line speed. Adjust band boundaries if a hysteresis loop forms at a band edge.
  9. Persist to recipe. Save DB50 as part of the HMI recipe so the tuning is restored on power-up.
  10. Document safe-state behavior. Verify that on E-stop or dancer over-travel, FB41 is frozen (I_ITL_ON := TRUE) and the drive accepts the controller inhibit command.

Verification and Field Diagnostics

After commissioning, three live checks confirm the fix is correct:

Check Method Pass Criterion
Empty-reel step response 5 % SP step on empty reel Overshoot < 8 %, settling < 5 s, no oscillation
Cross-band transition Tend from empty to full at constant line speed PV excursion within ±3 % of setpoint at every band edge
Line-speed profile Ramp line speed 0 → 100 % over 3 s PV deviation < 5 % throughout ramp
Cold start Power cycle, automatic recipe recall First 3 m of cable show no tension deviation
E-stop recovery Trigger stop, then run No integrator wind-up spike on resume

Trend the FB41 instance variables on the HMI: LMN, PV_IN, ER, and the integrator state ITN_VAL. They are all in the FB41 instance DB and can be added to the standard PID control faceplate.

Troubleshooting Matrix

Symptom Likely Cause Fix
Empty-reel oscillation, full-reel stable Variable process gain (this article) Gain schedule or drive-side PID
Oscillation at all diameters GAIN too high, TI too short, or CYCLE mismatch with OB35 Halve GAIN; double TI; align cycle times
Oscillation only at high line speed Acceleration torque term missing Add T_acc = J·dω/dt feed-forward
Slow response, large steady-state offset TI too long, dead-band too wide Reduce both, particularly on empty-reel band
PV noisy even at steady state Load-cell noise, no input filter Enable TM_LAG on derivative term or hardware filter on AI
Drive faults on sudden setpoint change LMN slew into over-current Lower LMN_HLM, add output ramp limiter
Oscillation frequency ~ 1 Hz Mechanical resonance (dancer, frame) Add stiffness to mechanical link, not just reduce Kp
Oscillation only on first second after start Integrator wind-up from previous fill Initialize ITN_VAL at start; COM_RST first cycle
Different behavior with reel A vs reel B Different r_core or cable spec Per-recipe tuning in DB50; load recipe on run start

Why does my S7-313C FB41 spooler loop oscillate only on the empty reel?

The open-loop gain between FB41's output (torque command to the SIMOREG 6RA70) and the load-cell feedback scales roughly as 1/r. With a fixed GAIN of 0.08 and TI of 510 ms the closed-loop gain exceeds the stability margin at small radii. Switch to gain-scheduling, move the loop into the 6RA70, or apply explicit torque compensation. See Siemens PID Self Tuner for automatic band tuning.

What are good starting values for FB41 GAIN and TI on a cable spooler?

Start with GAIN = 0.05, TI = 700 ms, TD = 0 ms, DEADB_W = 1.0 %, and CYCLE = 100 ms. Then apply five bands by diameter (empty / quarter / half / three-quarter / full) with Kp increasing and TI decreasing as r grows. Use PV_FAC and PV_OFF to normalize the load-cell input to engineering units before tuning.

Should I use FB41 in the S7-313C or the PID inside the SIMOREG 6RA70?

For new installations, the 6RA70's internal PID at 1-2 ms update rate outperforms an OB35 FB41 at 100 ms, especially during fast line-speed ramps. Keep FB41 only if your drive is already installed and re-engineering is not in scope, and use gain-scheduling by diameter to compensate. Reference: Siemens application note Center Winder with SIMOREG 6RA70.

How do I prevent integrator wind-up when switching PI sets in FB41?

Set I_ITL_ON := TRUE and load ITN_VAL with the previous output (scaled by the gain ratio of the new set) before the parameter swap. Also enable LMN_HLM / LMN_LLM clamps so the integrator cannot drive the manipulated value into a region where the plant saturates. Ramp GAIN and TI over 2-3 seconds when crossing a band boundary.

Can the PID Self Tuner handle a non-linear winder?

Yes, if you run one tuning pass per diameter band. The tool fits a first-order-plus-dead-time model and computes Kp and TI for that local operating point. Store the resulting parameters in a recipe DB (e.g. DB50) and let the gain-scheduling CASE selector pick the active set. Re-run tuning after any mechanical change (new dancer, new core size, different cable).

Back to blog