LEARN · DISCRETE CONTROL
Level control with hysteresis
The simplest control: turning a pump on and off. Why it does not work with a single point, how hysteresis solves it and how it is written in ladder.
Turning on and off
The P-101 pump fills the TK-101 tank and the plant draws water through the FCV-102 valve. This time the pump has no drive: it can only be running or stopped. The PLC decides when, by watching the level measured by the LT-101 transmitter.
It is the control found in most water tanks, cisterns and wells: cheap, easy to understand and enough when an exact level is not needed.
Simplified simulator: 1 m² tank and 60 m³/h pump. The logic is evaluated every 100 ms, as in a PLC scan cycle.
The problem with a single point
The first idea is to use one setpoint: if the level is below 1.8 m, turn the pump on; if it is above 1.8 m, turn it off. It works on paper, but as soon as the pump starts the level passes the setpoint, the pump stops, the level drops a little and it starts again. With waves on the surface it is worse: the measured level crosses the setpoint several times per second.
Each start heats the motor and wears the contactor. Motors allow a limited number of starts per hour, and a contactor that opens and closes non-stop soon fails. This is called chattering.
Try it: choose “Without hysteresis” and turn on the waves. Watch the starts-per-hour counter and the blue strip in the trend.
Hysteresis: two points
The solution is to separate the point where the pump starts from the point where it stops:
- Start (low level): when the level drops to here, the pump turns on.
- Stop (high level): when the level rises to here, the pump turns off.
Between the two points the pump keeps doing what it was doing: if it was filling it keeps filling, and if it was stopped it stays stopped. That zone is called the hysteresis band or dead band. The waves no longer make it jump, because they are much smaller than the band.
Try it: go back to “With hysteresis”, with the waves on. The starts drop to a few per hour.
The width of the band
Choosing the two points is a compromise:
| Band | Starts | Level | When it is a good fit |
|---|---|---|---|
| Narrow | Many | Almost constant | When the process needs an even level and the pump can withstand the starts |
| Wide | Few | Moves up and down a lot | When protecting the pump matters and the level can vary, as in a drinking water tank |
In addition, both points must stay away from the tank's limits: the start above the minimum level that protects the pump from running dry, and the stop below the overflow.
Try it: bring the two points together until there are 10 cm between them and watch the starts climb. Then separate them to 1 m and watch the level variation grow.
In ladder: the latching
Hysteresis is written with a classic start-stop circuit, the same as for a motor with two pushbuttons:
- The LT-101 ≤ start comparator acts as the start button: it closes when the level is low.
- In parallel goes a contact of the P-101 coil itself, the latching contact. When the level rises and the start comparator opens, the coil stays on through its own contact.
- In series goes the NOT LT-101 ≥ stop comparator, which acts as the stop button: it opens when the level reaches the top and breaks the latching.
In the simulator, each contact turns green when it conducts. Watch the latching while the tank fills: it is the only thing that keeps the pump running between the two points.
Written as an equation: P-101 = (LT-101 ≤ start OR P-101) AND NOT (LT-101 ≥ stop).
Hysteresis or PID?
- Hysteresis: the pump only turns on and off, the level may vary within a band and something simple and robust is wanted.
- PID: there is a drive or a control valve that can take any position, and the level has to stay close to a value. We explain it in PID level control.
In a real PLC
- The comparators work with the measurement already scaled to meters, not with the raw value of the analog input.
- The pump needs its permissives: automatic mode, drive or motor protector ready, and no emergency stop.
- A very-high-level alarm is added with an independent switch (LSHH), which cuts the pump even if the transmitter fails.
- Many programs add a minimum time between starts as extra protection for the motor.
The TK-101 tank program with hysteresis, permissives and operator panel is in Tutorials, in ladder for S7-1500 and S7-1200.
A challenge
Leave the demand fixed at 80 %. Which start and stop points give you fewer than 10 starts per hour without the level dropping below 1 m? Then change the demand to 25 % and check whether your values still work.
Practice it with your own PLC
In Procesia the TK-101 tank has the same loop, connected to your real or simulated PLC. Use the full version free for 7 days, no card.