Fault Detection in CSTR using MATLAB

Rishi Sarup Sharma. The paper discusses the diagnosis of different faults taking place in a continuous stirred tank reactor (CSTR). The reaction taking place is the alkaline hydrolysis of ethyl acetate in the presence of sodium hydroxide. The objective of the paper is to detect the faults occurring in the CSTR and to determine their magnitude and time of occurrence. The fault finding strategy is two prongedanalyzing the faults based on their deviation from the normal behaviour and estimating their time of occurrence from the plots. The next step undertaken is the evaluation of the fault deviation in percentage and subsequently certain conclusions are drawn from these.

The paper discusses the diagnosis of different faults taking place in a continuous stirred tank reactor (CSTR). The reaction taking place is the alkaline hydrolysis of ethyl acetate in the presence of sodium hydroxide. The objective of the paper is to detect the faults occurring in the CSTR and to determine their magnitude and time of occurrence. The fault finding strategy is two pronged-analyzing the faults based on their deviation from the normal behaviour and estimating their time of occurrence from the plots. The next step undertaken is the evaluation of the fault deviation in percentage and subsequently certain conclusions are drawn from these.

Introduction:-
The development of industrial manufacturing and advanced control systems have led to increase in the complexity of the system. Hence, process monitoring and fault detection become crucial for the safe operation of the system, as a whole. The conventional methods of fault detection can be broadly classified into two sub-divisions, namely knowledge-based and process data-driven procedures. Though the methodology involving data-driven methods is incapable of diagnosing on-line faulty data, it does not require in-depth knowledge of the process / plant. Between the different process-driven methods, the principal component analysis (PCA) and partial least squares (PCS) are approaches worth mentioning. However, these methods assume the process data to be based on Gaussian distribution, which may not be in-line with that generated by real-world systems [1]. A fault corresponds to the undesired deviation of system or its components from its normal behaviour. The deviation of the system performance actually conveys how much it is degraded. This would then give an idea to decide whether the fault can be tolerated or it is critical for the system leading to shut-down or may lead to a catastrophe [6].
Possible causes of faults are damaged components leading to catastrophe and thereby degrading the product quality. The modern plants are expected to run for extended hours. The focus is shifting towards preventing the occurrence of sudden shutdowns. Hence, it is imperative that system be monitored for system dynamic state so as to generate a warning in case of a mal-operation and give time for initiating corrective actions. Such on-line procedures depend heavily on the model-based system estimation and are most likely employ one of these available methods, known as, Bayesian filtering and Kalman filtering. These methods rely on the observations that are represented sequentially in time. The beauty of these methods can be gauged from the fact that they are optimal in use for linear state-space models and are based on the data that contains independent, additive and Gaussian noises [2].
The structure of the remaining paper is as follows: The reaction kinetics, taking place in the CSTR, is discussed the next section. Section 3 explores the experimental set-up used to for the diagnosis of faults. Section 4 investigates the different techniques adopted hitherto, for the fault diagnosis in dynamic systems. Section 5 presents the results obtained for the different faults occurring in the CSTR and their specific variation with regard to time. It also elaborates the results in terms of the qualitative analysis drawn from these fault characteristics. The last section states the conclusions on the basis of the present work.

Kinetics of Reaction in CSTR:-
The reactor employed in the present work is a Cascade CSTR, where continuous stirring is done to mix the two liquids with a variable flow rate. Continuous operation is the preferred mode of operation for many chemical processes. Continuous stirred tank reactors (CSTR), either as a single unit (tank) or connection of multiple units in series, are mostly employed in the chemical plants. The CSTR reactor is generally employed for liquid-phase or multi-phase reactions that have fairly high reaction rates. Streams of the reactants are continuously being fed into the vessels and product streams are withdrawn. The use of CSTR is widely accepted in the organic chemical industry, chiefly due to consistent product quality, ease in control, in comparison to other reactor types [12].The CSTR may be operated in steady state, implying thereby that no variables vary with time. Here the ideal conditions are termed to be that in which the flow rates are assumed to be constant [14].
The objective of the present work is to determine the faulty conditions, evaluated during the process dynamics in CSTR. The operating conditions in the CSTR involve the alkaline hydrolysis of ethyl acetate in the presence of sodium hydroxide. This in other words, is also termed as saponification. It is defined as the hydrolysis of a fat or oil (in the form of alkali) to yield soap for cleaning and reaction purpose. It refers to the process of hydrolysis of an ester under alkaline conditions to produce alcohol along with salt of a carboxylic acid (in the form of carboxylates). The sodium hydroxide, present in this reaction, acts as a caustic base. The vegetable oils and animal fats, present in the form of esters, act as triglycerides. When an alkali reacts with an ester, it breaks the bonds within the esters and yields a fatty acid salt along with glycerol [13].

Fig1: Experimental Set-up for CSTR
The cascade CSTR shown in figure 1 employs mixing of reactants ethyl acetate and sodium hydroxide using phenolphthalein as indicator, which are contained in the tanks shown in figure 2 below. The readings are obtained by varying the stirrer (agitator) speeds and flow rate respectively. The agitator is driven by an electric motor, placed on the front panel, as depicted in the figure. The electric motor is further driven by a variable speed unit. The stirring rate is governed by the adjusting the speed of agitator. The solution of ethyl acetate and sodium are first prepared and put in the tanks. Flow rate of the mixing the reactants in the two tanks are governed by adjusting the Rota meter, as shown in the figure 1. After each vessel is filled to the desired level, the liquid passes on the next vessel, through an orifice, placed at pre-determined height, of the vessel. The titration end point is reached at a point where the additional amount of sodium hydroxide changes colour to pink, before treating the output sample with a few drops of phenolphthalein indicator. With each such successive reading so obtained, the volume in both the tanks keeps decreasing. Figure 2 depicts the tanks that house the reactants for mixing in the CSTR.

Fault Diagnosis:-
A system having the capability of detection, isolation, identification and classification of faults is termed as a fault diagnosis system. The individual tasks of these functionalities are given below:- Fault detection component helps to reach a conclusion regarding the working of the system under normal or faulty conditions.  In case of occurrence of fault, then the task of fault isolation involves the localizing of the faulty component, initiating the fault.  Fault identification primarily deals with identifying the fault nature, in terms of its magnitude, severity and significance, with regard to how critical it can prove for the system.
The concept behind the same is the generation of signals that depict disparities between fault-free and after-fault conditions. These signals are referred to as residuals and can be conveniently generated using analytical redundancy approaches such as state observers, parity equations and parameter estimation. These are briefly discussed below:-(i) State Observers:-These help to estimate the system outputs from the system inputs and outputs. The residual can be represented as a weighed difference of the estimated and actual outputs. It is flexible to choose the gain of the observer and this property has been exploited in the observer structure.
(ii) Parity Relations: -These stem from the functional relationship between the sensor and actuator signals. It also relies on the temporal redundancy that exists when dynamic relations are used between inputs and outputs [3]. The vital thought that governs this technique is checking for the inconsistencies in the system equations, expressed mathematically. The analytical redundancy relations can be broadly classified into following two categories:a) Direct redundancy-functional inter-relationships existing among the various system / sensor outputs, expressed in terms of algebraic relations. b) Temporal redundancy-it signifies the dynamic relations that exist between sensor outputs and their subsequent actuator inputs. Such a relation is represented in terms of differential or difference equations [4]. (iii) Parameter estimation: -Faults occurring within the components of a dynamic system are assumed to have occurred in the physical parameters in terms of say temperature, pressure, velocity etc. The detection of faults is done by making the estimation of parameters in case of non-parametric models. The underlying postulation governing the above techniques is that each of these requires an accurate, well-defined plant model. As a result, the qualitative-based methods suffer from the hindrance of making an exact model of a real-world system, which makes their implementation all the more difficult. Any or part of process dynamics left unmodelled or ignored, is liable to render the performance of the system ineffective. For circumventing this problem, there is need of a robust methodology, which apart from making the system more sensitive to faults, also minimizes the effects of the disturbances on the system performance [3].
Conventional methods used for detection and diagnosis of faults can be broadly classified into three categories:model-based methods having two type-quantitative and qualitative and process history-based methods. Model-Tanks containing the reactants & connected in Cascade based methods initially acquire knowledge regarding the underlying physics behind the concerned process. The different quantities, governing the process, are then formulated and subsequently framed in the terms of a mathematical inter-relationship and known as a model. Prominent among these are the Kalman filters, Luenberger observers, and parameter estimation. On the contrary, process history methods do not employ the physics behind the process, as tool to acquire the model. Rather, it uses historic data for diagnosis and detection of faults. The observed data helps to extract characteristic features of the process which, in turn, estimate the system parameters. The data chosen must be descriptive in terms of fault-free and faulty data during the operational modes of the process. A few significant among them are expert systems, neural nets, statistical methods. A prominent and defining sign for an effective fault diagnosis system is adaptability. The responsiveness of the process changes due to the variations brought about by the deviations in the process dynamics, external disturbances, and internally-generated fault signals. In case of the process under study, a diagnosis method proves to be invalid if the process parameters or framework does adjust to the changes [5]. Prevailing fault diagnosis approaches for chemical processes can be broadly classified into two categories: Model-free techniques (that rely on statistical analysis, fuzzy logic, neural networks and expert systems), and model-based techniques which rely on observer-based methods.
Model-free methods: -These do not require a system model. Instead, historical data is collected in usual operating conditions. Among these, statistical and expert systems have recently researched and have found varied applications. Early studies on statistical analysis employed uni-variate analysis involving basic threshold techniques. In the recent years, these have been replaced by the multi-variate analysis e.g. principal component analysis. Knowledge-based expert systems involve embedding knowledge of the process, into the system. The system response cannot be predicted outside the problem domain. Such problem can be easily overcome by making use of neural networks (NN), since it is not necessary to embed knowledge or mathematical model of the process [7]. (ii) Model-based methods: -These substantiate the measurements of process variables. These process variables are then compared with respective estimates, obtained through the mathematical model of the system. Comparison of measured and estimated values leads to the generation of residuals which makes the process variables sensitive to fault occurrence. Handling of residuals promotes fault detection (i.e. recognition of fault presence), fault isolation (i.e. resolving faulty components), identification (i.e. computing fault size). The process variables are monitored using system model (in the form of diagnostic observer), being operated in parallel with the process. For fault detection in chemical process, Luenberger observers [8][9], Unknown Input observers [10] and Extended Kalman filters [11] are found to be widely used and accepted.

Problem Statement
The problem is to analyze the behaviour of the CSTR by study faults into the system. The problem of studying faults with the CSTR in operation is quite difficult and hazardous. Hence the solution to studying the CSTR is by injecting faults into the system. Ideally the system gives normal results when the flow rates of both the reactants are constant [13]. The system departs from the normal operation when the flow rates of either or both the reactants are changed. The system operating conditions are thus changed, and hence the readings as well as the operation depart from the normal and is therefore termed as "faulty" conditions. The departed system behaviour reflects in the wide variations occurring in the following, with regard to time:-(i) Flow rates (ii) Output which refers to the titration end point, obtained as explained in section 3.

Results:-
The results have been obtained through the platform of MATLAB (acronym for MATrix LABortaory). The data has been presented in the form of ".mat" files and thereafter the same data is used as input to obtain the plots in the MATLAB. The following data has been employed, the details of which has been tabulated below:-S.   Occurrence of T (in seconds)

Conclusion:-
The paper presents the different facets of fault diagnosis through the various techniques already studied. It also investigates the particular case of a three-tank CSTR, which depicts the alkaline hydrolysis of ethyl acetate in the presence of sodium hydroxide. The progress of the reaction has been monitored using real-time data, under the influence of different operating conditions. The proposed work identifies the faults at the same instant. Hence it is capable of handling the detection of faults instantaneously. The future work shall focus on diminishing these faults by adopting controllers or possibly through artificial intelligence techniques.