#### Abstract

The vanadium redox flow battery (VRB) is a nonlinear system with unknown dynamics and disturbances. The flowrate of the electrolyte is an important control mechanism in the operation of a VRB system. Too low or too high flowrate is unfavorable for the safety and performance of VRB. This paper presents a neural network predictive control scheme to enhance the overall performance of the battery. A radial basis function (RBF) network is employed to approximate the dynamics of the VRB system. The genetic algorithm (GA) is used to obtain the optimum initial values of the RBF network parameters. The gradient descent algorithm is used to optimize the objective function of the predictive controller. Compared with the constant flowrate, the simulation results show that the flowrate optimized by neural network predictive controller can increase the power delivered by the battery during the discharge and decrease the power consumed during the charge.

#### 1. Introduction

Because of the energy crisis, utilization of renewable energy sources such as wind and solar energy for electric power supply has received more and more attention in recent years. However, the intermittent nature of most renewable energy makes it highly dependent on reliable and economical energy storage systems. All-vanadium redox flow battery (VRB) is a promising candidate for the storage of renewable energy. Compared with other redox batteries such as zinc bromine battery and lead acid battery, VRB has many attractive features, including long cycle life, high energy conversion efficiency, flexible design, and low cost [1]. Moreover, the problem of electrolytes cross-contamination is avoided by using the same element in both half cells. The potential applications of VRB include load leveling, uninterruptible power supply (UPS), and renewable energy storage [2]. Thus, it has good application and development prospects.

The flowrate of the electrolyte is an important control mechanism in the operation of a vanadium redox flow battery system. At low flowrates, the electrolyte is provided insufficiently for the chemical reaction and stagnant regions can form in the electrode. The higher electrolyte flowrate will increase the VRB performance. But on the other hand, if the flowrate is too high, there is a risk of leakage, and the pump consumption will increase, which will reduce the system efficiency [3, 4]. In order to enhance system efficiency, the optimal electrolyte flow rate should be determined.

Until recently, most researches are focused on the key materials of VRB, and there is little information available in the literature about the optimization of the electrolyte flowrate. An optimal strategy of electrolyte flowrate is proposed in [3] to improve the system efficiency and keep the high capacity simultaneously. At the beginning of the charge/discharge process, VRB operates at the lower flowrate, and then increases to higher flowrate when the voltage increases/decrease to certain value. Energy efficiency, system efficiency, and capacity at different operating modes are compared and the optimal electrolyte flowrate is determined. A multiphysics model of the VRB is proposed in [5]. The battery power is represented during the charge/discharge as a function of flow rate, states of charge (SOC), and the stack current. The optimal flow rates are obtained by maximizing the power delivered during the discharge and minimizing the power consumed during the charge. However, these optimal strategies suffer from a serious drawback in the form of deterioration in the performance when the system is operated under wide range operating conditions or subjected to disturbance. To overcome these drawbacks, controllers based on robust control techniques must have been used.

Model predictive control (MPC) is an application of optimal control theory. In model predictive control, process model is utilized to predict the future response of a plant. An optimal control sequence is determined by solving a finite horizon optimization problem online at each sampling instant and the first control in this sequence is applied to the plant [6]. Because of its ability to handle the multivariable/nonlinear nature of the dynamics, constraints, and optimality in an integrated fashion [7], MPC technology can now be found in a wide variety of application areas including chemicals, food processing, automotive, and aerospace applications [8]. The performance of model predictive controller relies upon the accuracy of the model on which it is based. However, the VRB suffers aging, reactant crossover, and load disturbance that cause no well-known effects on the system dynamics; it is difficult to establish accurate mathematical model. Moreover, the mathematical model is too complex for online optimization, and a simpler model is therefore required. An attractive approach to tackle these problems is to use neural networks as nonlinear models of the dynamic behavior of the process [9]. This is because multilayer networks have a capability to learn and uniformly approximate nonlinear functions to a prospected accuracy [10].

In this paper, a nonlinear model predictive control scheme is proposed to maximize the power delivered by the battery during the discharge and minimize the power consumed during the charge.

#### 2. VRB System Process Description

The VRB system consisted of two key elements: the cell stack, where electrochemical reaction occurred and the tanks of electrolytes, where energy is stored. The electrolytes were pumped from the tanks to the stack by a circulation system. A schematic diagram of a vanadium redox flow batter is given in Figure 1.

The main electrode reactions for the VRB are as follows:

A multiphysics model of a VRB system with 19 cells is introduced in [11], which is composed of the electrochemical model and the mechanical model.

##### 2.1. Electrochemical Model

The equilibrium potential of the individual cells can be approximated using the Nernst equation (assuming unit activity coefficients) as follows: where is the standard potential; is the cell temperature; is the molar concentration of species in the cells. For simplicity, they assuming that the concentration inside the cell and tank is uniform and the time delay of electrolyte flow is negligible, the concentration inside the cell and tank is given by [12] where is the concentration inside the tank, is the volume of the cell, is the volume of the tank, is the current, is the electrolyte flowrate, and is a sign factor that depends on the considered vanadium species (−1 for and ions and 1 for and ions).

The quantity in the catholyte increases by 1 M (after the migration) when 1 M of vanadium is produced. So, the concentration in the catholyte at any state of charge is where is the protons concentration when the electrolyte is completely discharged.

Assuming that each individual cell composing the stack has the same charging characteristics, the equilibrium voltage of stack can be written as follows: where is the number of cells.

The stack voltage is decreased when current flows through the stack because of several types of internal losses, such as activation, concentration, and Ohmic losses. But these internal losses are difficult to measure; here, we replace them with equivalent resistance :

So stack voltage is given by

Then the power of stack can be calculated as

##### 2.2. Mechanical Model

The circulation system pumps the electrolytes from the tanks through the stack and back in the tanks. The power consumed by pumps is expressed as follows: where is the pump efficiency, is the pressure drop in the pipes which can be obtained from the extended Bernoulli equation. The pressure drop in the stack is proportional to the flowrate : where is the hydraulic resistance obtained from FEM simulations [13].

##### 2.3. Battery Power

In practice, is provided from the external power source during the charge and from the stack during the discharge [5]. By convention, the stack current is defined as positive during the discharge and negative during the charge. Thus, the battery power is given by

#### 3. Design of Nonlinear Model Predictive Controllers

The schematic of the neural network predictive control (NNPC) system developed in this research is shown in Figure 2. The main steps of the NNPC algorithm are listed as follows.(1)Measure the input and output of the VRB system.(2)Use the previous calculated control inputs and the neural network identifier to compute the cost function.(3)Use the optimization algorithm to calculate a new control vector.(4)Repeat steps and till the desired optimal result is achieved.(5)Apply the first element of the control vector to the VRB system.(6)Update the parameters of the NN with the new training set.(7)Repeat steps for each time step.

##### 3.1. Predictive Model Based on RBF Neural Network

According to previous section, the battery power can be expressed as follows

Suppose the stack current and temperature keep constant for a certain amount of time. So, there is only one control variable: the flowrate . The following NARX model can be used to represent the VRB system: where is the battery power, is the flowrate, and is an unknown nonlinear function that needs to be identified. Radial basis function (RBF) networks having one hidden layer were proven to be universal approximator [14]. Because of the advantages of easy design and good generalization, a RBF network is used to identify the nonlinear function in this paper. The structure of the RBF network is shown in Figure 3.

A Gaussian function is used as the activation function. So at the hidden layer, the output of RBF unit is where is the input of RBF network. and are the center and width of the th unit, respectively.

The network output is calculated by where is the weight value on the connection between RBF unit and network output. The one-step ahead prediction is given by

The -step ahead prediction of the system’s output is calculated by feeding back the model outputs (instead of the future system's outputs which do not exist) to the input nodes of the network [15].

Consider the following:

The computational burden of the optimization problem showed in next subsection increases with the complexity of RBF network structure. In order to simplify the RBF network structure and simultaneously ensure the approximation accuracy, in this study, genetic algorithm (GA) is adopted to obtain the optimum initial values of the RBF network parameters before training the RBF network. These parameters include the output weights, the centers, and widths of the hidden unit.

##### 3.2. The Objective Function Optimization Algorithm

There are different forms of the objective function under different control requirements. In this study, our purpose is to maximize the power delivered by the battery during the discharge and minimize the power consumed during the charge while ensuring the control signal is smooth. Noticing that the battery power is positive during the discharge and negative during the charge, the objective function is given as follows: subject to constraints where , is weight coefficient, and and are the predictive horizon and control horizon, respectively. The vector of the control variables is obtained from the minimization of the objective function over the specified horizon. The control vector is available only within the control horizon and maintains constant afterward, that is, for . Only the first element of the optimized control sequence is implemented on the process.

Since the function is nonlinear, an analytical solution of the objective function is not possible. Stochastic optimization algorithms such as genetic algorithm and simulated annealing suffer from the drawback of slow convergence, which make them not suitable for online control. Since the objective function surface is simple, the gradient based method is an appropriate choice. Based on the gradient based method, for a given iterative step , the control vector can be calculated as follows: where is the learning rate and is referred to as the additional momentum term. The initial value of in the iteration at each sampling period is defined as

Constraints on control sequence can be handled as follows: when any one of the reaches its limit, this control input is then set to be equal to its limit [16].

The derivative of the objective function at time , can be written as follows:

The partial derivative can be calculated by the chain rule:

where , , is the input vector at time : where represents the network input vector of and . can be given by

#### 4. Simulation

To investigate the performance of the proposed controller, a 19 cells, 2.5 kW, 6 kWh VRB is simulated. Its main characteristics are listed in Table 1 [5].

##### 4.1. Identification

In order to reduce the online computing time, the RBF network was trained offline before being applied to online control. The multiphysics model developed in Section 2 was used for train data generation. An input-output data set to train the RBF network was obtained by randomly changing the manipulated variable, , within the range of 0.05–0.7 and normalized between −1 and +1. The sampling time is set as 5 s. 1026 samples were used for the training, while 513 samples were used for validation. The initial values of the RBF network parameters were optimized by GA. After the optimum initial values were obtained, the Levenberg-Marquardt algorithm was used as training algorithm to adjust the network parameters. Root mean square error (RMSE) was employed to evaluate the accuracy of RBF network model. The training was terminated after 500 iterations; the obtained value of RMSE is 1.6591. Figure 4 shows the validation results. From the results of Figure 4, it can be observed that the RBF network can accurately represent the VRB dynamics.

The RBF network trained offline works well when there are no disturbances. However, it can not accurately represent the VRB dynamics when VRB system is subjected to uncertainty. So, the RBF network requires to train online to adapt with the change in the process. Newest 100 samples were used for training.

##### 4.2. Control Results

Normally, in a charge-discharge cycle, the battery is charged at constant current, the battery SoC increases from 2.5% (discharged) to 97.5%, and then it is discharged at constant current until it reached its initial SoC [11]. The predictive horizon and the control horizons for NMPC are chosen as 4 and 1, respectively. The parameter is set to 10000. The lower limit and upper limit of flowrate are 0.05 L/s and 2 L/s, respectively. In normal working condition, the battery is charged/discharged at constant current. Assuming at s, a disturbance on generator speed causes the charge current to change from 100 A to 95 A, and at s, a load disturbance causes the discharge current to change from 100 A to 110 A. Figure 5 shows the battery power during a charge-discharge cycle when influenced by a series of step changes in stack current. The corresponding optimal flowrate that is shown in Figures 6 and 7 shows the comparison of battery power during a charge-discharge cycle at different flowrate. Compared with the battery power at , the average power consumed during the charge at optimal flowrate decreased by 10.80 W, and the average power delivered by the battery during the discharge increased by 10.62 W.

#### 5. Conclusions

The electrolyte flowrate of VRB system was optimized online using model predictive control based on artificial neural networks. An RBF network is built to predict the future battery power. In order to reduce the computational burden of the optimization problem, the hidden layer nodes were chosen as 5. The RBF network model was found to be valid for wide flowrate variation with random load disturbances. The gradient descent algorithm method is used to realize the optimization procedure. Simulation result at different flowrate indicates that the proposed controller can enhance the output power of battery during the discharge and reduce the operating cost during the charge. Future works will focus on control strategy for VRB and wind farm combined system.