You are on page 1of 6

Proceedings of the 18th World Congress

The International Federation of Automatic Control


Milano (Italy) August 28 - September 2, 2011

Identification and Control of pH using Optimal Piecewise Linear Wiener


Model

William Ipanaqué*. José Manrique*

*Piura University, PO Box 353 Piura Perú; e-mail: william.ipanaque@ udep.pe; jose.manrique.s@gmail.com

Abstract: Wiener models consist of a linear dynamic element followed by a static non linear element. This paper shows a
non linear model predictive control (NMPC) based on a piecewise linear; the Wiener model is applied on an experimental
control of pH. The static nonlinear element of the Wiener model is approximated using piecewise linear function.
Identification using optimal local linear model is applied and parameter estimation as well as partitioning of the local linear
models is simultaneously obtained. The techniques are then applied to an experimental control of pH and the performance
of NMPC is shown.
Keywords: Nonlinear model predictive control; Block-structured model; Wiener model, non linear identification, local
linear model.

mixing dynamic of the reagent streams in a stirred vessel


1. INTRODUCTION
and the nonlinear element representing a static nonlinear
Model Predictive Control (MPC) is one of the design titration curve which gives pH as a function of the chemical
techniques that can be proven to stabilize process in the species, Niemi and Julia (1977).
presence of nonlinearities, Quin and Badgwell (1998).
MPC allows to use the detailed knowledge of a process in Piecewise local linear models is a class of Wiener models,
the form of a dynamic model, as an aid to controlling that where the parameters of a linear transfer function are valid
process. Linear MPC used models which have been for all segments, while each gain and bias parameter is only
linearised about an operating point as an aid to predict the valid inside of one data segment e.g. Cervantes et al (2003),
responses of the controlled process. Shafiee et al (2006). Therefore, the non linear characteristic
Many processes are sufficiently nonlinear to preclude good is given by a piecewise linear function.
applications of linear MPC technology. Such processes, as
pH control, include highly non linear processes that operate The object of the identification is to estimate the non-linear
near a fixed operating point. This has led to development of characteristic and the parameters of the dynamic linear
non linear model predictive control (NMPC) in which a system. Some researchers propose separation of the
more accurate model is used for process prediction and identification of the linear subsystem, from the non-linear
optimization. characteristic, Wigren (1993) and Greblicki, W. (1992).
Some papers have reported controllers incorporating Other proposes for identification of linear subsystem and
nonlinear models such as neural networks, as Patic et al. non linear characteristic is obtained in one step, e. g. Gomez
(2010) and Saindonat (1998); Volterra series model, et al. (2004), Sung and Lee (2004).
Genceli and Nikolaou (1995). In this paper we report the application to pH module, of an
Wiener models are useful in representing the nonlinearities identification algorithm using optimal local linear models
of a process without complications associated with general based on Kosek (2008). This algorithm automatically
non linear operators. A Wiener nonlinear system is a chooses the number of models and develops an optimal
cascade of a linear dynamic system followed by a static non partitioning. Other approaches require a predefined number
linearity and is effective in representing a class of nonlinear of local models for satisfying performance, e.g. Vörös
systems. Identification of Wiener systems has been (2003), Zhu (2002), thus the algorithm applied, on the basis
proposed in several papers: literature: Greblicki (1992), of quadratic criteria, finds the number of optimal partitions.
Gomez, et al. (2004), Kalafatis et. Al (1995), Kozek and Wiener models and the applied identification algorithm are
Jovanovic (2003), Sung and Lee (2004). described in section 2. Section 3 illustrates the pH process
The pH processes are frequently encountered in the and the experimental module where identification and
chemical process industries and represent a significant predictive control is implemented. Section 4 shows the
challenge in terms of their identification and control. The experimental results of the identification and predictive
pH process is considered in the literature to have structure control based on the Wiener model. Finally, some
of Wiener systems with linear element describing the conclusions are given.

978-3-902661-93-7/11/$20.00 © 2011 IFAC 12301 10.3182/20110828-6-IT-1002.03695


18th IFAC World Congress (IFAC'11)
Milano (Italy) August 28 - September 2, 2011

2. WIENER MODEL X T ( k ) = éë- y ( k - 1) ... - y ( k - n ) u ( k - 1) ...u ( k - m )1ùû


The Wiener model (Fig. 1) is composed of a linear dynamic qi = éëa1...an ki b1......kibm di (1 + a1 + a2 + ...an )ùû
element which is followed by a non-linear static function.
Making:
The linear part can be modeled by a transfer function. The
 = 
nonlinear element ranging from simple algebraic functions
to complex neural network, for control purposes this ⋮
function must have an inverse, Norquay et al, (1999); e.g. ! = !
polynomials, splines, basis functions, radial basis functions, !" = #$ %
etc., Bai (2003), Celka et al (2001), Saintdomat et al, ⋮
(1999). !"& = #$ %&
!"&" = '$ (1 +  + ) + ⋯ ! )

We can represent the vector $ as:


qi = [q1... .... ..qnqn+1... ...qn+mqn+m+1 ]
ei(k): residual or equation error
Fig. 1. Structure of the Wiener model In general the static gain -./ of the linear transfer function
is:
In this paper the linear block H(z) is given as an ARX b + ... .... .. + bm
model equation: kuv = 1 (8)
1 + a1 + ... .... .. + an
V ( z -1 )
H ( z -1 ) = (1) Since that gain kuv is different from one, in order to
U ( z -1 ) ^
normalize, we use an intermediate variable v :
v ( k ) = H ( z )u (k ) -1
(2)

b1z -1 + b2 z -2 +...+bm z - m v= (9)
( )
v k = u k ( ) (3) kuv
1+ a1z -1 + a2 z -2 +..+ an z - n
The output prediction is computed by the new equation:
Ù

Where u(k) is the input to the linear block, v(k) is an y = ki v + di (10)


intermediate signal which has not necessarily a physical ^ æ b + ....... + bm ö ^ ^
(11)
meaning this signal is the input for the nonlinear block. y = Ki ç 1 ÷ v + di = ki v + d i
The nonlinear part contains the multisegment piecewise è 1 + a1 + ...... + an ø
linear function as shown in Fig. 2, and described by: Parameters of local linear model are determined by:
Ù
y (k ) = Nv (v) = Ki v(k ) + di (4) q n +1 + ... + q n + m
dy (12)
ki = Ù
=
dv 1 + q1 + ... + q n

q n+ m+1 (13)
di =
1 + q1 + ... + q n
Transfer function for each model is redefined in the
following way:
b z -1 + ....... + b m z - m
G ( z) = 1 (14)
Fig. 2. Representation of non-linearity 1 + a1 z -1 + ...... + a n z - n

Where index “i” indicates each segment of local linear


model; y(k) is the process output, Ki and di are the gain and
the intercept of i-th local linear model. From (4) we can Where:
obtain the expression of v(k):  7
y ( k ) di (5) ⎡  ⎤ ⎡ 7 ⎤
v k = - ( ) ) )
⎢ ⎥ ⎢ ⋮ ⎥
Ki Ki ⋮
⎢ ⎥ ⎢ 7! ⎥
⎢ ! ⎥ ⎢
From (4) and (5):

 = ⎢ !" ⎥ = ⎢ #$ 8

é y ( k ) di ù é y ( k - 1) di ù
- ú + a1 ê
é y ( k - n ) di ù
- ú + ...an ê - ú = b1.u ( k - 1) + ... + bmu(k - m)
(6)
⎢ !") ⎥ ⎢ #$ 8) ⎥

ê
ë Ki Ki û ë Ki Ki û ë Ki Ki û
⎢ ⋮ ⎥ ⎢ ⎥
Previous equation can be expressed as: ⎢ !"& ⎥ ⎢ #$ 8& ⎥
y(k ) = X T (k )qi + ei (k ) (7) ⎣!"&" ⎦ ⎣'$ (1 + 7 + 7) + ⋯ 7! )⎦

Where the vectors:

12302
18th IFAC World Congress (IFAC'11)
Milano (Italy) August 28 - September 2, 2011

Criteria for optimizing the number of local models Recursive Least - Squares
Fundamental idea of the identification algorithm is based on For the estimating of the model’s parameters, minimal
Kozek and Sinanovic (2008). Testing the hypothesis that the recursive squares are used,
variance s e2,i of ei(k), defined by (19), for each local model
P ( k ) x ( k + 1)
is only caused by the normally distributed noise. g (k ) = (21)
1 + x ( k + 1) P ( k ) x ( k + 1)
T

The residual s e2,i of each local model is composed of noise


qi ( k + 1) = qi ( k ) + g ( k ) éëg ( k + 1) - xT ( k + 1)qi ( k )ùû (22)
covariance s 2
n ,i and bias covariance s : 2
b ,i

s e2,i = s n2,i + s b2,i (15) P ( k + 1) = P ( k ) - g ( k ) xT ( k + 1) P ( k ) ( 23)


Where:
If the local model is valid, s b2,i = 0 , then: ? @ (#) = [−A(# − 1) … − A(# − <) C(# − 1) − C(# − >) 1] (24)
s 2
e ,i =s 2
n ,i
(16)
Alternatively, this leads to propose the following qi = éëa1.........an kib1......kibm di (1 + a1 + a2 + ...an )ùû (25)
hypothesis:
s e2,i > s n2,i (17) In order to starting the algorithm, the following assumptions
With the scope of validating the proposed hypothesis, (16) could be considered:
and (17), critical values of probability Ji-square function · Values of P ( k ) are initiated in a rather big value, e.g.
ca ,v
2
is used; where: α level of reliability, v : degree of é1000000 0 0 ù (26)
P ( 0 ) = êê0 ú
freedom; where 9 = :$ − < − > and :$ is the number of
1000000 0 ú
êë0 0 1000000úû
samples for the current local model.
As long as: · The values of θ are initiated to zero
é0 ù (27)
cv2,i < ca2 ,v (18)
q ( 0 ) = êê0 úú
The proposed hypothesis will be satisfied, and therefore the ëê0 ûú
local model will be valid. When this hypothesis failed, a
· Once the first local model has been calculated, the new
new model must be initialized.
model are update with the values of P(k) y θ(k):
For a ramp like input signal with additional white noise for
é Pa ,i 0 ù (28)
instance Fig. 3, and for a starting parameter of the model, Pi +1 ( 0 ) = ê ú
ei(k) is computed: ë0 Pr ,i û
u(k)

80
Where Pa ,i is a scalar value and Pr ,i a diagonal matrix 2x2:
diag ( Pa,i ) = éσ a2 σ a2 ... ...... ....σ a2 ù
60

(29)
40
ë 1,i 2,i n,i û

20
diag ( Pr ,i ) = 1*106 [1 1... .... ....1] (30)
0

-20
The value of θ i+1 is initialized with:
200 400 600 800 1000 1200
Sample N°
1400 1600 1800
θi+1 ( 0 ) = éëa1,i ....a n,i r1r1bm,i ......r1bm,i r2 ùû (31)
Fig. 3. Manipulable variable: NaOH flow Where r1 y r2 are random numbers in the interval [-1,1].
Ù
ei ( k ) = y ( k ) - y (k ) (19)
3. pH PROCESS
Ù
where: : estimated output; y ( k ) : output value. Then
y(k )
A schematic of pH pilot plant which was used to evaluate
the error’s variance is determined, Ji-square distribution the proposed identification and control procedure is shown
values are obtained in statistic tables for a determined in Fig. 5.
degree of freedom, and for certain level of significance. The mechanistic model can be described as:
If
FS = FA + FB (32)
cv2,i < ca2 ,v (20)
dX A (33)
The model computed is valid and therefore a new set of data V. = FA .C0 A - FS . X A
dt
is taken ( u ( k ) , y ( k ) ) and the previous procedure is dX
V . B = FB .C0 B - FS . X B (34)
repeated. dt
Where:
If cv2,i > ca2 ,v ; A new local model is started, saving the FS : reactor’s output flow. (l/s)
FA : HCl input flow. (l/s)
parameters of the previously estimated model thus FB : NaOH input flow. (l/s)
successively until reach the entire set of data. XA : Concentration of HCl acid. (mol/l)
XB : Concentration of the NaOH. (mol/l)
12303
18th IFAC World Congress (IFAC'11)
Milano (Italy) August 28 - September 2, 2011

COA : Initial concentration of HCl. (mol/l) Models obtained applying the procedure described, are
COB : Initial concentration of NaOH (mol/l) summarized in Table 2. Fig. 6 shows different local linear
t : Time.(s) models. Defining vn as the noise variance we can see that
V : Reactor’s volume. (l) for vn=0.5 we obtain the optimal model (FIT 87.47 %)
Chemical equations while for vn=50 the model has a FIT of 58.1%.
The system is formed by the NaOH as base, and HCl as
acid. The neutralization process between a strong acid and a
Table 1. Nominal values
strong base are described by:
H O
2
(35) Volume 1.8 l
HCl (ac) ® H + (ac) + Cl - (ac)
H 2O HCl concentration 0.005 Mol/l
NaOH ( s) ® Na + (ac) + OH - (ac) (36)
+ -
NaOH concentration 0.005 Mol/l
H 2 O Û H + OH (37)
HCl flow 0.0067 l/s
Kw = [ H + ][OH - ] (38) NaOH flow 0.002-0.007 l/s
From electro neutrality: Control horizon 3
[ Na+ ] + [ H + ] = [Cl - ] + [OH - ] (39) Prediction horizon 3
Q = [ H + ] - [OH - ] = [Cl - ] - [ Na+ ] (40) Input weighting 16
[ H + ] = [ HCl ] (41)
Wiener model was incorporate into MPC Scheme and tuned
[OH - ] = [ NaOH ] using the simulation where the well known Generalized
(42)
From (32), (33), (34) and (40); we can determine the Predictive control, Clarke (1987), was used.
following equation: The predictive controller has been designed using only the
(43)
dQ 1 parameters of the linear transfer function, it means that the
= .(FA .C A - FB .C B - (FA + FB ).Q ) regulator considered as output the variable 9(#). This implies
dt V
The relation between Q, kw and pH is: that both the reference and the output variable must be
K converted into equivalent variable 9(#) using the inverse of
Q = 10- pH - -WpH (44)
10
the nonlinear function.
Equations (43) and (44) describe the dynamic behavior of The control law has been estimated considering a horizon of
the reaction between a strong acid and a strong base. prediction and control of 3. Moreover, the value that weights
the input variable u is equal to 16.
pH Module To evaluate the control, several pH setpoint changes were
From Fig. 4: pump(A) is an on/off Walcham pump made. Fig. 7 shows the behavior of control with good
EZB30D2VC to dosifier HCl, flow max is 0.21 l/m. Pump performances.
(B) to dosifier NaOH flow, is a variable speed pump
Walcham model EHE35E2-VC, max flow is 0.52 l/min. Table 2. Model parameters.
NoiseLinear Piecewise Range
The magnet mixer is from Velp AGE model, able to provide variance transfer
speed until 1200 r.p.m. for 8 l. The pH probe located in the function
reactor is from Hanna Instrument model HI 1006. This ki di
probe is connected to the indicator Hanna Instrument model
HI 8510E420 which provides signal output 4-20 mA. 0.5 0.3808 16.0532 n £ 12.61
Substances to be mixed are NaOH and HCl . Table 1 shows -1
0.6932 12.1849 12.61 < n £ 15.57
G(z )=M/N 1.1930 4.0662 15.57 < n £ 17.11
nominal values for experimentals. n > 17.11
M (z-1)= 0.0479 z- 1.7829 -5.9210
5 N(z-1)=1-0.9521 z 0.4128 15.7839 n £ 15.9450
1.3582 1.2848 15.9450 < n £ 18.9
25 0.4496 15.4677 n £ 17.97
1.8562 -7.3220 17.97 < n £ 18.9
50 0.4533 0.0479 n £ 17.9673

To verify the behavior of the system when setpoint decreases,


it was changed from 3.5 to 2.8 pH values. Results are shown
in Fig. 8. Settling time was 17 minutes, the system does not
Fig. 4. Experimental Module
present overshoots, despite the changes in set point was
4. EXPERIMENTAL RESULTS higher than before case. The control variable, shown in Fig.
8, changes between 4.4x10-3 l/s to 2.4x10-3 l/s of NaOH.
To identify the process, an ramp signal with added noise
was applied to the pump (B), starting near to 2x10-3 l/s until Behavior of control variables in the event of disturbances was
reach 6.5x10-3 l/s. Fig. 5 shows input signal and output evaluated: at instant time 3750 s, the amount of pumped HCl
response of the pilot plant. is diminished; when this disturbance occurs, the pH

12304
18th IFAC World Congress (IFAC'11)
Milano (Italy) August 28 - September 2, 2011

immediately increases. The control loop brings it back to its 4

setpoint y
r
3.5
decreasing the value of the control variable.

pH
3

Table 3. Data used for predictive control 2.5


7600 7800 8000 8200 8400 8600 8800
Parameter Value Unit tiempo(s)
-3
Volume 1.8 l 5
x 10

u
HCl 0.005 Mol/l

NaOH (L/s)
4
concentration
NaOH 0.005 Mol/l 3

concentration 2
7600 7800 8000 8200 8400 8600 8800
HCl stream 0.0067 l/s tiempo(s)

NaOH stream 0.002-0.007 l/s Fig. 8. pH (up) and NaOH flow (down) for setpoint 2.8
Control horizon 3 ---
Prediction 3 --- Comparation between Predictive Regulator and PI
horizon A comparation using predictive regulators and using a PI
7
x 10
-3
Entrada
controller to the same process have been made under the
caudal NaOH same nominal values of work.
Caudal NaOH (L/s)

5 The following figures show the results of using a PI


4 regulator.
2.7
Salida
3 2.69 Setpoint

2.68

2 2.67

0 500 1000 1500 2000 2500 3000 2.66

Muestra N° 2.65

Salida 2.64

4.5 2.63

pH 2.62

2.61
4
2.6

2.59
pH

3.5 2.58

2.57

3 2.56

2.55

2.54
2.5 0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 4000 4200 4400
t (s)
0 500 1000 1500 2000 2500 3000
Muestra N° Fig. 9. PI control of pH
Fig. 5. Input (up) and output (down) signal for identification
of pH Process. We can appreciate that the settling time of the process
Modelos obtenidos
4
real

vn=0.5 (87.47)
variable goes from 4 to 8 minutes with an overshoot of
vn=5 (81.51) 30%.
vn=25 (64.23)

3.5
vn=50 (58.10) The results of using a predictive regulator with control and
predictive horizons of 3 and an input weighting of 16 are
pH

shows below.
3 3.2

2.8
pH

2.6
2.5
0 500 1000 1500 2000 2500
Muestra N° 2.4 r
y
Fig. 6. Found models. 2.2
1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.1 1.11 1.12
tiempo(s) 4
x 10
-3
x 10
3.8 4

3.6 3
NaOH (L/s)

3.4
pH 2
3.2

3 r 1
y
2.8 u
4500 5000 5500 6000 6500 0
tiempo(s) 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.1 1.11 1.12
-3
tiempo(s) 4
x 10 x 10
5
u

4.5
Fig. 10. Using a predictive regulator
NaOH (L/s)

4
The settling times goes from 15 to 25 minutes but reducing
3.5
4500 5000 5500
tiempo(s)
6000 6500 the overshoot.
Fig. 7. pH (up) and NaOH flow (down) for setpoint 3.5
5. CONCLUSIONS
In this paper an identification algorithm using optimal local
linear models was applied to pH process, in order to obtain
Wiener model. The number of local linear models and
parameter estimation is simultaneously obtained. The

12305
18th IFAC World Congress (IFAC'11)
Milano (Italy) August 28 - September 2, 2011

results have demonstrated the benefits of MPC based on Qin, S.J and Badgwell T.A. (1998) An overview of
such Wiener model. nonlinear predictive applications in : IFAC Workshop
on Nonlinear Model Predictive Control, Assessment and
The model which is an important factor for prediction in Future Direction, Ascona, Switzerland.
MPC, is selected a Wiener model with local piecewise Saintdonat, J., Bhat, N. and McAvoy, T. J (1991) Neural net
linear model. Wiener MPC was shown to posses good based model predictive control. Int. J. Control 54, 1453-
setpoint tracking and disturbance rejection features. 1458.
Shafiee G., Arefi M.M., Jahed M..R.- Motlagh and Jalali
REFERENCES
A.A., (2006); Model Predictive control of a highly
Bai, E. W. (2003). Frequency domain identification of nonlinear process based on piecewise linear Wiener
Wiener models, Automatica 39, 1521-1530. models, in:1st IEEE int. Conf. E-Learning in Indust.
Celka P., Bershad J.M. and Vesim (2001). Stochastic Elec., pp. 113-118.
gradient identification of polynomial Wiener systems: Sung, S. W. and Lee, J. (2004). Modeling and control of
analysis and application, IEEE trans. signal Processing Wiener-type processes. Chemical Engineering Science,
49, 301-313. 59, 1515–1521.
Cervantes A.L., Agamennoni O.E. and Figueroa J.L. Vörös J. (2003). Modelling and identification of wiener
(2003); A nonlinear model predictive control system system with two-segment nonlinearities, IEEE
based on Wiener piecewise linear models. J. Process Transaction on Automatic Control 50 (10), 1629-1634.
Contr. 13, 655-666 Wigren T. (1993). Recursive prediction error identification
Clarke D.W., Mothadi C. and Tuffs P.S (1987). Generalized using the nonlinear Wiener model. Automatica, 29(4),
predictive control - Part II. Extensions and 1011–1025.
interpretation. Automatica 23, 149-160. Zhu Y. (2002) Estimation of an N-L-N Hammerstein-
Genceli, H. and Nikolau. M. (1995) Design of robust Wiener model, Automatica, 38, 1607-1614.
constrained model predictive controller with Volterra
series. A. I. Ch E, J 41, 2083-2097.
Greblicki, W. (1992). Nonparametric identification of
Wiener systems. IEEE Transactions on Information
Theory, 38(5), 1487–1493.
Gómez, J. C., Jutan, A., and Baeyens, E. (2004). Wiener
model identification and predictive control of a pH
neutralization process. IEE Proceedings of the Control
Theory Application, 151(3), 329–338.
Kalafatis, A., Arifin, N., Wang, L., and Cluett, W. R.
(1995). A new approach to identification of pH process
based on the Wiener model. Chemical Engineering
Science, 50, 3693–3701.
Kozek M. and Jovanovic N., (2003) Efficient modelling of
Propofol pharmacokinetics: a novel 2-compartment
model, in: Proceedings of the BioMedSim03 (2008), pp.
113–118
Kozek Martin and Sinanovic Sabina. Identification of
Wiener models using optimal local linear models Vienna
University of Technology, Institute of Mechanics and
Mechatronics, Wiedner Hauptstr. 8/325 A5, 1040
Vienna, Austria, Simulation Modelling Practice and
Theory 16, 1055–1066.
Niemi, A. and Julia P (1977) pH control by linear
algorithm, in Digital Computer Applications to Process
Control (Edited by Van Nauta Lemke), pp 289-297
IFAC and North Holland Publishing Company, New
York.
Norquay S. J., A. Palazoglu and J.A. Romagnoli (1999)
Application of Wiener model predictive control
(WMPC) to an industrial C2-splitter. Journal of Process
Control 9 (1999) 461-473.
Patic P. C., R. M. Zemouri R and L. Duta, (2010) Recurrent
Neural Networks in Linear Systems Controlling Studies
in Informatics and control vol 19, no 2 pp 153-158

12306

You might also like