Siemens FB41 CONT_C PID Block: GAIN, TI Reset, and TD Effects

David Krause24 min read
PID ControlSiemensTechnical Reference
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. Overview

The Siemens FB41 "CONT_C" (continuous controller) is the workhorse PID block shipped with the SIMATIC Standard PID Control library for STEP 7 / S7-300 / S7-400. It implements a parallel-form (non-interacting) PID algorithm with separate proportional, integral, and derivative paths, integral-action anti-windup, bumpless transfer between manual and automatic modes, configurable process-variable / setpoint / manipulated-variable scaling, a tracking input, and a disturbance feed-forward input. Understanding how the three primary tuning constants — GAIN, TI (the "reset" or integral time), and TD (the derivative time) — actually shape the controller output is essential for field commissioning, especially because Siemens documents TI in minutes per repeat rather than the repeats per minute used in many DCS systems.

2. FB41 in the Standard PID Control Library

FB41 is part of the "Standard PID Control" library that ships with STEP 7 V5.x and remains importable into TIA Portal for S7-300/400 targets. The canonical Siemens documentation is the manual Standard PID Control (function blocks FB41–FB43), entry ID 1137085 in the Siemens Industry Online Support:

FB41 family of function blocks
Block Name Function
FB41 CONT_C Continuous PID controller with analog (REAL) output, suitable for modulating actuators
FB42 CONT_S Step controller with pulse outputs QPOS_P and QNEG_P for motor-driven valves
FB43 PULSEGEN Pulse generator that converts LMN from FB41 to PWM duty cycle on a digital output
FB58 TCONT_CP Temperature controller (continuous) for S7-300/400 with extended self-tuning
FB59 TCONT_S Temperature controller (step) for motorised heating/cooling valves

Each FB41 instance requires an instance DB (created automatically when the FB is called) plus a static data area. The instance DB is typically renamed to a project-specific name, e.g. DB201 "PID_FURNACE", and houses all the tuning parameters in a structure that can be monitored and forced online.

3. I/O Pinout of FB41 CONT_C

The block exposes a comprehensive set of inputs and outputs. The most important pins for tuning and observation are listed below; the full set is in the Siemens manual referenced above.

Key inputs and outputs of FB41
Pin Dir Type Purpose
SP_INT IN REAL Internal setpoint (in % or engineering units, after scaling)
PV_IN IN REAL Process variable input (engineering units)
PV_FAC IN REAL Process variable multiplier (default 1.0)
PV_OFF IN REAL Process variable offset (default 0.0)
SP_FAC IN REAL Setpoint multiplier (default 1.0)
SP_OFF IN REAL Setpoint offset (default 0.0)
MAN IN REAL Manual manipulated value in %
MAN_ON IN BOOL TRUE: controller follows MAN; FALSE: automatic mode
GAIN IN REAL Proportional gain Kp (dimensionless)
TI IN REAL Reset time in MINUTES (integral action time)
TD IN REAL Derivative time in MINUTES
TM_LAG IN REAL Time constant of the D-element first-order lag, in seconds
DEADB_W IN REAL Dead-band width on the error, in % of span
LMN_FAC IN REAL Output multiplier (default 1.0)
LMN_OFF IN REAL Output offset (default 0.0)
LMN_HLM IN REAL Output high clamp (default 100.0 %)
LMN_LLM IN REAL Output low clamp (default 0.0 %)
DISV IN REAL Disturbance feed-forward added to the I-term
INT_HOLD IN BOOL TRUE: freeze the integral accumulator
I_ITL IN BOOL Rising edge re-initialises I-term to I_ITLVAL
I_ITLVAL IN REAL Initial value for the I-term, in %
PV OUT REAL Scaled effective process variable
ER OUT REAL Effective error after scaling and dead-band
LMN OUT REAL Manipulated variable in % (after output scaling)
LMN_P OUT REAL Proportional contribution to LMN (trending)
LMN_I OUT REAL Integral contribution to LMN (trending)
LMN_D OUT REAL Derivative contribution to LMN (trending)
QLMN_HLM OUT BOOL TRUE: LMN at the high clamp
QLMN_LLM OUT BOOL TRUE: LMN at the low clamp

4. The Continuous PID Algorithm in FB41

FB41 evaluates a parallel-form PID structure. The ideal continuous-time equation is:

u(t) = Kp * [ e(t) + (1/TI) * ∫ e(τ) dτ + TD * de(t)/dt ]

The output of FB41 is the manipulated variable LMN in percent of final control element range. The error e(t) is the difference between the scaled setpoint and the scaled process variable, after the dead-band is applied. The three terms are independent in the parallel structure, so the contribution of each term to the final output can be inspected individually via LMN_P, LMN_I, and LMN_D. This separation is one of the most useful commissioning features of the block: you can trend each term and see exactly which knob to turn.

For the discrete implementation, FB41 uses the backward-rectangle (backward-Euler) approximation for the integral action and a first-order-lag filtered derivative for the rate term. With sample time TS (set by the calling OB, typically OB35 at 1000 ms) and a fixed internal derivative gain of N = 10 used to bound the high-frequency derivative gain, the discrete update is equivalent to:

I_n = I_{n-1} + Kp * (TS / TI) * e_n D_n = (TD / (TD + N*TS)) * D_{n-1} + (Kp * N * TD) / (TD + N*TS) * (e_n - e_{n-1}) P_n = Kp * e_n LMN_raw = P_n + I_n + D_n + DISV LMN = clamp(LMN_raw, LMN_LLM, LMN_HLM)

The integral action is held (frozen) when INT_HOLD is TRUE. The integral state is re-initialised to I_ITLVAL on a rising edge of I_ITL. The output is clamped to [LMN_LLM, LMN_HLM], and the integral action uses an anti-windup back-calculation so that the I-term cannot grow beyond what the output clamp allows. DISV is added directly to the raw I-term, making it a feed-forward action that influences the I-state without going through the P or D paths.

5. GAIN: The Proportional Action

GAIN sets the controller's proportional gain Kp. The relationship between the gain, the proportional band (PB), and the error in percent of the PV span is:

P_out = Kp * e = (100 / PB_percent) * e_percent

If the setpoint is in percent (0–100) of the process range, a gain of 1.0 produces an output change equal to the error in percent. A gain of 2.0 doubles the reaction, and a gain of 0.5 halves it. The P-only step response to a step error of magnitude E is a constant value in time:

P_out(t) = Kp * E (for t ≥ 0)

This is the classic P-controller offset: the output never integrates away the steady-state error because the I-action is not present. Without I-action, a constant disturbance of magnitude d in PV units will always leave a residual error of:

e_ss = d / Kp

The effective proportional band (in % of span) for a given gain is:

PB_percent = 100 / Kp

For example, a gain of 2.0 corresponds to a proportional band of 50 %, meaning a 50 % step in error drives the output from 0 to 100 %. A gain of 0.5 corresponds to a 200 % PB, which is a sluggish loop that never reaches 100 % output on a 100 % error.

Field tip: if the controller overshoots and oscillates, the gain is too high relative to the process time constants. If the controller is sluggish with a permanent offset, raise the gain until the offset shrinks and oscillation appears, then back off 30–50 %.

6. TI: The Integral (Reset) Action — Siemens Convention

TI is the "reset time" or "integral action time" in MINUTES. This is the single most frequently misunderstood parameter on FB41. To be unambiguous about Siemens convention:

Siemens convention: TI is the time, in minutes, required for the integral contribution to grow to equal the proportional contribution for a constant step error. The smaller TI, the faster the I-action (more aggressive integration). Equivalently, the I-action performs one full "repeat" of the proportional action every TI minutes. Setting TI = 0.0 disables the integral action entirely.

To see this, consider a constant step error of magnitude E applied at t=0 with no D-action and no disturbance. The controller output for t ≥ 0 is:

u(t) = Kp * E + Kp * E * t / TI = Kp * E * (1 + t / TI)

The proportional contribution is Kp*E. The integral contribution at time t is Kp*E*t/TI. They are equal when t = TI. So TI is the time, in minutes, for the integral to "repeat" the proportional correction. Equivalently:

repeats_per_minute = 1 / TI (with TI in minutes)

The valid Siemens range for TI is typically 0.0 to 9999.0 minutes; the input is a REAL and accepts fractional values such as 0.25 min (= 15 s).

For comparison with a DCS that expresses the integral as "repeats per minute" (rpm):

TI_SIEMENS_min = 1 / rpm rpm = 1 / TI_SIEMENS_min

For example, a DCS tuning of "0.5 repeats per minute" maps to FB41 TI = 2.0 minutes. A DCS tuning of "5 repeats per minute" maps to FB41 TI = 0.2 minutes. The "minutes per repeat" naming maps directly to TI on FB41.

For a step input of magnitude E applied at t=0, the integral contribution as a function of time is:

LMN_I(t) = Kp * E * t / TI (in LMN units, i.e., % if LMN is in %)

The slope of the integral ramp is therefore Kp * E / TI. Doubling Kp doubles the I-ramp slope. Doubling TI halves the I-ramp slope (slower integration).

Effect of TI on controller behaviour
TI (minutes) Behaviour Typical use
0.0 No I-action; pure P or PD Fast positioning, surge control, manual reset
0.1 – 1.0 Aggressive integral, eliminates offset quickly Flow, pressure with fast dynamics
1.0 – 5.0 Moderate integral, common for temperature and level Thermal loops, tank level
5.0 – 30.0 Slow integral, smooth but slow to recover from disturbances Slow temperature, large thermal masses
> 30.0 Very slow; effectively no I-action Process with strong self-regulation

7. TD: The Derivative Action

TD is the derivative time in MINUTES. It sets how much rate action contributes to the output per unit of error rate. The continuous-time contribution of the D term is:

D_out(t) = Kp * TD * de(t)/dt

In Siemens FB41, the D-action is filtered through a first-order lag to attenuate high-frequency measurement noise. The user-tunable time constant of this lag is TM_LAG (in seconds). The discrete filtered D-action, expressed with TI, TD in minutes and TS in minutes, is approximately:

D_n = alpha * D_{n-1} + (1 - alpha) * Kp * TD * (e_n - e_{n-1}) / TS alpha = TD / (TD + TM_LAG/60)

Setting TD = 0.0 disables derivative action. The valid range is typically 0.0 to 9999.0 minutes. Practical TD values for industrial processes:

Effect of TD on controller behaviour
TD (minutes) Behaviour Typical use
0.0 Pure PI controller (no D-action) Most flow / level / pressure loops
0.05 – 0.5 Light D-action, smooths the response Temperature with noisy PV
0.5 – 2.0 Moderate D-action Motion control, fast position
> 2.0 Aggressive D-action; very noise-sensitive Rare in process control
Field tip: D-action amplifies measurement noise by approximately (Kp*TD/TS) at each scan. Always filter the PV with a low-pass and use moderate TD. If the manipulated variable shows high-frequency jitter, increase TM_LAG or reduce TD. For most process loops (flow, level, pressure, slow temperature) the safest starting point is TD = 0.0 (pure PI).

8. Step Response of a PI Controller in FB41

For a constant step error E applied at t=0, with the D-action disabled (TD = 0.0) and no disturbance, the FB41 output evolves as:

time t (min) LMN (%) 0 t 100 Kp * E P-action = Kp * E (constant) I-action = Kp*E*t/TI Total PI output t = TI (integral = proportional) TI

The P-action (blue) jumps instantly to Kp * E and stays there. The I-action (orange) starts at zero and ramps linearly with slope Kp * E / TI. The total PI output (green) is the sum. At t = TI, the I-action has caught up to the P-action; at t = 2*TI, the I-action is twice the P-action; and so on. This is the geometric meaning of "minutes per repeat" that Siemens uses for TI.

For a PI controller with GAIN = 1.5, TI = 2.0 min, and a step error of E = 10 (e.g., 10 % deviation of PV below SP), the output at t=0 is 15 %, and the I-ramp climbs at 7.5 % per minute, so it adds 15 % more after 2 minutes, 30 % more after 4 minutes, etc. In practice, the ramp stops when the process reaches setpoint and the error drops back to zero.

9. Anti-Windup, Output Limiting, and Bumpless Transfer

Integral windup is the phenomenon where the I-term keeps integrating while the manipulated variable is saturated at 0 or 100 %, so the controller cannot immediately back off the output when the PV returns to setpoint. FB41 implements anti-windup by tracking the I-term separately and clamping it so that LMN = LMN_P + LMN_I + LMN_D stays inside [LMN_LLM, LMN_HLM]. The integral action is held (frozen) when INT_HOLD = TRUE.

Anti-windup and bumpless-transfer pins
Pin Purpose
LMN_HLM / LMN_LLM Output clamps (default 100 / 0 %); anti-windup operates within these
INT_HOLD Freeze the integral accumulator while TRUE
I_ITL (BOOL, rising edge) On rising edge, the I-term is re-initialised to I_ITLVAL
I_ITLVAL (REAL) Initial value for the I-term, e.g., 50 % for startup at mid-stroke
MAN_ON (BOOL) TRUE: LMN follows MAN; FALSE: automatic mode
MAN (REAL) Manual manipulated value in %
QLMN_HLM / QLMN_LLM Output flags indicating the LMN has hit a clamp

On switching from manual to automatic (MAN_ON goes from TRUE to FALSE), the I-term is loaded with the current MAN value minus the current P and D contributions. This guarantees a bumpless transition: the output does not jump at the moment of the switch. The reverse transition (automatic to manual) is the responsibility of the user — you must drive MAN with the current LMN before flipping MAN_ON to TRUE.

time t (s) LMN / MAN (%) 50 % MAN = 50 % LMN (bumpless) MAN_ON = TRUE MAN_ON = FALSE

The blue trace is the MAN input; the green trace is the actual LMN output. In manual mode (MAN_ON = TRUE), LMN tracks MAN exactly. The instant MAN_ON drops to FALSE, the I-term is loaded with the current LMN minus the P and D contributions, so the output continues smoothly. After the switch, the controller reacts to the error and adjusts LMN.

10. Sample Time and Where to Call FB41

FB41 must be called in a cyclic OB. The call period TS is the OB period. Common practice:

  • OB35 (cyclic interrupt, default 1000 ms): typical choice for process control loops at 1-second sample time. The OB35 period can be reconfigured in HW Config from 1 ms up to 60 s.
  • OB1 (main cyclic): the call period is the OB1 cycle time, which depends on the program. Often 10–100 ms. Faster than OB35, but OB1 cycle time can vary with program load and may cause derivative noise issues.
  • OB32, OB33, OB34: additional cyclic interrupt OBs at default 500 ms / 200 ms / 100 ms. Useful for medium-speed loops.

Rule of thumb: choose TS at most one tenth of the dominant process time constant. For a temperature loop with time constant of 5 min, a TS of 5–10 s is appropriate. For a flow loop with time constant of 0.5 s, a TS of 50–100 ms is appropriate.

Pitfall: setting TI or TD much smaller than TS effectively makes the controller behave erratically, because the discrete integral and derivative approximations assume TS << TI, TD. Always keep TS at least 5× smaller than the smallest TI value you intend to use. For a TS of 1000 ms, the smallest practical TI is around 0.083 min (5 s); for a TS of 100 ms, the smallest TI is around 0.0083 min (0.5 s).

11. Setpoint and Process-Variable Scaling

FB41 supports independent scaling on the setpoint and PV paths:

PV = PV_FAC * PV_IN + PV_OFF SP_effective = SP_FAC * SP_INT + SP_OFF ER = SP_effective - PV (after dead-band)

Typical use cases:

  • PV_FAC / PV_OFF: linearise a 4-20 mA input that has already been converted to engineering units. For example, a 0–100 °C RTD scaled to 0.0–100.0 °C: PV_FAC = 1.0 and PV_OFF = 0.0. If the input is in 0.1 °C units, use PV_FAC = 0.1.
  • SP_FAC / SP_OFF: scale the setpoint to match the PV range; useful when SP comes from another controller in a cascade. Often left at 1.0 / 0.0.
  • DEADB_W: suppress small noise-induced controller action. A DEADB_W of 0.5 means errors below 0.5 % of span are treated as zero. Useful on level loops with a noisy dP cell.

12. Output Scaling

The final manipulated variable that leaves FB41 is:

LMN_scaled = LMN_FAC * LMN + LMN_OFF

Defaults are LMN_FAC = 1.0 and LMN_OFF = 0.0, giving LMN directly in percent. To convert LMN (%) to a 4-20 mA output for a valve, the scaling is normally done outside FB41 in the analog-output driver block (e.g., FB79 or a CP/IM analog output with scale block). When the controller drives a motor-driven valve through FB42 (CONT_S) or FB43 (PULSEGEN), LMN in % is interpreted as the desired valve position.

Output scaling for a 4-20 mA valve
Parameter Value Effect
LMN 0.0 % Valve fully closed (4 mA)
LMN 50.0 % Valve half open (12 mA)
LMN 100.0 % Valve fully open (20 mA)
LMN_HLM 100.0 Anti-windup upper clamp
LMN_LLM 0.0 Anti-windup lower clamp

If the valve has a split-range (e.g., 4-12 mA heats, 12-20 mA cools), use LMN_FAC = 2.0 and LMN_OFF = -100.0 to map 0–100 % controller output to −100 % to +100 % valve signal, then write the scaled value to two analog output channels (or use FB43 PULSEGEN with a single bipolar output).

13. Cascade, Tracking, and Feed-Forward

FB41 is a single-input controller but can be cascaded to build multi-loop control. Cascade is typically implemented by wiring the primary controller's LMN into the secondary controller's SP_INT:

Primary FB41 (SP_INT = ext) Secondary FB41 SP_INT = LMN primary Final Element (valve) PV primary PV secondary

The primary controller's LMN becomes the secondary controller's SP_INT. The secondary controller must be tuned 3–5× faster than the primary for cascade stability. In a temperature/flow cascade, the primary is slow (TI in minutes) and the secondary is fast (TI in seconds).

For feed-forward, connect a measured disturbance to the DISV input of the primary. The block adds DISV directly to the integral contribution, allowing the controller to compensate for known disturbances without waiting for the PV to deviate. A typical example is a heat-exchanger outlet temperature controller receiving a feed-forward of the inlet flow rate; the larger the flow, the more steam is needed at the same outlet temperature.

14. Common Commissioning Errors and How to Avoid Them

Common FB41 commissioning pitfalls
Symptom Likely cause Fix
Output stuck at 0 or 100 % PV_FAC / PV_OFF wrong, or PV_IN out of range, or sign error Trend PV, SP_INT, ER; correct scaling; verify analog input scaling
Output jumps on AUTO↔MAN MAN value not equal to current LMN before the switch Drive MAN := LMN while in AUTO; or use I_ITL at the switch
Output ramps forever when the loop saturates Integral windup; LMN_HLM / LMN_LLM not configured for the actuator Set LMN_HLM / LMN_LLM to the real actuator limits; verify by checking QLMN_HLM and LMN_I
Output jittery / noisy TD too large or TM_LAG too small; PV not filtered Increase TM_LAG to 1–5 s; reduce TD; add a low-pass on the analog input
Offset persists with integral enabled TI = 0.0 (integral disabled), or PV / SP signals swapped Verify TI > 0; trend SP and PV in the same engineering units; check sign
Loop oscillates GAIN too high, TI too small, TS too small, unmodelled delay Reduce GAIN; raise TI; raise TS; enable D-action with caution
Slow approach to setpoint with no overshoot GAIN too low or TI too large Increase GAIN; reduce TI; check that the actuator is not saturated
Controller drives to 0 % on startup I-term initialised to 0; loop is heating, PV below SP Use I_ITL with I_ITLVAL = expected steady-state output to avoid the I-term having to wind up from zero

15. Verification Procedure After Configuration

  1. Open the FB41 instance DB online and confirm all input values match the intended tuning constants. Force the controller to manual (MAN_ON = TRUE), set MAN to 50 %, and verify the controlled variable (e.g., valve position) follows.
  2. Apply a small setpoint step (5–10 % of span) in automatic mode, with the loop in a stable operating point. Trend LMN_P, LMN_I, LMN_D, PV, and ER. Confirm the P-term jumps, the I-term ramps, and the D-term spikes on the rate of change.
  3. Verify the time scale. The I-term should ramp at the predicted slope Kp*E/TI (in LMN units per minute). For example, with GAIN = 2.0, TI = 1.0 min, and ER = 5 %, the I-ramp slope should be 10 % per minute.
  4. Check the steady-state offset. With a PI controller, the offset should decay to zero within 4–5 * TI minutes. If a permanent offset remains, the I-term is being held (INT_HOLD) or windup is still active.
  5. Perform a load step (disturbance) and confirm the controller recovers. The closed-loop time constant should be roughly Tcl ≈ TI * (Kp_loop / Kp_total); this is a coarse check, not a substitute for proper tuning.
  6. Switch MAN↔AUTO several times and confirm there is no step change in LMN. The transition is bumpless if and only if MAN = LMN at the moment of the switch.
  7. For D-action loops, double the TD and confirm the output reacts to PV ramps more strongly; reset to original value when finished.
  8. For feed-forward loops, drive the disturbance input and confirm LMN shifts immediately, before the PV has had time to deviate.

16. Open-Loop Step Test Procedure for Tuning

To tune a loop from scratch with model-based methods, perform an open-loop step test:

  1. Place the controller in manual (MAN_ON = TRUE) and bring the process to a stable operating point. Record the steady-state PV and LMN.
  2. Apply a step change in MAN of about 5–10 % (small enough to stay linear, large enough to be measurable above noise).
  3. Trend the PV. Identify the dead time θ (time from the step to the first detectable PV change) and the time constant τ (time from the start of the PV change to 63 % of the total PV change). Compute the process gain Kp = ΔPV / ΔMAN in PV units per % LMN.
  4. Use Cohen-Coon (good for processes with significant dead time) or Lambda tuning (good for setpoint tracking) to compute GAIN, TI, TD.
  5. Apply the new tuning in manual first (verify SP matches PV and the controller is ready), then switch to automatic and perform a small setpoint step to verify behaviour.
Cohen-Coon tuning formulas for a FOPDT model
Parameter Formula Unit
Kc (controller gain) (1/Kp) * (τ/θ) * (1 + θ/(3τ)) dimensionless
Ti (reset time) θ * (30 + 3θ/τ) / (9 + 20θ/τ) minutes
Td (derivative time) 4θ / (11 + 2θ/τ) minutes
Lambda tuning formulas for a FOPDT model
Parameter Formula Unit
Kc (controller gain) (τ) / (Kp * (λ + θ)) dimensionless
Ti (reset time) τ minutes
Td (derivative time) 0.0 (Lambda uses PI by default) minutes

Lambda parameter λ is the desired closed-loop time constant; a typical choice is λ = 3*θ for aggressive setpoint tracking or λ = 5*θ for smoother response.

17. Worked Tuning Example: Steam-Heated Heat Exchanger

A heat exchanger heats water from 30 °C to 70 °C. The PV is the outlet water temperature in °C (0–100 °C range). The control valve is steam. An open-loop step test with a 5 % step in MAN from 40 % to 45 % produced:

  • Process gain Kp = 0.8 °C per % LMN (i.e., 1 % more steam gives 0.8 °C higher outlet)
  • Time constant τ = 90 s = 1.5 min
  • Dead time θ = 15 s = 0.25 min

Cohen-Coon tuning:

Kc = (1/0.8) * (1.5/0.25) * (1 + 0.25/(3*1.5)) = 1.25 * 6 * 1.0556 = 7.92 Ti = 0.25 * (30 + 3*0.25/1.5) / (9 + 20*0.25/1.5) = 0.25 * 30.5 / 12.333 = 0.618 min Td = 4*0.25 / (11 + 2*0.25/1.5) = 1.0 / 11.333 = 0.088 min

FB41 settings to apply:

GAIN = 7.9 TI = 0.62 // minutes per repeat TD = 0.09 // minutes TM_LAG = 1.0 // seconds (filter for D-term) LMN_HLM = 100.0 ; LMN_LLM = 0.0

Call FB41 in OB35 with TS = 1000 ms. For a 5 °C setpoint step (e.g., SP from 65 °C to 70 °C), the predicted response is roughly 5% / 5 = first-order with a closed-loop time constant of about 0.4 min, reaching 63 % of the step in 24 s. Verify by trending the actual response and fine-tuning by inspection.

18. FB41 vs. CONT_S (FB42) vs. PID_Compact

Choosing the right PID block
Block Output type Use case Anti-windup Tuning interface
FB41 CONT_C Analog (REAL %) Continuous control of modulating actuators (control valves, variable-speed drives via analog ref) Yes (output clamping) Manual: GAIN, TI, TD, TM_LAG
FB42 CONT_S Digital pulse (QPOS_P / QNEG_P) Integrating actuators (motorised valves) Yes Same as FB41 plus pulse time / break time
FB43 PULSEGEN Digital pulse (PWM) Converts LMN from FB41 to PWM duty cycle on a digital output Inherits from FB41 PER_TM (pulse period)
PID_Compact (FB 1130, S7-1200/1500) Analog or PWM Modern TIA Portal replacement with auto-tuning Yes Gain, TI, TD, plus pre-tuning and fine-tuning
PID_3Step (S7-1200/1500) Digital pulse (QPOS_P / QNEG_P) Motorised valve replacement for FB42 Yes Gain, TI, TD with motor travel time

For S7-300/400 systems that already use FB41, there is no functional reason to migrate. For S7-1200/1500 systems, use PID_Compact (FB 1130) instead; FB41 can be imported into TIA Portal for S7-1200/1500 targets but its derivative gain filter constant is fixed and the sample-time model is calibrated for S7-300/400 cyclic OBs.

19. FB41 and TIA Portal Migration Notes

When migrating an S7-300/400 project containing FB41 to TIA Portal on the same S7-300/400 hardware, the FB41 instance is preserved with its tuning values intact. When migrating to S7-1500, Siemens recommends replacing FB41 with PID_Compact (FB 1130), which uses different pin names and a different default cycle (typically the PID cycle OB used by the new PID technology object). Key translation points:

FB41 to PID_Compact parameter mapping
FB41 (S7-300/400) PID_Compact (S7-1200/1500) Notes
GAIN Retain.CtrlParams.Gain Direct transfer
TI Retain.CtrlParams.Ti Both in seconds on PID_Compact by default; divide by 60 to convert minutes→seconds
TD Retain.CtrlParams.Td Same unit handling as TI
TM_LAG (no direct equivalent; use PV input filter) PID_Compact has a separate input filter configuration
LMN_HLM / LMN_LLM Config.OutputScaling.UpperLimitIn / LowerLimitIn Default 100 / 0 % in both
DEADB_W Config.InputScaling.Deadband Similar function

For new S7-1500 designs, prefer PID_Compact for its built-in pre-tuning and fine-tuning routines; the tuning constants from a working FB41 loop can be transferred as starting values.

20. FAQ

Does FB41 use repeats per minute or minutes per repeat for TI?

Siemens uses minutes per repeat. TI is the time in minutes for the integral contribution to equal the proportional contribution for a constant step error. To convert from a DCS value in repeats/minute, use TI_SIEMENS = 1 / rpm. For example, 0.5 repeats/min equals TI = 2.0 min, and 5 repeats/min equals TI = 0.2 min.

What does TM_LAG do, and how do I set it?

TM_LAG is the time constant of the first-order low-pass filter applied to the derivative action. It is set in seconds. A typical value is 1 to 5 seconds. Increase TM_LAG to suppress measurement noise in the D-term; decrease it for faster derivative response, at the cost of more noise. TM_LAG is only active when TD > 0.0.

How do I implement anti-windup on FB41?

Anti-windup is built in. Configure LMN_HLM and LMN_LLM to the actual actuator limits (e.g., 0 and 100 %). The block automatically clamps the I-term so that LMN = P + I + D stays within the clamps. You can also freeze the I-term with INT_HOLD = TRUE when the actuator is locked out by an interlock, or re-initialise it with I_ITL on a rising edge to I_ITLVAL at startup.

Can FB41 run on an S7-1200 or S7-1500?

FB41 was designed for S7-300/400 and works on S7-1200/1500 only via legacy project import. Siemens recommends PID_Compact (FB 1130) for new S7-1200/1500 applications, which provides automatic pre-tuning and fine-tuning and a more modern configuration interface.

My controller is oscillating. Which parameter should I adjust first?

Reduce GAIN by half and double TI. If the oscillation persists, raise the sample time TS (move the FB41 call to a slower OB, e.g., OB35 at 1 s from a faster OB). If the manipulated variable is jittery rather than smoothly oscillating, the derivative action is amplifying noise — increase TM_LAG or set TD = 0.0. For temperature loops with significant dead time, consider switching from Ziegler-Nichols to Lambda tuning for a smoother response.

What is the difference between FB41 CONT_C and FB42 CONT_S?

FB41 produces a continuous analog output (REAL, in % of valve range) suitable for modulating actuators. FB42 produces pulse outputs QPOS_P and QNEG_P suitable for motorised integrating actuators (valves that move when pulsed). The math is the same; FB42 includes motor travel time and minimum pulse/break times. For pulse-width modulation of a single digital output, use FB41 driving FB43 PULSEGEN.

How do I make the manual-to-auto transfer bumpless?

Drive the MAN input with the current LMN value while the controller is in automatic mode. The moment MAN_ON goes TRUE, LMN continues to track MAN exactly. When MAN_ON goes FALSE, the I-term is loaded with the current MAN value minus the P and D contributions, so the output is continuous.

Back to blog