Resolving Siemens FB58 TCONT_CP Auto-Tuning Stuck in Phase 1

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

1. Problem Overview

The Siemens FB58 TCONT_CP is the standard PID temperature controller block from the STEP 7 Standard Library (PID Control Blocks / Standard PID Control V5.x and V6.x). It is widely deployed on S7-300 and S7-400 controllers for heating, cooling, and combined heating/cooling loops. A common commissioning failure is the auto-tuning routine halting inside Phase 1 (identification of the quasi steady-state) for 20 minutes or longer, while the controlled variable (PV/temperature) already coincides with the setpoint (SP). The block never advances to Phase 2, where the setpoint step change is generated to identify the process gain, dead time, and dominant time constant.

The reference behavior documented in the Siemens manual states that Phase 1 should last approximately one minute after TUN_ON = TRUE is asserted and the loop has reached a quasi steady state. If PV has reached SP but the controller remains in Phase 1 for tens of minutes, the tuning state machine is starved of the precondition it requires to advance. This article covers the underlying state machine, the field-proven root causes, and a deterministic commissioning procedure.

Application context: The reported failure is a steam-heated plate heat exchanger charging a water tank from PV ≈ 50 °C to SP = 65 °C. Saturated steam control valves typically have fast actuation relative to the thermal mass, so loop dynamics sit in the regime where TCONT_CP auto-tuning is highly sensitive to noise, dead-band configuration, and the quality of the steady-state read.

2. FB58 TCONT_CP Architecture and the Auto-Tuning State Machine

FB58 TCONT_CP is a fully continuous-acting PID controller with two-degree-of-freedom structure, integral anti-windup, setpoint ramp limiting, and a built-in tuner. It exposes the following key I/O relevant to commissioning:

I/O Symbol Type Function
PV_IN INPUT REAL Process value (scaled, °C)
SP_INT INPUT REAL Internal setpoint in % or engineering units
PV_FAC / PV_OFF INPUT REAL Scaling factors for PV normalization
SP_HLM / SP_LLM INPUT REAL Setpoint high/low clamps
MAN / MAN_ON INPUT REAL / BOOL Manual manipulated variable override
LMN_A / LMN_B OUTPUT REAL Analog / binary manipulated variable outputs
TUN_ON INPUT BOOL Enable tuner (enters Phase 1)
TUN_ST INPUT BOOL Trigger setpoint step / Phase 2 start
STATUS_H, STATUS_D OUTPUT WORD Heating and cooling status words
RR OUTPUT REAL Effective setpoint after ramp generator
TUN_CM, TUN_CL, TUN_KP, TUN_TI, TUN_TD, TUN_TM_LAG OUTPUT Identified controller parameters

2.1 Auto-Tuning Phase Definition

The tuner of FB58 follows a documented three-stage state machine. The phase number is exposed in the on-line block view header and through the STATUS_H / STATUS_D bits. The stages are:

  1. Phase 1 — Steady-state identification. With TUN_ON = TRUE, the controller observes the closed loop and waits for a quasi steady state. The block records the average LMN, average PV, and verifies that PV is close to SP. Phase 1 normally completes in ~1 minute when the loop is properly damped and noise is bounded.
  2. Phase 2 — Setpoint step identification. After Phase 1 succeeds, the user asserts TUN_ST = TRUE (or the block does it internally depending on configuration) and produces a setpoint step. The PV response is sampled, and the process is identified as a PTn model. KP, TI, TD are calculated.
  3. Phase 3 — Parameter adoption. Identified parameters are written into GAIN, TI, TD of the active PID core, the LMN smoothing filter is updated, and TUN_ON may be reset by the user.

2.2 Internal State Diagram

IDLETUN_ON = FALSE PHASE 1steady-state wait PHASE 2SP step + ID ABORTconditions violated PHASE 3adopt params TUN_ON = TRUE PV≈SP & stable ID ok timeout / drift

The critical transition is PHASE 1 → PHASE 2. It only fires when all of the following are simultaneously true:

  • PV is within the configured dead-band of SP (default tuning tolerance).
  • The derivative of PV (filtered) is below an internally calculated noise threshold for a continuous dwell time.
  • The closed-loop output LMN is within a valid operating range (no saturation).
  • The setpoint has been stable (no SP ramp in progress).
  • No process alarm is active (PV outside limits, sensor break).
Common misconception: Many engineers assume that "PV = SP" alone is sufficient. In practice, if any of the conditions above is violated, Phase 1 will continue sampling indefinitely and the timer will appear to "stall" for tens of minutes.

3. Root Causes for FB58 Auto-Tuning Stuck in Phase 1

The following root causes have been observed in the field, ranked by frequency.

3.1 Setpoint Ramp Generator Active (RR ≠ SP)

If SP_RAMP is non-zero in the FB58 instance DB, the effective setpoint RR is ramping toward SP_INT. The tuner treats this as a non-steady-state because SP_INT is changing. Phase 1 cannot terminate until the ramp settles. With a 50 → 65 °C heating ramp, a typical SP_RAMP value of 1 °C/min means the ramp itself lasts 15 minutes, plus the dwell window. Symptom: Phase 1 starts immediately, but does not advance until RR ≈ SP_INT for the configured dwell.

3.2 TUN_ON Asserted Before Steady State

The Siemens manual explicitly states: "The TUN_ON bit must only be set in the steady state or during aperiodic settling to the steady state. If the quasi steady state changes after setting the TUN_ON bit, this must be reset and the new quasi steady state must be signaled to FB58 by setting the TUN_ON bit again." In a steam-heated exchanger, the temperature curve typically has a tail — even after PV reaches SP, residual dynamics cause LMN to keep adjusting. If TUN_ON was asserted too early (e.g. while PV was still climbing rapidly), the block is locked into an unstable observation window and will not advance.

3.3 PV Noise Exceeds Tuning Dead-Band

RTD / thermocouple inputs on the AI module, especially unshielded thermocouples routed near VFD cables or steam solenoids, can show ±0.3 to ±0.8 °C noise. FB58 uses an internal noise filter (DEADB_W and FILTER parameters). If noise causes the filtered PV derivative to exceed the threshold, Phase 1 never completes. Add an external low-pass on the AI or increase FILTER (in seconds) carefully.

3.4 Output Saturation / Valve Stiction

If the steam control valve is near saturation (LMN ≥ 100 % or LMN ≤ 0 %), the closed loop is not in a linear operating region. The tuner discards the sample and continues waiting. Steam valves with graphite packing often show significant stiction; even if LMN = 35 %, the actual stem position may have a 5–10 % hysteresis band.

3.5 Sensor Break, Overflow, or Wrong Scaling

If the AI returns 7FFF hex (overflow) or 8000 hex (wire break) momentarily, FB58 latches a process alarm and refuses to advance. Check PV_FAC and PV_OFF against the AI scaling. With a PT100, the typical 0–300 °C range gives PV_FAC = 300.0 / 27648 = 0.01085, PV_OFF = 0.0.

3.6 Sample Time (CYCLE) Mismatch with FB58

FB58 must be called in OB35 (or any cyclic OB) with a constant time base. If CYCLE in the block does not match the OB35 period, or if OB35 is overloaded, the internal timers drift and Phase 1 never finishes within its expected window. Verify the OB35 cycle time matches SAMPLE_T parameter of FB58.

3.7 Manual Mode Active

If MAN_ON is TRUE during tuning, FB58 evaluates the manual path and does not transition. Reset MAN_ON = FALSE before and during the entire auto-tuning procedure.

4. Diagnostic Procedure

Follow this procedure before attempting to re-trigger auto-tuning. The goal is to verify that all Phase 1 preconditions are satisfied.

  1. Open the FB58 instance DB in STEP 7 and switch to Monitor/Modify view.
  2. Confirm TUN_ON is TRUE and confirm the value of TUN_KP, TUN_TI, TUN_TD. Identical to defaults (1.0 / 0.0 s / 0.0 s) indicates the tuner has not yet produced output.
  3. Record SP_INT, PV_IN, RR, and LMN values over a 60-second window using the trace / trend facility.
  4. Compute the difference |SP_INT − RR|. If it is non-zero, the ramp is active → see §3.1.
  5. Compute the standard deviation of PV_IN over 60 s. If σ > 0.2 °C for a 50–80 °C loop, suspect noise → §3.3.
  6. Verify the AI raw value in the hardware diagnostic (PIW) and confirm it is not returning 7FFF hex occasionally → §3.5.
  7. Check LMN: if LMN ≥ 95 % or LMN ≤ 5 %, the loop is saturated → §3.4.
  8. Open the STATUS_H / STATUS_D word: bit 1 typically indicates "Tuning active", bit 2 "Phase 1 in progress", bit 3 "Phase 2 in progress", bit 4 "Tuning error". A latched bit 4 indicates the tuner has aborted. Reset by toggling TUN_ON.
  9. Confirm the OB35 cycle time (ms) and verify SAMPLE_T parameter on FB58 matches. Typical default is 1.0 s.

5. Step-by-Step Resolution

Apply these actions in order. After each step, re-evaluate whether Phase 1 advances.

5.1 Pre-Conditions (Mandatory)

  • Loop in AUTO (MAN_ON = FALSE).
  • SP_RAMP = 0.0 °C/min (or set SP = current PV to disable ramp effect).
  • PID output not saturated: drive the loop with conservative manual KP = 0.5, TI = 120 s, TD = 0 s until PV tracks SP cleanly.
  • PV noise filtered: FILTER ≥ 5.0 s for thermocouples, ≥ 2.0 s for PT100.

5.2 Trigger TUN_ON Only After the True Steady State

Use this ST snippet in OB35 or a periodic FC:

// Wait until |PV - SP| < 0.5 °C for at least 60 s
IF NOT #TuningStarted THEN
    IF ABS(TarPv - TarSp) < 0.5 THEN
        #StableDwell := #StableDwell + 1.0;  // OB35 cycle counts
    ELSE
        #StableDwell := 0.0;
    END_IF;
    IF #StableDwell >= 60.0 THEN    // 60 s dwell
        TCONT_CP.TUN_ON := TRUE;
        #TuningStarted := TRUE;
    END_IF;
END_IF;

Replace TarPv and TarSp with the actual DB symbols. Setting TUN_ON after the dwell guarantees the manual precondition is met.

5.3 Generate the Setpoint Step

After Phase 1 completes (typically 60–90 s after TUN_ON = TRUE), the block sets a status flag indicating "ready for setpoint step". Then:

// Trigger Phase 2 with a 5–10 °C step
IF TCONT_CP.STATUS_H AND STATUS_READY_BIT THEN
    TCONT_CP.SP_INT := TCONT_CP.SP_INT + 7.5;  // 7.5 °C step
    TCONT_CP.TUN_ST := TRUE;                   // explicit trigger if required by config
END_IF;

The Siemens manual recommends a step size of 5–10 % of the operating range. With a 0–100 °C transmitter, this translates to 5–10 °C. Smaller steps fail to produce sufficient SNR; larger steps violate process safety.

5.4 Read Identified Parameters and Apply

After Phase 2 concludes, FB58 writes the identified values into the output parameters. Transfer them to the active PID core:

// Read and apply
GAIN   := TCONT_CP.TUN_KP;   // Proportional gain
TI     := TCONT_CP.TUN_TI;   // Integral time [s]
TD     := TCONT_CP.TUN_TD;   // Derivative time [s]
TM_LAG := TCONT_CP.TUN_TM_LAG; // Derivative lag [s]

TCONT_CP.TUN_ON := FALSE;    // exit tuning mode
TCONT_CP.TUN_ST := FALSE;

5.5 Verification of Results

Drive a setpoint step (e.g. 65 → 70 °C) and verify:

  • Time to reach ±2 °C of SP within the predicted time constant.
  • Overshoot < 5 % (for heating processes, slight overshoot is acceptable).
  • No persistent oscillation: amplitude decay ratio ≥ 4:1 within 3 cycles.
  • Valve does not chatter: derivative action filtered through TM_LAG.

6. Parameter Configuration Reference Table

Parameter Typical Value (Steam-Water Exchanger) Effect When Misconfigured
SP_RAMP 0.0 °C/min during tuning, 2.0 °C/min in production Ramp active → Phase 1 never completes
FILTER 5.0 s (TC), 2.0 s (RTD) Too low: noise prevents tuning; Too high: sluggish response
DEADB_W 0.1 °C Too wide: controller appears dead; Too narrow: hunts on noise
SAMPLE_T 1.0 s (matches OB35 = 1000 ms) Mismatch: timing drift in tuner
GAIN 0.3–1.5 (initial guess) Wrong initial gain: saturation in Phase 1
TI 60–300 s Too low: oscillation; Too high: sluggish recovery
TD 0.0 s for first-order processes TD on thermal mass adds unnecessary noise
PV_FAC Range / 27648 Wrong scaling: PV ≠ real temperature → tuner confused
PV_OFF 0.0 °C Non-zero offset biases the controller
LMN_HLM / LMN_LLM 100.0 / 0.0 Restrict if valve has limited authority
MAN_ON FALSE during tuning TRUE: tuner blocked

7. Field-Proven Diagnostic Matrix

Symptom Likely Cause Verification Fix
Phase 1 > 20 min, PV ≈ SP, SP_RAMP = 0 Noise / FILTER too low σ(PV) over 60 s Increase FILTER; add AI hardware filter
Phase 1 > 20 min, PV climbing, LMN saturated TUN_ON asserted before settling PV derivative trend Reset TUN_ON, wait, re-trigger
Phase 1 completes but no Phase 2 SP step not generated, TUN_ST stuck Monitor RR vs. SP_INT Generate explicit step in user code
Phase 2 aborts immediately PV limit alarm / sensor break STATUS_H bit 4 Fix sensor / scaling; reset TUN_ON
Identified KP too aggressive Step too small (poor SNR) Step amplitude Use 7–10 % of range step
Identified KP too small Valve stiction, nonlinearity Step response shape Service valve, re-tune with actuator health verified

8. Alternative Tuning Approaches

If FB58 auto-tuning continues to fail after the diagnostic steps above, three alternatives exist:

  1. Manual open-loop step test. Drive the loop in manual, apply a 10 % LMN step, log PV over 3 × expected dead time, and compute KP, TI, TD using Cohen-Coon or Lambda tuning. Then load these directly into FB58.
  2. Use FB59 TCONT_S instead of FB58. FB59 is the step-controller variant with simpler tuning rules and may be more tolerant of slow thermal processes.
  3. Use PID Self-Tuner blocks (FB60/61, or PID Compact on S7-1200/1500). On S7-1200/1500 the replacement block is PID_Compact (FB 1139 in TIA Portal V13+), which uses an improved identification method more robust against noise and slow processes.

9. Cross-Platform Notes

  • S7-1200 / S7-1500 / TIA Portal: FB58 is not available. Use PID_Compact (FB 1139) or PID_3Step for valve control. The TUN_ON / TUN_ST concept maps to StartTuning and TuningMode input bits.
  • S7-200 / SMART200: Use the PID wizard which generates a fixed-cycle PID with separate tuning utility.
  • STEP 7 V5.5 vs. V5.6: TCONT_CP versions shipped with V5.5 and V5.6 are identical in interface, but newer firmware on S7-300 CPUs may exhibit minor differences in the identification algorithm under high noise. Firmware ≥ V3.3 on S7-300 CPU 31x is recommended.
  • Firmware on the CPU must match the FB version: The Standard PID Control V5.x library requires CPU firmware ≥ V2.x on S7-300; V6.x requires ≥ V3.0.

10. Safety and Process Considerations

Steam hazard: During auto-tuning, the controller intentionally produces a setpoint step that may open the steam valve well beyond normal operating duty. Confirm that the downstream piping, condensate trap, and PRV are sized for the maximum possible LMN before initiating TUN_ON. Install a mechanical over-temperature relief independent of the PLC.
  • Always run auto-tuning with the loop in AUTO and a verified backup controller or hardwired limit in place.
  • Capture a process trend of PV, SP, and LMN at 500 ms resolution before and during tuning for post-mortem.
  • If the process includes a thermostatic mixing valve downstream, lock it open during tuning to avoid cross-coupling.
  • Document the final KP, TI, TD, and TM_LAG values in the loop database (e.g., COMOS, PlantCom).

11. Reference to Official Documentation

The following Siemens support documents provide authoritative detail. Verify against your installed library version before commissioning.

12. Commissioning Checklist

  1. FB58 instance DB compiled without warnings.
  2. OB35 cycle matches SAMPLE_T.
  3. AI wiring and shielding verified; σ(PV) < 0.1 °C.
  4. PV_FAC / PV_OFF match transmitter calibration certificate.
  5. SP_RAMP = 0 for tuning phase.
  6. Initial PID parameters produce stable closed-loop response in manual-driven test.
  7. TUN_ON asserted only after stable dwell verified.
  8. Setpoint step amplitude 5–10 % of range.
  9. Identified parameters documented; production SP_RAMP restored.
  10. Loop response trend saved to plant archive.

Why does FB58 TCONT_CP stay in Phase 1 for more than 20 minutes?

The tuner requires a true quasi steady-state: PV within the dead-band of SP, the filtered PV derivative below a noise threshold, the setpoint stable (SP_RAMP not active), output not saturated, and no process alarm. If any condition is violated, Phase 1 holds. Most common causes are an active SP ramp, sensor noise exceeding DEADB_W, valve saturation, or TUN_ON asserted before the loop had settled.

How long should FB58 Phase 1 normally last?

The Siemens manual states Phase 1 should complete in approximately one minute when the loop is properly damped. Times beyond 5 minutes indicate a precondition is not met. Re-trigger TUN_ON only after PV has been stable and within ±0.5 °C of SP for at least 60 s.

When should I assert TUN_ST to advance from Phase 1 to Phase 2?

Assert TUN_ST only after FB58 has confirmed Phase 1 completion (visible in the on-line block header as phase = 2, or via STATUS_H bit transitions). Forcing TUN_ST = TRUE during Phase 1 will be ignored. The recommended setpoint step amplitude is 5–10 % of the operating range; for a 0–100 °C loop, use 5–10 °C.

Can I use FB58 with an S7-1200 or S7-1500?

No. FB58 TCONT_CP is exclusive to S7-300 / S7-400 with STEP 7 V5.x. On S7-1200/1500 use PID_Compact (FB 1139) or PID_3Step in TIA Portal. The TUN_ON concept maps to the StartTuning input and the state machine to the TuningMode output.

What if the auto-tuned KP / TI cause oscillation in production?

Reduce GAIN by 30 %, increase TI by 50 %, and re-evaluate. Verify that the operating point during production is not in a non-linear region of the steam valve (typically below 10 % opening for graphite-packed globe valves). For heavily non-linear actuators, consider FB59 TCONT_S with a non-linear compensation curve, or replace the valve with a characterized segment ball valve.

Back to blog