CHEMICAL ENGINEERING TRANSACTIONS VOL. 81, 2020 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Qiuwang Wang, Min Zeng, Panos Seferlis, Ting Ma, Jiří J. Klemeš Copyright © 2020, AIDIC Servizi S.r.l. ISBN 978-88-95608-79-2; ISSN 2283-9216 Efficient Fuzzy Control of a Biochemical Reactor Anna Vasičkaninová*, Monika Bakošová, Juraj Oravec, Michaela Horváthová Slovak University of Technology in Bratislava, Faculty of Chemical and Food Technology, Institute of Information Engineering, Automation, and Mathematics, Radlinského 9, 81237 Bratislava, Slovak Republic anna.vasickaninova@stuba.sk Fuzzy logic control based on the Takagi–Sugeno inference method has been applied for the yeast alcoholic fermentation running in a continuous-time biochemical reactor in this paper. A type-1 fuzzy PID controller was designed to temperature control in a biochemical reactor. The fuzzy PID controller was also designed using type-2 fuzzy sets. The advantage of the fuzzy control is that it can be used very successfully for control of strongly non-linear processes and processes that are difficult to model because of complicated reaction kinetics. Obtained simulation results confirm this fact. The disadvantage of the fuzzy control design lies in the time- consuming tuning of controllers. The subtractive clustering method was used to identify the rule base. This approach was chosen to minimize the number of rules of the designed fuzzy logic controllers and to simplify the fuzzy controller design. Simulation results confirm that fuzzy PID controllers can assure better performance than conventional PID controllers. Yeast alcoholic fermentation is an exothermic process and the cooling is necessary to maintain the optimal temperature in the reactor. Fuzzy PID control reduces coolant consumption in comparison with conventional PID control and so it assures energy-efficient control of continuous-time alcoholic fermentation. Using type-2 fuzzy sets in the fuzzy PID controller design is very promising as the type- 2 fuzzy controller offers even better results than the type-1 fuzzy controller. 1. Introduction Biochemical processes have become integral parts of the pharmaceutical, chemical, and food industries. An important task for chemical engineers, biochemists and microbiologists is to cultivate organisms in a highly controlled way. Fermentation processes are very important to produce biofuels and their advanced control is being studied intensively. Nagy (2007) introduced a mathematical model of a continuous fermentation process for ethanol production that appropriately describes the temperature behavior inside a bioreactor and is also suitable for implementation by the Matlab/Simulink. Ławryńczuk (2008) presented the fundamental model of the yeast fermentation biochemical reactor and developed an artificial neural networks model as a black box model of yeast fermentation and used it in a computationally efficient nonlinear MPC algorithm. The fermentation control strategies review (Mears et al., 2017) summarizes the benefits and requirements of the open loop control, and different advanced control strategies as adaptive control, model predictive control, fuzzy control, artificial neural network-based control, probing control and statistical process control. Bakošová et al. (2019) study two advanced approaches to controlling alcohol fermentation in a biochemical reactor to minimize energy consumption. Fuzzy Logic Control (FLC) is often found in situations where conventional control is expected. Fuzzy logic is based on the theory of fuzzy sets. These were introduced by Zadeh (1965). The biggest advantage of fuzzy systems is tolerance to data inaccuracy. Fuzzy systems based on language variables are also applicable in classical control problems. Zadeh (2015) described his view of the development of fuzzy logic from 1965 and its current state. Aliev (2013) introduces the basics of fuzzy sets theory, fuzzy logic, and fuzzy mathematics. This book also presents applications of the proposed fuzzy logic-based generalized decision theory to solve the benchmark. The main benefit of fuzzy logic is its ability to work with unclear data (González et al., 2013). Various technological and engineering applications of fuzzy logic are listed in Ross (2010). Aviso et al. (2019) developed a fuzzy combined integer model of linear programming to reduce greenhouse gas emissions. Vasičkaninová and Bakošová (2015) investigate a Takagi–Sugeno fuzzy model of the tubular heat exchanger in a predictive DOI: 10.3303/CET2081015 Paper Received: 31/03/2020; Revised: 12/05/2020; Accepted: 13/05/2020 Please cite this article as: Vasičkaninová A., Bakošová M., Oravec J., Horváthová M., 2020, Efficient Fuzzy Control of a Biochemical Reactor, Chemical Engineering Transactions, 81, 85-90 DOI:10.3303/CET2081015 85 control algorithm to regulate the output petroleum temperature. The advantages of fuzzy logic based controllers are simplicity, robustness, and the ability to deal with complex nonlinear relationships using incomplete and noisy data (Silva et al., 2012). Sagüés et al. (2007) successfully implemented fuzzy controllers to control a biomass gasification process. The benefits of the application of fuzzy-based control are also commented by Wakabayashi et al. (2009) when controlling the temperature inside a polymerization reactor. In this case, the fuzzy-PI controller was implemented using a split range configuration with two control valves, one for a hot utility and one for a cold utility. In split range control, the output of the controller is sent to two or more control valves and each of them acts upon a certain range of the controller output. The aim of this split ranging is to improve the controller by expanding its performance range (Shen-Huiiet al., 2011). Fonseca et al. (2013) studied the application of a fuzzy-PI and fuzzy-PID controllers alongside a split range strategy to control the temperature inside a fermentation vessel by manipulating both both the flow of hot and cold water entering the jacket. Temperature control of the bioreactor for the fermentation process using Takagi-Sugeno fuzzy controller is also given in Flores-Hernández et al. (2018). The methods used to calculate the type-2 fuzzy logic controller (T2 FLC) output describes Tai et al. (2016). Based on the application overview, the most promising applications are searched. Mendel (2017) covers fuzzy rule-based systems – from type-1 to interval type-2 to general type- 2 – in one volume. For hands-on experience, the book provides information on accessing MatLab and Java software to complement the content. The book features a full suite of classroom material. The aim of this paper is to contribute to the design of the fermentation process control because, despite intensive research in this area, there is a lack of approaches leading to a simple and reliable design of the control. The main goal is to show that fuzzy controllers are able to provide energy savings compared to conventional PID controllers. 2. Fuzzy control 2.1 Type-1 fuzzy PID controller The general structure of type-1 fuzzy PID controller is shown in Figure 1. The controller is formed as a fuzzy PD controller with an integrator and a summation unit at the output (Kumbasar, 2014). The standard fuzzy PID controller is constructed by choosing the inputs to be error e and derivative of error de/dt and the output to be the control signal u. Figure 1: Fuzzy PID controller 2.2 Interval type-2 fuzzy PID controller The rule base for type-2 fuzzy controller (Figure 2) remains the same as for type-1 FLC, but its membership functions are represented by type-2 interval fuzzy sets instead of type-1 fuzzy sets using some type of reducer (Kumbasar, 2014). Figure 2: Interval type-2 fuzzy PID controller block diagram 86 3. The continuous-time fermentation bioreactor Yeast fermentation is an important biochemical process. The yeast fermentation reactor under investigation is taken from the work introduced by Nagy (2007) and also used by Ławryńczuk (2008). The control system structure for the continuous-time fermentation reactor is shown in Figure 3. Figure 3: The fermentation reactor operating in a continuous-time regime The mathematical model of this reactor describes fermentation kinetics and mass and energy balance of the reactor. The steady-state values of all variables are given in Ławryńczuk (2008). Simulation experiments with this model are described in Bakošová et al. (2019). 4. Results and discussion 4.1 Identification of yeast fermentation To obtain a nominal process model, step responses of the temperature in the reactor to various step changes of the cooling water volumetric flow rate were generated and intervals for the transfer function parameters were obtained. The fermenter was represented as the system with interval parametric uncertainty. The identified fermenter model was obtained using the Strejc method in the form of the first order plus time delay transfer function (Mikleš and Fikar, 2007) with the gain 𝜅, the time delay Td, the time constant , and s being the Laplace transform argument 𝑆 = 𝜅 𝜏𝑠 + 1 𝑒−𝑇𝑑𝑠 (1) The nominal values of the parameters are the mean values of parameter intervals: 𝜅mean = − 0.26 °C h dm-3, 𝜏mean = 37 h, Tdmean = 1 h. 4.2 Conventional PID control of yeast fermentation The nominal plant model (1) was used to design the PID controllers. Based on simulation results, the Cohen- Coon method and the Chien-Hrones-Reswick method (Corriou, 2004) were selected from several experimental tuning approaches. The transfer function of a PID controller C with a filtered derivative part is considered in the form: 𝐶 = 𝑘𝑝 (1 + 1 𝑡𝑖 𝑠 + 𝑡𝑑 𝑠 𝑡𝑑 𝑠 𝑁 + 1 ) (2) where kp is the proportional gain, ti the integral time, td the derivative time and N is a constant. The PID controller parameters are presented in Table 1, where N = 20, the negative value of controller parameter kp express the fact the higer cooling agent flow rate is applied the lower reactor temperature is reached. Table 1: Parameters of the conventionally tuned PID controllers Tuning rules kp (m3 h-1 °C-1) ti (h-1) td (h) Cohen-Coon −186.26 2.43 0.36 Chien-Hrones-Reswick −83.39 37.06 0.50 87 4.3 Fuzzy control of yeast fermentation The type-1 fuzzy controller was designed as a Sugeno-type fuzzy inference system (FIS) in the form Eq(3): If e is Ai and de/dt is Bi Then fi = pi e + qi de/dt + ri, i = 1, …, 4 (3) where e is the control error, de/dt is the derivative of error, pi, qi, ri are the consequent parameters. Sugeno-type FIS was generated using a subtractive clustering method. The symmetric Gaussian function Eq(4) was used for the fuzzification of inputs. This function depends on the standard deviation σ and the mean c. The Gaussian membership functions parameters σ and c can be seen in Table 2. The rules consequent parameters are enumerated in Table 3. 𝜇(𝑥) = 𝑒 − (𝑥−𝑐)2 2𝜎2 (4) Table 2: Parameters of the Gaussian membership functions e de/dt i ci i ci 1.14 -0.009 10.24 21.10 1.14 -0.089 10.24 21.21 1.14 -0.050 10.24 0.42 1.14 0.206 10.24 -0.09 Table 3: Consequent parameters pi qi ri 48,544 -1,102 -1,545,305 47,344 -769 1,589,707 10,865 -286 111,329 10,636 -264 112,916 Rule viewer that simulates the entire fuzzy inference process is seen in Figure 4. Figure 5 introduces the corresponding structure of ANFIS. Figure 4: Fuzzy inference system Figure 5: Structure of ANFIS output aggregation A1 A2 A3 e B1 B2 B3 e     f1 f2 f3 f4  u inputs if-part then-part rules B4 A4 88 There are different types of type-reduction methods to design interval type-2 fuzzy PID controller. Karnik-Mendel algorithms are iterative procedures (Karnik and Mendel, 2001) that are commonly used in fuzzy logic theory and in this paper too. The input type-2 fuzzy sets are shown in Figure 6 (Wu and Mendel, 2009). Figure 6: Interval type-2 membership functions (a) degree of membership - e graph and (b) degree of membership - de/dt graph 5. Simulation results Simulation results obtained with the proposed fuzzy controllers are shown in Figure 7 in set-point tracking with measurement noise. The results were compared also using the total consumption of cooling water V consumed during control, the integral quality criteria IAE (integrated absolute error) and ISE (integrated squared error) defined e. g. in Corriou (2004) as follows 𝐼𝐴𝐸 = ∫ |𝑟(𝑡) − 𝑦(𝑡)|𝑑𝑡 ∞ 0 , 𝐼𝑆𝐸 = ∫ (𝑟(𝑡) − 𝑦(𝑡))2𝑑𝑡 ∞ 0 (5) In Eq(5), r(t) is the reference value and y(t) is the actual process output. The reference reactor temperature r = 32 °C changed to 30.5 °C at 200 h. Table 4 summarizes the numerical results.The fuzzy controllers ensured reference tracking with measurement noise without overshoots. The consumption of cooling agent V was the lowest using type-2 fuzzy PID controller. The value of IAE was the lowest when type-2 fuzzy PID controller was used, and the value of ISE was the lowest when type-1 fuzzy PID controller was used. Conventional PID controllers led to the worst values of all considered criteria. Figure 7: Comparison of PID and fuzzy control Table 4: Values of V, ISE, IAE Control V (m3) ISE (°C2 h) IAE (°C h) Fuzzy PID type-1 8.12 48.88 60.31 Fuzzy PID type-2 8.05 49.79 55.57 PID Cohen-Coon 8.58 86.36 94.15 PID Chien-Hrones-Reswick 8.13 55.65 77.17 6. Conclusions Control of alcoholic fermentation as a part of biofuel production is currently the subject of intensive research. Two conventional PID controllers, a fuzzy PID type-1 and a fuzzy PID type-2 controllers were used to control the yeast fermentation reactor and compared. Depending on the coolant consumption and ISE and IAE criteria, both fuzzy controllers outperformed the PID control of the yeast alcohol fermentation running in a continuous- 89 time biochemical reactor. Comparing the highest and lowest ISE and IAE values, the ISE value decreased by 76 % when comparing fuzzy PID type-1 and PID Cohen-Coon controllers and the IAE value decreased by 69 % when comparing fuzzy PID type-2 and PID Cohen-Coon controllers. Fuzzy type-2 controller provided less coolant consumption, but with only a small 6.6 % reduction in water consumption. Simulation results confirmed the applicability of fuzzy control to maintain product yield and ensure energy savings when a strongly non-linear process with uncertainties is controlled. Acknowledgements The authors gratefully acknowledge the contribution of the Scientific Grant Agency of the Slovak Republic under the grant 1/0545/20. References Aliev R.A., 2013, Fuzzy Sets and Fuzzy Logic, Fundamentals of the fuzzy logic-based generalized theory of decisions, Springer-Verlag, Berlin, Germany, 1–58. Aviso K.B., Sy C.L., Tan R.R., 2019, Fuzzy optimization of direct and indirect biomass co-firing in power plants, Chemical Engineering Transactions, 76, 55–60. Bakošová M., Oravec J., Vasičkaninová A., Mészáros A., Artzová P., 2019, Advanced control of a biochemical reactor for yeast fermentation, Chemical Engineering Transactions, 76, 769–774. Corriou J.P., 2004, Process Control – Theory and Applications, Springer, London, UK. Flores-Hernández A., Reyes-Reyes J., Astorga-Zaragoza C., Osorio-Gordillo G., García-Beltrán C., 2018, Temperature control of an alcoholic fermentation process through the Takagi–Sugeno modeling, Chemical Engineering Research and Design, 140, 320–330. Fonseca R.R., Schmitz J.E., Fileti A.M.F., da Silva F.V., 2013, A fuzzy–split range control system applied to a fermentation process, Bioresource Technology, 142, 475–482. González J.R., Darbra R.M., Arnaldos J., 2013, Using fuzzy logic to introduce the human factor in the failure frequency estimation of storage vessels in chemical plants, Chemical Engineering Transactions, 32, 193– 198. Karnik N.N., Mendel J.M., 2001, Centroid of a type-2 fuzzy set, Information Sciences, 132, 195-220. Kumbasar T., 2014, A simple design method for interval type-2 fuzzy PID controllers, Soft Computing, 18, 1293– 1304. Ławryńczuk M., 2008, Modelling and nonlinear predictive control of a yeast fermentation biochemical reactor using neural networks, Chemical Engineering Journal, 145, 290–307. Mears L., Stocks S.M., Sin G., Gernaey K.V., 2017, A review of control strategies for manipulating the feed rate in fed-batch fermentation processes, Journal of Biotechnology, 245, 34-46. Mendel J.M., 2018, Uncertain rule-based fuzzy systems: introduction and new directions, Second Edition, Springer, Cham, Switzerland, 229-234, 600-608. Mikleš J., Fikar M., 2007, Process modeling, identification, and control, Springer, Berlin/Heidelberg, Germany. Nagy K., 2007, Model based control of a yeast fermentation bioreactors using optimally designed artificial neural networks, Chemical Engineering Journal, 127, 95–109. Ross T.J., 2010, Fuzzy logic with engineering applications, 3rd edition, John Wiley & Sons, Singapore. Sagüés C., García-Bacaicoa P., Serrano S., 2007, Automatic control of biomass gasifiers using fuzzy inference systems, Bioresource Technology, 98, 845–855. Shen-Huii D., Gang Z., Mei-Rong H., 2011, Research on regulator signal segment match to control valve in split range control system. In: Proceedings of the 2011 International Conference on Consumer Electronics, Communications and Networks (CECNet), 5, 4350–4353. Silva F.V., Schmitz J.E., Neves Filho L.C., Fileti A.M.F., Silveira Junior V., 2012, Saving energy using fuzzy control applied to a chiller: an experimental study, Clean Technologies and Environmental Policy, 14, 535– 542. Tai K., El-Sayed A.-R., Biglarbegian M., Gonzalez C.I., Castillo O., Mahmud S., 2016, Review of recent type-2 fuzzy controller applications, Algorithms, 9, 39. Vasičkaninová A., Bakošová M., 2015, Control of a heat exchanger using neural network predictive controller combined with an auxiliary fuzzy controller, Applied Thermal Engineering, 89, 1046-1053. Wakabayashi, C., Embiruçu, M., Fontes, C., Kalid, R., 2009, Fuzzy control of a nylon polymerization semi-batch reactor, Fuzzy Sets and Systems, 160, 537–553. Wu D., Mendel J.M, 2009, Enhanced Karnik-Mendel algorithms, IEEE Transactions on Fuzzy Systems, 17, 923– 934. Zadeh L., 1965, Fuzzy sets, Information and control, 8, 338-353. Zadeh L., 2015, Fuzzy logic: a personal perspective, Fuzzy Sets and Systems, 281, 4-20. 90 https://www.sciencedirect.com/science/article/pii/S0168165617300251 https://www.sciencedirect.com/science/article/pii/S0168165617300251