Digi tal Computer Applications to Process Control, Van © IFAC and orth-Holland Publishing Company (1977)
auta Lemke, ed.
A4-3
pH CO. TROL BY LI:EAR AL ORI r S P. Jutila
A. : ie i
Acader.1Y of Finland Helsinki, Finland
pH process is modelle applyine elementary theory of dissociation of the issolved constituents. S ch conversions of the measured pH signal are described whic permit a theoretically correct application of linear control. Both feedback an feedforward controls have been i~plemented in a comp ter controlle continuo s flow system of laboratory scale. Some res lts are shown and comparisons with more straightforward control methods are made. water is dissociated, and therefore the ion product can be used instead of the above constant. Instead of the activities, the concentrations are used with a good accuracy, especially for dilute solutions.
1. I '~TRODUCTI 01. Control of acidity or of pH is one of the most common control applications in industry. Most of its implementations are parallel to those of control of other process variables. pH is measured by a meter or transmitter producing a signal which is immediately transferred to a controller for adjustment of the feed of control chemical at the p'rocess inlet or at a later point.
= ~+aOH- ~
Kw
C+C-
~
10-14(mole/litre)2
(1)
The value of the product depends on the temperature and theoabove value corresponds to a temperature of 25 C. The present study deals only with isothermal processes.
Depending on the properties of the particular process, pH control may be affected by difficulties. In order to reach stability, the gain of a feedback control er must often be kept low. High demands are set on the static accuracy of the control components, and it is often hard or even impossible to meet these demands with conventional control devices. Practical solutions may include combinations of feedback and feedforward control, or of several feedback loops
The acidity of a solution is expressed by its pH number. This quantity is measured by a suitable pair of electrodes followed by a linear &mplifier. The electrodes produce a voltage which is linearly dependent on the pH value of the solution. -log1o[~+/(mole/litre)]
pH
11,21 .
~ -lOg,o[c+/(mole/litre)]
The model of the pH process has recently been studied and developed applying physical chemistry of dissociation of the constituents. Such models have been used for simulation of feedback control 13/, for develop ent of optimal control (4) and for stability studies 15,6/. In these studies, the pH signal is brought directly to the controller, except in 151 where a genera memory less control law is used, and in 16/ where a converter is 'ntroduced between the meter and the controller, in order to make the stability problem more tractable.
The hydrogen ion concentration C+ depends on the concentrations of strong or fully dissociated and of weak or partially dissociated acids and bases. For the dissociation of the weak acids and bases, the corresponding equilibri dependences are valid. Assuming that only monoprotic chemicals, or those with a single step of dissociation ~nly under process conditions, are present, is de ermine by the following e a ion 13, I where t e cons an s K and ~ describe the dissociat~on of eac acid a and base, respective y:
The present paper describes s ch conversions of the meas red pH signal which permit a ogica application of linear control and i p e entations of the contro n a comp ter controlled contino s flow system.
n
C
-
, J=
K.c.
~ + K .+C a
o
+ -
C ,
2. pH OF CHEMICAL SOLUTIO S
K . aJ
The processes of dissociation and recomb'nati~n of t e constit en s of water, the h drogen (H ) and hydroxy (OH-) ions, are very fast. herefore the relationship between eir concentrations in unamb'g 0 sly expressed by t e val e of the dissociation constant K of water. In aqueous solutions, only a mYnute part of the
C , OJ
~
~i
C , aJ
C . + C . aJ
aJ
If only stro g aci s and bases are present, there fol ows from Eqs. (1) and (3) tha the
289
( )
290
pH CO 'TROL BY LI EAR ALGORITH S
A4-3
asymptotical stability. as been erived for the correspondinG contro sys em wi h three mixers. ~f he condition is not sa isfied, imit cycle p enomena may be expected /S/.
iffere ce of he concentrat'ons of t e rogen an hy roxyl ons is inearly epenent on the difference of the concentrations of aci s and bases. Because the concentration does not affect, at least for p re li ids, the characteristics of flo~ and mixing, these processes are linear with regard to the concentration. Th s a linear model is obtained for the pH process in a continuous flow vessel, if the concentration di fference C is consi ered the primaly process variable. This has been specifically shown for a series of perfect m xers /5/. ny
Alt oug~ the correct model of acidity is sed in these papers, they are more aimed to operation and stability of the conventional pH feedback control syste. than to s estion of alternati ve procedures.
3.'. Feedback control of solutions of strong aci ds and bases At each point of a process containine only strong constituents, pH, C+, C and CB - CA
3. CO;TROL OF pH BY FEEDBACK
depend unambiGuously on eacn other; see (2), (,) and (3) for strong compounds only. Therefore the concentration difference (C) can be used as the. reference variable (C ) and as. the output ref varlable (C) equally well as pH. mhls alternative arrangement is presented in Fif,. 1 where the closed loop is linear, if the absolute changes of the control flow are small in comparison with the main process feed flo..l. The set point may be either the value of C f' or indirectly the value of pH f from i..lhi~~ C f is comp ted by a programmable r 5r permanently re wired converter. Either C or the indirectly controlled variable pH can be considered the process output variable. If the pH meter is followed by an appropriate converter, its output may be made to equal the process output C, overlooking noise and errors of measurement. his q antity is compared with the reference variab e, for detection of the control deviation.
T:'1e theoretically accurate mOdel of the H+ concentration process (3) can be sed as an al in design of pH control by feedback. .odel of a system consisting of a pH meter, of a linear PID controller and of a continuous flow process which consists of a perfect mixer and a plug flow unit, and where the equilibrium ~3) is valid, has been compile and used for sim lation /3/. The same syste~ has been augmented with a nonlinear gain of a hyperoolic sine shape following t.e ph measurement, an the co dition for stability has been derived by Popov's method for the case of Dot. strong and ..leak acids and bases. In the latter case, t e concentrat"on of each individ al ~eak acid and base must be ~no..ln for an accurate analysis. If on y strong acids and ~ases are present, the addition of e nonlinear gain results in a linear measurenent of he difference of their concentrations /6/. j
ne series of t'..lO perfect mixers provi ed ,..,i t':1 pH mea~urement and proportio al fee back control . as been shown globally asymptotically stable ty ~apunov's 2nd metho , if only s~rong ~onsti ents are present, and the condition of global
pH ref
Fixed nonLineo relationship by (1 ),(2L (I.)
It was stated in Section 2. that a continuo s flow process involv'nf, no weak compc nds is generally linear with ref,ard to C. If the controller can be tuned to control the concentration difference , of he control chemical
Q, C, +
Linear
+
controller
Linear flow & mixing process
c
1------------, Convers ion
I
by (1), (2),(4)
pHI pH detection
t4'----4
L
I
I Linear
Fig. 1. pH control wit
measurement
linear feedback loop
Fixed nonli near p by (1),(2), (4)
~-..-.treLationshi
pH
-3
291
Q,
Linear controller
c,
Linear flow & mixing process
c t--...._
..
Fixed nonlineor relationship
pH
by ( 1 L(2),(4)
.....--------4 pH
detection (nonlinear)
Fig. 2. Ordinary nonlinear pH control loop feed in irect propor ion to the control devia ion C - C, the closed loop is comple ely ref linear. cn a controller can nat rally be constructed, ut it is uch easier to control the flow of the chemical for which the conce tration is s ally known and even cons ant and the flo~ smal in comparison wit the main proce~s flow ( ' « . 0 andC,» Co)· S bject to.t ese assumptlons, the process c~n be consldered practically linear and the control action to e al the former alternative; ,(t)C, ~ Q'sC,(t) wnere s refers to the steady state vafue. Proportional control according to the control deviation C -. C is con.3idered as a basic . ref example. T e galn K ef the P control deterrrunes 1 the rela ionship between the deviations from the steady sta e point of operation. ( 6)
For snall devia ions from the s ea y sate e ilibri ,t'1e sarne res 1 is obta· nee. w· h control accordin to,-, (0) and pH ( ), if he contro gains. aye .e abo e ra io. ~onsi era le ifferences appear, if . e eviations are ereater. The for er co rol ( ) iMp11es a constan c:;ain '",i t. rep;ard 0 the conce tra io . difference ~ ic. is co~pa i le wi h the fac t at the process is linear ~it reGard 0 the same vari able, or al .os inear, i f . e con rol chemical feed ·s the anipulated v~ria le. A linear contro (7) hase directly on pH neas rement results in a value of the total control gain wh'ch de ends on he magn'tude of ne control eviation, and t:.is dependence is also influence by the selec ion of the set poin . Fig. 3 corresponds to he se po·n C = 0 (pH ref ~ 7). ~t ap~ e~rs. hat :e )ai~e ecreases for an lncreaslng ev at on, belng less than 50 % of he val'e correspon ing 0 he s eady sate, a rea y for a ev· a . on of 1 pr 1.
control of aCl
er inear, type
pH .
re ated to qs •
+
i
(C +
+ v
b
.e
a t
~r
o
) a d (5).
j
2 + ,")
Fi o
•
3.
o. ro C ref
a . n s as f
Ct ions
0
f
e' . at . 0,
pH CO
292
~ROL
BY LIt"EAR
e ivalen consideration iter,s of ~e pH deviation' pies a cons ant contro Ea'n ( ) 'W .. le t' e a e rna i ve con rol gain (~) change s 'Wi h changes of the devia ion and t: e set val e. This is s own in FiG. for the same case as Fig. 3.
t
Q,/ Cl
Fig. 5.
ontin o s f ow sys eLl
C f
q C + Q1 C , - (qo+ql)C f o 0
C a
-!
C
q(C -C) a
a
-2
-1
o
2
(q +q }(C -C ) o 1 f a
Q o
qo
-3
A4-3
LGORITH
Q
ql
f
V
1
( 10)
q
f
g V
(11)
The volumes are assumed to be constant and Q is a cons ant sample flow through the third mixer which corresponds to a pH measuring chamber. The values of the parameters and the steady state values of the variables are: q Iq, = 100, oS_4 s qos/qs = ~~ , Va/V f = 0.25, Cos = 10 (pHo~ ),
3
pH ref - pH
'- (pH 1 ~ 12), Cs = Cas = Cfs . 0 he values are the same as ln Ref. /51 where the control was based directly on pH measurement. It was sho'Wn there for the linearized system t~at the following value of K ~s ?btained at the stabi~ity limit for s all 2 deVla 10.S. T:e correspondlne value of K for 1 control according to C can be calc lated fro C1 (p~
Fig. 4. Control gains as functions of deviation pH - pH ref Fig. 3 sho'Ws the nonlinearity due to the pH measuremen • for a control loop 'Which is linear for its ot.er parts. In tnis typical example, t' e contro gain is s aller for grea er deviations and, correspondingly, the dev'ation producing a sat ration of the act ator is lar.er than in control according to the concertration difference. Th s he conve io al pH con rol is less effective for great han for s a dev'ations.
= - 10
= 7).
E . (
).
q1s C +1 30 --- --C
pJ
~
q1s ~ -1930 --- In10·V C'-+4K Cl s
w
( 12)
ast reason an extraneo s con ro eain practice. ;evertheless a a vary ack
y
0.,
rbances of long d ra falls belo the arge on s
or e=0
accor ing .f he o the
o e co sis i g of a series of t. ree pe rfec xers (Fig. 5) 'Was sed for a compara ive s y of bot contro e hods by si ation. The odel is t e sa e as Ref. 15/. o he r, arbi rary flo ode s ca be expecte ead to si ar res 1 s.
omp ra of a of pH feedback g~in K1kr~ hleher galns; a the gain
es
ed 2
pH CO TROL BY LI EAR ALGORITH S
A4-3
pH = .5 wi h no feed disturbance. The fig re is characterized by long stays of pH at both extremes. while the set value is passed rapidly. A feed disturbance of 0.5 pH unit (pH from to .5) prod ced at this gain a permanen~ change of tne 0 tput pH from 7 to 8.63. The 0 tput assumed t is constant val e after a few damped oscillations which indicated stability.
pH
relatively small control flow was not meas red. b t t e piston pump was calibrated and provided with a position transmitter for the stroke length. All transmitters and actuators of the controllable pumps were connected to the process comp ter Stomberg 1000 of the laboratory which was programmable in a real time Algol anguage. In a typical test. the system was run initially at ~Ho = 3:5~ pH, = 12.0 and pH ~. 7. ~he sablllty llmlts of the concentratlon dlfference control and of the nonlinear pH control were found to correspond to each other according to Eq. (9). For the former control. the limit did not change appreciably with changes of C (pH) and C (pH). ith a lower gain. the systgm 0 operated regurlarly showing for a step disturbance a permanent deviation which on the pH scale was somewhat smaller than in the corresponding case of the nonlinear control. An experimental reproduction of a simulated feature of the latter control is shown by Fig. 8 where oscillations of about 0.4 pH unit amplit de are first observed at a gain which exceeds the limit approximately with 20 %. A step change of pH to 3.7 was then produced by switching the 0 process feed from one source vessel to another one. At the same gain. the output is brought to about pH = 9.1 which corresponds to a stable state of the system.
10
Fig. 6. Limit cycling of nonlinear pH control system For experimental studies. the continuous flow research system of Fig. 7 was constructed. It was provided with two pH transmitters and one electro-magnetic flow transmitter. fhe
COMPUTER AND
INTERFACE
process soLutions
process
controL chemicaL
293
controL
fLow
pump Fig. 7. Comp ter contro led contin ous flow system
pH CO TROL B
294
LI Et R ALGORITH C a
9
8
7
100sec
~
6
Fig. 8.
3.2.
oC ao
(Qo + Q1) Ca
1CB 1 -
(
( 14) 0
+ Q 1) CB
This model was der'ved in Ref. / / for the case of acetic acid and sodi hydroxi e. he above e ua ions show t a pH eas remen alone is insufficien for an unambig ous descrip ion of the state of the process. One 'nde enden .eas remen of concen ra 'on of one of e constit en s or of the correspo dins ions would be nee ed. An inspection of he Eq. (3) sho s that+in this case no s~ch unarn i 0 s f nction of C exists which wo 1 depend linearly on the concentration of the control agent B. Analysis of the conventional sinele loop feedback control in the pre3ence of weak constituents therefore requires linearization and considera ion of only small chanees around the steady state. As an approximate method, a g~in which varies as a f nction of pI and is similar to tha in Fi . 3 has been mechanized wit analog co ponen sand applied to the case of a stron aci an a weak ase /8/. ne met 0 is based on an experimentally determined titration c rve and pH meas rement only, and the effects of a low deeree of issocia ion Or of changin concentrations of the constit ents are not analyzed.
pH
T
A4-3
TIME
4.
FEEDFOR~ARD
CO TROL OF ACI ITY
~onlinear pH feedback control system showing ins ability at pH ~ ~.5 and stabili y at pH ~ 9.1. pH of feed pipe changed from 3.5 to 3.7 atOtime T
tions of weak aCl s
o
e variable C ~as s fficie t for description of ,e rocess e ween s rong ac'ds an bases. Because these consti ents are f lly dissociate , t" e rr~ss balance e ations of the hydrogen and hydrox:, ons were in ependent of conce ra ions of other ions, ~nile hey were connecte 0 each other y :::1. (1).
-K )C+-K . w a w
o
are . ore he se of ed.
( 13)
( 5)
he case of one 'wea'k aci' or ase ca e ee for' ard .an er, ike .e of .e sc sse ic ac H of fee f 0''; is
295
pH CO TROL BY LI EAR ALGORITH1S
A4-3
meas red and C is calculated by means of Eqs. (2) and (~? while CA = CB = C . = 0, j = 1. Eq. (3) is then appl1e a~5tner time 0 the proce~s at the meeting point of the f~ed flows. C is s~bsituted by the esired H concentration C ,an since the concentration C of the contF~f agent is constant or known by Bl . . measurements, the req 1red control flow 1 1S obtained from a linear relations ip. K
ref
a
C+ + v ref '-a
( 16)
'" 00 o
Cref - Cl
The desc 'ibed feedforward control procedures can be easily applied also to the case of a variable process flow (t), if this is measured. The constant Q isOsimply substi tuted by the measured flow valueoQ (t) in Eqs. (15) and (16). o Feedforward control . as studied experimentally using the laboratory type flow system described earlier. First a solution of a strong acid (HC1) was used as the process flow, and its pH was meas red.J~ the basis of the measurement, C was calculated and the pump feeding a strong b~se (aOH, pH = 12,3) was controlled as determined by Eq. (15). Before the control experiment was started, the underlying chemical process was checked by batch tests in which the amount of base required for a pH change C ~ of the process soluticn was o determined. Art~ough the water used for preparation of the solutions was purified in ion exchangers, some inaccuracy was produced by e.g. dissolved CO for small steps of concentration 2 difference around the point of neutrality. For larger steps this effect decreased rapidly, and therefore no extra parameter was introduced, instead the val e of Kw was adj usted, if needed. In a typical experiment the acidity of the process feed flow was pH = 3.5 and the desired o of the 0 tput pH f = 7. he res It of batch tes!1~~i3in g~6a con~orm wit~ the K = 10 ava1lable 1n the Iltera ure Vi
pH
B
100sec
7
t-------i
T
TIME
F·g. 9. Feedforward control of pH; strong acid and base. Step change of pH of feed pipe from 3.5 to 4.0 at ti eOT
0 for the temperature of the liquid (21 C) 19/. From the initial value, pH of the process feed floJ was changed stepwise,Oby switching the feed to come from another f~ed vessel, to the value nH = 4. The flow of the basic solution was • 0 . controllei by the computer accord1ng to the feedforward control (15). The results are recorded in Fig. 9. Due to the high sensitivity of the process and to the limited positional accuracy of the act ator which resulted in more than ± 1 pH unit uncertainty at the output, the outp t pH assumed in this test an average value 7.4 at the beginning and 7.7 at the end of the experiment. Due to the practical measurement and control, the flow of the control agent was delayed with regard to the change of acidity in the process flow which is shown by the high transient pH peak. The results may be compared with the straightforward pH control wh~ch controls the flow. Q 1 of the control agent 1n a constant proport1on to the pH of the process feed flew. Determination of the linearized dependence between pH . . 0 and.~l at the steady state p01nt of oper~t~on del1vered the value of the control coeff1c1ent which results in the correct control, if the changes of pH are very small around the steady state pH va18e 3,5. However, larger disturbances re~ult in deviations so that already the value pH = 3,9 brings the control flow down o to zcro. If the described experiment wo Id be made with this type of control, the output pH would assume t.-le unchanged pH value of the feed (pH = pH = 4), i.e. such disturbance of 0.5 pH uni canRot be counterac ed logically by this cont rol. The character of the pH process is descri ed by the operation of an uncontrol ed process. 'vi th the sarr.e initial state as above, a change of pH o 3,5 res Its, in the absence of any control, in a change of he outp t pH 7 ~ 10,45 wh'ch demons rates the hi h sensi i y of the process. Acetic acid sso ve in wa er as sed as the process aterial in anot. er ser'es of experiments. pH was meas'red in the fee pipe and the corresnonding co centra ion C ca c a ed. he feed of a strong base ( aOJ, ~R = 12,2) was co ro led by t.e fee forward con ro er ( ). he val es of wo arameters, viz. of K and 0 the issoc'a ion co s a t of ace 'c aci~ K were no' fit ed'y batch ests, . ro h e er~i~a ion or the+amount of base re ire for he change Co ~ C t:ese ests, C was bro ght from p ref ,and r~spec 1vely fro ,), 0 he fir.al val e of C = 7. . e ob ained a e r 1 10- . K was aga'n very c ose to ne correct o~e, whi e e 0 her parame er K = 1.37.10- 5 differe somewhat more fro the ~al es found in t e literat re (K = 1.75'10- 5 1 I).
e
a
A4-3
pH CO 7ROL BY LIl EAR ALGORITH1S
296
The feedforward control was then applied to a continuous flow process for which pH was changed stepwise ,5 ~ 4 ~ 4,5 while ~he control was based on calc lation of C and subse ently on linear contro algorithm (qg), (pH f = 7). The experimental results are shown inrFlg. 10 which shows t at the feedforward control (16) functions correctl , at least in a range which corresponds to t e fitting of the model parameters. Except a peak immediately following a step, the outp t pH keeps relatively close to the desired value. Limited accuracy 0 the actuator resulted in ± 0.8 (pH .5) and ± 0.3 (pH = 4) pH unit uncert~inty of the output pH. ~f the controller would be based on a linearized dependence between pH and Q at the 1 steady state point of operation,Othe practical range of such control would be still narrower than for the corresponding case of strong constit ents. In a total absence of control, the output acidity at the middle part of the experiment would have assumed the value pH = 4.24.
i provements which can be reached e.g. wi h he I-term are easily unders ood in he case of a linear loop. Feedforward control is linear in the cases of both s ro and wea' acids an bases. It can be applied in so e re a i ve simple cases w i c. cannot be properly iealt \.:i th by the feedback control. ~. e ana sos tnerefore a voca es he appli cation of . e feedforward contro . an. Bo h control methods can be s peri~rosed for the control of a single sys e . Experimenta work wit: the COMp ter con rolled continuous floN system in laboratory supports the theory. The process is very sensitive, if the steady state pH step is h~gh and directed towards the ooint of neutralit:r, which accent at~ the nonidealities of the physical components.
6. LIST OF SY,IDOLS H+ ion concentration OH ion con entration concentration of strong acid concentration of strong base concentration of weak acid ~oncentration of weak base concentration of undissociated acid concentration of undissociated base
9 pH
8
concentration of weak anion
7
con~entr~tion
of weak cation - C dissociation constan of weak (acetic) acid ion product of water con rol gain; EQ. (6) cont rol sain; E • (7) 01 et ri c flow vol:.une 0,1 as s bindices of var"ables refer to process fee and control f ow, respec ively = C
6 100sec ~
5"----~r-----------4-------~
T,
TIME
Fig. 10. Fee forward control of pH; weak acid and strong base. Step change of pH of feed pipe from .5 to at time 0 and from to 4.5 at time T 2
7. REF2RE CES
/1/ Shinskey, F.G., -1yron, T.J., "Adaptive FeedpH Cont'l'o tiT; Advances ln Instrumentatlon, Proc. ISA Conf. ~ (19 0), Par 1, 565-70 ~k App lied to Feed[orwar-d
5. CO CL SIO S analysis of the pH
/2/
owi cz, E. ., "Uncle rstanding r enta io ~ec. 0 ogy,
/3/
ichter, .arcikic nstr e
/ /
~"acAvoy,
T., "Time Optimal and ZiegZeyichols Control", Ind. &Eng. C e " Process Deverop:", ..!..l (1972) 71-78
nes:--& /5/ ae t.e
A4-3
pH CO 'l'ROL BY LI EAR ALGORITHi·1S
/6/ Rang, E.R., "App lication of the Popov Criterition to
fj-:/eutralization Control",
Advances In Ins rurentation, 30 Part. 3, 76 /1--
/7/
1975,
cAvoy, T., Hs , 2., Lowent a , S.,
"Dynamics of pH in Controlled Stirred Tank Rea tor", Ind. & Eng. Chem., Process Des. & Develop.,
11 (1972) 68-70
/3/ WaIter, S., wiIke, K., "Ein neues Ver[ahren zur pH-Wert-Regelung", Chemie-Ing.-Techn.,
45 ( 1973 )
1071 -
1072
/ / Butler, I., "Ionic Equi libriwn: A l1athematical Approach"" Addison-Wesley, 1 64
297