Simulate Your Way out of a Difficult Real Time Control Problem: Automatically Controlling Gates to Reduce Combined Sewer Overflows (CSOs)

Size: px
Start display at page:

Download "Simulate Your Way out of a Difficult Real Time Control Problem: Automatically Controlling Gates to Reduce Combined Sewer Overflows (CSOs)"

Transcription

1 Simulate Your Way out of a Difficult Real Time Control Problem: Automatically Controlling Gates to Reduce Combined Sewer Overflows (CSOs) Maxym Lachance, Eng. 1, Sid Lodewyk, M.Sc., P.Eng. 2 1 Tetra Tech Sherbrooke Street East, Suite 900, Montréal (Québec), Canada, H1V 3R9 (*correspondence: maxym.lachance@tetratech.com) 2 City of Edmonton Street NW, Edmonton (Alberta), Canada, T5A 4L3 KEYWORDS RTC, Simulation, Control System, Process Optimization, Wastewater Challenges, PID. ABSTRACT To resolve the operational issues, such as process instability and excessive gate movements seen at the City of Edmonton real time control site RTC#4, an external simulator was developed to allow for off-site testing and development of a stable control solution that would account for all of the equipment specifications and on-site configurations. The simulator was built and configured using on-site data from previous rainfalls, and validated by being able to accurately reproduce the recorded on-site data for a chosen rainfall. Afterward, the simulator was used to create an optimum control strategy by testing various strategies and control parameters. Once the optimum control strategy was found, it was implemented on-site for evaluation. The new controller built from the simulation not only respected the equipment s constraints but also helped stabilize the control process and did not require any site modifications. The setpoint overshoot was eliminated, the upstream level oscillation was reduced by 80% from ±50 cm (1.0 m span) to only ±10 cm, and the downstream level oscillations were reduced by 80% from ±25 cm (0.5 m span) to only ±5 cm. The obtained results proved that a well-built simulator can be reliable and that simulation can be considered as a new and safe tool to resolve difficult real time control issues. Introduction In an effort to reduce combined sewer overflows (CSOs), the City of Edmonton implemented real time control (RTC) at the RTC#4 site in order to control flow and take advantage of the available inline retention. However, the site demonstrated operational issues, such as process instability and excessive gate movements; previous attempts to stabilize control were performed but the issues persisted. Consequently, a new methodology using off-site simulation was used to develop a control strategy that worked, which resolved the issues. The first phase of the project consisted of an analysis of the actual control logic and the gathering of all information regarding the existing control strategy (e.g. raw data from past rainfalls, equipment specifications, and ladder logic code programmed into the programmable logic controller (PLC)). Based on the gathered information, the existing control strategies were analyzed in detail, as were the equipment specifications and field installations. The findings confirmed that some of the control strategies were not optimum in regards to the site's hydraulic behavior and would need to be revised.

2 Lachance - Lodewyk 2 For the second phase of the mandate, a simulator was programmed to mimic the actual hydraulic conditions found at the site, which took into account all of the equipment and hydraulic specifications (i.e. sewer configuration, gate size, actuator speed, and instrumentation location). The simulator allowed for safe off-site testing of various control strategies until a valid and optimal control strategy was developed for the RTC#4 site. In the final phase, the optimal control strategy was programmed and implemented onsite at RTC#4, followed by a period of performance evaluation, confirming that the actual operational results were as anticipated and that all issues had been resolved. The purpose of this paper is to demonstrate that it is possible to perform off-site simulations to develop and fine-tune controllers for difficult real-time applications and possibly avoid expensive site upgrades. For this project, actuator upgrade, instrument relocation and gate opening re-sizing were all considered but ultimately were not needed as the simulation was able to provide a stable control solution. This methodology can provide optimal performance without the limitations of potentially risky on-site testing that could cause surcharges, overflows or flooding. Methodology Wastewater RTC simulation already exists in some modeling software but is very limited in the type of controls that can be programmed and cannot account for any odd hydraulic behavior, such as hydraulic jumps, transient effect, flow lamination, etc. They are only useful to obtain a general idea of the effect of RTC control on the hydraulic and are not reliable enough to establish the controller s gains. In most wastewater applications, the RTC site controllers are usually tuned and adjusted live during rainfall events. This method is simple and will normally yield acceptable results for simple sites. On the other hand, some sites may prove to be very complex for various reasons and on-site tuning may become especially difficult and require a long period of time waiting for a rainfall event in order to adjust the controller. This is where the use of an off-site simulation could be considered. The offsite simulation we have developed is not the typical theoretical hydraulic simulation using only hydraulic relationships. This simulator is custom built for a specific RTC site to perfectly mimic the site s hydraulics, configuration and its equipment specifications. That being said, the hydraulic behavior of the site can only be known through accurate monitoring. Therefore, this solution is only applicable for existing regulators where on-site data is already available, as this data is essential in order to understand the hydraulic properties of a site and build and validate a simulator. Finally, once the simulator is completed and validated by accurately reproducing the on-site data, it can be used to test and calibrate different controllers until an optimum solution is found. To summarize, it is possible to use off-site simulation to resolve complex RTC issues where a wide range of on-site data is available, when normal tuning methodology has failed, or if on-site tuning is too risky or not possible. RTC#4 Site Description In order to better understand the entirety of the project, it is important to have a good understanding of the site s objectives. Flow control is accomplished at RTC#4 by a large gate (see Figure 1), which has a

3 Lachance - Lodewyk 3 dual purpose: control and maintain a set downstream level, as well as controlling the upstream storage. Initially, the gate will throttle the flows to maintain the downstream set point, resulting in storage upstream of the gate until the maximum upstream storage is attained. At that point, the controller will switch to upstream level control, where the gate is modulated in order to maintain the upstream level set point. This causes the downstream level set point to no longer be respected, resulting in potential overflows. Control Issues at RTC#4 Source: Operational and Maintenance Manual (RTC#4), City of Edmonton Figure 1 : RTC#4 Site Layout The issues at the RTC#4 were recurrent from one rainfall to another and had remained unresolved, despite the City s efforts to alleviate them. The first issue at RTC#4 was the slow reaction of the gate at the beginning of an event, resulting in early overshoots of the downstream set point (see Figure 2). At the beginning of the event, the gate is far above the water and takes a long time (approximately 25 minutes) to reach the water and begin restricting flows downstream. This leads to an overshoot of around 40 cm higher than the downstream set point, which is critical as a higher downstream level may lead to an unnecessary overflow downstream before the full utilization of the available upstream storage.

4 Lachance - Lodewyk 4 Figure 2 : RTC#4 September 28, 2010 Rainfall Event: Set Point Overshoot Furthermore, as demonstrated in Figure 3, the gate controllers are unable to stabilise, resulting in unstable upstream and downstream levels. The upstream level control oscillates, resulting in an upstream level oscillation of ±50 cm (1.0 m span) around the set point, which creates unwanted situations. When the level is above the set point, there may be an impact on the upstream system (i.e. surcharge or flooding), and when the level is below the set point, the available storage is not fully utilised and additional flows are sent downstream, resulting in potential additional overflows. As for the downstream controller, it is also unstable, resulting in a downstream level oscillation of ±25 cm (50 cm span) around the set point. The instability in the downstream level is critical as each time the level is higher than the set point there is a potential for overflows, and when the level is below the set point, water is stored unnecessarily RTC4 Process History Depth (mm) :00:00-juil-16 10:48:00-juil-16 09:36:00-juil-16 08:24:00-juil-16 07:12:00-juil-16 06:00:00-juil-16 04:48:00-juil-16 03:36:00-juil-16 02:24:00-juil-16 01:12:00-juil-16 00:00:00-juil-16 22:48:00-juil-15 21:36:00-juil-15 20:24:00-juil-15 19:12:00-juil-15 18:00:00-juil-15 16:48:00-juil-15 15:36:00-juil-15 14:24:00-juil-15 13:12:00-juil-15 12:00:00-juil-15 10:48:00-juil-15 09:36:00-juil-15 08:24:00-juil-15 07:12:00-juil-15 Time CONTROL GATE POSITION DOWNSTREAM CONTROL SETPOINT TRUNK SEWER DEPTH UPSTREAM DOWNSTREAM TRUNK SEWER DEPTH UPSTREAM CONTROL SETPOINT Figure 3 : RTC#4 July Rainfall Event: Instability

5 Lachance - Lodewyk 5 Gathering Data and Specifications The first step in developing a simulator is to gather all of the required information, such as level, flows, gate position, and equipment specifications. The data will not only be used to understand the site specificity and build the simulator, but also as a reference to validate the simulator, a crucial part of the process. On-site rainfall data is essential. You must identify specific rainfalls where the operational issues are present and gather for each of them all of the recorded data, such as levels, flows and gate positions. These rainfalls will become your reference in order to develop and validate the simulators. Equipment specifications are also required, as it is important to understand the equipment used for control in order to have a better understanding of their behavior and limitations. For example, at RTC#4, the actuator was very restrictive in the type of control possible due to its limited modulation capability. The tables below present all of the information used to build the simulator. Table 1: Water Level Sensors Sensor Location Type Calibration Range Upstream water level Downstream water level Type Upstream of weir wall 40 m downstream of the gate Speed (mm/s) Ultrasonic Ultrasonic Table 2: Actuator Dead Band (%) Maximal Start and Stop Cycle (cycle per hour) 0 to m 0 to m Duty Cycle (minute per hour) Electric Table 3: Gate Size Height/Width Invert Initial Position Type Shape (m) (m) (%) Sluice Gate 1.8/ Rectangular 100 (fully open) Table 4: Sewer Location Shape Size Slope (m) (%) Upstream Egg-shaped Downstream Egg-shaped Finally, we have to gather information about the PLC used. This is essential to understand its specific controller possibilities and limitations. At RTC#4 the PLC offered a built-in proportional integrative and derivative (PID) functions block and enough processing capacity to program different controllers.

6 Lachance - Lodewyk 6 Simulating the Existing Behavior Before trying to test any new control strategies, it is important to validate the simulator by first reproducing the existing conditions inside the simulator, where the intent is to first simulate all existing conditions for a specific rainfall and be able to reproduce what was recorded on-site to confirm that the simulator is reliable. Once the simulator is validated, the same rainfall will be submitted to different control strategies in order to find an optimized control. Using all of the available data described in the previous sections, it is now possible to build the required function block for the simulator. The different simulator s inputs and function blocks are described in the following sections. Computing the Inflow (Simulator Input) The first step for simulation is to reproduce the site inflows for the simulated rainfall. The inflows will be the main input in the simulator and will be based on a real rainfall in order to be able to compare the actual control strategy with the optimized one. Since the site was not equipped with flow meters, the inflow must be computed using a mass balance equation: Where: V ( t t) V ( t) Qi ( t) = + Qg ( t) t Qi = Inlet flow rate Qg = Flow under the gate V = Accumulated volume Δt = Sampling period In other words, the total inflow will be equal to the flow under the gate plus flow that is being stored or minus the flow that is being released. The flow under the gate is computed using proven mathematical equations and the accumulated volume is derived from an existing storage/depth polynomial equation, developed by the City of Edmonton. Programming the Actual Upstream and Downstream PID Controllers (Function Block) To reproduce the actual RTC#4 controllers, the upstream and downstream water level controllers were programmed as they were in the on-site Allen Bradley SLC 5/03 processor PID block: Where: Output = computed output for the control variable (gate position) K c = controller proportional gain E = error on the process value (PV) T I = reset term (minutes per repeat) T D = rate term (minutes)

7 Lachance - Lodewyk 7 The PID controllers will react based on the required set points and will compute the appropriate gate positions as per their controller s parameters. The parameters were initially set as per the existing conditions to match the controller response seen on-site. Actuator (Function Block) The actuator is driven by the controller s PID output and was programmed to move the gate as per the actuator s specifications (i.e. speed, minimum and maximum opening, gate invert elevation, positioning accuracy associated with the encoder, position dead band, and initial opening). Flow Under the Gate (Function Block) The flow under the gate (FUG) relationship calculates the flow rate under the gate based on the upstream level, downstream level and gate positions. When the gate is plunged into the water, flow rates are computed using the equation found in the book Hydraulique (Kréménetski, Schtérenlith, Alychev and Yakovléa, Mir, 1984), used for rectangular sluice gates in a horizontal canal. When the gate is out of the water, the Kindsvater and Carter equation for weirs is used to compute flow rates under the gate. It is essential to compute the intercepted flow (FUG) to close the site s mass balance, which is needed to compute the downstream flows and the accumulated volume upstream of the gates. Upstream Water Level Sensor (Function Block) To simulate the upstream level, we know that the level will depend on the stored volume. Therefore we used the existing stored volume/level polynomial relationship developed by the City of Edmonton to translate the computed stored volume (mass balance) into an upstream water level. In addition, by analyzing the on-site data, we realized that the water level was not only dependent on the stored volume but that the level was also dependent on gate movements. Our study showed that there was a transient water level defined by the gate movements. In other words, when the gate was opening, the upstream level dropped quickly, oscillated and then re-stabilized. Inversely, when the gate was closing, the upstream level rose quickly, oscillated and then re-stabilized. This is mainly because the upstream level monitoring site is too close to the gate and is affected by the local transient effect. The mathematical model used to simulate the combined effect of the stored volume and the transient effect was developed by using the stored volume/level polynomial relationship and superimposing a calibrated exponential filter to reproduce the transient effect caused by the gate s movement. Downstream Water Level Sensor (Function Block) The downstream level is dependent on the flow at the monitoring site, flow that is equal to the computed flow under the gate function block. Since the downstream monitoring site is located 40 m downstream, we know that rapid change in the FUG will be attenuated over that 40 m distance (flow lamination). Therefore, we developed a flow conveyance model to calculate the flow rate at the downstream water level sensor after the 40 m travel distance. This flow rate is given by an exponential filter model that accounts for the travel time delay and flow lamination that occurs between the regulator and the downstream level monitoring site (see Figure 4).

8 Lachance - Lodewyk 8 Figure 4 : Flow Lamination and Travel Time Delay Simulation Results Reproducing the Existing Conditions The capability of the simulator to properly emulate the existing system behavior is a key element for the development of enhanced command rules. If the simulator does not reproduce the actual site s behavior closely enough, there is a risk that the performances shown from the simulator will not be transposed into the real world. In order to validate the capability of the simulator to reproduce the actual behavior of the RTC#4 site, the recorded gate movements from the September 28, 2010 rainfall were imposed on the simulator to see if the simulated levels matched the recorded level when they are submitted to the same inflows and gate movements. Figure 5 shows the upstream and downstream water levels measured and simulated for the September 28, 2010 rainfall event after many adjustments to the simulator to obtain the best possible results. These results show the ability of the simulator to accurately simulate the upstream and downstream water levels at the RTC#4 site. It should be noted that the simulator is not only able to reproduce the average levels, but also the frequency and amplitude of the oscillations of both the upstream and downstream levels.

9 Lachance - Lodewyk 9 Figure 5 : RTC#4 Levels with Imposed Gate Positions Imposing the gate position confirmed that the hydraulic simulation was properly simulated. To test the controller and actuator aspects of the simulator, the same inflows (from September rainfall) were simulated to compare the gate s movements. As demonstrated in Figure 6, the gate controller and gate position were also well simulated and remained very close to the measured values. Figure 6 : RTC#4 Gate Positions for the September 28, 2010 Rainfall

10 Lachance - Lodewyk 10 Development of New Command Rules As demonstrated with the simulation results from the previous section, the hydraulic simulation and equipment simulation for the RTC#4 site were validated and therefore ready to be used to develop a new control strategy, with the aim of resolving all of the operational issues. The strategy was to use the same reference inflows (September 28, 2010) with a different controller, while keeping all of the same hydraulic functions that had been previously validated. The control strategy was then adjusted and fine tuned, until a stable and optimum control was obtained. To develop new control rules, it is important to understand the origin of the control problems and characterize the difficulties related to the fulfillment of the control objectives. At the RTC#4 site, it was preferable to avoid expensive civil work and work with the existing control difficulties, because of the following site conditions: - The actuator is only rated for 60 starts per hour (1 gate movement/minute): o Limited in modulation capability; - The gate is large and only operates in the 0-10% range: o Limited control range; - The downstream level monitoring site is 40 m from the regulator: o Delay in the downstream level reaction; o Have to account for the flow lamination; - The upstream level monitoring site is just upstream of the gate: o Subject to transient effect during gate movements. The new command rules would have to account for the above site conditions, which is why the simulator was used to test a wide range of control parameters for both a PID controller and an adaptive and integrative controller (AI). The AI controller consists in a controller with a dynamic adaptive gain based on the current hydraulic conditions. The different control parameters that were tested and finetuned include the following: - Controller s gain (i.e. proportional, integrative and derivative gain): o Tune until stable control is reached; - Control period of the controller: o For the downstream water level controller, long control periods were simulated to guarantee that the impact of a gate movement is fully recorded by the downstream water level sensor; o For the upstream water level controller, long control periods were simulated to guarantee that the system dynamic was in a steady state in the vicinity of the control gate before defining a new gate set point position; - Averaging/filtering of the process variables: o To improve the robustness of the control in order to remove disturbances and noise; - Upper clamp (prevents movements of the gate higher than the upper clamp set point): o These upper clamps were simulated to ensure that the gate is closer to the water at the beginning of an event.

11 Lachance - Lodewyk 11 During our simulation we found that the AI controller was able to stabilize the process but that the PID was yielding better results for the upstream controller, where the derivative gain minimized the initial overshoot and eliminated low frequency oscillations. After many simulations it was possible to stabilize the controller and the final control strategy had the following characteristics: - Upstream controller (PID): o Upstream level average over the last 150 seconds; o Control period of 100 s: Longer than the level transient effect disturbance; Respect the actuator s limitation of 60 starts/hour; - Downstream controller (PID): o Upper clamp of 25%: Downstream control is done with opening below 25%; Improve response and eliminate point overshoot; o Downstream level average over the last 60 seconds; o Control period of 60 s: Longer than the travel time delay from the regulator to the monitoring site; Respect the actuator s limitation of 60 starts/hour. Figure 7 below illustrates the final simulator s performance compared to the measure data. *pink curve: simulation results, yellow curve: measurements Figure 7: Optimized PID Controller Simulation Results at RTC#4 (September 28, 2010)

12 Lachance - Lodewyk 12 Onsite Performance of the New Control Strategy After simulation, the new controllers (upstream and downstream) for RTC#4 were programmed and downloaded on-site for performance evaluation. During the evaluation period from October 21, 2011 to May 25, 2012, the new controllers performances were evaluated for four different rainfalls. It was found that the on-site performance was in phase with the performance obtained from the simulations and that no further adjustment of the controller was needed, as the optimum performance had been reached. The new controller built from simulation not only respected the equipment s constraints, such as gate movements (60 displacements per hour), but also helped stabilize the control process to maintain the level below the overflow weir, resulting in less CSO occurrences. The downstream set point overshoot was eliminated, the upstream level oscillation was reduced by 80% from ±50 cm (1.0 m span) to only ±10 cm, and the downstream level oscillations were reduced by 80% from ±25 cm (0.5 m span) to only ±5 cm. Figure 8 illustrate typical performance with the new controllers under upstream control. Acronym Figure 8: Optimized PID Controller Simulation Results at RTC#4 (September 28, 2010) PID... Proportional, integrative and derivative controller AI... Adaptive and integrative controller RTC... Real time control CSO... Combined sewer overflow PLC... Programmable logic controller FUG... Flow under the gate

13 Lachance - Lodewyk 13 Maxym Lachance, Eng. is a project engineer with Tetra Tech, holding a college degree in electronics and a bachelor's degree in automated production engineering (Montreal). He has more than 12 years of experience as both an electronic technician and an engineer, and has developed an expertise in instrumentation and control. Mr. Lachance has successfully commissioned and calibrated more than eight different wastewater real time control (RTC) sites while providing assistance and guidance for many more. He most recently increased his expertise in off-site simulation using the MATLAB platform to resolve difficult RTC applications, through which he won the 2012 Technical Achievement Award in recognition of innovative technical excellence by the Tetra Tech organisation. Sid Lodewyk, M.Sc., P.Eng. is a General Supervisor at the City of Edmonton with over 25 years of experience as a municipal engineer. He has worked in various positions at the City, including planning, monitoring and operating. He is currently in charge of a group of 40 engineers, technologists, electricians, millwrights and repairmen who operate and maintain the 200 mechanical facilities that form an integral part of the sewerage and drainage systems in the City. There are two RTC facilities in the City for CSO control, with a third in the final stages of construction.