EPA-600/2-77-211
November 1977
Environmental Protection Technology Series
                            i COMPUTER CONTROL OF
          ADVANCED  WASTE TREATMENT SYSTEMS
                                  Municipal Environmental Research Laboratory
                                       Office of Research and Development
                                       U.S. Environmental Protection Agency
                                               Cincinnati, Ohio 45268

-------
                RESEARCH REPORTING SERIES

Research reports of the Office of Research and Development, U.S. Environmental
Protection Agency, have been grouped into nine series. These nine broad cate-
gories were established to facilitate further development and application of en-
vironmental technology. Elimination of traditional grouping was  consciously
planned to foster technology transfer and a maximum interface in related fields.
The nine series are:

      1.  Environmental Health  Effects Research
      2.  Environmental Protection Technology
      3.  Ecological Research
      4.  Environmental Monitoring
      5.  Socioeconomic Environmental Studies
      6.  Scientific and Technical Assessment Reports (STAR)
      7.  Interagency Energy-Environment Research and Development
      8.  "Special" Reports
      9.  Miscellaneous Reports

This report has been assigned  to the ENVIRONMENTAL PROTECTION TECH-
NOLOGY series. This series describes research performed to develop and dem-
onstrate instrumentation, equipment, and methodology to repair or prevent en-
vironmental degradation from point and non-point sources of pollution. This work
provides the new or improved technology required for the control and treatment
of pollution sources to meet environmental quality standards.
This document is available to the public through the National Technical Informa-
tion Service, Springfield, Virginia 22161.

-------
                                            EPA-600/2-77-211
                                            November  1977
          DIGITAL COMPUTER CONTROL OF ADVANCED
                 WASTE TREATMENT SYSTEMS

                           by

                    Robert Yarrington
District of Columbia Department of Environmental Services
                 Washington, D.C.  20004

                     Walter W.  Schuk
                    Dolloff F,  Bishop
       Municipal Environmental  Research Laboratory
                 Cincinnati, Ohio  45268

                     James E. Bowers
                     Elliot D.  Fine
                     Hans W. Treupel
       International Business Machines Corporation
              Gaithersburg, Maryland  20760
               Contract Number 68-01-0162
                     Project Officer

                    Dolloff F.  Bishop
              Wastewater Research Division
       Municipal Environmental  Research Laboratory
                 Cincinnati, Ohio  45268
                This study was conducted
                   in cooperation with
District of Columbia Department of Environmental Services
                 Washington, D.C.  20004
                           and
       International Business Machines Corporation
              Gaithersburg, Maryland  20760
       MUNICIPAL ENVIRONMENTAL RESEARCH LABORATORY
           OFFICE OF RESEARCH AND DEVELOPMENT
          U.S.  ENVIRONMENTAL PROTECTION AGENCY
                 CINCINNATI, OHIO  45268

-------
                                  DISCLAIMER
     This report has been reviewed by the Municipal Environmental  Research
Laboratory, U.S. Environmental Protection Agency,  and approved for
publication.  Approval does not signify that the contents necessarily  reflect
the views and policies of the U.S. Environmental Protection  Agency, nor does
mention of trade names or commercial products constitute endorsement or
recommendation for use.
                                     11

-------
                                   FOREWORD
     The Environmental Protection Agency was created because of increasing
public and government concern about the dangers of pollution to the -health
and welfare of the American people.  Noxious air,  foul water, and spoiled
land are tragic testimony to the deterioration of our natural environment.
The complexity of that environment and the interplay between its components
require a concentrated and integrated attack on the problem.

     Research and development is that necessary first step in problem solution
and it involves defining the problem, measuring its impact,  and searching for
solutions.  The Municipal Environmental Research Laboratory develops  new and
improved technology and systems for the prevention, treatment, and management
of wastewater and solid and hazardous waste pollutant discharges from
municipal and community sources, for the preservation and treatment of public
drinking water supplies, and to minimize the adverse economic, social,  health,
and aesthetic effects of pollution.  This publication is one of the products
of that research; a most vital communications link between the researcher and
the user community.

     This report presents the development of digital computer control of
advanced wastewater treatment systems.  The report includes an evaluation of
the digital control technology with respect to analog and manual control.   It
provides information for selecting process control systems and thereby reduces
the adverse effects of pollution on man and his environment.


                                      Francis T. Mayo, Director
                                      Municipal Environmental
                                        Research Laboratory
                                     111

-------
                                   ABSTRACT

     Stringent water quality requirements, particularly of effluent quality,
demand the application of new control technology to wastewater treatment
systems.  The principal goal of this study was the development of a digital
computer control system for operation of wastewater treatment processes.  A
brief comparison of the operation using digital control with the operation
using existing manual and analog control was also performed.
     An IBM digital computer (System 7), with flexible hardware and software,
was placed at the EPA-DC Pilot Plant. ' The computer through a fixed disc and
associated software contained the capacity for storage of up to 4 months of
operator, laboratory, and on-line sensor data.  The control programs were
developed by IBM and the Pilot Plant Staff from analog or manual data and
were applied to physical-chemical operations in two separate treatment
systems:  a physical-chemical system treating raw wastewater and a three-
stage activated sludge system treating primary effluent.
     Three unit processes of the physical-chemical system--lime clarification,
recarbonation, and breakpoint chlorination—were initially selected for the
computer control because the chemistry of the processes was sufficiently
defined to permit process modeling and development of control algorithms.
After development of the algorithms, digital control was  successfully applied
to the physical-chemical system.  The algorithms in the physical-chemical
system controlled sludge wasting and lime dosing in lime  clarification,  CC^
and FeClj dosing in recarbonation, and sodium hydroxide and chlorine dosing
in breakpoint chlorination.   Digital control was next applied to physical-
chemical operations in the modified aeration, nitrification, and denitrifica-
tion stages of the biological system. The algorithms controlled the alum
dosing and D.O. in modified aeration, the lime dosing for pH control in
nitrification, and the CH^OH and alum dosing in denitrification.

     In short term comparisons between digital, manual and analog control,
data indicated digital control was a viable alternative to the manual and
analog control approach.  The digital process responded satisfactorily to
gradual and step changes in flow and wastewater substrate concentrations.
Both treatment systems under digital control produced 90  percent or more
removals of nitrogen, phosphorus, and organics.  Although these tests did not
reveal any significant differences in system performance  under the various
control approaches, the digital control produced the smallest pH and chemical
feed variation.  Long term full-scale operation is required to statistically
compare the effectiveness of automated versus manual control approaches  for
maintaining product quality and minimizing the chemical dosages.

     This report was submitted in partial fulfillment of  contract #68-01-0162
by the Government of the District of Columbia, Department of Environmental
Services under the sponsorship of the U.S. Environmenta  Protection Agency.
This report covers an experimental period from December 1972 to December 1974.

                                     iv

-------
                                   CONTENTS


Foreword	-	     iii

Abstract	      iv

Figures	      vi

Tables	     vii

Acknowledgment	   viii

     1.  Introduction  	       1

     2.  Conclusions	       2

     3.  Recommendations 	       4

     4.  Experimental Systems  	       5

              Physical-Chemical treatment  	       5
              Three-Stage activated sludge treatment 	       7
              Computer system hardware ...  	       9

     5.  Control Approach  	      14

              Control systems  	      14
              Algorithm development	      16

     6.  Computer Operation of Pilot Plants  .  	      32

              Physical-Chemical system .	 .  .  .      32
              Three-Stage activated sludge system  	      36

References	      40

-------
                                   FIGURES
Number                                                                   Page
   1   EPA-DC Pilot Plant "physical-chemical system" 	      6

   2   EPA-DC Pilot Plant "three-stage activated sludge system"  ....    8

   3   IBM System/7 configuration  	   10

   4   Information Transfer System ....... 	  .  	   12

   5   Control algorithm structure for effluent pH regulation of
         the lime clarification, recarbonation and nitrification
         subsystems	   19

   6   Mass-proportional chemical feed control 	  .....   26

   7   Dissolved oxygen control loop	  .   28

   8   Dissolved oxygen under automatic control  	   29

   9   Flow compensation for dissolved oxygen control  	   31

  10   Chlorine dosage ratio versus flow rate	35

  11   Three-stage activated sludge system diurnal flow pattern  ....   37
                                     VI

-------
                                   TABLES
Number                                                                   Page
  1   Physical-Chemical Control Systems 	      15




  2   Three-Stage Activated Sludge Control Systems  	      15




  3   Physical-Chemical System Operating Conditions 	      33




  4   Physical-Chemical System Removal Efficiencies 	      34




  5   Three-Stage System Removal Efficiencies 	      38

-------
                                ACKNOWLEDGEMENTS
     The assistance and cooperation of the operating staff at the EPA-DC Pilot
Plant is gratefully acknowledged.  We are particularly indebted to Luis
Gutierrez and Ralph Bernstein of IBM, Robert B.  Samworth of the Department of
Environmental Services, and Thomas A. Press ley of the U.S. EPA who contributed
significantly to the data collection, algorithm development,  and process
simulation.
                                    Vlll

-------
                                   SECTION 1

                                 INTRODUCTION
     The Municipal Environmental Research Laboratory,  Cincinnati,  Ohio.,
and the District of Columbia Department of Environmental Services  (DES),
conducted pilot studies of advanced wastewater treatment of municipal waste-
water at the Environmental Protection Agency - District of Columbia (EPA-DC)
Pilot Plant. The pilot work evolved into studies of two basic treatment
approaches; one approach consists of physical-chemical processes;  the other,
of advanced biochemical processes.

     The unit processes within these approaches have been combined into
various treatment systems able to remove carbon, phosphorous, and  nitrogen
from wastewater.  The unit processes may be represented by two basic
treatment systems, physical-chemical treatment of raw wastewater^  and three-
stage activated sludge treatment^ of primary effluent.  The pilot  studies
have provided design data while demonstrating water quality and systems
reliability.

     Automated process control and automatic data acquisition represented
an important part of the research effort.  The stringent objectives of
product quality sought from the advanced systems mandated good process
monitoring and operations.

     The DES and EPA engaged International Business Machines Corporation
(IBM) to provide a flexible, sensor-based, computer system for research on
data acquisition, alarm monitoring, and process control of the various
advanced wastewater treatment systems in the pilot plant.

     The principal goal of the study was the development of digital
algorithms to control various processes and operations in the physical-
chemical three-stage activated sludge systems.  In cooperation with the pilot
plant staff, IBM developed^ the computer-control programs for the  physical-
chemical system from analog and manual data provided by the pilot  plant
staff testing and evaluation of the digital control system was performed  by
the pilot plant staff after completion of the software.  Subsequent software
for the physical-chemical operations in the biological system were developed
and' tested by the pilot plant

-------
                                   SECTION 2

                                  CONCLUSIONS
     The operation of physical-chemical and selected processes within the
three-stage activated sludge systems under digital control represented the
first successful digital computer control of wastewater treatment systems for
the removal of organics, phosphorus, and nitrogen.  The computer operated
physical-chemical and advanced biological systems produced more than 95
percent removal of organics, 98 percent removal of phosphorus and 90 percent
removal of the total nitrogen.  The brief performance studies, however, did
not reveal any significant difference in the performance of physical-chemical
treatment under manual, analog or digital control or the three-stage activated
sludge treatment under manual-analog or digital control.

     The successful development of digital control in this study employed
different approaches in the design of twelve control algorithms for the two
treatment systems.  In the physical-chemical system, three control loops
employed flow proportional (feed-forward) control algorithms for sludge
wasting from both lime clarification and recarbonation and for FeCl^ addition
in recarbonation.  The lime and C02 feeds in the clarification process used
flow-proportional (feed-forward) proportional-integral  (feedback from pH
error) algorithms.  The digital control of breakpoint chlorination (Cl2 and
pH) employed a digital model of manual operation.  Generally, the model
provided satisfactory control of the complex process with the exception that
large step changes in flow produced slow control recovery.

     In the three-stage activated sludge system, three control loops also
employed flow-proportional control algorithms for FeClj addition in modified
aeration and methanol and alum addition in denitrification.  A mass propor-
tional (feed-forward) control algorithm using nitrate concentration and
process flow was developed as an alternate control strategy for methanol
addition.  With little diurnal variation in the nitrate concentration, the
mass proportional algorithm did not exhibit any advantage over the flow-
proportional for control of methanol addition.  The digital control of
dissolved oxygen in modified aeration and the pH in nitrification employed
flow-proportional proportional-integral algorithms using the D.O. or pH
error for feed-back.  Abrupt changes in flow or in reactor solids concentra-
tions produced oscillation in the D.O. control loop.  Reducing the process
gain and filtering the signal from the D.O. sensor produced effective control.

     The digital control usually produced the smallest variation from control
setpoint.  While the short performance tests of this study did not reveal
significant process quality or chemical consumption differences between

-------
control methods,  the improved control to setpoint in the digital approach
indicated a potential for minimizing chemical consumption.

     The computer exhibited a gradually increasing down time and eventually
failed.  Corrosion of the electrical terminals within the computer revealed
a need for protecting the computer from the corroding atmosphere of the
wastewater treatment.plant.

-------
                                   SECTION 3

                                RECOMMENDATIONS
     To fully assess and compare the capabilities of analog, digital,  and
manual control approaches for continuous production of appropriate quality
water, full scale demonstrations should be supported.  Long-term operation,
with careful data acquisition is needed to assess the statistical effective-
ness of the control approaches for minimizing the chemical and energy
consumption and for increasing systems reliability.

     Existing sensors for measurement of organics, phosphorous and nitrogen,
should be improved for full time on line monitoring.  The improvements needed
include reduction of lag time, reduced maintenance and improved precision
and sensitivity.

     Long term operation is needed to develop experience data on maintenance
of process sensors and control equipment within the wastewater plant
environment,

     If automated control technology is the answer to reliable product
quality, training manuals should be prepared to provide the knowledge
necessary for the operation and maintenance of these control systems.

     Finally specification on sensing devices should be developed to reduce
control system failures through improper selection of sensors.

-------
                                   SECTION 4

                             EXPERIMENTAL SYSTEMS

PHYSICAL-CHEMICAL TREATMENT

     In the pilot studies, the basic physical-chemical system (Figure 1)
consists of screening, two-stage (high pH) lime precipitation with recarbona-
tion, dual-media filtration, breakpoint chlorination,  and downflow granular
carbon adsorption.  The complete system was designed for a nominal capacity of
189 m^/day (50,000 gpd) with a flow controller which could impress a diurnal
variation of 4:1 maximum to minimum flow.

     In the first stage of the lime precipitation process, raw wastewater,
powdered CaO at a dosage of approximately 300 mg/1, and recycled solids were
rapidly mixed and then flocculated in a turbine mixed  flocculator.  The lime
increased the wastewater pH to approximately 11.5 and  precipitated bicarbonate,
phosphate, and magnesium ions from the water.  The magnesium hydroxide that
was formed at the high pH flocculated the organic solids and mineral precipi-
tates which were removed after flocculation in a rectangular settler.

     The limed water, after sedimentation, flowed through an open channel  to
recarbonation, where carbon dioxide was added in a turbine mixed recarbonation
tank.  The COo reduced the wastewater pH from 11.5 to  approximately 9.5 and
precipated the excess calcium ions added in the liming stage.  Five mg/1  of
ferric ions were also added in the recarbonation tank  to form the flocculant
Fe(OH)3.  The water was flocculated in a turbine mixed flocculation basin  and
then settled.

     In each stage of the two-stage clarification process, settled solids  were
recycled from the bottom of the settler at a flow rate equal to 10 percent
(empirically determined) of the average influent flow to the reactor to
provide nuclei for chemical precipitation.  The solids balances in the slurry
pools of the settlers were maintained by wasting solids at a flow rate equal
to approximately 1.5 percent of the influent flow.

     The overflow from the second-stage settler was pumped to a distribution
box ahead of two filters.  It then flowed by gravity through the dual-media
filters to remove the residual narticulates.  Each filter was packed with
0.61m (24 inches) of  0.5 mm Cb^.1 above 0.15 m (six inches) of 0.45 mm sand.

     After filtration, the wastewater was chlorinated  to oxidize the ammonia
to nitrogen gas.  In this reaction, the chlorine formed hypochlorous acid
which oxidized the ammonia first to monochloramine and then to N2 gas. A  base
was required to neutralize the HC1 produced by the chlorination reactions.

-------
FIRST STAGE CLARIFICATION
     BELT
      SCALE" FLow
 RAW  -
SEWAGE
               SLUDGE
                TANK
                    REACTOR

                      U" CONTROL
                     jAVALVE
                     HEVEL'
                      PROBE
                 ^^f CONTROL
                  " VALVE  I
                     \  /
            FILTRATION

                   Ap
                                                    RECARBONATIOM
                                                         Fed,
                                   BREAKPOINT CHLORINATION
                                 NH:

                          [FLOW  CONC.,

                          J_J	L
                                  HREACTOli
                                                 PH  CI2
                           FLOW
                  A,
                                      CONTROL
                                        VALVE
                                                        "NaOH
                                                PUMP
                                                                               TO
                                                                               FILTERS
CONTROL
VALVE

  LEVEL
  PROBE
CONTROL
VALVE
                                                                      ADSORPTION
                                                                                  EFFLUENT
        Figure  1.   EPA-DC pilot plant "physical-chemical system."

-------
The breakpoint occurred in the reaction when the NPL-N concentration was
reduced to zero.  At this point, free available chlorine was detected and the
total residual chlorine was minimized.

     The chlorine demand depended upon the ammonia and nonammonia chlorine
demand and the desired amount of free residual chlorine in the wastewater.
For the Washington, B.C. lime clarified raw wastewater, the Cl-.NHj-N dosage
weight ratio was approximately 9:1.  Breakpoint chlorination was'maintained
using a Kenics static mixer with 21 mixing elements and 1.6 seconds average
detention time.  The rapid mixing, a controlled pH of approximately pH 7 and
a low free residual chlorine concentration which favors oxidation to N2
minimized the undesirable production of nitrogen trichloride and nitrate.

     After a l~minute chlorine contact time, the flow from the chlorination
process was pumped through downflow granular carbon columns with a detention
time of approximately 30 minutes to remove most of the soluble residual
organics.  The carbon also removed the residual total chlorine from the
breakpoint process.

     The waste solids from the physical-chemical treatment system were
thickened and classified with a centrifuge into carbonate (centrifuge cake)
and non-carbonate solids (centrate).  The centrifuge cake was recalcined to
produce CaO and C02, for reuse in the clarification process.  The centrate
was dewatered by pressure filtration.  These solids handling options while
tested in the pilot plant were not routinely operated at the pilot scale and
were not automated.  During the automation study, recalcined lime, however,
was used with digital pH control operating the lime feeding system.
THREE-STATE ACTIVATED SLUDGE TREATMENT
     The basic three-stage activated sludge system (Figure 2) consisted of
modified aeration, nitrification, denitrification, and filtration.  The
system was designed for a nominal capacity of 189 m^/day (50,000 gpd) with
a flow controller which impressed a diurnal variation of 2.1:1 minimum to
maximum flow.  Primary effluent was pumped to the modified aeration reactor
which consisted of three completely mixed passes of equal size.  Compressed
air was supplied through perforated PVC pipe diffusers and the dissolved
oxygen levels in each stage were manually maintained between 1 and 2 mg/1.
Ferric chloride was added to the third pass of the reactor.  The effluent
was discharged to a circular peripheral feed clarifier.  Recycle solids were
returned at a constant percentage of influent flow.

     The effluent from the modified aeration clarifier was pumped to the
second biological system for nitrification.  The nitrification reactor
consisted of four complete mix passes operated in series.  Air was supplied
independently to each pass and the dissolved oxygen was manually maintained
between 0.5 and 4.0 mg/1.  A dry lime feeder was located above the first pass
and lime was automatically (analog) fed to maintain the desired effluent pH.
The effluent from the reactor flowed to a circular center-feed clarifer and
recycle solids were returned from the clarifier to the reactor at a constant

-------
                                MODIFIED AERATION
     PRIMARY-
F
FLOW
1
— *.

D.O. D.O.
1 1
PASS
1
PASS
2
eC
*
'3
PUMP
PASS
3



                  CONTROL
                    VALVES!
          CaO  xSCREW
                              AIR
AIR
                                                •SLUDGE
                                                   TANK
                            TO
                            NITRIFICATION
                    LEVEL
                    PROBE

                   CONTROL
                   VALVE
                                   NITRIFICATION

	 *.
FLOW
//PH
PASS
1
PASS
1
PASS
1
PASS
1
t t 1 f
AIR AIR AIR AIR
r^
N
\ SETTLER ]

/
*V CONTROL
A VALVE
•SLUDGE
TANK\ /
LEVEL
PROBE
                                                                     TO
                                                                     DENITR1FICATION
     METHANOL
 FLOW
  NO3
CONC.
       •ALL WASTE MECHANISMS
       WERE MANUALLY ACTIVATED
                                           ALUM

V) PUMP MIXERS
PASS
1
PASS
2
PASS
3

PASS
4
                2
-------
rate.  Methanol was pumped to the effluent from the nitrification clarifiei
and the process flow as sent to the denitrification reactor.

     The denitrification reactor consisted of four, covered,  mechanically
stirred tanks of equal size operated in series.  The tanks were covered to
exclude oxygen transfer from the air.  The effluent from the  denitrification
reactor then flowed directly into a singly, aerated, completely mixed chamber
in order to strip nitrogen gas from the water and to oxidize  any excess
methanol leaving the denitrification reactor.  Alum was also  added to this
chamber for residual phosphorus removal and solids flocculation.  Following
aeration, the effluent flowed to a circular center-feed clarifier.  Recycle
solids were returned from the clarifier to the denitrification reactor at a
constant rate of flow.

     Effluent from the denitrification clarifier flowed to a  splitter box,
where it was equally divided before flowing to a dual-media and multi-media
filter.  The dual-media filter consisted of 0.30 m (12 inches) of 0.6 to
0.7 mm sand overlain by 0.61 m (24 inches) of 1.2 to 1.4 mm coal.  The
multi-media filter consisted of 0.08 m (3 inches) of 0.2 to 0.35 mm ilmenite
overlain by 0.23 (9 inches) of 0.4 to 0.5 mm sand overlain by 0.2 m (8 inches)
of 1.0 to 1.1 mm coal overlain by 0.41 m (16 inches) of 1.5 to 1.6 mm coal.
Differential pressure readings were taken at various bed depths, and the
filters were backwashed either when the total pressure drop reached 3.0 m
(120 inches) or after 24 hours even though the pressure drop  had not yet been
attained.
COMPUTER SYSTEM HARDWARE
     To implement the digital control system for the control of the physical
chemical and three-stage activated sludge treatment processes, an IBM
System/7 was used.  This modular, sensor-based digital computer with
interrupt capability was also used for data acquisition.  The hardware
consisted of one processor module including a 16K monolithic memory with
400 ns cycle time, two input/output (I/O) modules, a disc storage module,
with 1.23 megawords of storage capacity, and one operator station (Figure  3).
The computer was located in an air-conditioned office within the pilot plant
building.  The multifunction I/O modules provided the required analog and
digital inputs and outputs.  Some 60 analog inputs points, including the
analog inputs for process control, were monitored by the computer representing
measurements for pH, flow, pressure, sludge density, temperature and online
analysis of nitrate, ammonia, and free chlorine concentrations.  Thirty-two
of these analog points were read once per second and their values smoothed
for .process control.

     Digital signals from switches and inputs from pressure sensors in
receiver tanks, hydraulic levels, etc., was handled through 35 digital
input points.  For one group of 16 inputs, an interrupt feature was included;
this feature allows comparison of the status of this group bit-by-bit against
a 16-bit reference register.  If the status of one or more bits did not agree
with the register bits, an interrupt could be initiated.  The operator

-------
o
ANALOG
INPUT	
DIGITAL.
INPUT

ANALOG
INPUT —
                                            S/7
                                         PROCESSOR
                                         MODULE
                                        MULTIFUNCTION
                                        MODULE
                                        MULTIFUNCTION
                                        MODULE
ANALOG OUTPUT
DIGITAL OUTPUT
                                Figure 3.  IBM System/7 configuration.

-------
communicated with the computer through the keyboard and the printer on the
operator station.  Paper tape reader and punch were also provided on the
operator station.

     For the data acquisition task, all 60 analog and 35 digital input points
were scanned periodically.  The data was either converted to engineering units
and punched on paper tape at the operator station for further processing (data
reduction, report generation, etc.) or the data was stored on the disc.

     The disc was used for program storage as well as data storage.  Process
control and data handling programs were transferred to the processor module
at a desired frequency or on request, preformed and returned to disk storage
(Figure 4).   The programs operated in either of two areas dependent on their
function and residence time.  The data storage allowed for the automatic
collection,  hourly averaging and disc storage of up to 128 sensor inputs or
automatically computed values.  The disc allowed up to 128 operator entered
values gathered as often as once per hour.  It also allowed the manual entry
of up to 16 laboratory analyses per day taken from up to 10 sample points per
unit process on up to 12 unit processes.  This amounted to a total of 8,064
inputs per day for four months.

     The previously described analog and digital input points were also used
for alarm monitoring.  If"process variables were out of an operated selected
range or operations were not performed properly, the operator was notified by
an audio/visual alarm signal.

Data Acquisition

     The data acquisition and storage system of the System 7 accepted data of
four different categories; continuous sensor read by the computers, calcula-
tions made by the computer, operator readings and analyses, and laboratory
analyses.

     Each sample was accessed by a four digit alphanumeric identification
code.  The first character was a letter which represented the unit process.
The second character was a number between "0" and "9" which represented the
sample point within the unit process.  The third and fourth characters were
either numbers or letters and represented the type of sample made (for example,
"pH" and "DO" represented pH and dissolved oxygen, respectively).

Continuous Sensors—

     Process monitoring equipment located throughout the pilot plant
transmitted information electronically to the computer.  The sensors included
flowmeters, dissolved oxygen analyzers, pH probes, temperature transmitters,
suspended solids meters and wet chemical analyzers measuring ammonia, free
residual chlorine, and nitrite-nitrate.  The 60 individual sensors were read
every 2 minutes, linearized where necessary, converted to engineering units,
averaged for one hour and stored in the disc file according to the sample
identification code, month, day and hour.
                                      11

-------
                             IMPUT
OUTPUT
ts)
MANUALLY ENTERED DATA
OPERATOR COMMANDS
OPERATOR READINGS
LABORATORY ANALYSES

AUTOMATICALLY ENTERED
DATA
ANALOG SENSORS
DIGITAL SWITCHES

OPERATOR REQUESTS
SENSOR READINGS
PROCESS STATUS
PROCESS REPORTS



S/7







'•

DISK FILE
(INPUT-OUTPUT)
PROGRAM STORAGE
DATA STORAGE

























' »
PROCESS CONTROL

DO CONTROL
pH CONTROL
CHEMICAL FEED CONTROL


ALARM MONITORING
PROCESS OUT OF LIMITS
ACTUATOR FAILURE
SENSOR FAILURE
WATCHDOG TIMER

REQUEST OUTPUT
SENSOR READINGS
PROCESS STATUS
PROCESS REPORTS
                                      Figure  4.   Information transfer system.

-------
Computed Values--

     The computer automatically logged information concerning the control
of the processes such as chemical usage rates,  dosage,  etc.   These values
were averaged for an hour and stored in the disc file,  again according to
the identification code, month, day and hour.

Operator Data—

     The operators on a regular schedule read non-transmitting devices,
performed basic analyses on.process samples such as alkalinity and
furbidities and measured process variables such as pH and DO where
continuous sensors were not installed.  Up to 128 separate measurements
read up to once per hour were then manually entered through the operator
station into the computer.  To speed up the entering process and to minimize
typographical errors, the operator gave the computer the date and time of
sample readings whereupon the computer initiated an automatic quizzing
process.  Beginning with the first sample on the operator log sheet, the
computer pointed out the identification code to which the operator responded
by typing only the numerals and decimal point.   The computer then typed the
identification code of the next sequential item on the operator's log and
continued this process either until the entry was complete or the operator
terminated the process.

     The storage and data acquisition capabilities of the system were used
to gather data for algorithm development.  Programs were also developed for
report generation but never implemented.
                                      13

-------
                                  SECTION 5

                               CONTROL APPROACH
CONTROL SYSTEMS
     Three processes of each system; lime clarification, recarbonation,  and
breakpoint chlorination in the physical-chemical system, and modified
aeration, nitrification and denitrification in the three-stage activated
sludge system were selected for the application of computer control (Tables
1 and 2").  Only physical-chemical processes or operations were controlled in
the three-stage activated sludge system.

     The digital process control, system consisted of eleven independent
control functions (Tables 1 and 2).   The process information required by
these functions was presented to the computer in the form of analog inputs
and two discrete inputs.  Analog and digital outputs from the computer were
used for control.  The analog inputs were sampled by the computer once per
second and then processed by a low-pass digital filter of the form commonly
referred to as an exponential filter.  The mathematical representation of the
filter is:

      C(nT)    =    (l-a)C'CnT) + aC{(n-l)T>                               (1)

where C(nT)    =    smoothed value of measured process variable at the n
                    sample time.

      C  (nT)   =    measured value of process variable at the n   sample
                    time.

      T        =    sample period.

      a        =    parameter which determines the frequency discrimination
                    characteristics of the filter 0
-------
TABLE 1.  PHYSICAL-CHEMICAL CONTROL SYSTEM
Stage
Lime
clarification

Recarbonation


Breakpoint
chlorination

Control Objective
pH setpoint
range: 11.3-12.0
Sludge wasting
range: 0.5-2.5%
of flow
pH setpoint
range: 9-9.8
Sludge wasting
range: 0.5-2.5%
of flow
FeClj dosage
range: 0-10 mg/1
Free Clj residual
range: 3-5 mg/1
pH setpoint
range: 7.1-7.5

Control Variable
CaO Feed
range: 0-24 Ib/hr
Volume
C02 Feed
range: 0-480 Ib/hr
Volume
FeCl3 Feed
C12 Feed
range: 0-120 Ib/day
NaOH Feed
range: 0-6.8 liter/
min.
(8.5%) NaOH by weight
Sensors
5H assembly
•lagnetic flow meter
Magnetic flow meter
Level switch
iH assembly
Magnetic flow meter
Magnetic flow meter
Level switch
•iagnetic flow meter
Magnetic flow meter
\utoanalyzers for
:12 and NH3
DH assembly
•iagnetic flow meter
Actuators
Gravimetric
feeder
Electropneuma tic
ball valve
Equal percentage
valve
Electropneumatic
ball valve
Peristaltic pump
V notch
Chlorinator
Positive displace-
ment pump
 TABLE 2.  THREE-STAGE ACTIVATED SLUDGE CONTROL SYSTEMS
Stage
Modified
Aeration
Nitrification
Denitrification
Control Objective
FeCl3 dosage range:
1-1.2 times
Phosphorus Cone.
D.O. Concentration
range: 1-2 mg/1
pH Set Point range:
7.0-7.5
CVUOH dosage range:
3.7-4.6 times the
Nitrate Cone.
Alum dosage range:
38.7-46.9 mg/1
Control Variable
FeCl3 Feed
Air Flow
CaO Feed
CH-jOH Feed
j»lum Feed
Sensors
Magnetic flow raecer
Magnetic flow meter
D.O. Meter
Magnetic flow meter
pH Assembly
Magnetic flow meter
Autoanalyzer for
Nitrate
Magnetic flow meter
Actuators
Positive Displace-
ment Pump
Linear Throttling
Value
Gravimetric Feeder
Positive Displace-
ment Pump
Positive Displace-
men t Pump
                      15

-------
differential pressure to automatically control backwashing cycles of the
filters in both treatment systems and the carbon columns in physical-chemical
systems.

     The computer indirectly controlled the water quality from both treatment
systems by minimizing the pH error in lime clarification, recarbonation,
breakpoint chlorination, and nitrification; by controlling the dosage of FeCl3
in recarbonation and mqdified aeration, the dissolved oxygen concentration in
modified aeration, the dosage of CH^OH and alum in denitrification, the free
residual Cl^ concentration in breakpoint chlorination,, and finally by control-
ling the amount of sludge wasted from lime clarification.


ALGORITHM DEVELOPMENT
     The control objectives in Tables 1 and 2 require control algorithms
ranging from the simple feedforward loops to complex feedback/feedforward
combinations.  The control algorithms in some cases included more than one
principal control relationship and supporting computer control statement.   The
actual programs were written in the machine language of the System/7.   The
principal control relationships and the computer control statements are
described here.  It should be noted that the equations are presented in
general form.  The constants or empirical functions represented by symbol in
the general form of the central algorithm must be determined for each site
specific application.


Sludge Wasting Control


     The algorithms developed to provide regulation of lime sludge wasting
used feedforward control only.  The algorithm performed rectangular
integration of the influent flow rate to obtain the volume (Vw) of influent
to the physical-chemical system since the previous sludge wasting.

      Vw       =    TZQ(nT)                                                (2)

where T        =    interval of integration (sample period)

      Q(nT)    =    wastewater flow rate.

When a percentage of this integrated volume equalled or exceeded the volume
of the sludge receiver tank, the algorithm commanded the sludge receive tank
drain valve to close and the sludge wasting valve to open.  A level probe
on the sludge receiver tank signaled (discrete input) the computer when
the wasting operation was complete, and the algorithm subsequently commanded
the sludge wasting valve to close and the receiver tank drain valve to open.
The sludge receiver tank volumes for both lime clarification and recarbona-
tion, as well as the waste percentages for each unit process, could be
specified by the process operator.  The actuator signal from the computer
was:

                                     16

-------
      Actuator signal = {Jpp   VRT  is full                                (3)

where VRT             = volume of sludge receiver tank.


Chemical Addition Control
     The development of the algorithm for regulation of the Fed, dosage to
lime clarification and modified aeration, and CHjOH and alum dosages to
denitrification, paralleled that of the sludge wasting algorithm as a
feedforward control was employed.   This feedforward algorithm governed the
percentage of time that the peristaltic (set rate with variable time) pump
dispensing the FeClj, CHsOH, alum, etc., remained activated.  The algorithm
performed the following calculation once per minute to determine the ON time
in seconds per minute:
      ON  =    6° Vl W">                                                 (4)
                 V  V
                 V2 V3

where V   =    desired dosage (mg/1 of wastewater)

      ¥„  =    concentration of chemical solution (mg/ml of soln.)

      V,  =    pump rate (ml/min).


The computer actuator signal to the pump was on or  off,  based on the ON time.
The computer control of the chemical solution feed  rate  was also evaluated
for two other types of pumps:  a set-stroke with variable speed and a set
speed with variable stroke.  The pumps were compared for reliability and
performance.  All of these pumps were designed for  positive displacement
and head pressure insensitivity in their normal operating ranges.   However,
the feed rates of all three pumps varied with the level  of the chemical
storage tank, i.e. with suction head pressure.  With a constant head chemical
storage tank, the variable on-time pump performed quite  well.  It was
necessary for the variable speed pump to incorporate an  empirical table
look-up routine in the computer program to account  for a non-linear relation-
ship between the pump rate and the input signal. The computer by
interpolation selected the speed of the pump.  When operated with a constant
head feed tank, the pump then showed good performance and repeatability.   The
variable stroke pump presented the greatest difficulties and never performed
satisfactorily.  In addition to its suction head pressure sensitivity,  the
pump showed nonlinearity and poor repeatability throughout its operating
range.  From a material balance, the control algorithm for the variable speed
pump was:
                                     17

-------
      V   =    Vl Q (nt)                                                   CS)

               ~2

The relationship for the computer actuator signal was:

      Actuator signal    =    £__ V,                                       (6)
                               rb  o

where £„„                =    empirical functional relationship between
                              V, and the final element, the pump output.


Effluent pH Control


     The basic structure of the algorithms developed to regulate the effluent
pH of the lime clarification and recarbonation process is presented in
Figure 5.  The control loop employed pH error for feedback and process flow
for feedforward control.  The approach taken in the design of the Proportional
Integral (PI) Controller for feedback control was to:

     1.   Hypothesize a mathematical process model structure;

     2.   Obtain step response data on the processes throughout the
          range of process operating points;

     3.   Develop the process model;

     4.   Mathematically derive a deadbeat control law for the process
          model where deadbeat control is designed to reduce the pH error
          to zero in one sample time.

The process models developed for the lime feed and CCU feed were represented
as first order linear differential equations with lumped time invariant
parameters.  As was shown (3), the deadbeat control law for this model
structure took on the same structure as that of the familiar digital PI
control law.


      D(nT)    =    	1_  {   e"T/T>  E(nT) + 	1_   I E(nT)              (7)
                    P(nT)   1 _ e-T/t          P(nT)

where D(nT)    =    required chemical dosage computed by the PI controller
                    at the n*-h control instant
                                                  .I.
      P(nT)    =    process gain computed at the n   control instant

      E(nT)    =    difference between the desired pH  (set point) and
                    the smoothed value of the measured pH

      T        =    time constant of the process model
                                      18.

-------
INFLUENT
FLOW
RATE
              FEED-
              FORWARD
              CONTROLLER
                             REQUIRED
                             CHEMICAL
                             DOSAGE, D
                             DESIRED
                             PH
                        PI
                        CONTROLLER
REQUIRED WEIGHT
OF CHEMICAL PER
UNIT TIME, W
              ACTUATOR
              CONTROL
                    CHEMICAL, M
              PROCESS
AUTOMATIC
TUNING OF Pi
CONTROLLER
PARAMETERS
                                                        PH
Figure 5.   Control algorithm structure for effluent pH regulation of the lime clarification
           recarbonation and nitrification subsystems.

-------
      T        =    control period (T = 60 seconds for the lime clarification
                    and lime addition in nitrification; T = 15 seconds for
                    recarbonation)

      e             a constant = 2.7183.

The set of step response curves associated with the two unit processes were
used to obtain steady-state process gain curves which gave the relationship
between the effluent pH and the chemical dosage being introduced to the
process.  These two empirically derived gain curves were then approximated
by analytical functions.

      P(nT)    =            BpH(nT)	,  gain function for the lime   (8)
                    (not -  [|n(a- pH(nT)]      clarification process and
                                              for lime addition in
                                              nitrification.

      P(nT)    =            pH(nT)	,  gain function for the        (9)
                    3 2 [|na -  |n pH(nT)]recarbonation process

where a, $     =    constants

      pH(nT)   =    smoothed value of pH at the n   control instant.

The constants in Equations 6 and 7 were selected to reduce the process error
to zero in one sample time.

     The analytical functions thus developed were used in the control
algorithms to compensate the PI controller parameters for the nonlinear
process gain characteristics.  This parameter tuning function produced near
uniform algorithm performance throughout the design range of operating
set points.

     Feedforward control was added by forming the product of smoothed influent
flow rate and the feedback output of the PI controller—the required chemical
dosage  (weight of chemical per unit volume of wastewater)--to compute the
weight of lime or C02 to be added, W(nT):

      W(nT)    =    D(nT)  {Q(nT)>.                                       (10)

The actuator control for the lime clarification process consisted of a second
feedback loop which governs the percentage of time that the gravimetric
feeder was operated (ON/OFF) during the period of time between subsequent
control actions  (one minute, in this case).  The delivered weight of CaO per
minute, M(nT), is measured and time integrated (totalized).  When the
totalized weight of CaO equals that required by the output of the feedforward
controller, the CaO feeder is turned off.
                                      20

-------
                                     n
                              ON  ,   Z  M(nT) > W(nT)                     (11)
      Actuator Signal    =
                              OFF, otherwise

Actuator control for the recarbonation process was implemented differently,
where an equal percentage valve was used to"control the flow of CXU gas.  The
nonlinear valve characteristics were empirically determined.  The character-
istics describing the functional relationship between the C02 flow rate and
actuator signal issued by the computer were implemented in the control
algorithm as a table look up and used to develop the correct actuator
signal in response to output of the feedforward controller—the required
C02 flow rate.  Thus the computer actuator signal was:

      Actuator Signal    =    fp  W(nT)                                   (12)

where f_                 =    empirical functional relationship between
                              valve C02 flow and W(nT).

     Actuator control of the pH in nitrification was similar to the actuator
control for lime clarification except that the capability for control by time
integrated weight was not available.  Dry lime was added by activating a screw
feeder at constant feed rate for a number of seconds each minute to meet the
pH control requirements.  The actuator signal was:

      .             .         .-ON  , > a W(nT) -,                          ,.,,
      Actuator signal    =    {,-.,,„ ' —,    r  ' }                          (13)
                 &             OFF,  otherwise

where a                  =    rate of CaO delivery, g/sec.


Breakpoint Chlorination Control


     The initial planning for a breakpoint chlorination control algorithm
called for the development of a steady-state control algorithm to achieve
noninteractive regulation of free residual chlorine and effluent pH.  It soon
became apparent, however, that the quantity and quality of process response
data required to develop the intended control strategy was not .likely to be
forthcoming under manual control of the process.

     The process was further complicated by the large Cl2 dosage (150 mg/1)
for breakpoint and the small residual (4 ± 2 mg/1) required for control.  For
effective control, the control hardware evolved to the use of two actuators,
a large chlorinator supplying the major portion of the feedforward dosage
and a small chlorinator controlled by feedback to complete the breakpoint
and control the free residual chlorine.

     A decision was made that a different control strategy must be designed
and implemented.  The intent was to provide a digital control strategy that
could be used as a basis for collecting the process data necessary to model
the breakpoint process.


                                      21

-------
     The algorithm employed a dead band control strategy with a logic program
and may be thought of as the implementation of the procedures that a process
operator might employ in manually controlling the process.  The control
functions were as follows:

     1.   Feedforward control of Cl2 and NaOH to compensate for variations
          in wastewater flow rate and ammonia concentrations were done
          every five seconds.  The new dosages were computed from old
          dosages by adding linear incremental corrections to the old dosages.

     2.   Feedback control of Cl2 and NaOH to correct for out of limit pH and
          Cl2 concentrations were done in a routine which was entered on
          either a 5-second or a 5-minute cycle.  When entered, the routine
          checked first the effluent pH and second the free residual chlorine.

Due to the influence of pH on the analysis of free Cl2,  chlorine dosage
adjustments could not be made when the process pH was less than 6.6 or greater
than 7.8.

     The logic sequence to control the breakpoint process was as follows:

     o    Read pH.

     o    If pH was within dead band (± 0.2 pH units around setpoint) limits,
          read free C\2 residual.  If free Cl£ was within dead band limits
          (± 2 mg/1 of setpoint), wait five seconds and reenter logic sequence,

     o    If pH was outside dead band limits but inside alarm limits (< 6.6 or
          > 7.8), read free C\2 residual.  If free €!„ residual is within dead
          band limits, adjust NaOH dosage.  Wait five minutes and reenter
          logic sequence.

     o    If pH was within dead band limits, read free C\2 residual.  If free
          Cl2 residual was outside dead band limit, adjust Cl2 dosage and
          maintain C^/NaOH ratio.  Wait five minutes and reenter logic
          sequence.

     o    If pH was outside dead band limits, but inside alarm limits, read
          free Cl£ residual.  If free Cl2 residual was also outside of dead
          band limits, determine the necessary changes in the Cl2/NaOH dosage
          ratio and adjust the Cl2 and NaOH dosages.  Wait five minutes and
          reenter logic sequence.

     The equations for accomplishing the above control actions were:


      n  r*T-\          feedback increment        f    . -,
      Dl(nT)   =  a  {pHset - PH(nT)}    + Dl  ^n'1)T} +

                  b  {[D2(nT) H. D CnT)J - [D (n-l)T + D (n-l)T] }          (14)
                                      22

-------
                    feedback increment
      D2(nT)   = c {C12 set - Cl2(nT)} + D2 {(n

                    feedforward increment
      D_(nT)   = d {A(nT) - A {(n - 1)T}} + D_ {(n - 1)1}
                                                      (15)


                                                      (16)
where D (nT),
      D2(nT), D2{(n-l)T}
      D3(nT), D3{(n-l)T}



      pH set

      pH(nT)
      C12 set
      Cl2(nT)
      A(nT), A


      a, b, c
               required caustic dosage calculated at
               the nth and (n-l)t'1 control instant

               required feedback chlorine dosage
               (small chlorinator) calculated at the
               n*h and (n-l)t  control instant

               required feedforward chlorine dosage
               (large chlorinator) at the n^ and
               (n-l)^ control instant

               desired value of effluent pH

               smoothed value of pH at the n™ control
               instant.

               desired value of free residual chlorine
               concentration

               smoothed value of free residual chlorine
               at the n1-" control instant

               smoothed value of ammonia concentration
               at the n™ control instant

               proportionality constants for incremental
               feedback control of effluent pH and free
               residual chlorine  .
      d                       =    Cl:NHj-N dosage ratio.

Feedforward control for influent flow rate variations was implemented as
follows:
DjCnT) Q (nT)

D2(nT) Q (nT)

D3(nT) Q (nT)

required amount of caustic per unit time

required amount of feedforward chlorine per unit time

required amount of feedback chlorine per unit of time
      W2(nT)

      W3(nT)
(17)

(18)

(19)
where W , (nT)
      W2(nT)

      W3(nT)
                                     23

-------
The actuators for the chlorine dosages were two V-notch chlorinators with
linear output.  For the caustic dosage, the actuator was a variable stroke
positive displacement pump.  The pump output was nonlinear with stroke and
exhibited mechanical hystersis.  The computer actuator signal for caustic
dosage was:

      Actuator signal    =    f™ W (nT)                                  (20)

where fpp                =    complex empirical function describing
                              pump output with stroke

and for chlorine were:

      Actuator signal    =    g W (nT)                                    (21)

      Actuator signal    =    h W (nT)                                    (22)

where g, h               =    proportional constant for linear chlorinator
                              output .

The algorithm satisfactorily controlled the complex breakpoint chlorination
process but exhibited slow recovery responses for abrupt step changes in
flow.  Later after completion of the algorithm development for the three-
stage activated sludge system, an attempt was made to improve breakpoint
chlorination control.  In that attempt, the pH in the breakpoint process
was successfully controlled by the feedback PI controller (Equation 7) with
a feedforward correction (proportioned to process flow).  At the same time,
the chlorine addition and residual free chlorine was successfully controlled
by the output of an analog PI controller with the feedback error signal
based on residual Cl2 difference from setpoint coupled to an analog flow
proportional output based upon process flow.  While the approach was
completely feasibile, the digital parallel of the analog C\2 controller was
not completed.


Mass Proportional Control of
     In denitrification., mass -proportional control was applied to the
feed system.  An  autoanalyzer was used for continuous measurement of
nitrite-nitrate concentration entering the denitrification stage.  In the
mass -proportional control, the measured concentration of nitrite-nitrate and
the process flow rate were combined to determine the chemical feed rate.
The mathematical description of this program was:

      V        =    V, M Q(nT)                                            (23)
                    V*

where V_C      =    chemical pumping rate, ml/min

      Q(nT)    =    process flow, 1/min
                                      24

-------
      M        =    mass proportional ratio

      V W      =    nitrite-nitrate concentration, mg/1

      V?I      =    concentration of methanol solution

The actuator was a variable speed pump and the computer actuator signal was:

      actuator signal    =    fpp V_                                      (24)

where fpE                =    empirical functional description of the
                              feed element (input signal vs. ml/min).

This is visually represented in Figure 6.

     Mass-proportional control of FeCl_ addition to the final pass of
modified aeration for phosphorus removal was also attempted.  An autoanalyzer
method to measure total phosphorus, however, produced a coating on the
optical viewing element which required frequent cleaning (approximately
every hour).  This coating occurred in spit of settling and filtration of
the sample prior to its passing through the optical viewer.  The coating
prevented the use of the sensor in the FeCl_ mass-proportional feed control
system.


Dissolved Oxygen Control


     Dissolved oxygen control in the modified aeration process required
continuous adjustment of the air flow rate to compensate for changes  in the
air requirements of the biological system.  The air requirement was dependent
on numerous factors.   The amount of carbonaceous material and the number of
biological organisms present in the reactor could change relatively rapidly.
The oxygen consumption rate changed with variation in the influent
concentration of carbonaceous material or with variation in the process flow.
The system oxygen consumption rate also changed with variations in the
recycle to process flow ratios.  Sensors were not available for measuring
continuously the suspended solids in the recycle flow or carbonaceous
material in the influent process flow so feedforward information was  limited
to process and recycle flow.  The exact relationship of process flow  to air
requirement was not known going into the study but was to be examined once
dissolved oxygen control was established at steady-state conditions.   Since
it was expected that the maximum impact of disturbances would be felt in the
first stage, dissolved oxygen control was attempted on the first two  passes
of the modified aeration stage.

     The two passes were controlled totally independently of each other, both
using automatic air throttling valves under direct digital control.  The PI
Controller with feedforward compensation was used by the computer and can
be expressed mathematically by:
                                     25

-------
    SOLUTION
    CONCENTRATION


MASS  PROPORTIONAL
         RATIO
   FEED CONTROL
  CHARACTERISTICS
                 CHEMICAL
                 CONTROL
                 EQUATION
 COMPUTED
REQUIREMENT
ACTUATOR
CONTROL
EQUATION
          NITRITE-NITRATE CONCENTRATION
     FLOW
                WASTEWATER
                FLOW
                                    METHANOL
                                    FEED
                                                   -J RE ACTOR
            Figure  6.  Mass proportional chemical  feed control.

-------
                                 -T/T
      SCFM(nT) .  (           [--] EDOCnT,
                    DO                                       D(]


where SCFM(nT) =  required air rate computed by the controller at the n
                  control instant

      P o(nT)  =  process gain computed at the n   control instant

      T        =  time constant of the process model

      T        =  control period (T = 96 seconds)

      Eno(nT)  =  difference between the desired DO (set point} and the
                  smoothed value of the measured DO

      F(Q)     =  feedforward correction based on process flow and raised
                  during the study.

The empirical process gain was approximated by:
      PDO(nT)  =  _ B D°C"T) _                                (26)
         1  }     In SDO - ln(SDO - DO nT)

where SDO      =  the saturation DO level, mg/1

      DO       =  the smoothed value of the dissolved oxygen
                  concentration, mg/1.

The computer actuator signal to the control valve was:

      Actuator signal    =    f™ SCFM(nT)                                (27)
                               rb
where fp                 =    empirical functional relationship between
                              the air valve and SCFM(nT).

A visual representation of the control loop is shown in Figure 7.  One of the
problems encountered immediately was that the unsmoothed dissolved oxygen
signal exhibited relatively large amplitude, high frequency flutter,  ±0.3
mg/1 within one second (see Figure 8).  Thus, it was necessary "to heavily
dampen the signal for use in the control program [A Palo Alto, California,
study also encountered this flutter and attributed it to eddies and varia-
variations in dissolved oxygen passing by the membrane of the sensor (4)].

     With the algorithm, the dissolved oxygen level was brought under
satisfactory control for steady-state conditions.  At that point, the process
was again subjected to the stress of the diurnal flow pattern.  Although
control was maintained during the flow changes, the degree of control was
reduced and therefore various feedforward flow compensation functions were
tested.  This flow compensation function was expressed as F(Q) in the control
equation above.  It was varied from linear to various non- linear relation-
ships which empirical data suggested.  Linear flow proportioning resulted in


                                     27

-------
           FEED CONTROL CHARACTERISTICS

DO  SET POINT 	
             CHEMICAL
             CONTROL
             EQUATION
 COMPUTED
REQUIREMENT
                                                               1
ACTUATOR
CONTROL
EQUATION
      FT
              WASTEWATER
               FLOW
                        -J  DOT
                 Figure  7.  Dissolved oxygen control  loop.

-------
         •Result of 0130
          Recycle Flow Change
                                    Result of 0900_
                                    Recycle Flow
                                    Change
           2 am
             I
         PASS 2
4 am
6 am
                                  TIME
 8 am
 10 am
O)
E
   0
                             I
           2 am
4 am
6 am
8 am
                                  TIME

             Figure  8.  Dissolved oxygen under automatic control.
10 am

-------
a degradation of control from simple feedback control.  The highest degree
of control was achieved with F(Q) proportional to the quadratic root of the
process flow with a low limit setting corresponding to the air requirement of
the system at zero process flow (Figure 9).   The resultant relationship was a
moderate rise in air flow with increasing process flow in the low process
flow range.  This rise slowed and essentially flattened out as the process
flow approached maximum.
                                     30

-------
100
 80
 60
 40
                            F > 10 GPM  F(O) = (O/80) /4 x 100
                            F £ 10 GPM  F(O) = F(10)
 20
            10
                      20
                      30        40        50
                      O (IN GALLONS PER MINUTE)

Figure  9.   Flow  compensation for dissolved
                                                              60
                                                                        70
                                                                                 80
                                                          oxygen control.

-------
                                  SECTION 6

                                   RESULTS
PHYSICAL-CHEMICAL SYSTEM
     After the completion and testing of the computer control program the
physical-chemical system was operated continuously with three different
control approaches:  12 days of manual control, 9 days of digital control,
6 days of analog control.  Unfortunately, the development of the digital
control program required more time than originally planned.  The remaining
available resources and the required task of automation of the pilot plant's
three-stage activated sludge system limited the operating time for
evaluation of the digital control system on physical-chemical treatment.

     In the early work on analog control in physical-chemical treatment,
the basic physical-chemical system, except for breakpoint chlorination,
could be operated manually or by feedback analog control.  The control of
breakpoint chlorination by feedback analog control, however, was not
possible during changes in process flow.  The feedforward-feedback approach
developed for successful computer control of breakpoint chlorination was
also applied to the manual and analog methods.  In manual operation, the
operator could provide a feedforward control action as long as the flow
pattern was known and involved discrete flow changes.  Thus, the system
performance under manual, analog, and digital control, was sequentially
tested on the complete physical-chemical system for simple step diurnal flow
variations.

     These first continuous control studies on the entire physical-chemical
system were performed with a simple diurnal flow variation in which step
flow changes were applied manually on a specified schedule across the
system (Table 3).  The pilot plant operators had prior knowledge of the
flow and flow changes.  The digital process in the final testing program
responded satisfactorily to gradual and continuous changes in flow as well
as to step changes.  The flow changes represented a series of steady
operations in which the pilot plant operator during manual operation could
readjust the operating conditions at each step change in flow and satis-
factorily operate even the chlorination process.

     The average residuals and removal efficiencies for operation at pH
11.6 in lime clarification, pH 9.8 in recarbonation (9.4 in manual operation)
and pH 7.0-7.4 in breakpoint revealed that all control approaches for the
step variation in flow produced very satisfactory continuous operation with
accumulative final removals of approximately 90 percent of the total nitrogen

                                     32

-------
       TABLE 3.  OPERATING CONDITIONS FOR THE PHYSICAL-CHEMICAL SYSTEM
Clarification (two-stages)
Filtration
Absorption
Flow
1/min (gal/min)
85,1 rain (22.5)
125,5 avg (33.2)
198.3 max (52.5)
85.1 min (22.5)
125.5 avg (33.2)
198.3 max (52.5)
85.1 min (22.5)
125.5 avS (33.2)
198.3 max (52.5)
Loading
26.5 m3/day/n2 ( 625 gpd/ft2)
40.6 m3/day/m2 ( 996 gpd/ft2)
64.2 m3/day/m2 (1575 gpd/ft2)
81.5 1/min/m2 (2.0 gpm/ft2)
118.0 1/min/ra2 (2.9 gpm/ft2)
187.0 1/min/m2 (4.6 gpm/£t2)
187.0 1/min/m2 ( 4.6 gpra/ft2)
277.0 1/rain/ra2 ( 6.S gptn/ft2}
436.0 l/min/ro2 (10.7 gpra/ft2)
98 percent of the total phosphorus, and more than 95 percent of the organics
from the wastewater (Table 4).   The final residual concentrations and the
accumulative percentage removals for the short study did not reveal any
significant differences in the system performance under the various control
approaches.  Further study with unknown step and gradual continuous changes
in flow are necessary to fully assess and compare the capabilities of the
three control approaches for continuously producing high-quality water.

     The average lime dosage required to achieve a wastewater pH of 11.6 was
263 rag/1 for an average influent alkalinity of 113 mg/1 during digital
control and 331 mg/1 for an average influent alkalinity of 131 rag/1 during
analog control.  Conversion of the analog lime dosage to equivalent dosage
for the influent alkalinity during digital control produced a comparable lime
dosage of 283 mg/1 during the analog operation.  Nearly two years of operation
of the -physical-chemical system with manual or manual-analog operation of the
lime feeding system revealed a wide range and variability in the lime dosage
and the resulting wastewater pH (240 mg/1 to 385 mg/1 at pH 11.3 and 289 to
360 mg/1 at pH 11.7).   Similar wide variability occurred in the C02 dosage.
The variability in the chemical dosage was related to mechanical difficulties
in control and measurement of the chemical feeds as well as to variations in
the alkalinity of the wastewater itself.

     The tests using the computer for data acquisition indicated that the
digital control produced the smallest pH variation (usually ± 0.037 pH units
under flow or set point change) and a lime dosage at the low end of the
observed lime dosage range.  The pH deviations for manual and analog control
were ± 0.2 pH units and ± 0.1 pH units respectively.   Long-term operation,
however, with careful data acquisition is required to evaluate the statistical
effectiveness of the control approaches for minimizing the chemical dosages.

     Previous laboratory work (5) revealed that the Cl2 dosage for breakpoint
chlorination varied with the degree of pretreatment before chlorination with
                                     33

-------
        TABLE 4.  REMOVAL EFFICIENCIES FOR THE PHYSICAL-CHEMICAL SYSTEM


Manual
Raw
Screened
Clarified
Filtered
Chlorinated
Adsorbed
Digital
Raw
Screened
Clarified
Filtered
Chlorinated
Adsorbed
Analog
Raw
Screened
Clarified
Filtered
Chlorinated
Adsorbed
TOC
mg/1 Z

82
79 4
32 61
13 84
14 83
3 96

58 --
56 --
17 71
9 84
11 81
2 97

75
72 4
18 76
15 80
14 81
4 95
BOD
mg/1 %

123
118 12
35 72
12 90
-_
3 98

83 —
85 —
23 72
10 88
__ __
4 95

114
102 8.6
22 81
17 85
__
4 96
COD
rag/1 %

260
254 2
93 64
43 89
36 86
13 95

182
191
48 74
28 85
25 86
10 95

245
239 2.5
47 81
39 84
33 87
10 96
SS
mg/1 %

145
142 2
115 26
4 97
7 95
3 98

114
127 —
69 39
8 93
3 97
9 92

121
107 11.5
16 87
4 97
3 98
3 98
P
mg/1 %

6.8
6.4 5
1.05 85
0.20 97
0.16 98
0.13 98

5.2
5.2
0.36 93
0.13 98
0.16 97
0.10 98

6.7
6.4 4
0.29 96
0.20 97
0.23 96
0.16 98
Total S
mg/1 %

21.4
21.5 —
18.4 14
14.4 33
2.9 86
2.2 90

17.0 —
16.7 —
11.6 32
11.3 34
2.7 84
1.6 91

21.5
22.0 —
15.9 26
14.9 31
3.4 84
2.3 89
a C1:NH3-N weight ratio of approximately 8:1 for breakpoint of lime clarified
and filtered secondary effluent and 9:1 for lime clarified and filtered raw
wastewater.  The earlier work also revealed that rapid mixing and pH control
was also required to minimize undesirable side reactions.

     In the study of the different control approaches, the free residual
chlorine after breakpoint was controlled to less than 10 mg/1 and usually
to less than 6 mg/1.  The total Cl2 dosage for breakpoint of 15 mg/1 of
NH3-N was about 140 mg/1.  While digital operation gave the best control of
free residual chlorine, usually to within ± 2 mg/1 of the set point under
steady state flow, step changes in flow produced loss of control with long
recovery times.

     The use of the computer's continuous data acquisition capabilities,
however, revealed an effect on chlorine dosage not known previously
(Figure 10).  Flow increases through the static mixer used as the breakpoint
reactor produced a decreasing ratio of CliNHj-N.

     The high-shear energy at the higher flow rates (high Reynolds numbers)
and the short reaction time in the static mixer produce more rapid mixing and
pH control and thus reduced the reaction period for undesirable side
reactions.  These side reactions all consume C12 and increase the ratio of
                                     34

-------
Cl: NH3N
RATIO
           12
           11
           10
                                      r i
Cl: NH3N RATIO FOR BREAKPOINT

            pH 70-74

            A DIGITAL CONTROL
            • ANALOG CONTROL
                                             7.6=STOICHIOMETRIC RATIO
                      i     i    i   i  i  i  i  i
                                                         i    11
                               4   5 6 7 8 910    15  20

                                      Re x io~5
                30  40 50   75  100
                   Figure 10.   Chlorine dosage  ratio in flow rate.

-------
C1;NH3-N required to achieve breakpoint.  The change in C1:NH3-N dosage
with flow through the reactor can be most readily introduced into the digital
control model to improve the control performance.
THREE-STAGE ACTIVATED SLUDGE SYSTEM
     Following the digital application to the physical-chemical system,
computer control of the three-stage activated sludge treatment system was
initiated.  This multi-stage activated sludge system with final filtration
met the proposed District of Columbia discharge standards and was the one
selected for the 812m^/min (309 mgd) Blue Plains Sewage Treatment Plant.
The three-stage system was normally operated under manual-analog control
with process flows similar to those of the physical-chemical system and the
diurnal flow pattern imposed is shown in Figure 11.  Again, as in earlier
work, the pilot plant operators had prior knowledge of the flow and flow
changes.

     The average residuals and removal efficiencies revealed that manual-
analog and digital control approaches for the step variation in flow
produced very satisfactory continuous operation with accumulative final
removals of approximately 92 percent of the total nitrogen, 97 percent of
the total phosphorus and more than 98 percent of the BOD from the wastewater
(Table 5).  As in the case of the physical-chemical system, this study did
not reveal any significant differences in the system performance under either
control approach.  The manual-analog control normally employed in the system
included analog control of chemical feeds and manual control of D.O.  Total
manual control was never attempted.

     The modified aeration stage, operated at an SRT of approximately one day
with mineral addition, exhibited excellent stability under both manual and
digital control and produced a satisfactory effluent for subsequent processes
in the three stage system.  As previously mentioned, dissolved oxygen control
in this process was difficult with step changes in solids concentration and/or
flow, however digital control maintained D.O. to within ±0.5 mg/1 of the set-
point .  A higher degree of control could perhaps be achieved if additional
sensors had been used in feedforward/feedback control mechanisms such as a
TOC analyzer or a suspended solids sensor.  However, those additional sensors
were not necessary for adequate control.  Manual control of D.O. could only
be maintained to within ± 1,5 mg/1 of the setpoint, and suggested that energy
consumption could be reduced through automated D.O. control strategies.

     FeClj addition to this modified aeration was accomplished effectively
under both manual and digital control.  With FeClg dosage equal to a 1:1 mole
ratio Fe/P, modified aeration removed approximately 83 percent of the 6005,
72 percent of the phosphorus, and about 31 percent of the total nitrogen.

     The  subsequent nitrification process with the pH controlled to 7.0-7.2
by an average addition of 60 mg/1 of dry CaO produced essentially complete
nitrification and essentially complete removal of carbonaceous BODg.  Flow
proportioned lime addition for control of pH produced fluctuations of ± 0.2


                                     36

-------
  200
   160
   120
 ,   80

O
u.


    40
       RECYCLE
       CHANGED
    0000
RECYCLE
CHANGED
                 I
             RECYCLE
             CHANGED
0400     0800
           NOON

            TIME
1600
2000    2400
                 Figure 11,  Diurnal flow pattern.

-------
           TABLE  5.   THREE  STAGE ACTIVATED  SLUDGE SYSTEM REMOVAL EFFICIENCIES
EFFLUENT
Manual*
Primary
Modified
Aeration
Nitrification
Denitrifi-
cation
Filtration
Digital**
Primary
Modified
Aeration
Nitrification
Denitrifi-
cation
Filtration
TOG
mg/1 %

76.7
18.9 75.4
7.5 90.2
8.8 88.5


64.5
19.0 70.5
6.9 89.3
7.9 87.8

BOD
mg/1 %

111
11.7 89.5
.10.9 90.2
8.5 92.4
2.0 98.1

94
15.1 83.9
10.7 88.6
8.2 91.3
1.9 98.0
COD
mg/1 %

238
42.3 82,2
17.7 92.6
19 92


218
47.3 78.3
17.0 92.2
20.4 90.6

SS
mg/1 %

no
13 82
7.5 93.2
14.1 87.3


104
18 82.6
7 93.3
17.7 83.0

P
mg/1 %

6.9
1.9 80.3
1.2 84.3
0.7 90.9
0.2 98.1

6.2
1.6 74.2
1.1 82.3
0.7 88.7
0.1 98.4
Total N
mg/1 %

23
14.9 35.3
14.2 38.6
2.1 91.0
1.5 93.6

21.6
14.7 31.9

1.3 94.0
1.7 92.1
 * June, 1973
** July-August, 1973

-------
pH units from the setpoint.  Operating under digital control, the computer
held the pH to within ± 0.03 pH units from the setpoint and control was
maintained with only routine cleaning and calibration of the process flow
meter and pH sensor.

     The denitrification process with methanol addition removed an average
of 94 percent of the nitrate nitrogen with an average of approximately
0.7 mg/1 of residual NOj-N.  A dosage of four units of methanol (by weight)
per unit of NOj-N produced essentially complete denitrification.  Flow-
proportional addition of methanol later modified to mass-proportional
addition produced high removal efficiencies but no higher than those achieved
under flow proportional analog control of the feed rates.  Alum addition in
the denitrification process at an A1:P mole dosage ratio between 3:1 and 5:1
reduced the effluent phosphorus by about 40 percent.  No significant
difference in process performance was detected under digital or manual
control.  The real impact of the alum addition was to insure good phosphorus
and solids removal by the final filtration process.

     Filtration of the denitrified effluent produced a final effluent that
consistently exceeded the discharge standards for the proposed new plant in
Washington, D.C.  The residual BODs averaged 2 mg/1; the total nitrogen,
1.6 mg/1; and the total phosphorus, 0.2 mg/1 as P.
                                     39

-------
                                  REFERENCES
1.   Bishop, D.  F., J. B.  Stamberg, and J.  W.  Porter.   Advanced Waste
     Treatment Systems at the EPA-DC Pilot  Plant.   AIChE Symposium Series
     124, Water 1971, 68, 11, 1972.

2.   Heidman, J. A., D. F. Bishop, J.  B. Stamberg.   Carbon,  Nitrogen and
     Phosphorus Removal in Staged Nitrification-Denitrification Treatment.
     EPA 670/2-75-052, U.S.  Environmental Protection Agency, Cincinnati,
     Ohio, 1975.  38 pp.

3.   Bishop, D.  F., W. W.  Schuk,  R. B.  Samworth,  R.  Bernstein,  and
     E. D. Frein.  Computer Control of Physical-Chemical Wastewater
     Treatment.   In:  Pollution Engineering and Scientific Solutions,
     E. S. Barrekette, ed.  Plenum Press, New York-London, 1973.
     pp. 522-547.

4.   Stepner, David E. and J. F.  Petersack.   Data Management and Computerized
     Control of a Secondary Wastewater Treatment Plant.  In:  Instrumentation
     Control and Automation for Waste-Water Treatment Systems:   Progress in
     Water Technology, Vol.  6, J. F. Andrews,  R.  Briggs, and S. H. Jenkins,
     eds.  Pergamon Press, Oxford, England, 1974.

5.   Pressley, T. A., D. F.  Bishop, and S.  G.  Roan.   Ammonia-Nitrogen
     Removal.  Environmental Sci. and Tech.  6, 622,  1972.
                                      40

-------
                                   TECHNICAL REPORT DATA
                            (Please read instructions on the reverse before completing]
 1. REPORT NO.
  EPA-600/2-77-211
                                                            3. RECIPIENT'S ACCESSION-NO.
4. TITLE AND SUBTITLE
  Digital Computer Control  of Advanced Waste Treatment
  Systems
                                                            5. REPORT DATE
                                                            November 1977  flssuing Date)
                                    6. PERFORMING ORGANIZATION CODE
7. AUTHOR(S)
  Robert Yarrington, Walter  W.  Schuk, Dolloff F.  Bishop,
  James  E.  Bowers, Elliot  D.  Fine,  and Hans W. Treupel
                                    8. PERFORMING ORGANIZATION REPORT NO.
9. PERFORMING ORGANIZATION NAME AND ADDRESS
  Department of Environmental Services
  Government of the District  of Columbia
  12th  Street, N.W.
  Washington, DC  20004
                                     10. PROGRAM ELEMENT NO.
                                       1BC611  (SOS  2B  Task 05)
                                     11. CONTRACT/GRANT NO.
                                        68-01-0162
 12. SPONSORING AGENCY NAME AND ADDRESS
  Municipal Environmental Research Laboratory--Cin.,OH
  Office  of Research and Development
  U.S. Environmental Protection Agency
  Cincinnati,  Ohio  45268
                                     13. TYPE OF REPORT AND PERIOD COVERED
                                     Final Report    12/72-12/74
                                     14. SPONSORING AGENCY CODE
                                        EPA/600/14
 15. SUPPLEMENTARY NOTES
  Project  Officer:  Dolloff F.  Bishop,  (513) 684-7628
16. ABSTRACT
  The  objectives of the study  were to develop and demonstrate automatic control
  strategies using a digital computer on advanced wastewater treatment systems.   Two
  basic pilot treatment systems  were automated, physical-chemical treatment and  the
  three-stage activated sludge system.  The digital  automation involved control  of
  lime feeding,  pH control with  C02, FeCl3, sludge wasting,  and breakpoint chlorination
  in the  physical-chemical system.  In the biological  system, the automation  involved
  FeCl3 dosage and D.O, control  in aeration, pH control  in nitrification and  Q^OH and
  alum dosage controls in denitrification.  The digital  control approaches satis-
  factorily operated the pilot plants.
17.
                                KEY WORDS AND DOCUMENT ANALYSIS
                  DESCRIPTORS
                       b.lDENTIFIERS/OPEN ENDED TERMS  C. COSATI Field/Group
  Process  Control
  Computers
  pH Control
  Dissolved Gases
  Oxygen
  Chlorination
Aeration
Nitrification
Chemical  Dosage Control
Physical-Chemical
  Treatment
Denitrification
13B
18. DISTRIBUTION STATEMENT
   Release  to Public
                       19. SECURITY CLASS (This Report)
                        Unclassified
                          21. NO. OF PAGES
                              49
                                              20. SECURITY CLASS (Thispage}

                                               Unclassified	
                                                                         22. PRICE
EPA Form 2220-1 (9-73)
                                            41
                                                                U.S. GOVERNMENT PRINTING OFFICE: 1977- 7S7-140/659!

-------
                                                                                                    I    .
U.S. ENVIRONMENTAL  PROTECTION AGENCY
     Office  of Research and Development
         Technical Information Staff
            Cincinnati, Ohio  45268

            OFFICIAL BUSINESS
    PENALTY FOR PRIVATE USE, S3OO
  AN EQUAL OPPORTUNITY EMPLOYER
                                                              POSTAGE AND FEES PAID
                                                      U.S. ENVIRONMENTAL PROTECTION AGENCY
                                                                      EPA-335


                                                             Special Fourth-Class Rate
                                                                       Book
                I
                5o
ID
O
T
                                          If your address is incorrect, please change on the above label;
                                          tear off; and return to the above address.
                                          If you do not desire to continue receiving this technical report
                                          series, CHECK HERE [""). tear off label, and return it to the
                                          above address.

-------