Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzzy Techniques

Embed Size (px)

DESCRIPTION

Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzzy Techniques

Citation preview

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using ModelPredictive and Neuro Fuzzy Control Techniques.

    Thesis submitted in partial fulfillment of the

    Requirements for the degree of

    Master of Science in Technology

    in

    Instrumentation EngineeringBy

    (Signature)

    NITHIN VARGHESE NINAN

    (Register Number: 122539010)

    Under the guidance of

    (Signature)

    Dr. R Suresh

    HOD, Department of Chemical Engineering

    R V College of Engineering

    Bangalore

    MANIPAL UNIVERSITY, MANIPAL

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using Model

    Predictive and Neuro Fuzzy Control Techniques.

    Thesis submitted in partial fulfillment of the

    Requirements for the degree of

    Master of Science in Technology

    inInstrumentation Engineering

    By

    NITHIN VARGHESE NINAN

    (Register Number: 122539010)

    Examiner 1 Examiner 2

    Signature: Signature:

    Name: Name:

    MANIPAL UNIVERSITY, MANIPAL

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    CERTIFICATECERTIFICATECERTIFICATECERTIFICATE

    Thisistocertifythatthisthesisworktitled

    OptimizationofBioreactorControlsusingModelPredictiveandOptimizationofBioreactorControlsusingModelPredictiveandOptimizationofBioreactorControlsusingModelPredictiveandOptimizationofBioreactorControlsusingModelPredictiveandNeuroFuzzyControlTechniques.NeuroFuzzyControlTechniques.NeuroFuzzyControlTechniques.NeuroFuzzyControlTechniques.

    Isabonafiderecordoftheworkdoneby

    NITHINVARGHESENINANNITHINVARGHESENINANNITHINVARGHESENINANNITHINVARGHESENINAN

    Reg.No.122539010

    InpartialfulfillmentoftherequirementsfortheawardofthedegreeofMasterofMasterofMasterofMasterof

    ScienceScienceScienceScience inTechnologyinTechnologyinTechnologyinTechnologyinininin InstrumentationEngineeringInstrumentationEngineeringInstrumentationEngineeringInstrumentationEngineeringunderManipalUniversity,

    Manipalandthesamehasnotbeensubmittedelsewherefortheawardforany

    otherdegree

    (Signature)

    GuideName:ShivajithCK

    AssistantMangaerBiotechAutomation SartoriusStedimIndiaPvt.Ltd.

    Bangalore

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    ACKNOWLEDGEMENT

    Under the esteem guidance of our project guide professor Dr. R Suresh, HOD

    Department of Chemical Engineering, R V College of Engineering, Bangalore, a

    detail study on Optimization of Bioreactor Controls using Model Predictive and

    Neuro Fuzzy Control Techniques and its applications to various models has been

    studied as well as simulation has been done. We are very thankful for his whole-

    hearted co-operation without which this project could not have been completed.

    I take this opportunity to express my sincere thanks and acknowledge the

    support received from, Shivajith C K, Assistant Manager, Sartorius Stedim

    Biotech Pvt. Ltd., for his valuable guidance and granting the permission to carry

    out the project at Sartorius Stedim Biotech Pvt. Ltd.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    DECLARATION

    I hereby declare that the entire work presented in this project was carried out by

    me under the guidance of Dr. R Suresh, HOD Department of Chemical

    Engineering, R V College of Engineering, Bangalore, and no part of it has been

    submitted for any degree or diploma in any institution previously.

    In keeping with the general practice of reporting scientific observations due

    acknowledgements have been made wherever the work described is based on

    the findings of other investigators. Any omissions, which might have occurred by

    oversight or errors in judgment, are regretted.

    Date: (Signature)

    Nithin Varghese Ninan

    Register Number: 122539010

    Instrumentation Engineering, Batch 1

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 1

    Index

    1. Abstract.................................................................................................................... 31.1 Problem Definition .................................................................................. 3

    2. Introduction........................................................................................................... 52.1 Process Definition................................................................................................. 5

    2.1.1 Activated Sludge Processes ................................................................ 92.1.2 Biological Nutrient Removal .............................................................. 10

    2.2 First Order Plus Dead Time Modelling............................................................ 142.5 The BNR Process............................................................................................... 193. Literature survey................................................................................................ 243.1 Fuzzy Logic Control........................................................................................... 24

    3.1.1 Fuzzy If-Then Rule ............................................................................ 243.1.2 Fuzzy Reasoning ............................................................................... 25

    3.2 Artificial Neural Networks.................................................................................. 263.2.1 Multi-Layer Perceptron ...................................................................... 283.2.2 Back-Propagation Learning Algorithm ............................................... 30

    3.3 Integration of Fuzzy Logic and Neural Networks........................................... 334. System Identification, Modelling and Simulation............................................. 36

    4.2 Development of FOPDT Models ........................................................... 415.Fuzzy Logic Controller Design............................................................................. 44

    5.1 Fuzzy Logic Controller Selection .......................................................... 445.2 Development of the Fuzzy Logic Controller .......................................... 44

    6. A Brief History of Industrial MPC........................................................................ 476.1 Principle of MPC .................................................................................. 526.2 Constraints ........................................................................................... 536.3 The Receding Horizon .......................................................................... 546.4 Optimization Problem ........................................................................... 576.5 Models .................................................................................................. 58

    7 Tuning of the MPC-controller............................................................................. 607.1 Sampling time T .................................................................................. 607.2 Prediction horizon P ............................................................................ 607.3 Control horizon M ................................................................................ 617.4 Weighting matrices of in- and outputs: u and y ............................. 61

    8. The filter in MPC................................................................................................... 61

    8.1 First order filter .................................................................................... 628.2 Kalman filter ....................................................................................... 638.3 Extended Kalman filter ....................................................................... 63

    9. State of art of MPC for WWTPs......................................................................... 659.1 Linear MPC ........................................................................................ 659.2 Nonlinear MPC ................................................................................... 66

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 2

    10. Dynamic Matrix Control..................................................................................... 6611. Implementation of MPC in MATLAB................................................................ 70

    11.1 MATLAB code .................................................................................... 7011.2 OUTPUT IN MATLAB WINDOW ........................................................ 7511.3 INFERENCE ....................................................................................... 77

    12. Conclusions......................................................................................................... 7913. Bibiliography........................................................................................................ 80

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 3

    1. Abstract1.1 Problem Definition

    The biological nutrient removal (BNR) stage of a wastewater treatment plant

    is a biochemical system requiring regulation of the dissolved oxygen (DO)

    concentration of the bioreactor. Typically, these processes are very slow and

    incorporate nonlinearities, significant dead time and many sources of

    disturbances, making them a challenge to control. Effective control of the

    BNR process leads to better quality effluent that is eventually discharged into

    bodies of water. In addition, significant energy is used by large air blowers

    that supply process air to the bioreactors. Accordingly, a cost-savings can be

    realized in achieving good control of the BNR process in the form of energy

    conservation.

    Due to the length of time it takes to observe changes in a BNR bioreactor,

    system simulation is particularly well suited for developing a controller for the

    process. The BNR process is highly complex from a first principles modelling

    perspective, incorporating many variables of which some must be estimated,

    in addition to nonlinearities (Brdys and Maiquez, 2002). A first order plus dead

    time (FOPDT) modelling approach is proposed that drastically simplifies the

    modelling of the bioreactor and is based on the results of step tests performed

    on a subject bioreactor.

    By reason of the large degree of uncertainty inherent in the BNR process,

    a fuzzy logic controller (FLC) is proposed for the DO concentration in the

    bioreactor, as fuzzy logic lends itself particularly well to these types of

    systems. In addition, the FLC provides the capabilities of dealing with

    nonlinearities and non-symmetry in the final control element, as well as being

    able to be implemented as a simple lookup table.

    This project thesis provides a brief overview of Model Predictive

    Control (MPC).A brief history of industrial model predictive control

    technology has been presented first followed by a some concepts like the

    receding horizon, moves etc. which form the basis of the MPC. It follows the

    Optimization problem which ultimately leads to the description of the

    Dynamic Matrix Control (DMC).The MPC presented in this report is based on

    DMC. After this the application summary and the limitations of the existing

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 4

    technology has been discussed and the next generation MPC, with an

    emphasis on potential business and research opportunities has been

    reviewed. Finally in the last part we generate Matlab code to implement

    basic model predictive controller and introduce noise into the model. We

    have also taken up some case studies like Swimming pool water

    temperature control and helicopter flight control etc. by applying the MPC

    controller on these models.

    Originally developed to meet the specialized control needs of power plants

    and petroleum refineries, MPC technology can now be found in a wide variety

    of application areas including chemicals, food processing, automotive, and

    aerospace applications Its reason for success is many, like it handles

    multivariable control problems naturally. But the most important reason for its

    success is its ability to handle constraints. Model predictive control (MPC)

    refers to a class of computer control algorithms that utilize an explicit process

    model to predict the future response of a plant. At each control interval an

    MPC algorithm attempts to optimize future plant behavior by computing a

    sequence of future manipulated variable adjustments. The first input in the

    optimal sequence is then sent into the plant, and the entire calculation is

    repeated at subsequent control intervals. The basic MPC controller can be

    designed with proper restrictions on the prediction horizon and model length.

    The prediction horizon has to be kept sufficiently larger than control horizon.

    But after applying to many other applications we find as the complexity

    increases then we need techniques other than DMC like generalized

    predictive control (GPC) which are better.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 5

    2. Introduction2.1 Process Definition

    In managed wastewater systems, wastewater is collected and routed through

    sewer systems to wastewater treatment plants. These plants vary in size and

    configuration but the function of all wastewater treatment plants remains the

    same, which is to produce a wastewater stream that can be safely discharged

    back into the environment and minimize the solid waste that is produced.

    A process flow diagram for a typical wastewater treatment plant is given in

    Fig. 2.1. As shown, wastewater enters the plant from the sewer where it is

    coarsely screened and degritted. The effluent then flows to the primary

    clarifiers to allow initial sedimentation to occur. The settled sludge, known as

    primary sludge, is usually dewatered using centrifuges or sludge presses

    before disposal or stabilization. Following primary clarification, the effluent

    flows to the aeration cells, or bioreactors, where it is aerated and retained to

    allow time for the biochemical reactions to take place which reduce

    suspended solids through oxidation (Grady et al., 1999). Following aeration,

    the effluent flows to secondary clarifiers where a second stage of

    sedimentation occurs. The sludge that settles to the bottom of the secondary

    clarifiers is known as activated sludge. Activated sludge is a concentrated

    slurry (Grady et al., 1999), of which a portion is usually fed back to the

    aeration cells and a portion is wasted. The sludge destined for the aeration

    cells is referred to as return activated sludge (RAS) and the wasted sludge is

    referred to as waste activated sludge (WAS). The final stage of wastewater

    treatment is typically disinfection, either by ultraviolet light (UV) or chlorination.

    It is known that waters containing a low concentration of DO produce

    harmful aquatic effects. Wastewater effluent consists of a large portion of

    soluble organic material (SOM), which serves as a nutrient source for aquatic

    microorganisms that consume oxygen as part of their metabolic cycle,

    reducing the available DO. Since these microorganisms can survive at lower

    concentrations of DO than higher life forms, an ecosystem is developed which

    distresses and precludes the latter. Wastewater also contains nitrogen and

    phosphorous, which act as nutrients and lead to the proliferation of aquatic

    vegetation in downstream bodies of water (Grady et al., 1999). This process is

    known as eutrophication and also leads to a reduction in DO.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 6

    Fig 2.1: Process flow diagram for a typical wastewater plant.

    There are four basic categories of pollutants in wastewater: soluble

    organic matter (SOM), insoluble organic matter (IOM), soluble inorganic

    matter (SIM) and insoluble inorganic matter (IIM). There are two basic types

    of unit operations found at wastewater treatment plants: physical unit

    operations and biochemical unit operations. Physical unit operations consist

    of activities like screening, degritting and sedimentation. Biochemical unit

    operations typically occur in a bioreactor where wastewater is exposed to

    microorganisms, resulting in biochemical reactions.

    In wastewater treatment, preliminary physical unit operations are usually

    carried out first (screening and degritting) to remove large objects and IIM

    followed by sedimentation (primary clarification). After sedimentation, the

    remaining IOM settles to the bottom of the basin and exits as underflow for

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 7

    further treatment and/or disposal. The effluent (overflow) then carries the

    soluble material to the next stage of treatment. Wastewater, in general,

    contains a very low concentration of reacting pollutants. As a result,

    biochemical unit operations are used on the wastewater stream at this stage

    as these types of operations are more efficient at low concentrations of

    reacting constituents (Grady et al., 1999). During the biochemical operations,

    the soluble material is converted into more benign forms such as gaseous

    nitrogen and car-bon dioxide. Further, during growth, the microorganisms

    capture the remaining IOM allowing it to be settled and removed during later

    physical unit operations (Grady etal., 1999). The unit operations of a typical

    wastewater plant are shown in Fig. 2.2.

    In a bioreactor, the primary characteristic of the biochemical environment for

    fostering microbial growth is the terminal electron acceptor (Grady et al.,

    1999). The three different types of electron acceptors used are: oxygen,

    organic compounds and inorganic compounds. If sufficient quantities of DO

    are supplied to the bioreactor it is said to be aerobic. Anaerobic environments

    are those in which the electrode potential is highly negative and the terminal

    electron acceptors are the organic compounds carbon dioxide and sulfate.

    Environments in which nitrites and/or nitrates are the primary terminal electron

    acceptors are referred to as anoxic. In these environments, the electrode

    potential is higher and growth is more efficient than anaerobic environments

    due to the nitrite and/or nitrate contribution. However, aerobic environments

    remain the most efficient for microbial growth. The biochemical environment

    maintained in a bioreactor has a significant impact on the effectiveness of the

    treatment and different types of wastewater warrant different applications of

    biochemical environments.

    There are many different bioreactor configurations and the physical

    configuration of the bioreactor impacts the effectiveness of the operation. The

    two major classes of bioreactors are suspended growth and attached growth.

    The suspended growth type bioreactor requires sufficient mixing to maintain

    suspension of the microorganisms, followed by a unit operation to remove the

    suspended biomass. In attached growth type bioreactors the microorganisms

    are grown as a biofilm solid surface. This discussion focuses on suspended

    growth bioreactors as the process under study is of this type.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 8

    Fig 2.2: Unit operations of a typical wastewater plant.

    Suspended growth bioreactors are implemented in several ways including

    the continuous stirred tank reactor (CSTR), the sequencing batch reactor

    (SBR) and the perfect plug-flow reactor (PFR). In a CSTR, the influent

    wastewater continuously flows through the bioreactor. Sufficient mixing is

    provided to maintain a well-mixed and uniform environment, which aids in

    maintaining a constant average physiological state (Grady et al., 1999). Often

    a sedimentation stage follows the CSTR and the underflow slurry (secondary

    sludge) is recycled back to the bioreactor. CSTRs can be cascaded in series

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 9

    to achieve additional operational flexibility. In a SBR, the wastewater does not

    flow continuously through the bioreactor. Instead a fixed volume of

    wastewater is reacted to completion at a time. These types of reactors are

    particularly flexible as the biochemical environment can be highly controlled to

    suit the quality of the wastewater. In a PFR, the constituents of the fluid flow

    through the bioreactor without mixing and in the same order in which they

    enter.

    2.1.1 Activated Sludge Processes

    The ASP is a well-known and extensively deployed method of secondary

    wastewater treatment that is capable of achieving a good quality effluent.

    Activated sludge uses aerobic suspended growth of microorganisms to

    remove SOM from wastewater. The ASP primarily consists of the bioreactor

    and secondary clarification processes. The basic principle behind activated

    sludge is that when microorganisms are exposed to SOM, they will consume

    and reduce it. The microorganisms must be provided with sufficient DO, which

    they require to survive and must be kept in a sufficiently suspended state to

    achieve good results. Both of these goals are met by introducing process air

    into the pre-treated wastewater stream. This can be done in a variety of ways

    including diffused aeration, jet aeration and surface aeration.

    Diffused aeration involves lining the bottom of the aeration basins with a

    diffuser grid and forcing process air through the grid, usually utilizing large

    blowers. This method diffuses air bubbles of varying sizes into the wastewater

    stream. Jet aeration utilizes aspirating devices that require the wastewater to

    be pumped through an ejector that mixes air into the pumped water stream.

    Surface aeration operates by pumping water into the air, after which the falling

    water contacts the water surface causing air to be mixed with the wastewater.

    Generally, diffused aeration is suited for large, deep aeration basins,

    whereas jet aeration is suitable for smaller tanks and surface aeration is

    suitable for shallow aeration basins as the mixing is primarily concentrated at

    the surface.

    In ASPs, the aeration stage occurs in basins where the primary

    biochemical operations take place. The effluent from the bioreactor is known

    as mixed liquor. Following aeration, a clarification stage takes place, which

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 10

    allows for sedimentation of the microorganisms to occur. The settled

    microorganisms can then be recycled in concentration (i.e., RAS) back into

    the bioreactor and/or wasted (i.e., WAS). A schematic of the ASP is shown in

    Fig. 2.3.

    There are numerous configuration options for ASPs, which generally vary the

    geometric characteristics of the bioreactor itself. The trade-offs between the

    various configurations are usually driven by capital cost requirements,

    efficiency and operational complexity. Two of the more popular bioreactor

    configurations are called conventional activated sludge (CAS) and step-feed

    activated sludge (SFAS). The geometric characteristics of these

    configurations are shown in Fig. 2.4.

    Fig 2.3: Simplified view of the activated sludge process. (Adapted from Grady

    etal. (1999))

    2.1.2 Biological Nutrient Removal

    Much of wastewater is human waste, containing nutrients and bacteria. In

    wastewater, the term nutrient generally refers to nitrogen and phosphorus, as

    these elements when deposited in bodies of water provide nutrition to life-

    forms present in the water. This process is also known as eutrophication. The

    United States Environmental Protection Agency (EPA) offers the following

    description of how eutrophication affects surface water:

    Nitrogen and phosphorus are the primary causes of cultural

    eutrophication (i.e., nutrient enrichment due to human activities) in

    surface waters. The most recognizable manifestations of this

    eutrophication are algal blooms that occur during the summer. Chronic

    symptoms of over-enrichment include low dissolved oxygen, fish kills,

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 11

    murky water and depletion of desirable flora and fauna.

    In addition, the increase in algae and turbidity increases the need to

    chlorinate drinking water, which, in turn, leads to higher levels of

    disinfection by-products that have been shown to increase the risk of

    cancer. Excessive amounts of nutrients can also stimulate the activity of

    microbes, such as Pfiesteria, which may be harmful to human health

    (US Environmental Protection Agency, 2007).

    Fig 2.4: Two types of activated sludge processes. (a) Conventional activated

    sludge; (b) Step-feed activated sludge. (Redrawn from Grady et al.(1999))

    Accordingly, a process that is capable of enhanced nitrogen and

    phosphorus removal is highly desirable. This is the goal of the BNR process,

    which uses the principles of the ASP, but through advanced bioreactor

    configuration is able to achieve higher levels of nitrogen and phosphorus

    removal.

    The history of the BNR process is interesting and deserves a brief

    discussion. Nitrogen and phosphorus removal technologies were developed

    separately, but con-currently, in the 1960s. During this time, developers of the

    processes were evaluating the use of various bioreactor zones and

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 12

    configurations and their effects on effluent quality. The bioreactor zones

    under study were aerobic (sufficient oxygen), anaerobic (absence of oxygen

    and nitrates) and anoxic (absence of oxygen with presence of nitrates).

    Much research was dedicated to configurations that would yield good

    nitrogen removal, however, due to the high costs, both capital and

    operational, biological nitrogen removal processes received very little

    commercial attention. Whereas biological nitrogen removal processes were

    receiving much academic attention but little commercial attention, biological

    phosphorus removal was a phenomenon that was actively being observed in

    plugflow bioreactors that were uniformly aerated. This method of aeration

    yielded low DO concentration levels at the front of the process creating

    anaerobic zones which are now known to be crucial to biological phosphorus

    removal. While it is now known that biological reactions are largely

    responsible for the phosphorus removal, this was a point of controversy

    during initial development of the process. These two processes have since

    been integrated into a single process today which is referred to as biological

    nutrient removal.

    The framework for the BNR process was first introduced by Barnard

    (1975), who purported the concepts which form the basis for BNR. The first

    concept is that appropriate use of anoxic and aerobic zones as well as nitrate

    recirculation form a single operational and cost-effective approach to nitrogen

    removal.

    The second concept is that sufficient removal of nitrate in the anoxic zone

    results in phosphorus removal. Using these concepts, various bioreactor

    configurations have been designed and implemented. The general BNR

    process is depicted in Fig. 2.5.

    The importance of the different zones in BNR is based on the terminal

    electron acceptor. The terminal electron acceptor in the aerobic zone is

    oxygen, in the anoxic zone it is nitrate-N and in the anaerobic zone where

    neither oxygen nor nitrate-N are present, it is carbon dioxide and sulfate

    (Grady et al., 1999). It is the alternating physiological environments created by

    the BNR bioreactor configuration that provide

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 13

    Fig 2.5: Process flow diagram for the BNR process. (Redrawn from Grady et

    al.(1999))

    enhanced removal of nitrogen and phosphorus in the effluent. In general, the

    aerobic zone provides SOM removal similar to the ASP, whereas the

    anaerobic zone provides phosphorus removal and the anoxic zone provides

    nitrogen removal.

    Biological nitrogen removal requires the use of both nitrification and

    denitrification processes. Nitrification occurs in aerobic zones where ammonia

    is converted first to nitrites and then to nitrates. Denitrification occurs in the

    anoxic cells when heterotrophic bacteria convert nitrate-N to nitrogen gas

    using nitrate-N as the terminal electron acceptor as they oxidize SOM. The

    nitrification and denitrification processes follow the nitrogen cycle, which is

    depicted in Fig. 2.6.

    Biological phosphorus removal involves the enrichment of the bioreactor

    zone with phosphorus accumulating organisms (PAOs). In the anaerobic

    zone, due to the lack of oxygen and nitrate-N, and the relatively short

    retention time, oxidation of SOM by heterotrophic bacteria does not occur.

    However, fermentation by these organisms will occur, resulting in the

    production of volatile fatty acids (VFAs). The VFAs are then transported and

    stored in the PAOs as polyhydroxyalkanoic acids (PHA) which are

    then used in cellular growth and the reformation of polyphosphate from the

    inorganic phosphorus found in the effluent. With the phosphorus trapped in

    the PAOs it can then be settled and removed (Grady et al., 1999).

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 14

    Fig 2.6: Graphical representation of the nitrogen cycle exploited in the BNR

    process.

    2.2 First Order Plus Dead Time Modelling

    The response of a process to a step input provides a method of characterizing

    and subsequently modelling the process. Step testing the process involves

    inducing a step change in the process, usually performed by a setpoint

    change, and observing the response. Many processes, when step tested in

    this fashion, exhibit a first order response but with a time lag. The transfer

    function of a first order process can be modified to include a time lag. This

    type of model is known as a first order plus dead time (FOPDT) model. Many

    processes can be modelled in this fashion. From the response of the process

    to a step input, the three parameters that comprise a FOPDT model can be

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 15

    surmised. These parameters are the steady-state process gain K, dead time

    TD and time constant . A graphical representation of the FOPDT model is

    shown in Fig. 2.7.

    The FOPDT model transfer function G(s) is expressed in the Laplace

    domain as

    where Kis the steady-state process gain Cs/m; Csis the ultimate process

    response; mis the step input; is the time constant; and TDis the dead time

    (Smith and Corripio, 1985).

    When a process is step tested in this way, the response observed from the

    feedback sensor represents the lumped response of the process, the actuator

    and the feedback sensor

    The model obtained can then be used in a simulation of the process and

    provides the complete response of the system, including the dynamics of the

    sensor, the actuator and the process itself.

    2.3 Fuzzy Logic Control

    Introduced by Zadeh (1965), fuzzy set theory is a form of mathematics that is

    used to represent approximate knowledge. Contrary to crisp, bivalent logic,

    where quantities take on values of one (true) and zero (false), fuzzy logic

    provides a method of evaluating logical expressions where quantities can take

    on continuous values between zero and one. This fuzzy as opposed to

    crisp representation of the data lends fuzzy logic its power to evaluate

    approximate reasoning. A brief introduction to fuzzy logic and its application to

    control are provided as background to the proposed solution.

    Fuzzy logic provides a method of utilizing approximate reasoning to solve

    problems and is derived from the way that people approach problem-solving.

    People generally think in fuzzy terms, i.e., a person might say the

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 16

    ep

    m(t) m

    rocess

    esponse

    (t)

    Cs

    0.632 Cst

    C

    0 TD t

    Fig. 2.7: Graphical representation of a FOPDT model. (Adapted from Smith

    and Corripio (1985))

    temperature outside is veryhot, or the meat is slightlyundercooked. Fuzzy

    logic affords the ability to use fuzzy descriptors or linguistic variables to define

    the inputs and output of the fuzzy system. In the above examples, the terms

    very and slightly are referred to as linguistic hedges and form part of the

    linguistic variable. The linguistic variables are then used in the formation of a

    rule base that is used to evaluate the output of the fuzzy system with respect

    to fuzzy sets (fuzzy inputs and outputs of the system).

    The way in which the linguistic variables are used to provide approximate

    reasoning is through the use of membership functions. Membership functionsare used to define the degree of which a linguistic variable describes the state

    of the fuzzy element under study. When the set of all possible values that a

    fuzzy element can take on (i.e., the universe of discourse) is plotted,

    geometric areas of the set are assigned to one of the linguistic variables.

    Fuzzy logic operations are then used to evaluate the output of the fuzzy

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 17

    system with respect to the rule base and the linguistic variables.

    Fuzzy rules generally take the form of an if-then statement, or an

    implication. For example, if A and B then C, where A, B and C are fuzzy

    objects, and where both A and B are conditions and C is the action.

    Accordingly, a method of evaluating these types of fuzzy expressions is

    required.

    Fuzzy logic operations are analogous to bivalent operations. The fuzzy

    operations complement, union and intersection correspond to the bivalent

    logic operations NOT, AND and OR. In bivalent logic, the implication of one

    set by another set is evaluated as the union of the first set with the

    complement of the second set. Bivalent logic implication is also extended for

    use in fuzzy logic. Implication, however, in the case of fuzzy logic, requires

    that connectives be expressed in terms of the membership functions for the

    corresponding sets. Fuzzy logic implication has been interpreted in several

    ways including Larsen implication, Mamdani implication, Zadeh implication,

    Dienes-Rescher implication and Lakasiewicz implication. The Mamdani

    implication has been selected for this work due to its wide acceptance. The

    expressions for fuzzy complement, union and intersection are given as

    (Karray and De Silva, 2004)

    A(x) = 1 A(x); x X;

    A B(x) = max[ A(x); B(x)]; x X;

    AB(x) = min[ A(x); B(x)]; x X;

    respectively, where Xis the universe of discourse; xis the variable in X; Aand

    B are fuzzy sets; Aand B are membership functions ofA andB, respectively;

    Ais the membership function representing the fuzzy complement ofA;ABis

    the membership function representing the union of A and B; and AB is the

    membership function representing the intersection of Aand B.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 18

    Fuzzy implication has been interpreted in multiple ways, however, since

    Mamdani implication is selected for this work, the Mamdani implication is

    provided which is given as (Karray and De Silva, 2004)

    AB(x) = min[ A(x); B(y)]; x X; y Y; (2.2)

    where Xand Yare the universes of discourse for Aand B, respectively; y is

    the variable in Y; and AB is the membership function representing A implies

    B.

    The above equations can then be used to develop the compositional rule

    of inference (CRI), which allows for the full evaluation of the if A and B then

    C expressions making up the rule base. Since both the AND and implication

    operations can be realized as min functions, and since the rules are joined

    using OR connectives, the membership function of the entire rule base is

    determined by (Karray and De Silva, 2004)

    R(a; b; c) = max min[ Ai(a); Bi(b); Ci(c)]; (2.3)

    i

    where R is the overall membership function for the rule base; i is the rule

    index; Ai, BiandCiare fuzzy sets;a,b andc are the variables inAi,BiandCi,

    respectively; and Ai , Bi and Ci are membership functions of Ai, Bi and Ci,

    respectively.

    These equations are necessary for evaluating the fuzzy relationships that

    form the system. Linguistic variables are assigned to the membership

    functions making up the fuzzy set. The areas where the membership functions

    overlap is what specifically characterizes fuzzy logic, where the boundary

    between system states is not precisely defined and is partially composed of

    multiple states. Typical fuzzy membership functions are shown in Fig. 2.8.

    The figure depicts the membership function for a variable x. The linguistic

    variables forx areHigh,Okay andLow. Areas A, C and E arethe parts of the

    fuzzy set that are exclusively High, Okay and Low, respectively. However,

    parts B and D are part Highand Okayand part Lowand Okay, respectively

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 19

    High Okay Low

    1

    (x)

    A C E

    X

    0.5

    B D

    0

    -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1

    x

    Fig. 2.8: Typical fuzzy membership functions.

    illustrating the fuzzy relationships. Membership functions can be constructed

    in several ways. Common types include Gaussian (as in Fig. 2.8), triangular

    and trapezoidal, but others exist.

    Fuzzy control is particularly well adapted to processes that are well

    understood by an expert. The expert assists in the development of the fuzzy

    rule base which describes in literal terms how the process is controlled. From

    the fuzzy rule base, membership functions are developed that characterize

    the relationships between the linguistic variables. Finally, fuzzy operations are

    carried out to evaluate the fuzzy expressions. Utilizing the fuzzy logic

    components described, a complete fuzzy inference system (FIS) can be

    constructed.

    2.5 The BNR Process

    The particular wastewater process under study is the BNR stage. As

    mentioned previously, BNR is an enhanced form of the ASP used in

    wastewater treatment. These processes are microbiological in nature and

    require regulation of the environment of the microorganisms contained in the

    bioreactor.

    The actual configuration of the bioreactor under study is show in Fig. 2.10.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 20

    Fig. 2.10: Process flow diagram for the bioreactor configuration.

    The process and instrumentation diagram (P&ID) for the process is shown in

    Fig. 2.11. The P&ID shows the major components of the process control

    system and their control signals to and from the industrial controller

    (programmable logic controller). As shown in Fig. 2.11, a header pipe carries

    the supply air to the FCVs controlling the airflow to each bioreactor cell. The

    process air is supplied by a team of blowers operating in a lead/lag

    configuration, whereby they are brought online sequentially as required. In

    this scheme, the blowers have full voltage non-reversing (FVNR) motors and

    the airflow through each blower is controlled by a FCV on its suction side. The

    blower system operates to keep a constant air pressure in the supply header

    through an independent control loop. The work in this paper focuses on

    developing a controller for the bioreactor FCVs.

    DO concentration of the aeration cells is a critical parameter in the overall

    control of the BNR process. The organisms in the bioreactor require a

    sufficient supply of oxygen to act effectively and there is a band of control

    required. If too little oxygen is supplied the organisms are suffocated.

    Conversely, if too much oxygen is supplied settling problems may occur later

    in the treatment process, in addition to wasted energy (Turmel et al., 1998).

    The dynamics that affect the DO inside of a bioreactor are complex and in

    some models the number of parameters involved exceeds sixty (Brdys and

    Maiquez, 2002).

    BNR is a specialized form of the ASP. Many approaches to controlling

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 21

    Fig. 2.11: Bioreactor process and instrumentation diagram.

    ASPs consider the entire process of which DO regulation is one

    component. In attempting to control the entire ASP automatically, elaborate

    mathematical models of the process must be constructed, which consist of

    many variables that cannot be measured and must be estimated.

    Furthermore, in many plants, certain parts of the ASP are controlled

    manually by the plant operations staff that monitor critical parameters on a

    daily basis. Samples of the wastewater are taken daily and analyzed in an

    offline laboratory. Accordingly, as much of the information collected is of a

    very coarse resolution, it does not lend itself to incorporation for automatic

    control of the system. The DO concentration of the bioreactor, however, is

    typically monitored continuously and it is highly desirable to be maintained at

    a specified setpoint. Meeting this goal helps to produce a good quality effluent

    and minimize operating costs. For this reason, this work focuses specifically

    on controlling the bioreactor DO concentration without regard for the

    remainder of the BNR process. Manual changes in the parameters of the BNR

    process made by plant staff undoubtedly change the bioreactor dynamics,

    however, the goal of this work is to characterize the bioreactor process and

    develop worst-case conditions, which embody these potential changes in

    dynamics and subsequently test the controller according to the range of

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 22

    process dynamics.

    For the purpose of controller design and simulation, an actual BNR bioreactor,

    is step tested and FOPDT models of the process are developed. The FOPDT

    modeling approach allows the direct incorporation of experimental data

    obtained from the actual plant into the simulation and design of the controller.

    While this method has the drawback of relying only on a snapshot of the

    process dynamics at a given point in time, it has the advantage of not having

    to rely on elaborate mathematical models of the ASP, which incorporate many

    assumptions and variables that cannot be measured.

    To address the fact that only a snapshot of the process is being evaluated,

    the bioreactor is tested under two separate conditions, a low wastewater flow

    condition and a high wastewater flow condition through the bioreactor. The

    objective of this experiment is to capture the dynamics of the process during

    each event to observe the process dynamics under these conditions and

    subsequently develop worst-case models for testing the controller

    performance.

    In wastewater plants, often, very little process instrumentation is available

    to assist in the control decisions of a bioreactor. In addition, it is very desirable

    to deploy a low maintenance, robust controller, that requires very little

    operator intervention for long-term, sustained operation. With this in mind, the

    work in this thesis focuses on developing a FLC for the bioreactor FCVs

    requiring only feedback of DO concentration and returning the required FCV

    stem position.

    In addition, as the dynamics of each cell of the bioreactor are different, one

    could develop individually tuned controllers for each cell, however, as

    simplicity, robustness and low-maintenance are the ultimate goal of this work,

    a single controller is developed that adequately controls each of the bioreactor

    cells under wide ranging and proposed worst-case process conditions.

    Finally, to ensure the controller is easy to realize in an industrial controller,

    an algorithm is developed to approximate the control surface of the optimal

    FLC as a lookup table. The lookup table can be implemented in any

    programmable logic controller (PLC) and is ideal for fast computation.

    The final result of this work is to be able to input one or more FOPDT pro-

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 23

    cess models and return a lookup table representing an optimal fuzzy control

    surface, optimized for an individual system or several systems concurrently.

    This technique can then be used to tune the controller optimally across its

    entire operational range, providing that FOPDT models of the process at its

    operational extremes can be obtained.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 24

    3. Literature survey3.1 Fuzzy Logic Control

    Based on Zadehs theory of fuzzy sets, the concept of fuzzy logic has been

    successfully applied to the control of industrial processes particularly those

    that are ill-defined but which can be successfully controlled by human

    operators.

    The basic idea of this approach is to incorporate the experience of human

    operators in the design of the controllers. The value of the inputs and outputs

    need not be numerical and may be expressed in natural language. Most

    commonly, a fuzzy logic model includes a mapping of input values to output

    values using simple IF-THEN statements, such as IF room temperature is

    high, THEN supply more cool air to the room. These types of mappings

    permit the incorporation of expert knowledge with the fuzzy logic model.

    3.1.1 Fuzzy If-Then Rule

    Assuming there are two inputs, xand y, to the system and the output is z. An

    example of a fuzzy if-then rule is:

    If xis Aiand yis Bi, then zis Ci.

    where x , y and z are linguistic variables, Ai , Bi and Ci are fuzzy sets

    characterized

    by membership functions.

    Another form of fuzzy if-then rule, T-S type proposed by Takagi and Sugeno

    (1985), has fuzzy sets involved only in the antecedent.

    If xis Ai and yis Bi, then z= c0i+ c1ix+ c2iy

    where the consequent of the rule is a linear function of the input variables.

    A simpler form is extensively used, which is actually a zero order T-S

    fuzzy rule. If xis Aiand yis Bi, then z= zi

    where zi is a crisply defined number.

    Through the use of linguistic labels and membership functions, a fuzzy if-then

    rule can easily capture the essence of humans experience. Fuzzy if-then

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 25

    rules form the core of the fuzzy inference system to be introduced below.

    3.1.2 Fuzzy Reasoning

    Fuzzy reasoning is an inference procedure used to derive conclusions from a

    set of fuzzy if-then rules and one or more conditions. The steps of fuzzy

    reasoning performed by fuzzy inference systems are (Shaw, 1998):

    Compare the input variables with the membership functions in the

    antecedent to obtain the membership values of each linguistic label

    (fuzzification).

    Combine the membership values on the antecedent to get firing

    strength (weight) of each rule.

    Generate the qualified consequent of each rule depending on the firing

    strength.

    Aggregate the qualified consequent to produce a crisp output (defuzzification).

    3.1.3 Fuzzy Inference System

    Basically, a fuzzy inference system is composed of four functional blocks as

    shown in Fig. 3-1 (Jang, 1993):

    Knowledge Base

    Input Output

    Fuzzification

    Data Base Rule Base

    Defuzzification(Crisp)

    (Crisp)

    Decision-Making Unit(Fuzzy) (Fuzzy)

    Fig. 3-1 Basic fuzzy inference system

    A fuzzification interface which transforms the crisp inputs into

    degrees of match with linguistic values.

    A knowledge base which contains a number of fuzzy if-then rules and

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 26

    defines the membership functions of fuzzy sets used in the fuzzy

    rules.

    A decision-making unit, sometimes referred to as an inference

    engine, which performs the interface operations on the rules.

    A defuzzification interface which transforms the fuzzy results into crisp

    outputs.

    Depending on the types of fuzzy reasoning and fuzzy if-then rules

    employed, fuzzy inference systems can be classified into different types:

    Mamdani fuzzy inference system:

    The overall fuzzy output is derived by applying max operation to the

    qualified fuzzy outputs (each of which is equal to the minimum of firing

    strength and the output membership function of each rule). The centroid of

    area, bisector of area and mean of maximum are normally used to obtain the

    final crisp outputs from the fuzzy outputs.

    Takagi-Sugeno fuzzy inference system:

    This system is applicable for Takagi-Sugeno type rules. The final outputs are

    the weighted average of each rules outputs. When the consequent of rules

    are crisp value, the overall outputs are the weighted average of each rulescrisp outputs.

    The following features have effect on the performance of fuzzy logic

    controllers (FLCs) (Pedrycz, 1989).

    Scaling factors for input and output variables.

    Membership functions of fuzzy sets.

    Setting of fuzzy rules.

    3.2 Artificial Neural Networks

    One of the most important capabilities of an artificial neural network (ANN) is

    that it can be trained to do a mapping between input and output variables by

    adjusting a set of weights and thresholds of a connectionist model based on

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 27

    training examples. It attempts to achieve good performance through massive

    interconnections of simple computational elements or neural units. An artificial

    neural network model is characterized by its architecture, its processing

    algorithm and its training algorithm. The network architecture specifies the

    arrangement of neural connections while the type of units is characterized by

    the activation function used. For a given architecture, the neural network is

    used in two different modes: the processing mode and the training mode. In

    the processing mode, the processing algorithm specifies how the neural units

    compute the outputs for any set of inputs and for a given set of weights. The

    training algorithm specifies how the neural network adapts its weights for all

    training patterns (Haykin, 1999).

    With respect to the architecture, four main types of neural networks can be

    distinguished:

    Layered feed-forward neural networks, where a layer of neurons

    receive inputs only from the neurons from the previous layer, such

    as multi-layer perceptrons.

    Recurrent neural networks, where the inputs to neurons are the

    nets previous outputs as well as inputs from external sources.

    Laterally connected neural networks, which consist of feedback

    input units and a lateral layer consisting of such neurons that are

    laterally connected to their neighbors.

    Hybrid networks, which combine two or more of the above features.

    The training algorithms for neural networks can be classified into supervised

    learning and unsupervised learning. In supervised learning, the networks are

    presented with a set of example input-output pairs and trained to implement a

    mapping that matches the examples as closely as possible. In contrast, for

    unsupervised learning, the networks are presented with only the input

    samples, and learned to group these samples into classes that have similar

    feature.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 28

    3.2.1 Multi-Layer Perceptron

    The multi-layer perceptron (MLP) is the most used and studied artificial neural

    network. According to the Kolmogorov theorem (Kolmogorov, 1957), a three-

    layer perceptron can be trained to approximate any non-linear function. Thus,

    the MLP can be a suitable tool for obtaining good approximate solutions in

    complicated mapping problems.

    A MLP is formed from interconnections of many basic neurons and are

    typically of the structure shown in Fig. 3-2. As shown in Fig. 3-2, in addition to

    the necessary input layer and output layer, there is also a hidden layer. This

    structure is referred to as a three-layer network in this work because it has

    three layers of nodes. However, it has only two layers of processing elements,

    the hidden layer and the output layer.

    Hidden Layer

    Input Layer Output Layer

    Fig 3-2 Simple architecture of a multi-layer perceptron

    In these layers, each neuron in a layer is connected to neurons in the

    previous and in the next layer, but it is not connected to any neuron in the

    same layer. These connections between neurons have their adjustable

    weights, which are adjusted during the training process. The inputs to each

    processing neuron are multiplied by their corresponding weight and the

    weighted sum is then acted upon by an activation function before the output.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 29

    x0 =1

    w0

    wi yxi f ()

    xnw

    n

    Fig. 3-3 Structure of a neuron

    Fig. 3-3 shows the structure of a single neuron. The function of the neuron

    can be described by:

    =wixi (2-1)

    y =f ()(2-2)

    where yis the output of the neuron,

    xi,i =0,K,n are then inputs to the neuron,

    wi,i =0,K,n are the weights connecting the inputxi to the neuron, and

    f () is the activation function which operates on the weighted sum of input, v .

    Typically, in addition to the inputs, a bias input is also added. If x0 is used as

    the bias input, it is normally set to a constant value of 1 and the bias is

    adjusted during training through adjustment of the bias weight w0.

    The following activation functions are commonly used:

    Threshold function:

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 30

    1, 0

    (2-3)f ()=

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 31

    connecting weights are adjusted to reduce the difference between the target

    or desired outputs and the actual outputs of the network. The training set,

    comprising many training pairs, is presented to the neural network repeatedly

    until the error decrease below the desired level. Study of different learning

    algorithms is always a very active area of the research in artificial neural

    networks. To date, many algorithms have been developed, among which the

    back-propagation (BP) algorithm is the most widely used.

    Before the BP algorithm is derived, the following notations are introduced:

    ylj(p) :output of the jth node in layer lfor the pth training example net

    input to

    net lj(p) : the jth node in layer lfor the pth training example

    wlji(p) : weight connecting the ith node in layer l1 to the jth node in

    layer lfor the pth training example

    d j(p) :desired response of the jth output node for the pth training

    example

    lj(p) : local gradient for jth node in layer lfor the pth training example

    Nl :number of nodes in layer l

    L : number of layers

    P : number of training examples

    The nodes in the first layer only transmit the inputs to the second layer.

    Referring to Fig. 2-3, the output of a node in layer l, for l2 , is given by

    ylj(p)=f (netlj(p)) (3-6)

    whereN

    netlj(p)=l1 wli(p)yi

    l1

    (p) (3-7)i=0

    For the special cases, we have

    yi1(p) is the ith component of the input vector to the network

    y0l1(p)=1, andwlj0(p)is the bias weight

    f () is the activation function.

    BP uses a gradient search technique to find the network weights that

    minimize an objective function. The objective function to be minimized is

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 32

    usually the average squared error function:

    1P

    Jav

    = J(p) (3-8)P p=1

    where J( p) is the total squared error at the output layer for the pth example:

    1 N

    J (p)= L(dj(p) yLj(p))

    2 (3-9)

    2

    j=1

    where NLis the number of nodes in the output layer.

    The weights of the network are determined iteratively according to:wlji(p +1)=wlji(p)+ wlji(p) (3-10)

    wlji(p)=

    J(p)

    (3-11)w

    lji(p)

    where is a positive constant called the learning rate. To implement this

    algorithm, an expression for the partial derivative of J( p) with respect to each

    weight in the network is developed. For an arbitrary weight in layer l, this canbe computed using the chain rule:

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 33

    where the kth neuron in the l+1 layer is connected to the jth neuron. Finally,

    the correction wlji( p) is defined by:

    The above equations comprise the back-propagation learning algorithm. At

    the beginning of the training process, all the connecting weights are usually

    initialized to some small random values. The learning rate can be fixed oradaptively chosen in a number of ways. The process of computing the

    gradient and adjusting the weights is repeated until the output error decrease

    to some specified level. The multi-layer perceptron can be used as a universal

    approximator, a classifier or a regression machine.

    3.3 Integration of Fuzzy Logic and Neural Networks

    Fuzzy logic and neural networks have been briefly overviewed in the previous

    sections. Table 3-1 lists the characteristics of fuzzy logic and neural networks.It can be seen that fuzzy logic and neural networks have several

    characteristics in common. For example, both are model-free function

    estimators that can be adjusted or trained for improved performance.

    However, each has its own advantages. The advantages of fuzzy logic over

    neural network are its tolerance for imprecision and explicit knowledge

    wlji( p) =lj( p) yi

    l1( p) (3-17)

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-a

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 34

    representation. On the other hand, neural networks offer other advantages

    such as the ability to learn and to generalize from these. In this regard, it is

    believed that the integration of fuzzy logic and neural networks can leverage

    the advantages of the two individual techniques.

    Table 3-1 Characteristics of fuzzy logic and neural networks (Medsker, 1995)

    Properties of intelligent systems Fuzzy logic Neural Networks

    Function estimators

    Trainable, dynamic

    Improvement with use

    Parallel implementation

    Numerical

    Tolerance for imprecision

    Explicit knowledge representation

    Adaptive

    Optimising

    Interpolative

    Tolerance for noise

    Research in the use of fuzzy logic with neural networks has been progressing

    at a rapid pace during the last few years. The integration of fuzzy logic and

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 35

    neural networks can be viewed from different perspectives. In terms of

    applications, numerous studies have been done on the improvement of

    control systems, conventional or fuzzy, by use of the neural technology. Other

    applications modify neural networks, supervised or unsupervised, with fuzzy

    techniques to improve their performance. The main approaches to integration

    of fuzzy logic and neural networks can be summarized as follows: fuzzy

    connectionst expert system, neural networks for designing and tuning fuzzy

    systems, FAM (fuzzy associative memory), FCM (fuzzy cognitive map) and

    FNN (fuzzy neural networks).

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 36

    4. System Identification, Modelling and SimulationThe bioreactor under study is relatively slow to respond and generally it is not

    desir-able to develop the controller by experimenting with the actual process.

    Therefore, in order to develop the proposed FLC and further optimize it,

    modelling the system is necessary to facilitate simulation.

    One of the objectives of this work is to develop a controller that is robust

    enough to perform well for multiple process models, several of which are

    modelled directly from raw process step testing data and two that represent

    worst-case scenarios. If this objective can be met then the controller is likely

    robust enough to provide good performance in spite of less than perfect

    modelling. However, given the difficulty in tuning the proposed controller in

    the field, several potential sources of error are incor-porated into the models

    including a nonlinear FCV, continuous random disturbances and low-pass

    filtering of the feedback signal.

    4.1 Bioreactor Step Testing

    As mentioned, FOPDT models provide a realistic approach to system

    identification for the purpose of system modelling. Much of the previous work

    in modelling a bioreactor for the purpose of DO control system simulation has

    been con ducted using analytical models derived from mass-balance

    equations. The analytical models attempt to incorporate the vast physical,

    biological and chemical properties present in a bioreactor, but for practical use

    often require several variables to be estimated. Development of FOPDT

    models through step testing is chosen for this work due to the realistic nature

    of the technique. Through step testing the actual bioreactor under study, the

    response of the actual process to a step input is observed and characterized.

    In FOPDT modelling, higher order systems are characterized by a first

    order approximation plus a transport lag. The three parameters of the FOPDT

    model (time constant, steady-state process gain and dead time) are actually a

    lumping together of many of the actual parameters of the process. The

    purpose is to fit the process response to a curve that is simpler to express. In

    turn, this means that it is more difficult to capture the operational ranges of

    the process to understand the process capability, since the parameters of the

    model are an abstraction of the actual process parameters. One of the

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 37

    drawbacks to FOPDT modelling through step testing is that the process

    response is only observed under the operating conditions present during

    testing, while the process may respond differently under alternative operating

    conditions. Thus, in some cases it is advantageous to observe and

    subsequently model the process response under multiple operating conditions

    to understand the process.

    In the case of the bioreactor under study, there are many process parameters

    that affect the response of the system. These include but are not limited to the

    physical dimensions of the bioreactor and its associated piping and

    components, pressure in the process air header, flow rate of the wastewater,

    quality of the secondary sludge, flow rate of the RAS, flow rate of the WAS,

    OUR in the bioreactor, quality of the wastewater, temperature of the

    wastewater, temperature of the process air, etc. There are many more but

    these are examples of the actual process parameters that would need to be

    considered in any analytical model of the bioreactor. By contrast, step testing

    presents a simple, but effective method of obtaining a reasonably accurate

    model. This is especially valid for large, slow processes that do not need to be

    controlled precisely, but need to perform reasonably well over a wide range of

    process conditions.

    It was determined through consultation with the Operators of the bioreactor

    that one of the most important factors in the performance of the bioreactor is

    the rate of wastewater flow. During times of high flow, the wastewater does

    not have the same retention time in the bioreactor and also the high flows

    tend to change the dynamics of the organisms in the bioreactor. Therefore, in

    order to characterize the process, two conditions are selected to provide two

    types of models that establish a worst-case operational range of the system.

    The process conditions selected for this purpose are when the bioreactor is

    experiencing low or normal wastewater flow rates and when it is experiencing

    high wastewater flow rates, such as during a storm or melt event. Therefore,

    each of the three cells is step tested during both low flow and high flow

    conditions, giving the following specific conditions: cell 1 low flow (C1LF), cell

    2 low flow (C2LF), cell 3 low flow (C3LF), cell 1 high flow (C1HF), cell 2 high

    flow (C2HF) and cell 3 high flow (C3HF). The experimental step testing data is

    plotted in Fig. 4.1.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 38

    The process and instrumentation diagram (P&ID) for the bioreactor shown

    in Fig. 2.11 depicts the team of blowers which supply process air to a

    common header. The common header is shared between two bioreactors and

    it makes a constant header pressure available to the cells of the bioreactors

    through a modulating, electrically actuated valve. The team of blowers

    operates in such a way that blowers are brought online and taken offline

    according to the demand for air, as sensed by a pressure transmitter on the

    common header. One important point to consider in this test scenario is that if

    the system dynamics change significantly and a blower needs to be brought

    online or taken offline during the test, it could potentially cause a significant

    undesirable disturbance to the system and compromise the test data.

    The blower control system is not part of this work, however, it is important to

    understand how it works in order to appreciate how the step testing is carried

    out. The blowers are full-voltage non-reversing (FVNR) motors. The airflow

    through each blower is controlled by modulating an electrically actuated valve

    on the suction side of the blower. The operational regime of the blower

    system is such that if the demand for process air is reduced beyond a certain

    threshold, then blowers must be taken offline or they will automatically shut

    down due to electrical current limitations, possibly causing an undesirable

    disturbance. Hence, if the bioreactor FCVs are closed for step testing, it will

    cause this very situation and as the valves are opened, and demand for

    process air increases, blowers will be brought online causing step changes in

    the header pressure.

    6 45

    4.8 36

    a

    n

    ow

    DO

    (mg/L)

    3.6 27

    2.4 18

    1.2 9

    30 60 90 120

    Time (min.)

    (a)

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 39

    1.5 75

    1.2 60

    PlantFlow

    (MLD)

    DO(mg/L)

    0.9 45

    0.6Cell 1

    30

    0.3Cell 2

    15

    Cell 3

    Plant Flow

    30 60 90 120Time (min.)

    (b)

    Figure 4.1: Plant flows during bioreactor step testing. (a) Low flow condition;

    (b) High flow condition.

    In addition, if the blowers are brought online, and then are taken offline again,

    they have a ten minute restart inhibit period before they can be brought online

    again.

    The situation described above is mitigated by testing only one of the two

    bioreactors and utilizing the second bioreactor to assist in manually controlling

    the conditions of the process air header to ensure that blowers are not

    brought online or taken offline during testing. It is noted that this method inconjunction with the existing blower control loop produces a very stable

    header pressure. The step testing data is plotted with the header pressure in

    Fig. 4.2, showing a header pressure setpoint of 55 kPa being tracking very

    tightly.

    The step testing is completed by first closing the FCVs for the selected

    bioreactor. Each cell is then tested individually by opening the FCV to 100%.

    The response of the DO concentration in the bioreactor is measured by DO

    transmitters and is recorded in the supervisory control and data acquisition

    (SCADA) system. The step test results are shown in Fig. 4.1 and 4.2. Fromthe results it can be generalized that when the flow is low, the process has a

    higher gain.

    An important characteristic of a system where multiple processes are present

    is whether the processes interact. Interacting processes typically require a

    decoupling mechanism for the controllers to avoid fighting each other. In the

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 40

    case of the bioreactors in this work, they are designed such that wastewater

    flows in one direction and there are baffles between the aeration cells that

    allow only a few inches of water to flow over to the next cell. This design

    minimizes the backflow of oxygen from downstream aeration cells.6 60

    4.8 48

    Pressure(kPa)

    DO(mg/L) 3.6 36

    2.4 24

    1.2 12

    30 60 90 120Time (min.)

    (a)

    1.5 60

    1.2 48

    Pre

    ssure(kPa)

    DO

    (mg/L) 0.9 36

    0.6Cell 1

    24

    0.3Cell 2

    12

    Cell 3

    Pressure

    30 60 90 120Time (min.)

    (b)

    Fig. 4.2: Header pressure during bioreactor step testing. (a) Low flow

    condition; (b) High flow condition.

    The step testing is completed in the order of the most downstream cell to

    the least downstream cell. This means that once a cell is tested, because it

    cannot interact with upstream cells, it can be returned to service. This is

    demonstrated by the results in that during both tests, when cell 3 is tested in

    isolation, no response is observed in cells 1 and 2. Since the DO does not

    migrate to upstream cells, the cells do not interact.

    One might presume that as the wastewater flows downstream it carries

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global Education Services Pvt. Ltd., Bangalore

    Page | 41

    with it some DO, however, the test results do not indicate this. During the low

    flow step testing, each cell is returned to service after it is tested. However,

    during the high flow step testing, cell 1 and cell 3 are inadvertently returned to

    service for a brief period while step testing cell 2. The results indicate that the

    contribution of DO from cell 1 and cell 3 to cell 2 during this period is

    negligible, and that very little DO flows upstream or downstream to adjacent

    cells.

    4.2 Development of FOPDT Models

    From the step testing data, the values for the FOPDT model parameters for

    each process are extracted. There are methods to characterize the response

    graphically in a piecewise fashion by observationally extracting the dead time

    and steady-state process gain and then deriving the time constant. However,

    for the purpose of this work, in order to generate the models as accurately as

    possible, the models are simulated and tuned to match the step test process

    reaction curves as closely as possible. The FOPDT model step responses are

    plotted with the actual step test process reaction curves in Fig.s 4.3 and 4.4.

    While the data collected during step testing is not perfect due to the number of

    disturbances inherent in the process, the FOPDT models produce step

    response curves that match the actual process reaction curves very well. Two

    proposed worst-case models are developed by inspecting the process models

    obtained experimentally and the use of two assumptions. The two

    assumptions are that increasing process gain leads to decreased stability and

    that increasing dead time leads to decreased stability. The time constant of

    the process is varied to provide two extremes, one when the time constant is

    relatively fast and one when it is relatively slow. The largest time constant is

    doubled and the smallest time constant is halved to create the two scenarios.

    The other two parameters, process gain and dead time, are doubled for each

    scenario to create the two worst-case scenarios at opposite extremes of the

    operational range of the bioreactor. The selected values for the parameters of

    the process and worst-case FOPDT models are shown in Table 4.1.

  • 5/28/2018 Optimization of Bioreactor Controls using Model Predictive and Neuro Fuzz...

    http:///reader/full/optimization-of-bioreactor-controls-using-model-predictive-an

    Optimization of Bioreactor Controls using

    Model Predictive and Neuro Fuzzy Control Techniques Nithin Varghese Ninan

    Manipal Global