Do-it-yourself model-based control

When regulatory control can’t do the job, and you can’t find an off-the-shelf APC package, your only option may be to build your own. It’s not easy, but it can be done and good ones can make a world of difference.

By Peter Welander March 13, 2013

There can be situations where conventional regulatory control might not run a process optimally and your company management might want to try some variation of advanced process control (APC). While there are various sub-groups under this umbrella, one common approach is model predictive control (MPC), also more generically known as model-based control. This method uses a mathematical model of a process connecting relationships of relevant parameters.

Building such a model begins with an understanding of what is actually happening to the feedstocks as they are turned into final products. This includes chemical reactions, energy balance, reaction times, and so on. For some processes, it is possible to purchase existing process models that can be added to your control system. The more common the process, the greater likelihood that you will be able to buy one off the shelf. For example, there are many plants that make ethanol from corn and there are basic similarities from one location to another, so there are multiple model platforms available.

However, if your need is more specialized, a pre-packaged solution may simply not be available. In those situations, one option is creating your own process model to drive your DCS. This kind of project is not for the faint of heart, but at the same time it is not impossible. Those who have participated in such projects suggest that the most critical factor for success is deep knowledge of the process and experience with the individual plant.

Deciding strategy

Most models applied to a working plant use actual historical data combined with basic stoichiometric relationships. “There are two different mindsets,” says Chad Harper, CAP, PMP, director of technology for Maverick Technologies. “For one, you can use a recipe scenario where the process may be so deterministic that some first principles approach can be pulled together and get you where you want to be. The other one applies inferred properties using first principles to look at key variables in the plant and go through a regression process utilizing the plant data. You’re looking for the actual plant dynamic models to be able to put in there. We’ve done both.”

In either case, Harper warns that the model has to be adapted to the specific plant in question since every process unit has its own operating peculiarities. He adds, “Even if you can model something in a steady state environment you can rarely say, ‘Here are the numbers that I want to be at. Go!’ Process dynamics, closed-loop control behavior, and bumpless activation all have to be accounted for.”

The approach may be based on the information and resources available in a given situation, effectively using what you have to work with. Ric Snyder, senior product manager, information software and process business at Rockwell Automation, suggests, “Some people like to build empirical models because they have lots of data. Others like to do equation-based models because they have some chemical engineering knowledge or first principles models available. For building the models themselves, there are lots of dynamic identification toolkits that people can use, so once you’ve identified a specific tool and you have the data, building the model or regressing the parameters out of the data is not particularly difficult, it’s more the judgment of knowing what inputs I need and what are the outputs that I think I can predict. This is where some degree of chemical engineering knowledge and background is crucial in order to get good models. It’s more about defining what the model structure should be and what things should relate to that.”

Simulation first?

One way to create a model is to do it first using a process simulator as a means to test your assumptions. When the simulator is working, you can see how closely it follows actual plant operation and vice versa.

“In process plants, you don’t have the luxury of trial and error,” says Tony Lennon, industry marketing manager for industrial automation at MathWorks. “A plant manager’s real job is to make sure product is being shipped out the door while dealing with safety considerations, damage to equipment, downtime, and so on. Simulation is a means of making good design and implementation decisions, so when you do go to the plant manager, you can show what you’ve done with the simulation, reproduce the error, and say, ‘We need to try this,’ and then explain why you think it’s going to work.”

Lennon warns that simulations can’t be created in a vacuum but must reflect the reality of a specific plant environment. “If you’re going to use a simulation tool, you have to model what is happening in your plant today,” he adds. “If you haven’t done that, then don’t even continue because you haven’t captured the real dynamics of your plant. The most effective way to do that is to combine real process data in some sort of system identification process along with some type of first principles model.”

Dealing with problems

Every process unit has its quirks. Even if all the equipment is functioning correctly, there are still upsets, non-linear elements, and bottlenecks that challenge operators. An effective model should be able to ride through those by including some feedback element to account for un-modeled disturbances.

“I’ve done several implementations of an octane control on a catalytic reformer in a refinery,” Harper says. “There’s an analyzer, but it’s about 45 minutes down the train, so it’s calculating the octane coming out of a reformer based on all sorts of variables, including the feed rates, quality of the feed stocks, and several other things. A model-based controller has been successful in a refinery that might be doing all manner of crude stocks, sweet, sour, and it still rides through those. But it’s a pretty complex model because it covers all the different scenarios and everything’s been regressed through the model itself. It took some time to set up correctly and a good bit of work, but if you can do it, you’ve created an exceptionally valuable controller. It’s probably one of the best returns on investment a plant can make.”

A simulation can serve as a diagnostic tool, showing where theoretical and actual plant performance characteristics diverge. Lennon says the idealized world can point to flaws in the real one: “If a plant is designed properly to produce a certain capacity per day, bottlenecks will be in the physical system. You have 8-in. pipelines and you can only flow so much through the control valves and heat exchangers. So say you’re in a plant start-up, and you expect a certain output per day, and you aren’t achieving that when you reach steady state. Every time you try to ramp up, you start to get dynamic instability in the system. You can use the process model to investigate how you’re actually controlling the system. In that case, if you’ve done the physical sizing of the plant properly, I would believe that you’ve done something wrong in the control system. Maybe some of your control elements or field instruments are not behaving properly. That’s where you would compare data from the real plant to what the simulation said it should be. If everything is sized properly for that level of output, you need to go back to the control system to see why you’re not able to reach your desired output.”

Only as good as your people

While there is no argument that model-based controllers can operate very successfully, if you’re going to create your own, they will only be as good as the individuals you have doing the work. Like many improvements you might try, if your engineers don’t understand what’s happening, you can’t count on a positive outcome no matter how sophisticated your tools are. “Coming up with a simulation model does take a degree of experience with the actual process,” Lennon explains. “We can’t replace experience. We can give great tools that allow somebody with experience to say, ‘We understand that once this tank is full, you can’t put any more in it.’ You can’t trade experience for a software package.”

Snyder agrees: “There’s no substitute for good practical knowledge and experience. Nobody becomes an MPC guru overnight or even within a year or two. There’s still a lot of art, even though there is lots of mathematics and lots of science in there. A lot of things you learn by doing.”

Hot water heater as process example

Here’s a simple demonstration: consider a gas-fired, 50-gal hot water heater, as you might have in your home. Most designs are simple and have a thermostat that turns the fixed burner on and off in response to the water temperature at the outlet. A more sophisticated design might use a PID controller that can modulate the burner in response to the outlet temperature as the key process variable. This approach might not be effective ultimately if you need critical control of the outlet temperature. With the large volume in the tank, the process could be sluggish since it might take a long time to change the temperature of that much water. For example, say the inlet temperature goes down 20 °F. By the time the sensor at the outlet recognizes the change, the temperature in the tank may have fallen significantly.

One approach might be to create a model of the process. Here are a few of the main elements we need to quantify or measure continuously:

  • Outlet water temperature, which is our primary process variable
  • Inlet water temperature, which determines how much the temperature has to change
  • Flow rate, which determines the volume we have to heat
  • Burner output, which is a function of natural gas feed and our only control effort
  • Heat transfer ability of the tank, which is non-linear since there is a fixed surface area, and
  • Heat loss through the walls of the tank.

The process model quantifies all those relationships, and as long as each variable can be measured, performance should be predictable. If the flowrate is 2 gpm and the temperature change from inlet to outlet is 100 °F, we can calculate the amount of heat we need and therefore the amount of gas. Non-linear elements such as the tank’s ability to capture heat and loss through the sides, can be built into the calculations. As those variables move around, the model should respond and keep the outlet temperature stable. If we’ve done a good job, it will be able to respond to changes quickly and track to the setpoint more accurately than simple regulatory control.

Peter Welander is a content manager for Control Engineering. pwelander@cfemedia.com

Key concepts:

  • Advanced process control can helps situations where regulatory control is inadequate.
  • Creating a process model using mathematical tools can help run the controller and serve as a diagnostic tool.
  • The accuracy of your model and its ability to control depends heavily on the skill of your people.

Go online:

Learn more about the companies mentioned:
www.mathworks.com
www.mavtechglobal.com
www.rockwellautomation.com

Read more about APC below: