← All exercises

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.

Inputs and outputs

TagTypeDefaultDescription
In_LevelREAL50Current tank level
Cfg_SetpointREAL100Target fill level
Cfg_DeadbandREAL10Deadband below setpoint to start filling
Out_ValveBOOLFill valve command signal

Required behavior