{'fraction_non_alphanumeric': 0.029294783539850083, 'fraction_numerical': 0.00849013308857274, 'mean_word_length': 4.80595026642984, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Electrochemical Low-Frequency Impedance Spectroscopy for Diagnostics of Fuel Cells

Diagnostics of the state of health of fuel cells is important for their safe operation and to maximise their lifetime. The low-frequency intercept of a fuel cell's electrochemical impedance spectrum with the real axis is a good prognostic variable that changes linearly with degradation. Using relay feedback, it is possible to estimate this parameter on-line without a full impedance spectroscopy, with a lightweight algorithm that can be realised with a typical fuel cell control unit. The proposed method is tested in simulations and experiments, and demonstrated convergence times of just a few seconds.


I. INTRODUCTION
Proton-exchange membrane fuel cells (PEMFCs) are today the most popular type of fuel cells, and are employed in automotive, stationary and portable applications. The focus of much research in fuel cells in later years has been on reducing production costs and increasing lifetime, to reduce their total cost of ownership [1].
Electrochemical impedance spectroscopy (EIS) is a popular laboratory technique to investigate the degradation state of fuel cells; it identifies and distinguishes processes occurring with different time constants by analysing the relationship between a small sinusoidal perturbation of current or voltage applied to a fuel cell. However, EIS in general cannot be deployed in commercial applications because of the size and cost of the required equipment, the duration of the tests, and not least the complexity of the results, which require highly trained personnel to interpret and act upon.
An extended interpretation of PEMFC impedance spectra featuring resonant elements is the equivalent-circuit model is shown in figure 1; its impedance spectrum consists mainly of a series of capacitive loops at high and medium frequencies, followed by an inductive loop at the lowest frequencies (0.2 Hz to 0.01 Hz) [2]. Literature data on the low-frequency loop of EIS spectra appears to indicate a relation to humidification phenomena [3] or mass transport and diffusion processes [4].
When subjecting PEMFCs to accelerated stress tests, Pivac et al. [5] found that the resistance in the cathode resonant circuit (R 4 in figure 1) is linearly dependent on degradation, and is therefore a good candidate prognostic variable, i.e. a variable from which the degradation state of the cell can be easily assessed. This resistance, however, is in parallel with an inductance, meaning that at steady state it is "shorted out" and not measurable: its measurement requires dynamic operation.
While EIS would be the obvious candidate method in a laboratory, it is not deployable in commercial applications. Several alternative methods have been devised for low-cost, on-line implementation of EIS-like diagnostic tools: current pulse injection to measure impedance at high and medium frequencies [6], multi-sine perturbation [7], specific tools to detect flooding or dry-out [8], pseudo-random binary sequences with wavelet [9] and fast Fourier transforms [10], and load modulation [11].
Our contribution is a simple, cheap, fast, self-correcting algorithm, named electrochemical low-frequency impedance spectroscopy (ELFIS), to estimate the prognostic variable R 4 with minimum disruption to the underlying process. The key idea is to induce a small perturbation at the specific frequency at which the EIS spectrum intersects the real axis: from the value of impedance at that point it is possible to calculate R 4 . This frequency is however unknown and must be identified: this can be done with a modified relay excitation feedback, a classical method for tuning of PID controllers [12].

A. Fuel-Cell Model
The fuel cell is modelled as an impedance composed of the items laid out in figure 1, with the values of resistances, inductances and capacitances given in table I; these values represent nominal conditions [2]. When subject to sinusoidal oscillations in either of them, the amplitude ratio and phase shift of voltage and current are expressed by a frequencydependent complex impedance; this can be interpreted as a transfer function between current and voltage in the context of control theory.
Some sampled EIS spectra are presented in figure 2. The data point we seek is the rightmost intersection of the spectra with the real axis, which we refer to in the following as the low-frequency resistance or LFR [5]. By definition, the EIS spectrum corresponding to the LFR has zero phase, i.e. ∠Z(f LFR ) = 0 and R LF = |Z(f LFR )|.

B. Classical Relay Feedback
In process control, a relay is a simple element that essentially implements the sign function: The relay function R(e) is thereby a single-input, singleoutput, stateless function, trivial to implement in software. The classical application of relay feedback is shown in figure 3, where all variables are assumed to be normalised around zero. G(s) is a stable, positive-gain, low-pass transfer function, and a relay is immediately upstream it in a feedback loop. This configuration induces an oscillation cycle: a positive y will immediately produce a negative u, which will in turn eventually result in a negative y, depending on the internal dynamics of G(s); the cycle will then be repeated indefinitely with a continual inversion of the relay sign.
These oscillations naturally converge to the system's ultimate frequency f u , where the system's input and output are in opposite phase, i.e. ∠G(j 2 π f u ) = 180 • . The ultimate frequency and its associated ultimate gain are important parameters for tuning of PID controllers [12].

C. Adaptation of Relay Feedback to Fuel Cells
While the classical relay feedback of figure 3 is designed to converge to the frequency associated with a 180 • phase difference, the intersection of EIS spectra with the real axis in figure 1 occurs at a phase of 0 • . Furthermore, fuel cells do not have a low-pass characteristic, and high-frequency components must be filtered out to avoid relay chattering.
Both these objectives can be achieved by the introduction of two integrators in the feedback loop, as shown in figure 4, since each integrator: • dampens signals proportionally to their frequency; • adds a phase lag of 90 • to all frequencies. Thereby, the two integrators in the feedback loop strongly dampen high-frequency noise, and invert the phase of the input signal at all frequencies, including that (yet unknown) of the LFR. The modified relay feedback will converge to a limit cycle at frequency f LFR , since ∠Z(j 2 π f LFR ) = 0 • .
An important advantage of this method is that integrators have minimal computational and memory requirements for software implementation, as they need to store one single value and perform one sum per evaluation cycle.

D. Compensation of Voltage Bias
During operation it is common for a fuel cell's voltage to slowly drift, because of e.g. changes in humidity, temperature, or degradation. This deviation can cause a voltage bias that will make the oscillations asymmetric and reduce the accuracy of the method presented above. It is however possible to provide a cheap on-line estimation of this bias with a gradient method [13, § 4.3.5].
Assuming we are not too far from the LFR frequency, we have Z ≈ R LF , and the following model is then valid: where δV m is the modelled voltage deviation, R LF is the estimated low-frequency resistance and V bias is the estimated voltage bias. The model error ε is the deviation between measured and modelled voltage: where θ is the parameter vector and the equation has been converted to matrix form. An appropriate cost function to minimise to find the best parameter estimate is: and its gradient in parameter space is: Then, the minimising trajectory in parameter space is given by the opposite of the gradient multiplied by an adaptive gain Γ is symmetric and positive definite, and we can choose it for simplicity to be diagonal: Inserting the definition of Γ into vector equation 6, the following two equations result: These two equations can be integrated online to track the parameter estimates. Tuning γ R and γ V is a separate control engineering task: they can be chosen from a wide range, with larger values improving convergence but reducing stability. This algorithm can be easily implemented as a block diagram as depicted in figure 5, requiring just sums, multiplications, and memory storage of the two integrator states. As an additional bonus, the estimator also provides an on-line estimate of R LF .

III. SIMULATIONS
The overall model represented in figure 6 was implemented and run in Simulink, with the fuel cell's impedance model Z of figure 1 and the fitted parameters of table I: for these values, the LFR is R LF = 8.3 mΩ and occurs at f LFR = 0.35 Hz. Figure 7 shows the result of a 60 s simulation of the relay feedback in terms of the inputs and outputs of the relay and the fuel cell. The bias-corrected voltage (red) fits the measured voltage (blue) so well they are difficult to distinguish after  a rapid convergence time. The resulting estimates for LFR and voltage bias are shown in figure 8, indicating convergence within just 5 s. The estimated LFR cycles between 8.2 mΩ and 8.6 mΩ, which is close to the known value of 8.3 mΩ; a more precise estimate may be obtained with a low-pass filter or with offline least-squares.
Results show that the proposed method is fast, robust, precise and accurate. However, it is vital that the fuel cell control system has a sufficiently fast sampling rate, e.g. 10 ms to 20 ms, and that the relay is likewise prompt. As the necessary perturbations are rather small, these measurements are unlikely to lead to additional degradation of the fuel cells.

IV. EXPERIMENTS
The method was tested on a full-size fuel cell stack at the laboratory of ElringKlinger AG in Dettingen an der Erms, Germany; the experimental rig is sketched in figure 9. As the laboratory's electronic load would have required major reprogramming to implement a relay feedback, it was instead emulated by connecting in parallel to the stack a 10 Ω resis- tance (TE Connectivity TE1500B10RJ) with a solid-state relay (Crydom D2425) to connect and disconnect the resistance from the stack; the electronic load was left in constant-current mode, also connected in parallel to the stack.
The solid-state relay was controlled with a National Instruments data acquisition unit (DAQ, USB-6002) controlled by a LabVIEW program that independently sampled the stack's voltage with a custom-built voltage reducer.
A numerical issue that was not apparent during simulations was the bias estimator's numerical instability, as equations 8 and 9 are stiff. While this is automatically taken care of in Simulink thanks to its automatic selection of integration method, LabVIEW (and any real-time control system) takes samples at fixed intervals, in our case every 10 ms, and the algorithm rapidly diverges.
Two approaches are possible: either one significantly detunes Γ, reducing convergence speed (which may be acceptable, given the excellent results of figure 8), or one implements the estimator's equations with a more stable implicit integration method, such as the Backward Euler. The Backward Euler implementation of the estimator in LabVIEW is presented in figure 10; while it successfully stabilises the estimator without compromising on the convergence speed, it is noticeable that the implementation is much less readable than figure 5.
Applying ELFIS on the full stack with the estimator's Backward-Euler implementation yielded the results plotted in figure 11. It is noticeable how the voltage bias keeps drifting, which is likely due to the way the experiment was run: instead of oscillating around a steady-state, current was increased every time the resistance was connected, and then returned to the initial state when it was shunted out: the average current was therefore not the one of the original steady-state, and a slow transient was initiated.
On the other hand, the estimated LFR estimate, while noisy, remained at the same level, and with the application of a lowpass filter (time constant 1 min) it appears reasonably stable at 0.224 Ω. The relay feedback's oscillation frequency converges at about 0.2 Hz.

V. CONCLUSION
A simple algorithm based on relay feedback can measure the low-frequency intercept of the EIS spectrum of fuel cells, which is a prognostic variable able to indicate the degradation status of the cells. The method has been tested in simulations and experiments, indicating the ability to converge to a solution within few seconds and in spite of both voltage bias and noise.
The algorithm requires only simple operations (comparison, sum, multiplication) and storage of four floating-point numbers: it is therefore amenable to online implementation in commercial system for continuous monitoring of the state of health of fuel cells.
The algorithm presents some issues of numerical instability, which can be resolved either by estimator detuning or implicit implementation.