# A Fault Diagnosis Design Based on Deep Learning Approach for Electric Vehicle Applications

Tehrani Kambiz, Halid Kaplan, Mo Jamshidi

► To cite this version:

Tehrani Kambiz, Halid Kaplan, Mo Jamshidi. A Fault Diagnosis Design Based on Deep Learning Approach for Electric Vehicle Applications. Energies, 2021, 14 (20), pp.6599. 10.3390/en14206599. hal-03518644

HAL Id: hal-03518644

https://normandie-univ.hal.science/hal-03518644v1

Submitted on 19 May 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Article

# A Fault Diagnosis Design Based on Deep Learning Approach for Electric Vehicle Applications

Halid Kaplan<fnref n="1" />, Kambiz Tehrani<fnref n="2" />* and Mo Jamshidi<fnref n="1" />

**Abstract:** Diagnosing faults in electric vehicles (EVs) is a great challenge. The purpose of this paper is to demonstrate the detection of faults in an electromechanical conversion chain for conventional or autonomous EVs. The information and data coming from different sensors make it possible for EVs to recover a series of information including currents, voltages, speeds, and so on. This information is processed to detect any faults in the electromechanical conversion chain. The novelty of this study is to develop an architecture for a fault diagnosis model by means of the feature extraction technique. In this regard, the long short-term memory (LSTM) approach for the fault diagnosis is proposed. This approach has been tested for an EV prototype in practice, is superior in accuracy over other fault diagnosis techniques, and is based on machine learning. An EV in an urban context is modeled, and then the fault diagnosis approach is applied based on deep learning architectures. The EV and the fault diagnosis model is simulated in Matlab software. It is also revealed how deep learning contributes to the fault diagnosis of EVs. The simulation and practical results confirm that higher accuracy in the fault diagnosis is obtained by applying the LSTM.

**Keywords:** artificial neural network (ANN); data analytics; deep learning; electric vehicles; fault diagnosis; long short-term memory (LSTM)

<figure><img src="image_2.png" /></figure>

check for
updates

**Citation:** Kaplan, H.; Tehrani, K.; Jamshidi, M. A Fault Diagnosis Design Based on Deep Learning Approach for Electric Vehicle Applications. *Energies* **2021**, *14*, 6599. https://doi.org/10.3390/en14206599

Academic Editor: Wencheng Guo

Received: 6 July 2021

Accepted: 28 September 2021

Published: 13 October 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_3.png" /></figure>

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## 1. Introduction

Control of smart cities is becoming more difficult due to widespread use of electric vehicles (EVs) along with development of electricity generation. EVs can play a vital environmental role and be regarded as future individual and public transportation due to their decarbonization feature [1,2]. EVs show more energy efficiency in comparison with conventional gasoline or diesel-based vehicles [2–6]. In the long term, EVs can be treated as energy storage devices and thereby provide great opportunities and ancillary services for microgrids such as voltage regulation, frequency regulation, and so on in the form of vehicle-to-grid (V2G) technology [4,5,7,8].

Faults in the components of microgrids such as EVs and distributed energy resources are inevitable [9]. EVs have several electrical parts and energy conversion chains. To maximize their lifetimes, a fault diagnosis (FD) approach is necessary to be applied. In the literature, several techniques such as multiple sensors, the probability approach, algorithmic approach, artificial intelligence (AI), and machine deep learning [3,10–12] have been proposed for the FD. These techniques can be even used simultaneously. An FD approach has also evolved rapidly to become a viable alternative to traditional health care solutions [1–5].

The FD is also essential for maximizing system availability and reducing operating costs. A monitoring approach embedded in an on-board microcontroller can be applied to several components in EVs including the energy storage elements (batteries and supercapacitors), battery management unit, semiconductor devices, power electronic converters, electric motors, sensors, and so forth [13–15]. Each component can cause various faults.

<footnote n="1">¹ Department of Electrical and Computer Engineering, University of Texas at San Antonio, San Antonio, TX 78249, USA; halid.kaplan@utsa.edu (H.K.); mojamshidi4@gmail.com (M.J.)</footnote>

<footnote n="2">² Department of Energy and Control, Normandy University, 76800 Rouen, France</footnote>

<footnote>* Correspondence: tehrani@esigelec.fr or kambiz.tehrani@ieee.org</footnote>
For instance, a problem in the semiconductor devices due to high voltage or high switch-
ing frequency can be considered as open-circuit or short-circuit faults [16–18]. Another
problem that degrades the operation of the semiconductor devices can be related to the
problems of power driver modules.

FD systems can be divided into two categories: model-based and data-based systems. The former depends on mathematical modeling and the latter does not require modeling and parameters thereof [19]. Robust FD methods are used to adopt traditional diagnosis approaches. There is a high demand for advanced data-based FD approaches that can accurately monitor faults through classification and feature extraction of deep learning for correct and faulty data sets. The quality and reliability of the collected data from a variety of sensor measurements such as voltages and currents are key factors for EVs. In this paper, an FD system with the real values obtained in the experiments has been developed, and then a real simulation model to apply the FD tool has been developed. Section 2 reviews the literature and examines the different machine learning (ML) techniques. Section 3 defines the problem in the FD of EVs and the purpose of the research study. Section 4 introduces the research methodology and simulations. Section 5 discusses the results of the different models. Section 6 presents the conclusion of the article and the potential future work.

## 2. Data Analytics and Deep Learning in EVs

Big data can be used to assess the capability of data-analyzing algorithms and the
corresponding capacity of hardwares to handle large data sets [20]. In keeping with the
fast growth of technology and advances in measurement techniques, the volume of the
data generated in EVs (electric motors, multi-energy systems, power electronic converters,
and so on) has been increased significantly. Because the amount of the generated data is
growing exponentially, the data structure is becoming much more complex. This creates
new challenges in analysis methods. Big data requires appropriate data analysis tools to
tackle the problem of the FD. The growing interest and recent breakthroughs in AI and ML
have actively contributed to the development of new methods for FD and fault prognosis
approaches. Figure 1 illustrates the FD methods which have been a hot topic [21] around
the world. As mentioned in [22], the results of the FD can provide many benefits and
save costs. Because the number of EVs in smart cities is increasing, researchers are being
motivated to discover new better FD methods for EVs as a necessity to securely analyze
EVs and operate them.

<figure><img src="image_4.png" /><figcaption>Figure 1. FD methods in EVs.</figcaption></figure>
FD is a fundamental subject for the operation of EVs in the context of a smart city. The main type of AI-based models, artificial neural networks (ANNs), is commonly used in control systems, especially nonlinear control applications because of their incredible learning ability. The ANN training process can be done during an iterative algorithm consisting of a complicated equation to calculate the output values depending on the given sets of the input values. The learning process means updating and determining the synaptic weights. Because of the self-learning ability, ANNs can build a relationship between the inputs and outputs from historical data. Moreover, there are different connection styles and learning algorithms. Several architectures and algorithms have been proposed to solve different problems in nonlinear systems [23]. In [24], an ANN is implemented for an EV monitoring system. The FD protects EVs from damage caused by voltage and current instability [25]. The ANN and space vector machine (SVM) classifier are also used in monitoring and fault identification of a three-phase induction motor [16,26,27].

ML methods are utilized in learning functional relationships between the data [28]. Deep learning has attracted a great deal of attention in recent years due to its outstanding performance in many fields like image processing, speech recognition, and pattern recognition [29,30]. Deep learning, which is one of the ML techniques, has recently showed remarkable results in a variety of fields. The main concept in deep learning algorithms is to automate the mining of data representations [23]. Deep learning methods extract meaningful features by using a huge amount of unsupervised data. Deep learning is a collection of simple trainable mathematical units that learns complex functions [29]. This architecture improves ANNs with better training methods; it makes learning algorithms much easier to show better performance. Feature representation attempts to learn good features automatically. Deep learning can learn multiple levels of representation. These algorithms are enhanced by AI which aims to imitate the human's brain ability to analyze, learn, and make decisions on very complex problems like EVs and smart grids. For the FD, there must be signs of the critical fault occasion. Abrupt voltage and current changes can be regarded as some signs of faults. Meanwhile, some faults have no signs, so they are hard to be predicted. Most of the faults which have signs could possibly be detected by deep-learning-based FD approaches. EVs usually have an induction motor which often gives overload faults. However, under constant-load conditions, the fault monitoring in the induction motor using digital signal processors (DSPs) gives excellent results, while they cannot perform efficiently enough when the load is varied [31]. The parameters are time-varying in FD approaches of EVs, and so designers tend to model parameter estimators with deep algorithms. This paper will use the long short-term memory (LSTM) network, which is a deep learning approach for the FD of EVs.

### 3. Problem Statement

EVs usually contain a three-phase inductor motor as a vital part of their configuration. The three-phase induction motors are the most commonly used motors because they have certain advantages such as reliability and low cost. There are two categories of faults in EVs: electrical faults and mechanical ones. Timely detection and accurate FD is essential to the efficient operation of the induction motors in EVs. Also, simultaneous faults in the induction motors can lead to extreme interruptions and losses.

AI techniques such as ANN, SVM, and fuzzy systems are known as attractive alternatives to traditional hard computing methods that cannot easily diagnose different faults in the induction motors. In addition, traditional methods require long computational times. Therefore, an AI model based on expert systems, ANN, and fuzzy logic is used to solve this problem [32]. FD has proven to be a complex problem because of non-linearity. This problem cannot be solved by using a simple analytical formulation. The FD must have advanced data analytics and deep learning tools to decrease the cost of maintenance and instabilities. The FD in EVs with AI techniques have proved to be a useful tool to solve these issues. Nowadays, the most widely used methods are deep learning approaches. They are appropriate for the problem of energy-related fields [33].
In this paper, an FD approach with the experimental results of an EV prototype is proposed and the use of deep learning to perform the automated FD is discussed. An EV is simulated and the collect data, that may be related to faults such as voltages, currents, phase angles, and so on, is analyzed. It is inserted into the simulation to obtain faulty data to train the model. In addition, an LSTM model that provides the FD for a fault is developed. The model will be tested by comparing the actual outputs of the simulation. The accuracy of the proposed model will be compared to an ANN to present how the deep learning provides the FD.

**4. Methods**

As an experimental part of this research study, two induction motors supplied by inverters are integrated into the EV. Pulse width modulation (PWM) is commonly used in the power electronic converters of EVs [13,34,35]. A space vector pulse width modulation (SVPWM) control is applied in this system. The SVPWM is a more sophisticated technique to provide a higher voltage to the induction motor than a classical sine pulse width modulation. The SVPWM uses the eight fundamental voltage vectors to realize the variable frequency of voltage and speed adjustment, and it offers better DC bus utilization. Figure 2 shows the EV prototype test bench. Figure 3 presents the data of the different sensors, current, voltage, and speed sensors, for different driving cycles. The FD approach provides the detection of any type of failure for the electrical components in this EV shown in Figure 2.

<figure><img src="image_5.png" /><figcaption>**Figure 2.** EV prototype test bench (a) under test on a roll bench (b) different sensors connected to the EV (c) on a dynamometer for the different measurements</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 3.** Data from the sensors when the EV is under test.</figcaption></figure>

The phase voltages can be expressed in terms of Fourier coefficients:
$$ 
\begin{aligned}
V_a &= \frac{V_{DC}}{2} \sum_{n=0}^{\infty} A_n \sin(n\omega t + \phi_n) \\
V_b &= \frac{V_{DC}}{2} \sum_{n=0}^{\infty} A_n \sin(n(\omega t - 2\pi/3) + \phi_n) \\
V_c &= \frac{V_{DC}}{2} \sum_{n=0}^{\infty} A_n \sin(n(\omega t + 4\pi/3) + \phi_n).
\end{aligned} 
\quad (1) $$

$\phi$ is the phase angle in radian, $\omega$ is the angular frequency of the waveform in radian per second, and $A_n$ is the amplitude of the waveform. The line-to-neutral voltages ($V_{an}$, $V_{bn}$, $V_{cn}$) may be calculated directly from the line-to-ground voltages ($V_{ag}$, $V_{bg}$, $V_{cg}$). The phase-to-neutral voltages can be expressed as follows:

$$ \begin{bmatrix} V_{an} \\ V_{bn} \\ V_{cn} \end{bmatrix} = \frac{1}{3} \begin{bmatrix} 2 & -1 & -1 \\ -1 & 2 & -1 \\ -1 & -1 & 2 \end{bmatrix} \begin{bmatrix} V_{ag} \\ V_{bg} \\ V_{cg} \end{bmatrix}. \quad (2) $$

The voltages of the inverter can also be presented in the d-q reference frame:

$$ \begin{bmatrix} V_{dn} \\ V_{qn} \\ V_{0n} \end{bmatrix} = \frac{2}{3} \begin{bmatrix} \cos \theta & (\cos \theta - 2\pi/3) & (\cos \theta + 2\pi/3) \\ \sin \theta & (\sin \theta - 2\pi/3) & (\sin \theta + 2\pi/3) \\ 1/2 & 1/2 & 1/2 \end{bmatrix} \begin{bmatrix} V_{an} \\ V_{bn} \\ V_{cn} \end{bmatrix}. \quad (3) $$

The characteristics of the electric motor and the inverter used in modeling and the simulation results have been brought up in the Table 1.

<table><caption>Table 1. Characteristics of the electric motor and the inverter.</caption><thead><tr><th>Type of the Electric Motor</th><th>Induction</th></tr></thead><tbody><tr><td>Rated power</td><td>4 kW</td></tr><tr><td>PWM frequency</td><td>15 kHz</td></tr><tr><td>DC bus voltage (V<sub>DC</sub>)</td><td>48 V</td></tr><tr><td>Frequency</td><td>135 Hz</td></tr><tr><td>Rated voltage</td><td>28 V</td></tr><tr><td>Rated current</td><td>110 A</td></tr><tr><td>Number of pole pairs</td><td>2</td></tr><tr><td>Rated speed</td><td>3900 tr/min</td></tr><tr><td>Rated couple</td><td>9.8 Nm</td></tr></tbody></table>

The practical tests of the engine of the EV made it possible to obtain the engine parameters which have given in Table 2.

<table><caption>Table 2. Parameters of the electric motor.</caption><thead><tr><th>Parameter</th><th>Symbol</th><th>Value</th><th>Unit</th></tr></thead><tbody><tr><td>Stator resistance</td><td>R<sub>s</sub></td><td>14.7</td><td>mΩ</td></tr><tr><td>Rotor resistance</td><td>R<sub>r</sub></td><td>2.34</td><td>mΩ</td></tr><tr><td>Stator inductance</td><td>L<sub>s</sub></td><td>340</td><td>μH</td></tr><tr><td>Rotor inductance</td><td>L<sub>r</sub></td><td>340</td><td>μH</td></tr><tr><td>Mutual inductance</td><td>M</td><td>310</td><td>μH</td></tr><tr><td>Moment of inertia</td><td>J</td><td>0.025</td><td>Kg·m<sup>2</sup></td></tr><tr><td>Friction coefficient</td><td>f</td><td>0.007</td><td>Nm·s/rad</td></tr></tbody></table>

The characteristic curves provided by the manufacturer at the output of the electric motor are illustrated in Figure 4. These characteristics are used in the simulation. This allows us to apply the FD method in a real context. With deep learning and data analytics, monitoring can be more effective for maintenance. Data analytics is the computational
procedure for determining the relations between variables using methods such as database, clustering, ML, regression, and classification. However, because of the numerous sources, the collected data sets might be of different levels of quality in terms of redundancy and consistency. The application of data analytics in EVs aims to extract useful knowledge from sensor data that can be used for FD of EVs. In this part, a data-based FD model will be introduced in the form of simulation. The data set used to train the network is acquired from the simulation of the EV. Voltage and current measurements for both correct and faulty conditions are done. At the first step, large amounts of the data collected from sensors are reshaped to train and test our model. A data set consists of 150,000 current or voltage samples for each type of disturbance. The number of the data sets reaches 600,000. Eighty percent of the data sets are used as training sets. The next step is to develop a model using deep learning technique that is suitable for feature extraction from stored data. The created model can be tested by comparing the real-time measurements and the outputs of the model. The successful model provides crucial information to overcome FD problems of the EV. Figure 5 shows the flow chart of the FD method.

<figure><img src="image_7.png" /><figcaption>**Figure 4.** Specifications of the EV given by the manufacturer.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Figure 5.** Flow chart of the proposed FD method.</figcaption></figure>
An LSTM network is composed of memory blocks called cells. It has two states: the cell states and the hidden states. The states are transferred between the cells. The cell state is the main chain of the data flow. As previously mentioned, a ML architecture like the LSTM network, which is a deep-learning-based model, and an ANN is designed by means of Matlab software. Figure 6 illustrates the basic structure of the LSTM model for the FD design of EVs. The LSTM network can solve long-term and short-term dependency problems. Figure 7 shows the layers of the LSTM. The hidden layer of the LSTM is called a memory cell which is the fundamental part of the LSTM [36]. There are three gates: input gates, output gates, and forget gates. The input gate defines which inputs will be kept in the next state. The forget gate decides which of the previous state information is not saved. These two gates allow the states to be updated and the information to be added to or to be removed from the memory cell. The LSTM updates the state of the cell to calculate the best output of the LSTM network. This updating process improves the accuracy of the network. Finally, the output gate defines which information in the new state will be the output of the cell. The output of the hidden layers of the LSTM at the time t is mathematically described as:

$$h_t = \tanh(w_{hx} * X_t + w_{hh} * h_{t-1} + b_h), \quad (4)$$

$$i_t = \sigma(w_{ix} * X_t + w_{ih} * h_{t-1} + b_i), \quad (5)$$

$$f_t = \sigma(w_{fx} * X_t + w_{fh} * h_{t-1} + b_f), \quad (6)$$

$$o_t = \sigma(w_{ox} * X_t + w_{oh} * h_{t-1} + b_o), \quad (7)$$

$$\hat{C}_t = \tanh(w_{cx} * X_t + w_{ch} * h_{t-1} + b_c), \quad (8)$$

$$s_t = f_t \otimes s_{t-1} + i_t * \hat{C}_t, \quad (9)$$

$$h_t = \tanh(s_t) \otimes o_t. \quad (10)$$

<figure><img src="image_9.png" /><figcaption>Figure 6. Design of the LSTM network.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Figure 7. Layers of the LSTM.</figcaption></figure>
The structures of the LSTM are presented in Figure 6 where $i_t$, $f_t$, $o_t$, and $\hat{C}_t$ represent the input gate, forget gate, output gate, and output of the input cell, respectively; $w_{ix}$, $w_{fx}$, $w_{ox}$, and $w_{cx}$ represent the weights of the input data of $X_t$ for the input gate, forget gate, output gate, and input cell, respectively; $w_{ih}$, $w_{fh}$, $w_{oh}$, and $w_{ch}$ denote the weights of the previous output ($h_{t-1}$) of the hidden layer of the LSTM; $b_i$, $b_f$, $b_o$, and $b_c$ are the input gates, forget gates, output gates, and input cell bias vectors, respectively; $C_t$ is the cell input; $s_t$ and $s_{t-1}$ are the current cell states at the times $t$ and $t-1$; $h_t$ refers to the output of the current hidden state; $\sigma$ is the sigmoidal function; $\otimes$ is the element-wise multiplication; and eventually tanh is the hyperbolic tangent function.

It is crucial to properly select the algorithm parameters affecting the training performance [37]. The learning rate is a key parameter for LSTM networks. It affects the error convergence and the modification of the network’s weights. After comparing the results, the learning rate was determined to be 0.005. After numerous parameters were applied to the LSTM model to find the optimal one, the LSTM model was built with 50 neurons for the FD of the EV. The dropout layer was used to prevent over-fitting. The probability of the dropout layer was set at 0.5 which was a default for training. Different epochs like 100, 250, and 500 were tested. The errors during training were obtained: 3.86 (12 min), 3.82 (35 min), and 3.63 (61 min). When the epochs were set bigger than 100, the training times were extremely increased, but the accuracy of the model did not increase very much. Thus, the epochs of training were adjusted at 100. Model parameters were set as shown in Tables 2 and 3. After training, the faulty and correct data sets obtained from the EV simulation were employed to validate the trained LSTM model.

<table><caption>**Table 3.** Parameters of the built LSTM model.</caption><thead><tr><td>Parameter</td><td>Value</td></tr></thead><tbody><tr><td>Initial learning rate</td><td>0.005</td></tr><tr><td>Activation function</td><td>Sigmoid</td></tr><tr><td>Loss function optimizer</td><td>Adam</td></tr><tr><td>Max training epochs</td><td>100</td></tr><tr><td>Loss function 1</td><td>Root mean square error (RMSE)</td></tr><tr><td>Loss function 2</td><td>Mean absolute percent error (MAPE)</td></tr><tr><td>Number of hidden units</td><td>50</td></tr><tr><td>Learn rate drop fact.</td><td>0.2</td></tr><tr><td>Probability of the dropout layer</td><td>0.5</td></tr></tbody></table>

As presented in Figure 8, an EV based on an electromechanical conversion chain is regarded as the power system model in this paper. Several faults are inserted into the system to validate the system’s performance. The discrete time and continuous voltages and currents of the simulation are delivered to the FD analysis. The most commonly used parameters are currents and voltages in the FD. Electrical faults in EVs can be classified as open-circuit and short-circuit faults. These faults can be identified by monitoring and diagnosing each phase voltage and currents [38]. Abnormal voltage changes may lead to open-circuit faults, and abnormal current changes may lead to a short-circuit fault. Line-to-ground (LG) and line-to-line (LL) faults may also occur. The more different faults can be simulated to have larger data-sets which certainly improve the performance of the FD model.
VIRTUOSE Asynchronous Machine Vector Control

<figure><img src="image_11.png" /><figcaption>**Figure 8.** Simulation of the EV with Matlab/Simulink.</figcaption></figure>

As depicted in Figure 9, a technique using both correct and faulty conditions of the currents and voltages has been developed. The outputs of the LSTM are used to show the fault occurrences. This approach gives data from current and voltage examinations in the EV to accomplish the FD with the LSTM concept. The Matlab-based LSTM technique has achieved higher diagnostic accuracy in detecting faults in the EV. Faults are inserted into a Simulink model by creating short-circuit and open-circuit faults. A circuit breaker is used to create them. The current and voltage outputs of the proposed Simulink model are used to make a data set for the proposed LSTM architecture. To illustrate how deep learning architectures enhance the performance of the FD, a shallow ANN has been implemented as well.

<figure><img src="image_12.png" /><figcaption>**Figure 9.** Fault detection when the line-to-ground fault occurs in $I_c$.</figcaption></figure>

**5. Results**

In this paper, the characteristics of the inverter plus the electric motor have been measured and validated so as to compare the results with those given by the manufacturer. To reach such a purpose, a vehicle dyno-roll bench test has been employed as shown in Figure 2. A vehicle dyno-roller bench makes it possible to determine the output power of the engines by measuring the power at the wheels and the losses in the vehicle transmissions. By knowing the power and the rotation frequency of the electric motors (transmission ratio), it is feasible to calculate their torque. The power measurement is
carried out for a speed ramp of 30 s in the iso-speed mode of the dynamometer under full load (accelerator 100%). The EV has two electric motors: a front electric motor and a rear electric motor. Several tests on this EV have been carried out to compare them to the specifications given by the manufacturer in Figure 4. The overall characteristics of the two engines in the measurements have been presented in Figure 10.

<figure><img src="image_13.png" /><figcaption>**Figure 10.** Different tests carried out on the roll bench.</figcaption></figure>

As depicted in the figures, the results given by the manufacturer match those of the tests. Moreover, the different sensors connected to the EV provide different curves for the different driving cycles. These curves have been recorded in the vehicle microcomputer, and then anomalies in the different driving cycles can be detected. Neural-network-based FD methods, stochastic deep learning techniques, and deep architectures provide a multi-directional connection between neurons and are expected to increase the accuracy. Based on the available data and by designing FD methods based on deep learning, the FD architectures can be enhanced. To check the performance of the models, as illustrated in Table 4, an error calculation index like MAPE can be defined. $X(t)$ and $\hat{X}(t)$ are the actual and predicted outputs.

<table><caption>**Table 4.** Definition of two indices for the calculations.</caption><thead><tr><th>Index</th><th>Equation</th></tr></thead><tbody><tr><td>MAPE</td><td>(Σ<sup>N</sup><sub>t=1</sub> |X(t) - X̂(t)/X(t)|)/N</td></tr><tr><td>RMSE</td><td>√(Σ<sup>N</sup><sub>t=1</sub> [X(t) - X̂(t)]<sup>2</sup>)/(N - 1)</td></tr></tbody></table>

The better performance of the LSTM compared to traditional networks like ANNs has been revealed. As shown in Table 5, the MAPE is 0.63 when the LSTM is used and the MAPE is 9.87 when the ANN is used. The prediction accuracy is improved in comparison with the ANN due to the feature extraction and the characteristics of the deep learning approach. Figure 11 illustrates the FD using the LSTM network. EVs can be operated more securely and reliably when accurate results are obtained.

<table><caption>**Table 5.** MAPE values for different fault types.</caption><thead><tr><th>Type of Fault</th><th>ANN</th><th>LSTM</th><th>Computation Time</th></tr></thead><tbody><tr><td>Swell</td><td>11.06</td><td>2.95 (97.05%)</td><td>15 min</td></tr><tr><td>Sag</td><td>9.67</td><td>3.03 (96.97%)</td><td>22 min</td></tr><tr><td>Line-to-ground</td><td>9.95</td><td>1.77 (98.23%)</td><td>25 min</td></tr><tr><td>Line-to-line</td><td>9.87</td><td>0.63 (99.37%)</td><td>24 min</td></tr><tr><td>Average</td><td>10.13</td><td>2.06 (97.94%)</td><td>21.5 min</td></tr></tbody></table>
<figure><img src="image_14.png" /><figcaption>Figure 11. $I_c$ when the line-to-line fault occurs in $I_b$ and $I_c$ for the LSTM.</figcaption></figure>

An ANN with 10 layers and 50 neurons per layer has been used. The sigmoid activation function was selected for it. As shown in Figure 12, the errors for the results are the lowest with an accuracy of 90.29% in terms of MAPE. The differences between the observed and predicted data can be easily noticed in Figure 12. The ANN is less effective in modeling and has computational problems such as slow convergence and local minimum which cause low accuracy as against the LSTM. The high accuracy achieved by the LSTM model is due to its capability to detect time-series data which are natural in the EVs’ data sets. The LSTM network controls the instantaneous information impact on the sensor data by adding memory cells helping the network save and transmit information over a long period of time. Unlike traditional models, the proposed LSTM network can achieve better performance because of the two-dimensional network which is composed of many memory units. A comparison with other models clearly shows that the proposed LSTM network can be employed with higher performance. Because FD in EVs can be viewed as a time-series problem, the LSTM network, that can update the states, has been suggested. Deep learning methods can successfully simulate highly nonlinear time series such as structured or unstructured output prediction. One of the novelties in this paper is that the LSTM architecture for the FD problem in EVs has been used. In Table 6, the performance of the proposed LSTM model is compared with the previous studies. It shows the proposed model improves the FD performance.

<figure><img src="image_15.png" /><figcaption>Figure 12. $I_c$ when the line-to-line fault occurs in $I_b$ and $I_c$ for the ANN.</figcaption></figure>
<table><caption>**Table 6.** Accuracy of some known methods.</caption><thead><tr><td>Method</td><td>Reference</td><td>Accuracy</td></tr></thead><tbody><tr><td>Kalman filter and fuzzy expert systems</td><td>[39]</td><td>96%</td></tr><tr><td>Extreme ML and particle swarm optimization</td><td>[40]</td><td>97.6%</td></tr><tr><td>Wavelet packet transform and genetic algorithm</td><td>[41]</td><td>98.33%</td></tr><tr><td>Fast Fourier transform and ANNs</td><td>[42]</td><td>95.65%</td></tr><tr><td>SVM</td><td>[43]</td><td>96%</td></tr><tr><td>Deep LSTM with voltage sag</td><td>This paper</td><td>96.97%</td></tr><tr><td>Deep LSTM with voltage swell</td><td>This paper</td><td>97.05%</td></tr><tr><td>Deep LSTM with line-to-ground</td><td>This paper</td><td>98.23%</td></tr><tr><td>Deep LSTM with line-to-line</td><td>This paper</td><td>99.37%</td></tr></tbody></table>

## 6. Conclusions and Future Work

This paper discussed FD methods in EVs and introduced a particular FD method for the induction motor of an EV to detect and diagnose the short-circuit and open-circuit faults. The deep learning method successfully extracted the features from the sensor data collected from the EV in practice and simulation. The model proposed in this paper applied the LSTM. The improved LSTM network based on deep learning was employed to diagnose the electrical faults and eliminated the local minimum problems in traditional diagnostics methods. The simulation and experimental results validated the viability of the proposed method in diagnosing multiple types of electrical faults in EVs. It was proven that the deep-learning-based FD models such as LSTM networks are much more accurate than traditional FD methods. As a future work, it is highly recommended that the FD approach proposed in this paper based on the LSTM is implemented for V2G technology in the context of a smart city.

**Author Contributions:** Conceptualization, H.K., K.T. and M.J.; methodology, H.K. and K.T.; software, H.K. and K.T.; validation, K.T. and M.J.; formal analysis, H.K.; investigation, H.K. and K.T.; writing—original draft preparation, H.K and K.T.; writing—review and editing, K.T; supervision, K.T. and M.J.; project administration, K.T. and M.J. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors would like to thank the Normandy region in France for its help within the framework of the VIRTUOSE project (EV project), and thank Mahdi Bayati for his support in this research study.

**Conflicts of Interest:** The authors declare no conflict of interest.

## Abbreviations

The following abbreviations are used in this manuscript:

<table><tr><td>AI</td><td>Artificial intelligence</td></tr><tr><td>ANN</td><td>Artificial neural network</td></tr><tr><td>DSP</td><td>Digital signal processor</td></tr><tr><td>EV</td><td>Electric vehicle</td></tr><tr><td>FD</td><td>Fault diagnosis</td></tr><tr><td>LSTM</td><td>Long short-term memory</td></tr><tr><td>MAPE</td><td>Mean absolute percentage error</td></tr><tr><td>ML</td><td>Machine learning</td></tr><tr><td>PWM</td><td>Pulse width modulation</td></tr><tr><td>RMSE</td><td>Root mean square error</td></tr></table>
<table><tr><td>SVM</td><td>Space vector machine</td></tr><tr><td>SVPWM</td><td>Space vector pulse width modulation</td></tr><tr><td>V2G</td><td>Vehicle-to-grid</td></tr></table>

## References

1. Bilgin, B.; Magne, P.; Malysz, P.; Yang, Y.; Pantelic, V.; Preindl, M.; Korobkine, A.; Jiang, W.; Lawford, M.; Emadi, A. Making the case for electrified transportation. *IEEE Trans. Transp. Electrif.* **2015**, *1*, 4–17.

2. Masuch, N.; Lützenberger, M.; Ahrndt, S.; Heßler, A.; Albayrak, S. A context-aware mobile accessible electric vehicle management system. In Proceedings of the 2011 Federated Conference on Computer Science and Information Systems (FedCSIS), Szczecin, Poland, 18–21 September 2011; IEEE: Piscataway, NJ, USA, 2011; pp. 305–312.

3. Bogosyan, S.; Gokasan, M.; Goering, D.J. A novel model validation and estimation approach for hybrid serial electric vehicles. *IEEE Trans. Veh. Technol.* **2007**, *56*, 1485–1497.

4. Zhao, L.; Prousch, S.; Hübner, M.; Moser, A. Simulation methods for assessing electric vehicle impact on distribution grids. In Proceedings of the IEEE PES T&D 2010, New Orleans, LA, USA, 19–22 April 2010; IEEE: Piscataway, NJ, USA, 2010; pp. 1–7.

5. Markel, T.; Kuss, M.; Simpson, M. Value of plug-in vehicle grid support operation. In Proceedings of the 2010 IEEE Conference on Innovative Technologies for an Efficient and Reliable Electricity Supply, Waltham, MA, USA, 27–29 September 2010; IEEE: Piscataway, NJ, USA, 2010; pp. 325–332.

6. Zhou, Z.; Liu, Y.Z.; Song, J.L.; Lin, B.W.; Wang, C. A method for power converter fault diagnosis. In Proceedings of the 2016 IEEE International Conference on Aircraft Utility Systems (AUS), Beijing, China, 10–12 October 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 62–67.

7. Iovine, A.; Rigaut, T.; Damm, G.; De Santis, E.; Di Benedetto, M.D. Power management for a DC MicroGrid integrating renewables and storages. *Control Eng. Pract.* **2019**, *85*, 59–79.

8. Bayati, M.; Abedi, M.; Gharehpetian, G.B.; Farahmandrad, M. Short-term interaction between electric vehicles and microgrid in decentralized vehicle-to-grid control methods. *Prot. Control Mod. Power Syst.* **2019**, *4*, 1–11.

9. Meckel, S.; Schuessler, T.; Jaisawal, P.K.; Yang, J.U.; Obermaisser, R. Generation of a diagnosis model for hybrid-electric vehicles using machine learning. *Microprocess. Microsyst.* **2020**, *75*, 103071.

10. Park, S.H.; Kim, T.S.; Park, J.S.; Moon, G.W.; Yoon, M.J. A new buck-boost type battery equalizer. In Proceedings of the 2009 Twenty-Fourth Annual IEEE Applied Power Electronics Conference and Exposition, Washington, DC, USA, 15–19 February 2009; IEEE: Piscataway, NJ, USA, 2009; pp. 1246–1250.

11. Davila, J.; Fridman, L.; Poznyak, A. Observation and identification of mechanical systems via second order sliding modes. In Proceedings of the International Workshop on Variable Structure Systems, 2006. VSS’06, Alghero, Italy, 5–7 June 2006; IEEE: Piscataway, NJ, USA, 2006; pp. 232–237.

12. Djeziri, M.A.; Merzouki, R.; Bouamama, B.O.; Dauphin-Tanguy, G. Bond graph model based for robust fault diagnosis. In Proceedings of the 2007 American Control Conference, New York, NY, USA, 9–13 July 2007; IEEE: Piscataway, NJ, USA, 2007; pp. 3017–3022.

13. Bayati, M.; Abedi, M.; Farahmandrad, M.; Gharehpetian, G.B.; Tehrani, K. Important Technical Considerations in Design of Battery Chargers of Electric Vehicles. *Energies* **2021**, *14*, 5878.

14. Tehrani, K.; Maurice, O. A cyber physical energy system design (CPESD) for electric vehicle applications. In Proceedings of the 2017 12th System of Systems Engineering Conference (SoSE), Waikoloa, HI, USA, 18–21 June 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 1–6.

15. Tehrani, K. A smart cyber physical multi-source energy system for an electric vehicle prototype. *J. Syst. Archit.* **2020**, *111*, 101804.

16. Moosavi, S.S.; Djerdir, A.; Aït-Amirat, Y.; Khaburi, D.A. Fault detection in 3-phase traction motor using artificial neural networks. In Proceedings of the 2012 IEEE Transportation Electrification Conference and Expo (ITEC), Dearborn, MI, USA, 18–20 June 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 1–6.

17. Li, Y.; Li, Z.; Zhu, S.; Jiao, M.; Wu, C. Junction temperature post-fault analysis of single IGBT short-circuit for double-side cooling inverter used for electric vehicle. In Proceedings of the 2017 IEEE International Electric Machines and Drives Conference (IEMDC), Miami, FL, USA, 21–24 May 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 1–6.

18. Fuchs, F.W. Some diagnosis methods for voltage source inverters in variable speed drives with induction machines-a survey. In Proceedings of the IECON’03, 29th Annual Conference of the IEEE Industrial Electronics Society (IEEE Cat. No. 03CH37468), Roanoke, VA, USA, 2–6 November 2003; IEEE: Piscataway, NJ, USA, 2003; Volume 2, pp. 1378–1385.

19. Reiter, R. A theory of diagnosis from first principles. *Artif. Intell.* **1987**, *32*, 57–95.

20. Jamshidi, M.; Tannahill, B.; Yetis, Y.; Kaplan, H. Big data analytic via soft computing paradigms. In *Frontiers of Higher Order Fuzzy Sets*; Springer: Berlin/Heidelberg, Germany, 2015; pp. 229–258.

21. Chen, Z.; Lin, F.; Wang, C.; Le Wang, Y.; Xu, M. Active diagnosability of discrete event systems and its application to battery fault diagnosis. *IEEE Trans. Control Syst. Technol.* **2013**, *22*, 1892–1898.

22. Ramahaleomiarantsoa, J.; Héraud, N.; Bennouna, O.; Sambatra, E.J.R.; Razafimahenina, J.M. Modeling & fault diagnosis system for electric vehicles. In Proceedings of the IECON 2012-38th Annual Conference on IEEE Industrial Electronics Society, Montreal, QC, Canada, 25–28 October 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 4127–4132.

23. Kaplan, H. *Data Analytic Studies for Turkey's Energy Forecast*; The University of Texas at San Antonio: San Antonio, TX, USA, 2014.
24. Chen, Y.L.; Kuo, Y.W.; Wang, S.S. Artificial neural network for predictions of vehicle drivable range and period. In Proceedings of the 2012 IEEE International Conference on Vehicular Electronics and Safety (ICVES 2012), Istanbul, Turkey, 24–27 July 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 329–333.

25. Mishra, D.P.; Samantaray, S.R.; Joos, G. A combined wavelet and data-mining based intelligent protection scheme for microgrid. *IEEE Trans. Smart Grid* **2015**, *7*, 2295–2304.

26. Konar, P.; Chattopadhyay, P. Bearing fault detection of induction motor using wavelet and Support Vector Machines (SVMs). *Appl. Soft Comput.* **2011**, *11*, 4203–4211.

27. Kolla, S.R.; Altman, S.D. Artificial neural network based fault identification scheme implementation for a three-phase induction motor. *ISA Trans.* **2007**, *46*, 261–266.

28. Sadeghian, A.; Tahayori, H. *Frontiers of Higher Order Fuzzy Sets*; Springer: Berlin/Heidelberg, Germany, 2015.

29. Bengio, Y. Deep learning of representations: Looking forward. In *International Conference on Statistical Language and Speech Processing*; Springer: Berlin/Heidelberg, Germany, 2013; pp. 1–37.

30. Wu, J.; Yu, Y.; Huang, C.; Yu, K. Deep multiple instance learning for image classification and auto-annotation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–9 June 2015; pp. 3460–3469.

31. Siddiqui, K.M.; Giri, V. Broken rotor bar fault detection in induction motors using wavelet transform. In Proceedings of the 2012 International Conference on Computing, Electronics and Electrical Technologies (ICCEET), Nagercoil, India, 21–22 March 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 1–6.

32. Mahmoud, T.S.; Habibi, D.; Hassan, M.Y.; Bass, O. Modelling self-optimised short term load forecasting for medium voltage loads using tunning fuzzy systems and Artificial Neural Networks. *Energy Convers. Manag.* **2015**, *106*, 1396–1408.

33. Zhong, S.; Wang, X.; Zhao, J.; Li, W.; Li, H.; Wang, Y.; Deng, S.; Zhu, J. Deep reinforcement learning framework for dynamic pricing demand response of regenerative electric heating. *Appl. Energy* **2021**, *288*, 116623.

34. Bayati, M.; Abedi, M.; Hosseinian, H.; Gharehpetian, G.B. A novel control strategy for Reflex-based electric vehicle charging station with grid support functionality. *J. Energy Storage* **2017**, *12*, 108–120.

35. Bayati, M.; Abedi, M.; Gharehpetian, G.B.; Farahmandrad, M. Sinusoidal-ripple current control in battery charger of electric vehicles. *IEEE Trans. Veh. Technol.* **2020**, *69*, 7201–7210.

36. Polson, M.; Sokolov, V. Deep learning for energy markets. *arXiv* **2018**, arXiv:1808.05527.

37. Kolodziejczyk, W.; Zoltowska, I.; Cichosz, P. Real-time energy purchase optimization for a storage-integrated photovoltaic system by deep reinforcement learning. *Control Eng. Pract.* **2021**, *106*, 104598.

38. Prasad, A.; Edward, J.B.; Ravi, K. A review on fault classification methodologies in power transmission systems: Part—I. *J. Electr. Syst. Inf. Technol.* **2018**, *5*, 48–60.

39. Abdelsalam, A.A.; Eldesouky, A.A.; Sallam, A.A. Characterization of power quality disturbances using hybrid technique of linear Kalman filter and fuzzy-expert system. *Electr. Power Syst. Res.* **2012**, *83*, 41–50.

40. Ahila, R.; Sadasivam, V.; Manimala, K. An integrated PSO for parameter determination and feature selection of ELM and its application in classification of power system disturbances. *Appl. Soft Comput.* **2015**, *32*, 23–37.

41. Manimala, K.; Selvi, K.; Ahila, R. Optimization techniques for improving power quality data mining using wavelet packet based support vector machine. *Neurocomputing* **2012**, *77*, 36–47.

42. Borges, F.A.; Fernandes, R.A.; Silva, I.N.; Silva, C.B. Feature extraction and power quality disturbances classification using smart meters signals. *IEEE Trans. Ind. Inform.* **2015**, *12*, 824–833.

43. Xiong, S.; Xia, L.; Bu, L. Classification of composite power quality disturbance using support vector machines. In Proceedings of the 2015 Chinese Automation Congress (CAC), Wuhan, China, 27–29 November 2015; IEEE: Piscataway, NJ, USA, 2015; pp. 1522–1527.