You are on page 1of 7

Predictive Controller Applied to a pH Neutralization Process

1.
Process Estofanero Estofanero L., L., Edwin Edwin R.*. R.*.  Estofanero L., Edwin R.*.
* * Electrical Electrical Engineering Engineering São Paulo, Department, Department, Brazil,
Escola Escola (e-mail: Politécnica Politécnica estofanero@usp.br) Garcia, Garcia, Garcia,
Claudio** Claudio** Claudio** of of the the University University of of São São Paulo, Paulo, **
Electrical Engineering Department, Escola Politécnica of the University of São Paulo, São Paulo,
Brazil, (e-mail:clgarcia@lac.usp.br)

Abstract: This paper reports the experimental results of a predictive controller applied to a pH neutraliza-
tion plant. A pretest was used to get an approximate transfer function (first order plus dead time) to tune
a PI controller, in order to collect data in closed-loop. The process was then identified in closed-loop with
the PI controller to get linear models and the best models were chosen to implement the predictive
controller. the Keywords: controller. © 2019, PI controller IFAC The The Predictive (International
performance performance to get Control, linear Federation of of System the the models predictive
predictive Identification, of and Automatic the and and best the the Control) PI PI pH models controllers
controllers Neutralization Hosting were was was chosen by Elsevier compared. compared. Process.
to implement Ltd. All rights the reserved.
predictive
Keywords: Predictive Control, System 1 1 . . INTRODUCTION
INTRODUCTION
Identification, 

pH Neutralization Process.
Model Model nowadays Predictive Predictive it is used Control Control to (MPC) (MPC) control was was
distinct created created plants in in the the (Cutler 1970s 1970s and and & Ramaker, 1980; Sha'aban et
al., 2018) The Dynamic Matrix Control (DMC) has been used in several industrial plants (Richalet et al.,
1978; Camacho & Bordons, 2000). It works with a linear model of the process, given by a step response
convolution model.
To design the linear predictive controller, it is necessary the process model to predict the future outputs
of the plant and then compare them with the desired values. For this, System Identification plays an
important role to obtain a mathematical model of the process and with this implement the predictive
controller. It is important to estimate the best process model so that the controller can perform future
predictions of the plant output (Clarke et al., 1987a; Camacho & Bordons, 2000). MPC should have best
performance when the model of the process is near to the features of the process to be controlled.
In this work, the MPC controller was used to keep the pH=7.0 of a neutralization process. The control of
pH in Continuous Stirred Tank Reactors (CSTRs) is studied in the literature (McAvoy et al., 1972;
Buchholt & Kümmel, 1979; Gustafsson, 1985; Wright et al., 1991; Gustafss on et al., 1995; Gomez et al.,
2004; Hermansson & Syafiie, 2015; Alkamil et al., 2018; Sha'aban et al., 2018). This process model is
validated in the range between 6.5 and 7.5.
In Section 2 the predictive controller is presented. In Section 3 the pH neutralization pilot plant is
described. In Section 4 are shown the results from the input and output dataset and finally, in Section 5,
the conclusions are drawn.
2 . PREDICTIVE CONTROLLER
To implement the predictive controller, a linear model of the process was obtained using system
identification techniques.
2.1 System Identification
System identification gets a model of a process from experi- mental data (Zhu, 2001), that are obtained
by measuring the
system ou present th ce model. are chosen is used:
where yy(ff the i-th va i-th value denotes th following inputs); A eXogenou
A predict process m to be appl prediction the desire error, the the input o predictive is applied procedure
Morari, 1 2002). Fi controller
Copyright © 2019 IFAC 202
system ou present th
ion 4 are d finally,

el of the niques. experi- uring the


2002). Fig. 1 shows the block diagram of a predictive controller.
Fig. 1. Predictive Control Structure.
2405-8963 © 2019, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. Peer review under
responsibility of International Federation of Automatic Control. 10.1016/j.ifacol.2019.06.062
Available online at www.sciencedirect.com

ScienceDirect
IFAC PapersOnLine 52-1 (2019) 202–206

970s and utler & ic Matrix al plants It works response
ssary the lant and , System ematical e model model the the redictive 0). 0). process MPC MPC plant
plant so so
e pH=7.0 ntinuous literature stafsson, omez et al., 2018; ed in the
Section 3 ion 4 are d finally,
202
system output yy(tt) and the input uu(tt). The structures to re- present the linear models consider a
process and a disturban- ce model. Depending on the model structure, the polynomials are chosen
(Ljung, 1999). To compare the models, the fit index is used:
‖yy(ff) − yŷ(ff)‖
fffftt = (1 − ‖yy(ff) − yy̅(ff))‖
) ∗ 100 (1)

where yy(ff) is a vector with the real output of the system for the i-th value, yŷ(ff) is a vector with the
output identified for the i-th value, yy̅(ff) is the average of the system output, and ‖.‖ denotes the
Euclidean norm. In this work were used the following structures: ARX (AutoRegressive with eXternal
inputs); eXogenous eXogenous ARMAX inputs), inputs), (AutoRegressive OE OE (Output (Output Error)
Error) Moving and and BJ BJ (Box (Box Average Jenkins). Jenkins).
with
2.2 2.2 Predictive Predictive Control Control A predictive controller has two parts: the optimizer and the
process model. The optimizer estimates the best control signal to be applied to the system. The process
model estimates the prediction of the output. The predicted output is compared to the desired process
reference to find the predicted error. This error, the function cost and the constraints of the process are
the input of the optimizer block and it estimates a vector of the predictive control signals. Only the first
element of the vector is applied to the system. At the next sampling time, the whole procedure is
repeated (Cutler & Ramaker, 1980, Garcia & Morari, 1982; Camacho & Bordons, 2000; Maciejowski,
2002). Fig. 1 shows the block diagram of a predictive controller.
L. Estofanero et al. / IFAC PapersOnLine 52-1 (2019) 202–206 203
The objective of the MPC algorithm is to calculate the control actions, represented by increments in the
manipulated variables, by minimizing the objective function given in (2).

JJ NNyy = ∑λλyy[yŷ(tt + jj|tt) − ww(tt + jj)]2 jj=1+ ∑λλuu[∆uu(tt + jj − 1)]2


(2) NNuu
jj=1 where NNyy is the prediction horizon of the output, NNuu is the control horizon, where it is advisable to
select (NNuu ≤ NNyy), λλyy and λλuu are the output weight and control signal output, res- pectively, yŷ (tt +
jj│tt) is the predicted output at time (tt + jj) using the available information until time tt, ww(tt + jj) is the
reference signal at time (tt + jj) and Δuu(tt + jj) is the increment of the control signal at time (tt + jj).
3 . pH NEUTRALIZATION PILOT PLANT
*The pH neutralization pilot plant considered in this work is shown in Fig. 2. It involves the mixture of acid
(HHHHHH) and basic (NNNNNNHH) solutions inside a reactor tank. A strong acid solution (HHHHHH)
with a molar concentration of 0.0056 mol/L and a strong base solution (NNNNNNHH) with a molar
concentration of 0.0186 mol/L were used. The flow rate of the acid solution is kept at 50 L/h, the
manipulated variable is the basic solution flow rate and the controlled variable is the pH.
Fig. 2. The pH neutralization pilot plant.
There are two controllers operating: one for the level control and the other for the pH control. The volume
(V) of the tank is kept constant, since the level of the tank is maintained at 75% of the height of the tank
by a level controller. A piston pump regulates the basic solution flow rate.
4 . TESTS AND RESULTS
The pH neutralization pilot plant is installed in the Industrial Process Control Laboratory in the São Paulo
University. The control of this plant is performed by the DCS (Distributed Control System) of ABB (800xA
System). Through the OPC server of this system, the Simulink of Matlab can read and write the variables
to control the process. Fig. 4 shows the client-server network, the Connectivity Server that works as
interface between the Aspect Server and the DCS and finally, shows that the electric signals are
connected to the DCS.
Fig. 3 Network diagram for the pH neutralization plant.
4.1 PI Controller
The tuning of the PI controller used to control the pH in the neutralization reactor was carried out using
the Ziegler- Nichols method, as a first attempt. Then, the fine tuning of the PI controller was performed
experimentally. Fig. 4 shows the different proportional gains used to tune the PI controller.
Fig. 4 Tuning tests for the PI controller.
The parameters of the PI controller are shown in Table 1.
Table 1. Parameters of the PI controller.
2
Proportional gain KP
180 s/rep
Integral time TI
4.2 Pretests of the System
The objective is to obtain a preliminary model of the process in closed-loop, exciting the pH set point with
positive and negative steps (0.5 and 1 pH) starting with pH in 7.0. The set points go from 7.0 to 7.5; from
7.0 to 6.5; from 7.0 to 8.0 and from 7.0 to 6.0. The graphs of these tests are shown in Fig. 5 to 8, that
show the controlled and the manipulated variables.
203
204 L. Estofanero et al. / IFAC PapersOnLine 52-1 (2019) 202–206
Fig. 5. Input and output values with a step in the pH set point from 7.0 to 7.5.
Fig. 6. Input and output values with a step in the pH set point from 7.0 to 6.5.
Fig. 7. Input and output values with a step in the pH set point from 7.0 to 8.0.
Fig. 8. Input and output values with a step in the pH set point from 7.0 to 6.0.
With these four datasets, models of the type FOPDT (first order plus dead time) were identified, using
the command “procest” of Matlab. Table 2 shows the obtained models.
Table 2. Transfer functions of the FOPDT models.
0.16649ee
Step System From 7.0 to 7.5 GG1(ss) = 324.71ss −38.4ss
+1
0.14625ee
From 7.0 to 6.5 GG2(ss) = 831.05ss −19.0ss
+1
0.16321ee
From 7.0 to 8.0 GG3(ss) = 291.47ss −38.7ss
+1
0.15563ee
From 7.0 to 6.0 GG4(ss) = 761.05ss −40.0ss
+1
Based on these models, the duration of the experiment to collect data to identify the process model was
set to 8000 s and the sampling time was selected as 1 s.
4.3 System Identification with PRBS signal To collect the experimental data and to identify the discrete
models, a PRBS (Pseudo-Random Binary Signal) signal was used to excite the set point of the system in
closed-loop, considering a minimum bit time of 75 s and amplitude of ±0.5 pH. 8000 points were
collected and the first 4000 points were used to estimate the models and the remainder to validate them.
Fig. 9 shows the input and output data.
Fig. 9. Input and output data with PRBS signal.
The ARX model was tested with orders nnnn 1 to 7, nnnn 1 to 8 and nnnn 1 to 30. The ARMAX model
was tested with orders nnnn 1 to 7, nnnn 1 to 3, nnnn 1 to 8 and nnnn 1 to 3. The OE model was tested
with orders nnnn 1 to 5, nnnn 1 to 8 and nnnn 1 to 3. The BJ model was tested with orders nnnn 1 to 2,
nnnn 1 to 6, nnnn 1 to 2, nnnn 1 to 3 and nnnn 1 to 3. The best linear model of each of these structures
is shown in the following equations: ARX Model
= −1 −20.0004822zz −3−18
BB(zz) AA(zz) 1−0.89zz −0.10zz −0.042zz

−4 −5 (3)
+0.024zz +0.0270zz ARMAX Model
= −1 −2 −1 −2 −3 −4 −5
BB(zz) AA(zz) 0.0001736zz −0.0001723zz 1−1.245zz −1.072zz +1.024zz +1.152zz −0.8583zz

(4)
OE Model
= −1 −2 −3 −4 −1 −2 −3 −4 −5 −6
BB(zz) FF(zz) −0.013zz +0.041zz −0.042zz +0.014zz 1−2.12zz +0.88zz +0.49zz −0.46zz +0.53zz −0.32zz

(5)
BJ Model
204
L. Estofanero et al. / IFAC PapersOnLine 52-1 (2019) 202–206 205
= −10.0002402zz −2 −1 −3 −4−2
BB(zz) FF(zz) 1−1.00zz −1.24zz −0.66zz −0.00005889zz +0.77zz

−5 (6)
+0.22zz Of the four identified models, the best one was chosen using the cross-validation. Fig. 10
shows the cross-validation with the last 4000 collected data. Table 3 shows the fit index for these
models. The best fit was of the BJ structure.
Fig. 10. Cross-validation of the obtained models.
Table 3. Fit values of the obtained models.
Signal ARX ARMAX OE BJ
PRBS 39.73 47.99 51.10 54.81
4.4 MPC Controller Test
The MPC controller was implemented in Simulink of Matlab. Its sampling time was selected as 1.0 s. To
choose the prediction horizon, it was incremented from 10 to 300. Over 200, the performance of the
controller decreases and the error increases. Therefore, the best value for this parameter was 200. The
control horizon was tested with values from 1 to 10. Over 6, the performance of the MPC controller does
not get better and then the best value for this parameter was 5.
The constraints were set according to the limits of the process. For the manipulated variable, the
constraints are set for the base flow. For the controlled variable, the constraints are set from 0 to 14 pH.
The weights for the input and output were set by trial-and-error. The input weight was incremented from
0.001 to 1.0 and the best value found was 0.01. The output weight was incremented from 1 to 5 and the
best value was 3. The parameters of the MPC controller was configured by trial- and-error until it
outperformed the PI controller. Table 4 shows the parameters of the MPC controller.
Table 4. Parameters of the MPC controller.
MPC parameters Value
Sampling time 1 s
Prediction horizon 200
Control horizon 5
Minimum Input Constraint 0
Maximum Input Constraint 100
Minimum Rate Input Constraint -0.1
Maximum Rate Input Constraint 0.1
Minimum Output Constraint 0
MPC parameters Value
Sampling time 1 s
Maximum Output Constraint 14
Input Weight 0.01
Input rate Weight 0.1
Output Weight 3
Fig. 11 shows the comparison between the MPC and the PI controller for steps in the pH set point that
follow the next sequences: from 7.0 to 7.5, 7.5 to 7.0, 7.0 to 6.5 and 6.5 to 7.0 pH. The tests lasted 8000
seconds.
Fig. 11. Comparison between MPC and PI controllers.
In order to compare the performance of the two controllers, the ISE (Integrated Squared Error) index was
used. The equation to calculate it is:
IIIIII = ∫ tttt0 ff
[yy(ii) − yŷ(ii)]2dddd (7)
This index values are shown in Table 5.
Table 5. ISE index for the four steps.
Performed test ISE PI ISE MPC
Step from 7.0 to 7.5 38.2225 30.7579
Step from 7.0 to 6.5 34.1064 31.5541
Step from 7.0 to 8.0 86.8275 42.7291
Step from 7.0 to 6.0 183.8186 144.8345
Table 5 shows that the performance of the MPC controller is superior to the PI controller for all the steps.
5 . CONCLUSIONS
In this work, the predictive controller was implemented in Matlab Simulink. The best model identified that
represents the pH neutralization process was selected to implement the predictive controller and the
parameters of the MPC controller were defined by trial-and-error.
205
206 L. Estofanero et al. / IFAC PapersOnLine 52-1 (2019) 202–206
ontrol of pH neutralization processes: A review. Control
ngineering Practice. vol. 45, pp. 98-109. 2015. Holaza, J.,
Considering the ISE index, the performance of the aučo, M., Drgoňa, J., Oravec, J., Kvasnica, M., and Fikar,
predictive controller was better than the PI controller. . MPC-based reference governor control of a continuous
irred-tank reactor. Computer and Chemical Engineering.
ACKNOWLEDGEMENT ol. 150, n. 12, pp. 289-299. 2018. Ljung, L. System
This study was financed in part by the Coordenação deentification: Theory for the user. 2nd ed.
Aperfeiçoamento de Pessoal de Nível Superior - Brasi pper Saddle River, NJ. Prentice Hall. 1999. Maciejowski,
(CAPES) - Finance Code 001. J.M. Predictive control with constraints.
Englewood Cliffs, NJ. Prentice Hall. 2002.
REFERENCES cAvoy, T.J., Hsu, E. and Lowenthal, S.. Dynamics of pH
ontrolled stirred tank reactor. Ind. Eng. Chem. Process
Alkamil, E.H.K., Al-Dabooni, S., Abbas, A.K., Flori, R., and
ev., vol. 11, pp. 68-70. 1972. Richalet, J., Rault, A.,
Wunsch II, D.C. Learning from experience: An automatic
estud, J. and Papon, J.. Model Predict Heuristic Control.
pH neutralization system using hybrid fuzzy system and
pplications to Industrial Processes. Automatica. vol. 14,
neural network. Procedia Computer Science. vol. 140, pp.
p. 413-428. 1978. Sha'aban, Y.A., Tahir, F., Masding,
206-215. 2018. Buchholt, F. and Kümmel, M. Self-tuning
W., Mack, J., and Lennox, B. Control Improvement using
control of a pH- neutralization process. Automatica. vol.15,
PC: A case study of pH control for Brine Dechlorination.
n. 6, pp. 665- 671. 1979. Camacho, E.F. and Bordons, C.
EE Access. Vol. 6, pp. 13418-13428. 2018.
Model Predictive Control.
Zhu, Y.C. Multivariable System Identification for Process
Springer, Verlag. Londres. 2000. Clarke, D.W.,
Control, Elsevier Science Ltd, Oxford, 2001.
Mohtadi, C. and Tuffs, P.S. Generalized Predictive Control
Wright, R. A., Soroush, M., and Kravaris, C. Strong Acid
– Part I. The Basic Algorithm. Automatica, vol. 23, n. 4, pp.
Equivalent Control of pH Processes: An Experimental
137-148, 1987a. Cutler, C.R. and Ramaker, B.L. Dynamic
Study. Ind. Eng. Chem. Res., v. 30, n. 11, p. 2437–2444,
Matrix Control – A computed control algorithm. Proc.
1991.
Automatic Control Conf., San Francisco, CA, paper
WP5-B. 1980. Garcia, C.E. and Morari, M. Internal Model
Control. 2. Design Procedure for multivariable systems.
Ind. Eng. Chem. Res., vol. 24, pp. 472-484. 1982. Gomez,
J.C., Jutan, A., and Baeyens, E. Wiener model
identification and predictive control of a pH neutralisation
process. IEE Proceedings - Control Theory and
Applications. vol. 151, n. 3, pp. 329-338. 2004. Gustafsson,
T. K. An experimental study of a class of algorithms for
adaptive pH control. Chem. Engng Sci., v. 40, n. 5, p.
827–837, 1985. Gustafsson, T. K., Skrifvars, B.O.,
Sandström, K.V., and Waller, K.V. Modeling of pH for
control. Ind. Eng. Chem. Res. vol. 34, n. 3, p. 820-827,
1995. Hermansson, A.W. and Syafiie, S. Model Predictive
206

You might also like