LOGO! 8 Buffer Tank Pressure Control: Implementing Hysteresis

David Krause15 min read
HMI ProgrammingSiemensTutorial / How-to
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 Overview

A common application for a Siemens LOGO! 8 logic relay is maintaining a gas buffer tank between two pressure setpoints. The typical requirement is: open the fill valves when tank pressure drops to a low threshold (5 bar), close them when pressure reaches a high threshold (8 bar), and leave them closed until the next fill cycle is needed. The valves should also be forced open whenever the measured pressure falls below the lower threshold, regardless of recent history.

The naive implementation—a single threshold trigger switching on at 5 bar and off at 8 bar—produces severe output chattering when the pressure hovers near 8 bar. Because the tank is small and the off-take flow is low, the pressure oscillates between 7.9 bar and 8.1 bar, forcing the relay to switch on and off many times per minute. On-delay or off-delay blocks alone do not solve the problem, because they just delay the inevitable chatter and lengthen the time the relay spends near the threshold.

This article documents a robust, deterministic implementation using Analog Amplifier, Analog Threshold Trigger, and state-latching blocks in LOGO! Soft Comfort FBD, with the LOGO! TDE text display providing a white backlight during a fill cycle in the 5–8 bar band and an amber backlight when the tank is below 5 bar.

Prerequisites

  • Siemens LOGO! 8 base module (6ED1052-xxx08-0BA1 or later) with firmware ≥ V8.0. For the latest features (full TDE message text, M-flag persistence) use firmware V8.3 or later as documented in the LOGO! 8 System Manual.
  • LOGO! TDE (6ED1055-4MH08-0BA1) connected to the base module via the integrated Ethernet port or a LOGO! CSM unmanaged switch.
  • LOGO! Soft Comfort V8.4 or later for program authoring and simulation.
  • Two-wire or three-wire pressure transmitter with 0–10 V analog output corresponding to 0–10 bar (e.g. WIKA A-10, IFM PN7, or Endress+Hauser Cerabar PMC11). Output must be ratiometric or have its own 24 V supply, not loop-powered 4–20 mA unless an external 250 Ω resistor is fitted to convert the signal.
  • 24 VDC solenoid valves with power consumption below the LOGO! Q-output rating (typically 8 A resistive / 3 A inductive per output).
  • 0.5 mm² shielded twisted pair for analog signal run; shield grounded at the cabinet end only.
Important: The LOGO! 8 base module analog inputs AI1–AI4 accept 0–10 V directly. The older 0/4–20 mA scaling requires an external burden resistor (250 Ω for 4–20 mA → 1–5 V). Verify your transmitter output type before wiring; an incorrect termination will produce a constant zero or out-of-range reading in the analog amplifier.

Hardware Wiring and Signal Scaling

Connect the 0–10 V pressure transmitter output to AI1 of the LOGO! 8. The transmitter's 24 V supply must come from a clean, regulated source; do not power it from the same rail driving the solenoid coils, as inductive kickback will inject noise into the analog input and cause the threshold triggers to chatter regardless of hysteresis settings.

Wire the fill valves to Q1 (primary fill path) and Q2 (secondary or makeup path, optional). The 24 VDC common returns to the LOGO! M terminal. Place a 1N4007 flyback diode (or a TVS diode rated above coil voltage) directly across each solenoid coil, cathode to +24 V.

Table 1 — Signal scaling for a 0–10 V / 0–10 bar pressure transmitter
Pressure (bar) Sensor output (V) AI1 raw value (0–1000) Engineering bar (after amplifier)
0.0 0.00 0 0.0
5.0 5.00 500 5.0
8.0 8.00 800 8.0
10.0 10.00 1000 10.0

Place an Analog Amplifier (B001) directly after AI1. Configure:

  • Sensor type: 0–10 V
  • Gain: 1.00
  • Offset: 0
  • Output range: 0 to 1000 (mapped to 0.0–10.0 bar in the message text)

Using the analog amplifier once, immediately after the sensor, centralises the scaling. If the transmitter is later replaced with a different range (for example 0–16 bar or 4–20 mA), only one block needs adjustment, not every downstream threshold trigger. This is the key engineering advantage of the analog amplifier approach over configuring the scaling inside each threshold trigger.

Why the Naive Implementation Chatters

The classic mistake is to use a single threshold trigger with On = 5 bar and Off = 8 bar directly driving the valve output. With a small buffer tank and low draw, the pressure crosses 8.0 bar, the relay opens, the off-take flow drops the pressure to 7.9 bar, the relay closes, pressure climbs back to 8.0 bar, the relay opens, and so on. Adding a 5-second on-delay and a 5-second off-delay only widens the deadband; the relay still toggles, and any hysteresis smaller than the natural pressure swing is useless.

Three engineering rules apply to all on/off control of continuous processes:

  1. Hysteresis must exceed the expected measurement noise plus the expected change during the relay's response time. With a 0–10 V sensor, the LSB is 10 mV ≈ 10 mbar. Cable noise and ADC quantisation add another 10–30 mbar. Use a hysteresis of at least 200 mbar (0.2 bar) for gas systems with slow-moving pressure.
  2. Once the high threshold is reached, the output must latch off until the low threshold is crossed again. This is a stateful problem, not a comparator problem.
  3. Use a force-on condition that overrides the latch for the case where the tank is genuinely empty (e.g. after a long shutdown) and the low threshold has not yet been reached, but the pressure is clearly below the safe operating minimum.

Step-by-Step: Hysteresis with State Latching

The following FBD program is the field-verified solution. The block numbers correspond to a clean implementation; renumber as needed when integrating into an existing program.

Step 1 — Analog input and amplifier

  • AI1 (block I1) → Analog Amplifier B001 with gain 1.0, output 0–1000.
  • The B001 output value represents the tank pressure in units of 0.01 bar (1000 ≡ 10.00 bar). This is the canonical value used by every downstream block.

Step 2 — Two analog threshold triggers

Use two Analog Threshold Trigger blocks with hysteresis configured. Each trigger has separate On and Off thresholds.

Table 2 — Threshold trigger parameters
Block Function On threshold Off threshold Hysteresis Output
B002 Low-pressure trigger ≥ 4.5 bar (450) < 4.4 bar (440) 0.1 bar downward High when pressure below 4.5 bar
B003 High-pressure trigger ≥ 8.0 bar (800) < 7.9 bar (790) 0.1 bar downward High when pressure above 8.0 bar
B004 Mid-band trigger (5–8 bar) ≥ 5.0 bar (500) < 5.0 bar (499) 0.01 bar High when pressure ≥ 5.0 bar

B002 — Low-pressure / force-fill trigger. This block is dedicated to detecting the "tank is dangerously low" condition. It trips at 4.5 bar and resets at 4.4 bar, providing a 0.1 bar hysteresis that filters sensor noise. Its output is ORed with the latch output to force the fill valves open whenever the pressure is genuinely low, regardless of the latch state.

B003 — High-pressure trip. This block trips at 8.0 bar and resets at 7.9 bar. Its output is fed to the reset input of the fill-enable latch; the high-threshold trip is what causes the fill cycle to terminate.

B004 — Mid-band detector. This is a single-threshold block at 5.0 bar. It is used only for the TDE message text and backlight logic; it does not control the fill valve. Its purpose is to distinguish the "filling in normal range" display (5–8 bar, white backlight) from the "low pressure" display (below 5 bar, amber backlight).

Step 3 — Latching with an RS flip-flop

Use an RS flip-flop (B005) with:

  • S (set) input: the falling edge of B003 inverted — i.e. the moment pressure crosses below 8.0 bar while the tank has just been filled. In practice, set the latch when pressure has been above 5.0 bar for at least the previous fill. The cleanest implementation is to set the latch from the inverted output of B003 (set on falling edge of "high pressure" flag).
  • R (reset) input: B003 output (high when pressure ≥ 8.0 bar).

The latch output, call it M1, is high when the tank is "filled and waiting to be drawn down." M1 is low when the tank is being filled.

The fill-valve output Q1 is then computed as:

Q1 = (NOT M1) OR B002

That is: open the fill valve when the latch is not set, OR when the force-fill low-pressure trigger is active. The latch prevents the valve from reopening as soon as pressure dips back below 8.0 bar; only when the pressure actually falls to 5.0 bar (and the latch is reset by a separate path) will the cycle repeat. To reset the latch on the low side, add a second RS flip-flop (B006) or an AND/OR combination that resets M1 when B003 has been low for a sustained period — typically 30 seconds — implemented with an off-delay block (B007, parameter 30 s).

Note on the off-delay: The 30 s off-delay is the minimum time the pressure must stay below 8.0 bar before the system re-arms for the next fill. This is what eliminates the 7.9 ↔ 8.0 bar chatter. With a 30 s hold, the relay will not reopen for at least 30 seconds after closing; if the tank is still above 5.0 bar after 30 s, the latch stays set and no further switching occurs until pressure drops to 5.0 bar.

Step 4 — Output assignment

  • Q1 = (NOT M1) OR B002 — fill valve primary coil
  • Q2 = M1 — optional "tank full" indicator lamp or secondary valve

Step 5 — TDE message texts and backlight

The LOGO! TDE supports up to four message text windows with independent backlight colour settings (white, amber, red, green). The relevant entries are:

Table 3 — TDE message text configuration
Slot Trigger condition Text content Backlight
1 Q1 (fill active) AND B004 (pressure ≥ 5.0 bar) "BUFFER FILLING Pressure: XXX.X bar Range: 5.0 – 8.0 bar" White
2 B002 (pressure < 4.5 bar) AND NOT Q1 "BUFFER LOW Pressure: XXX.X bar Fill forced ON" Amber
3 NOT Q1 AND NOT B002 (tank full and stable) "BUFFER READY Pressure: XXX.X bar" White (steady)
4 B003 (pressure ≥ 8.0 bar) — momentary "HIGH PRESSURE TRIP FILL VALVE CLOSED" Red (acknowledge)

Enable Bar Graph in the message text properties to show a 0–10 bar fill level on the TDE; use the analog amplifier output as the bar-graph source.

The two key insight from the field report is that the "white during filling 5–8 bar" message must be ANDed with Q1 (the actual fill command), otherwise the white backlight will activate the moment pressure drops below 8.0 bar, even if the latch is keeping the valve closed. This is a common trap: a pressure-range indicator without an active command indicator is misleading.

LOGO! Soft Comfort Implementation Notes

When working in LOGO! Soft Comfort V8.4 or later, the program can be authored in FBD (function block diagram), which is the most readable representation for an analog-pressure application. Use the following block-palette groups:

  • Special functions → Analog → Analog Amplifier
  • Special functions → Analog → Analog Threshold Trigger
  • Special functions → Timers → Off-delay
  • Basic functions → Flip-flop → RS (reset-dominant)
  • Basic functions → Boolean → AND, OR, NOT
  • Output → Q1, Q2

Place comments on every block in the FBD editor (right-click → Properties → Comment). This dramatically reduces commissioning time and is required by most plant documentation standards (e.g. ISA-88 / ISA-95 naming).

M-flag discipline

Use M1 through M8 for all internal state. M1 = "tank filled, awaiting drawdown," M2 = "low-pressure force-fill armed," M3 = "high-pressure trip latched." M-flags retain their state across power cycles only if the LOGO! has a battery or supercap backup; for retentive behaviour, configure the latch as a retentive RS flip-flop using the coil field in Soft Comfort.

Verification and Commissioning

Commission the system in this order:

  1. Sensor checkout: With the fill valve closed and the tank at atmospheric pressure, read AI1 in LOGO! Soft Comfort → Online → Tag Table. The value should be 0 ± 5. Apply a known regulated pressure (e.g. 5.00 bar from a deadweight tester) and verify the analog amplifier output reads 500 ± 2. If it does not, recalibrate the transmitter or adjust the amplifier gain.
  2. Threshold verification: Use the Soft Comfort simulation to step the AI1 value from 0 to 1000 in 10-unit increments. Confirm:
    • B002 (low trigger) trips at 450, resets at 440.
    • B003 (high trigger) trips at 800, resets at 790.
    • B004 (5.0 bar mid) trips at 500, resets at 499.
  3. State machine verification: From 0 bar, ramp up to 9 bar over 60 s. Q1 should energise at the start, stay energised continuously through 5.0 bar and 8.0 bar, and de-energise when B003 trips at 8.0 bar. Q1 must not re-energise for at least 30 s after that. Then drop pressure to 4.0 bar over 30 s. Q1 should re-energise via the B002 force-fill path (not via the latch), proving the force-fill path is active.
  4. TDE verification: In simulation, you may observe a brief "green screen" flash during the transition from amber to white backlight. This is a known simulation-only artefact caused by the Soft Comfort renderer initialising the TDE state; it does not occur on physical hardware. Confirm by uploading the program to the real LOGO! 8 and exercising the same sequence.
  5. Hardware verification: With the transmitter removed and a 0–10 V calibrator connected, repeat step 3 on the physical LOGO! 8. Verify Q1 LED on the LOGO! front panel, Q1 voltage at the terminal strip, and the TDE display. Sign off the I/O checkout sheet before energising the gas system.

Common Pitfalls

Table 4 — Common implementation mistakes and their fixes
Symptom Root cause Fix
Relay toggles 5–10 times per minute at 8.0 bar Single threshold trigger with on/off at 5/8 bar, no latch Add RS flip-flop + off-delay for re-arm
White backlight on TDE even when valves are closed Message text trigger uses only pressure range, not Q1 AND the white-backlight message with Q1
Pressure dips to 4.0 bar and valves stay closed Force-fill path missing or wired to AND of latch output OR B002 with latch output, never AND it
Green TDE flash during amber-to-white transition Simulation-only Soft Comfort bug No fix needed; test on physical hardware
Chatter returns after 24 h of operation Sensor supply noise from coil kickback Add flyback diodes on coils, separate 24 V rail for transmitter
Latch state lost on power cycle Non-retentive RS flip-flop Enable retentive flag in block properties
Threshold triggers fire at wrong values after transmitter replacement Scaling configured in each threshold trigger Use a single analog amplifier; reference its output

Advanced: Adding a Second Safety Threshold

For critical processes, add a second safety threshold at 3.0 bar (B008) that triggers a hard-wired alarm and an SMS / e-mail via the LOGO! CMR2020 or CMR2040 4G communications module. This threshold is independent of the fill-control logic and must be implemented in a way that a single block failure cannot mask the alarm (use a normally-energised alarm relay, fail-safe wiring).

Capacity and Sizing Reference

While this article focuses on control logic, the buffer tank itself must be sized to bridge the worst-case off-take flow and the fill-valve flow rate. A common rule of thumb for gas buffer tanks is:

V_tank = (Q_offtake × t_bridge) / (P_max – P_min) / k

where Q_offtake is the peak off-take in standard litres per minute, t_bridge is the desired hold time (e.g. 10 minutes), P_max – P_min is the usable pressure band (3 bar in this application), and k is a compressibility factor (≈ 1 for ideal gases below 10 bar). The actual standard for high-pressure gas storage is ASME BPVC Section VIII for vessels above 15 psig (≈ 1 bar), and EN 13445 for European installations. Consult these standards for design pressure, material selection, and PED category classification — the figures in this article are control-system parameters, not pressure-vessel design values.

Field-Proven Variations

  • Two-stage fill: For large tanks, use Q1 for the primary fill path (fast) and Q2 as a topping valve that engages at 7.0 bar. Reduces heat-of-compression issues in CO₂-rich mixtures.
  • Predictive fill: Use a flow-integrator (AI2 from a mass flow meter) to anticipate when 5 bar will be reached, and pre-emptively start the fill cycle. This is beyond LOGO! 8's arithmetic capabilities and would require a SIMATIC S7-1200 or LOGO! 8 with the custom function block library.
  • Mixture-ratio control: When the buffer tank is a mixed gas (N₂/CO₂ as in the source), the two mass flow controllers upstream of the tank must maintain a constant ratio regardless of fill state. Use independent PID loops on each MFC, with the buffer-tank fill logic as a separate permissive.

How do I stop the LOGO! 8 relay from chattering at 8 bar?

Use an RS flip-flop to latch the fill-valve output off when the 8.0 bar high threshold trips, and add a 30-second off-delay before re-arming. The off-delay prevents the relay from reopening as the pressure oscillates 7.9 ↔ 8.0 bar. Drive Q1 = (NOT latch) OR (low-pressure force-fill trigger).

What is the correct hysteresis for a 0–10 V pressure sensor on LOGO! 8?

Use at least 100 mbar (10 units on the 0–1000 amplifier output scale) of hysteresis per Analog Threshold Trigger. The LSB of a 0–10 V input on LOGO! 8 is approximately 10 mV ≈ 10 mbar, so 100 mbar gives 10× the quantisation noise as a guard band. For noisy industrial environments, use 200 mbar.

Should I scale the 0–10 V input inside each threshold trigger or use a single Analog Amplifier?

Use a single Analog Amplifier immediately after the analog input, and reference its output from every downstream block. This way, when the transmitter is replaced or re-calibrated, only one block needs to be changed, not every threshold trigger. The amplifier gain should be 1.0 for a 0–10 V / 0–10 bar transmitter.

Why does the TDE show a green backlight briefly during the amber-to-white transition in simulation?

This is a known artefact of the LOGO! Soft Comfort simulator's TDE renderer. It does not occur on the physical LOGO! TDE hardware. The brief green flash happens because the simulator initialises the backlight colour before applying the priority logic. Test the backlight behaviour on the actual LOGO! 8 + TDE hardware before concluding the program is wrong.

Can I retain the latch state across a power cycle on LOGO! 8?

Yes. Open the RS flip-flop block properties in LOGO! Soft Comfort and enable the Retentive flag for the output. The latch will then be backed up by the LOGO!'s internal supercap (typically several days) or the optional LOGO! Battery module (6ED1057-1NB00-0BA0) which provides years of retention.

Back to blog