Modeling and Control of a Biodiesel Transesterification Reactor ()
1. Introduction
1.1. Background of Study
The increased demand for food, better communication technology, housing, means of transportation, clothes and better standard of living has led to considerable increase in the number of industries and manufacturing companies. The resulting effect is increased energy consumption and requirement; hence necessitating increased research into readily available, sustainable and environmentally friendly energy sources. These energy sources include nuclear energy, fossil fuels (petroleum energy), solar energy, wind energy, hydro energy, and other alternative sources such as biofuel. In this group, biofuel has the advantage of producing no net output of carbon in the form of carbon dioxide [1], and is rapidly biodegradable and completely non-toxic; hence spillages are of less risk than fossil diesel spillages [2]. An important type of biofuel is biodiesel, which has become the foremost alternative biofuel being developed to reduce the World’s dependence on fossil fuels. Also, growing concern on the use of fossil fuel particularly due to its environmental effects has made biodiesel an alternative fuel to those refined from petroleum feedstock as it reduces greenhouse emissions [3]. Its higher flash point than fossil diesel makes it safer in the event of a crash and it also has fuel properties similar to diesel fuel [4]. Biodiesel can be produced from renewable sources such as vegetable and animal oils, as well as from wastes, such as used cooking oil through a process called transesterification [5] which is the chemical reaction between triglyceride and alcohol in the presence of a catalyst to produce biodiesel and glycerol.
1.2. Biodiesel Production
The general reaction scheme and the set of consecutive reversible reactions for the transesterification of triglyceride (fat or oil) as given by [6] are shown in Figure 1.
In a typical esterification process, the triglyceride reacts with alcohol in the presence of a catalyst (usually a strong alkaline like sodium hydroxide) to form the mono-alkyl ester, or biodiesel and crude glycerol. Methanol or ethanol is the alcohol mostly used and produces methyl or ethyl esters respectively with potassium or sodium hydroxide as catalyst.
Research on various aspects of the transesterification process abound: works on the use of various oils as feedstock for the transesterification process include the use of: coconut oil [7], cottonseed oil [8], cashew nut shell liquid oil [9], jatropha oil [10], sunflower [11], palm oil [12] and beef tallow by [13].works on catalysts used include: chemical (homogeneous—alkali or acid, heterogeneous—solid acid or solid alkali catalyst) and biological (immobilized lipases) [14], heterogeneous base catalyst from waste eggshell [15] [16]; reaction kinetics of transesterification of: sunflower oil [17], jatropha oil [18] and of palm oil [6], [19].
Researches on the effects of process parameter aimed at establishing optimum reaction conditions for maximum and profitable biodiesel production include works on the effects of temperature and pressure [20]; methanol-oil molar ratio [21], mixing rate [18], catalyst type [16] [22] and optimization of reactor parameters by [23] and [24]. The reaction mechanism for the transesterification of
Figure 1. General reaction scheme and consecutive reversible reactions for the transesterification.
used vegetable oil to biodiesel occurs via a series of three-stage reversible reaction scheme; as with reversible reactions, the reactions can proceed in either direction if not effectively controlled. Implementation of an appropriate control strategy will ensure optimum biodiesel production and process stability. Research on the control of the biodiesel reactor is scanty, except the works of Mjalli & Hussain (2009) [25] that compared the predictive and self-tuning adaptive control strategies for biodiesel reactor and Olufemi & Ogbeide (2017) [26] that designed non-linear controllers for the biodiesel reactor. In this work a model for a feedback control strategy with Proportional Integral (PI) controller was developed for the continuous stirred tank reactor and used to study the effect of disturbance and determine optimum controller parameters that will ensure increased biodiesel production and stability of the reactor.
2. Methods
The mathematical models of the continuous stirred tank reactor (CSTR) were developed by applying the principle of conservation of mass on the reactor. These models (open loop process models) were ordinary differential equations and were solved with industrial process data [21] [26] [6] using the ode45 solver from MATLAB 7.5.0. The open loop models were used for reactor simulation to determine the effects of step-changes of ±10% in the reactants flowrate on the reactor performance—the concentrations of biodiesel produced. Simulation results showed instabilities in biodiesel concentrations due to changing reactants flowrate, hence requiring reactor control. The control objective was to ensure maximum production (concentration) of biodiesel as fluctuations in the inlet reactants flowrate occur. The feedback control configuration with Proportional-Integral (PI) controller was used to effect the control action. A closed loop block diagram of the process was drawn, from which the closed loop model of the process output (biodiesel concentration) was developed. The closed loop model equation of the process was developed in terms of the transfer functions of the components of the closed loop block diagram. To effectively ensure this control which is to minimize the effects of disturbances, obtain rapid and smooth responses to set point changes with little or no oscillations and eliminate steady state error (offset); the optimum values of the controller parameters (controller gain
, the integral or reset time
) had to be determined. This was achieved by controller tuning. This is a systematic selection of controller parameter values that achieves control objectives. An iterative procedure using the On-Line Trial and Error Method with the initial values of the parameters determined using the Ziegler’s method of direct substitution for stability [27] implemented with MathLab Simulink was developed. The values of these parameters that stabilize the output in the reactor are the optimum controller setting for effective control of the process.
2.1. Reaction Kinetics
The reaction mechanism for a transesterification process [6] is given in Figure 1 was used to obtain the corresponding reaction rates for the reactions assuming first order elementary reaction rate as follows:
(1)
(2)
(3)
(4)
(5)
(6)
2.2. Model Development
2.2.1. Open Loop Reactor Model
The open loop model is the model of the process without any form of control. In formulating the process (Continuous Stirred Tank Reactor) model, the following simplifying assumptions were made: the reactants were perfectly mixed therefore outlet conditions were the same as conditions within the reactor, density is constant and heat capacity varies negligibly with temperature, the reactor is perfectly insulated and there is no heat loss. Applying the principle of conservation of mass to each reaction component (i) involved in the process gave the model equation for constant reactor volume:
(7)
Equation (7) can be written for each component by substituting the reaction rate of the various components as follows:
Triglyceride:
(8)
Methanol:
(9)
Diglyceride:
(10)
Monoglyceride:
(11)
Methyl Ester (biodiesel):
(12)
Glycerol:
(13)
These derived equations are the open-loop models for the transesterification process.
2.2.2. Closed Loop Reactor Model-Process Control
The Control Objective was to ensure the concentration of biodiesel (methyl ester) from the reactor was maintained at a maximum pre-specified level (stable and does not fluctuate with time) in the face of changing disturbances (step changes in the inlet feed flow rate—a Servo problem). The closed loop diagram of the process is shown in Figure 2 and the block diagram in Figure 3.
AAS—Atomic Adsorption Spectrophotometer.
Figure 2. Closed-loop diagram of the process.
Figure 3. Block diagram of closed-loop system.
The general model equation for the output of a closed loop process [27] was applied to obtain the output (concentration of biodiesel, methyl ester:
) of the closed loop process in the Laplace domain in terms of transfer functions of the various components in Figure 3 due to set point (
) and load/ disturbance (
) changes to give:
(14)
where:
= Transfer Function for the Final Control Element
= Transfer Function for the Controller
= Transfer Function for the Process
= Transfer Function for the Load
= Transfer Function for the Measuring Device
For the servo control problem: the set point undergoes step changes while the load does not change (
); the feedback controller acts to keep the concentration of biodiesel (
) close to the set point (maximum concentration of biodiesel)
.
The output
from Equation (14) becomes:
(15)
2.2.3. Determination of the Transfer Functions
The transfer function of each component was obtained by expressing the component model equation in deviation variables form, Laplace transform the resulting equation and rearrange the final equation in the input-output form. The transfer function for the various components in the closed loop diagram (Figure 3) was therefore obtained following this procedure as follows:
1) Process
The transfer function for the process was obtained as:
(16)
2) Controller: Proportional-Integral (PI) Controller
The controller of choice varies between the Proportional Integral (PI) and a Proportional Integral Differential controller (PID). As a result of the noise signal which cannot be accounted for within the framework of this study, a PI controller was used. The model equation for the output of a PI controller in deviation variables is [25]:
(17)
Equation (17) was laplaced and rearranged to obtain the Transfer function as:
(18)
where:
= proportional gain;
= reset time.
3) Measuring Device (Differential Pressure Cell)
(19)
4) Final Control Element (The Control Valve)
(20)
The values of the transfer functions of the measuring device and the final control element as given by Equations (19) and (20) are usually assumed as the transfer functions of these components of the closed loop do not change and have minimal effect on the system [27].
2.3. Determination of Model Parameters
2.3.1. Reaction Rate Constants
The reaction rate constants for the transesterification process of palm oil as the triglyceride [6] was used in this study are as follows (Table 1).
2.3.2. Controller Parameter/Constants
The controller parameters: the proportional gain and reset time for the PI controller were determined using an iterative procedure—the On-Line Trial and Error Method with the initial values of the parameters determined using the Ziegler’s method of direct substitution for stability [27].
2.4. Solution Techniques
2.4.1. Open Loop Model
The model equations are a system of coupled non-linear differential equations and were solved using Runge-Kutta 4th order.
2.4.2. Closed Loop Model
Substitution of the expressions for the various components of the close loop model into the close loop model equation, rearrange and invert Laplace transform to obtain the expression for the concentration of biodiesel in the time domain as:
(21)
3. Results and Discussion
3.1. Open Loop Model Results/Response
The results obtained by solving the open loop model equations for the various components of the esterification reaction give the behavior of these components in the reactor. These results as predicted by the model equations are shown in Figures 4-9.
Figure 4 and Figure 5 show how the concentrations of the reactants—triglyceride and methanol vary in the reactor with time.
The concentrations of the reactants—triglyceride and methanol decreased continuously with time as the reaction proceeds and becomes gradually constant—equilibrium gradually attained as reaction stops.
Figure 6 and Figure 7 show the behavior of the intermediate products (diglyceride and monoglyceride) produced in the course of the reaction.
The concentrations of diglycerides increased sharply initially and continuously until it reached a maximum in the first three quarters of the reaction time and thereafter, gradually decreased till the end of the reaction. Similarly, the concentrations of monoglyceride increased slowly and continuously until it reached a maximum and thereafter gradually decreased to a very minute concentration at the end of the reaction. This confirms the formation of monoglyceride as an intermediate product which was almost completely used up during the reaction as shown by its concentration at the end of the reaction. These results and trends were similar and in agreement with similar works on the transesterification of used oil in the literature: Yusuff et al. (2014) [21]; Olufemi & Ogbeide (2017) [26]; Leevijit et al. (2006) and Theerayut et al. (2006) [6].
The results of the concentration of the products—methyl ester (Biodiesel) and glyceride are shown in Figure 8 and Figure 9.
From Figure 8 and Figure 9, the concentrations of methyl ester and glyceride increased gradually continuously throughout the course of the reaction with the
Figure 4. Concentration of triglyceride in the reactor with time.
Figure 5. Concentration of methanol in the reactor with time.
Figure 6. Concentration of diglyceride in the reactor with time.
Figure 7. Concentration of monoglyceride in the reactor with time.
Figure 8. Concentration of biodiesel in the reactor with time.
Figure 9. Concentration of glyceride in the reactor with time.
rate of production of methyl ester (biodiesel) much higher than that of glyceride. The concentrations of these products increased continuously and gradually attained equilibrium towards the end of the reaction.
3.2. Effect of Disturbance—Step Changes in Reactant Flow Rates
The effects of step changes (increase and decrease) in the reactants (triglyceride and methanol) flowrates on the concentrations of methyl ester (biodiesel) are shown in Figure 10 and Figure 11.
A 10% step increase in the inlet reactants flowrates means more reactants are available for reaction, this results in an increase in the rate of reaction and a corresponding increase in products formed. Figure 10 shows an initial sharp increase in biodiesel concentration which became gradual, then there was a decrease for a while then an increase. This increase-decrease trend continued throughout the reaction period and finally increased gradually at the end of reaction. Similarly, a 10% step decrease in the inlet reactants flowrates means less reactants are available for reaction, results in a decrease in the rate of reaction and a corresponding decrease in products formed. Figure 11 shows an increase-decrease trend in the biodiesel concentrations but with a decreased actual value at each time and at the end of the reaction when compared to the concentrations when there were no disturbances. For both cases there were varying distortions in the concentrations of biodiesel and the concentration did not attain equilibrium.
Figure 10. Effect of step increase in inlet reactant flow rates on the concentration of biodiesel in the reactor with time.
Figure 11. Effect of step decrease in inlet reactants flow rates on the concentration of biodiesel in the reactor with time.
3.3. Closed-Loop Response: Effect of the Controller
The closed loop responses of the biodiesel concentration in the reactor with a feedback PI controller at varying values of the controller parameters (controller gain KC and integral or reset time τI) aimed at stabilizing the concentration level of biodiesel were investigated. A typical response is shown in Figure 12. The concentration levels during these variations oscillated progressively with increasing amplitude and a low or high period of oscillation. This showed that the process was still unstable and the controller required more tuning.
The controller parameters were continuously adjusted in a systematic way until the “best” values of controller parameters for the process—values that gave faster and less oscillatory response that becomes stable in the shortest possible time were obtained. The optimum values of these controller parameters obtained were: KC = 8.306 and τI = 17.157 mins.
The behavior of the biodiesel concentrations at these values for ±10% step changes in the inlet reactants flowrates is shown in Figure 13 and Figure 14.
Figure 12. Typical behavior of biodiesel concentration during tuning of controller parameters.
Figure 13. Effect of controller to step increase in inlet flow rates on the concentration of biodiesel in the reactor with time.
Figure 14. Effect of controller to step decrease in inlet flow rates on the concentration of biodiesel in the reactor with time.
As seen in these figures the PI control was able to almost eliminated the oscillation (nullify the effect of the disturbances), stabilize the process and gave higher production of biodiesel in both cases compared to when there was no controller in place.
4. Conclusion
A dynamic model has been developed for the continuous stirred tank reactor for the transesterification of used cooking oil (triglyceride) to biodiesel by applying the principles of conservation of mass. The developed models were used to study the dynamic behaviour of the reactor. The model results gave the concentration time profiles of the reactants and products in the reactor. Simulation of the continuous stirred tank reactor to step changes in inlet reactants flowrate on the concentration time profile of the product—biodiesel showed fluctuations in the concentration time profile for biodiesel. Hence process control was effected using a proportional-integral feedback controller. A closed loop model (process with controller) was developed. The solution of the closed loop model to step changes in the inlet flowrate showed oscillatory response in the biodiesel concentration with offset over a long period. Controller tunning was therefore performed to obtain optimum values of the controller parameters (controller gain
, the integral or reset time
) of
mins which ensured stability and eliminated the offset (steady state error).