1. Problem Overview: FB41 Oscillation in a Hydraulic AGC Loop
The reported fault is a classical dominant-time-constant mismatch between a slow hydraulic Automatic Gauge Control (AGC) actuator and a poorly configured SIMATIC S7 FB41 "CONT_C" continuous controller. The reported symptoms are:
- Setpoint (SP_INT) fixed at
3000 µmwith a starting thickness of28000 µm(cold-start travel of ~25 mm). - Steady-state process value (PV_IN) fluctuating between
-2945 µmand+3100 µm(peak-to-peak > 6 mm). - Output manipulated continuously with no apparent settling.
- Only
GAINandTIused.TD(derivative time) = 0 andDEADB_W(dead band) = 0. - OB1 scan time measured between 1 s and 5 s — already an order of magnitude larger than the actuator response.
Target specification from the user is ±2 µm at the setpoint. The current peak error of >6000 µm indicates a controller that is either (a) grossly over-gained with insufficient integral action, (b) being sampled far too slowly, (c) suffering from quantization noise, or — most likely — (d) a combination of all three. The fix is rarely a single parameter change; it requires a structured re-commissioning of the FB41 instance, its sample time, its derivative block, and the hydraulic valve I/O conversion.
2. AGC System Architecture and FB41 Placement
Hydraulic AGC systems regulate strip exit thickness by closed-loop positioning of a screwdown or hydraulic roll-gap actuator against a load cell (force) and/or position transducer. The control hierarchy is typically:
- Level 0 — Load cell / LVDT / X-ray thickness gauge (PV feedback).
- Level 1 — SIMATIC S7-300 or S7-400
FB41 CONT_Cblock (PID algorithm). - Level 2 — Hydraulic servo-valve driver, ±10 V or 4–20 mA output (LMN scaled to engineering units).
FB41 implements the ideal, parallel (non-interacting) PID algorithm:
LMN(t) = GAIN · [ e(t) + (1/TI)·∫e(t)dt + TD·de(t)/dt ] + LMN_OFF
where e(t) = SP − PV. Because the standard FB41 supports proportional, integral, and derivative branches, a default of TD = 0 reduces the controller to a PI structure. For a stiff hydraulic position loop the PI-only branch is workable, but the derivative term should be reintroduced (with TM_LAG filter) to damp the dominant mechanical resonance that is being excited at the start of the travel and is now showing up as the 6 mm steady-state hunting.
3. Root-Cause Analysis of the ±6 mm Oscillation
| Likely Cause | Symptom Signature | Diagnostic | FB41 Parameter Affected |
|---|---|---|---|
| Excessive gain | Symmetric sinusoidal hunting around SP | Halve GAIN; if amplitude halves, gain is too high | GAIN |
| Integral windup at start | Large overshoot followed by slow oscillation | Watch LMN saturate at 100 % for >5 s during ramp from 28 mm | TI, LMN_HLM/LMN_LLM |
| Scan time >> dominant time constant | Limit cycle of period ≈ 2 × scan time | OB1 cycle = 1–5 s, hydraulic Tp ≈ 100 ms | CYCLE |
| Quantization on PV | Square-wave jitter of 1–2 LSB | Inspect PV_IN LSB in VAR viewer | PV_FAC, DEADB_W |
| Hydraulic stick-slip / dead zone | Drift followed by sudden jump | Step test LMN 0→10 %; observe PV | DEADB_W, GAIN |
| Derivative action missing on resonant load | High-frequency ringing superimposed on slow drift | FFT of PV noise; peak at 2–5 Hz | TD, TM_LAG |
A 5 s scan time on a hydraulic actuator with a 100–200 ms dominant time constant violates the Shannon sampling rule and forces the integrator to fight itself. The first concrete action is therefore to move the FB41 call out of OB1 into a dedicated OB35 (cycle interrupt) at 100 ms.
4. FB41 Parameter Reference Table
The following table lists every FB41 instance-DB parameter that matters for AGC stability. Default values shown are for a fresh CONT_C block; do not run a hydraulic AGC loop with these defaults.
| Parameter | Type | Default | AGC Recommended | Engineering Meaning |
|---|---|---|---|---|
| SP_INT | REAL | 0.0 | 3000.0 | Setpoint in µm (engineering units) |
| PV_IN | REAL | 0.0 | from AI | Thickness feedback in µm |
| PV_FAC | REAL | 1.0 | 1.0 | PV scaling factor |
| PV_OFF | REAL | 0.0 | 0.0 | PV offset (calibration) |
| DEADB_W | REAL | 0.0 | 2.5–5.0 | Dead band in µm (key to ±2 µm stability) |
| GAIN | REAL | 2.0 | 0.4–0.8 (initial) | Proportional gain (dimensionless) |
| TI | TIME | T#20s | T#2s–T#6s | Integral action time |
| TD | TIME | T#0s | T#0.3s–T#1.0s | Derivative action time |
| TM_LAG | TIME | T#10s | T#0.1s–T#0.3s | Derivative low-pass filter |
| DISV | REAL | 0.0 | 5–10 | Disturbance variable for feed-forward |
| CYCLE | TIME | T#1s | T#100ms | FB41 sampling time |
| LMN_HLM | REAL | 100.0 | 100.0 | Output upper limit (%) |
| LMN_LLM | REAL | 0.0 | -100.0 | Output lower limit (%) |
| LMN_FAC / LMN_OFF | REAL | 1.0 / 0.0 | per DA scale | Output scaling to D/A words |
| MAN / MAN_ON | REAL / BOOL | 0.0 / FALSE | commissioning | Manual override (use during step tests) |
Parameter reference: SIMATIC S7-300/400 Standard PID Control — Function Block Manual.
5. Sampling-Time Rule (Section 9.3.1 of the Standard PID Manual)
The Siemens "Standard PID Control" reference manual gives a direct rule for the FB41 CYCLE input:
T_sample ≤ T_dominant / 6
For a hydraulic AGC, the dominant time constant of the combined valve–cylinder–load system is typically 80–200 ms. Therefore the FB41 sample time should be set between 15 ms and 35 ms. The acceptable engineering range is 50–100 ms, which is what OB35 in the default S7-300 / S7-400 CPU configuration provides.
CYCLE parameter is irrelevant — the algorithm runs at OB1 cycle, which on a heavily loaded CPU with communication tasks can stretch to 5 s. Move the call to OB35 and set CYCLE = T#100ms. OB35 must be configured in Hardware → CPU Properties → Cyclic Interrupts with period 100 ms.6. Tuning Procedure — Step Response and Ziegler–Nichols
6.1 Prerequisites
- FB41 instance DB exists and is being called in OB35 with
CYCLE = T#100ms. - PV scaling
PV_FACandPV_OFFverified by injecting a calibration thickness. - Manual mode operational: set
MAN_ON = TRUEandMANto a fixed output (e.g. 30 %). - Trend recorder on PV_IN, LMN, and SP_INT (use the S7 Variable Table or a WinCC trend).
6.2 Open-Loop Step Test
- From a steady state at 28000 µm, with the controller in manual, step
MANfrom 0 % to 20 %. - Record PV_IN until a new steady state is reached. Mark on the trend:
-
Td= dead time (transport delay) — time until PV first visibly changes. -
Tu= time constant (63 % of the total step change). -
Kp= (ΔPV/ΔLMN) process gain in µm / %.
-
- Restore MAN to the original value and allow PV to settle back.
6.3 Apply Ziegler–Nichols PI Tuning
Using the Kp, Tu, and Td measured in §6.2, calculate the initial FB41 parameters from the open-loop Ziegler–Nichols PI rule:
GAIN_Kp = 0.9 · Tu / (Kp · Td)
TI = 3.3 · Td
For example, with a measured Kp = 800 µm/%, Tu = 1.2 s, Td = 0.25 s:
GAIN = 0.9 · 1.2 / (800 · 0.25) = 0.0054
TI = 3.3 · 0.25 s = 0.825 s → T#825ms
This will be intentionally aggressive; in §6.5 it will be detuned.
6.4 Closed-Loop Detuning (Quarter-Amplitude Decay)
- Switch the FB41 to automatic (
MAN_ON = FALSE). - Make a 5 % setpoint step (e.g. SP_INT 3000 → 3150 µm) and observe the response.
- Adjust by quarter-decay rules:
- Amplitude too large, decay too slow → reduce
GAINby 25 %. - Persistent oscillation at constant amplitude → increase
TIby 50 %. - Excessive overshoot, slow recovery → reduce
TIby 20 %. - High-frequency noise superimposed → reduce
TDor increaseTM_LAG.
- Amplitude too large, decay too slow → reduce
- Repeat the step until a critically-damped or slightly underdamped response is achieved with peak overshoot < 5 % and settling time within 5 × Td.
6.5 Add Derivative Action (Critical for AGC)
AGC hydraulic systems exhibit a lightly-damped mechanical resonance in the 3–15 Hz band. Pure PI control will either be slow or, when made faster, will ring at this resonance. Adding a derivative branch stabilises the loop without raising integral gain:
TD = 0.3 · Tu
TM_LAG = 0.1 · TD (or T#100ms, whichever is larger)
The TM_LAG first-order filter is mandatory — without it, a 1 LSB step in PV will appear at the output as an impulse that can saturate the valve amplifier.
7. Dead-Band Implementation (User-Suggested Fix)
The discussion thread explicitly recommends DEADB_W for the ±2 µm target. The dead-band function inside FB41 works as:
if |e| < DEADB_W → e := 0 (controller freezes)
if |e| ≥ DEADB_W → e unchanged
Recommended settings:
| Target Accuracy | DEADB_W (µm) | Comments |
|---|---|---|
| ±5 µm | 8 | Conservative; for load-cell feedback |
| ±2 µm (user target) | 3 | Requires low-noise PV (X-ray gauge preferred) |
| ±1 µm | 1.5 | Only with millisecond scan and 24-bit A/D |
8. Anti-Windup and Bumpless Transfer
Because the start-up travel is 28000 → 3000 µm (an enormous step), integrator windup is the second major cause of the over-shoot and oscillation. Configure FB41 as follows:
- Set
LMN_HLM = 100.0andLMN_LLM = -100.0if the valve is bi-directional; otherwise0..100. - Wire the actual valve feedback to the FB41
LMNR_HS/LMNR_LSoutputs (L or H signalled feedback) by OR-ing in the saturating branch — this is the built-in anti-windup path. - Forced-tracking during manual mode: if
MAN_ON = TRUE, FB41 automatically tracks the integrator so the auto → manual transition is bumpless. Verify in the VAR table thatINT_HOLDandI_ITVALdo not jump when toggling.
A common field-fitted improvement is to pre-charge the integrator by setting the initial LMN to the manually-found steady-state value at the moment of switching from manual to auto, by writing the pre-charge value into the instance DB LMN_I prior to clearing MAN_ON.
9. Step-by-Step Re-Commissioning Procedure
- Move FB41 to OB35. In HW Config, set OB35 period = 100 ms. Replace the call in OB1 with a call in OB35 using the same instance DB. Confirm the call is unconditional and is the only block running in OB35.
- Set CYCLE = T#100ms on the FB41 input pin.
-
Configure output limits:
LMN_HLM = 100.0,LMN_LLM = 0.0(or -100 for bi-directional valve). -
Run the step test in manual (§6.2) and record
Kp,Tu,Td. -
Enter the calculated
GAIN,TIfrom §6.3 into the instance DB. -
Add derivative:
TD = 0.3 · Tu,TM_LAG = max(0.1·TD, T#100ms). - Switch to auto and apply a small setpoint step. Iterate §6.4 until quarter-decay behaviour is obtained.
-
Apply dead band: start at
DEADB_W = 3.0(µm). If steady state is achieved within ±2 µm, leave it. If the band is over-tame, halve to 1.5 µm and re-test. -
Add feed-forward (optional): for material-grade changes, set
DISVfrom a load-cell or speed reference. Section 9.3.5 of the Standard PID manual covers this. - Save the commissioned values to the PLC and document them in the instance-DB symbol table.
10. Verification and Acceptance Test
Acceptance is the user-stated ±2 µm at 3000 µm setpoint under steady rolling conditions. A repeatable verification procedure is:
- Hold the line at constant speed and tension for at least 60 s.
- Capture 600 samples of
PV_IN(10 min at 1 Hz log) into a WinCC archive. - Compute the standard deviation σ. The peak-to-peak steady-state jitter is approximately 6σ. To meet ±2 µm, σ ≤ 0.33 µm.
- Apply a 2 % setpoint step (3060 µm) and verify overshoot ≤ 5 % (153 µm) and 2 % settling time ≤ 4 s.
- Disturbance rejection: simulate a roll-eccentricity pulse (5 % LMN pulse for 200 ms) and verify recovery within 6 s.
If σ is not achieved, walk the DEADB_W down and the TM_LAG down in 20 % steps, re-testing after each change. If oscillations re-appear, raise TI by 30 %.
11. Diagnostics and Online Monitoring
Open the FB41 instance DB in Monitor/Modify (TIA Portal or STEP 7 classic) and observe the following real-time variables:
| DB Variable | Meaning | Healthy Reading |
|---|---|---|
| SP_INT | Current setpoint | = 3000.0 µm |
| PV_IN | Scaled process value | Within DEADB_W of SP_INT |
| ER | Error signal | Near zero at steady state |
| LMN | Manipulated value | Smooth; no high-frequency switching |
| LMN_HLM / LMN_LLM | Output limits | 100.0 / 0.0 |
| QLMN_HLM / QLMN_LLM | Limit active flags | FALSE under normal operation |
| INT_HOLD | Integrator hold | FALSE |
| I_ITVAL | Integrator value | Stable or slowly changing |
| DISV | Disturbance variable | Per feed-forward |
Cross-reference: SIMATIC Standard PID Control — Function Block Manual (PDF, Siemens Support Entry ID 1137082) and the PID controller reference for algorithm definitions.
12. Advanced Topics and References
12.1 Alternative Controller Blocks
For a mill with multiple cascades (gauge → tension → speed) consider migrating to FB58 "TCONT_CP", which is the TIA Portal successor to FB41 and supports pulse-width-modulated outputs, two configurable PID parameter sets, and integrated self-tuning. See the FM 355 / TCONT_CP application notes for migration guidance.
12.2 Smith Predictor for Transport Delay
Long distance between the X-ray gauge and the roll gap introduces a transport delay. The standard fix is a Smith predictor, which is a structural change you can build on top of FB41 by writing the predicted PV to PV_IN. The fuzzy-PID Smith predictor variant is documented in Stability and stabilisation research for hydraulic AGC.
12.3 Higher-Level Cascade Structure
Modern AGC systems use a master–slave structure: the master (FB41) sets a position reference for a slave (FB41) regulating the hydraulic cylinder position. This isolates the slow thickness loop from the fast mechanical resonance. Honeywell's MetalsMaster AGC product and the fuzzy-PID design study for AGC both confirm the two-loop architecture.
12.4 Self-Tuning Option
If commissioning time is limited, add the Siemens PID Self-Tuner (part of the Standard PID Control library). It performs the open-loop step test automatically and writes the resulting GAIN, TI, TD into the same instance DB. Reference: Siemens PID Self-Tuner manual.
13. Field-Commissioning Summary Matrix
| Symptom | Likely Cause | Action | Expected Improvement |
|---|---|---|---|
| ±6000 µm limit cycle | 5 s OB1 scan time | Move FB41 to OB35, CYCLE = T#100ms | Cycle time shrinks by 50× |
| Large overshoot from 28 mm start | Integral windup | Set LMN_HLM/LLM; pre-charge integrator | No saturation overshoot |
| High-frequency ring on steady state | Hydraulic resonance undamped | Enable TD = 0.3·Tu, TM_LAG = 0.1·TD | Noise attenuated >10 dB |
| ±5 µm random jitter | A/D quantization + valve dead zone | Set DEADB_W = 3.0 | ±2 µm steady state |
| Slow reaction to setpoint | TI too long | Halve TI; re-test | 30–50 % faster settling |
| Aggressive response, overshoot | GAIN too high | Reduce GAIN by 20 % | Overshoot <5 % |
14. Frequently Asked Questions
What is the recommended FB41 sample time for a hydraulic AGC loop?
Use OB35 at 100 ms and set CYCLE = T#100ms. A 5 s OB1 cycle on a 100–200 ms hydraulic system violates the standard rule T_sample ≤ T_dominant / 6 and produces a forced limit cycle that looks like a tuning failure.
Why does my FB41 oscillate between -2945 and +3100 µm at a 3000 µm setpoint?
That is a symmetric limit cycle of period approximately twice the scan time. The most common cause is the controller being called in OB1 at 1–5 s. Move the call to OB35, reduce GAIN to one-third of its current value, increase TI to 3–6 s, and re-test.
Should I add the derivative (TD) action in FB41 for gauge control?
Yes, for hydraulic AGC the derivative term with a TM_LAG low-pass filter is essential to damp the 3–15 Hz mechanical resonance of the cylinder. Start with TD = 0.3·Tu and TM_LAG = max(0.1·TD, T#100ms).
What value of DEADB_W gives ±2 µm stability?
For an X-ray gauge with 1 µm resolution, set DEADB_W = 3.0 µm initially. The dead band should be about 1.5× the target peak-to-peak accuracy. Smaller values risk chatter; larger values introduce steady-state offset.
How do I prevent integrator windup during the 28 mm → 3 mm cold-start ramp?
Wire the valve saturation feedback into the FB41 LMNR_HS / LMNR_LS inputs, set LMN_HLM = 100 and LMN_LLM = 0 (or -100 for bi-directional valves), and pre-charge the I_ITVAL integrator to the manually-found steady-state output before switching to auto.