DESIGNING A PID CONTROLLER TO CONTROL A FUEL CELL VOLTAGE USING THE IMPERIALIST COMPETITIVE ALGORITHM

In this article, an optimized PID controller for a fuel cell is introduced. It should be noted that we did not compute the PID controller’s coefficients based on trialand-error method; instead, imperialist competitive algorithms have been considered. At first, the problem will be formulated as an optimization problem and solved by the mentioned algorithm, and optimized results will be obtained for PID coefficients. Then one of the important kinds of fuel cells, called proton exchange membrane fuel cell, is introduced. In order to control the voltage of this fuel cell during the changes in the charges, an optimal controller is introduced, based on the imperialist competitive algorithm. In order to apply this algorithm, the problem is written as an optimization problem which includes objectives and constraints. To achieve the most desirable controller, this algorithm is used for problem solving. Simulations confirm the better performance of proposed PID controller.


INTRODUCTION
The growing reduction in the fossil fuel resources and human's energy supply necessity leads to substitute new sources of energy such as fuel cell. Fuel cells have advantages of high performance, flexibility, light weight and portability, and can be consistent with the environment. Thus, energy producing by this kind of facilities is a considerable achievement in this regard by minimum cost of investment and exploitation of these resources. The proton exchanges membrane (PEM) fuel cell is a non-emission energy conversion device which uses a proton exchange membrane as the electrolyte. This fuel cell contains a cathode, an anode and a proton conductor and cathode. The hydrogen gas extracted from metha-nol reaches the end of the anode plate (negative electrode), while oxygen or air goes to the end of the positive electrode (cathode). In the other words, the fuel cell contains oxidized hydrogen at the anode as well as reduced oxygen on the cathode. Protons flow through the polymer electrolyte membrane from anode to cathode, and similarly; electrons go to the cathode through an external path. In the cathode, oxygen is combined with protons and electrons, which result in water formation and heat generation. Both anode and cathode contain a catalyst (usually platinum) to increase the rate of chemical reactions. In figure  1, a simplified diagram of the fuel cell is shown.
In order to produce electrical energy from the fuel cell, it is necessary that the output voltage remains constant for various charges. It guarantees achieving high-quality power. However, the output voltage of the fuel cell changes due to different charges. Employing a controller is necessary to fix the output voltage. The simplest controller that can be used is the PID controller. There are many studies within the context of technical and parametric examinations of the proton exchange membrane fuel cell. In [2], a PEM fuel cell at low voltage was modeled for hybrid applications. [4] explained the general facts about the fuel cell. In [7], controlling the output voltage of a PEM fuel cell using metal refrigerating algorithm was done. And in [8], a dynamic model of the fuel cell has been studied. In this work, a simple PID controller for the fuel cell has been used, with the difference that the coefficients of this controller are calculated using the imperialist competitive algorithm, rather than trial and error method. At first, the problem is formulated as an optimization problem and will be optimized based on an imperialist competitive algorithm to calculate the optimum result of the PID controller. This system was simulated in simulink environment of MAT-LAB software.

IMPERIALIST COMPETITIVE ALGORITHM (ICA)
Imperialist competitive algorithm is a new algorithm for complementary calculations, which is based on the socio-political evolution of mankind. Similar to the evolutionary algorithms, this algorithm begins with some initial random population, called countries. A number of the best members are selected as colonizers and the rests are considered as colonies. In optimization problems by considering the function f(x), argument x must be found so that the corresponding cost is optimal (usually minimum). In an N-dimensional optimization problem, each country is an 1*N var array. This array is defined as follows: The corresponding cost of each country is computed by evaluating function f for variables (p 1 , p 2 , p 3 , ... , p Nvar ). Thus we have: In the beginning of ICA algorithm, Ncountry initial countries are madeand Nimp countries among the best members (the countries with the minimum cost function) of this population are selected as colonizers. The remained Ncol countries are colonies, each of which belongs to an empire. The colonizer countries attract colonies by employing attraction (assimilation) policies in line with various optimization purposes. The colonizers attract the colonies proportional to their power according to the equation (3). The overall power of imperial is calculated based on the power of its both parts; the colonizer power in addition to percentage of the average power of all its colonies. (3) The colony moves x units under the direction of the connecting line between the colony and colonizer countries and is drawn to a new position. In figure (2), the distance between the colony and colonizer countries is defined by d, and x is a random number with uniform distribution (or any other suitable distribution). Thus we have: where β is a number greater than one and near to 2. An appropriate value may be equal to 2. Moreover, the angle of movement is considered as a uniform distribution as follows: In the imperialist competitive algorithm (ICA) with a possible deviation, the colony proceeds in the colonizer absorption. The deflection angle is shown with randomly chosen and uniformly distributed function θ. During colonies movement to the colonizer countries, there may be some of the colonies that they obtain a better position than their colonizers. In this case, the colonizers will be substituted with the colonies and swapped with. To model this competition, the probability of colonies taking over by imperial regarding the whole cost is calculated as follows:

N.T.C. n =max i {T.C. i }-T.C. n (6)
Which and are the total cost of nth imperial and the normalized total cost, respectively. The probability of taking over a colony by imperial is calculated as follows: The corresponding flowchart of the imperial competitive algorithm has been shown in Figure 2.

Dynamic model of the fuel cell
In order to study the dynamic model of the fuel cell, a general schematic structure and its performance should be examined first. This schematic structure has been illustrated in Figure 3. In this way, the mass of anode and cathode are only intended as compact anode and cathode. The output voltage across the fuel cell is calculated by subtracting voltage drops from the returning voltage.
Equation (8) displays the procedure of calculation of the fuel cell output voltage. (8) where Vs is the output voltage of the fuel cell in volts, n the number of cells of the fuel cell, Vact the voltage drop caused by anode and cathode in volts, Vohmic the voltage drop importance in volts, and Vohmicis the certain amount of voltage drop as a result of resistance owed to transferring electrons and protons in the electrolyte between anode and cathode.Vconis generated with regard to the convection of mass of oxygen and hydrogen gases. Furthermore, Ereversable is calculated as follows: (9) where T is the fuel cell temperature in Kelvin, PO 2 and PH 2 are the effective partial pressures of oxygen and hydrogen gases respectively. The effective partial pressures of oxygen and hydrogen are calculated as follows:

V s =n(E reversable -V act -V ohmic -V con
where P a and P c respectively are the inlet pressures of anode and cathode in terms of atmosphere, A the electrode effective area square centimeters, i the current of the fuel cell, and are the Fig. 2. Imperialist competitive algorithm Flowchart amount of water vapor saturation pressure which is dependent on fuel cell. is the partial pressure of hydrogen gas which calculated as follows:

USE ICA ALGORITHM TO ADJUST CONTROLLER PARAMETERS
Despite the development and application of controllers in the control systems, simple controllers are still considered desirable controllers. In most cases, the PID controllers are main compensators, which can be easily de-ployed in analog and digital systems. In this study, PID controller is used to control the fuel cell voltage. The controller general schematic is in Figure 4.
The controller parameters must be optimized include . It is obvious that the load changes of the transient system depend on the controller system coefficients. Controller design methods are not able to implement since the system is a fully nonlinear system, so these methods do not have good performance in the system.
In order to design the controller system based upon the imperialist competitive algorithm for this system, regarding the curve of load changes, we consider the worst conditions and design the system for these conditions. Figure 5 shows the worst case considered as the system. The issue must be written as an optimization problem and solved. Select as function constitutes an important part to the optimization problem, because the choice of different objective functions may completely alter the particles changes. We used the error function for the optimization problem: (13) where tsim is simulation time that objective is calculated from this time. Note that the more value of objective function the more optimized solution. The optimization problem is optimized under a number of constraints which in this case are as follows: where: In this optimization problem number of particles, the particles dimension, and the number of repetitions are respectively specified as 80, 3, and 50.The optimization results are determined as follows: The proposed controller can well control the output voltage across the fuel cell. This can be evidenced by time-domain simulation of the system for the MATLAB software by different constant load cases.

PEM FUEL CELL VOLTAGE CONTROL AGAINST LOAD CHANGES (IST)
By examining the dynamics of fuel cell is known that the fuel cell output voltage intensively varies with output load changes. Consequently, it is clear that the output voltage must be controlled. The output voltage can be controlled by various controllers. The simplest type is the classic PID controller. In this section, for different variation of the load, the output voltage is controlled using a classic PID controller which its coefficients are as equation (16). Also figure (6) shows anode and cathode pressures, load, output voltage, and the reference voltage. In figure (7) the output voltage has been shown more obvious. According to the figure the controlled voltage overshoots in the area of radical changes of load. In figure (8) the output voltage error (difference between the output voltage and the reference voltage) has shown the maximum value of almost 75 V.