ijcccv11n4.dvi INTERNATIONAL JOURNAL OF COMPUTERS COMMUNICATIONS & CONTROL ISSN 1841-9836, 11(4):522-537, August 2016. Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova J.D. Rojas, O. Arrieta Escuela de Ingeniería Eléctrica, Universidad de Costa Rica, San José, 11501-2060 Costa Rica. Tel: +506-2511-3892, fax: +506-2511-3920 {jdrojas, oarrieta}@eie.ucr.ac.cr M. Meneses, R. Vilanova* Departament de Telecomunicacióó i d’Enginyeria de Sistemes, Escola Tècnica Superior d’Enginyeria, ETSE, Universitat Autònoma de Barcelona, 08193 Bellaterra, Barcelona, Spain {montse.meneses, ramon.vilanova}@uab.cat *Corresponding author: ramon.vilanova@uab.cat Abstract: In the work presented in this paper, data-driven control is used to tune an Internal Model Control. Despite the fact that it may be contradictory to apply a model-free method to a model-based controller, this methodology has been success- fully applied to a Activated Sludge Process (ASP) based wastewater treatment. In addition a feedforward controller over the influent substrate concentration was also computed using the virtual reference feedback tuning and applied to the same wastew- ater process to see the effect over the dissolved oxygen and the substrate concentration at the effluent. Keywords: Activated sludge process, data-driven control, internal model control, wastewater treatment plants 1 Introduction Data-Driven Control is a rather new control approach that does not attempt to find the model of the plant to control, instead, it uses experimental data to directly find a controller, which, generally, is meant to minimize some control performance criterion. Some of the most remarkable methods within this control approach are the Iterative Feedback Tuning (IFT) [1, 2], the Windsurfer Approach [3, 4], the Correlation Approach [5, 6] and the Virtual Reference Feedback Tuning (VRFT) [7–9]. While the IFT and the Windsurfer Approach are iterative methods (that is, several experiments on the plant have to be performed in order to find the controller) the Correlation approach and the VRFT are one shot methods (only one set of data is needed to find the controller). IFT computes an unbiased gradient of a performance index to iteratively improve the tuning of the parameters of a reduced order discrete time controller, at each iteration three different experiments are performed on the system and based on this data, the gradient is computed; in the Windsurfer approach the objective is to find a better model for the plant (and subsequently a better controller) using closed-loop data and Internal Model Control (IMC) design [10] in such a way that, with every iteration, the closed loop bandwidth can be increased; Data-Driven control using the correlation approach is a one-shot methodology that attempts to find the values of a restricted order controller that tries to minimize the correlation between the closed-loop error of the system (based in a desired closed-loop behavior) and the reference for the process output, and the VRFT translates the model reference control problem into an identification problem, Copyright © 2006-2016 by CCC Publications Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 523 being the controller the transfer function to identify based on some "virtual signals" computed from a batch of data taken directly from an open-loop experiment. In this work, the VRFT approach is used and extended in order to be applied to a Wastewater Treatment Plant (WWTP). WWTP are an important case of study within the process control area, while an active research area that involves other disciplines as for example chemistry, biology, and instrumentation. Moreover, by it self, WWTPs have deep impact in the quality of live in big cities. That is why the constraint on the level of pollution of the treated water before discharging it into the receiving waters, is becoming more stringent [11] and because of that, a correct control and operation of WWTP is one of the top priorities for both, industry and academics. Among the types of WWTP, the Activated Sludge Process (ASP) is one of the most popular and more studied [12, 13]. This is also true from the automatic control perspective: for example in [14] a parameter and state non-linear estimator is used in an adaptive linearizing control of the dissolved oxygen and substrate concentration of an ASP but under the assumption that only the dissolved oxygen is available for measurement. In [15], several multivariable PI control method are applied to the ASP by linearizing the nonlinear model and the results are presented, as well as the combination of some of these methods. In [16], predictive control is used to maintain a low concentration of substrate at the output by controlling the dissolved oxygen using the dilution rate. The internal model of the predictive control is a three layer neural network. In [17] the control of the substrate concentration is achieve using an estimation based on the dissolved oxygen measurements, a dynamic controller that cope with the change in reference and a PID controller that corrects the steady state error produced by the use of a linearized model in the first controller. In [18] a decentralized PI approach is presented to show that simple well tuned PI controllers can achieve a similar performance than more complex methodologies for the ASP case. Some other strategies have been proposed recently such as in [19] where an I-P controller control system with pole-placement design is proposed. In all the cases, some sort of model (non-linear o linearized) is used to computed the controller. In several cases it is supposed that some parameters are known which may no be the case for a real plant. The contribution of this paper is to apply a data driven approach to the tuning of discrete- time restricted-order linear controller in a decentralized approach to have good performance for both reference tracking and disturbance rejection in an ASP based WWTP. Without explicitly computing a model of the process an Internal Model Control approach is used in conjunction with the VRFT methodology. Even more, the effect of the influent concentration disturbance is taken into account by computing a feedforward control using the VRFT as well. It was found that this methodology provide excellent results when compared with a PI approach. The rest of the paper is divided in two parts, in section 2, a short overview on VRFT is presented as well as the mentioned extensions for the IMC control. In section 3 the results of the application of this data-driven method is presented and compared with a two-degrees of freedom PI controller. The conclusion are presented in section 3. 2 Virtual reference feedback tuning extensions In this section, an overview on the VRFT is presented as well as some results that extend the capacity of the VRFT for different control strategies and structure of controllers is presented. 2.1 Virtual Reference Feedback Tunning overview The Virtual Reference Feedback Tuning (VRFT) is a one-shot data-based method for the design of feedback controllers. The original idea was presented in [7], and then formalized by 524 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova + - u(t) y(t) C(z; θ) P (z) r̄(t) Figure 1: The VRFT set up. The dashed lines represent the "virtual" part of the method Lecchini, Campi, Savaresi and Guardabassi (see [8, 9]). In [8], the method is presented for the tuning of a feedback controller. If a the con- troller belongs to the controller class {C (z;θ)} given by C(z;θ) = βT (z)θ, where β (z) = [β1 (z) · · ·βn (z)]T is a known vector of transfer functions, and θ = [θ1 θ2 · · ·θn]T is the vector of parameters, then the control objective is to minimize the model-reference criterion given by: JMR (θ) = ∥ ∥ ∥ ∥ ( P(z)C(z;θ) 1 + P(z)C(z;θ) −M(z) ) W(z) ∥ ∥ ∥ ∥ 2 2 (1) Starting from a batch of open-loop data {u(t),y(t)}, a "virtual" signal is computed in such a way that, if the closed-loop system is feed with this virtual signal and the controllers in the loop were the ideal controllers that would achieve a predefined target transfer function, then the input and output signals of the plant in closed-loop would be the same than the batch of open-loop data. The output of the controller should be equal to u(t) and then, this controller can be found by identifying the transfer function which yields the output u(t) when the input r̄(t) − y(t) is applied to the input as depicted in Fig. 1 The original VRFT algorithm, as presented by the authors in [8], is as follows: Given a set of measured I/O data {u(t),y(t)}t=1,...,N 1. Calculate: • a virtual reference r̄(t) such that y(t) = M(z)r̄(t), and • the corresponding tracking error e(t) = r̄ −y(t) 2. Filter the signals e(t) and u(t) with a suitable filter L(z): eL(t) = L(z)e(t) uL(t) = L(z)u(t) 3. Select the controller parameter vector, say, θ̂N , that minimizes the following criterion: JNV R (θ) = 1 N N ∑ t=1 (uL(t) −C(z;θ)eL(t))2 (2) If C(z;θ) = βT (z)θ, the criterion (2) can be given by JNV R (θ) = 1 N N ∑ t=1 ( uL(t)−ϕTL(t)θ )2 (3) with ϕL(t) = β(z)eL(t) and the parameter vector θ̂N is given by θ̂N = [ N ∑ t=1 ϕL(t)ϕL(t) T ]−1 N ∑ t=1 ϕL(t)uL(t) (4) Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 525 The authors, also showed that, the filter L(z) should be the one that approximates the criterion (2) to (1). This filter should be designed to accomplish the constraint: |L|2 = |1−M|2 |M| |W |2 1 Φu (5) where Φu is the spectral density of u(t). The VRFT framework have been used in several applications and even have been extended for the MIMO case and used for PID tuning, for example see [20–24]. 2.2 Internal model control using the virtual reference feedback framework Internal Model Control (IMC) is a popular control method that incorporates the model of the process into the controller [10]. The standard structure is depicted in Fig. 2. P(z) represents the Plant, while ¯P(z) is its model. Q(z) is the IMC controller. If the output of the model and the output of the plant are the same, and there is no disturbance, the control system behaves as if it was in open-loop. If this is the case, to have perfect tracking, Q(z) must try to cancel the dynamics of the plant. On the other hand, if there is a mismatch between the plant and its model or if a disturbance acts on the system, the feedback loop enters into play. This characteristics leads to the well know property that an IMC system would be nominally internally stable if Q(z) is stable, in case the model is equal to the plant. Of course, finding a perfect model is rarely achievable and if it were, Q(z) may not be possible to be equal to the inverse of this model due to physical limitations or because the inverse of the plant may lead to an unstable controller. In [10] a two-step design is proposed for this kind of controller: 1. Solve the nominal performance criterion given, for example, by min Q̄(z) ∥ ∥ ( 1 − P̄(z)Q̄(z) ) W(z) ∥ ∥ p (6) Where W is a filter chosen to give more importance in certain frequencies and ‖·‖p is a given norm that defines the performance criterion. The optimal solution to this problem yields to a sensitivity function given by S∗(z) = 1 − P̄(z)Q̄(z) and the complementary sensitivity function given by M∗(z) = P̄(z)Q̄(z), that is, the response to a change in the reference is as if it were in open loop, while the response to a disturbance is in closed-loop. Of course this response is not achievable and therefore, the model P̄(z) should be divided in an invertible and non-invertible part to be able to approximate the optimal controller. 2. To introduce robustness conditions, the complementary sensitivity has to be rolled off at high frequencies, therefore, it is necessary to add a low pass filter f(z) to the controller Q̄(z), to obtain the final controller Q(z) = Q̄(z)f(z). Suppose that the multiplicative uncertainty is bounded by a frequency dependent function l̄m(ω), ∣ ∣ ∣ ∣ P(eω)− P̄(eω) P̄(eω) ∣ ∣ ∣ ∣ ≤ l̄m(ω) Then the closed-loop system is robustly stable if and only if |f(eω)| < 1∣ ∣P̄(eω)Q̄(eω)l̄m(ω) ∣ ∣ ∀ω (7) 526 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova Figure 2: Standard Structure of the IMC. P̄ represents the plant model and Q is the IMC controller Figure 3: Disposition for the VRFT experiment using the IMC topology. The dashed line represents the virtual signals and components. The reasons why the IMC control has become very popular is because, finding the controller and the conditions for robust stability can be cast in a very simple form. Using the VRFT framework, this constraint are not really necessary, since the methodology does not need any modeling step. Interested reader on IMC control, can find more information on [10, 25]. It is possible to find an IMC controller using the VRFT framework without concerning about the modeling of the system. In Fig. 3, the experimental setup for the VRFT applied to the IMC topology is depicted. If the target complementary sensitivity function is given by M(z), then the virtual reference r̄(t) is computed as: r̄(t) = M−1(z)y(t) (8) If the ideal controller were in the loop, then one would have P̄(z) = P(z) and the input to the controller Q(z,θ) would be r̄(t) and its corresponding output would be u(t) in order to have y(t) as the output of the closed-loop system. From Fig 3, it can be found that the ideal controller would be given by Q0(z) = M(z)P(z) −1 P̄0(z) = M(z)Q0(z) −1 (9) P0(z) would be the ideal plant model that is derived from the ideal controller. This basic idea leads to the following optimization problem which gives the set of optimal parameters θ∗ (in a least square sense): min θ J(θ) = min θ N ∑ i=1 (u(i) −Q(z,θ)r̄(i))2 (10) Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 527 ����� Figure 4: Virtual Reference setup for feedforward plus IMC controller. Solid lines are for "real" components and signals while dashed lines are for "virtual" components and signals Once Q(z,θ∗) has been determined, it is easy to compute the approximation of the process model of the plant from (9): P̄(z,θ) = M(z)Q(z,θ)−1 (11) It is important to note that P̄(z,θ) is seen just as an “instrumental model”, that results from the determination of the optimal controller. In fact, it can be seen just as a part of the IMC controller that results from the optimization. Of course, if a robust check is performed with the obtained controller, this approximation of the plant can be used as if it were the nominal model. In that case, the controller and the nominal model would be found at once. The filter for robust operation presented in (7), is already included in the determination of Q(z,θ∗) given the desired M(z). 2.3 VRFT approach to feedforward control Sometimes, it is possible to measure disturbances that affect the process output. In those cases, it is desirable to use a feed-forward controller that acts before the effects of these distur- bances reach the output of the plant. In [26], the idea of using the VRFT controller was presented to be used in conjunction with a one-degree of freedom controller. The main difference is that it is assumed that the disturbance is available for measurement and is used in the optimization problem. In this paper this idea was implemented in conjunction with the VRFT-IMC controller. Suppose that the control system can be represented by the diagram in Fig. 4, where P1(z) and P2(z) represent the unknown dynamics of the plant from the input u(t) and the disturbance d(t) to the output y(t), respectively. These three signals are measured from an open-loop experiment. The idea of using the feedforward control plus the IMC controller is to cope with both measurable and non-measurable disturbances. Q(z), Pm(z) and Cf(z) are the controllers to be found. The “virtual” components and signals (which are presented with dashed lines in Fig. 4) are: • M(z), which is the target closed-loop dynamics from the reference signal to the output of the controlled system. • F(z), is the target closed-loop dynamics from the measured disturbance to the output. 528 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova • r̄v, is the virtual reference computed from the data obtained from an open loop experiment and the closed-loop target functions. • ȳd, is the ideal disturbed output in closed-loop, if the virtual reference is applied in the closed-loop and the ideal controllers are set in place. • d, is the measurable disturbance signal that it is suppose to be available in the open loop experiment. The virtual reference signal r̄v has to be computed according to the ideal relationships and the measured and virtual signals: ȳd = Mr̄v + Fd (12) If one is able to find the ideal controllers, then ȳd = y. Since this is exactly what is needed, the virtual signal is computed from (12) as: ȳd = y r̄v = M −1 (yd −Fd) (13) The transfer function of the controlled system is y = P1Q 1 + (P1 −Pm)Q r + (1 −PmQ)(P1Cf + P2) 1 + (P1 −Pm)Q d (14) Note in (14), that the input signals do not have a bar, denoting that these signals are not virtual, but actually are entering to the system. When comparing (12) and (14), one is able to find the ideal controllers that would, theoretically, drive the system to the desired dynamics (if the transfer functions of the plant were known): Qo = M P1 −M(P1 −Pm) Cfo = 1 P1 ( F(1 − (P1 −Pm)Q) 1 −PmQ −P2 ) (15) Once Q(z) and Cf (z) has been obtained by optimization, the best approximation of Pm(z) is Pm(z) = M(z)Q −1(z), just as in (9) where one expects that Pm(z) ≈ P1(z) since the virtual reference was computed to achieve this relationship. This optimization is found by following the paths in the diagram of Fig. 4 that lead from the measured and virtual inputs to the u(t) signal, it is straightforward to find that the cost function to optimize is given by: J(θ) = 1 N N−1 ∑ i=0 [u(i) − (Q(z,θ) r̄v(i) + Cf (z,θ) d(i))]2 (16) Solving this optimization problem, one is able to find directly the two controllers and the instrumental model, using only one batch of input-output data without any iterative scheme. 3 Application to an ASP based WWTP In this section a practical example of the IMC-VRFT method exposed above is presented. The plant considered in this paper is the WWTP given in [27]. It comprises an aerated tank Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 529 Table 1: Initial conditions Biomass X(0) = 217.79 mg/l Substrate S(0) = 41.23 mg/l Dissolved Oxygen DO(0) = 6.11 mg/l Recycled Biomass Xr(0) = 435.58 mg/l Influent Substrate Sin(0) = 200.00 mg/l Influent Dissolved Oxygen DOin(0)= 0.50 mg/l Table 2: Kinetic parameters β = 0.2 Kc = 2mg/l r = 0.6 Ks = 100mg/l α = 0.018 KDO = 0.5 Y = 0.65 DOs = 0.5mg/l µmax = 0.15 h −1 where microorganisms act on organic matter by biodegradation, and a settler where the solids are separated from the wastewater and a proportional part is then recycled to the aerator in order to maintain certain amount of biomass in the system. The layout is shown in Fig. 5. The component balance for the substrate, biomass, recycled biomass and dissolved oxygen provide the following set of non-linear differential equations: dX(t) dt = µ(t)X(t) −D(t)(1 + r)X(t) −rD(t)Xr(t) (17) dS(t) dt = −µ(t) Y X(t) −D(t)(1 + r)S(t) + D(t)Sin (18) dDO(t) dt = −Koµ(t) Y X(t) −D(t)(1 + r)DO(t) + KLa(DOs −DO(t)) + DO(t)DOin (19) dXr(t) dt = D(t)(1 + r)X(t) −D(t)(β + r)Xr(t) (20) µ(t) = µmax S(t) kS + S(t) DO(t) kDO + DO(t) (21) KLa = αW(t) (22) where X(t) - biomass, S(t) - substrate, DO(t) - dissolved oxygen, DOs - maximum dissolved oxygen, Xr(t) - recycled biomass, D(t) - dilution rate, W(t) - aeration rate, Sin and DOin - substrate and dissolved oxygen concentrations in the influent, Y - biomass yield factor, µ - biomass growth rate in a Monod like form [28], µmax - maximum specific growth rate, kS and kDO - saturation constants, KLa - oxygen mass transfer coefficient, α - oxygen transfer rate, Ko - model constant, r and β - ratio of recycled and waste flow to the influent. The influent concentrations are set to Sin = 200 mg/l and DOin = 0.5 mg/l. The control strategy is a decentralized control as in [18] where the multivariable process is treated as two separate single variable process. The strategy is depicted in Fig.6. With respect to the control problem definition, it is considered that the dissolved oxygen, DO(t), and substrate, S(t), are the controlled outputs of the plant, whereas the dilution rate, D(t), and aeration rate W(t) are the two manipulated variables. The control of DO provides a method to maintain the necessary amount of biomass in the system while controlling S gives a way to keep the pollution 530 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova �������� �� ���� ����� ������ ����� ������� ����� ��������� ����� ������ ��� ������ Figure 5: Wastewater Treatment Process ���������� ���������� ���������� �� ��� Figure 6: Control Strategy for the WWTP at the effluent in an acceptable level [14]. The initial conditions and kinetic parameters are taken as in [18, 27] and presented in Table1 and 2. The settings of the VRFT controller are as follows: For both control loops, the sampling time was selected as Ts = 0.5min, the IMC controller Q(z) has the following parameterization: Q(z) = α1 + α2z −1 + α3z −2 β1 + β2z−1 + β3z−2 (23) the target transfer function for the DO loop is: MDO(z) = 0.02357z−1 1 −0.9764z−1 (24) which represents a first order transfer function with a constant time of approximately 20min. For the S loop (controlled by manipulating D(t)), the target closed-loop dynamics is a first order transfer function with a constant time of approximately 40min given by: MS(z) = 0.01382z−1 1−0.9862z−1 (25) The input-output data was selected as an additive random signal of 0 mean and variance 90 for the W(t) and variance 7.5e-4 for the D(t) around the operation points given in Table 1. The resulting controllers were found as: QDO(z) = 40.69 −19.35z−1 −19.65z−2 1−0.4683z−1 −0.4792z−2 QS(z) = 0.01236 −0.006155z−1 −0.006158z−2 1−0.4863z−1 −0.4924z−2 (26) Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 531 The IMCFF-VRFT version was also implemented, considering the influent substrate concen- tration Sin as the measurable disturbance. The Q controller has the same parameterization as in (23). For the feedforward controller, the parameterization is: Cf (z) = γ0 + γ1z −1 1−σ1z−1 (27) The sampling time is the same as for the Q controllers, and the desired target transfer function is F(z) = 0, which is normally what is desired with the feedforward control. The experimental data was slightly changed, because the dynamics from the disturbance to the output are slower: the data changes slowly and it was taken into account that a portion of the output data were affected only by the input, while another portion is affected only by the disturbance and, finally, another portion is affected by both. This is helpful to identify correctly both controllers at the same time. The resulting controllers are: QDO(z) = 40.57 −80.37z−1 + 39.8z−2 1 −1.974z−1 + 0.9739z−2 CfDO(z) = −0.0002002 + 0.001138z−1 1−0.9976z−1 QS(z) = 0.01233 −0.02416z−1 + 0.01183z−2 1 −1.947z−1 + 0.9479z−2 CfS(z) = −0.0006154 + 0.0004481z−1 1 −0.7261z−1 (28) The results of this controllers are compared to the two-degrees of freedom, continuous time PI controller of [18]. Two different test were performed: a change in the references and a disturbance on the influent substrate Sin where it is considered that every 24h, an increase of 10% of the value of Sin during 1h takes place. For the change in reference (Sref(t) for the substrate concentration reference and DOref(t) for the dissolved oxygen reference), the result is as given in Fig. 7 and 8. A step change of 10mg/l is applied to Sref(t) at time t = 10h while a step change of -2mg/l in DOref(t) is applied at time t = 100h. The effect of one loop change in the other loop, due to the process interaction, can be observed as well. In both cases the IMC-VRFT and the IMCFF-VRFT controller achieves a better performance for both the reference tracking as well as the disturbance rejection when the other loop changes. In Table 3 the values of the integral of the squared errors (ISE) and the Total Variation (TV), which measures the aggressiveness of the control effort, are presented. ISE and TV are computed as: ISE = ∫ t 0 e(t)2 dt TV = N ∑ i=1 |u(i) −u(i−1)| (29) e(t) is the error signal (the reference minus the measured output), and u(i) is the output of the controlled sampled every hour and N is the total number of samples. In the column “Reference Tracking” it can be seen that for the S loop with the application of the IMC-VRFT controller the ISE is greatly reduced (near the 57%) but with almost the same TV. The DO loop is improved in both ISE and TV, as can be also seen in Fig. 7 and 8, the section that is zoomed details the change in the DO, it is clear that the response of the PI controller is much worse than the 532 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova 0 50 100 150 40 42 44 46 48 50 52 54 time (s) S u b s tr a te c o n c e n tr a ti o n ( m g /l ) Change in Reference, S Reference PID IMC−VRFT IMCFF−VRFT Figure 7: Step change in the S reference at time t = 10h Table 3: Comparison of the results between the IMC-VRFT, IMCFF-VRFT and the PID control Reference tracking Disturbance rejection S DO S DO ISE PI 77.23 2.94 12.05 0.0021 IMC-VRFT 32.85 0.64 5.56 6e-005 IMCFF-VRFT 33.25 0.65 0.15 0.0083 TV PI 0.091 89.10 0.15 7.02 IMC-VRFT 0.083 67.33 0.15 4.69 IMCFF-VRFT 0.082 65.01 0.16 13.07 response of the IMC-VRFT, which almost has no overshoot. In Fig. 9, the plot of the control signals is presented for both the dilution rate and the air flow rate. As it was expected, the performance of the IMC-VRFT and the IMCFF-VRFT are similar for the reference tracking since no disturbance is present for this simulation, despite the fact that the controllers were found using different optimization methods (in the case of the IMC-VRFT a simple linear least square problem can be casted, while for the IMCFF-VRFT, the output error (OE) method was applied [29]). For the disturbance in the substrate concentration of the influent, the responses are presented in Fig. 10, Fig. 11 and Fig. 12. PI control is faster to control the disturbance Fig. 10, but the overshoot is larger. The IMCFF-VRFT controller performs much better than the IMC-VRFT controller (the ISE is 97% lower) with almost the same TV. The response of the DO is greatly improved with a reduction of almost 97% of ISE for IMC-VRFT, but the IMCFF-VRFT performs much worse than the PI controller (the ISE is almost 4 times bigger with a TV 2 times grater). It is clear that a feedforward strategy is not adecuate for the DO loop, since the effect of the change in Sin is much slower than the effect of the aireation. Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 533 � �� ��� ��� ��� � ��� � ��� � ��� � �� �� � � � � �� � � �� � � � � � �� � � � � � �� � � � � � � �� � ������� �� �!������"��� �!������ #$� $%�&' () $%�((&' () *� *� *+ ��� ��, ��� ��� ��+ ��� ��, ��- ��+ ��* � ��� ��, ��� ��� ��� � �� �� � � � � �� � � �� � � � � � �� � � � � � �� � � � � � � �� � ������� �� �!������"��� �!������ #$� $%�&' () $%�((&' () Figure 8: Step change in the DO reference at time t = 100h 0 50 100 150 0.05 0.1 0.15 0.2 0.25 time (s) D il lu ti o n R a te ( h − 1 ) Dilution Rate PID IMC−VRFT IMCFF−VRFT 0 50 100 150 0 50 100 150 time (s) A ir F lo w R a te ( m 3 h − 1 ) Air Flow Rate PID IMC−VRFT IMCFF−VRFT Figure 9: Control effort during the change in the reference 534 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova 0 50 100 150 40.6 40.8 41 41.2 41.4 41.6 41.8 42 42.2 42.4 time (s) S u b s tr a te c o n c e n tr a ti o n ( m g /l ) Disturbance Rejection, S Reference PID IMC−VRFT IMCFF−VRFT Figure 10: Effect over the substrate concentration when the substrate input is disturbed 0 50 100 150 6.1 6.105 6.11 6.115 6.12 6.125 6.13 6.135 6.14 6.145 time (s) D is s o lv e d O x y g e n c o n c e n tr a ti o n ( m g /l ) Disturbance Rejection, DO Reference PID IMC−VRFT IMCFF−VRFT Figure 11: Effect over the dissolved oxygen when the substrate input is disturbed Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 535 0 50 100 150 0.08 0.09 0.1 time (s) D il lu ti o n R a te ( h − 1 ) Dilution Rate PID IMC−VRFT IMCFF−VRFT 0 50 100 150 89 89.5 90 90.5 91 time (s) A ir F lo w R a te ( m 3 h − 1 ) Air Flow Rate PID IMC−VRFT IMCFF−VRFT Figure 12: Control effort during the disturbance in the substrate concentration of the influent Conclusions In this paper, the VRFT method has been studied and was applied within the IMC frame- work. Also, a feedforward extension to the IMC-VRFT controller was also presented. Both methodologies were successfully applied to a WWTP process, substantially improving the re- sults of a continuous time two-degrees of freedom PI controller using a restricted order discrete time controller in the case of the reference tracking. For the disturbance rejection, the feedfor- ward controller greatly improved the performance for the substrate loop but for the dissolved oxygen loop, it was found that the feedforward component degrades the performance. The dif- ference in the constant time and the little effect that has the influent substrate concentration over the dissolved oxygen may be the reason of this poor performance. Data-driven control is a powerful tool that can be easily applied to several control problems and that can be extended to several control structures. How to chose the closed-loop target functions without any knowledge of the plant (only data) and how to guarantee stability and robustness when the controller is found, are subject that still need further research in this control area. Acknowledgment The financial support from the University of Costa Rica, under the grants 322-B4-218 and 731-B4-213, is greatly appreciated. Also, this work has received financial support from the Ministerio de Economia e Innovacion of Spain under project DPI2013-47825-C3-1-R. Bibliography [1] H. Hjalmarsson, M. Gevers, S. Gunnarsson, O. Lequin (1998), Iterative feedback tuning: theory and applications, Control Systems Magazine, IEEE, DOI: 10.1109/37.710876, 18(4): 26–41. 536 J.D. Rojas, O. Arreta, M. Meneses, R. Vilanova [2] M. Gevers (2002), A decade of progress in iterative process control design: from theory to practice, Journal of Process Control, DOI: 10.1016/S0959-1524(01)00018-X, 12(4): 519-531. [3] W. S. Lee, B. D. O. Anderson, I. M. Y. Mareels, R. L. Kosut (1995), On some key issues in the Windsurfer approach to adaptive robust control, Automatica, DOI: 10.1016/0005- 1098(95)00092-B, 31(11): 1619–1636. [4] B. Anderson (2002), Windsurfing Approach to Iterative Control Design, in: A. P., S. P. A. (Eds.), Iterative Identification and Control: Advances in Theory and Applications, Springer Verlag, 142-166. [5] A. Karimi, L. Miskovic, D. Bonvin (2003), Iterative correlation-based controller tuning with application to a magnetic suspension system, Control Engineering Practice, DOI: 10.1016/S0967-0661(02)00191-0, 11(9): 1069 - 1078. [6] A. Karimi, K. van Heusden, D. Bonvin (2007), Noniterative Data-driven Controller Tuning using the Correlation Approach, in: European Control Conference, Kos Island, Greece. [7] G. Guardabassi, S. Savaresi (2000), Virtual reference direct design method: an off-line approach to data-based control system design, Automatic Control, IEEE Transactions on, DOI: 10.1109/9.855559, 45(5): 954–959. [8] M. C. Campi, A. Lecchini, S. M. Savaresi (2002), Virtual reference feedback tuning: a direct method for the design of feedback controllers, Automatica, DOI: 10.1016/S0005- 1098(02)00032-8, 38(8): 1337-1346. [9] A. Lecchini, M. Campi, S. Savaressi (2002), Virtual reference feedback tuning for two degree of freedom controllers, International Journal of Adaptative control and Signal Processing, DOI: 10.1002/acs.711, 16(5):355–371. [10] M. Morari, E. Zafirou (1989), Robust Process Control, Prentice-Hall International. [11] U. Jeppsson (1996), Modelling aspects of wastewater treatment processes, Ph.D. thesis, Department of Industrial Electrical Engineering and Automation (IEA) Lund Institute of Technology (LTH), http://www.iea.lth.se/ ielulf/publications/phd-thesis/PhD-thesis.pdf [12] M. Henze, P. Harremoës, E. Arvin, J. la Cour Jansen (1997), Wastewater Treatment, Bio- logical and Chemical Process, 2nd Edition, Enviromental Engineering, Springer Verlag, New York, USA., series Editors: Förstner, U. and Murphy, Robert J. and Rulkens, W.H. [13] M. Henze, W. Gujer, T. Mino, M. van Loosdrecht (2002), Activated Sludge Models ASM1, ASM2, ASM2d and ASM3, 1st Edition, Scientific and Technical Report, IWA Publishing, London, UK, 2002. [14] F. Nejjari, B. Dahhou, A. Benhammou, G. Roux (1999), Non-linear multivariable adap- tive control of an activated sludge wastewater treatment process, International Journal of Adaptive Control and Signal Processing, 13 (5): 347–365. [15] N. A. Wahab, R. Katebi, J. Balderud (2006), Multivariable pid tuning of activated sludge processes, Proc. of the International Control Conference (ICC2006), 2006. [16] S. Caraman, M. Sbarciog, M. Barbu (2007), Predictive control of a wastewater treatment process, International Journal of Computers Communications & Control 2(2): 132–142. Data-driven Control of the Activated Sludge Process: IMC plus Feedforward Approach 537 [17] F. Koumboulis, N. Kouvakas, R. King, A. Stathaki (2008), Two-stage robust control of substrate concentration for an activated sludge process, ISA Transactions, 47(3): 267- 278. [18] R. Vilanova, R. Katebi, V. Alfaro (2009); Multi-loop PI-based control strategies for the Acti- vated Sludge Process, Emerging Technologies and Factory Automation, IEEE International Conference on, 2009. [19] A. D. Kotzapetros, P. A. Paraskevas, A. S. Stasinakis (2015), Design of a modern automatic control system for the activated sludge process in wastewater treatment, Chinese Journal of Chemical Engineering, 23(8): 1340-1349. [20] M. Nakamoto (2004), An application of the virtual reference feedback tuning for a MIMO process, SICE 2004 Annual Conference, Sapporo, Japan, 3: 2208-2213. [21] F. Previdi, T. Schauer, S. Savaresi, K. Hunt (2004), Data-driven control design for neuro- protheses: a virtual reference feedback tuning (VRFT) approach, Control Systems Technol- ogy, IEEE Transactions on, DOI: 10.1109/TCST.2003.821967, 12(1): 176–182. [22] F. Previdi, M. Ferrarin, S. M. Savaresi, S. Bittanti (2005), Closed-loop control of FES supported standing up and sitting down using Virtual Reference Feedback Tuning, Control Engineering Practice, DOI: 10.1016/j.conengprac.2004.10.007, 13(9): 1173 -1182. [23] A. Sala, A. Esparza (2005), Extensions to virtual reference feedback tuning: A direct method for the design of feedback, controllers, Automatica, DOI: 10.1016/j.automatica.2005.02.008, 41(8): 1473 - 1476. [24] Y. Kansha, Y. Hashimoto, M.-S. Chiu (2008), New results on VRFT design of PID controller, Chemical Engineering Research and Design, DOI: 10.1016/j.cherd.2008.02.018, 86(8):925 - 931. [25] D. E. Rivera, M. Morari, S. Skogestad (1986), Internal model control: PID con- troller design, Industrial & Engineering Chemistry Process Design and Development, DOI: 10.1021/i200032a041, 25(1): 252-265. [26] G. Guardabassi, S. Savaresi (1997), Data-based simultaneous design of composite feedback- feedforward controllers: a virtual input direct design approach, 4th European Control Con- ference (ECC97), Brussels, Belgium, 1997. [27] F. Nejjari, G. Roux, B. Dahhou, A. Benhammou (1999), Estimation and optimal control design of a biological wastewater treatment process, Mathematics and Computers in Simu- lation, DOI: 10.1016/S0378-4754(98)00158-X, 48(3): 269 - 280. [28] J. Monod (1949), The growth of bacterial cultures, Annual Review of Microbiology, 3(1): 371–394. [29] L. Ljung (1999), System Identification, Theory for the User, 2nd Edition, Prentice Hall, 1999.