Blog

When not to use AI

It is an odd subject for someone who builds models for a living. But the most useful thing I did on one job was to talk a plant out of buying one.

Date
Outcome
Throughput
Filed under
Engineering notes

The oscillation that wanted a mechanic

The complaint was a column that would not settle. Its temperature swung up and down on a cycle of about twenty minutes, day and night, and the product purity swung with it. The site had put up with it for a year. Somebody had read an article, and the request that reached me was for a machine learning model to predict the swings and get ahead of them.

It could have been built. There was plenty of data and the pattern was regular. I am fairly sure the model would have predicted the swings very well indeed.

But a swing that regular is not a mystery to be learned. It is a symptom. So before anything else we looked at the reflux valve, plotting where the controller asked it to be against the flow that actually resulted. The plot was a neat parallelogram. Anybody who has tuned loops will know what that means: the valve was sticking. The controller would ask for a little more, nothing would move, it would ask harder, the valve would jump too far, and round it went.

An instrument technician repacked the valve and reset the positioner on a Thursday. The column settled that afternoon. Nobody needed a model to predict an oscillation that had stopped happening.

I tell the story because the pull in the other direction is strong. A model is new, and a repacked valve is not. A model gets a slide in the quarterly review. But the plant did not want a slide, it wanted a steady column.

Questions to ask before the first line of code

Since then I run through a short set of questions before agreeing that a problem is one for AI. They are not profound. They are the questions a sensible uncle would ask.

Is something simply broken? Sticking valves, badly tuned loops, a failed instrument, a bypass left open. A surprising share of what looks like complicated behavior is ordinary equipment in poor repair. Fix that first. If you do not, the model learns the faults along with the process, and you have automated your maintenance backlog.

Is the answer already known? Some relationships were settled a century ago. If a mass balance, a pump curve or a vapor pressure equation gives the number, use it. A model trained to rediscover the gas laws from plant data will rediscover them slightly wrong.

Would a rule do? "If the level is above this and the pump is off, raise an alarm" needs no training and explains itself. A good many monitoring jobs are three rules and a timer. I have nothing against three rules and a timer.

Can anybody act on the answer? This one is skipped more often than any other. A model that says, correctly, that quality will be poor in four hours is worth something only if there is a handle to pull: a setpoint, a blend, a schedule. If there is none, you have bought an accurate way of feeling worse sooner.

Is the data there, and will it stay there? A model needs the thing it predicts to have been measured, many times, under conditions like the ones it will meet. If the event has happened twice in ten years, there is nothing to learn from. That is a job for engineering judgment and a careful hazard study, and nobody should be embarrassed to say so.

And who will look after it? A model is not a thing you install and walk away from, like a length of pipe. If the site has nobody to watch it and nobody who would notice it going stale, a simpler tool that needs no watching may serve better for longer.

When a problem gets through all of those, it is usually a good one. Many variables acting together, no equation that covers them, a result that is measured, a decision that can be changed. That is where a model earns its keep, and where the gains in getting more through a unit that is already running well tend to be found. Running well being the operative words.

I do not think any of this is modesty about what the methods can do. A carpenter who owns a very fine plane still does not use it to drive screws.