Online Prediction of Vehicular Fuel Cell Residual Lifetime Based on Adaptive Extended Kalman Filter

The limited lifetime of proton exchange membrane fuel cell (PEMFC) inhibits the further development of the fuel cell industry. Prediction is one of the most effective means for managing the lifetime of a fuel cell because it can assist in the implementation of mitigation actions before a vehicular fuel cell fails by estimating the residual lifetime. Therefore, this study aimed to develop a PEMFC lifetime prediction method for online applications. This paper presents the online prediction method developed for the residual lifetime of a vehicular fuel cell, which utilises data processing with an adaptive extended Kalman filter and a prediction formula. The formula considers different operating conditions and the external environment, which is in accord with the actual operating conditions of fuel cell vehicles. This method realises the online prediction of the residual lifetime of a vehicular fuel cell by updating weight coefficients for the operating conditions and environmental factors. This prediction method was validated and analysed using a simulation. The influences of key parameters on the stability and prediction accuracy of the algorithm were evaluated. The prediction method proposed in this paper can provide a reference for studies on fuel cell lifetime prediction.


Introduction
With the increase in the amount of carbon dioxide and other greenhouse gases being produced, new energy vehicles are gaining increasing attention and investments. Proton exchange membrane fuel cells (PEMFCs) have the advantages of a low operating temperature, high current density, and fast start-up ability and are considered to add tremendous value to new electric vehicles [1,2]. However, they also have numerous drawbacks which have prevented their widespread distribution and application [3]. The lifetime of a PEMFC is one of the main factors [4,5]. A reasonable prediction for the residual lifetime of a fuel cell can provide an accurate estimation of its durability and allow maintenance measures to be taken in time to prolong its lifetime, which is also very important to improve the economy of a fuel cell [6,7]. This article focuses on the prediction of the residual lifetime.
Lifetime prediction can be defined as an estimation of the time until an unknown future failure situation [8]. In the case of a PEMFC, the objective of such a prediction is determining the residual lifetime to prevent fault occurrence. The prediction uses a large amount of test data from actual fuel cell stacks in order to indicate future degradation trends. Based on the degradation trends, the residual lifetime of a PEMFC system can be forecast, and the advent of failure can be predicted.
The first problem to be solved in lifetime prediction was defining the lifetime end point. Different definitions are given in different studies. Jouin et al. [9] gave some references for this problem. Zhang et al. [10] The simulation results showed that this method could realise the short-term prediction of the fuel cell lifetime under different loads and could deal with test data containing large disturbances. Jia et al. [33] proposed a memory recurrent neural network algorithm for fuel cell residual lifetime estimation. This algorithm could estimate the lifetime trend well and had a strong ability to remove noise. In order to compensate for the shortcomings of a model-based method, Zhu et al. [34] proposed a prediction method based on the state space of a Gaussian process to infer the changes in the internal time-varying parameters. The validity of this method was proven by a group of long-term experimental data for a fuel cell. However, a data-driven approach requires a large amount of training data and is unsuitable for online prediction.
A hybrid method combines the theory of a model method and the precision of a data method. Thus, it is often used in fuel cell degradation data processing. Cheng et al. [35] synthesised the advantages of the model and data methods and proposed a hybrid method based on the least square support vector machine (LSSVM) and a prediction model. This method was verified by data. The results showed that it had a good ability to capture nonlinearity and improve the accuracy of residual lifetime prediction. Based on an automatic machine learning algorithm and a semi-empirical model, Liu et al. [36] reported a hybrid estimation method for the residual lifetime. Jha et al. [37] proposed a hybrid method that included a particle filter and bond graph model. In this method, the prediction was expressed as a joint state parameter estimation problem in a particle filter framework. Although using a model could enhance the learning process, the computational cost makes it challenging to implement in real applications, especially at this stage. However, the authors believe that with the improvement of vehicular processor algorithms and computing power, especially the further development of the cloud connection method, the application of data-driven and hybrid methods with higher precision will be realised in the automobile.
The state of a vehicular fuel cell is very complex, because it is affected by the working conditions and external environment [38][39][40]. Therefore, prediction tools need to have an adaptive ability to improve the accuracy of online prediction [29]. An adaptive algorithm for fuel cell degradation data has been proven to be able to adapt to dynamic load changes [41][42][43]. This study investigated an adaptive extended Kalman filter (AEKF) method, and its accuracy and effectiveness were verified using experimental data.
In this context, there were three stages associated with the study of the lifetime of a fuel cell. In the first stage, an empirical model was developed to predict the lifetime of the fuel cell, in which the activation losses, ohmic losses, and concentration losses were taken into account. This model was combined with the AEKF to obtain an estimated value of the current voltage. In the second stage, an online residual lifetime prediction method was developed based on the empirical model. The influences of the operating conditions and external environment for the actual working conditions were also taken into account in this method. In the third stage, the prediction method was validated and analysed using a simulation, and the influences of the related parameters on the prediction accuracy and stability were evaluated.

PEMFC Data Processing in AEKF Framework
It has been proven that the decay of a fuel cell's life is a nonlinear process, especially in the middle and later stages of its lifespan [11,15]. Therefore, this paper presents a nonlinear empirical lifetime prediction model. The load on a fuel cell stack frequently changes during operation under vehicle conditions, which means the working conditions of a PEMFC are very dynamic [20]. Therefore, the prediction algorithm for the model should have an adaptive capability. Data processing methods, such as Kalman and particle filters, have been used under static conditions to process the decay data of a fuel cell and have achieved good results [10,11,26]. However, under vehicle and online conditions, the characteristics of the fuel cell will change with the working conditions, and the measured noise statistics may change over time. Thus, using a Kalman filter to estimate the fuel cell life may not be the optimal method [44]. In order to improve the estimation accuracy for the residual lifetime of a fuel cell under the uncertainty of measured noise statistics, an AEKF is proposed for data processing under an online condition.

Data Sources
Song et al. [24] investigated a 400-cell fuel cell stack. The details of their testing process can be found in that paper. Some parameters of the test fuel cell stack are listed in Table 1. The voltage degradation data of their fuel cell stack were used in this study.  Figure 1 shows the experimental performance degradation under the rated current.

Data Sources
Song et al. [24] investigated a 400-cell fuel cell stack. The details of their testing process can be found in that paper. Some parameters of the test fuel cell stack are listed in Table 1. The voltage degradation data of their fuel cell stack were used in this study.  Figure 1 shows the experimental performance degradation under the rated current.

AEKF Algorithm
The conventional equations for the Kalman filter algorithm are given as follows: where k x is the state of the system, k u is the input, k y is the output, and F is the state transition matrix of the system. The noise variables, k w and k V , are usually assumed to be Gaussian noise and independent of each other. In particular, noise k w is the system error, and noise k V is the measurement error. In practice, the process noise covariance Q and measurement noise covariance R matrices might change with each time step or measurement. The AEKF can update these two

AEKF Algorithm
The conventional equations for the Kalman filter algorithm are given as follows: where x k is the state of the system, u k is the input, y k is the output, and F is the state transition matrix of the system. The noise variables, w k and V k , are usually assumed to be Gaussian noise and independent of each other. In particular, noise w k is the system error, and noise V k is the measurement error.
In practice, the process noise covariance Q and measurement noise covariance R matrices might change with each time step or measurement. The AEKF can update these two parameters adaptively under dynamic conditions and reduce the error caused by parameter initialisation. This study assumed that the voltage degradation of a fuel cell is nonlinear, especially at the end of its life. In a long-term fuel cell test, it has been found that the total resistance and limiting current vary Energies 2020, 13, 6244 5 of 21 greatly, with basically the same rate of change [11]. Thus, the following nonlinear degradation model proposed by Bressel et al. [11] is used: where g is the stack voltage, E is the open circuit voltage, r 0 is the total resistance, i k is the current, i 0 is the exchange current, i l0 is the limiting current, k is the current time, and α k is the total resistance derivative to time.
A polarisation curve is a standard measure to characterise the output performance of fuel cells. The degradation model is based on the electrochemical theory of fuel cells, which introduces activation loss (A ln( i k i 0 )), ohmic loss (r 0 (1 + α k )i k ), and concentration loss (B ln(1 − i k i l0 (1−α k ) )). The degradation experiment of fuel cells is a pure statistical result of degradation characteristics. The degradation characteristics of the statistical results are expressed by the empirical model based on the electrochemical theory, which reflects the degradation law of the fuel cell more truly.
The state prediction formula is expressed as follows: β k can be set as a constant.
The state of the system can be expressed as follows: The state transition matrix of the system can be expressed as follows: Here, T s is the sampling period (1 h). In the long-term test process for a fuel cell, the state of the fuel cell is characterised by a polarisation curve and an electrochemical impedance spectrum to obtain the key parameters for the model. The detailed parameter acquisition process can be obtained from the work of Bressel et al. [11].
The core formula of the AEKF can be expressed as follows: Time update Measurement update In the proposed AEKF algorithm, process noise Q and observation noise R in the system are no longer fixed values configured in advance but rather change according to the time and environment.
An estimation of the covariance of the innovation residual is derived by taking the average of the previous residual sequences for a window of length N [43]: where v k is the innovation residual in the Kalman filter, and j 0 = k − N + 1 is the first sample in the estimation window. N is called the moving window. That is, the amount of accumulated residual. The introduction of the moving window N realises the adaptive updating of the adaptive covariance matching algorithm. AEKF introduces an adaptive covariance matching algorithm based on the Kalman filter principle. The problem of variable noise is solved and the adaptive ability of the algorithm to complex working conditions is enhanced by continuously updating the system error covariance and measuring the noise covariance coefficient. The estimated process noise and observation noise are obtained as follows:

Filter Settings
The initial values of Q, R and P are selected as follows: Because the initial degradation rate is assumed to be unknown, x 0|0 = [0, 0] T . In order to avoid excessive calculation, this study calculated the difference for the first two times, which meant N = 2.

Filtering Results and Analysis
The degradation of the PEMFC was simulated using the data from Figure 1 and the empirical model from Equation (5). Figure 2 shows the filtering results for the first 1000 h.

Filtering Results and Analysis
The degradation of the PEMFC was simulated using the data from Figure 1 and the empirical model from Equation (5). Figure 2 shows the filtering results for the first 1000 h.   It can be concluded from Figure 2 that the AEKF algorithm converged at approximately 200 h. After about 200 h, the filtering result shows a stable downward trend, indicating that the noise of the test data is basically removed. For the online prediction of a PEMFC's lifetime, this length of time is considered to be the learning time. During the learning time, the prediction tool learns the behaviour of the system and updates some parameters of the model. This length of time is acceptable for vehicular applications. It has been proven that the selection of the initial parameters has an effect on the convergence time, robustness, and accuracy of the system. This paper provides a reference initial value. The initial settings for the basic Kalman parameters can be determined using the Kalman theory and related literature. Figure 3 shows the long-term test results and AEKF data processing of the fuel cell. It can be seen that the lifetime decline of an actual fuel cell is nonlinear, especially in the middle and later periods. This nonlinear degradation mechanism is complex and is mainly due to the degradation of the membrane electrode assembly caused by dehydration and flooding [45]. The results show that the nonlinear model accurately describes the degradation of the fuel cell. The filtering result is desirable and shows that the AEKF algorithm has a strong ability to eliminate noise. of the initial parameter settings and update noise covariance matrices Q and R adaptively. Thus, it is more suitable for a changing environment.

Residual Lifetime Online Prediction
The difficulties involved in fuel cell online prediction were studied. In order to realise online prediction, these difficulties should first be solved. This section analyses the difficulties and provides solutions. Then, four adverse operating conditions are defined. The degradation rate of each operating condition was measured under laboratory conditions. Finally, this paper proposes a residual lifetime prediction formula. The residual lifetime could be estimated online by updating the  Figure 4 summarises the fuel cell degradation data processing based on the AEKF, which includes the nonlinear degradation model and measurement value containing noise. These two parts are considerably influenced by process noise covariance Q and measurement noise covariance R. Therefore, the performance of the Kalman filter is also very affected by the two noise covariance matrices [46]. Relevant research shows that the wrong settings for initial noise covariance matrices Q and R may seriously reduce the performance of the Kalman filter and even lead to the non-convergence of the filtering results [42]. In general, it is unrealistic to set the general optimal noise covariance matrix in the initial stage. In practice, the optimisation of the best noise covariance matrices, Q and R, should enable adjustments based on changes in the use scenario, making it possible to achieve the best performance from the Kalman filter. The AEKF can reduce the influences of the initial parameter settings and update noise covariance matrices Q and R adaptively. Thus, it is more suitable for a changing environment.

Residual Lifetime Online Prediction
The difficulties involved in fuel cell online prediction were studied. In order to realise online prediction, these difficulties should first be solved. This section analyses the difficulties and provides solutions. Then, four adverse operating conditions are defined. The degradation rate of each operating condition was measured under laboratory conditions. Finally, this paper proposes a residual lifetime prediction formula. The residual lifetime could be estimated online by updating the weight coefficients for each operating condition and environmental factor.

Residual Lifetime Online Prediction
The difficulties involved in fuel cell online prediction were studied. In order to realise online prediction, these difficulties should first be solved. This section analyses the difficulties and provides solutions. Then, four adverse operating conditions are defined. The degradation rate of each operating condition was measured under laboratory conditions. Finally, this paper proposes a residual lifetime prediction formula. The residual lifetime could be estimated online by updating the weight coefficients for each operating condition and environmental factor.

Online Prediction Difficulties and Solutions
This study reviewed the research on lifetime prediction methods for a PEMFC. The advantages and disadvantages of various methods were compared and analysed.
In most studies, the output voltage and power are usually used as indicators to evaluate the fuel cell state of health because these are easy to obtain. For online prediction, the average voltage was used as an indicator in this study. The lifetime of a fuel cell for vehicular use is shorter because of the complex and highly dynamic operating conditions [20]. Thus, the effects of the working conditions should be seriously considered. It has been proven that typical operating conditions will have an appreciable effect on fuel cell durability [24]. Therefore, this paper follows Pei's definition of four typical working conditions of fuel cell vehicles [20]: the load-changing condition, start-stop condition, idle condition, and high-power load condition. The total voltage degradation rate of a vehicle fuel cell is based on the degradation rate of each condition and the previous load spectrum of the driving cycle. The load and external environment for a vehicular fuel cell stack frequently change during operation. Therefore, an environment factor is introduced to reflect the difference between the test results for a fuel cell's lifetime on a test bench and the actual vehicle test results on the road. At the same time, the environmental factor should be regularly evaluated and updated after specific intervals of time. In terms of data processing tools, as previously mentioned, the AEKF is selected to obtain the current voltage estimation under online conditions. Then, these parameters are used in the lifetime prediction formula. To sum up, three main difficulties should be solved in order to realise online prediction. The difficulties and solutions investigated in this study are shown below.
(1) Health indicator of PEMFC under dynamic conditions. At present, the lifetime prediction for a PEMFC system is typically completed under constant operating conditions. However, under highly dynamic conditions, the stack voltage is highly dependent on the operating conditions and environment.
Solution: On the basis of the definition from the US Department of Energy, the average voltage per cell under the rated current is used as an indicator. This standard has been widely used in related research [15,19,20].
(2) Assessment of actual working conditions.
The operation mode (start-stop, idle, high-power, etc.), load, and external parameters (intake pressure, air humidity, working temperature, etc.) can have significant impacts on the durability of the PEMFC system.
Solution: The effects of typical operating conditions should be seriously considered when estimating the fuel cell lifetime. In this study, four operating conditions continue to be used to evaluate the changes in the working-the load-changing conditions, start-stop condition, open-circuit/ idle/low-power load condition, and high-power load condition. An environment factor was also introduced to estimate the changes in external parameters.
For predicting the lifetime of a PEMFC system, the adaptive ability of the predictive tool is an important means for maintaining its efficiency and reliability. A Kalman filter is widely used in data processing for fuel cells under static conditions. At the same time, some scholars have used an adaptive Kalman filter to study the residual lifetime of a lithium battery [42,44]. The results have verified the validity and accuracy of an adaptive Kalman filter. The nonlinear Kalman filter method is sensitive to the filter parameters and lacks a general method for setting the initial parameters of the filter [46]. Therefore, the adaptability of the data processing tools should be improved as much as possible under dynamic conditions. Solution: An AEKF method is proposed to improve the stability and precision of the lifetime prediction algorithm. An AEKF can adaptively update noise covariance matrices Q and R based on the innovation residual, which can update the state vector more accurately. Thus, it is more suitable for online conditions.
The online residual lifetime prediction for a PEMFC could be realised after solving the abovementioned difficulties. A logic diagram for online PEMFC prediction is presented in Figure 5.
Based on the above analysis, four types of data are needed for the residual lifetime prediction formula: current voltage, voltage degradation rate, weight coefficients of each operating condition, and environmental factor. The current voltage was obtained using the AEKF. The voltage degradation rates of the four operating conditions were separately investigated under experimental conditions. A weight coefficient was obtained by ascertaining each operating condition proportion in the load cycle spectrum. In fact, the weight coefficient remained constant over time. The environmental factor was obtained by evaluating and updating the external condition. Finally, the residual lifetime was estimated by using these parameters in the prediction formula.  Based on the above analysis, four types of data are needed for the residual lifetime prediction formula: current voltage, voltage degradation rate, weight coefficients of each operating condition, and environmental factor. The current voltage was obtained using the AEKF. The voltage degradation rates of the four operating conditions were separately investigated under experimental conditions. A weight coefficient was obtained by ascertaining each operating condition proportion in the load cycle spectrum. In fact, the weight coefficient remained constant over time. The environmental factor was obtained by evaluating and updating the external condition. Finally, the residual lifetime was estimated by using these parameters in the prediction formula.

Lifetime Prediction Based on Operation Conditions
Pei et al. [20] studied the influence of typical operating conditions on the lifetime of a vehicular fuel cell. The classification of the operating conditions was discussed in the authors' previous work [24] and other relevant literature [19]. Therefore, this classification will continue to be used in this paper. A fuel cell vehicle has four main working conditions: (1) Load-changing condition; (2) Start-stop condition; (3) Open-circuit/idle and low-power load condition; (4) High-power load condition.
Therefore, a fuel cell vehicle's driving conditions and the total degradation rate can be simulated as the sum of these four typical operating conditions. This article defines the voltage degradation rate and weight coefficient of the operating conditions as follows: , , , g g g g g = (23) Here, i d and i g stand for the voltage degradation rate and the weight coefficients of the loadchanging condition, start-stop condition, idle condition, and high-power load condition, respectively. A higher weight coefficient for an operating condition makes it more likely that the fuel cell stack is operated under this condition. The fuel cell stack degradation should be separately tested and evaluated under the different operating conditions. The fuel cell stack degradation is related to the

Lifetime Prediction Based on Operation Conditions
Pei et al. [20] studied the influence of typical operating conditions on the lifetime of a vehicular fuel cell. The classification of the operating conditions was discussed in the authors' previous work [24] and other relevant literature [19]. Therefore, this classification will continue to be used in this paper. A fuel cell vehicle has four main working conditions: (1) Load-changing condition; (2) Start-stop condition; (3) Open-circuit/idle and low-power load condition; (4) High-power load condition.
Therefore, a fuel cell vehicle's driving conditions and the total degradation rate can be simulated as the sum of these four typical operating conditions. This article defines the voltage degradation rate and weight coefficient of the operating conditions as follows: Here, d i and g i stand for the voltage degradation rate and the weight coefficients of the load-changing condition, start-stop condition, idle condition, and high-power load condition, respectively.
A higher weight coefficient for an operating condition makes it more likely that the fuel cell stack is operated under this condition. The fuel cell stack degradation should be separately tested and evaluated under the different operating conditions. The fuel cell stack degradation is related to the weight coefficients and degradation rates of the four conditions. The degradation rates of the fuel cell stack under the different operating conditions were normalised under the test conditions.
Pei et al. [20] performed a study on the performance degradation of a fuel cell stack, taking into consideration the effects of the load-changing condition, start-stop condition, idle condition, and high-power condition. Our previous work [24] referenced and optimised the experimental results of Pei's project and confirmed the influence of the relevant working conditions on fuel cell degradation. The test results were used as a reference in this study to determine the degradation rate and weight coefficient under each operating condition. The voltage degradation rate obtained in an experiment was used for online prediction. The following part outlines the method used for ascertaining voltage degradation rate d, which was then directly used in the lifetime prediction formula. The test process and results were as follows.
A. Start-stop condition.
A complete start-stop cycle included the following: start, idle for 1 min at a constant current of 10 mA/cm 2 , idle, stop, and purge hydrogen until the voltage is zero. This was a basic cycle, which was repeated 10 times. After 80 h of testing, the decay rate under start-stop condition was 0.00196%.
B. Idle condition.
The idle and start-stop process ran at the same time. The test time was 50 h (sampling time interval, 15 min). Removing the start-stop factor, the idle condition degradation rate was 0.00126%.
One load-changing cycle was set from idle to the rated power. At every 200 load-changing cycles, the output voltage was recorded. After 80 h of testing, the degradation rate under this condition was 0.00332%. D. High-power load condition.
First idle for 30 min, then input the load's high-power current. After this process (4.5 h), the degradation rate under this condition was 0.00147%.
Then, the fuel cell degradation rates under each operating condition were normalised. More details about the test process can be found in reference [20]. Table 2 gives a summary of the four degradation rates.

Residual Lifetime Prediction Formula
After normalising the four degradation rates, it was necessary to ascertain the weight coefficients of each operating condition based on the previous load cycle spectrum. Weight coefficients were defined for the load-changing condition, start-stop condition, idle condition, and high-power load condition. These parameters were set as the inputs of the lifetime prediction formula. The weight coefficient was the ratio of the time under each condition to the driving time of the fuel cell system over the previous driving mileage record. A higher weight coefficient for a condition resulted in it occupying a higher proportion of the load cycle spectrum.
The residual lifetime prediction formula is given as follows and some details are explained [20]: (1) ∆V represents the permitted voltage variation magnitude from the current time to the point where the voltage declines by 10%.
(2) V is the voltage obtained by the AEKF at the current time.
(3) k is an environmental factor that is primarily related to the air pressure and input quantity of gas. Because of the differences between laboratory test conditions and real vehicle road test conditions, the lifetime degradation rate of a vehicular fuel cell is generally faster than the experimental results [19]. Here, k is an acceleration coefficient used to evaluate the environment factor. Pei et al. [20] compared the experimental results with the actual fuel cell bus test results and obtained the k value (k ≈ 1.72). The introduction of an acceleration coefficient makes the experimental results closer to the real degradation results of vehicle fuel cells. We believe that the operating environment of a vehicular fuel cell often changes, and k should be updated according to the estimated and predicted voltage values. In this study, k was used as a reference value for the lifetime prediction during the following period.
(4) In this study, the initial value of k was set to 1.8 because the fuel cell model used here was a nonlinear model. Because the nonlinear degradation factor during the beginning of the lifetime was not significant, the initial value was slightly higher than 1.72. This also left a safety threshold for the fuel cell lifetime prediction.
(5) At the same time, k responds to changes in the external conditions over a long period. Therefore, it is recommended that k be updated every 100 h. V 600 , where k 600 is the value of k at 600 h; • V 600 = V 500 − 100 * k 500 V 500 dg T . If the predicted voltage at 600 h (V 600 ) is higher than the estimated voltage at 600 h (V 600 ) then k 600 is higher than k 500 , because the external conditions worsen during these 100 h. In the original formula, k was considered a constant value. For the prediction under dynamic conditions, this paper improves the calculation method of k, which can be adjusted adaptively according to the change in external environment.

Simulation Validation
The residual lifetime prediction method was validated and analysed using simulations. Based on the voltage degradation data and degradation rate of each condition, conclusions could be drawn from simulations using the power-following (PF) energy management strategy of the 'Urban Dynamometer Driving Schedule' (UDDS) driving cycle.

Determining Weight Coefficients
The weight coefficients were related to the energy management strategy and driving cycle. However, these were not the concern of this study. In this study, the simulations were validated under the PF energy management strategy and UDDS driving cycle. The UDDS driving cycle is shown in Figure 6. experimental results [19]. Here, k is an acceleration coefficient used to evaluate the environment factor. Pei et al. [20] compared the experimental results with the actual fuel cell bus test results and obtained the k value ( k ≈ 1.72). The introduction of an acceleration coefficient makes the experimental results closer to the real degradation results of vehicle fuel cells. We believe that the operating environment of a vehicular fuel cell often changes, and k should be updated according to the estimated and predicted voltage values. In this study, k was used as a reference value for the lifetime prediction during the following period.
(4) In this study, the initial value of k was set to 1.8 because the fuel cell model used here was a nonlinear model. Because the nonlinear degradation factor during the beginning of the lifetime was not significant, the initial value was slightly higher than 1.72. This also left a safety threshold for the fuel cell lifetime prediction.
(5) At the same time, k responds to changes in the external conditions over a long period. Therefore, it is recommended that k be updated every 100 h.

Simulation Validation
The residual lifetime prediction method was validated and analysed using simulations. Based on the voltage degradation data and degradation rate of each condition, conclusions could be drawn from simulations using the power-following (PF) energy management strategy of the 'Urban Dynamometer Driving Schedule' (UDDS) driving cycle.

Determining Weight Coefficients
The weight coefficients were related to the energy management strategy and driving cycle. However, these were not the concern of this study. In this study, the simulations were validated under the PF energy management strategy and UDDS driving cycle. The UDDS driving cycle is shown in Figure 6. The following provides the definition of each operating condition used in this study, which allowed the weight coefficients to be further calculated. The following provides the definition of each operating condition used in this study, which allowed the weight coefficients to be further calculated. The weight coefficient of the start-stop condition was the ratio of the time for start-stop cycles over the entire driving mileage to the total driving time.

B. Idle condition
In this study, the threshold voltage for the idle condition was set at 0.85 V, which meant the fuel cell was considered to be in the idle condition with a cell voltage higher than 0.85 V [24]. Figure 7 shows that the voltage of a single cell decreases with an increase in the fuel cell system output power. In this study, when the cell voltage was 0.85 V, the output power of the fuel cell stack was 4.42 kW. Therefore, the idle coefficient was the ratio of the time when the output power of the fuel cell was less than 4.42 kW to the total time. A. Start-stop condition The weight coefficient of the start-stop condition was the ratio of the time for start-stop cycles over the entire driving mileage to the total driving time.
B. Idle condition In this study, the threshold voltage for the idle condition was set at 0.85 V, which meant the fuel cell was considered to be in the idle condition with a cell voltage higher than 0.85 V [24]. Figure 7 shows that the voltage of a single cell decreases with an increase in the fuel cell system output power. In this study, when the cell voltage was 0.85 V, the output power of the fuel cell stack was 4.42 kW. Therefore, the idle coefficient was the ratio of the time when the output power of the fuel cell was less than 4.42 kW to the total time. C. Load-changing condition The cumulative change in the output power was a reflection of a change in the load. One loadchanging cycle meant that the fuel cell load changed from idling to the rated power. In this study, one load-changing cycle was the difference between idling and the rated power.
D. High-power load condition In this study, the output voltage threshold for the high-power level was set at 0.7 V. Thus, the fuel cell stack was considered to be operating at a high-power level with an output voltage below 0.7 V. Figure 7 shows that an output power of 35.75 kW corresponded to a point where the cell voltage was 0.7 V. Therefore, the high-power coefficient was the ratio of the time when the output power of the fuel cell was higher than 35.75 kW to the total time.
The PF energy management strategy and UDDS driving cycle were set up as the simulation conditions. Figure 8 shows the calculation result of the fuel cell system power. The calculated weight coefficients of each condition are listed in Table 3.
The weight coefficients for the four operating conditions were calculated. The voltage degradation rate was tested separately. The current voltage was obtained using the AEKF. The initial value for the environmental factor was set at 1.8. These four inputs were used in the lifetime prediction formula.

C. Load-changing condition
The cumulative change in the output power was a reflection of a change in the load. One loadchanging cycle meant that the fuel cell load changed from idling to the rated power. In this study, one load-changing cycle was the difference between idling and the rated power.

D. High-power load condition
In this study, the output voltage threshold for the high-power level was set at 0.7 V. Thus, the fuel cell stack was considered to be operating at a high-power level with an output voltage below 0.7 V. Figure 7 shows that an output power of 35.75 kW corresponded to a point where the cell voltage was 0.7 V. Therefore, the high-power coefficient was the ratio of the time when the output power of the fuel cell was higher than 35.75 kW to the total time.
The PF energy management strategy and UDDS driving cycle were set up as the simulation conditions. Figure 8 shows the calculation result of the fuel cell system power. The calculated weight coefficients of each condition are listed in Table 3.

Simulation Results
The residual lifetime simulation was conducted using the degradation data, and the results are shown in Figure 9. The changes in environmental factor k are shown Figure 10. Figure 11 shows the changes in the absolute error. In this simulation case, considering the amount of calculation needed for an online prediction, a value of two was selected for N . The initial value of k was set at 1.8 considering the difference between the test results on the test bench and the test results for a real vehicle, as well as the nonlinearity of the fuel cell degradation.   The weight coefficients for the four operating conditions were calculated. The voltage degradation rate was tested separately. The current voltage was obtained using the AEKF. The initial value for the environmental factor was set at 1.8. These four inputs were used in the lifetime prediction formula.

Simulation Results
The residual lifetime simulation was conducted using the degradation data, and the results are shown in Figure 9. The changes in environmental factor k are shown Figure 10. Figure 11 shows the changes in the absolute error. In this simulation case, considering the amount of calculation needed for an online prediction, a value of two was selected for N. The initial value of k was set at 1.8 considering the difference between the test results on the test bench and the test results for a real vehicle, as well as the nonlinearity of the fuel cell degradation.

Simulation Results
The residual lifetime simulation was conducted using the degradation data, and the results are shown in Figure 9. The changes in environmental factor k are shown Figure 10. Figure 11 shows the changes in the absolute error. In this simulation case, considering the amount of calculation needed for an online prediction, a value of two was selected for N . The initial value of k was set at 1.8 considering the difference between the test results on the test bench and the test results for a real vehicle, as well as the nonlinearity of the fuel cell degradation.   Similar to the voltage estimation based on the AEKF, the residual lifetime prediction algorithm converged at approximately 200 h. Generally, if the predicted value of the residual lifetime can be kept within 10% of the real lifetime, it can be regarded as an ideal prediction [11,27]. It can be noted from Figure 9 that after 200 h, the estimated value of the residual lifetime of the algorithm entered and remained in the ideal confidence interval.
As shown in Figure 10, every 100 h, the prediction algorithm will automatically update environmental factor k based on the predicted and estimated values of the current voltage. The evaluation of the environment is dynamic and its deterioration is reflected in the value of k over a period of time. For example, at the 600th hour, when the driving environment of the vehicle was relatively poor, the algorithm automatically evaluated this state and increased k . Thus, it can be seen that the residual lifetime is underestimated in Figure 9 at 600 h. In the following period of time,  Similar to the voltage estimation based on the AEKF, the residual lifetime prediction algorithm converged at approximately 200 h. Generally, if the predicted value of the residual lifetime can be kept within 10% of the real lifetime, it can be regarded as an ideal prediction [11,27]. It can be noted from Figure 9 that after 200 h, the estimated value of the residual lifetime of the algorithm entered and remained in the ideal confidence interval.
As shown in Figure 10, every 100 h, the prediction algorithm will automatically update environmental factor k based on the predicted and estimated values of the current voltage. The evaluation of the environment is dynamic and its deterioration is reflected in the value of k over a period of time. For example, at the 600th hour, when the driving environment of the vehicle was relatively poor, the algorithm automatically evaluated this state and increased k . Thus, it can be seen that the residual lifetime is underestimated in Figure 9 at 600 h. In the following period of time, Figure 11. Changes in absolute error.
Similar to the voltage estimation based on the AEKF, the residual lifetime prediction algorithm converged at approximately 200 h. Generally, if the predicted value of the residual lifetime can be kept within 10% of the real lifetime, it can be regarded as an ideal prediction [11,27]. It can be noted from Figure 9 that after 200 h, the estimated value of the residual lifetime of the algorithm entered and remained in the ideal confidence interval.
As shown in Figure 10, every 100 h, the prediction algorithm will automatically update environmental factor k based on the predicted and estimated values of the current voltage. The evaluation of the environment is dynamic and its deterioration is reflected in the value of k over a period of time. For example, at the 600th h, when the driving environment of the vehicle was relatively poor, the algorithm automatically evaluated this state and increased k. Thus, it can be seen that the residual lifetime is underestimated in Figure 9 at 600 h. In the following period of time, because of the adaptive ability of the algorithm, the estimated voltage and k will change accordingly, which will also improve the prediction accuracy for the residual lifetime. Figure 11 shows the changes in the absolute error. Similarly, the prediction error was too large in the first 200 h because the algorithm did not converge. Satisfactory results were obtained after 200 h, with an average absolute error of 53 h (after 200 h). For online forecasting, this result was acceptable.

Parametric Studies
It can be found that the residual lifetime prediction algorithm based on the AEKF depends on the setting of the initial parameters. This article provides some reference settings. For the initialisation of the Kalman filter, the basic theory for a Kalman filter [47] and the previous related research [10,11,44,46] can be referenced. Therefore, it will not be discussed in detail. This paper mainly discusses the influence of symbol window length N on the AEKF. Figure 12 shows the results when the value of N is set to 2, 3, and 4. It can be seen that N has a certain impact on the convergence time and prediction accuracy of the algorithm. The AEKF filtering results and prediction of the residual lifetime have the same convergence time, and the fluctuation of the AEKF algorithm is reflected in the residual lifetime prediction results to some extent. When the value of N is 2, 3, and 4, the convergence time of the algorithm is approximately 200, 700, and 1200 h, respectively, which shows that the convergence speed slows down. In terms of the prediction accuracy, with an increase in N, the fluctuation of the prediction value near the residual lifetime increases. Similarly, the absolute error increases accordingly. The mean absolute error values after 200 h were 53, 60, and 69 h, respectively. It can be concluded that the increase in moving window will slow down the convergence speed of the algorithm, which will lead to a decrease in prediction accuracy. Therefore, in practical application, the computing power of the on-board processor and the convergence time of the algorithm should be considered comprehensively.
Energies 2020, 13, x FOR PEER REVIEW 16 of 21 because of the adaptive ability of the algorithm, the estimated voltage and k will change accordingly, which will also improve the prediction accuracy for the residual lifetime. Figure 11 shows the changes in the absolute error. Similarly, the prediction error was too large in the first 200 h because the algorithm did not converge. Satisfactory results were obtained after 200 h, with an average absolute error of 53 h (after 200 h). For online forecasting, this result was acceptable.

Parametric Studies
It can be found that the residual lifetime prediction algorithm based on the AEKF depends on the setting of the initial parameters. This article provides some reference settings. For the initialisation of the Kalman filter, the basic theory for a Kalman filter [47] and the previous related research [10,11,44,46] can be referenced. Therefore, it will not be discussed in detail. This paper mainly discusses the influence of symbol window length N on the AEKF. Figure 12 shows the results when the value of N is set to 2, 3, and 4. It can be seen that N has a certain impact on the convergence time and prediction accuracy of the algorithm. The AEKF filtering results and prediction of the residual lifetime have the same convergence time, and the fluctuation of the AEKF algorithm is reflected in the residual lifetime prediction results to some extent. When the value of N is 2, 3, and 4, the convergence time of the algorithm is approximately 200, 700, and 1200 h, respectively, which shows that the convergence speed slows down. In terms of the prediction accuracy, with an increase in N , the fluctuation of the prediction value near the residual lifetime increases. Similarly, the absolute error increases accordingly. The mean absolute error values after 200 h were 53, 60, and 69 h, respectively. It can be concluded that the increase in moving window will slow down the convergence speed of the algorithm, which will lead to a decrease in prediction accuracy. Therefore, in practical application, the computing power of the onboard processor and the convergence time of the algorithm should be considered comprehensively.  The prediction formula proposed in this paper introduces factor k to evaluate the external environment. In the process of online prediction, k is considered to be a dynamic variable. According to the predicted and estimated values of the current voltage, k can be updated in real time to reflect the driving condition of the vehicle in a period of time. The decline of the vehicular fuel cell is usually faster than that of a fuel cell under experimental conditions. By comparing the experimental results with the actual fuel cell bus test results, the value of k has been confirmed to be about 1.72 [20]. In this study, the initial value of k was set at 1.8. At the same time, the influence of k on the prediction algorithm was analysed. Figure 13 shows the differences in the prediction results with different values of k. When k is 1.6, the prediction algorithm overestimates the residual lifetime. In actual use, this may lead to a driver's optimistic estimation of the vehicle condition. When k was increased to 1.9, the convergence time of the algorithm was not affected, the predicted value was closer to the residual lifetime, and the absolute error was reduced. After 200 h, the corresponding mean absolute errors were 125, 68, and 59 h (with N values of 2, 3, and 4, respectively). In general, in the range of 1.6-1.9, the predicted values remained in the ideal confidence interval. The simulation results further confirm the accuracy of the initial work for environmental factor measurement. The prediction formula proposed in this paper introduces factor k to evaluate the external environment. In the process of online prediction, k is considered to be a dynamic variable. According to the predicted and estimated values of the current voltage, k can be updated in real time to reflect the driving condition of the vehicle in a period of time. The decline of the vehicular fuel cell is usually faster than that of a fuel cell under experimental conditions. By comparing the experimental results with the actual fuel cell bus test results, the value of k has been confirmed to be about 1.72 [20]. In this study, the initial value of k was set at 1.8. At the same time, the influence of k on the prediction algorithm was analysed. Figure 13 shows the differences in the prediction results with different values of k . When k is 1.6, the prediction algorithm overestimates the residual lifetime. In actual use, this may lead to a driver's optimistic estimation of the vehicle condition. When k was increased to 1.9, the convergence time of the algorithm was not affected, the predicted value was closer to the residual lifetime, and the absolute error was reduced. After 200 h, the corresponding mean absolute errors were 125, 68, and 59 h (with N values of 2, 3, and 4, respectively). In general, in the range of 1.6-1.9, the predicted values remained in the ideal confidence interval. The simulation results further confirm the accuracy of the initial work for environmental factor measurement.

Conclusions
This study focused on an online prediction method for the lifetime of a vehicular fuel cell and proposed an adaptive online prediction method for the residual lifetime considering the actual driving conditions of vehicles.
The following conclusions can be drawn: (1) It is reasonable to define an average voltage per cell decrease of 10% in the rated current as the end of the fuel cell's life. In addition, this value is easy to obtain under online conditions. This study, again, proved the usability and rationality of this standard.
(2) The AEKF could reduce the influence of parameter initialisation on the prediction results, as well as update the process and measurement noise covariance dynamically, which was helpful to

Conclusions
This study focused on an online prediction method for the lifetime of a vehicular fuel cell and proposed an adaptive online prediction method for the residual lifetime considering the actual driving conditions of vehicles.
The following conclusions can be drawn: (1) It is reasonable to define an average voltage per cell decrease of 10% in the rated current as the end of the fuel cell's life. In addition, this value is easy to obtain under online conditions. This study, again, proved the usability and rationality of this standard.
(2) The AEKF could reduce the influence of parameter initialisation on the prediction results, as well as update the process and measurement noise covariance dynamically, which was helpful to improve the prediction accuracy under online conditions. The AEKF showed good results in lifetime prediction, making it possible to quickly and accurately estimate the current voltage to update the residual lifetime in real time. (3) It was verified that the lifetime prediction formula could quickly and accurately estimate the residual lifetime by considering the influence of the driving conditions in the lifetime prediction for a vehicular fuel cell and combining the experimental data of fuel cell degradation with the simulation data under specific driving cycle conditions. In the example reported in this paper, a predicted value for the residual lifetime could be given after 200 h, and the average absolute error was approximately 53 h. The combination of the model-based AEKF and prediction formula did not require a large amount of calculations under online conditions. (4) Environmental factor k could be used to evaluate the external driving environment of a vehicle.
In addition, k could be updated dynamically, which enhanced the adaptability of the algorithm. This will make it possible for drivers to obtain the current residual lifetime and driving environment of the vehicle for a period of time. (5) Moving window N is a parameter that affects the convergence speed and prediction accuracy of the algorithm. An increase in moving window N will increase the amount of calculations and reduce the convergence speed and prediction accuracy. In practical application, people should consider the requirements of calculation, convergence time, and accuracy and set the value of moving window N reasonably.
In the simulation results for the driving cycle, the weight coefficients of different conditions were fixed, which may deviate from the actual operation results. The next stage of research should be based on real vehicle driving data to verify the effectiveness of the algorithm in a real vehicle dynamic test.