Tank Fill
medium
Bang-bang controller for a tank fill valve with configurable deadband.
What it teaches
Latched bang-bang control: valve opens when level < setpoint - deadband, closes when level >= setpoint. The output is a latch driven by two thresholds. Teaches the canonical fill-controller pattern that every tank, hopper, and bin uses.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Level | Input | REAL | 50 | Current tank level |
| Cfg_Setpoint | Input | REAL | 100 | Target fill level |
| Cfg_Deadband | Input | REAL | 10 | Deadband below setpoint to start filling |
| Out_Valve | Output | BOOL | 0 | Fill valve command signal |
Required behavior
- Cfg_Deadband must be 0 or greater.
- Out_Valve turns on when In_Level drops below Cfg_Setpoint minus Cfg_Deadband.
- Out_Valve turns off when In_Level rises to or above Cfg_Setpoint.
- Out_Valve maintains its current state when In_Level is between the start-fill threshold and the setpoint.