Case Study: Using machine learning tools for accurate flow control

Nov. 4, 2020
Machine learning control algorithms and fast flowmeters help a wastewater treatment plant save 50% of energy.

Chico wastewater treatment plant (WWTP) in California treats around 6 million gallons of water every day. More than 50% of the total plant energy bill is spent on aeration of the activated sludge system, which is typical for the industry.

One of the methods to improve the energy efficiency of the activated sludge system is to optimize and automatically control air compression and efficient flow distribution among air discharge pipes. Automatic control, however, has its challenges.


1. The air supply is controlled by vanes, while air distribution at the Chico activated sludge system is controlled by butterfly valves, which are valves of choice for the aeration system at the WWTPs. Both vanes and butterfly valves have nonlinear characteristics (see Figure 1). When a valve opening changes by 2 to 3 degrees, the flow doubles. A couple degrees of rotation takes an actuator less than a second to complete. So, the flowmeters need to be fast enough to reflect these changes in airflow.

2. Proportional integral derivative (PID) control law is linear and cannot provide accurate control for nonlinear processes.

3. In addition to providing accurate flow control, the airflow control algorithms need to maintain the lowest pressure in the system to avoid wasting energy on overcoming the headloss generated by partially closed valves.

4. Headloss of completely opened valves is less than 0.1 psi, which is significantly smaller than the static pressure of the system. This phenomenon represents a substantial challenge to traditional control methods.

5. Traditionally, each control valve operates independently of others and of the blower. Independent operations of valves and blowers often lead to control system oscillation (valve and blower hunting).


The instrumentation challenge was addressed by installing recently developed thermo flow meters (Model 410 FTB) by Kurz Instruments based in Monterey, California. This model is fast — time constant of just 0.18 seconds — and measurements are characterized by very low noise (0.19%). To address a nonlinearity challenge, it was decided to replace PID control with a control that is based on the aeration system and blowers’ models. Initially, a formal differential equation-based mathematical model of the aeration system was developed using Matlab/Simscape package. Unfortunately, the accuracy of this model was inadequate; therefore, it could not be used for accurate control.

Instead of using formal modeling, an alternative modeling approach was developed using machine learning (ML) tools. This approach uses historical data to forecast the behavior of the aeration valves and blowers. A case-based reasoning method was used to determine an optimum vane position of the blower. This method finds a match in the past of the current air demand and selects the vane position that corresponds to the smallest energy consumption by the blower.

A random forest method was used to determine an opening for each of the butterfly valves. The random forest method is based on multiple combinations of if-then rules that are computer-generated based on historical data. These rules take into account information about airflows and positions for each of the valves in the system.

The aforementioned flow control algorithms, part of the DO/Nmaster developed by Ekster and Associates, are currently the only ML-based commercial system for airflow, dissolved oxygen and ammonia controls.


Fifteen 410 FTB flowmeters and DO/Nmaster were installed at the Chico wastewater treatment plant. Based on data collected from all 15 flowmeters over several days with 30-second interval frequency, a 50th percentile of the flow control error was less than 3.4%. Until now, this accuracy at the Chico plant could have been achieved only by replacing the installed low-cost butterfly valves with linear valves that were up to 50 times more expensive. Furthermore, the authors assume that the control error would be much smaller if the existing low-cost, outdated valve actuators were replaced with modern fast actuators that have a much smaller dead band.

Another significant improvement was the stabilization of airflow (as shown in Figure 2), and valves and blowers stopped “hunting.” As a result, the wear and tear of valves and blowers were reduced.

Improvement of airflow control helped improve the precision of the dissolved oxygen and ammonia controls. According to the local electrical utility verification team, the use of electricity by the blowers at the Chico plant was reduced by more than 50% after the installation of DO/Nmaster in combination with 410 FTB flowmeters.

Alex Ekster, Ph.D.,P.E., is a technical director at Ekster and Associates Inc. based in Fremont, California.

Vasiliy Alchakov, Ph.D., is a software department manager at Ekster and Associates Inc. based in Fremont, California.

Alex Larionenko, M.S. is a machine learning control engineer at Ekster and Associates Inc. based in Fremont, California. The authors’ combined experience in wastewater treatment optimization and control exceeds 60 years.

Sponsored Recommendations

Learn About: Micro Motion™ 4700 Config I/O Coriolis Transmitter

An Advanced Transmitter that Expands Connectivity

Micro Motion™ G-Series Compact, Drainable Coriolis Flow and Density Meters

Micro Motion G-Series Coriolis flow and density meters are ideally suited for Process Monitoring and Optimization applications, offering easy selection with pre-selected models...

Learn about: Micro Motion G-Series Coriolis Flow and Density Meters

The Micro Motion G-Series is designed to help you access the benefits of Coriolis technology even when available space is limited.

Micro Motion 4700 Coriolis Configurable Inputs and Outputs Transmitter

The Micro Motion 4700 Coriolis Transmitter offers a compact C1D1 (Zone 1) housing. Bluetooth and Smart Meter Verification are available.