If you have an extra pH meter available, it would do the first loop
quite a bit of good. A formula based on empirical experience can
predict the valve position for the first reactant addition, with the
first PID loop just correcting the error in this prediction. The
controller adds the prediction to the PID reaction to create the
actual control output. Likewise, the pH meter that runs this first
loop can also be an input into a second formula that predicts the
second valve position. Of course, those formulas don't mean much if
the stream does not flow at a constant rate. If rate varies, a
measurement of that needs to be included in the feedforward formulas.
If the caustic reactant supply suffers concentration variations or
pressure changes, it is helpful to include those pieces of information
in the formulas, also, or replace the control valves with metered
A warning. Static mixers are not at all good for this application,
because they just mix across the area of the pipe, and do not add any
historical averaging (lag) so an abrupt change in the stream pH at the
mixer input (that includes poor uniformity across the pipe cross
section) still shows up as an abrupt change at the mixer output (but
with much better uniformity across the pipe area).
I have designed a fat spot replacement for a static mixer loop that
had this problem. It improved the ability of the loop to smooth out
step changes by at least a factor of 10. It consists of a section of
pipe about 4 times the process pipe diameter and about 5 times as long
as it is wide, closed at one end. The input stream enters this fat
section near the exit end with a tangential connection, so that the
flow causes maximum rotation within the fat pipe. At the same end,
the flow exits through concentric dip tube that has two rows of holes,
smaller near the entry point, and larger toward the far end. It ends
about one of its diameters from the closed end of the large pipe with
an open end. This mechanism approximates a mix tank, by storing a
historical record of recent process variations and combines samples
from this history, so that a step change in the input composition
exits as an lag filtered step. It also has quite a bit higher
residency time than a static mixer of the same length, allowing
reactions to come closer to completion before being measured.
Having this kind of mixer between reactant injection and process
measurement allows for quite a bit more gain in the PID controller,
and for less error before the controller reacts.
John Popelish has given good advice. Personally I think the best return on
investment is to put in flow measurement and scale all controller output
proportional to flow. That gets rid of one variable very easily.