Next Article in Journal
Empowering Owner-Operators of Small and Medium Commercial Buildings to Identify Energy Retrofit Opportunities
Previous Article in Journal
Comparative Analysis of Combustion Characteristics of a CFB Boiler during the Changes Process between High-Rated Loads and Low-Rated Loads
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Temperature Control of a Chemical Reactor Based on Neuro-Fuzzy Tuned with a Metaheuristic Technique to Improve Biodiesel Production

by
Mario C. Maya-Rodriguez
1,
Ignacio Carvajal-Mariscal
1,*,
Raúl López-Muñoz
2,
Mario A. Lopez-Pacheco
1 and
René Tolentino-Eslava
1
1
Escuela Superior de Ingeniería Mecánica y Eléctrica Unidad Zacatenco, Instituto Politécnico Nacional, Mexico City 07738, Mexico
2
Group of Research and Innovation in Mechatronics (GRIM), Centro de Innovación y Desarrollo Tecnológico en Cómputo (CIDETEC), Instituto Politécnico Nacional, Mexico City 07700, Mexico
*
Author to whom correspondence should be addressed.
Energies 2023, 16(17), 6187; https://doi.org/10.3390/en16176187
Submission received: 17 July 2023 / Revised: 12 August 2023 / Accepted: 17 August 2023 / Published: 25 August 2023

Abstract

:
This work deals with the problem of choosing a controller for the production of biodiesel from the transesterification process through temperature control of the chemical reactor, from the point of view of automatic control, by considering such aspects as the performance metrics based on the error and the energy used by the controller, as well as the evaluation of the control system before disturbances. In addition, an improvement method is proposed via a neuro-fuzzy controller tuned with a metaheuristic algorithm to increase the efficiency of the chemical reaction in the reactor. A clear improvement is shown in the minimization of the integral of time multiplied squared error criterion (ITAE) performance index with respect to the proposed method (8.1657 × 10 4 ) in relation to the PID controller (7.8770 × 10 7 ). Moreover, the integral of the total control variation (TVU) performance index is also shown to evaluate the power used by the neuro-fuzzy controller (25.7697), while the PID controller obtains an index of (32.0287); this metric is especially relevant because it is related to the functional requirements of the system since it quantifies the variations of the control signal.

1. Introduction

Gasoline is one of the most widely used fuels globally to meet the energy needs of the population, such as mobility, the generation of electricity, and for industrial processes. Diesel is another cheap fuel, and its efficiency is similar to that of gasoline. In many countries such as Mexico, it is a cheaper alternative to gasoline [1]. One of the disadvantages of diesel is that, like gasoline, it is a non-renewable source and emits different kinds of pollutants into the atmosphere. These reasons have motivated the development of more environmentally friendly alternatives that are also renewable energy sources with similar efficiency to diesel and gasoline, such as natural gas [2] and biodiesel [3]. Biodiesel is an extraction product obtained from vegetable oils and animal fats, which allows a reduction in the CO 2 and CO emissions by up to 41% [4].
In recent works, it has been proposed to use fish waste oil as the raw material for the production of biodiesel, and to use it as the fuel for systems operating under critical conditions, mainly in regions such as Iran, where a large amount of waste is generated. This process generates a yield of around 95%, which is achieved using response surface methodology (RSM), which uses data such as pressure, temperature, the molar ratio of alcohol to oil and the feed flow rate to vary in the proposed model [5].
In Mexico, most of the energy demand is directed to the transportation sector, followed by the generation of heat and electricity. In both cases, the main source of energy comes from the burning of fossil materials, which corresponds to 60% of the total energy production [6]. Renewable sources only account for around 9% of the total production, with biodiesel covering 5% of it [7]. Although political reforms and strategic plans have been implemented in order to reduce pollutant emissions into the atmosphere, even projecting that by 2024, 35% of the total energy production will come from renewable resources, there are several factors that have limited this progress [8], such as high production costs, the lack of an adequate infrastructure for the process, or the lack of incentives to develop those products [9]. Even with these limitations, biodiesel production has prospered, and various research studies regarding biodiesel production and its promotion in different applications have been developed in recent years [6,10,11].
One of the main challenges when using biodiesel is that it needs to have a viscosity similar to that of diesel, which is achieved by mixing different substances and heating them under specific conditions for each type of mixture in transesterification reactors [12]. Therefore, it is important to have adequate control of what happens inside the reactor, especially with the temperature. In [13], an alternative method for the production of biodiesel is presented. It seeks to optimize three non-linear functions with three criteria for decision making to minimize the heat generation cost and pollution when processing biomass in regions where the temperature is low. This optimization process is carried out in stages using genetic algorithms and MCDM techniques for the first stage, using the results as constraints for the following stages.
Diverse control techniques are applied, depending on the information available from the system to be controlled. Proportional–integral–derivative (PID) controllers are among the most used at an industrial level [14,15], to more advanced controllers based on fuzzy logic [16,17] or neural methods [18], or a combination of both [19]. A fuzzy controller uses fuzzy logic to decide what action to take based on the input data, using a series of if–then rules proposed by the programmer based on his experience. These rules can be improved by including a machine learning algorithm, neuro-fuzzy, so that the rules are based not only on the programmer’s criteria but also on how the system learns from the data and selects the best answer.
In the case of transesterification reactors, what is required to be controlled is the ester temperature. Model-based controllers are one of the methodologies used for this purpose, for which it is necessary that the model of the system is controlled. In [20], the authors developed a PID control for the temperature and speed in a prototype of the transesterification process, making the temperature increase rapidly to meet the control point and then maintaining both the temperature and the mixture speed at stable values. In [21], another proposal for the modeling of a reactive distillation process for the production of biodiesel is presented. It includes a PID controller that is tuned applying the Ziegler–Nichols and Cohen–Coons methods. In [22], the modeling for biodiesel production is also proposed, but it is focused on a microreactor that requires more knowledge of the system in order to obtain an adequate result, combining kinetic chemistry with variables such as convection and diffusion. It considers only the modeling, leaving its control as future work.
Another modeling of this process that predicts the concentration of reactant profiles is presented in [23], where the authors used information from the kinetic chemistry of the process and combined it with other variables of the same process. The model was validated with data from the literature, and two controllers for the temperature of the process were proposed: one for the closed-loop system, and a proportional–integral controller (PI) generating fast and stable responses in the stationary state. Other types of controllers have been developed, such as the proposal in [24], in which a neural controller was combined with a fuzzy adaptability rate for network training, improving both the response time and precision. A neural controller was introduced in [25], applying the particle swarm optimization (PSO) to change the responsiveness rate of the controller, reducing the time to find the optimal responsiveness rate of the controller. In these last mentioned works, the stability of the method is guaranteed.
There are also alternative proposals for the generation of the fuel mixture. In [26], a PID controller and a neuro-fuzzy controller were used in a microwave generator that emits thermal radiation for the mixture, reducing the time by 50% compared to conventional methods.
Nowadays, the real-world problems that arise in the industry present increasing complexity and therefore become difficult to solve using the so-called classic methods. The trend is focused on the optimization of processes through the best use of their resources to generate a service or product. These systems can be addressed by different areas, whose perspective contributes to satisfying the requirements of the industry. The automatic control oversees regulating the variables that participate in a process, such as pressure, level, temperature, and flow, among others. However, the regulation of these variables essentially implies an energy expense, complying with quality standards and respecting the operating limits previously defined. Classic controllers based on the PID, such as the one shown in [27], normally reach their limits quickly. This may be due to the fact that the setpoint (operating conditions) requested from the system cannot be reached by the selected controller, originated mainly on limitations in their structure and mathematical definition. Another important factor to consider is the set of environmental conditions, which can generate an affectation to the signal coming from the controller.
In this work, a generalized controller based on neuro-fuzzy techniques with metaheuristics tuning is presented for controlling the temperature of the transesterification reactor, increasing its performance by addressing the control problem and the effects of a disturbance in the system. The proposed control has the disadvantage of requiring adequate tuning in order to perform its task efficiently. So, as another contribution, this problem is solved with the use of a metaheuristic algorithm that determines a set of parameters such that the error function is minimized when applying the control. The obtained results are compared with the ones in [27], where the authors presented a linear model of the reactor together with a PID control to stabilize the temperature for different sample concentrations. These results indicate that the developed controller obtains better performance in following the setpoint, using smaller power consumption compared to that of the classic PID controller, under conditions inspired by real-world problems.

2. Materials and Methods

2.1. Description of Industrial Plant

The plant is shown in Figure 1, where T C represents the temperature of the thermal agent, T p the temperature of the output product, and T 1 the temperature of the product. The system is designed to maintain the temperature of the product ( T 1 ) equal to T 0 , which is the reference temperature, by means of a control system using the transducer to receive information from the tank. This control system allows the flow of cold water and steam to the tank in order to reach the desired temperature. It is also important to analyze the energy balance of the system due to it being an endothermic reaction. In this case, the heat balance equation is defined as:
q a r + q a b = q p ,
with q a r being the heat of the cold water, q a b the steam heat and q p the output product heat.
The complete reaction of this process can be considered of the second order, described as
T g + 3   C H 3 O H k 1 k 8   k 7 3 R C O O C H 3 + G l ,
where k 1 –k 8 are reaction speed constants.
Some considerations to be made for the process are described next. If the reaction is stopped early, components will react completely, decreasing the conversion rate of the reaction. Also, the reaction should take place at the maximum temperature possible, which is determined by other variables, such as the pressure in the tank, the degrading temperature of the product, and surfactants. The product and the surfactants should be in the tank before the process begins. So, it is important to define a mathematical model that can be used with a control algorithm to regulate the temperature of the process to generate the optimal conversion rate of the whole process.
The modeling of the temperature of the plant is introduced in this section; equations are obtained from [27].
The transfer function for the temperature of the tank is:
G f = 4 360 s + 1 1143 s + 1 .
To obtain (3), a serial array of three other transfer functions is needed, i.e., G f = G E G p G T , where each one represents a dynamic and static part of the complete system, shown next:
G E = K E T E s + 1 ;
G E = K p T p s + 1 ;
G T = 2 .
The model (4) corresponds to the execution element, where K E = 2 and T E = 360 ; the following (5) applies to the process with T p = 1143 s , K p = 1 , and lastly for the temperature transducer (6), which is just a gain. With these three transfer functions, we must assure that the temperature of the tank remains at the same level as long as the vegetable oil and the methanol react so that the fatty acids methyl ester and glycerin are produced.
In [27], an explanation of how to find the parameters of the system described by Equations (4)–(6) is included. These parameters physically represent the system properties and differentiate them from those of systems that also produce biodiesel but with different volume production. It is worth mentioning that in this work, they are solely used to have a point of comparison with the aforementioned work through the implementation of control methods and their effects on the mathematical model. The parameters of a mathematical model that represent a real-world application are susceptible to variance with respect to time, either due to environmental conditions or due to the properties of the system itself. In the case of biodiesel production, it could happen when the process is carried out. In the transesterification stage, it is possible to observe adverse phenomena within the equipment and instruments, such as residues, gases, and loss of properties due to heat, even within operating ranges, among other aspects. These apparently simple things can cause parameter variation. It is important to mention that the operation of the control method developed in this paper does not require knowledge of these parameters. So, in the case of being implemented in a real case, it represents an advantage since, due to its adaptable nature, accompanied by metaheuristics, it could respond to a variation in the parameters of an industrial system.

2.2. PI Controller

As the first attempt to control the temperature of the tank (3), a PI controller is proposed as follows, the goal being to obtain the open-loop transfer function as
G o = G c · G f = ω n 2 ζ s 1 2 ζ ω n s + 1 .
In this manner, the transfer function for the controller can be defined as
G c = K R · T c s + 1 T c s ,
in order to achieve the structure of (7), T c = T p , and the remaining values are obtained by performing some mathematical operations and proposing ζ = 0.7 as a damping factor. This leads us to
K R = ω n T c 2 ζ K f = 0.38 ;
ω n = 1 2 ζ T E = 0.0019 .
With the numerical values, (8) can be written as
G c = K R · T i s + 1 T c s = 434.34 s + 0.38 1143 s .
Simulation and further analysis are presented in subsequent sections of this work.

2.3. Neuro-Fuzzy Controller

For industrial systems, such as biodiesel production, due to their non-linear nature, it is difficult and complex to propose a control to offer maximum performance with less effort, or even in some cases only to provide system control for the process variable and thereby reach the setpoint. Currently, the system has a classical On–Off control, with poor performance. In order to improve the control and obtain major benefits without changing the structure of the process, a first idea may be to migrate to the PID controller; however, the system has different sources of heat to raise or lower the temperature of the reactor. Moreover, many disturbances are due to the environment, like the temperature and climate conditions, which represent a big problem for the structure of a PID controller since these types of time-varying disturbances are not usually successfully rejected by classical controls. In accordance with the challenge of improving the production of biodiesel, the characteristics of the proposed controller have to avoid the problematic derivative of knowing the mathematical model and its parameters since the size and the physical phenomenainherent to the process will make it difficult to perform this task. Otherwise, the controllers based on online learning could learn from the behavior of the process, and also take the knowledge from the human experience acquired from the control of the system. The real-world problems with a non-controlled environment tend to be easily controlled by means of an adaptive law control since the weighting of the unmodeled dynamics and the time-varying disturbances are attenuated as the learning process continues for a longer time. Below is the description of a neuro-fuzzy controller; according to [28], the following presents an improvement to the method already mentioned since the concepts and steps necessary for the implementation of the controller in the industrial environment are omitted. Moreover, it is important to note that the implementation of this controller will currently be carried out in a digital control system, so expressing the method clearly in discrete time is essential.
In Figure 2, the neuro-fuzzy controller has two inputs called E and Δ E , which means of the error and the increment of the error on time. To calculate these signals, it is necessary to define the following expressions.
E ( k ) = S P ( k ) P V ( k ) ,
and
Δ E ( k ) = E ( k ) E ( k 1 ) T s ,
where S P ( k ) and P V ( k ) denote the setpoint and the value of the process variable in instant k. E ( k 1 ) represents a delayed value in time of variable E ( k ) , and T s means the sampling time. In the industry, it is common to talk about the sampling of a signal on the process control. Although there is no analytical way to determine the value of the sampling rate, it is possible to state a bound that must be respected to guarantee that there is no loss of information when discretizing a continuous signal from the real world. The theorem of Shannon–Nyquist remarks this fact in a way that explains the relationship between the sample rate and signal frequency.
Theorem 1. 
The sample rate f s must be greater than twice the highest frequency component of interest in the signal. This frequency is usually known as the Nyquist frequency f N [29]:
f s > 2 f N .
The network architecture has five layers. The first layer provides to the fuzzification an input vector X ( k ) , which contains E ( k ) and Δ E ( k ) . The second layer is used to inference the fuzzy rule base, and the 3rd–5th layers are employed for the defuzzification process to formulate output u ( k ) . Figure 3 provides a clear representation of the neuro-fuzzy controller:
The first layer provides the mapping of the real values of the input vector X ( k ) to the linguistics applied to make the fuzzification, according to the Takagi–Sugeno method [30], where the concept of membership function is defined; this process consists of assigning the values of the input signals to a fuzzy set. These membership functions can be Gaussian bells, sigmoids, triangles, etc. Moreover, the “fuzzy” concept is of great help for control systems that operate on nonlinear plants since it allows the use of an operator’s knowledge through the experience acquired over time [31]. The structure of this step is defined by
μ A j , k = Γ j ( Λ j ( k ) , X i ( k ) ) ,
where μ A j , k denotes the number of membership functions selected for vector X ( k ) i i = 1 , 2 , , normally proposed by the engineer’s attempt and failure, and j = 1 , 2 , , n , where n is the number of membership functions. The term Γ j ( · ) describes the function selected to make the fuzzification and Λ j ( k ) are the parameters of the function. For example, the Gaussian bell is
μ A j , k ( X i ( k ) ) = e 0.5 X i ( k ) ϕ j , k σ j , k 2 ,
where Γ j ( · ) is the membership function selected, the Gaussian bell, and the set Λ j ( k ) is the parameters ϕ j , k and σ j , k , which means the position and spread of the Gaussian function.
Thus, the second layer performs the mechanism based on the “if–then” statement. Based on this implication, it is the way in which the fuzzy sets generated by the vector X ( k ) and its subsequent membership functions are related to be able to classify and determine the possible scenarios of the behavior of a system. Subsequently, a value can be proposed as the output according to each of the cases established by the set of fuzzy rules:
O p = w ( k ) = μ A j , k ( X i ( k ) ) T μ A j , k ( X i ( k ) ) ,
since the index p = 2 , 3 is the second or third layer.The output of the third layer should be normalized according to
w ¯ ( k ) = w ( k ) l = 1 R w l ( k ) .
where the index l = 1 , 2 , , R , where R is the number of fuzzy rules such that R = n × n . The output of the fourth layer is simply the products of the normalized firing strength and parameter r l = γ j ( λ j ( k ) ) from the output
O 4 = β n ( k ) = w ¯ n , : ( k ) γ j ( λ j ( k ) ) ,
where β n ( k ) n , γ j ( λ j ( k ) ) corresponds to the membership function and the parameters to describe the action of the controller base on the third layer, and w ¯ n , : ( k ) represents each row of the matrix. The fifth layer has only one node labeled as six to indicate that it performs the sum function as given by
U ( k ) = β ( k ) ,
where U ( k ) is scalar and the control signal.
In the analysis of fuzzy systems, according to the literature [31], they are by themselves magnificent for the control of complex and highly non-linear systems since they do not need the mathematical model of the system to work. It is also possible to make use of the experience of the workers to initialize and parameterize the control system through of the process of fuzzification–fuzzy rules–defuzzification in such a way that it is used in control systems distributed by leading companies in the area of control and automation [32]. To improve the performance of these controllers, hybridizations were made with neural networks, giving them the ability to learn as time passes, and the system is subject to different operating conditions, including disturbances [33]. The gradient descent method [29] is adapted for tuning the membership functions of the neuro-fuzzy network, and with this, it is possible to give a learning property to the system. The way in which the neural network concept is adapted to the fuzzy system is described in the following equations.
The general approach, i.e., the parameters of the fuzzification stage, are
Λ j ( k + 1 ) = Λ j ( k ) η Λ i E ( k ) μ A j , k ( X i ( k ) ) ,
and in the defuzzification stage:
λ j ( k + 1 ) = λ j ( k ) η λ i E ( k ) w l ( k ) .
Taking into consideration the Gaussian bell function [28], the update parameter equations are
ϕ ( k + 1 ) = ϕ ( k ) ) η ϕ E ( k ) μ A j , k ( E ( k ) ) E ( k ) ϕ i , k σ i , k d i a g ( γ j ( λ j ( k ) ) ) β n , i ( k ) w l ( k ) ;
σ ( k + 1 ) = σ ( k ) ) η σ E ( k ) μ A j , k ( E ( k ) ) ( E ( k ) ϕ i , k ) 2 σ i , k 3 d i a g ( γ j ( λ j ( k ) ) ) β n , i ( k ) w l ( k ) .
For example, r j ( k ) n x n is a symmetric matrix, with characteristic values in the principal diagonal. This type of membership function is called a singleton. The update values are defined:
r j ( k + 1 ) = r j ( k ) η r E ( k ) w l ¯ ( k ) .
where η ϕ , η σ and η r are known as constants of the learning rate. These define the learning speed of the control system. Normally, they are chosen by the error proof between 0 < η 1 . Regarding the real-world applications, special care must be taken with this learning constant since when chosen improperly, or in the presence of disturbances such as noise, it can quickly make the controller unstable. Below, in Figure 4, a flowchart of the general procedure for the implementation of the neuro-fuzzy controller (NFC) is given.

2.4. Tuning NFC Parameters with DE

As a contribution to this proposal, the tuning with DE of the NFC parameters is proposed. This is because the resulting behavior when applying the NFC is susceptible to its initialization parameters. Traditionally, this tuning is performed by randomly testing different parameters until a result is obtained that is adequate according to the designer’s criteria. In this paper, it is proposed that this criterion is an objective function, with which the optimization algorithm (DE) works.
Figure 5 shows the proposed methodology for tuning the NFC parameters. The first step consists in the random initialization of a set of candidate parameters (population); also, the elements of each individual in the population are ordered to satisfy expressions (26) and (27), where V 1 , V 2 , , V 12 are parameters linked to the NFC activation functions, so it is required that they maintain an increasing order. The list of all tuned parameters is shown in Table 1:
V 1 V 2 V 3 V 4 V 5 V 6
V 7 V 8 V 9 V 10 V 11 V 12 .
The second step consists in evaluating the current population in each cycle using the objective function (28), which is the sum of the error and its derivative. If the end criteria are met, the process is finished. In the case of the end criteria not being met, in the next steps, new individuals are generated:
f ( q ) = i = 1 k | e i | + w | e i ˙ | .
In the third, for each individual in the population, the mutation operator of DE is applied following (29), using a target individual ( x r 1 ), two additional individuals ( x r 2 , x r 3 ), and mutation factor F. The resulting vectors are ordered to satisfy (26) and (27):
M u t a n t V j = x r 1 + F ( x r 2 x r 3 ) .
To guarantee that the candidate individuals remain within the search space, in the fourth step, the function (30) is applied, where u l i and l l i are the upper and lower limits of V i , respectively:
V i = u l i , u l i V i l l i , l l i V i V i , o t h e r .
In the fifth step, the test vectors are generated from the pseudorandom copy of the genetic material of the parent or mutant vector. In this work, the binomial cross (31) is used:
N e w V i = M u t a n t V i , r a n d ( 0 , 1 ) C R F a t h e r V i , r a n d ( 0 , 1 ) > C R .
Lastly, at the sixth step, the individuals are compared using (32), and the best is kept for the next cycle, while the other one is discarded:
V g + 1 = N e w V i , f ( N e w V i ) f ( V g ) V g , o t h e r .
To deal with constraints (26) and (27), each time that a new solution vector is generated that is not feasible, a repair of that segment is applied, reordering the index associated with the parameter until the constraints are met.

2.5. Validation Method

Conventionally, biodiesel production is carried out by the transesterification of triacylglycerides with methanol or ethanol in the presence of homogeneous basic catalysts, such as sodium or potassium hydroxides, carbonates or alkoxides [34]. In [27], the ideal temperature (50 °C–60 °C) to carry out the processes of the transesterification reaction of soybean oil with methanol is shown, using a basic catalyst in a homogeneous catalysis; Figure 6 represents a desired behavior of the process transesterification for the example mentioned.
As the temperature in the reactor increases, the viscosity of the oil will decrease, and thus the reaction time will be shorter and the reaction rate higher if the boiling point (64.8 °C) is exceeded for long periods of time. Then, as the methanol starts to evaporate, the reaction rate will decrease.This represents a control problem from two different points of view. The first refers to maintaining the temperature process variable at a determined setpoint (60 °C); however, in the environmental conditions where the system control is carried out, they can be adverse and generate disturbances that cause a deviation from the desired temperature, for example, a very warm day can increase the temperature of the environment such that the dissipation of energy through the medium is slower, and the biodiesel compound can be seriously altered by not having the necessary conditions for its unitary operation. Although disturbances must be rejected by every controller, it is not necessarily possible for the controller to achieve this, and disturbance rejection may take too long at best. The controller proposed in [27] is based on the PID (see Figure 7); however, there is no robustness test of the control system in the face of a disturbance that would allow to know with greater certainty the behavior of a system in real operating conditions, giving way to decide if the approached option will result in a real-world application. Below, the performance of the controller is shown in the event of an abrupt change in the environmental temperature of 10 °C; this is performed in simulation at 5000 s. Although this disturbance may sound a bit aggressive, it is convenient to evaluate the controllers in extreme cases, as it allows to know in a better way the limits of a controller.
As can be seen in the previous figure, the current control of the system takes around 4000 s to establish the system, and once it suffers the disturbance in 5000 s, it takes around 3000 s to reject the disturbance. However, it cannot be said that the controller does not work if it can be said that it can be improved;the energy needed to control the system can be seen in Figure 8.
To improve transesterification performance, it is necessary to propose another neuro-fuzzy controller with a tuning process based on metaheuristics since this type of controller has too many parameters to choose from and therefore is tuned by trial and error. With metaheuristics, it is possible to minimize the dependence on luck or to have enough information available about the process or knowledge of the system. The results obtained by the method proposed in this work are shown in the Figure 9 and Figure 10.
The resulting validation of the proposed controller is denoted by means of the minimization of the performance indexes’ integral of time multiplied squared error criterion (ITAE) and the integral of total control variation (TVU), which are commonly used in the related literature to evaluate controllers on the automatic control field. The ITAE index penalizes the deviation between the setpoint and the process variable, while the TVU index penalizes the supplied energy by the controller.

3. Discussion

The metric of performance allows to make a interpretation of the dynamic by quantifying the signal of error; the smaller the index, the better the performance of the controller.A metric that is useful for this is the ITAE since it will penalize the error more strongly as time passes; this is preferable since, for systems with possible slow dynamics, which can be the temperature variable or the level, the initial error is usually large. Below is the expression of performance metrics [29]:
k = 1 d k e ( k ) e ( k 1 ) ) 2 .
Another variable that is important to quantify and observe is the performance of the control signal produced by the control system since on many occasions, the simulation physically demands something that the system cannot perform because it is not made for these characteristics. For example, a pump designed so that at nominal frequency, it delivers 150 lpm, while the control demands a control signal of 200 lpm; this clearly will not happen in reality, and then there will be considerable variation in what is expected versus what is obtained. A performance index that can help us evaluate this parameter is the TVU [29]:
k = 1 d u ( k ) u ( k 1 ) .
When evaluating the control systems in the face of a disturbance, it is easier to discriminate if it will work in the real operating conditions and surrounding environmental factors. The proposed method minimizes more effectively than the PID controller control, and this is normal since the structure of the controller obeys a series of principles that, by design of its structure, allows it to do certain things. The proposed method combines two of the most powerful control techniques that exist; neural networks allow continuous learning and fuzzy logic allows interpreting the information from experience and knowledge to control a system. In addition, the contribution of a metaheuristic technique to improve the controller and take it to a higher level, where it attacks the main weakness of the neuro-fuzzy control, which is the dependent on the good choice of the parameters that are necessary to initialize for the controller to operate, the proposed metaheuristics allows us to address this problem since the use of this algorithm represents a way of exploring multiple configurations while generating new and better solutions iteratively; therefore, the expected results are easier to find, reducing the simulation, execution and implementation times. Figure 11 shows two output signals generated with different parameters. Eventually, through several iterations of the metaheuristics, new candidate sets are generated and tested to evolve the individuals (vectors with the parameters), so the best individual of the last iteration of the algorithm is better than all the others generated in the whole process.
Due to the stochastic nature of the metaheuristic technique, there is a possibility that the solution shown represents an extraordinary or difficult case to replicate since in each run, different random values were generated. Considering this, the tuning through the DE was replicated 10 times. The equations of the neuro-fuzzy controller were coded in MATLAB R2020a, and the data acquisition was obtained by means of software on a computer with the following specifications: Intel i7 processor @3.70 GHz, 16 GB RAM, and Windows 11 operating system. Using as end criteria 50,000 evaluations of the objective function, in order to compare the solutions found in new executions, the metrics of this solutions are reported in Table 2, where the error function is calculated with (28), with w = 1000 . Also, the ITAE and TVU metrics are reported to make a comparison with the performance of the PID controller.
Below is the comparison table of the PID controller against the method proposed in this work, given the performance metrics mentioned.
With the proposed method in this work, the optimization can be referred to in two ways (see Table 3): the first is focused on obtaining a lower deviation between the setpoint and the process variable; and the second path can focus on minimizing the energy required for process control to maintain the process variable at the setpoint, even in the presence of disturbances. Regarding the biodiesel process, there is usually more than one heat source, which will serve to raise or lower the temperature of the reactor. The use of less energy to produce biodiesel must be considered with a high priority since, otherwise, it may be cheaper to continue using non-renewable energy since electrical resistances, heat exchangers, cooling towers, and pumps, among others, are usually used as the final control elements to control the chemical reaction reactor. Normally, these aspects go unnoticed and generate significant economic losses in the profitability of a production plant since, by not considering the energy consumed by the control equipment, the performance of the control system can be interpreted incorrectly and even generate fines by energy regulatory commissions.

4. Conclusions

In this work, a generalized neuro-fuzzy controller is presented, as well as the combination of this controller with a metaheuristic technique applied for its tuning, making it better and more efficient. In addition, its use in a process for the generation of biodiesel is discussed, and the problems of its production are detailed, explaining how it can be made more efficient from the point of view of automatic control. The implementation of the proposed controller allows optimization tasks for the efficient use of the energy necessary to produce biodiesel in the transesterification process. The reported numerical simulation considers disturbances intended to emulate adverse production conditions according to the industrial environment. These disturbances can alter the necessary properties of biodiesel according to the production standards, for which the study of their rejection by the controllers becomes essential. In the results reported in this work, it is shown that the proposed advanced controller can present better performance than that of the classical PID controller in a real implementation since it maintains the temperature variance in the defined setpoint. This is due to its mathematical structure, minimizing the performance metric ITAE with a lower energy cost, which is verified with a higher minimization of the TVU index.

Author Contributions

M.C.M.-R. and R.L.-M. worked on all the tasks, I.C.-M. and M.A.L.-P. worked on the literature review, M.C.M.-R. and R.L.-M. conducted experimental studies, I.C.-M. and R.T.-E. performed the supervision, all authors analyzed the results. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Not applicable.

Acknowledgments

The Consejo Nacional de Humanidades, Ciencias y Tecnologías (CONHACYT), for the postdoctoral fellowship awarded to M.C.M-R. (CVU: 706063), that enabled research on biodiesel-based energy alternatives.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhang, Z.; Dong, R.; Lan, G.; Yuan, T.; Tan, D. Diesel particulate filter regeneration mechanism of modern automobile engines and methods of reducing PM emissions: A review. Environ. Sci. Pollut. Res. 2023, 30, 39338–39376. [Google Scholar] [CrossRef]
  2. Benbellil, M.A.; Lounici, M.S.; Loubar, K.; Tazerout, M. Investigation of natural gas enrichment with high hydrogen participation in dual fuel diesel engine. Energy 2022, 243, 122746. [Google Scholar] [CrossRef]
  3. Bai, X.; Chen, H.; Oliver, B.G. The health effects of traffic-related air pollution: A review focused the health effects of going green. Chemosphere 2022, 289, 133082. [Google Scholar] [CrossRef]
  4. Mahbub, N.; Gemechu, E.; Zhang, H.; Kumar, A. The life cycle greenhouse gas emission benefits from alternative uses of biofuel coproducts. Sustain. Energy Technol. Assess. 2019, 34, 173–186. [Google Scholar] [CrossRef]
  5. Espootin, S.; Sameti, M.; Zaker, S. Biodiesel from fish waste oil: Synthesis via supercritical methanol and thermodynamic optimization. Clean Energy 2021, 5, 187–195. [Google Scholar] [CrossRef]
  6. Masera, O.; Rivero, J.C.S. Promoting a Sustainable Energy Transition in Mexico: The Role of Solid Biofuels. Bioenergy Res. 2022, 15, 1691–1693. [Google Scholar] [CrossRef]
  7. Balance Nacional de Energía: Producción de Energía Primaria. Available online: https://sie.energia.gob.mx/bdiController.do?action=cuadro&cvecua=IE11C01. (accessed on 14 July 2022).
  8. Orozco-Ramírez, Q.; Cohen-Salgado, D.; Arias-Chalico, T.; García, C.A.; Martínez-Bravo, R.; Masera, O. Production and market barriers of solid forest biofuels in Mexico From the enterprises’ perspective. Madera Bosques 2022, 28, 1–15. [Google Scholar]
  9. Sosa-Rodríguez, F.S.; Vazquez-Arenas, J. The biodiesel market in Mexico: Challenges and perspectives to overcome in Latin-American countries. Energy Convers. Manag. 2021, 12, 100149. [Google Scholar] [CrossRef]
  10. Macías-Alonso, M.; Hernández-Soto, R.; Carrera-Rodríguez, M.; Salazar-Hernández, C.; Mendoza-Miranda, J.M.; Villegas-Alcaraz, J.F.; Marrero, J.G. Obtention of biodiesel through an enzymatic two-step process. Study of its performance and characteristic emissions. RSC Adv. 2022, 12, 23747–23753. [Google Scholar] [CrossRef] [PubMed]
  11. Boly, M.; Sanou, A. Biofuels and food security: Evidence from Indonesia and Mexico. Energy Policy 2022, 163, 112834. [Google Scholar] [CrossRef]
  12. Yaqoob, H.; Teoh, Y.H.; Sher, F.; Farooq, M.U.; Jamil, M.A.; Kausar, Z.; Sabah, N.U.; Shah, M.F.; Rehman, H.Z.U.; Rehman, A.U. Potential of waste cooking oil biodiesel as renewable fuel in combustion engines: A review. Energies 2021, 14, 2565. [Google Scholar] [CrossRef]
  13. Rezaei, M.; Sameti, M.; Nasiri, F. An enviro-economic optimization of a hybrid energy system from biomass and geothermal resources for low-enthalpy areas. Energy Clim. Chang. 2021, 2, 100040. [Google Scholar] [CrossRef]
  14. Borase, R.P.; Maghade, D.; Sondkar, S.; Pawar, S. A review of PID control, tuning methods and applications. Int. J. Dyn. Control. 2021, 9, 818–827. [Google Scholar] [CrossRef]
  15. Aboelhassan, A.; Abdelgeliel, M.; Zakzouk, E.E.; Galea, M. Design and Implementation of model predictive control based PID controller for industrial applications. Energies 2020, 13, 6594. [Google Scholar] [CrossRef]
  16. Pacco, H.C. Simulation of temperature control and irrigation time in the production of tulips using Fuzzy logic. Procedia Comput. Sci. 2022, 200, 1–12. [Google Scholar] [CrossRef]
  17. Azad, A.S.; Rahaman, M.S.A.; Watada, J.; Vasant, P.; Vintaned, J.A.G. Optimization of the hydropower energy generation using Meta-Heuristic approaches: A review. Energy Rep. 2020, 6, 2230–2248. [Google Scholar] [CrossRef]
  18. Han, H.; Liu, H.; Li, J.; Qiao, J. Cooperative fuzzy-neural control for wastewater treatment process. IEEE Trans. Ind. Inform. 2020, 17, 5971–5981. [Google Scholar] [CrossRef]
  19. Pezeshki, Z.; Mazinani, S.M. Comparison of artificial neural networks, fuzzy logic and neuro fuzzy for predicting optimization of building thermal consumption: A survey. Artif. Intell. Rev. 2019, 52, 495–525. [Google Scholar] [CrossRef]
  20. Al Andzar, M.F.; Puriyanto, R.D. PID Control for Temperature and Motor Speed Based on PLC. Signal Image Process. Lett. 2019, 1, 7–13. [Google Scholar] [CrossRef]
  21. Giwa, A.; Ogunware, M.A. Modelling, simulation and control of a reactive distillation process for biodiesel production. ABUAD J. Eng. Res. Dev. 2018, 1, 49–60. [Google Scholar]
  22. Ajeni, M.O.; Heath, W.P.; Poupard, E. Modelling for Control of Biodiesel Microreactors. IFAC-Pap. 2021, 54, 312–317. [Google Scholar] [CrossRef]
  23. Adokiye, T.; Gunorubon, A.J.; Kenkugile, D.K. Modeling and Control of a Biodiesel Transesterification Reactor. Adv. Chem. Eng. Sci. 2020, 10, 210–224. [Google Scholar] [CrossRef]
  24. Farhat, Y.; Rhili, F.E.; Atig, A.; Zribi, A.; Ben Abdennour, R. Stability analysis strategy for the adaptive neural control system: A practical validation via a transesterification reactor. Iran. J. Sci. Technol. Trans. Electr. Eng. 2021, 45, 1395–1409. [Google Scholar] [CrossRef]
  25. Yassin, F.; Ali, Z.; Asma, A.; Ridha, B.A. Enhancement neural control scheme performance using PSO adaptive rate: Experimentation on a transesterification reactor. J. Vib. Control. 2022, 29, 3769–3782. [Google Scholar] [CrossRef]
  26. Shoelarta, S.; Ngatin, A.; Pia, R.B. Controlled microwave to boost biodiesel transesterification in continuous reactor. Proc. Aip Conf. Proc. 2020, 2197, 030002. [Google Scholar]
  27. Stanescu, R.C.; Leahu, C.I.; Soica, A. Aspects Regarding the Modelling and Optimization of the Transesterification Process through Temperature Control of the Chemical Reactor. Energies 2023, 16, 2883. [Google Scholar] [CrossRef]
  28. Tipsuwanporn, V.; Intajag, S.; Witheephanich, K.; Koetsam-ang, N.; Samiamag, S. Neuro-fuzzy controller design for industrial process controls. In Proceedings of the SICE 2004 Annual Conference, Sapporo, Japan, 4–6 August 2004; Volume 2, pp. 1656–1661. [Google Scholar]
  29. Ljung, L. System Identification Theory for User; Prentice-Hall: Englewood Cliffs, NJ, USA, 1987. [Google Scholar]
  30. Bortolet, P.; Palm, R. Identification, modeling and control by means of Takagi-Sugeno fuzzy systems. In Proceedings of the 6th International Fuzzy Systems Conference, Barcelona, Spain, 1–5 July 1997; Volume 1, pp. 515–520. [Google Scholar] [CrossRef]
  31. de Campos Souza, P.V. Fuzzy neural networks and neuro-fuzzy networks: A review the main techniques and applications used in the literature. Appl. Soft Comput. 2020, 92, 106275. [Google Scholar] [CrossRef]
  32. Cabrera, S.A.; Rojas–Moreno, A. Implementation of a Distributed Control System. In Proceedings of the 2022 IEEE XXIX International Conference on Electronics, Electrical Engineering and Computing (INTERCON), Lima, Peru, 11–13 August 2022; pp. 1–4. [Google Scholar] [CrossRef]
  33. Huba, M.; Hypiusová, M.; Ťapák, P.; Vrancic, D. Active Disturbance Rejection Control for DC Motor Laboratory Plant Learning Object. Information 2020, 11, 151. [Google Scholar] [CrossRef]
  34. Liu, Y.; Lotero, E.; Goodwin, J.G.; Mo, X. Transesterification of poultry fat with methanol using Mg–Al hydrotalcite derived catalysts. Appl. Catal. Gen. 2007, 331, 138–148. [Google Scholar] [CrossRef]
Figure 1. Pilot plant scheme [27].
Figure 1. Pilot plant scheme [27].
Energies 16 06187 g001
Figure 2. Neuro-fuzzy model controller scheme.
Figure 2. Neuro-fuzzy model controller scheme.
Energies 16 06187 g002
Figure 3. Neuro-fuzzy model controller scheme.
Figure 3. Neuro-fuzzy model controller scheme.
Energies 16 06187 g003
Figure 4. Flowchart for tuning the NFC parameters.
Figure 4. Flowchart for tuning the NFC parameters.
Energies 16 06187 g004
Figure 5. Flowchart for tuning the NFC parameters.
Figure 5. Flowchart for tuning the NFC parameters.
Energies 16 06187 g005
Figure 6. Transesterification reaction at 60 °C and 6:1 molar ratio [27].
Figure 6. Transesterification reaction at 60 °C and 6:1 molar ratio [27].
Energies 16 06187 g006
Figure 7. Dynamics of the reactor temperature before a disturbance rejected by a PID control.
Figure 7. Dynamics of the reactor temperature before a disturbance rejected by a PID control.
Energies 16 06187 g007
Figure 8. Dynamics of energy used by the PID controller before a disturbance rejection.
Figure 8. Dynamics of energy used by the PID controller before a disturbance rejection.
Energies 16 06187 g008
Figure 9. Dynamics of the reactor temperature before a disturbance rejection by a PID control.
Figure 9. Dynamics of the reactor temperature before a disturbance rejection by a PID control.
Energies 16 06187 g009
Figure 10. Dynamics of energy used by the neuro-fuzzy controller before a disturbance rejection.
Figure 10. Dynamics of energy used by the neuro-fuzzy controller before a disturbance rejection.
Energies 16 06187 g010
Figure 11. Examples of experimentation of the neuro-fuzzy controller through metaheuristics.
Figure 11. Examples of experimentation of the neuro-fuzzy controller through metaheuristics.
Energies 16 06187 g011
Table 1. List of tuned parameters with DE of the NFC.
Table 1. List of tuned parameters with DE of the NFC.
ParameterDescriptionRange
Parameter of the membership functions ( ϕ j , k and σ j , k )Describe the functions in the first layer of NFC ϕ j , k 50 , 50 must respect the relation (26) and (27), σ j , k 50 , 50
Learning rate constantsWeight variations updated during learning 0.0001 , 1
Initial weightsThe weights are used to calculate the output and also are updated through the training of NN, but different initial values can also produce different behaviors 0.0001 , 100
Table 2. Performance of 10 tuned configurations using DE.
Table 2. Performance of 10 tuned configurations using DE.
RunObjective FunctionITAETVU
1 6.7627 × 10 3 8.2962 × 10 4 31.5969
2 7.2181 × 10 3 1.2079 × 10 5 34.8130
3 5.8884 × 10 3 1.0349 × 10 5 53.1110
4 5.9560 × 10 3 4.7113 × 10 4 28.1334
5 5.6419 × 10 3 4.0733 × 10 4 28.7059
6 5.7688 × 10 3 5.2593 × 10 4 30.2796
7 5.9590 × 10 3 9.4081 × 10 4 26.0572
8 6.0072 × 10 3 7.5809 × 10 4 27.7262
9 5.9796 × 10 3 1.0031 × 10 5 27.8622
10 6.0396 × 10 3 8.1657 × 10 4 25.7697
Mean 6.1221 × 10 3 7.9954 × 10 4 31.4055
Standard deviation 0.4848 × 10 3 2.6310 × 10 4 8.0863
Table 3. Controller performance index comparison.
Table 3. Controller performance index comparison.
ControllerITAETVU
PID7.8770 ×   10 7 32.0287
Neuro-Fuzzy with Metaheuristics (best ITAE)4.0733 ×   10 4 28.7059
Neuro-Fuzzy with Metaheuristics (best TVU)8.1657 ×   10 4 25.7697
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Maya-Rodriguez, M.C.; Carvajal-Mariscal, I.; López-Muñoz, R.; Lopez-Pacheco, M.A.; Tolentino-Eslava, R. Temperature Control of a Chemical Reactor Based on Neuro-Fuzzy Tuned with a Metaheuristic Technique to Improve Biodiesel Production. Energies 2023, 16, 6187. https://doi.org/10.3390/en16176187

AMA Style

Maya-Rodriguez MC, Carvajal-Mariscal I, López-Muñoz R, Lopez-Pacheco MA, Tolentino-Eslava R. Temperature Control of a Chemical Reactor Based on Neuro-Fuzzy Tuned with a Metaheuristic Technique to Improve Biodiesel Production. Energies. 2023; 16(17):6187. https://doi.org/10.3390/en16176187

Chicago/Turabian Style

Maya-Rodriguez, Mario C., Ignacio Carvajal-Mariscal, Raúl López-Muñoz, Mario A. Lopez-Pacheco, and René Tolentino-Eslava. 2023. "Temperature Control of a Chemical Reactor Based on Neuro-Fuzzy Tuned with a Metaheuristic Technique to Improve Biodiesel Production" Energies 16, no. 17: 6187. https://doi.org/10.3390/en16176187

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop