ChE E3820y: DYNAMICS AND CONTROL OF DYE MIXING (TRC)

A. SAFETY

1. Wear safety glasses at all times.

2. Wear jeans or slacks, a long sleeved shirt, and sturdy shoes that give good traction on possibly wet floors.

3. Guard against electrical hazards by making sure that all equipment is well grounded using three-wire plugs and other means.

4. Guard against falls, burns, cuts, and other physical hazards.

5. Think first of safety in any action you take. If not certain, ask the TA or a faculty member before you act.

6. Note that methylene blue dye is relatively innocuous, although it does stain the skin. Soap and hot water remove the blue color from the skin. Rubber gloves will be provided.

B. OVERVIEW

The goals in carrying out this experiment are:

o To demonstrate the use of an impulse response technique to determine the residence time distribution function (rtdf) of a flow system, and measure the effect of the flow rate and flow system configuration on the residence time distribution function. From the rtdf and the flow rate, the volume of the system will be calculated.

o To demonstrate the use of a PID feedback controller in holding the effluent concentration of dye at a desired level, in the face of disturbances such as step changes in flow rate or set point, impulse injection of dye, and flow system configuration. To determine the quality of the control as a function of controller parameters.

C. SCENARIO

In a continuous fiber dying process a reactive and unstable dye has to be produced, diluted, and used on a continuous basis. Since the demand for the diluted dye varies, as does the required dye concentration, your plant has used a continuous diluter, comprising three vessels in series, for many years. In this diluter an operator samples the effluent dye concentration every five minutes, analyzes for dye concentration, and then adjusts the dye feed rate. This has proven unsatisfactory in that the effluent dye concentration varies too much, leading to excessive off-spec fiber which has to be discarded or sold at a discount. The recent advent of inexpensive microcomputers and A/D boards with digital output has convinced the technical director (Dr. Ole Aginous) that a computer-based control system should be designed and installed. Such a system has been purchased from an outside group, Aginous Associates Inc.

Many questions about the system have arisen. For example, it is not known if the three vessels are well mixed at some or all flow rates. (Certainly at very low flow rates, perfect mixing is not to be expected.) Data on which a mathematical model of the flow system can be based are not available. And it is not known how well a linear PID controller can hold the effluent dye concentration at a desired level, and what combination of controller gains gives the best, or even satisfactory, control.

Your group has been selected to test the dye mixing system with and without the controller, develop controller settings that produce the best performance, and recommend acceptance or rejection of the system. Your group will write a report which focuses on the above points, and also makes recommendations for improvements to the unit if these are needed.

D. APPARATUS

The continuous flow dye mixing system is shown schematically in the attached diagram. The major components are as follows:

Dye Feed Tank

This is a 20 L polyethylene tank holding a weak solution of methylene blue, typically 10 mg/L. If the feed solution is too concentrated, the control valve will operate in the almost closed position. Conversely, if the feed is too dilute, the valve cannot open far enough to reach the desired effluent dye concentration (especially at high flow rates).

Dye Feed Pump

This is a magnetically-driven centrifugal pump that provides a relatively constant pressure feed of dye solution to the automatic control valve. This pump should not be run when the impulse injection runs are being made.

Dye Control Valve

This is a needle valve, of range 9 turns, driven by a 200 step per revolution stepper motor. Thus the full range of the valve is 1800 steps. This range can be covered in about 40 seconds.

Water Pressure Regulator

This regulator is connected to the water feed line, normally the lab mains. It is used mainly to reduce the effect of lab water pressure variations on the water feed rate to the experiment. A pressure at the inlet to the water flow control valve of say 30 psig is sufficient to cover the desired flow rate range.

Water Control Valve and Rotameter

The Model 1355 rotameter (Brooks Instrument) has an upper limit of about 1400 ml/min, and is equipped with an integral needle valve which is used to set the flow rate. Calibration data for the rotameter are attached. It is recommended, however, that each flow rate used be measured by using a stopwatch to time the collection of 250 or 500 ml of water in a graduated cylinder. The rotameter is then used to monitor and control the constancy of the flow during a run.

Impulse Injector

This device consists of a U-shaped aluminum block in which slides an I-shaped acrylic block containing two passages which align with passages in the aluminum block. Initially the upper passage is filled with a relatively concentrated dye solution by using a syringe. At time zero of an impulse run the block is snapped sharply downward by finger pressure, inserting the dye filled passage into the water feed stream. O-rings seal the ends of the passages in the acrylic block. A removable acrylic retainer allows removal of the acrylic block for o-ring replacement, if needed. Use of a light lubricant such as Vaseline prevents binding of the sliding block.

Flow System

The flow system consists of three borosilicate Erlenmeyer flasks of nominal volume 250 ml. Each flask is equipped with an o-ring sealed Teflon plug, held in place by an aluminum retainer secured to a Keck clamp. (Note that the hold-down screws should be only finger tight.) Two ball valves allow the flow to (a) pass through the three vessels in series, (b) pass through only the last vessel, or (c) pass partly through three and partly through one vessel. Each configuration has its own residence time distribution, which of course is a function of flow rate. The flask inlet and outlet lines are designed so that air bubbles will pass through the first two flasks and collect in the third flask, which is equipped with an air vent line. If the Tygon outlet line is pinched and the ball valve in the vent line is opened, air in the top of the last flask can be removed before a run. This flask then acts as a bubble trap during the run and prevents air bubbles from entering the spectrophotometer cuvette.

Spectrophotometer and Cuvette

The concentration of dye in the effluent from the flow system is determined by a Spectronic Model 20 spectrophotometer (Spec 20). The Spec 20 is equipped with a specially designed long-path flow-through cuvette. A light beam passes through the cuvette, to a grating that selects the wavelength (normally 640 nm), and then to a photodetector. The photodetector signal is displayed as transmittance on an analog meter on the Spec 20, and also converted to a voltage which is sampled and digitized by the A/D board in the computer. In the computer the dye concentration (dimensionless) is computed using the equation

C = 1000 ln(450/V)

where C is concentration and V is voltage (millivolts) from the Spec 20.

E. PROCEDURE

Inspection and Initialization

The apparatus should be examined carefully. Check that the effluent water line from the cuvette is connected to the drain, that the cable from the terminal board is connected to the valve driver, and that the cable to the Spec 20 is plugged into the Jones connector on the bottom of the Spec 20. Turn on the power strip, and unplug the pump until a control run is to be made. Turn on the computer and proceed through Windows 95 to the DOS prompt. Type CD \ZQB45 to connect to the directory which contains the impulse injection program (MXTRCR01.BAS) and control (MXCTRL01.BAS). Load by typing QB MXTRCR01 or QB MXCTRL01. Type ESC to bypass the first screen. The selected program is now ready to run.

Calibration of the Water Flow Rotameter

With the ball valves set to bypass the first two vessels, set the water rotameter to 30 (read the center of the ball), and record the time needed to collect 250 ml of effluent water in a graduated cylinder. Then increase the water flow rate in increments of 20 to 150 and measure the water flow rate (ml/min) at each setting. The water rotameter is now calibrated. Your results may be compared to those (see below) provided by the manufacturer, for water at 70 F.

Spectrophotometer Calibration

When all traces of blue dye and all bubbles have been washed from the cuvette (running at a low flow rate will remove even small bubbles), and with the light shield in place, use the left hand black knob to turn on the Spec 20. Lift the cuvette until a shutter inside the Spec 20 falls, and set the needle of the meter to 0% transmittance. Replace the cuvette, and use the black knob on the lower right to set the transmittance to 100%. The Spec 20 is now calibrated.

Impulse Injector Set Up

Set the water rotameter at 30 mm, and use finger pressure to moving the sliding block to the upper position. Move the syringe to the downward position, and then pull about 5 ml of dye solution from its flask into the syringe. Allow a few seconds for bubbles to disengage. Then use the syringe to push about 2 ml of solution back through the block into the flask. The impulse injector is now loaded.

Impulse Response Runs

Make sure the dye pump is off and the ball valve on the pump inlet is closed. Load the impulse injector as described above. Set the flow rate at an intermediate rate, say 100 on the rotameter, which corresponds roughly to 800 ml/min. Load program MXTRCR01.BAS under QuickBASIC in directory C:\ZQB45 by typing CD \ZQB45 and then QB MXTRCR01. Run the program by typing Alt-R and the hitting ENTER. Enter the name of the group running the experiment (e.g. aaa), the run number (e.g. 01), the name of the file to be used for the data (e.g. aaa01), and the NDELAY parameter. NDELAY controls the duration of the interval over which data are collected. For runs at higher flow rates, say 1000 ml/min, using only one vessel, NDELAY = 1000 is a good value. For runs at lower flow rates using three vessels, values to 5000 may be needed. If the program terminates before the effluent dye level has returned to zero, NDELAY should be increased. (Note that NDELAY also corresponds to the number of samples digitized and averaged for each of the 200 data points collected. This averaging tends to remove high frequency noise.)

When the program instructs INJECT DYE AND HIT ENTER SIMULTANEOUSLY, use firm finger pressure to rapidly snap the injector block fully into the downward position. At the same time a second student will hit ENTER on the computer. You will see the effluent concentration plotted on the screen, and the run will end after 200 points have been recorded and saved to the selected file. Continue by hitting ENTER as prompted. Enter the volume collected in calibrating the rotameter (e.g. 250 ml) and the collection time (e.g. 20 seconds). (Invent and enter numbers corresponding to the correct flow rate if the rotameter was not calibrated.) The program will calculate the mean residence time (see notes below) and the volume of the system between the injection point and the cuvette. You should repeat these calculations after reading the data in the file produced by the program into a spreadsheet program.

Now a series of runs should be made, at rotameter readings of say 30, 60, 100, and 150. This series should be repeated with the ball valves set to send flow through three vessels in series. (At high flows with three vessels in series, a more concentrated solution of dye may be used to fill the injector.) Since each run should take no more that 10 minutes, about 90 minutes should suffice for say 8 to 10 runs. You may want to repeat a run several times to test reproducibility.

Control Studies

The goal here is to determine how well a feedback control system can hold the effluent dye level at a given setpoint, and how the performance of the PID control algorithm varies with the controller gains. The procedure is as follows:

o Set a flow rate (say 800 ml/min), arrange for flow through the the last vessel only, turn on the computer, load program MXCTRL01.BAS in C:\ZQB45. Remove any air collected in the last vessel by using the vent valve. Check for air bubbles in the cuvette and remove if necessary by lowering the flow rate temporarily. Calibrate the Spec 20 as described above.

o Open the ball valve in the dye pump inlet line and plug the pump into the power strip.

o Run the program by hitting Alt-R. The program will request the name of a file to which the data collected during the rune will be written. The program will next drive the dye valve fully open, and any air in the pump should be washed out. Blue dye will enter the last vessel, and the Spec 20 transmittance will drop. Hit ENTER as requested by the program, and the valve will be driven to an almost closed position.

o As requested by the program, hit ENTER to proceed and enter the gains AKP, AKI, AKD and the setpoint. AKD is the proportional gain, AKI is the integral gain, and AKD is the derivative gain. Typical values are AKP = 0.1, AKI = 0.01,

AKD = 0.0, and SETPOINT = 700. SETPOINT = 693 corresponds to 50% transmittance on the Spec 20. Larger gains (e.g. AKP = 0.5,

AKI = 0.1) will give more vigorous control action, but may produce oscillations. Smaller gains tend to give sluggish but stable control.

o Hit ENTER as requested to proceed with the run. You will see a plot of dye concentration (red), error [= setpoint - concentration] (green), and valve position (blue), a fully closed valve corresponding to the top of the plot. Numbers corresponding to these values will also be printed below the plot. The control algorithm tries to drive the error to zero, corresponding to the lower border of the plot. The run will terminate when 300 data points have been collected. The data will be written to the named file at the end of the run.

o The control algorithm repeats every 4 seconds, so that a 300 point run takes 20 minutes. At any point in the run, hitting SPACE will stop the control action, and the program will ask for new values for AKP, AKI, AKD and SETPOINT. (Also the integral of the error will be set to zero when SPACE is hit.) If the error is reduced to zero in say the first 5 or 6 minutes, you can change the setpoint (to say 550 or to 850) and record the response of the controlled system to the step setpoint change. Alternately, you may want to make a step change in the flow rate (to say 300 ml/min or to 1000 ml/min) and observe the response of the system to this disturbance. Or, you may want to reset the ball valves to allow the flow to pass through all three vessels, and observe the effect of this change on the quality of the control.

F. REPORT

The report should describe concisely what the goals were, what was done, and what the results and conclusions were. The raw data should appear in an Appendix, and plots of typical impulse response and control run data should appear, and be discussed, in the body of the report.

G. NOTES ON RESIDENCE TIME DISTRIBUTION THEORY

Without deriving the theory, we consider an impulse injection of inert tracer to a flow system (well or poorly mixed) with volumetric flow rate Q and volume V. We can say, first, that all the tracer injected must eventually leave. Second, all the fluid in the system at time zero must eventually be washed out and replaced by new fluid. These statements can be shown to correspond to the equations

Q = D/INT(0-->inf): C(t)dt

Where the notation INT(0-->inf): C(t)dt is to be interpreted as the integral, from zero to infinity, of the function following the colon (:) , here C(t), with respect to the variable following the d, here, t.

and

V/Q = INT(0-->inf): tC(t)dt / INT(0-->inf): C(t)dt

where C(t) is the concentration of tracer in the effluent following the injection of amount D of tracer at the system inlet at time t = 0. Also, V/Q is the mean residence time of fluid in the system. Note that C may be replaced in the second equation by a multiple of C, say kC, without affecting the mean residence time V/Q. From V/Q, if Q is known, we can find V. For evenly spaced effluent concentration data we can use numerical integration, say Simpson's Rule, to find V/Q, as shown in the following example, where W denotes the Simpson's Rule weights (1 4 2 4 .... 2 4 1).

time, t

conc., C(t)

wt., W

WC

tC(t)

WtC(t)

0

2

1

2

0

0

2

4

4

16

8

32

4

5

2

10

20

40

6

2

4

8

12

48

8

1

1

2

8

8

 

 

 

38

 

128

Then, using Simpson's Rule [(Delta t/3)(1 4 2 4 2 4 .... 2 4 1)], with Delta t = 2,

INT(0-->inf): C(t)dt = (2/3) 38 = 25.333

and

V/Q = INT(0-->inf): tC(t)dt / INT(0-->inf): C(t)dt = [(2/3) 128]/25.333 = 3.368

If Q = 200 ml/min, the system volume V is 200*3.368 = 673.6 ml. Such calculations can be done easily using a spreadsheet if t and C(t) are given at evenly spaced times and Wk = 3 - (-1)k except for the first and last points, i.e. for k = 1, 2, 3, ....

Alternately one can perform the numerical integration using the trapezoidal rule:

[(Delta t/2)( 1 2 2 2 ... 2 1)], with only a small loss in accuracy.

H. WATER ROTAMETER CALIBRATION

Brooks Instrument

Model 1355

Water, 70 F

Stainless steel float

R-615-B tube

Reading (mm)

Flow rate (L/min)

150

1.368

140

1.242

130

1.128

120

1.022

110

.917

100

.818

90

.722

80

.624

70

.535

60

.448

50

.354

40

.274

30

.198

20

.112

10

.047

I. COMMENTS

o At high flow rates using only one vessel, the impulse response should correspond to a short delay followed by a single exponential, since the vessel is close to being perfectly mixed.

o At low flow rates the vessels will not be well mixed, as seen by watching the dye impulse enter the vessel. This can lead to quite complex impulse response plots.

o If the flow system ball valves are both open, the rtdf may become very different from one, or three, stirred tanks in series.

o It would be possible to use parameter estimation methods to analyze the data in terms of a model consisting of one or more well-stirred tanks in series.

o The best control runs will occur when the dye concentration has been adjusted to allow the control valve to run about 3 or 4 turns open at steady state and 50% transmittance.

o Methylene blue dye is available from any chemical supply house, for example Fisher.