0711_PHbutton

Virtual Control of Real pH

Nov. 6, 2007
Virtual design reduces the hassles of pH control.

By Gregory K. McMillan and Mark S. Sowell

Nearly every plant has pH control applications, even if only a plant waste-treatment system. The performance of the pH system is important, not only from the viewpoint of environmental regulation compliance, but also in terms of reagent consumption, direct costs and as an indicator of upstream process problems. Additionally, pH can be critical in the process operation of crystallizers, fermenters, reactors and strippers For example, a 0.2 pH variation from the optimum pH for a mammalian cell culture can decrease cell growth, viability or product formation by 10%. Therefore, proper control of the pH system is an important part of profitable and safe plant operation.

Great Expectations and Practical Limitations

In terms of hydrogen ion concentration, a pH system seeks to achieve a degree of concentration control that is extraordinary. No other measurement offers a rangeability of 1014 (0-14 pH scale) or a resolution of 10-7 (neutrality). While we tend to focus on the configuration of the DCS, achieving the full potential of the pH measurement requires exceptional attention to every aspect of the system design. Deficiencies in the equipment, piping, valves or sensor selection or installation can cause the system to fail miserably. However, advanced process control and high-resolution control valves can get the most out of the system and potentially eliminate a stage of neutralization or an agitated vessel.

For pH electrodes, some plants have established the middle selection of three electrodes as a best practice. (See items 1-3 in the “Extra Credit” sidebar, located at the end of this story.) Many users have moved to two electrodes, but since the electrodes never agree, using two raises more questions than answers and offers no improvement in reliability if the wrong electrode is chosen.

Manual and automated logic that establish one electrode as the favorite would make an interesting article. Middle signal selection, on the other hand, is quite boring, since it inherently provides protection against a single failure of any type, including the most insidious of all, a failure to a value that matches the pH set point, a very real possibility for pH. Using the middle value can also reduce noise and improve the accuracy of the signal.

Existing Plant Waste pH Control System
Each stage in this system consisted of a static mixer, multiple reagent control valves in parallel, and the middle selection of three pH electrodes to improve the resolution and reliability of the final element and measurement.
Since pH electrodes are a hassle, very few are willing to take a leap of faith into more electrodes, even though in many cases the savings in process efficiency and smarter maintenance would cover the installed cost in less than year. However, an online pH model can provide the third sensor, at least as a demo, but this is just a small part of the whole story. Besides identifying advanced control opportunities, there is a vast new realm of possibilities for testing the entire system design using a “virtual plant.”

The Art of Simulation

A virtual plant was recently used to prototype and test new advanced control strategies for a plant waste-treatment system. The virtual plant consists of a first-principle dynamic model of the pH system and the control system configuration running on the same PC. (See items 4 and 5 in “Extra Credit” sidebar, located at the end of this story.) The model includes component, charge and energy balances for various types of equipment and piping designs. The task of setting one up is a lot less intimidating, both in terms of numerical computation and physical properties, than is normally associated with high-fidelity process models if one focuses on simplification and attention to details that really matter—the essence of the art of dynamic simulation.  For example, the effect of valve resolution, dip tube volume, transportation and mixing delays are modeled because these are often the large sources of dead time. The name of the game with pH is to minimize the loop dead time to minimize the excursion along the highly nonlinear titration curve. 

Process models may have hundreds of thousand of compounds and millions of details on physical properties, but often assume perfect valves, perfectly mixed volumes and perfect injection of reagents, all of which cause a serious underestimation of the loop dead time, leading to erroneous conclusions and bizarre controller tuning. (See Items 6, 7, and 8 in sidebar, located at the end of this story.)  For pH modeling for process control of environmental systems, about 20 acids and bases cover about 90% of the applications. The physical properties requirements are much less (just molecular weight, density and dissociation constants of each acid and base). The waste treatment systems are normally dilute enough so that activity coefficients are not needed.

A Mystery

We tested the online pH model in a plant waste-treatment system that had two stages of inline pH control followed by a tank, as shown in Figure 1. Each stage consisted of a static mixer, multiple reagent control valves in parallel, and the middle selection of three pH electrodes to improve the resolution and reliability of the final element and measurement. The big downstream tank with three electrodes was not particularly well mixed, but still provided significant attenuation (smoothing) of the pH oscillations from the inline systems. There was a complex custom fuzzy logic control system on the tank that worked, but sometimes made changes operators could not understand. The engineer who implemented the fuzzy logic had moved on, and its detailed functionality was a mystery to us, let alone to those not privy to its origin.

Seeking simplicity and the use of standard tools, we used the virtual plant to explore whether we could replace the fuzzy system with straightforward model predictive control. The goal as illustrated in Figure 2 was to minimize reagent consumption by lowering the pH set point of the inline systems without causing a pH excursion in the tank below the RCRA environmental limit. To insure the second stage could quickly do its job, a secondary objective was to keep the second-stage reagent valves at a minimum throttle position good enough to eliminate the valve and reagent delivery delays associated with getting a valve off its seat and flushing out an injector. To back up the fuzzy logic, a kicker algorithm would step open the second-stage pH controller output to 50% if the second-stage pH hit a low pH trigger point. 

The Setup

Before we could effectively use an online pH model, we needed to get the concentration right for the major strong acid in the waste. To kill two birds with one stone, we used a single input and output model predictive control (MPC) in an innovative way to adapt the concentration online. The set point and the controlled variable of the MPC was the reagent-to-waste flow ratio for the actual and virtual plant, respectively. The manipulated variable of the MPC was the strong acid concentration in the process model. The set points of the inline pH system came from the actual plant. Figure 3 shows this setup of the virtual plant running in unison with the actual plant. While a single model parameter was used here, the multivariable capability of the MPC offers the ability to extend the adaptation to several model parameters.

Opportunities for Reagent Savings
The goal of this arrangement was to minimize reagent consumption by lowering the pH set point of the in-line systems.
Once the model was adapted, it offered inferential measurements of the waste concentration for diagnostics and provided a vehicle to prototyping many other advanced control opportunities. The whole virtual plant was run faster than real time offline or just parts of the process, such as the big tank, ran faster than real time online. 

Upsetting Experiences

The first few hours after the model was put online, the adaptive MPC homed in on a relatively constant concentration. When we returned from lunch, the plant was rocking and rolling, and the pH system was dealing with frequent rapid changes in waste concentration. The kicker was activating about every 20 minutes. The MPC did a much better than expected job of chasing the acid concentration, as shown in Figure 4. We confirmed later that the production unit that was the source of most of the strong acid was having issues. A comparison of the virtual plant and actual plant control valve positions and pH response revealed there was no flow going through one of the second-stage reagent valves. The problem cleared a day after a phone call. Although not confirmed for this case, a technician said the tiny trim in these reagent valves had gotten plugged.

Adaptation of Virtual Plant and Optimization of Actual Plant
This is the setup of the virtual plant running in unison with the actual plant.
The in-line set points in the virtual plant were turned over to a single input and output MPC for each stage in the virtual plant to investigate whether the MPC could replace the fuzzy logic control. The second-stage MPC did a good job of holding a tank running 10 times real time at a minimum pH. The first-stage MPC had difficulty keeping the second-stage reagent valves exactly at a specified minimum position because of interaction with the second-stage MPC and kicker. Fortunately, the secondary objective of reagent valve position optimization was less important. Since an MPC had been demonstrated to perform similar functions, it is expected the MPC should be able to do better than an integral only valve position controller. (For more details, see item 8 in the sidebar located at the end of this story.)

The kicker algorithm was made smarter by incrementing the output by 0.5% per second instead of a single step in the output of 50% (For more details, see item 9 in the sidebar located at the end of this story.). Also, a larger filter was added to the pH trigger for the second stage to emulate the filtering action of the attenuation tank. The result was smoother operation and a significant reagent savings. Making the kicker less disruptive and putting the reagent valve optimization in the same MPC used for tank pH control has eliminated potentially debilitating interactions. 

More Excitement for Engineers

It takes more and more interesting opportunities to get weathered engineers excited. However, the almost limitless opportunities to explore advanced control ideas make us downright tingly. For example, tests have shown model predictive control can make fine and coarse split-ranged reagent valves just a distant memory—or nightmare) (See item 8 in the sidebar located at the end of this story). The reagent savings in environmental systems are potentially big, since a lot is left unknown, and the loops don’t get as much attention as the more up-front and glamorous applications in production units.

Besides picking the relatively low-hanging fruit in waste treatment systems, what is learned can be carried over to process pH loops to improve product quality. There is a significant opportunity for all pH systems to maximize the return on capital improvements by a performance-based intelligent design of equipment, piping, sensors and valves.

Process control has proven to be able to improve the process metrics (capacity, quality and efficiency) of an existing installation by operating closer to constraints (equipment or process limits). If you had knowledge of the possible improvements by process control during the design of a new plant, you could select equipment that both improves metrics and reduces project cost. A virtual plant provides the tool for exploration and demonstration, testing of the control system and its configuration, and training of operations and technical support groups for these opportunities.

A design criterion dating back to the 1960s cited one stage of neutralization is needed for every 2 pH units the influent is away from the pH target. Each stage was considered to be a well-mixed vessel with a minimum residence time of 10 minutes and a turnover time of less than 0.5 minutes.  The guideline also recommended the tanks have significantly different residence times to prevent resonance. An influent at 1 pH and a target of 7 pH would necessitate three vessels with set points of 3, 5, and 7 pH. For a large waste flow (e.g., 1,000 gpm), the minimum residence time translated to large operating volumes (10,000, 50,000 and 250,000 gallons) and agitation power requirements. The installed cost of such a system can be several million dollars.

Adaptation of Process Model’s Waste Concentration
The model predictive control (MPC) did a much better than expected job of chasing the acid concentration.
The criterion ignored practical problems in reagent injection and valve design that could cause failure to meet performance objectives despite a large capital investment. A virtual plant can show how advanced control and multiple high-resolution control valves can enable an inline pH system (e.g. static mixer) and a single vessel to replace the three well-mixed vessels for this case and reduce the project cost by 50% or more.

Using a virtual plant, engineers can try out neat stuff such as:

  1. Elimination of the split-ranging of acid and base valves;
  2. Translation of the controlled variable from pH to reagent demand for excursions to the steep portion of the titration curve;
  3. Identification of titration curves;
  4. Diagnostics of production unit problems;
  5. Inferential measurements of concentrations and pH;
  6. Optimization of totalized flow ratios of reagent to influent streams;
  7. Translation of the controlled variable from batch pH to rate of change of reagent demand for linearization and bi-directional self-regulation;
  8. Full throttle set point response of a reagent demand controller (See item 10 in sidebar located at the end of this story).
  9. Virtual discovery is a reality for pH control systems,  (See item 11 in the sidebar located at the end of this story).

Go to www.controlglobal.com/ Gregory K. McMillan is a regular Control contributor and a consultant with Emerson Process Management. Mark S. Sowell is a Process Control Fellow with Solutia.

Extra-Credit Reading

Below is a list of additional reading on advanced control and measurement of pH and the use of simulation and “virtual” plants.

  1. McMillan, Gregory K., “A Funny Thing Happened on the Way to the Control Room”
  2. McMillan, Gregory K., Plant Design Category
  3. McMillan, Gregory and Cameron, Robert, Advanced pH Measurement and Control, 3rd edition, ISA, 2005
  4. McMillan, Gregory K. and Cameron, Robert A., Models Unleashed – Virtual Plant and Model Predictive Control Applications, ISA, 2004
  5. Mansy, Michael, M. McMillan, Gregory, K., and Sowell, Mark, S., “Step into the Virtual Plant,” Chemical Engineering Progress, February 2002
  6. Boyes, Walt, Hebert, Dan, O’Brien, Larry, and McMillan, Gregory, “The Light at the End of the Tunnel is a Train,” Control, August, 2005, p.36
  7. McMillan, Gregory K., “Improving Process Loops,” Chemical Processing, October, 2007
  8. McMillan, Gregory K., “A Fine Time to Break Away from Old Control Valve Problems,” Control, November, 2005, p. 57
  9. McMillan, Gregory K, “One Man’s Story—Part 2,” Control Talk, Control, September, 2007, p. 95
  10. McMillan, Gregory, K. “Full Throttle Batch and Startup Response,” Control, May, 2006, p. 67
  11. McMillan, Gregory K, “One Man’s Story—Back to the Future,” Control Talk, Control, October, 2007, p. 91

Sponsored Recommendations

2024 Industry Trends | Oil & Gas

We sit down with our Industry Marketing Manager, Mark Thomas to find out what is trending in Oil & Gas in 2024. Not only that, but we discuss how Endress+Hau...

Level Measurement in Water and Waste Water Lift Stations

Condensation, build up, obstructions and silt can cause difficulties in making reliable level measurements in lift station wet wells. New trends in low cost radar units solve ...

Temperature Transmitters | The Perfect Fit for Your Measuring Point

Our video introduces you to the three most important selection criteria to help you choose the right temperature transmitter for your application. We also ta...

2024 Industry Trends | Gas & LNG

We sit down with our Industry Marketing Manager, Cesar Martinez, to find out what is trending in Gas & LNG in 2024. Not only that, but we discuss how Endress...