Please select whether you prefer to view the MDPI pages with a view tailored for mobile displays or to view the MDPI
pages in the normal scrollable desktop version. This selection will be stored into your cookies and used automatically
in next visits. You can also change the view style at any point from the main header when using the pages with your
Posgrado Electrónica, Tecnológico Nacional de México-Centro Nacional de Investigación y Desarrollo Tecnológico, Interior Internado Palmira S/N, Palmira, Cuernavaca, Morelos 62490, México
Departamento de Mecatrónica, Universidad Politécnica de Chiapas, Carretera Tuxtla-Villaflores KM. 1+500, Suchiapa, Chiapas 29150, México
Departamento de Ingeniería Electrónica, Tecnológico Nacional de México-Centro Nacional de Investigación y Desarrollo Tecnológico, Interior Internado Palmira S/N, Palmira, Cuernavaca, Morelos 62490, México
Catedra CONACYT-Tecnológico Nacional de México-Instituto Tecnológico de Tuxtla Gutiérrez, Carretera Panamericana Km. 1080, Tuxtla Gutiérrez, Chis 29000, México
Departamento de Maestría en Mecatrónica, Tecnológico Nacional de México-Instituto Tecnológico de Tuxtla Gutiérrez, Carretera Panamericana km 1080, Col. Terán, Tuxtla Gutiérrez, Chis 29050, México
Author to whom correspondence should be addressed.
Received: 16 January 2017 / Accepted: 15 March 2017 / Published: 19 March 2017
Fossil fuel combustion produces around 98% of coal emissions. Therefore, liquid and gaseous biofuels have become more attractive due to their environmental benefits. The biodiesel production process requires measurements that help to control and supervise the variables involved in the process. The measurements provide valuable information about the operation conditions and give estimations about the critical variables of the process. The information from measurements is essential for monitoring the state of a process and verifying if it has an optimal performance. The objective of this study was the conception of a virtual sensor based on the Extended Kalman Filter (EKF) and the model of a batch biodiesel reactor for estimating concentrations of triglycerides (TG), diglycerides (DG), monoglycerides (MG), methyl ester (E), alcohol (A), and glycerol (GL) in real-time through measurement of the temperature and pH. Estimation of the TG, DG, MG, E, A, and Gl through this method eliminates the need for additional sensors and allows the use of different types of control. For the performance analysis of the virtual sensor, the data obtained from the EKF are compared with experimental data reported in the literature, with the mean square error of the estimate then being calculated. In addition, the results of this approach can be implemented in a real system, since it only uses measurements available in a reactor such as temperature and pH.
The reduction in fossil fuel reserves and growing concerns about their environmental impact has urged the search for new energy sources forward [1,2,3,4,5]. Biodiesel is an alternative to conventional diesel as a fuel source because it is biodegradable, non-toxic, and produces low emission of polluting gases, and therefore has environmental benefits [4,6]. The production of biodiesel is economically competitive and represents an alternative as an ideal substitute for conventional diesel.
Biodiesel is compounded by mono-alkyl esters obtained by transesterification of an oil or fat with a methoxide . Studies have been conducted to reduce biodiesel production costs by controlling the reaction parameters that affect the speed and reaction mechanisms or optimizing their production processes [1,8]. The biodiesel production processes require measurements that aid in controlling and monitoring process variables. The measurements provide valuable information about the operating conditions and simultaneously give an estimate for critical variables by monitoring the state of a process and verifying that performance is optimal. There are methods to monitor the progress of the reaction, such as gas and liquid chromatography [9,10,11,12], Fourier transform infrared (FTIR), near-infrared (NIR), and nuclear magnetic resonance (NMR) spectroscopy methods [10,12,13,14,15,16,17], measurement of refractive index , and viscosity . Most of these methods require samples to be taken and offline analyses to be performed which include a pre-treatment of the sample. According to the advances made in online concentration analysers, measuring these are usually expensive and difficult to maintain, in addition to possibly introducing a time delay in the control loop . Therefore, the effect of an online application of a state estimation technique is to provide an estimate of the composition in real time from measurements of available sensors and the elimination of expensive sensors. This would avoid the consumption of other sensors, and being able to monitor all the online states could make the process more efficient.
Noise in processes is a common feature in chemical and biological reactors , and designing a nonlinear filter for a more precise estimation is necessary. The extended Kalman filter (EKF) is widely used for the estimation of states in many engineering applications for nonlinear systems and covers the problems caused by noise. In Reference , an extended Kalman filter was used to identify the parameters of a marine riser. In Reference , an implementation of a Kalman filter was performed to estimate unknown states and inputs for acceleration measurements. In Reference , a real-time estimation for concentrations in a distillation column was developed. In Reference , a Kalman filter using a Sigma point for a batch polymerization reactor was conducted. In Reference , extended Kalman filtering was used to estimate temperature and irradiation for maximum power point tracking of a photovoltaic module. An estimate was performed for the biomass concentration, production concentration, and substrate concentration in the fermentation process in a batch reactor by state-space modelling and usage of Kalman filters . In a plug flow reactor, temperature was estimated by designing a hybrid extended Kalman filter . In Reference , an estimate of the concentration of existing biogas in a continuously stirred reactor was performed using an extended Kalman filter.
The aim of this work was to design virtual sensors of the elements involved in the transesterification reaction in a reactor producing biodiesel in order to solve the online measuring problem for variables and also to provide tools for control systems.
2. Transesterification Model
The kinetic study of the transesterification reaction describes the reaction mechanisms and provides the parameters to predict the composition and concentration of the reaction at any point in time and under certain conditions. The reaction mechanism for producing esters is composed of three reversible consecutive reactions (Equations (1)–(3)). The reaction occurs from one mole of triglyceride (TG) reacting with three moles of alcohol (A) to form the intermediate products, diglycerides (DG) and monoglycerides (MG). The final product is methyl ester (E) and glycerol (GL).
Equation (4) shows the final balance of the process:
The reaction mechanism of biodiesel production is common, regardless of the source of fatty acids. The general form of the set of differential equations governing the kinetics of the transesterification reaction of triglycerides is as follows (Equations (5)–(10)) :
where are the rate constants for reaction in units of M/s.
The reaction rate in practice is affected by various factors, including temperature. The Arrhenius equation (Equation 11) relates the temperature in the reaction rate, and it is expressed as:
where α is the pre-exponential factor, ε is an activation energy, is the reactor temperature, and is the gas constant.
There is a direct relationship between temperature and the transesterification reaction. A high reaction temperature increases the rate of biodiesel formation, but it is limited by the boiling points of the reaction components. The component with the lowest boiling point is methanol (64.5 °C) . For this reason, analyses are carried out at different temperatures to determine if the designed estimator had a suitable fit for temperature changes. In this sense, different authors have different simulations of this system model at different temperatures to analyse the effect of this variable in the conversion of triglycerides into methyl esters [29,30,31].
3. Extended Kalman Filter
In many engineering applications, there are variables and physical parameters that cannot be directly measured, either due to a lack of specific sensors or the expensive cost (in enormous quantities). An alternative for dealing with this issue is to obtain a dynamic estimation of the required variables or parameters by using state observers, also known as virtual sensors. The extended Kalman filter (EKF) is a reasonable estimator for this application, as it is able to handle system nonlinearities and is built to incorporate noise from measurements and processes .
A state observer is a dynamic algorithm which is used to estimate the variables of a process using the following: a mathematical model represented in state space, the available measurements of the process (inputs and outputs), and an error correction term to ensure the convergence of the algorithm.
The general representation of a nonlinear state space model is as follows:
with and being smooth functions, whereis the vector of state variables, is the input vector, and is the vector of output variables. To derive a general structure of a state observer, let us consider the nonlinear state space model (12):
where the superscript at any variable denotes estimation, are the online estimations, whereas is the gain of the observer. Then, the design of the state observer involves choosing an appropriate gain, in order to make the estimation error converge to zero. If the observation error is defined as follows:
The dynamics of the error observation are derived from Equations (12) and (13):
The word “extended” emphasizes the fact that this observer is an extension of the original linear version to nonlinear systems. The design of the gain matrix is based on a linearized version (the linearized tangent model) of the observation error from process dynamics (computed from a Taylor series expansion of a state space model around some operating point). Considering the linearization of Equation (15) around the observation error , the following equation is obtained:
where and are, respectively, equal to:
Although the Kalman filter was originally introduced in a stochastic framework, it can also be interpreted as the approximated solution of a deterministic optimization problem. Indeed, the design of the extended Kalman filter consists of finding the gain matrix, that minimizes the mean square observation error:
with the dynamical model Equation (16) (under the constraints of the dynamical model, in the usual notations of optimization theory). Hence, the gain is computed as follows:
where is a time-varying matrix calculated through the following Riccati equation:
For the implementation of the EKF, the concerning matrices must accomplish certain properties: , , and , where and are covariance matrices with elements chosen for optimal noise filtering. To ensure the convergence of the filter, one can use the following expression instead of Equation (16):
where I is the identity matrix with appropriated dimensions and α is a constant parameter that provides a stability degree to the estimation. Namely, by means of this parameter, the estimation error is bounded and the estimation rate can be tuned.
4. Results and Discussion
4.1. Simulation of the Transesterification Reaction
The model of differential equations presented in Equations (5)–(10) were used to simulate the transesterification reaction of triglycerides of the oil of jatropha sp. biodiesel at 50 °C, with conditions presented in Table 1. Kinetic constants used were 1.6775, 0.1174, 2.1303, 0, 0.1961, 0.0449 with units M/s, for i = 1 ... 6, respectively, according to the data reported in Reference .
The simulation was carried out in the Matlab® simulation software using an ode45 solver. The results obtained from simulation of the nonlinear model of the transesterification reaction are shown in Figure 1. It shows that TG was consumed as the reaction proceeded, while E was formed. At the same time, intermediate reactions were carried out that produce and consume MG and DG. These behaviours coincide with the experimental results that have been reported in previous studies [29,31,32].
4.2. Reaction Estimation
This section presents the setup for the simulations used to examine the performance of the proposed estimator. The simulation was carried out in the Matlab Simulink® software. The EKF estimation was compared with experimental results that have been reported in previous studies [29,31,32]. An estimation of intermediate and final products of the transesterification reaction of methanol with Jatropha oil was carried out. Constant reaction temperature (50 °C) simulations and changes of temperature by 20 °C (changing 50 °C to 70 °C and 30 °C) were performed. This was done to analyse the performance of the estimation obtained by the extended Kalman filter.
A block diagram of the Kalman filter extended for use as a virtual sensor is shown in Figure 2. Directly measuring the inlet temperature and indirectly measuring the concentration of E through a pH sensor  allows estimation of the six system states.
There is a direct relationship between pH and the transesterification reaction in the production of methyl ester. Changes in OH− concentration due to the conversion of oil to biodiesel are observed by the pH meter during the reaction. It appears that the OH− ions do not dissolve in the oil because of their polar nature, but do dissolve in the biodiesel and glycerol. As the reaction occurs, the oil concentration decreases and the concentration of methyl ester and glycerol increases, causing changes in pH derived from the stoichiometric ratio. Thus, changes in pH are directly correlated with methyl ester concentration.
The linearized model using Equation (17) is shown in Equation (23):
To show the performance of the proposed EKF, the calibration values that were used are shown in Table 2.
The results of the constant reaction temperature (at 50 °C) are shown in Figure 3. It can be observed that the estimated values (green line) can track the experimental values (blue line) in a highly effectively way from one measured state and one input, which are the six concentrations obtained from the transesterification reaction. Furthermore, the mean squared error (MSE) of the signals was calculated to analyse the performance of the observer with the MSE subsequently found to be zero. Since the concentration of triglycerides and diglycerides frequently have a value of 0, it is important to display the correct estimation of the graphs logarithmically.
The results of the estimation simulation against a change in the temperature of +20 °C (50 °C to 70 °C) in minute three of simulation are shown in Figure 4. It can be seen that even with a change in the reference system, the EKF continuously provides a perfect estimation for the system. MSE values were calculated, and there was only minimal error.
The estimation simulation against a −20 °C temperature change (50 °C to 30 °C) in minute 3 is shown in Figure 5. It can be seen that the slope of the concentration of MG becomes more pronounced and the formation of E and GL is less than the obtained amounts at 50 °C. Furthermore, it demonstrates how the estimator (green line) perfectly follows the change of the system (blue line).
The Kalman filter estimation is shown in Figure 6 with the introduction of random noise to the process data. In this estimation, a good filter performance is observed and the MSE was calculated in percentages (Table 3).
In Figure 7, the Kalman filter estimation is shown after the introduction of random measurement noise (sensor), with an excellent filter performance observed and the MSE being calculated in percentages (Table 4).
The error of estimation of the states with measurement noise is shown in Figure 8, with the error being close to zero. The convergence of the filter is corroborated according to Reference .
The prospects for the implementation of virtual sensors for biodiesel production involve developing a fault-tolerant control system with fault diagnosis to support the continuous operation of the production process and consequently achieve an improvement in production by doing this in a more robust and secure manner. In addition, the use of such virtual sensors will allow the implementation of control techniques that require all output variables to be measured. In addition to these, sensors can monitor the reagents and products of the reaction transesterification online. Reactors could even be designed with online readings where it can be visualized whether the reaction is complying with European Standard Automotive fuels—Fatty acid methyl esters (FAME) for diesel engines—Requirements and test methods (EN14214).
There is practical importance for implementing virtual sensors for biodiesel production, as these sensors can estimate variables that cannot be measured or are difficult to measure online, in addition to reducing instrumentation costs, since no extra sensors would be needed to measure the concentrations of MG, DG, TG, A, and GL. In addition, it would avoid the need for reading times and reagents for measuring concentrations by destructive and costly analytical techniques such as gas chromatography. The virtual sensors would have the measurements online as a first option, allowing evaluation of whether or not it meets the specifications of standard EN14214.
A Kalman filter was designed and implemented as a virtual sensor to estimate concentrations of the transesterification reaction of Jatropha oil with methanol (A) in a batch reactor to produce fatty acid esters (biodiesel, E) using measurements of temperature and pH sensors. The substances estimated were TG, DG, MG, E, A, and GL. To analyse the performance of the estimation system, we 3 simulated cases: (a) with the temperature inlet to 50 °C; (b) a change in temperature of +20 °C and change of −20 °C; and (c) with random noise in the system and measurement. For analysis of the estimation process, the MSE was calculated in percentages. In every case, the error was practically null, providing evidence that an excellent estimation is performed by the filter and proving its usefulness as a virtual sensor.
Betty López designed FKE, Betty López and Juan Pablo Castillo designed the simulation; Peggy Álvarez and Manuel Adam analized the data; Héctor Hernández and Luis Vela wrote the paper.
Conflicts of Interest
The authors declare no conflict of interest.
Demirbas, M.F.; Mehmet, B. Progress and recent trends in biodiesel fuels. Int. J. Green Energy2009, 50, 14–34. [Google Scholar] [CrossRef]
Felizardo, P.; Baptista, P.; Menezes, J.C.; Correia, M.J.N. Multivariate near infrared spectroscopy models for predicting the methyl esters content in biodiesel. Anal. Chim. Acta2008, 607, 153–159. [Google Scholar]
Fukuda, H.; Kondo, A.; Noda, H. Biodiesel fuel production by transesterification of oils. J. Biosci. Bioeng.2001, 92, 405–416. [Google Scholar] [CrossRef]
Mansouri, S.S.; Ismail, M.I.; Babi, D.K.; Simasatitkul, L.; Huusom, J.K.; Gani, R. Systematic Sustainable Process Design and Analysis of Biodiesel Processes. Processes2013, 1, 167–202. [Google Scholar] [CrossRef]
Ovando-Medina, I.; Espinosa-García, F.; Núñez-Farfán, J.; Salvador-Figueroa, M. Does biodiesel from Jatropha Curcas represent a sustainable alternative energy source? Sustainability2009, 1, 1035–1041. [Google Scholar] [CrossRef]
Ma, F.; Hanna, M.A. Biodiesel production: A review. Bioresour. Technol.1999, 70, 1–15. [Google Scholar] [CrossRef]
Knothe, G. Biodiesel and renewable diesel: A comparison. Prog. Energy Combust. Sci.2010, 36, 364–373. [Google Scholar] [CrossRef]
Franco, M. Simulación del Proceso de Producción de Biodiesel a Partir de Aceites Vegetales en Condiciones Súper-Críticas. Master’s Thesis, Escola Tecnica Superior d’Enginyeria Industrial de Barcelona, Barcelona, Espana, 2013. [Google Scholar]
Holčapek, M.; Jandera, P.; Fischer, J.; Prokeš, B. Analytical monitoring of the production of biodiesel by high-performance liquid chromatography with various detection methods. J. Chromatogr. A1999, 858, 13–31. [Google Scholar] [CrossRef]
Dubé, M.A.; Zheng, S.; McLean, D.D.; Kates, M. A comparison of attenuated total reflectance-FTIR spectroscopy and GPC for monitoring biodiesel production. J. Am. Oil Chem. Soc.2004, 81, 599–603. [Google Scholar] [CrossRef]
Richard, R.; Li, Y.; Dubreuil, B.; Thiebaud-Roux, S.; Prat, L. On-line monitoring of the transesterification reaction between triglycerides and ethanol using near infrared spectroscopy combined with gas chromatography. Bioresour. Technol.2011, 102, 6702–6709. [Google Scholar] [CrossRef] [PubMed][Green Version]
De Boni, L.A.B.; Da Silva, I.N.L. Monitoring the transesterification reaction with laser spectroscopy. Fuel Process. Technol.2011, 92, 1001–1006. [Google Scholar] [CrossRef]
Fontalvo-Gómez, M.; Colucci, J.A.; Velez, N.; Romanach, R.J. In-line near-infrared (NIR) and raman spectroscopy coupled with principal component analysis (PCA) for in situ evaluation of the transesterification reaction. Appl. Spectrosc.2013, 67, 1142–1149. [Google Scholar] [CrossRef] [PubMed]
Kouame, S.D.B.; Perez, J.; Eser, S.; Benesi, A. 1H-NMR Monitoring of the transesterification process of Jatropha oil. Fuel Process. Technol.2012, 97, 60–64. [Google Scholar] [CrossRef]
Knothe, G. Analyzing biodiesel: Standards and other methods. JAOCS J. Am. Oil Chem. Soc.2006, 83, 823–833. [Google Scholar] [CrossRef]
Reddy, S.R.; Titu, D.; Chadha, A. A novel method for monitoring the transesterification reaction of oil in biodiesel production by estimation of glycerol. JAOCS J. Am. Oil Chem. Soc.2010, 87, 747–754. [Google Scholar] [CrossRef]
Xie, W.; Li, H. Hydroxyl content and refractive index determinations on transesterified soybean oil. JAOCS J. Am. Oil Chem. Soc.2006, 83, 869–872. [Google Scholar] [CrossRef]
Ellis, N.; Guan, F.; Chen, T.; Poon, C. Monitoring biodiesel production (transesterification) using in situ viscometer. Chem. Eng. J.2008, 138, 200–206. [Google Scholar] [CrossRef]
Oisiovici, R.M.; Cruz, S.L. State estimation of batch distillation columns using an extended Kalman filter. Chem. Eng. Sci.2000, 55, 4667–4680. [Google Scholar] [CrossRef]
Patnaik, P.R. Improvement of the microbial production of streptokinase by controlled filtering of process noise. Process Biochem.1999, 35, 309–315. [Google Scholar] [CrossRef]
Torres, L.; Verde, C.; Vázquez-Hernández, O. Parameter identification of marine risers using Kalman-like observers. Ocean Eng.2015, 93, 84–97. [Google Scholar] [CrossRef]
Eftekhar, S.; Chatzi, E.; Papadimitriou, C. A dual Kalman filter approach for state estimation via output-only acceleration measurements. Mech. Syst. Signal Process.2015, 60–61, 866–886. [Google Scholar] [CrossRef]
Beyer, M.A.; Grote, W.; Reinig, G. Adaptive exact linearization control of batch polymerization reactors using a Sigma-Point Kalman Filter. J. Process Control2008, 18, 663–675. [Google Scholar] [CrossRef]
Docimo, D.J.; Ghanaatpishe, M.; Mamun, A. Extended Kalman Filtering to estimate temperature and irradiation for maximum power point tracking of a photovoltaic module. Energy2017, 120, 47–57. [Google Scholar] [CrossRef]
Wang, J.; Zhao, L.; Yu, T. On-line estimation in fed-batch fermentation process using state space model and unscented kalman filter. Chin. J. Chem. Eng.2010, 18, 258–264. [Google Scholar] [CrossRef]
Rezaei, N.; Rahimpour, M.R.; Khayatian, A.; Jahanmiri, A. A new hybrid approach in the estimation of end-states of a tubular plug-flow reactor by Kalman filter. Chem. Eng. Process. Process Intensif.2008, 47, 770–779. [Google Scholar] [CrossRef]
Kupilik, M.J.; Vincent, T.L. Estimation of biogas composition in a catalytic reactor via an extended Kalman filter. In Proceedings of the IEEE International Conference on Control Applications, Denver, CO, USA, 28–30 September 2011; pp. 768–773.
Noureddini, H.; Zhu, D. Kinetics of transesterification of soybean oil. J. Am. Oil Chem. Soc.1997, 74, 1457–1463. [Google Scholar] [CrossRef]
Jain, S.; Sharma, M.P. Kinetics of acid base catalyzed transesterification of Jatropha curcas oil. Bioresour. Technol.2010, 101, 7701–7706. [Google Scholar] [CrossRef] [PubMed]
Noriega, M.A.; Narváez, P.C.; Heinz, C. Kinetics of Jatropha oil methanolysis. Fuel2014, 134, 244–249. [Google Scholar] [CrossRef]
Berchmans, H.J.; Morishita, K.; Takarada, T. Kinetic study of hydroxide-catalyzed methanolysis of Jatropha curcas–waste food oil mixture for biodiesel production. Fuel2013, 104, 46–52. [Google Scholar] [CrossRef]