A systematic methodology for controller tuning in wastewater treatment plants

A systematic methodology for controller tuning in wastewater treatment plants

8th IFAC Symposium on Advanced Control of Chemical Processes The International Federation of Automatic Control Singapore, July 10-13, 2012 A systemat...

1MB Sizes 1 Downloads 73 Views

8th IFAC Symposium on Advanced Control of Chemical Processes The International Federation of Automatic Control Singapore, July 10-13, 2012

A systematic methodology for controller tuning in wastewater treatment plants M. Mauricio-Iglesias*. S.B. Jørgensen* G. Sin* 

* CAPEC, DTU Chemical Engineering, Technical University of Denmark, DK-2800 Lyngby, Denmark, (e-mail: mim@ kt.dtu.dk;[email protected]; [email protected] ). Abstract: Wastewater treatment plants are typically subject to continuous disturbances caused by influent variations which exhibits diurnal patterns as well as stochastic changes due to rain and storm water events. In order to achieve an efficient operation, the control system of the plant should be able to respond appropriately and reject these disturbances in the influent. A methodology is described here which systematically addresses the assessment of the plant and the influent dynamics, in order to propose a controller tuning that is best adapted to an existing or planned wastewater treatment plant. Keywords: Controller tuning, decentralized control, wastewater treatment, benchmark simulation plant 

a given plant during dry weather (although much less during rain episodes). In particular, for municipal WWTP the inflows are largely related to the metabolism of the population, and their pattern can be characterized with historical data. Therefore, a suitable tuning of the controllers of a given WWTP should take into account the external dynamics that is the environment of the plant (i.e. nature of feed disturbances) and the expected inflow variations on top of the internal dynamics in the plant (i.e. interactions between the bioreactors and the separation due to mass recycling, biological activities versus settling performance, etc).

1. INTRODUCTION Provision of safe and sustainable water and sanitation services for human consumption/domestic water consumption, agricultural (e.g. irrigation) and industrial water usage is regarded among major challenges of this century and closely linked with energy and climate change issues. Not surprisingly the water/wastewater treatment for both municipal and industrial wastewater is an already established industry with a fast growth rate. For example, in EU, the water/wastewater industry correspond to 1% of GDP with a turnover about 80 billion € and an average growth rate of 5% per year (WSSTP 2006). Although wastewater treatment technologies have reached maturity in application, the control systems have not changed significantly in the professional practice since the introduction of dissolved oxygen control in the seventies (Olsson 2006). In practice, the implemented control structures in WWTP go rarely beyond flow-metering, and dissolved oxygen (DO) control installed in a single-input, single-output (SISO) mode as regulatory controllers, while in research there are several feasibility evaluation studies for advanced control strategies(Shen, Chen & Corriou 2008).

The aim of this work is to describe a systematic methodology for tuning of the controllers in WWTP that incorporates the information of the inflow to the plant together with information about the interactions within the plant system, in order to achieve an efficient control action. 2. METHODS 2.1 Model description The BSM1 plant has been described in detail elsewhere (Copp 2002). A short description is included here for the sake of completeness. It is composed of five activated sludge reactor tanks: the two first operating in anoxic conditions followed by three aerobic tanks in order to reproduce a common strategy for nitrogen removal consisting on nitrification and denitrification.

The need to investigate control structures in wastewater treatment plant led to development of the so-called benchmark simulation plant 1 (BSM1, (Copp 2002) ). Since its publication, a large number of control strategies have been proposed for the BSM1 plant, including the application of model predictive control (Shen, Chen & Corriou 2008), the optimization of setpoints (Guerrero et al. 2011), and the assessment of control structures (Flores-Alsina et al. 2008). To the best of our knowledge, no contribution has dealt with the problem of controller tuning in WWTP. Being an end-of-pipe treatment process, i.e. whatever the effluent quality, it is discharged to the receiving environment, the main disturbances that affect WWTP are related to variations in the influent flow and concentrations. However, in contrast with other end-of-line treatment processes, the patterns followed by the influent flow are rather constant for 978-3-902823-05-2/12/$20.00 © 2012 IFAC

Fig. 1. Diagram of the BSM1 plant and studied control layer.

828

10.3182/20120710-4-SG-2026.00101

8th IFAC Symposium on Advanced Control of Chemical Processes Singapore, July 10-13, 2012

The five activated sludge reactors are followed by a secondary settler. The control structure investigated here (Flores-Alsina et al. 2008) consists of three decentralized feedback loops that control the dissolved oxygen (DO) level in each of the aerobic tanks manipulating the corresponding aeration valve (Fig 1). Each of the streams in the BSM1 plant is characterized by 15 state variables. Of these, the following 11 characterise the inflow: soluble inert organic matter (SI), readily biodegradable substrate (SS), particulate inert organic matter (XI), slowly biodegradable substrate (XS), active heterotrophic biomass (XBH), total ammonium nitrogen (SNH), soluble biodegradable organic nitrogen (SND), particulate biodegradable organic nitrogen (XND), alkalinity (SALK), total suspended solids (TSS) and total flowrate (Q). The BSM1 simulations were carried out in Simulink (Mathworks). The block diagram of the linearized system is shown in Fig. 2.

can be done based on expert knowledge on an existing plant or in a systematic way using such as using sensitivity analysis (Sin et al. 2011). ii) Influent characterisation. An essential point in this method is to use the information about the influent to the WWTP in order to correctly characterize the expected disturbances. In an existing plant, this can be done through analysis of historical influent data, which may in general be provided by the plant itself. In case of plants with limited instrumentation, dry weather flow data can be inferred from the water consumption of the population and its composition can be estimated (Tchobanoglous, Burton 1991). For projected plants, models of different complexity (Gernaey et al. 2011) have been developed that include flowrate, pollutants and temperature generation taking into account diurnal, weekly variations and rainfall. Once defined, the influent flow can be analysed using timeseries analysis and/or spectral decomposition in order to evaluate the frequency ranges that are more relevant for disturbance rejection. In particular, spectral decomposition methods are especially well suited for the analysis of influent flow data since they are robust to measurement noise, outliers and missing data and have been successfully combined with principal component analysis (Thornhill, Horch 2007). iii) Variable scaling. Variable scaling, albeit considered trivial, plays a key role in the interpretation of the results of a number of controllability measurements (condition number, close loop disturbance gain). In general variable scaling must bring the variables to comparable magnitudes. As a general rule, controlled variables are scaled so that the maximum acceptable offset has magnitude ±1. Manipulated variables and disturbances should be scaled so that the maximum and minimum values expected/desired have magnitude ±1.

Fig. 2. Block diagram of the linearized plant. 3. SYSTEMATIC METHODOLOGY FOR CONTROLLER TUNING The methodology presented here is based on four main steps consisting in a review of the process, an assessment of the open loop plant, a design closed loop step and a final evaluation (Fig. 3).

iv) Plant linearization. Since WWTP are nonlinear plants with markedly different operation modes (dry weather influent versus rain weather), the operating point for the controller tuning needs to be carefully selected for linearization. Since the daily/weekly variation of the influent is pronounced for most municipal WWTPs, we recommend here to linearize the plant around several operating points (at least corresponding to the highest and lowest loading points) and carry out the analysis for each of them. v) Analysis of disturbance effects. The disturbance effects on the controlled variables are characterized by the closed loop disturbance gain (CLDG) defined as: (1) where G is the plant transfer function, diag(G) is the matrix consisting of diagonal elements of G and Gd is the disturbance transfer function. The magnitude of the CLDG element ij indicates the effect of the ith disturbance on the jth controlled variable at any given frequency. If the variables are suitably scaled, a ij lower than 1 indicates that the disturbance will not lead the controlled variable to an unacceptable offset (Hovd, Skogestad 1992).

Fig. 3. Methodology for controller tuning including methods used in each of the step/substeps. These steps and substeps are generic and are briefly introduced there. Examples of methods to perform them are illustrated below using the BSM1 as a case-study. i) Screening of disturbances. Given the large number of potential disturbances in WWTP, it is advisable to screen those which affect more severely the process. The screening

vi) Analysis of loop interactions. Loop interactions have to be taken into account in controller tuning. The (performance) 829

8th IFAC Symposium on Advanced Control of Chemical Processes Singapore, July 10-13, 2012

relative gain array (PRGA and RGA) have been used to analyse the loop interactions and design controllers accordingly (Skogestad, Hovd 1990). For strong interactions, the controllers have to be able to reject the “disturbance” introduced by the other loops. On the contrary, if the interactions are low, the controllers can be tuned independently.

The main periods related to the influent flow were determined (Fig. 5) through spectral decomposition of the each of the influent variables and then principal component analysis (Thornhill, Horch 2007). The results showed that the most important variations take place with periods of 8 h, 12 h and 24 h that correspond to daily metabolism of the city mainly the morning and evening cycle in a day with around 8 h and 12 h periods and day to day variation, which follows 24 h periods. These periodic variations correspond to varying activities of human water consumption, which results in varying influent load and disturbances to the plant.

vii) Closed-loop design. The information gathered in the previous steps is used for design or improvement of the controller. Two criteria are retained in particular: the ability to reject disturbances and interactions from other loops. viii) Evaluation. The last step of the methodology consists on the evaluation of the proposed tuning and its assessment with the suitable key performance indicators (KPI). The evaluation can be carried out through a model-based simulation and, ultimately, with the implementation of the designed tuning in the plant.

0.02

Energy (dB)

0.015

These steps are demonstrated with the case study of the BSM1 described previously.

0.01

0.005

4. PROCESS REVIEW 0 0

4.1 Screening of disturbances Of the 11 states present at the inflow, only some of them are expected to significantly upset the process. In a previous publication, we have identified the most significant influent variables that affect the controlled variables and/or plant operation objectives (Sin et al. 2011). The following variables were found the most significant: readily biodegradable substrate (SS), particulate inert organic matter (XI), slowly biodegradable substrate (XS), total ammonium nitrogen (SNH), total suspended solids (TSS) and flowrate (Q). Henceforth, our analysis will be restricted to these variables.

30

40

4.3 Variable scaling

4

The controlled variables were scaled so that the largest tolerable offset in any controlled variable (considered as ±5%) has magnitude ±1. The selection of the acceptable offset depends indeed of expert knowledge or how the control structure is related to the performance objectives. The manipulated variables were scaled between their maximum and minimum value and the disturbances were scaled between their maximum and minimum input value considering together the three influent flow patterns (dry weather, rainfall and storm). The corresponding scaling factors used are shown in table 1.

2

Table 1. Scaling factors used for modelled variables

The wastewater influent profiles used are defined in the BSM1 for dry and storm weather (Fig. 4). 4

x 10 6

Flow (L/d)

20

Period (h)

Fig. 5. Principal component analysis of the spectral decomposition of the six disturbances considered in the influent. The abscissa axis shows the inverse of the frequency in order to indicate the main variation periods.

4.2 Influent characterization

0

Dry Weather

0

2

4

6

8

10

12

14

Time (days) 4

x 10 6

Flow (L/d)

10

Storm Weather

4 2 0

0

2

4

6

8

10

12

14

Time (days)

Fig. 4. Influent flow profile for dry weather and storm weather (BSM1). The variation pattern show diurnal effects with 8h, 12h and 24h periods as revealed by spectral decomposition (see Fig 5). 830

Var. Value

SI (g COD m-3) 30

SS (g COD m-3) 65.2

XI (g COD m-3) 45.6

Var. Value

XS (g COD m-3) 193

XBH (g COD m-3) 26.5

SNH (g N m-3) 30.1

Var. Value

SND (g N m-3) 6.5

XND (g N m-3) 10

SALK (mol m-3) 7

Var. Value

TSS (g COD m-3) 199

Q (m3 d-1) 18446

Var. Value

DO3 (g O m-3) 0.1

DO4 (g O m-3) 0.1

DO5 (g O m-3) 0.1

Var. Value

kLa3 (d-1) 360

kLa4 (d-1) 360

kLa5 (d-1) 360

8th IFAC Symposium on Advanced Control of Chemical Processes Singapore, July 10-13, 2012

4.4 Plant linearization

RGA fails to predict one-way interactions, as those taking place in units in series. To overcome such failure, the performance RGA (PRGA) has been used (fig. 8)

The plant was linearized using the linear analysis tool of Simulink. Prior to the linearization, the plant was simulated using the benchmark simulation protocol: first the plant is simulated with constant dry weather influent load for 150 days in order to reach steady state, and then followed by simulations using 14 days of dynamic influent load. In order to analyse the impact of the operating point, two operating points were selected for linearisation: a peak flow (14 days + 11h) and a valley flow (14 days + 28 h). It was found that both the CLDG and RGA gave almost the same results for the two operating points. For simplicity, only the valley flow operating point will be considered hereafter.



Magnitude

1

10

11



12

0

10



13

-1

10 -2 10

-1

10

0

10

1

10

Frequency (rad/day)

21

Magnitude

1

10

22

0

10

23

-1

10 -2 10

2

10

-1

10

0

10

1

10

2

10

Frequency (rad/day)

5. OPEN LOOP ASSESSMENT

31

Magnitude

1

5.1 Analysis of disturbance effect The closed loop disturbance gain (CLDG) plots were used to determine the effect of disturbances on the controlled variables (fig 6). The CLDG elements show whether controller action is needed to avoid a deviation higher than the maximum deviation allowed (here set as ±5% through variable scaling). Only the results corresponding to the total ammonium nitrogen and the flowrate are shown (fig 3a and 3b) since in the rest of cases, the CLDG elements were below 1 over the whole frequency range.

10

32

0

10



33

-1

10 -2 10

-1

10

0

10

1

10

2

10

Frequency (rad/day)

Fig. 8. Performance RGA for the three control loops. ij denotes the effect of manipulated variable j on controlled variable i. Loop interactions take place between the loops placed downstream (tank 4 respect to tank 3 and tank 5 respect to the other two). However, the ij elements are reasonably lower than the paired (ii) elements and lower than 1. Thus, each of the loops is able to reject the “disturbances” introduced by the rest of them. Loop interaction is not considered an issue in this control configuration and operating point, and will not be taken into account on the controller tuning. 6. CLOSED LOOP DESIGN The previous analysis gives the necessary information to carry out the closed loop analysis and eventually, the proposal of the tuning parameters for the control loops. The open loop analysis led to the following conclusions: -Only ammonium and flowrate are important disturbances that have to be rejected in order to keep the controlled variables close to their setpoints. This is linked to the plant performance only if the controlled variables and the control structure are well related to the performance objectives. Otherwise, the control structure must be reviewed.

Fig. 6. CLDG plot for ammonium concentration (a) and flowrate (b) effect on controlled variables The CLDG plots show that the maximum effect of ammonium concentration takes place at around 1 rad/day (~14h period) whereas flowrate maximum appears at around 2 rad/day (~7h period). Those peaks are close to the region of frequency were the dry weather influent varies (8h, 12h and 24 h). Hence, control action will be needed to reject the offset introduced by those disturbances.

- The maximum effect of ammonium disturbances is related to 14h periods. For flow rate disturbances, the period is 7h. As the main modes of the influent flow are 24h, 12h and 8h, controller action is needed to reject the influent disturbances. -The interactions among the loops are negligible at the analysed points corresponding to dry weather flow conditions. Each control loop can be designed independently. Analysis of the plant response to disturbances and loop interactions under rain and storm events respectively can be investigated at different operation mode of the plant by repeating the systematic methodology demonstrated above.

5.2 Analysis of loop interaction For the analysis of the loop interaction, the frequency dependent RGA was determined for the three loops. At all frequencies the paired element (ii) is close to one whereas the other two elements are lower than 0.1 (results not shown). However, it has been reported (Hovd, Skogestad 1992) that 831

8th IFAC Symposium on Advanced Control of Chemical Processes Singapore, July 10-13, 2012

Magnitude

6.1 Analysis of tuning parameters In order to illustrate the method, closed loop analysis will be carried out with reported tuning parameters for this control structure (Vanrolleghem, Gillot 2002). In this configuration it is considered that the three loops are closed with PI controllers with the same settings (Kp = 0.0278; I = 0.01 days, setpoint = 2 mgO L-1).

Magnitude

Magnitude Magnitude

1

-1

10

0

10

Frequency (rad/day)

Magnitude

2

2

g22c2

0

10

-2

-1

10

10

0

10

Frequency (rad/day)

Magnitude

10

g c

33 3

-2

10

2

10



0

10

-2

10

2

g c

22 2

-1

10

0

1

10

10

2

10

3

0

10

-2

10

g c

33 3

-1

10

0

1

10

10

Table 2. Comparison of controller tuning performance on the error on the controlled variables (7 days simulation)

3 0

1

10

The efficacy of the controller action can be determined with the integral of absolute error (IAE) of the controlled variable and the variance of the manipulated variables (table 2).

1

10

2

10

0

10

The evaluation of the tuning proposed was carried out on seven days simulation with the dry weather influent and the storm weather influent. The proposed controller parameters (Kp = 0.0484; I = 5.4 10-3 days) were compared to a configuration (Kp = 0.0278; I = 0.01 days) previously reported (Vanrolleghem, Gillot 2002) .

1

10

10



-1

10

7. EVALUATION

11 1

-2

11 1

Fig 10. Comparison of the CLDG effect on each of the controlled variable (i) and the controller action (giici) for ammonium variations (Kp = 0.0484; I = 5.4 10-3 days)

g c

10

-2

10

Frequency (rad/day)

10

10

1

g c

Frequency (rad/day)

2

0



0

10

Frequency (rad/day)

To assess the disturbance rejection, the controller action (giici) is plotted and compared with the CLDG element (i). Ihe controller action is higher than the CLDG elements introduced by ammonium variations in the influent (results not shown). On the contrary, the controller action is lower than the CLDG elements at frequencies close to 2 rad/day for the flowrate in loops 4 and 5 (fig. 9). Hence, loops 4 and 5 should be tuned tighter in order to efficiently reject the flowrate disturbance. 

2

10

-1

10

0

10

Integral of absolute error (mgO2 d L-1) DO3 DO4 Dryweather influent Vanrolleghem(2002) 0.190 0.326 This work 0.032 0.104 Storm weather influent Vanrolleghem(2002) 0.193 0.313 This work 0.063 0.100 Variance of manipulated variable (d-1) kLa3 kLa4 Dryweather influent Vanrolleghem(2002) 10.5 12.0 This work 10.7 12.7 Storm weather influent Vanrolleghem(2002) 10.9 12.9 This work 10.7 12.9

1

10

Frequency (rad/day)

Fig 9. Comparison of the CLDG effect on each of the controlled variable (i) and the controller action (giici) for flowrate variation (Kp = 0.0278; I = 0.01 days) 6.2 Proposal of new tuning parameters In order to reject the disturbances introduced by the influent, giici has to be larger than i at the bandwidth of interest. To allow a better comparison with the tuning reported previously, let us keep the same structure (PI controllers) and let the tuning parameters be the same for the three loops. The new parameters are obtained according to the following minimisation: (2) s.t. |giici|>1.50 |i| for >B where MS is the peak of the sensitivity function and B is the desired bandwidth. Hence, tuning parameters could be found that ensured the rejection of the disturbances keeping the robustness of the controller (i.e. with minimal MS). The comparison between the new tuning parameters (Kp = 0.0484; I = 5.4 10-3 days) and the CLDG elements can be seen in fig. 10.

DO5 0.315 0.106 0.323 0.103 kLa5 4.34 4.34 4.15 4.25

As expected, the proposed tuning has a lower IAE for the three loops (by a factor of 3 approx.) since the increase in the proportional gain and the decrease in the integral time lead to a tighter control action. However, the tighter tuning did not lead to an increase of the variation in the aeration valves. In effect, the variances of the manipulated variables have similar 832

8th IFAC Symposium on Advanced Control of Chemical Processes Singapore, July 10-13, 2012

values given that the new parameters were obtained ensuring a low value of MS.

phenomenological modelling approach", Environmental Modelling and Software, vol. 26, no. 11, pp. 1255-1267.

Finally, the controllers were also compared in terms of performance of the plant. Three indices were selected since they are related to the control structure: ammonium level in the effluent, aeration energy and the overall cost index.

Guerrero, J., Guisasola, A., Vilanova, R. & Baeza, J.A. 2011, "Improving the performance of a WWTP control system by model-based setpoint optimisation", Environmental Modelling and Software, vol. 26, no. 4, pp. 492-497.

The performance of the plant to remove nitrogen was quantified as the percentage of time that the limit of ammonium in the effluent (4 gN m-3) was not violated. The aeration energy quantifies the total energy used by the three actuators in the period of evaluation. The overall cost index (OCI) is an index composed of the contributions of the aeration energy, pumping energy, sludge production, external carbon addition and mixing energy, therefore represent the operating cost of all the plant (Copp 2002)

Hovd, M. & Skogestad, S. 1992, "Simple frequencydependent tools for control system analysis, structure selection and design", Automatica, vol. 28, no. 5, pp. 989-996. Olsson, G. 2006, "Instrumentation, control and automation in the water industry - State-of-the-art and new challenges", Water Science and Technology, vol. 53, no. 4-5, pp. 1-16. Shen, W., Chen, X. & Corriou, J.P. 2008, "Application of model predictive control to the BSM1 benchmark of wastewater treatment process", Computers and Chemical Engineering, vol. 32, no. 12, pp. 2849-2856.

Table 3. Comparison of controller tuning performance for selected key performance indicators (7 days simulation) NH4 (%) Aeration OCI* (MWh) Dryweather influent Vanrolleghem(2002) 0.298 27.1 17130 This work 0 27.1 17052 Stormweather influent Vanrolleghem(2002) 2.09 27.1 17469 This work 1.63 27.1 17650

Sin, G., Gernaey, K.V., Neumann, M.B., van Loosdrecht, M.C.M. & Gujer, W. 2011, "Global sensitivity analysis in wastewater treatment plant model applications: Prioritizing sources of uncertainty", Water research, vol. 45, no. 2, pp. 639-651. Skogestad, S. & Hovd, M. 1990, "Use of frequencydependent RGA for control structure selection", Proceedings of the 1990 American Control ConferencePubl by American Automatic Control Council, Green Valley, AZ, United States, 23 May 1990 through 25 May 1990, pp. 2133.

*OCI. Overall cost index (defined in the text)

The results (table 3) show that the performance is also improved with the new tuning, since it allows decreasing significantly the percentage of time that the ammonium regulation was violated whereas it did not lead to a higher cost (OCI) or expense of aeration energy.

Tchobanoglous, G. & Burton, F. 1991, Metcalf and Eddy Wastewater Engineering. McGraw-Hill.

8. CONCLUSIONS

Thornhill, N.F. & Horch, A. 2007, "Advances and new directions in plant-wide disturbance detection and diagnosis", Control Engineering Practice, vol. 15, no. 10 SPEC. ISS., pp. 1196-1206.

A systematic methodology combining dynamic simulations, control engineering toolbox and process engineering insights were developed and successfully evaluated for efficient tuning of controllers in WWTP. In particular, it is emphasized to understand the nature of disturbances and use this insight for effectively tuning the control loops. The systematically tuned controllers showed superior performance as opposed to traditionally tuned controllers reported in literature. The methodology can be used for retrofitting/existing plant, but also it can guide the engineer when designing and commissioning new WWTPs.

Vanrolleghem, P.A. & Gillot, S. 2002, "Robustness and economic measures as control benchmark performance criteria", Water Science and Technology, vol. 45, no. 4/5, pp. 117-126. WSSTP 2006, Water Safe, Strong and Sustainable - a European Vision for Water Supply and Sanitation in 2030. In strategic research agenda report by the European Technology Platform for Water , Water Supply and Sanitation Technology Platform.

REFERENCES Copp, J.B. 2002, "The COST simulation benchmark: Description an simulator manual", Office for Official Publications of the European Community, Luxembourg., Flores-Alsina, X., Rodríguez-Roda, I., Sin, G. & Gernaey, K.V. 2008, "Multi-criteria evaluation of wastewater treatment plant control strategies under uncertainty", Water research, vol. 42, no. 17, pp. 4485-4497. Gernaey, K.V., Flores-Alsina, X., Rosen, C., Benedetti, L. & Jeppsson, U. 2011, "Dynamic influent pollutant disturbance scenario generation using a 833