· 5 min read
Lab results arrive every 90 minutes. A soft sensor estimates the same quality every 15, from readings the plant already logs.
Picture the overhead of a debutanizer, C-101. Product purity has to stay above 98.5 mol %. The lab takes a sample, runs it and reports back, and the next result arrives about 90 minutes later. In between, the operators steer the column on temperatures, pressures and flows, and on experience.
Most of the time that works. Then a feed composition upset arrives between two samples. Purity drifts down, crosses the spec limit, and recovers before the next lab result comes back. On paper the shift looks clean. In the product tank it was not.
A soft sensor exists to fill that gap.
A soft sensor, sometimes called an inferential or virtual analyzer, is a model that estimates a quality you measure rarely from variables you measure all the time. For the debutanizer, the slow measurement is overhead purity from the lab. The fast measurements are the top tray temperature (TI-104), the column pressure (PI-102) and the reflux flow (FIC-110), all logged by the plant historian every few seconds. The model learns how the fast readings relate to the slow one, then predicts purity every 15 minutes, or every minute if you like.
At a fixed pressure, the temperature on a tray near the top tracks the composition of the liquid on it. Heavier components raise the boiling point, so a warmer top tray usually means a less pure overhead. Pressure shifts that relationship, which is why the model needs PI-102 as well as TI-104. Reflux tells the model how hard the column is working to hold the separation.
All of this is familiar to a chemical engineer. Machine learning turns the relationships you already reason about into a number on a screen, updated continuously.
In Python the core of the model is short:
from sklearn.ensemble import GradientBoostingRegressor
X = df[["TI-104", "PI-102", "FIC-110"]]
y = df["purity_lab"]
model = GradientBoostingRegressor().fit(X_train, y_train)
predicted = model.predict(X_now) # mol %
The engineering is everything around those lines: choosing the inputs, aligning the samples and deciding when the prediction can be trusted.
A soft sensor is a model of the plant as it was when the data was collected. Catalysts age, exchangers foul and operating targets move. Two habits keep it useful:
The value is rarely the model itself. It is the hour of off-spec product you now see as it happens, the giveaway you can trim because you trust the estimate, and the lab samples you can spend on the questions that matter.
Course 1 builds a purity model like this one on distillation column data, from first Python to a validated model.