Late, Lost and Wrong Laboratory Samples

Loss-in-weight feeders dosing additives into a polymer extruder, with laboratory samples taken from the product

Open the Weigh Feeder Additive Control app

Advanced Control Exercise 8 of 30 in Estimation · All exercises · Time: 15 minutes

Plants measure their most important quality only in the laboratory, a few times a shift and long after the sample was taken. An estimator that uses those results has to put each one at the time it describes, survive a lost sample, and refuse a botched one without being deaf to a real change. This exercise watches a polymer additive line do all three across a grade change.

Learning Outcomes

  • Place a delayed measurement at the time it was collected, not the time it arrived.
  • Explain how a dead band and an outlier test decide whether a laboratory result moves the estimate.
  • Compare a squared-error objective with a robust one for an estimator that sees an occasional wrong value.

Book Chapter

Control in Petrochemicals and Polymers (Volume 12), Chapter 12, Loss-in-Weight Additive Feeders and the Holdup Their Scales Cannot Weigh. Read the chapter, open the PDF, or watch the lecture slides.

Theory in Brief

A sample collected over `[t_s, t_e]` and reported at `t_r > t_e` is compared with the model's prediction for the collection interval, not with the present state:

$$r_j = y_j - \frac{1}{t_e - t_s} \int_{t_s}^{t_e} \hat y(t)\, dt$$

The app's laboratory trim `\delta` is a bias update on that residual, with a filter gain `\lambda`, applied only when the result lies outside a dead band of 1.5 assay standard deviations, and held as a possible outlier when it departs by more than 25 % until the next sample confirms it. A moving horizon estimator treats the same problem by writing each residual at its own time inside the window and by choosing a loss that grows slowly for large errors. The Huber loss, used by this app's feeder MHE, is quadratic near zero and linear beyond a threshold `c`:

$$\rho_H(r) = \begin{cases} \tfrac{1}{2} r^2 & |r| \le c \\ c\,|r| - \tfrac{1}{2} c^2 & |r| > c \end{cases}$$

A squared error lets one wrong result pull the estimate as far as it likes; a robust loss caps its pull. The horizon must be longer than the reporting delay, or a result arrives after its interval has left the window.

Model: Physics-based. Mass balances of each feeder, the blender and the extruder, with the product's composition delayed by its transport through the line.
Decision: Whether a laboratory result moves the trim, and how far; the ratio controllers then correct the feeders.
Learning: Online estimation from sparse, delayed and occasionally wrong data, the same problem a soft sensor trained on laboratory values faces.

Exercise

Read 2 min · Predict 1 min · Run 7 min · Explain 3 min · Check your AI 2 min.

Predict. The first sample is collected at 0.9 h, just before the grade changes from PP-A to the clarified PP-B at 1 h, and reported 45 minutes later. What clarifier level will it show, and against which grade's target should it be judged? What should the estimator do with a result that is 40 % above its prediction?

Run the Weigh Feeder Additive Control app. Use the fastest speed, 600×, and press Run again to pause at the times in each step.

  1. Open 9 · Late, lost and wrong laboratory results on the Quality view. Press Run and pause at 6 h. Watch the sample queue: an open circle at collection, filled at report.
  2. Read sample 1's collection time, report time, grade and status. Then read samples 2 and 3: their status says whether the trim used them.

Explain.

  1. Why must sample 1 be judged against PP-A even though it arrives during PP-B?
  2. Sample 3 reads far above its prediction. Why is refusing it right here, and what would make refusing it wrong?

Generative AI Learning

"My laboratory analyzer reports two hours late and is sometimes wrong. How should a state estimator use these results? Should I compare each result with the current model prediction?"

Check the answer against your run: A good answer says to compare each result with the prediction for its own collection time, to use a robust loss or an outlier test, and to keep the estimation window longer than the delay. Your sample 1 result tests the first claim. The assistant is your tutor and reviewer; you answer for every claim you turn in.

What to Turn In

A table with each sample's collection time, report time, grade, measured clarifier and status, your written prediction, and three sentences that answer the two questions.

Sample 1 was collected from 0.90 h to 0.98 h and reported at 1.73 h, after the change to PP-B, but it belongs to the PP-A lot. It shows 104 ppm of clarifier against a prediction of 89 ppm for its own collection interval: the feeders started the clarifier a few minutes before the change, so the model predicts some. Judged against PP-B's target of thousands of ppm it would look absurd, and a naive estimator would trim the clarifier feed hard in the wrong direction. Its status is accepted.

Sample 2 is missed and contributes nothing. Sample 3 reads 1,392 ppm of AO-2 against 1,000 predicted and 2,810 ppm of clarifier against 2,000, every active high by about 30 to 40 %. Its status is rejected · outlier, and the trim ignores it. Every active high at once with nothing else in the plant changed points to the analysis, not the feeders. Refusing it would be wrong if the next sample confirmed it on the same side, or if a feeder's own diagnostics showed a change; the app's rule accepts the result then. A squared-error estimator with no outlier test would have let it pull the trim. The predictions quoted here come from the scripted replay.

Measured with the app build of December 3, 2026 by a scripted replay of the steps above. Numbers that no tile shows come from the replay's record; your readings from the trends will be close. A later app release may move the last digit.

Estimator Objectives compares the squared-error and absolute-error objectives in GEKKO. Build a one-state estimator for a slowly drifting concentration, add one measurement 40 % high, and compare the estimate under `EV_TYPE=2` (squared error) and `EV_TYPE=1` (absolute error with a dead band). Then delay every measurement by four samples and see what the horizon length must be.

Related

References

  1. Hedengren, J. D. (ed.), Control in Petrochemicals and Polymers, Volume 12 of Interactive Control Engineering, Chapter 12, "Loss-in-Weight Additive Feeders and the Holdup Their Scales Cannot Weigh", pp. 282–304, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
  2. Huber, P. J., Robust estimation of a location parameter, Annals of Mathematical Statistics 35(1), 73–101, 1964.

Course Information

TCLab

Project

Applications

Advanced Control Exercises

Exams

Modeling

Machine Learning

Estimation

Control

Reinforcement Learning

Related Courses

Admin