You are here : Control System Design - Index | Simulations | pH Simulation | Part 1 ## pH Control - Part 1Before continuing, make sure you have read Chapter 19 ## System ModelFrom elementary mass balance considerations, it can be shown that an appropriate state space model for the strong acid-strong base system is
where
Normally, the reagent concentration is constant, and we control the
effluent pH by varying the reagent flow. Note that the concentrations are
From this formula, we can see that an excess concentration of 0 gives a pH of 7 (which is the pH of water, as expected). Also, negative excess concentrations correspond to basic pH, and positive excess concentrations correspond to acidic pH.
## Control DesignWe assume that the tank system has a level controller which maintains a constant liquid volume in the tank. The reagent flow is controlled using a simple PI controller as shown in the figure below. Note that the control valve on the reagent pipe has a saturation, since it can be fully open (giving a maximum flow rate) or fully closed (giving a minimum flow rate of zero). For the purposes of designing the controller, the plant is linearised by assuming that the reagent flow is much smaller than the influent flow (since the reagent is more concentrated). This results in the linear model shown below. The controller is designed so that the closed-loop bandwidth is twice that of the open-loop bandwidth. This way, the initial peak in reagent flow falls within the limits imposed by the valve. It may seem logical to construct a larger valve so that a faster controller can be implemented, but we will see later that this carries with it serious design tradeoffs which mitigate against going too far in this direction. For this example, we choose the parameter values as
and design a PI controller with q / c
and _{u}k = 4_{i}q^{2} / Vc.
Note that the primary concern of the controller is to reject disturbances
rather than to follow a set-point, since the set-point will always be a pH
of 7. Also, we assume that the control valve allows a maximum reagent flow
rate of 1.5 _{u}L / min.There is an inherent problem with the pH control system: the measured output is pH, but what we want to control is hydrogen ion concentration (using pH as the control variable with a set point of 7 would make the system even more non-linear than it already is). If we did not know equation (2) for converting between ion concentration and pH, we would have to attempt to estimate the titration curve, possibly linearising it to find ion concentration. The pH curve looks almost vertical in the middle, but upon magnification we find that it is not linear at all. Thus, linearising the titration curve has serious sensitivity ramifications for the control system. Fortunately, in this case we know the function for pH in terms of concentration, so we can simply invert this equation to find the ion concentration for the measured pH. This is rarely possible in practise. Note that when measuring the effluent pH, there is a delay of the order of 5 seconds. It is safe to ignore this delay considering the time scales we are looking at (i.e. with a plant time constant of 500 seconds). ## Java Applet SimulationBelow is a Java applet which simulates the above pH neutralisation system. The blue plot shows the influent concentration and the green plot shows the effluent concentration. This process is extremely slow, so the time scale is accelerated somewhat: 1250 simulated seconds pass for each real second of the simulation, giving a horizontal scale of 2500 seconds per division Pressing the "Change Parameters" button brings up the parameters window allowing you to change the controller values, the influent pH and the animation speed. The controller has been implemented in the anti-windup form to avoid the effects of the saturation of the valve. The animation speed can be 25, 12.5 or 6.25 frames per second. This speed is only the rate at which the screen is refreshed - the simulation is unaffected. The speed function is available for those with slower computers so that the simulations still appear in real-time (if somewhat jerkier). Note that the applet does some auto-detection of the speed of your computer, so if you select a speed that your computer cannot handle, the applet will reduce the speed accordingly.
The observed non-linear output response is due in part to the non-linear system. However, most of the non-linearity arises from the fact that we are measuring pH which is a logarithmic function of the excess ion concentration. It is hydrogen ion concentration that we are concerned with controlling, but we measure pH since environmental laws specify the acceptable effluent pH ranges (the tolerance could be as small as 0.5 of a pH). In this simulation, it was assumed that both the influent flow and concentration were constant, but this is rarely the case. The next page looks at the effect of varying the influent flow rate. |