{Optimization of electrochemical parameters in microbial fuel cell system based on Fuzzy-PID and CMAC neural network} http://dx.doi.org/10.5599/jese.636 135 J. Electrochem. Sci. Eng. 9(2) (2019) 135-142; http://dx.doi.org/10.5599/jese.636 Open Access: ISSN 1847-9286 www.jESE-online.org Original scientific paper Optimization of electrochemical parameters in microbial fuel cell system based on Fuzzy-PID and CMAC neural network Chengcai Fu1,2, Fengying Ma1, 1School of electrical engineering and automation, Qilu University of Technology, Shandong Academy of Sciences, Jinan 250353, China 2School of Mechanical Electronic & Information Engineering, China University of Mining & Technology, Beijing 100083, China Corresponding author: E-mail mafengy@163.com Received: November 13, 2018; Revised: November 29, 2018; Accepted: December 5, 2018 Abstract Due to the extensive application prospects on wastewater treatment and new energy development, microbial fuel cells (MFCs) have gained more and more attention by many scholars all over the world. The bioelectrochemical reaction in MFC system is highly complex, serious nonlinear and time-delay dynamic process, in which the optimal control of electrochemical parameters is still a considerable challenge. A new optimal control scheme for MFC system which combines proportional integral derivative (PID) controller with parameters fuzzy optional algorithm and cerebellar model articulation controller (CMAC) neural network was proposed. The simulation results demonstrate that the proposed control scheme has rapider response, better control effect and stronger anti-interference ability than Fuzzy PID controller by taking constant voltage output of MFC under the different load disturbances as example. Keywords Microbial fuel cells, electrochemical parameters, fuzzy optional algorithm, CMAC neural network Introduction Environment and energy are two major problems that influence the sustainable development of human beings [1]. Bioelectrochemistry systems (BES), especially microbial fuel cells (MFCs), are a newly arising technology that could generate electricity from organic matters, which caused widespread attention of scholars due to their potential applications in environmental purification and solving the energy problem [2]. The current research of MFCs is mainly focused in electricigens, electrode materials, stack electricity production, wastewater treatment and biosensors [3-7]. However, the energy generated http://dx.doi.org/10.5599/jese.636 http://dx.doi.org/10.5599/jese.636 http://www.jese-online.org/ mailto:mafengy@163.com J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 MICROBIAL FUEL CELL SYSTEM 136 from MFCs is unstable because of the complex impact of the system configuration and electrochemical parameters such as concentration of the solution, voltage, power, dissolved oxygen, temperature, etc. It is obvious that optimal control of electrochemical parameters plays an important role in the aspect of improving the performance of MFCs. Based on the research and development of a simple and feasible mathematical model [8], a suitable controller can be designed to maintain the desired output of MFC under different load de- mands. However, the traditional proportion integration differentiation (PID) controller can hardly control the complex process, owing to the time-varying disturbance, strong coupling, nonlinearity and strict operating conditions of MFCs [9]. With the development of Artificial Intelligence (AI) technology, the artificial neural network is used successfully in control of the complicated pro- cess [10,11]. The approximation ability of cerebellar model articulation controller (CMAC) based on high- speed local learning and generalization ability is found superior to other neural networks which are more suitable for nonlinear real-time control in complex dynamic environment [12]. This paper investigates a CMAC-PID optimal control method for two-chamber microbial fuel cell by combining CMAC and Fuzzy PID control. The nonlinear relationship between input and output can be operated by the concept and actual mapping of CMAC [12,13]. This method showed advantages not only of high precision and anti-interference of PID, but also has fast response speed and high precision control performance. In the rest of paper, a brief description of the mathematical model for two- chamber microbial fuel cell is given in the section 2, while the CMAC-PID intelligent control optimization algorithm is proposed in the section 3. In the section 4, the voltage control of MFCs under disturbance is taken as an example to prove the superiority of this method. Finally, some conclusions and predictive prospect are given at end of this paper. Dynamic model of two-chamber MFC A typical two-chamber MFC consists of an anode, cathode, proton exchange membrane and electrical circuit. In the anode chamber, organic matters (eg. acetate in wastewater) are oxidized and biodegraded by microorganisms, releasing electrons and protons. Electrons flow to cathode through an electrical circuit and react with protons and electron acceptors in the cathode chamber (Figure 1). Equations of electrochemical reactions occurring at anode and cathode are described as follows [8]: Anode: (CH2O)2 + 2H2O → 2CO2 + 8H+ + 8e- (1) Cathode: O2 + 4e- + 2H2O → 4OH- (2) The anode chamber operates under anaerobic conditions, what is one of necessary conditions for the operation of MFC. Therefore, the anodic reaction rate (r1) can be described by the Monod type-equation, which is depicted as 0 AC 1 1 a AC AC exp CαF r k η X RT K C   =   +  (3) where k10 is the rate constant of anodic reaction at standard conditions,  is the corresponding charge-transfer coefficient, F is the Faraday constant, R is the gas constant, T is the operating temperature, a is the anodic polarization overpotential, KAC is the half rate constant for acetate, while CAC and X represent acetate and biomass concentrations in the anode chamber. Chengcai Fu and Fengying Ma J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 http://dx.doi.org/10.5599/jese.636 137 Figure 1. Schematic diagram of typical two-chamber MFC system The Bulter-Volmer expression is used to characterize the electrochemical reaction at the cathode, where the cathode reaction rate (r2) is described as 0 2 2 2 O 2 2 O O 1 - exp c C( )F r k RT K C −  =   +    (4) where k20 is the rate constant of cathode reaction at standard conditions,  is cathodic charge transfer coefficient, c is cathodic polarization overpotential, while CO2 and KO2 are concentration and half velocity rate constant for dissolved oxygen, respectively. Anode and cathode chambers of the MFC can be regarded as a continuous reactor [11]. Four mass balance equations in the anode chamber are expressed as: inAC a a AC AC m 1 d V ( - ) d C Q C C A r t = − (5) 2 m 12 2 CO in a a CO CO d V ( )+2 d C Q C C A r t = − (6) 1 inH a a H H mV ( - ) 8 d dC Q C C A r t = + (7) in a a m ac 1 a dec x dX V d X X Q A Y r V K X t f  − = + −    (8) In above equations, subscript a and superscript in denote anode and flow of feed, respectively. V, Q and Am denote the volume, flow rate and membrane area, while fX, Yac and Kdec denote the reciprocal of wash-out fraction, bacterial yield and decay constant for acetate utilizers, respectively. Similarly, in the cathode compartment, three mass balance equations are represented as 2 2 2 O in C C O O m 2 d V ( - ) d C Q C C A r t = + (9) inOH C C OH OH m 2 d V ( - )-4 d C Q C C A r t = (10) inM C C M M m M d V = ( - )+ d C Q C C A N t (11) where the subscripts c stands for cathode, NM represents the flow of M+ through the proton exchange membrane, which can be calculated as follows NM = 3600icell/F (12) The charge balances at the anode and cathode are given by http://dx.doi.org/10.5599/jese.636 J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 MICROBIAL FUEL CELL SYSTEM 138 Ca(da/dt) = 3600 icell – 8Fr1 (Anode) (13) Cc(dc/dt) = 3600 icell – 4Fr2 (Cathode) (14) where icell is current density of MFC, while Ca and Cc represent the capacitance of anode and cathode, respectively. The output voltage of a single MFC is expressed by the following equation cellm cell O a c cell m aq V = - - dd V i k k   + +      (15) where Vo is the open-circuit voltage, dm, dcell, while km and kaq represent proton film thickness, electrode distance, conductivity of membrane and electrical conductivity of solution, respectively. The main parameters of MFC system are shown in Table 1. Table 1. Operating parameter values of acetate MFC model Symbol Description Value Unit F Faraday constant 96485.4 C mol-1 R Gas constant 8.3144 J mol-1 K-1 T Temperature 303 K dm Thickness of membrane 1.778e-4 m dcell Distance between anode and cathode 0.022 m km Conductivity of membrane 17 Ω-1 m-1 kaq Electrical conductivity of solution 5 Ω-1 m-1 Ca Capacitance of anode 400 F m-2 Cc Capacitance of cathode 500 F m-2 Va Volume of anode compartment 5.5e-5 m3 Vc Volume of cathode compartment 5.5e-5 m3 Am Area of membrane 5e-4 m2 Yac Bacterial yield 0.05 dimensionless Kdec Decay constant for acetate utilizers 8.33e-4 h-1 fx Reciprocal of wash-out fraction 10 dimensionless Qa Flow rate of fuel feed to anode 2.25e-5 m3 h-1 QC Flow rate feeding to cathode compartment 1.11e-3 m3 h-1 CACin Concentration of acetate in the influent of anode 1.56 mol m-3 CCO2 in Concentration of CO2 in the influent of anode 0 mol m-3 Xin Concentration of bacteria in the influent of anode 0 mol m-3 CHin Concentration of H+ in the influent of anode 0 mol.m-3 CO2 in Concentration of dissolved O2 in the influent of cathode 0.3125 mol m-3 CMin Concentration of M+ in the influent of cathode 0 mol m-3 COHin Concentration of OH− in the influent of cathode 0 mol m-3 Vo Open-circuit Voltage of MFC 0.77 V K10 Rate constant of anodic reaction at standard conditions 0.207 mol m-2 h-1 K20 Rate constant of cathode reaction at standard conditions 3.288e-5 mol m-2 h-1 KAC Half velocity rate constant for acetate 0.592 mol m-3 KO2 Half velocity rate constant for dissolved oxygen 0.04 mol m -3  Anodic charge transfer coefficients 0.051 dimensionless  Cathodic charge transfer coefficients 0.663 dimensionless Design an CMAC-PID control system A CMAC neural network controller was used as feed-forward controller to increase the response speed, while an intelligent PID controller based on fuzzy algorithm was used as feedback controller to ensure system stability and restrain disorder. The structure of CMAC-PID controller is shown in Figure 2. Chengcai Fu and Fengying Ma J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 http://dx.doi.org/10.5599/jese.636 139 Quantization Address mapping CMAC memory CMAC function calculation PID controller Learning algorithm MFC system + + + _ Vcell* Vcell Un Up U(k) e de/dt Fuzzy inference Kp Ki Kd ec Figure 2. Structure of CMAC-PID control for two-chamber MFC system Tutor learning algorithms are applied in CMAC neural network which includes input layer, middle layers and output layer [14,15]. The nonlinear mapping of input layer and adaptive mapping for weights of output layer are determined by the designer separately between adjacent layers. The basic function of middle layers is connected with the output layer by adjusting weight parameter based on gradient descent algorithm. The design of CMAC neural network mainly includes the division of input space, the realization of nonlinear mapping from input to output layer and the learning algorithm for weight of output layer [12]. Here the reference voltage Vcell* is used as an input to CMAC. At the end of each control cycle, the output Un(k) of CMAC is calculated and compared with the final control output U(k) of the system, and amends the weight to enter the learning process. The difference between input and output of CMAC is little gradually, then the total control output of the microbial fuel cell system is only generated by CMAC [13,14]. Three parameters KP, Ki, Kd of the PID controller are real-time optimized by the fuzzy control algorithm according to the tracking error e and the change in error ec to enhance the anti-disturb ability of the system [10]. The fuzzy sets for e(k), ec(k) are {NB, NM, NS, Z, PS, PM, PB}. The fuzzy domain for e(k), ec(k) are [-1,1]. The ultimate control goal of MFC is make the error between the output voltage Vcell and the given output voltage Vcell* minimum. Therefore, the control algorithm can be described as: n i i cell cell i 1 ( )= ( ) *- ( )= ( )- ( 1) C U k w e k V V ec k e k e k = = −  p p i d 0 ( )= ( )+ ( )+ ( ) k j U k K e k K e j K ec k =  (16) U(k)=Un(k)+Up(k) where i is the binary vector, c is the generalization parameter of CMAC network, wi is the weight of the i-th storage unit, Un(k) and Up(k) are the output of CMAC and PID controller, respectively, Kp = Kp0 + Kp; Ki = Ki0 + Ki; Kd = Kd0 +Kd. Adjustment indicators of CMAC are expressed as: 2 n( ( )- ( ))( ) 2 U k U k E k c = p i ( )( ) ( )=- = U kE k w k w c      (17) w(k) = w(k-1) + w(k) + (w(k) – w(k-1)) where  is the network learning rate, and the ranges from 0 to 1,  is an inertia quantity,   (0,1). Setting w = 0 at the beginning of the system, by this time, Un = 0, U = Up, and the system is only controlled by PID, and then, the control signal Up(k) from the PID controller gradually approach zero http://dx.doi.org/10.5599/jese.636 J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 MICROBIAL FUEL CELL SYSTEM 140 and the control signal Un(k) from CMAC controller is gradually closing in on the final control output signal U(k) along with incremental learning of CMAC. Simulation and results CMAC and PID concurrent control for MFC system is realized by Matlab/Simulink. As shown in Figure 3, the feed flow of the anode chamber will directly affect the output voltage of MFC system, so the optimization of the voltage could be achieved by controlling the flow of the anode feed. Time, h Figure 3. Impact of different anode feed rates on the output voltage of MFC For the control optimization algorithm proposed in Section 3, the time of sampling was t = 1 ms. Parameters of CMAC neural network are N = 100, c = 5, η = 0.1 and α = 0.5, The initial parameters of the PID controller are KP = 2.5 e-4, Ki = 4.08 e-5 and Kd = 3 e-4. The dynamic parameters of PID controller are real time optimized by a fuzzy control algorithm. We set the reference voltage to 0.5 V and switch the resistance from 500 to 400 Ω as an external disturbance within the time of 100 h. The simulation results of intelligent control based on CMAC- PID, independent Fuzzy-PID and without controller (Uncontrol) are shown in Figures 4-6 in comparison to the reference voltage. Time, h Figure 4. Simulation results of CMAC-PID intelligent control 0 50 100 150 200 250 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 Time(h) V o u t( V ) 95 100 105 110 0.46 0.48 0.5 Reference CMAC-PID V o lt a g e , V V o lt a g e , V Chengcai Fu and Fengying Ma J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 http://dx.doi.org/10.5599/jese.636 141 Time, h Figure 5. Simulation results of Fuzzy-PID control Time, h Figure 6. Simulation results without control It can be seen from simulations presented in Figures 4-6, that for CMAC-PID intelligent optimization control, the output voltage of MFC is adjusted within shorter time, with faster response speed and higher robustness than for the independent Fuzzy-PID control or uncontrolled case. Also, for this last case, it seems to be very difficult to maintain stable output and reach the reference value after long period of operation in the presence of external disturbances, as shown in Table 2. Table 2. Comparison of three control methods for MFC system Control method Rise time, h Recovery time under interference, h CMAC-PID 21.8 5.3 Fuzzy-PID 32.3 11.2 Uncontrol 64.9 -- 0 50 100 150 200 250 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 Time(h) V o u t( V ) Reference Fuzzy-PID 0 50 100 150 200 250 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 Time(h) V o u t( V ) Reference Uncontrol V o lt a g e , V V o lt a g e , V http://dx.doi.org/10.5599/jese.636 J. Electrochem. Sci. Eng. 9(2) (2019) 135-142 MICROBIAL FUEL CELL SYSTEM 142 Conclusion Optimal control strategy for electrochemical parameters of two-chamber MFC has been developed by combining Fuzzy PID and CMAC neural network, which provides an alternative to the parameter optimization for biochemical reaction process showing serious nonlinearity and hysteresis in the cell. The simulation results have validated the proposed optimal algorithm. In addition, this control strategy can be applied to the control of various parameters such as dissolved oxygen, pH, temperature and other factors that affect the performance of microbial fuel cell due to simple control rules, fast convergence speed, few calculations and strong adaptability. Acknowledgements: This work was supported by the Independent Innovation Technology Project of Ji'nan Institute (201401210), Statistical Research Project of Shandong Province in 2016 (KT16131), and The Open Fund of Key Lab Pulp and Paper Science Technology (KF201418). References [1] K. S. Chirag, B. N. Yagnik, Research Journal of Biotechnology 8 (2013) 84-90. [2] M. H. Zhou, H. Y.Wang, J. D. Hassett, T. Y. Gu, Journal of Chemical Technology & Biotechnology 88 (2013) 508-518. [3] J. M. Luo, J. Yang, H. H. He, J. Tao, Z. Li, M. Wang, M. H. Zhou, Bioresource Technology 139 (2013) 141- 148. [4] W. L.Yang, K. Y. Kim, P. E. Saikaly, B. E. Logan, Energy & Environmental Science 5 (2017) 1025-1033. [5] L. Pablo, S. Andrew, G. John, L. Ioannis, Physical Chemistry Chemical Physics Pccp 15 (2013) 2278-2281. [6] A. Gil-Carrera, A. Escapa, R. Moreno, R. Moran, Journal of Environmental Management 122 (2013) 1- 7. [7] A. Schievano, A. Colombo, M. Grattieri, S. P. Trasatti, A. Liberale, P. Tremolada, C. Pino, P. Cristiani, Journal of Power Sources 340 (2017) 80-88. [8] Y. Zeng, , Y. F.Choo, B. H. Kim, P. Wu, Journal of Power Sources 195 (2010) 79-89. [9] L. Fan, C. Li and K. Boshnakov, Pakistan Journal of Pharmaceutical Sciences 27 (2014) 685-690. [10] M. X. Yan, L. P. Fan, International Journal of Electrochemical Science 8 (2013) 3321-3332. [11] A. M. An, Y. L. Liu, H. S. Zhang, C. D. Zheng, J. Fu, Journal of Chemical Engineering 68 (2017) 1090-1098. [12] J. K. Liu,Advanced PID Control and MATLAB Simulation, Electronic Industry Press, Beijing, China,2007, p.183. [13] C. M. Lin, H. Y. Li, Nonlinear Analysis-Real World Applications 14 (2013) 206-223. [14] D. Z. Xu, N. Ji, Y. Tang, International Journal of Energy and Power 4 (2015) 92-97. [15] C. Y. Jia, X. Y. Shan, Y. C. Cui, T. Bai, F. J. Cui, Journal of Iron and Steel Research 20 (2013) 17-22. ©2019 by the authors; licensee IAPC, Zagreb, Croatia. This article is an open-access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons. org/licenses/by/4.0/) http://creativecommons.org/licenses/by/4.0/)