A Neural Networks based Predictive Voltage-Tracking Controller Design for Proton Exchange Membrane Fuel Cell Model

In this work, a new development of predictive voltage-tracking control algorithm for Proton Exchange Membrane Fuel Cell (PEMFCs) model, using a neural network technique based online auto-tuning intelligent algorithm was proposed. The aim of proposed robust feedback nonlinear neural predictive voltage controller is to find precisely and quickly the optimal hydrogen partial pressure action to control the stack terminal voltage of the (PEMFC) model for N-step ahead prediction. The Chaotic Particle Swarm Optimization (CPSO) implemented as a stable and robust on-line auto-tune algorithm to find the optimal weights for the proposed predictive neural network controller to improve system performance in terms of fast-tracking desired voltage and less energy consumption through investigating and comparing under random current variations with the minimum number of fitness evaluation less than 20 iterations.


NONLINEAR MODEL OF PROTON EXCHANGE MEMBRANE FUEL CELLS
In general, PEM fuel cells use a solid polymer as an electrolyte and porous carbon electrodes containing a platinum or platinum alloy catalyst as shown in Fig. 1  The chemical reaction at anode is: 2 2 → 4 + + 4 − (1) Electrons pass through the external electrical circuit to generate electric signal. In cathode side, the electrons and protons react with oxygen from air to produce water and heat as result of reaction Benchouia, et al., 2015, Beirami, et al., 2015, and Derbeli, et al., 2017 The chemical reaction at cathode is: 4 − + 4 + + 2 → 2 2 (2) Water produced must be thrown out to keep system from flooding and rendering inoperative passive. Output power produced from single-cell is (1 volt), so to get the desired power must connect cells in either parallel or series to convert names to stack fuel cell. The temperature work of this kind of fuel cells around ( (5) Where: Vcell: represents the output voltage of the fuel cell. EN: represents thermodynamic potential. Vact: is the voltage drop due to the activation of the anode and cathode. Vcon: is the concentration overvoltage. Vohm: represents voltage descent resulting from the impedance of the conduction of protons through the electrolyte and of the electrons through its track. Physical parameters and the characteristic of the PEMFC are taken from Correa, et al., 2003 as shown in Table 1. = 1.229 − 0.85 * 10 −3 * ( − 298) + 4.3085 * 10 −5 * * (( 2 ) + 0.5 * ln( 2 )) (6) Where: 2 : is the hydrogen partial pressure.
2 : is the oxygen partial pressure. Activation loss is the voltage drop due to the energized between the anode and cathode, Correa, et al., 2003.
To determine this type of loss, Eq. (7) can be used: = 1 + 2 * + 3 * * ln( 2 ) + 4 * * ln ( ) (7) where I: is the load current. CO2: is the dissolved oxygen concentration in the surface of cathode om /cm 3 . By using Henry law CO2 as Eq. (8) Where, Rm: is the equivalent resistance of electron flow. Rc: is the constant value of proton resistance.   Fig. 2 explains the general form of the predictive neural controller for the PEMFC. The proposed predictive neural controller contains three sections: the first section is the on-line neural network identifier. The second section is the numerical feedforward controller. The third section is the feedback controller with optimizer algorithm. In the next sections, each section of the proposed controller will be illustrated in detail.

Figure 2.
The general structure of the proposed predictive neural controller.

The On-Line Neural Networks Identifier
The modeling and system identification is the main task of the structure for the proposed controller because it is a require-ding for analysis and controller designing, Al-Araji, et al., 2011. The structure of neural identifier algorithm consists of five stages as shown in Fig. 3 Al-Araji, et al., 2011. Based on the description of the PEMFC system operational there are three outputs of PEMFC system, the first is the Fuel-Cell stack output voltage (VFC); the second is the temperature (T) variable of the Fuel Cell system operational and the third is the load current (IL) variation. As well as, there are two inputs of the PEMFC system which controlled the operation of the Fuel Cell, the first one is the hydrogen partial pressure ( 2 ) controlled effort and the second is the oxygen partial pressure (   (16) where F [-]:denotes to the relationship function between the past values of input-output of the fuel cell system. Fig. 4, the proposed dynamic model of MLP neural network (NN) identifier of the PEMFC system is represented in Eq. (17). (17) here VFCm: is the neural Fuel-Cell stack output voltage. Fm [-]: denotes the nonlinear relationship function between the past values of input-output of the neural fuel cell system. The nonlinear relationship of the NN identifier model [-] is the (MLP) model, which means multi-layer perceptron as shown in Fig. 4, where it consists of three layers: The input or buffer layer; the hidden or nonlinear activation layer and the output layer. So neural network identifier    [-] output layer. To explain these calculations, consider the general a th neuron in the hidden layer. The inputs to this neuron consist of an n th dimensional vector X , where n th is the number of the input nodes and a bias whose value proposed equal to -0.1, Al-Araji, et al., Nells, 2001. All the inputs have a weight Van linked with it. The first determination within the neuron consists of calculating the weighted sum neta of the inputs as, Al-Araji, 2015 and Nells, 2001.

As explained in
Next, the output of the neuron ha is determined as the continuous sigmoid function of the neta as: After the outputs of the hidden layer are calculated, they are passed into the output layer. In the output layer, a single linear neuron is used to calculate the weighted sum (netob) of its inputs (the output of the hidden layer as in Eq. (21)), Al-Araji, et al., Nells, 2001.
Where: Ah: called nodes, which mean the number of the hidden neuro, and Wba is the weight between the hidden neuron ha and the output neuron. The single linear neuron then passes the sum (netob) through a linear function of slope 1 or another slope used to scale the output as Eq. (22): where P: represented the number of training points in the training set. eVm(k+1): denotes prediction model error at each iteration among the true voltage output of the PEMFC and the neural model voltage output. : The actual output voltage of the fuel cell of each iteration. : represent model output voltage of the neural network of every iteration. Fig. 5 shows the architecture of a series-parallel identification model based on feedforward MLP neural networks, which is so simple that at each instant of time, the past inputs and the past outputs of the Fuel-Cell system are fed into the neural networks then the network's output yields the prediction error as in Eq. (25). In the model, the inputs of the neural networks model are the output of the actual PEMFC, so this scheme can be used only in conjunction with the system. In this paper, the Particle Swarm Optimization (PSO) as one of the modern stochastic search and an intelligent algorithm is used to learn the identifier neural PEMFC model. PSO is famous by its simple concept, easy implementation, and quick convergence Salim, et al., 2013, Isa and Rahim, 2013 and Al-Araji, 2015 and the goal of it is to find and tune the best weights neural network to show the effectiveness in terms of number of iterations for evaluating the objective cost function and the minimum value obtained for the mean square error cost function as in Eq. (24). The first step in the PSO algorithm randomly generated particles as initial particles (population of individuals). Each particle is led by the internal interaction in order to get the optimal or near-optimal solution by minimizing the objective cost function by flying through the search space. 33 In general, to show the movement of particle , , depends on its velocity, V , which is adjusted at each time step by using the Global best position, Gbest, and the Local best position, Lbest, which have been already found. The particle's velocity update represents as Eq. (25)  ( (26) where 1 and 2: are cognitive coefficients. r1 and r2: are two uniform random numbers. To modify the operation of PSO algorithm in terms of a random operator in searching and to avoid and solve the global optimization problems with a large number of local minima. The chaotic technique descent because it has been exploited in some metaheuristic methods, which makes it generally exhibits better numerical performance, Dagher, 2018. Therefore, the proposed algorithm is Chaotic Particle Swarm Optimization CPSO algorithm because it has the ability to improve the global searches and reach to an optimal solution with minimum number of iterations that depend on probabilities of the chaotic techniques, Dagher, 2018 than stochastic techniques. To enhance the capability of PSO in the global searching, it has to put the new inertia weighting in the velocity update equation, and it becomes as follows: The new inertia weighting in the velocity update Eq. (27) can be calculated by using two steps as follows: The first step is described the logistic equation employed for constructing chaotic PSO as in Eq.

]
(29) = ( + 1) (30) After applying the training mechanism of the neural network, as shown in Fig. 5 by using CPSO intelligent algorithm for reducing the model error between the actual output voltage ( + 1) and neural network model output voltage ( + 1) and is equal to zero approximately then the neural network identifier model will complete the same actual output response.

The Numerical Feedforward Controller Design
The numerical feedforward controller (NFFC) is very important in the build of proposed predictive neural controller, because of its requisite to keep the steady-state sequence voltage error to zero value, which means that the working of the (NFFC) ) ( 2 k PH FF  is to put the output voltage of the PEMFC as the desired input voltage in steady state. Hence, NFFC is assumed to calculate the inverse dynamic of PEMFC system, and so it is called inverse feedforward controller (IFC). To achieve the controller, there are several equations must be numerically calculated as follows: where des V : is the desired input voltage.

2
: is the feedforward control action of the hydrogen partial pressure.

The Feedback Controller Design
The feedback controller is also necessary to stabilize the tracking voltage error of the Fuel Cell System when the output voltage of the PEMFC system is driftage from the required input voltage. Feedback controller consists of an on-line neural identifier and an optimization algorithm. The main goal of the feedback controller design is to find the feedback control action that minimizes the accumulative error between the desired voltage and output voltage of the PEMFC system as well as a weighted sum of the hydrogen partial pressure ( 2 ) control signal. This can be achieved by minimizing the following multi-objective performance index as in Eq. (34) Camacho and Bordons, 1999.
is the reference control action of the hydrogen partial pressure and it is equivalent to : is the total control signal of the hydrogen partial pressure.
This multi-objective cost function will not only force the output voltage to sequence the desired input voltage by minimizing the accumulative voltage error for N steps ahead but also compelling the control action of the hydrogen partial pressure in the transient period to be as close as potential to the reference control signal of the hydrogen partial pressure. Also, J depends on (R and Q) which are positive weighting coefficients, hence a control action of hydrogen partial pressure found will be optimal with respect to the given set of values of the weighting 35 factors Q and R. The choice of (Q & R) is done with engineering judgment and is often performed iteratively by observing the system response in the light of design specification such as overshoot and rise time Ziogou et al., 2018, Camacho and Bordons, 1999. The on-line identifier neural networks of the PEMFC system is to be used to obtain the predicted values of the output voltage of the system for N steps ahead instead of running the system itself N steps. These values are needed to calculate the feedback control action by the optimization algorithm such that the multi-objective performance index J will be minimized. Also, on-line identification is required to make VFCm(k) the output voltage of the identifier as close as possible to the PEMFC output VFC(k). A feedforward neural network is used as an identifier, and two stages of learning of this neural network will be performed: the off-line identification is considered as first stage, and an on-line modification of the weights of the obtained identifier to keep track of any possible variation of the PEMFC system parameters is considered as the second stage. Therefore it can be said In this work a one hidden layer feedforward neural network is used for the identifier, hence where the activation function of the hidden layer is being a sigmoidal function but the output layer is a linear function. CPSO algorithm is used to set the weights of the neural networks for learning the dynamics of the PEMFC, and a simple gradient descent rule is used. After the identifier learns the dynamics of the PEMFC system then the whole structure of the controller as shown in Fig. 2 will be implemented.

One step ahead control action prediction
The feedback control signal of the hydrogen partial pressure ) 1 ( 2   k PH FB will be getting for one-step-ahead that is where N is equal to one.
By using the chain rule of differentiation, we will obtain the following: Hence, the equation (45) becomes as follows For the one hidden layer and one output layer of the on-line neural network identifier as be seen in Fig. (4) we will obtain the following: For linear activation function in the output layer as 1 ) where the Van's are the weights of the PH2(k) only. Hence, is calculated for each specimen. Since, neural network identifier model as given by Eq. (17) represents the PEMFC model to be control approximately, were used to predict future values of the model output voltage for the future N steps, which used to detect the optimal value of FB PH  2 using an optimization algorithm. For this purpose, let N be a pre-specified positive integer and denote: As the predicted outputs voltage of the identifier model of PEMFC system using the neural networks model in equation (17), then defined the following error voltage vector: Defining the feedback control signals FB PH  2 to be determined as follows: (60) Moreover, assuming the following multi-objective cost function: Then our purpose is finding FB H P   2 such as JN represents the minimized by using the gradient descent rule, so that the new control action will be given by following: It can be noted that each part in the above matrix could be found by differentiating the Eq. (17) with respect to each part in Eq. (60) as a result, it can be obtained that: where P is the input pattern to the identifier neural networks.

P=[PH2(t), PH2 (t-1),…, PH2 (t-n+1),VFC(t), VFC(t-1),…, VFC (t-n+1)]
Eq. (65) represents the Jacobian matrix, which calculated by using Eq. (66) each time a new control signal PH2 has to be determined. This could result in a large computation to large N. Therefore, a recursive method for calculating the Jacobian matrix is developing in the following, so the algorithm can be applied to real-time systems. After finishing the proceeding from n=1 to N and from j=1 to N the new control action PH2 for the next sample will be is last value of the feedback-controlling signal can be determined by using the optimization algorithm that N-step ahead of control signal is calculated. This is calculated at every sample time k so PH2(k+1) is applied to that PEMFC system and the neural network identifier model at the next sampling time. Later, these steps were applied at the 38 next sampling time (k+1) until the voltage error between the required input voltage and the actual output voltage becomes less than a specified value. After each sampling time the weights of the on-line neural network identifier model are updated to minimize the model error between the actual PEMFC model and identifier model by using CPSO Algorithm.

NUMERICAL SIMULATION RESULTS
The suggested form of the predictive neural controller as explained in Fig. 2 is carried out by using MATLAB m.file (2018) package. The first stage in the controller design is necessary to study and analyze the dynamic characteristics of the PEMFC system that it has the physical parameters, as shown in Table 1. The first study, is to show the polarization curve of the output voltage and the stack output power of the Fuel Cell in normal operation state during the load current is variable 0 A to 30 A while the hydrogen partial pressure is constant value at 1.0 bar, the oxygen partial pressure is constant value at 0.2 bar and the temperature of the operation is constant at 25C o as in Figs. (6, a and b).    8 shows the output voltage of (FC) is increasing when the hydrogen partial pressure is increasing too. Because the thermodynamic potential (EN) value of the PEMFC system as in equation (6) has been improved toward increasing that led to the improved the performance of the Fuel Cell system. The third study is to show the effect of the temperature changes from 25 C o to 80 C o on the output voltage of (FC) operation during a load current of (FC) is variable from 0 A to 30 A while the hydrogen partial pressure is constant value at 1.0 bar and the oxygen partial pressure is constant value at 0.2 bar. Figure 8. The fuel cell output voltage cell system against load current variable when the hydrogen partial pressure is changed against load current variable. Fig. 9 shows the output voltage of (FC) is increasing when the temperature is increasing too. Because the thermodynamic potential (EN) value of the PEMFC system has been improved toward increasing and reducing the impact values of the parameters on the loss voltage in the fuel cell system, which led to improved performance of the fuel cell system. But when increasing the temperature of the operation of the fuel cell will cause loss of necessary humidity for the cell membranes that lead to a negative impact on the life of the fuel cell. To establish the proposed controller design, there are three stages should be achieved as follows: The first stage is to build the neural networks identifier PEMFC model, it is used the five steps for identification algorithm, as shown in Fig. 3. The first step is to generate input-output patterns, as shown in Figs. 10, a and b in order to excite all nonlinear regions of the fuel cell system and to show the dynamical behavior of it.
Step two is using the MLP neural networks structure, as explained in Fig. 4 to appear the PEMFC model system So the proposed number of the nodes in the three layers (input layer, hidden layer, and output layer) respectively are (5, 7, 1).
Step three is using the CPSO algorithm to learn the neural network identifier model off-line algorithm; then it uses on-line algorithm to tune the identifier.
Step four the proposed 2 nd order dynamic behavior represents of the neural network identifier PEMFC model based on NARMA model as in Eq. (69).
( + 1) = [ ( ), ( − 1), ( ), 2 ( ), 2 ( − 1)] (69) The signals entering to or sent out from the neural networks have been annealed to lie within (-1 and +1) to overcome numerical problems that are involved within real values. Scaling functions have to be added at the neural networks terminals (input-output) to transform the scaled values to actual values and vice versa. Because the inputs patterns (Load Current (1 to 25) A, and Hydrogen Partial Pressure (1 to 5) bar) and output patterns (Output Voltage (20 to 30) volt) are more significant than 1, as shown in Figs. (10-a and b). After the learning cycle of the neural network identifier PEMFC model based on CPSO algorithm. The parameters of the off-line CPSO algorithm is identified as in Table 2.    Figure 11. The output voltage of the fuel cell system and neural networks identifier model for learning set. Based on CPSO algorithm, the off-line mean square error is shown in Fig. 12 that it has the minimum value of the performance index and reaching to 0.0036. The five-step is model validation and it can be achieved by using 100 new patterns as a testing pattern for the neural networks identifier PEMFC model. The responses of neural networks identifier PEMFC model followed the actual output voltage of (FC) and without the over learning problem occurred in the learning cycle for CPSO algorithm as shown in Fig. 13. Figure 13. The output voltage of the fuel cell system and neural networks identifier model for testing set.
The second stage calculates the reference hydrogen partial pressure control action based on the proposed numerical feedforward controller design as in Eq. (33) in order to keep the tracking voltage error of the fuel cell system to zero value at steady-state. The third stage is a neural feedback controller design; it can be implemented based on neural network identifier PEMFC model and multi-objective cost function. So the feedback hydrogen partial pressure control action for one-step-ahead is represented as in Eq. (43). To confirm the proposed controller design can generate the optimal hydrogen partial pressure control operation and to track the desired output voltage of PEMFC system as precisely and quickly. On-line CPSO algorithm is using to tune the weights of the neural networks identifier PEMFC model and parameters of online CPSO algorithm can be defined as in Table 3. The 125 samples that represent the five different step-change desired outputs voltages of the PEMFC system with five cases of variable load current are carried out as shown in Fig. 14.   Fig 15. shows that, for one-step-ahead prediction, the actual output voltage of the PEMFC system is suitable tracking the desired output voltage for the five different step-change without oscillation in the output, the steady-state error is not equal to zero value, and it has overshoot in the start sample because of the initial output voltage of the PEMFC system. While for ten step-ahead predictions, the actual output voltage of the PEMFC system is excellent tracking the desired output voltage for the five different step-change without oscillation in the output. The steady-state error is equal to zero value, and no overshoot in the start sample because of the controller design with optimization algorithm could process the difference voltage between the initial output voltage of the PEMFC system and the desired output voltage. Fig. 16. shows that, the response of the hydrogen partial pressure control action for one-stepahead prediction of the proposed neural predictive controller. It has not smooth control action of the partial pressure to track the desired output voltage, and it tries to minimize the steady-state error to the zero value. While for ten step-ahead predictions, the optimal response of the hydrogen partial pressure control action has smooth control action to track the desired output voltage and it approximates to minimize the steady-state error to the zero value when we are taken the (Q and R) parameters are equal to (10 and 1) respectively. Figure 14. The desired output voltage and load current for the fuel cell system. Figure 15. The actual output voltage of the fuel cell for one-step ahead and ten-step ahead prediction.
To analyze the effectiveness of the two parameters (Q and R) in the controller design, Fig. 17 shows the 3-D response of the values of the on-line multi-objective cost function with respect to (Q and R) parameters for one-step-ahead prediction. It is clear that when increasing the value of the Q parameter (from 1 to 10) and decreasing the value of the R parameter (10 to 1), the on-line multi-objective cost function value is decreasing that depends on the Eq. (55) which is generated the step change value of the feedback control effort. The proposed controller behavior is more accurate for tracking the output voltage of the fuel cell in the transient state and in the steady-state and made the error value equal to zero approximation with a minimum value of the on-line multi-objective cost function and reducing the number of the fitness evaluation at ten-step ahead prediction, as shown in Fig. 18. Figure 16. The control effort for one-step ahead and ten-step ahead prediction.  Figure 18. The on-line performance of the multi-objectives for one-step ahead and ten-step ahead prediction.