Anda di halaman 1dari 36

A REPORT ON

ANN Based pH Control


Under the partial fulfilment of course

SUBMITTED BY SUMIT GUPTA MALIK BULBUL SINGH RAGHAV SUBRAMANIAN 2009A8PS290P 2009A8PS293P 2009A8PS294P

SUBMITTED TO

Dr. SUREKHA BHANOT


Professor Department of Electronics and Instrumentation Engineering

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE PILANI


04 APRIL 2012

ACKNOWLEDGEMENT
We sincerely thank Prof. Surekha Bhanot, Instructor in-charge, INSTR C312, for giving us this opportunity of gaining an experience in mathematical modeling using MATLAB based Artificial Neural Networks. We would also like to express our deep sense of gratitude to Dr. Surekha Bhanot, for her valuable suggestions and advice without which this report would not have been possible. We are also grateful to Mr. Parikshit K. Singh and Mr. Rajesh Purohit, tutorial instructors, for providing us with a clear understanding of the subject. The vote of thanks will be incomplete without the mention of seniors and our friends who have helped us in making this project successful.

TABLE OF CONTENTS
TOPIC Abstract Introduction Process Description and Modelling Conclusion References Page No. 4 5 8

ABSTRACT
This report aims at the modeling of pH neutralization process which is a very important process in the chemical industry and implementing servo control for the pH neutralization process in a CSTH. The dynamic behavior of neutralization process in (CSTR) was studied and the process control was implemented using different control strategies Neural Network (NARMA-L2, NN Predictive) control for neutralization of weak acid with a strong acid (NaOH). The report has been broadly divided into three parts where the first part deals with the process modeling of the pH neutralization of a weak acid with a strong base in CSTH and the derivation of the mathematical model for the process. The second part deals with ANN (Artificial neural network), it's evolution over the period of time, it's basic understanding, it's various applications. The third and the last part deals with different control strategies that are available and have been implemented till now for various process models specifically pH neutralization process. And the control methods that we have implemented using Simulink and neural network toolbox which provide NARMA-L2, NN Predictive controllers which can be trained as per the model.

INTRODUCTION
The precise control of pH is vital in many processes. Some of the applications that require a precise control of pH are in the areas of wastewater treatment, pharmaceuticals, biotechnology and chemical processing. Wastewater treatment is especially difficult since it is necessary for the effluent stream to remain neutral to prevent corrosion, to protect aquatic life or to provide neutral water for reuse as process water or as boiler feed. In bioreactors, the control of pH is important to support cell growth. In the production of pharmaceuticals, a tight control of pH is critical to maintain the quality of the products. The control of pH has long been recognized as a difficult problem. The difficulties arise due to frequent changes in the influent composition and the severe process non-linearities. The process non-linearity can be expressed as a Sshaped static pH response (see Fig. 1). Several approaches have been suggested in the past to handle non-linear aspects of pH control. Some of these methods are generic model control, internal model control, reaction invariant control and gain scheduled PI control. The use of an adaptive control scheme may at first seem to be the appropriate choice for the control of a pH neutralization process as shown in many studies. However, satisfactory long-term control behavior was not obtained for the continuous running of an adaptive control scheme. At times the use of adaptive control scheme has resulted in a change of sign of the process model, such that the valve is driven to saturation. Due to this, the adaptation is usually turned off when unusual pH responses are observed. Despite the many other advances in non-linear control theory, gain scheduled PI control remains the preferred choice for the industries.
5

In the standard gain scheduled control schemes the gains selection for the PI controller is dependent on the current pH in the continuous stirred tank reactor (CSTR). As the pH in the CSTR varies the gain varies accordingly. In this report use of this control scheme has shown a vast improvement on the performance of the control system. Furthermore this method does not demand significant computing resources and is heuristically easy to understand and simple to implement. These characteristics should make this control scheme more appealing to be put into industrial practice.

PROCESS DESCRIPTION AND MODELLING


The practical system under study in this paper is a pH neutralization system (see Fig. 2). The pH is defined as a measure of acidity or alkalinity of a solution containing water. It is mathematically defined, for a dilute solution, as the negative decimal logarithm of the hydrogen ion concentration [H+] in the solution, that is: pH = log10[H+] (1) Practical pH processes tends to be very complicated in terms of variations of the species contained in the influent and the reagent and the selection of the mixing equipment. However, there exist several well known dynamical models accounting for the dominant characteristics of a pH process in a CSTR. The pH neutralization process presented in this paper was adapted from the dynamical model presented by McAvoy. This model had been derived from first principles and has been verified by experimental results. The model consists of two parts, a dynamical model describing the flow dynamics of concentrations of the influent compositions into the CSTR followed by a static non-linearity characterizing the physiochemical equilibrium conditions between these concentrations. Assuming that the pH neutralization process has two inlet streams, the first inlet stream contains an acid of concentration C1 with a flow rate of F1 and the second inlet stream contains base with concentration C2 and flow rate of F2. The dynamic model for the CSTR is then given as: V = F1C1 (F1 + F2) . (2)

= F2C2 (F1 + F2) (3)

where the constant v is the volume of the content in the reactor, and and the concentrations of the acid and the base, respectively. These equations describe how the concentrations vary dynamically with time subject to the input streams F1 and F2. To obtain the pH in the effluent stream, a relation between instantaneous concentrations and is needed.

This relationship can be described as a non-linear algebraic equation known as the titration curve. Depending on the chemical species used, the titration curve varies. In this paper we consider the case of a weak acid neutralized by a strong base. Nominal process operating conditions are provided in Table 1. Consider an acetic acid
9

(weak acid) denoted by HAC, being neutralized by sodium hydroxide (strong base) denoted by NaOH. The reactions are: H2O H+ + OH HAC H+ + AC NaOH Na+ + OH The electro neutrality condition states that the sum of the charges of all ions in the solution must be zero,

this is given by: [Na+] + [H+] = [OH] + [AC] . (4)


10

where the symbol [] denotes the concentration of its argument. In water where the dissociation is incomplete, we define the dissociation constant of water as: Kw = [H+][OH] .. (5) where Kw = 1014 is the dissociation constant for water at 25C. Similarly we can define the dissociation of acetic acid as: Ka = [AC][H+] (6) [HAC] where Ka = 1.8 105 is the dissociation constant of acetic acid at 25C. Defining the concentrations of and as: = [HAC] + [AC] . (7) and = [Na+] (8) we have a set of seven independent equations (Eqs. (2) (8)) with seven unknowns which describes the dynamic behavior of this neutralization process. A more condensed form of the above equations can be achieved by eliminating [OH] using Eq. (5), [AC] using Eq. (4), and [HAC] using Eq. (6). The resulting are Eqs. (2), (3) and (9) : [H+]3 + (Ka + ) [H+]2 + (Ka( ) Kw) [H+] KwKa = 0 (9)

11

A Simulink model was constructed using this derivation of the dynamical model to represent the pH neutralization process between acetic acid and sodium hydroxide (see Fig. 3).

Fig. 3 Mathematical Model Implementation

12

Fig.4 Model for pH Utilization

13

Fig.5 Neutralization Curve simulated in Process Model

14

Fig.6 Final Control Model

15

Fig. 7 Model Behaviour

16

Fig.8 NN Predictive Controller

17

Fig.9 Training Data

18

Fig.10 Neural Network and Training Parameters

19

Fig.11 Validation Data

20

Fig.12 Simulation using Randomly Varying Set point

21

ARTIFICIAL NEURAL NETWORK


Artificial neural networks are inspired by the early models of sensory processing by the brain. An artificial neural network can be created by simulating a network of model neurons in a computer. By applying algorithms that mimic the processes of real neurons, we can make the network learn to solve many types of problems. A model neuron is referred to as a threshold unit and its function is illustrated in Figure 1a. It receives input from a number of other units or external sources, weighs each input and adds them up. If the total input is above a threshold, the output of the unit is one; otherwise it is zero. Therefore, the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning
If the classification problem is separable, we still need a way to set the weights and the threshold, such that the threshold unit correctly solves the classification problem. This can be done in an iterative manner by presenting examples with known classifications,
22

one after another. This process is called learning or training, because it resembles the process we go through when learning something. Simulation of learning by a computer involves making small changes in the weights and the threshold each time a new example is presented in such a way that the classification is improved. The training can be implemented by various different algorithms.

Back-propagation
Training starts by setting all the weights in the network to small random numbers. Now, for each input example the network gives an output, which starts randomly. We measure the squared difference between this output and the desired outputthe correct class or value. The sum of all these numbers over all training examples is called the total error of the network. If this number was zero, the network would be perfect, and the smaller the error, the better the network. By choosing the weights that minimize the total error, one can obtain the neural network that best solves the problem at hand. This is the same as linear regression, where the two parameters characterizing the line are chosen such that the sum of squared differences between the line and the data points is minimal. In back-propagation, the weights and thresholds are changed each time an example is presented, such that the error gradually becomes smaller. This is repeated, often hundreds of times, until the error no longer changes. In back-propagation, a numerical optimization technique called gradient descent makes the math particularly simple; the form of the equations gave rise to the name of this method. There are some learning parameters (called learning rate and momentum) that need
23

tuning when using back-propagation, and there are other problems to consider. For instance, gradient descent is not guaranteed to find the global minimum of the error, so the result of the training depends on the initial values of the weights.

24

CONTROL SYSTEMS
Control systems are tightly intertwined in our daily lives so much so that we take them for granted. They may be as low tech and unglamorous as our flush toilet. Or they may be as high tech as electronic fuel injection in our cars that we now drive. In fact there is more than a handful of computer control systems in a typical car that we now drive. In everything from the engine to transmission, shock absorber, brakes, pollutant emission, temperature, and so forth, there is an embedded microprocessor controller keeping an eye out for us. The more gadgetry, the more tiny controllers pulling the trick behind our backs.1 At the lower end of consumer electronic devices, we can bet on nding at least one embedded microcontroller. In the processing industry, controllers play a crucial role in keeping our plants running virtually everything from simply lling up a storage tank to complex separation processes and chemical reactors. To consider pH as a controlled variable, we use a pH electrode to measure its value and, with a transmitter, send the signal to a controller, which can be a little black box or a computer. The controller takes in the pH value and compares it with the desired pH, what is called the set point or the reference. If the values are not the same, there is an error, and the controller makes proper adjustments by manipulating the acid or the base pump the actuator. The adjustment is based on calculations made with a control algorithm, also called the control law. The error is calculated at the summing point, where we take the desired pH minus the measured pH. Because of how we calculate the error, this is a negative-feedback
25

mechanism. When we change a specic operating condition, meaning the set point, we would like, for example, the pH of the bioreactor to follow our command. This is what we call servo control. The pH value of the bioreactor is subjected to external disturbances (also called load changes), and the task of suppressing or rejecting the effects of disturbances is called regulatory control. Implementation of a controller may lead to instability, and the issue of system stability is a major concern. The control system also has to be robust such that it is not overly sensitive to changes in process parameters.

Neural Network in Control Systems


Neural networks have been applied successfully in the identification and control of dynamic systems. The universal approximation capabilities of the multilayer perceptron make it a popular choice for modeling nonlinear systems and for implementing general-purpose nonlinear controllers. This chapter introduces three popular neural network architectures for prediction and control that have been implemented in the Neural Network Toolbox software: Model Predictive Control NARMA-L2 (or Feedback Linearization) Control Model Reference Control This chapter presents brief descriptions of each of these architectures and demonstrates how you can use them. There are typically two steps involved when using neural networks for control: 1. System identification
26

2. Control design In the system identification stage, you develop a neural network model of the plant that you want to control. In the control design stage, you use the neural network plant model to design (or train) the controller. In each of the three control architectures described in this chapter, the system identification stage is identical. The control design stage, however, is different for each architecture: For model predictive control, the plant model is used to predict future behavior of the plant, and an optimization algorithm is used to select the control input that optimizes future performance. For NARMA-L2 control, the controller is simply a rearrangement of the plant model. For model reference control, the controller is a neural network that is trained to control a plant so that it follows a reference model. The neural network plant model is used to assist in the controller training.

27

Controllers in NNET Toolbox


Model Predictive Control This controller uses a neural network model to predict future plant responses to potential control signals. An optimization algorithm then computes the control signals that optimize future plant performance. The neural network plant model is trained offline, in batch form, using any of the training algorithms. (This is true for all three control architectures.) The controller, however, requires a significant amount of online computation, because an optimization algorithm is performed at each sample time to compute the optimal control input. NARMA-L2 Control This controller requires the least computation of these three architectures. The controller is simply a rearrangement of the neural network plant model, which is trained offline, in batch form. The only online computation is a forward pass through the neural network controller. The drawback of this method is that the plant must either be in companion form, or be capable of approximation by a companion form model. Model Reference Control The online computation of this controller, like NARMA-L2, is minimal. However, unlike NARMA-L2, the model reference architecture requires that a separate neural network controller be trained offline, in addition to the neural network plant model. The controller training is computationally expensive, because it requires the use of dynamic back propagation.
28

Fig.13 Neural Network

29

Fig.14 Testing Data

30

Fig. 15 Training Behaviour

31

Fig.16 Neural Model and its Paramaters

32

Fig.17 Simulation 1

33

Fig.18 Simulation 2

34

CONCLUSION
The present report represents a simulation programs in MATLAB language used to study and develop a mathematical model of the dynamic behavior of neutralization process in a continuous stirred tank heater (CSTH), and the process control implemented using different control strategies. The following conclusions can be drawn: 1. For now the NARMA-L2 controller of NNET toolbox is very fast relative to the NN predictive model which takes a longer time even in the simulation. 2. NN predictive model is more accurate for the data training that we have used. 3. Volume plays a big role in the control strategy as the increase in volume decreases the sensitivity of the model hence the NN predictive model gets more accurate. 4. Training for 1000 data sets is enough to train the neural network.

35

REFERENCES
Process Control by Prof. Surekha Bhanot What are Artificial Neural Networks? by Anders Krogh www.mathworks.com Modified Functional Link Artificial Neural Network by Ashok Kumar Goel, Suresh Chandra Saxena and Surekha Bhanot Neuro modeling and control strategies for a pH process by E.Sivaraman and S.Arulselvi Adaptive control of a pH Process by Dr.Karima M. Putrus and Zahra'a F. Zihwar

Modified Mathematical Model For Neutralization System In Stirred Tank Reactor by Ahmmed Saadi Ibrehem

36

Anda mungkin juga menyukai