**2. Battery Modelling**

The most common model used to describe battery behaviors in EVs application is the equivalent circuit model. For an LFP battery running drive cycles that are highly dynamic, such as UDDS, an ECM with at least two RC pairs is recommended [15]. This is because the first order ECM neglects the effect of diffusion. However, the higher the model order is, the more computational effort it demands, due to the larger number of model parameters. For the implementation of the proposed FDI, it is not required for the model to have grea<sup>t</sup> accuracy, since the extraction of ECM parameters is used to monitor the state of battery operation, rather than to model the battery performance. Therefore, in order to optimize the computational complexity of the approach, the first order ECM is used in this paper. The simplified ECM model is shown in Figure 1.

**Figure 1.** Schematic of a first order equivalent circuit model (ECM).

The state space equation of this battery model can be expressed as follows:

$$\begin{array}{l} \dot{\mathcal{U}}\_{1} = \frac{I}{\mathcal{C}\_{1}} - \frac{\mathcal{U}\_{1}}{\mathcal{C}\_{1}\mathcal{R}\_{1}}\\ \mathcal{U}\_{eq} = \mathcal{O}\mathcal{C}V - \mathcal{U}\_{1} - IR\_{0} \end{array} \tag{1}$$

In order to perform the proposed recursive approach on the model, an autoregressive exogenous model is needed. This is done through obtaining the transfer function of the battery impedance from Equation (1) in the s-domain, as shown in Equation (2). The transfer function is then discretized using the basic forward Euler transformation method, in which s is replaced by 1−*z*<sup>−</sup><sup>1</sup> *T*.*z*<sup>−</sup><sup>1</sup> , where *T* is the sampling time. The discretization is shown in Equation (3) below.

$$G(\mathbf{s}) = \frac{\mathcal{U}\_2(\mathbf{s})}{I(\mathbf{s})} = -R\_0 - \frac{R\_1}{1 + sR\_1C\_1} \tag{2}$$

$$G(z) = \frac{a\_2 + a\_3 z^{-1}}{1 + a\_1 z^{-1}} \tag{3}$$

where

$$a\_1 = \frac{T}{R\_1 C\_1} - 1\tag{4}$$

$$a\_2 = -R\_0 \tag{5}$$

$$a\_3 = R\_0 - \frac{T}{C\_1} - \frac{TR\_0}{R\_1 C\_1} \tag{6}$$

*R*1 and *C*1 can be determined as follows:

$$R\_1 = \frac{a\_1 a\_2 - a\_3}{1 + a\_1} \tag{7}$$

$$C\_1 = \frac{T}{a\_1 a\_2 - a\_3} \tag{8}$$

The autoregressive exogenous model can then be obtained as follows:

$$y\_k = OCV\_k + a\_1(OCV\_{k-1} - y\_{k-1}) + I\_k a\_2 + I\_{k-1} a\_3 \tag{9}$$

with *yk*, which can be rewritten as:

$$y\_k = \theta\_k^T \phi\_k \tag{10}$$

where

$$\theta\_k = \begin{bmatrix} 1; a\_{1,k}; a\_{2,k}; a\_{3,k} \end{bmatrix} \tag{11}$$

$$\phi\_k = \left[ \text{OCV}\_k; (\text{OCV}\_{k-1} - y\_{k-1}); I\_k; I\_{k-1} \right] \tag{12}$$

The values for OCV (open-circuit voltage) in Equation (12) will be determined from the OCV–SOC relationship, established experimentally. This reduces the computational effort for θ*k*, which gives more accurate ECM parameter estimations. Equations (10)–(12) will be used in the proposed RLS algorithm, and Equations (5), (7), and (8) will be used to extract the ECM parameters for the purpose of fault diagnosis.
