Design and Implementation of On-Line Self-Tuning Control for PEM Fuel Cells

*University of Glamorgan, Faculty of Advanced Technology, Pontypridd, Wales, UK CF37 1DL This paper presents the modelling and real time implementation of PEM (polymer electrolyte membrane) fuel cell flow control. Flow control presents a critical performance requirement to achieving dynamic power responses for electric vehicle motor demands. However a fuel cell’s complex structure and reactant requirements traditionally result in an unsatisfactory response to such dynamic loading instances. This in turn causes brief power losses associated with driving patterns such as acceleration and hill climbing. To improve the fuel cell’s dynamic response to such drive cycles, this paper presents new methodology for system identification and controller design. The fuel cell is modelled initially with established linear model and parameter estimation methods. The approach is then expanded to an on-line system identification LabVIEW programme to account for the non-linear and time varying characteristics. Based upon this identification process, a novel LabVIEW self-tuning PID controller is implemented in real time to control the response. The self-tuning controller continuously re-calculates the critical gain and period, and then adjusts the controller actions accordingly. Conclusions are then summarised from the results and future ongoing work is discussed briefly.


INTRODUCTION
The use of fuel cells as alternative power sources for mobile and stationary applications is steadily increasing as concerns over global oil reserves, escalating prices, and the environmental impacts of CO 2 emissions increase.The dominant fuel cell technology for the automotive market is PEM (polymer electrolyte membrane).This is due to its compact design, favourable weight and power densities, along with low operating temperatures and quick start up times.PEM's use of solid polymers also makes it favourable for ease of construction, and it exhibits good ability to respond to rapidly changing loads as experienced in automotive applications.
This ability to respond to load changes depends on precise control of several subsystems.These include the temperature, humidity and pressure subsystems, which are closely associated to achieving final steady state value for a load request.Also, the reactant flow subsystem which is closely associated to the dynamic response to load changes, which is the focus of this research publication.The ability of the fuel cell to respond to dynamic loading instances is critical to the overall driver experience and life expectancy of the fuel cell stack.If the fuel cell is unable to respond adequately to large load variations, the continued voltage and power output drops associated to current inrushes of motors, results in momentary cell stress and drying of the membrane.Continued exposure weakens a cell, resulting in a low voltage output, which in turn increases the stresses on neighbouring cells in the stack, leading to a cascade failure and loss of the system.
The complex, nonlinear dynamics of the fuel cell have been traditionally modelled using their approximated principles of electrochemistry, fluid dynamics, thermodynamics and heat transfer, in terms of the physical and material properties; along with universal constants under various assumptions and constraints.Earlier research work was focused on achieving steady state models of PEM fuel cells, describing the physical variables through Nernst equation, gas diffusion equation, and voltage drop and concentration equations.Recently there has been a noticeable increase in volume of dynamic subsystem research modelling of the transient response of PEM fuel cells.Pukrushpan et al. [1] is a noticeable contributor in this field, where he described the dynamics by a set of first order equations governing the air compressor, mass transportation and energy conservation of the reactant flows, and pressure across the anode and The World Electric Vehicle Journal, Vol 2, Issue 4 cathode.Cerola et al. [2] follows on providing more accurate partial differential equations to describe both the static and dynamic behaviours.Golbert and Lewin [3] constructed a spatial, time dependant fuel cell model covering the dynamics of water condensation on the electrodes, evaporation and generation.They also included a quasi steady state temperature profile.Pathapati et al [4] derived a dynamic model of the effects of the charge double layer capacitance and flow pressure dynamics, to allow predictions of the transient response of cell voltage temperature and gas flow rates under dynamically changing loads.
It is important to realise that no matter how complex the dynamic model, it never fully describes the fuel cell, and therefore system response, precisely in terms of system parameters.A fuel cell's inherent nonlinearities and time varying characteristics inevitably pose difficult problems for system identification and control, making either linear or more complex nonlinear models, only valid over an operating range which exhibits linearity.Such models are typically used to investigate system stability, sensitivity, observability and controllability to allow controller designs.However if investigated in real time, these parameters with varying time operating states can be more closely identified to the system response with minimal error.
Therefore, adaptive controllers can serve as a feedback law to achieve the control objectives with the time varying nonlinear properties, as well as external disturbances which is represented by factors such as loading of an electric vehicle motor.Previously referenced Pukrushpan et al. [1] implemented an observer based feedback controller to protect the stack from the previously described oxygen starvation effects during loading.This uses a linear quadratic technique based on a linearised state-space model.Other authors using such techniques to accommodate the nonlinearities include Paradkar et al. [5] who integrated a linearised PEM fuel cell model into a power plant, and simulated a load frequency controller.An optimal controller then accommodates the control application based on the disturbances.Schumacher et al. [6] deploy a fuzzy controller for the humidity management subsystem which adjusts the fan according to the requirement.Revenkar [7] highlights the requirement for further research into system models and controllers for multiple input, multiple output (MIMO) systems covering the whole operating range, a problem which is in part addressed within the proceeding sections.

FUEL CELL MODELLING
The referenced publications describe the fuel cell from its basic structure of a proton exchange membrane electrolyte, sandwiched between the anode and cathode electrodes.Each electrode then consists of a catalyst and gas diffusion layer to support the reaction which produces power and removes generated water.Figure 1 presents the structure of a PEM Fuel Cell.
In order to develop a control strategy for a fuel cell's flow, a model of the dynamic process is adopted from previous studies and described by its Nernst equation, anode and cathode gas diffusion, kinetics and proton concentration dynamics.From a system viewpoint, hydrogen is an input variable and is fed at an adjustable flow rate N H . Oxygen is also an input and can be represented by N A where a fuel cell uses the oxygen content of air.In the case of this publication, a compressed air cylinder fed via a regulated value is utilised for controllability.Voltage and Current are then considered the system outputs.Franklin et al Design and Implementation of On-Line Self-Tuning Control for PEM Fuel Cells [8] represents this as a standardised MIMO system represented by Figure 2.
From Figure 2, a standardised representation of the relationship can be formulated as shown in Figure 3, with blocks Theoretically each block can then be linearised as its own transfer function describing its relationship.For example 1

G represents the relationship between c I
and A N .However, in practice this would be impossible to determine as blocks would need to be eliminated to achieve a true representation, and the fuel cell cannot be sustained with only one reactant input.The overall stack model can be expressed as Equations ( 1) and ( 2).
(1) (2) Equations ( 1) and ( 2) will now form the basis for the proceeding system identification methodology and design of a novel self-tuning PID controller programme and its application.

Linear ARMAX Model
Since the model of the fuel cell is very complicated, this paper focuses on the relationship between the oxygen flow and the voltage of the fuel cell.So hydrogen flow , H N is constant.The following ARMAX (autoregressive moving average with exogenous input) model in Equations ( 3), ( 4) and ( 5) is considered to describe the dynamics between the oxygen flow where y denotes the system output, u represents the system input, k denotes the time instant of sampling, and r and β are the order of A and B, respectively.w represents the constant disturbance of . Finally the corresponding transfer function between outputs and inputs in discrete form can be found as Equation ( 6).
Using linear theory all system modes can be excited using the ARXMAX approach by an impulse input signal of white noise.This has a frequency content entirely of sinusoidal waves of the same amplitude and strength, and can be generated with a pseudo random binary sequence (PRBS).However, in practice such an excitation signal could cause damage to the fuel cell in real time operation.The unit would not be able to respond to a PRBS large harmonic content, so instead a square wave excitation process would be implemented.

On-Line Parameter Estimation
Expanding the ARXMAX identification methodology to include the recursive least squares algorithm (RLS), allows the identification process to predict the system output according to the past information.This allows for non-linear and time varying dynamics identification of the fuel cell.From Equations ( 3)-( 5), the estimation of ) (k y is expressed as Equation ( 7) (7) where (8) (9) After step k the new output is measured and a new set of parameters are obtained by Equations (10-12).

CONTROLLER DESIGN
Self-tuning controllers belong by their characteristics to the family of adaptive controllers.The aim of adaptive controllers is to solve control problems in cases where the characteristics of the system are unknown or time varying, as with fuel cells.The principle of adaptive control is to change the controller characteristics on the basis of the process change.Typically as with the self-tuning method utilised in this paper, the recursive identification processes is utilised.
The task of on-line adaptive control is to maintain the optimal parameters of a difficulty to control process with time varying characteristics.This presents a complex process concisely explained in the following 3 step cyclic repetition.
1.The process parameters are assumed to be known for current control loop and equal to their current estimation.
2. The control strategy is designed based on the previous assumption and controller output is calculated.
3. The following identification step is performed after obtaining new controlled process variables.The parameters of the controlled process are recalculated using RLSM in this case (other Recursive methods can of course be utilised).

Digital PID Controllers
Digital proportional integral derivative (PID) controllers remain widely accepted by industry due to their simplicity, convenience, and well known structures.Digital PID controllers use in fuel cell applications is extensively tried and accepted to give performance enhancements for an estimated model.However the non-linear and time varying characteristics of fuel cells mean the parameters are far from optimal, and require retuning over periods of operation.The adaptation of this well-known structure to a real time, self-tuning LabVIEW application is presented in proceeding sections, illustrating new methodology and material to this well understood controller.A generalised digital PID controller can therefore be derived from its continuous form given as Equation ( 13).
(13) where is the integral and d T is the derivative action.
The integral and derivative actions from Equation (13) are now discretised using the forward rectangular critical gain K PU , and ultimate period T U , using the work of Bobal et al and his book, "Digital Self Tuning Controllers" [9].An overview of a generalised selftuning PID controller structure is presented in Figure 4.
Bobal proposed the use of a discrete self-tuning method by considering a standardised single input, single output (SISO) system model in Equation ( 16). (16) where are the z-transforms of the controller and process output, respectively.d denotes the time delay as integer 0 T and A and B are the n -degree polynomials defined by Equation ( 4) and ( 5), respectively.So, let the process (17) be controlled by the proportional controller is the z-transform of the reference signal.method (FRM).In addition for on-line identification, the recursive control algorithm is incorporated to compute the actual controller value   T is the sampling period.

Design of Self-Tuning PID Control
The Ziegler-Nichols methodology has been utilised throughout industry to determine both continuous and digital PID controller parameters.Similarly as with the generalised PID structure illustrated previously, its use in research does not present new material.However the following adaptation of the Ziegler-Nichols process of obtaining the proportional, integral, and derivative values does present new material and methodology.The process utilises a real time LabVIEW programme which identifies the ultimate parameters, known as ( ) Bobal's approach was now modified to be included within a LabVIEW programme developed for such 2 nd order systems.The programme operates by automatically identifying the orders within the characteristic equation of the system in question.The LabVIEW MathScript function is then utilised to implement equations (20)-(25) for identification of the critical values K PU and T U .The identified system parameters are then passed to Design and Implementation of On-Line Self-Tuning Control for PEM Fuel Cells  3) and ( 4) the following transfer function is obtained as Equation ( 20).

(18)
where the denominator is termed as the characteristic equation for a closed loop.

(19)
Equation ( 19) can now be equated using the Unified Approach as utilised by Bobal for a 2 nd order process as Equation ( 20).

(20)
The approach presents two cases for identification of K PU and TU.
1.The critical poles lie on the real axis therefore the following equations ( 21) and ( 22) are valid for calculation of the critical values K PU and T U .

(23)
To allow K PU and T U to be calculated in both cases, equations ( 24)-(25) are required.Full details of the identification process can be obtained from Bobal's book, "Digital Self Tuning Controllers" [7].However to illustrate the steps, a diagrammatic overview is given as Figure 5.
The control actions are then adjusted each execution loop of the LabVIEW programme, continuously updating the identified model and in turn the controller parameters.A full description of the software and hardware is given in the proceeding section.

IMPLEMENTATION
System identification is performed on a single cell membrane electrode assembly (MEA).The system setup and operational parameters are monitored via the University's fuel cell test station (FCTS), designed to our research requirements.A block diagram representation of the setup is given in Figure 6 with a photographic representation given in Figure 7.
The test station consists of five subsystems.The gas delivery subsystem, stack (single cell presently) subsystem, humidification subsystem, control subsystem and load subsystem.Clearly the gas delivery subsystem delivers the reactants (gases) of hydrogen to the anode and air (oxygen) to the cathode with a nitrogen flush as an option.The stack or single cell subsystem represents the heart of the fuel cell.
The flow rate of air and hydrogen can be precisely controlled via each solenoid valve.Either cell voltage or current can be set at a specific value via the load bank to control power output.For demonstration of the fuel cell's response to a drive cycle, the following power set point changes were made (29) at 5 seconds intervals and the recorded response given as Figure 8.This illustrates the existing implemented controller strategy which controls the required flow rate based on the stoichemetric reactant flow request for a set point.An identification match of 59%, a substantial improvement over Figure 9 is achieved.However the implementation of higher order identification processes highlights the floored technique of using a linear modelling process to identify a non-linear system.

On-Line Identification
It is therefore reasonable to investigate the history  Clearly these performance issues in a real world application would present unwanted diver sensations and stressing of the fuel cell, which as previously detailed must be avoided to prolong cell life.

Off-Line Identification
The response of A N and , H N against c I and , c V is now recorded for off-line system identification purposes.
A N is varied as a square wave signal, while H N remained constant.The results are collected via a data acquisition (DAQ) card and LabVIEW program.
The data is then processed by the MATLAB system identification toolbox using ARX to calculate the coefficients of the transfer function .i G From this the identification match is shown as Figure 9 for a second order model, with the identified transfer function given as Equation ( 30). (30) The second order system obtained provides significant information to the system's dynamic properties and allows for basic simulations of controller designs.It also shows the possibility of reducing the fuel cell model complexity to a 2 input 2 output configuration.However issues with these assumptions are evident.
Firstly there is a considerable mismatch, highlighting the linear modelling approach is not suitable for non linear systems.Secondly the identified model only represents the system over the period of the exercise.Therefore does not representing the fuel cell's time varying dynamic characteristics.
To investigate the inadequacy of the second order identification, higher order model parameters were identified and compared against the second order parameters.Figure 10   is now repeated over a wider operating range.This is to provide evidence to the reader that the collected results were obtained over a sufficient range, to introduce significant non linearity's.The new data is then manipulated via a MATLAB m file using the recursive least square method (RLSM), to obtain the coefficients of the overall system transfer function, i G .The RLSM m file originally identified the system as a 2 nd order representation which was found to provide significant information to the system dynamic response.However later higher orders were included to show further unidentified characteristics.The obtained results can be found in Figure 11 for the 4 th order voltage response prediction.Figure 12 details the combined voltage-current responses to obtain the power output identification match.
Clearly a significant improvement in the identification match is achieved.This provides evidence to the argument of using a non linear identification process.
However the operation of the fuel cell over a finite period to obtain a set of convergent parameters that are used to describe the system dynamics, only offers a small history of the time variant characteristics.To fully account for the fuel cell time varying characteristics, the implementation is now adapted to an on-line identification process.To achieve this, the ARX model describing the system using RLSM to include the LabVIEW is an ideal choice for this process due to its data acquisition abilities and increasing control theory toolsets.A generalised system structure is given as Figure 13.
The LabVIEW program now implements in real time the ARX identification process with RSLM continuously.

Self-Tuning PID Control
This time to represent real world conditions, the identification technique of varying flow rates is changed to the introduction of a drive cycle via a series of voltage load set point changes via a DC load bank.This can be regarded as the disturbance a motor would place on a real world vehicle application.The response results seen in Figures 14 is for the following set point changes (33). (33)

CONCLUSIONS
The LabVIEW drive cycle and data collection program performed well, collecting all required data.This allowed for an accurate identification match to be obtained in real time.In turn allowing the self tuning PID algorithm based on the modification of Bodal's work to obtain accurate ultimate values of K PU and T U .The second element of the LabVIEW program then calculated the final proportional, integral and derivative action values based on Ziegler-Nichols methodology.
A substantially improved response is then achieved when compared to the existing controller method, which calculates the flow requirement based on the stoichemetric value.Analysis of the results in Figure 14 shows several performance enhancements as compared to the existing controller.Firstly it can be seen that at point of interest (a), where a step increment in load requirement is implemented by a voltage set point decrease, both controllers reach a steady state value.However the stoichiometry based control method experiences the previously detailed momentary voltage loss, which is a direct result of the load bank demanding a load change.During this transition process, the reactants of hydrogen and oxygen are depleted, resulting in a momentary cell voltage drop.The self tuning PID controller is able to control this transition process with no momentary voltage drop.The self tuning PID controller is also able to settle Interestingly it should also be noted that for smaller positive step increment changes, and step decreases, both controllers provide good control capabilities.The results also provide evidence that self tuning PID controllers would also be suited to large fuel cell stacks as used in vehicle applications due to the pronounced improvements on the single cell presented here.
Future work is now proceeding to expand this controller strategy to further account for the time varying characteristics of the fuel cell, by utilising a self tuning Fuzzy-PID hybrid strategy.This will be followed by extending the work to include additional subsystems.

N
where R represents the internal cell resistance.
average of past inputs, where is the estimation gain which brings the relative information of new measurements to update the parameter estimation.
matrix which characterises the difference between the estimated and actual values where initially ) 0 ( P is chosen to be a large value.The coefficient l is called the forgetting factor which changes the importance of new information to old and has a range of

Figure 4 :
Figure 4: Overview of self-tuning PID structure

Figure 5 :
Figure 5: Overview of identification steps

2 .
The critical poles are with the imaginary parts so Equation (23) is valid.

Figure 6 :Figure 7 :Figure 8 :
Figure 6: FCTS block diagram overview Vehicle Journal, Vol 2, Issue 4Design and Implementation of On-Line Self-Tuning Control for PEM Fuel Cells Highlighted inFigure 8 at point of interest (a) and (b), are the instantaneous power (watt) losses between large loading points.These power loses are caused by the starvation of reactants A N and , H N as the flow controller adjusts to the new set point determined by the stoichemetric request value.

Figure 9 :
Figure 9: N A varied -N H constant

Figure 10 :
Figure 10: N A varied -N H constant using high orders

Figure 14 :
Figure 14: Real time implementation results