Adaptive fuzzy energy management strategy for range‐extended electric vehicles integrated with deep learning

A novel framework for adaptive energy management, rooted in deep learning principles, is proposed to minimize fuel consumption in extended‐range electric vehicles amidst intricate driving scenarios. This innovative approach integrates a long short‐term memory (LSTM) network for pattern recognition across three driving patterns and an adaptive fuzzy controller. To mitigate the impact of poor hyperparameter selection on recognition accuracy, Gray Wolf Optimization is employed to optimize the hidden layer nodes, training times, and learning rate of the LSTM. Simultaneously, a genetic algorithm is utilized to optimize the vertex coordinates of the fuzzy control membership function, enabling the adaptive adjustment of parameters in the fuzzy energy management strategy. The condition recognition model accurately identifies the vehicle's driving status and seamlessly transitions to an energy management strategy tailored to the present conditions. This ensures optimal operation, enhancing overall fuel efficiency and performance. The simulation results robustly validate the efficacy of this approach: the GWO‐LSTM network achieves an impressive 97.7% accuracy in recognizing working conditions, surpassing the 88.9% accuracy of the traditional LSTM network. Furthermore, the fuel consumption reduction achieved by the adaptive fuzzy energy management strategy amounts to 11.9% compared with the conventional fuzzy energy management approach. This outcome underscores the tangible enhancement in vehicle fuel economy resulting from the seamless integration of deep learning techniques.


| INTRODUCTION
The automotive industry is actively exploring alternative propulsion systems to reduce reliance on internal combustion engines. 1 Traditional electric vehicles face challenges related to limited driving range, infrastructure, and consumer adoption. 2,3REVs emerge as a solution to bridge the gap between conventional vehicles and pure electric vehicles. 4he distribution of different energy sources in EREVs is a key aspect of energy management strategy research. 5][8][9][10] Therefore, developing energy management strategies tailored to different driving conditions and identifying the optimal strategy in real-time can further improve the fuel economy of the vehicle.7][18] Identifying driving conditions is a nonlinear problem.Support vector machines require the introduction of kernel functions or feature transformations when dealing with nonlinear problems, which depend on expert experience.In addition, SVM can lead to long computation times when dealing with large complex datasets.Clustering algorithm-based identification is essentially an inductive identification method, and its accuracy is influenced by subjective factors such as algorithm selection, parameter settings, and initial value selection, resulting in poor stability.In contrast, neural network-based identification has strong nonlinear modeling capabilities and good adaptability, making it suitable for handling large-scale data.
To address the aforementioned limitations and challenges and consider the robustness of driving condition identification and the uncertainty of fuzzy control parameters, this study introduces deep learning theory to construct an adaptive fuzzy energy management strategy for EREVs, aiming to adapt to complex driving conditions.

| EXTENDED-RANGE ELECTRIC VEHICLE (EREV) MODEL AND PARAMETERS 2.1 | Vehicle model and parameters
Using a specific extended-range electric vehicle as the research object, the vehicle parameters are shown in Table 1.The power train system structure is illustrated in Figure 1 and consists of key components such as the drive motor, DC/DC converter, battery pack, engine, generator, and transmission device.Solid lines represent mechanical connections, and dashed lines represent electrical connections.
A vehicle dynamics model is established by considering the driving resistance and driving force: where F t is driving force; f is rolling resistance coefficient; α is slope angle; C d is air resistance coefficient; A is frontal area; G is the force of gravity acting on the vehicle; v is the vehicle speed; δ is the rotational mass conversion factor; du dt is the vehicle acceleration; and m is the vehicle curb weight.

| Drive motor model
The efficiency diagram of the drive motor is shown in Figure 2 and its mathematical model is as follows: where P m is motor power; ω m is motor speed; T m is motor torque; v is vehicle speed; r is wheel radius; i is the transmission ratio of the vehicle gearbox.

| Engine model engine
Operating efficiency and fuel consumption are important factors in evaluating the fuel economy of a vehicle.Figure 3 shows the engine efficiency MAP diagram, and based on the MAP diagram, the current engine fuel consumption rate can be obtained by looking up the table using the engine speed and torque.The formula for calculating a vehicle's fuel consumption is where Fuel is fuel consumption; F fuel is fuel consumption rate at time t; t 0 is engine start time; t 1 is engine shutdown time; W t ( ) is engine speed at time t (r/min); and T(t) is the engine torque at time t (N m).

| Power battery model
The selected power battery model is the Rint model, as shown in Figure 4. Its mathematical model is as follows: The WLTC, NEDC, and US06 cycle tests serve as the three types of cycle tests, each covering urban, suburban, and highway working conditions.However, there exists a significant difference in the speed range of these tests.To enhance recognition accuracy, it is necessary to redefine the criteria for classification.Therefore, average vehicle speed and power demand serve as the criteria for classification.The three cycle tests are then redivided accordingly, and the resulting segments are combined to form three types of working condition databases: Working Condition 1 for urban low-speed driving conditions (1369 s), Working Condition 2 for suburban mediumspeed driving conditions (1288 s), and Working Condition 3 for highway cruising conditions (923 s).The classification of the three driving test cycles is shown in Table 2, and the three typical driving test cycles are shown in Figure 5.The division of working conditions is depicted in Figure 6.

| Extraction of working condition feature parameters
There is overlap and correlation between the feature parameters of working conditions, and the selection of feature parameters determines the accuracy of the current working condition description.Selecting too many feature parameters will increase computational complexity and decrease real-time performance.Selecting too few feature parameters will result in inaccurate description of the current working condition, leading to a decrease in recognition accuracy.Five feature parameters were selected to describe the working condition features, including maximum speed, average speed, idle time ratio, maximum acceleration, and maximum deceleration.The feature parameters extracted from the three types of working conditions are shown in Table 3. Maximum speed V max (km/h): (5) where v is the speed of the vehicle during the operating condition segment, and t is the time duration of the operating condition segment.Idle time ratio η i : where t i is the idle time.
Maximum acceleration a _ a max (m/s 2 ): where a ai is the acceleration at time t i in the driving cycle segment.
Maximum deceleration a _ d max (m/s 2 ) where a di is the deceleration at time t i in the driving cycle segment.

| Processing of working condition sample data
Taking T as the recognition cycle and time as 100 s, ΔT as the extraction interval and time as 3 s, working condition segments are extracted as shown in Figure 7.The extracted overlapping segments are divided into working conditions based on the proportion.If the proportion of the overlapping segment is less than 50%, it belongs to the previous working condition segment, and if it is greater than 50%, it belongs to the next working condition segment.

| GWO-optimized LSTM recognition model
The recurrent neural network (RNN) stands out as a potent model extensively utilized in handling large-scale data processing and time series problems.In contrast to traditional feedforward neural networks, RNN tackles the challenges of sequential data adeptly through recurrent connections and memory mechanisms.This enables RNN to effectively capture intricate patterns and dependencies within sequential data.The structure of the RNN neural network is depicted in Figure 8.The selected long short-term memory (LSTM) neural network architecture in this context comprises 6 input layers, 5 hidden layers, and 3 fully connected layers.
To address the challenges posed by vanishing and exploding gradients in traditional RNNs when handling long-term dependencies, Hochreiter and Schmidhuber devised an enhanced RNN architecture known as the long short-term memory (LSTM) neural network.This innovative structure incorporates specialized memory cells and gating mechanisms, enabling effective retention and selective updating of information over extended sequences.By doing so, LSTMs effectively overcome the Extracted working condition segments.
limitations of traditional RNNs, allowing for more robust learning and representation of long-term dependencies in sequential data.LSTM neural network is an improved type of RNN that addresses the issues of gradient explosion and vanishing gradients through the use of three "gates" (forget gate f t , input gate i t , output gate o t ). 19The LSTM neural network unit structure is shown in Figure 9, where x t , h t and c t represent the input vector, output vector, and memory cell, respectively.σ denotes the sigmoid activation function, tanh denotes the hyperbolic tangent activation function, h t−1 and c t−1 represent the output and state vectors from the previous unit, and '+', and '×' represent the respective mathematical operations.
The specific steps are as follows: Step 1: x t and h t−1 pass through the forget gate f t to filter out forget information: The weights coefficients and bias vectors of the W f gate and the b f gate in the equation.
Step 2: The input gate i t updates the input information into the cell: where b i and b c are the bias vectors of the input gate, W c is the weight coefficient, and ĉ t is the candidate state vector.
Step 3: The memory unit c t updates the cell state: Step 4: The output gate o t determines the information output.
where W o is the weight coefficients of the output gate, and b o is the bias vector.The initial weights and parameters of the LSTM neural network have a significant impact on the model's performance and can easily get trapped in local optima, requiring optimization of its parameters. 20][23][24] Therefore, the GWO algorithm is utilized to optimize the initial weights and bias parameters of the LSTM neural network.
The GWO algorithm is a method inspired by the hunting behavior of a wolf pack, consisting of a leader α responsible for decision-making, assistant leaders β who support the pack and act as substitutes for the leader, followers δ responsible for executing commands from both the leader α and assistant leaders β, and maintain- ers ω who maintain the internal balance of the wolf pack, as illustrated in Figure 10.
The specific steps are as follows: Step 1: α issues instructions to β and δ to surround the prey: where A and C are collaborative vector coefficients; X t ( ) p is the location of the prey; X t ( ) is the location of the wolf pack; t is the total number of times the wolf pack surrounds the prey; r 1 and r 2 are random numbers ranging from 0 to 2; α linearly decreases from 2 to 0 as the iteration converges.
Step 2: Under the leadership of α, α, β, and δ continuously approach the prey.The updated formula for their positions is as follows: In the equation: D α , D β , and D δ represent the distances between α, β, and δ, respectively, with other individuals; X 1 , X 2 , and X 3 represent the current positions of α, β, and δ, respectively.
Step 3: Simulate the attack of the wolf pack by reducing the value of α.When α ‖ ‖ < 1, it indicates that the wolf pack is launching an attack near the prey, while also completing the selection of the optimal value.The update of the positions of the gray wolves throughout the entire process is illustrated in Figure 11.
The GWO algorithm is used to optimize the initial weights and bias parameters of the LSTM neural network, with the specific optimization steps as follows: Step 1: Select 5 feature parameters-maximum speed, average speed, maximum acceleration, idle time ratio, and maximum deceleration-as inputs and the operating condition type as the output.Establish a mapping relationship between input and output, and normalize the output results, as shown in Table 4.
Step 2: Use the number of hidden layer nodes, learning rate, and regularization coefficient of the LSTM algorithm as the optimization targets for the GWO algorithm.Then, set the population iteration number and dimensions of the GWO algorithm, the wolf pack size N, and the range of optimized parameters.
Step 3: Use the GWO optimization algorithm for parameter initialization.Specify the initial number of wolves in the pack, the maximum iteration number, the number of parameters to be optimized, and their value range.Initialize the position vectors of the individuals in the wolf pack x i , denoted as α, β, and δ wolves; calculate the fitness value of the individuals in the wolf pack using the following formula: where y′ i is the predicted value of the LSTM model, and y i is the target value.
Step 4: Use the GWO optimization algorithm to optimize the parameters.Iterate to calculate the fitness of the wolf individuals and update their positions, repeating the optimization steps until reaching the maximum iteration number or the global optimal position is within the minimum limit.Apply the optimized parameters to the long short-term memory neural network for training and evaluation.The flowchart of the GWO-LSTM optimization algorithm is shown in Figure 12.

| Work condition recognition results
The selected five feature parameters, namely maximum speed, average speed, maximum acceleration, idle time ratio, and maximum deceleration, were used as inputs, and the work condition type was used as the output.The mapping relationship between the inputs and outputs was established, and the output results were normalized, as shown in Table 4.
The LSTM neural network was set with three input nodes, one output node, and five hidden layer nodes.The LSTM and GWO-LSTM neural network models were trained and tested using the extracted work condition feature samples.There were a total of 884 training feature samples and 217 testing feature samples.Table 5 shows the comparison of recognition accuracy between the two neural network models.Compared to LSTM, the GWO-LSTM showed an improvement in both training and testing recognition accuracy, with a more significant improvement in the testing recognition accuracy.The testing recognition accuracy increased from 88.94% to 97.70%.

| Fuzzy controller design
Plug-in hybrid electric vehicles have two energy sources, and energy allocation is crucial for improving fuel economy.To reduce fuel consumption of plug-in hybrid electric vehicles, a fuzzy energy management strategy is adopted to design a dual-input, single-output fuzzy controller.The fuzzy control structure is shown in Figure 13, where the inputs are the vehicle's power demand P req and the state of charge (SOC) of the traction battery, and the output is the power of the range extender.
According to operating conditions 1, 2, and 3, different membership functions are set.Taking the city low-speed driving condition of operating condition 1 as an example, the domain range of the vehicle's demanded power is set as [0-20 kW], with fuzzy subsets as [VS, S, M, B, VB]; the domain range of the SOC value of the power battery is set as [0-1], with fuzzy subsets as [VS, S, M, B, VB]; the domain range of the output power of the range extender is set as [0-15 kW], with fuzzy subsets as [ZO, VS, S, M, B, VB, LO].The same settings apply to operating conditions 2 and 3, and the fuzzy rules for all three conditions are the same.The fuzzy rule is shown in Table 6.
The fuel economy of a plug-in hybrid electric vehicle (PHEV) depends on both the fuel consumption of the engine and the energy consumption of the power battery.Therefore, the selected optimization objective is the sum of the fuel consumption of the PHEV engine and the energy consumption of the power battery.The energy consumption of the power battery can be expressed as equivalent fuel consumption, and the overall vehicle energy consumption expression is where J is the objective function, representing the overall vehicle energy consumption; Q fuel is the fuel consumption of the engine (L/km); V fuel is the equivalent fuel consumption of the power battery (L/km); f t ( ) is the fuel consumption rate of the engine at time t (g/kW h), f d is the fuel density (g/ cm 3 ); E k is the energy consumption of the battery (kW h); Q _ fuel low is the lower heating value of the fuel combustion; η e is the average efficiency of the engine; η g is the average efficiency of the generator; and D fuel is the fuel density.

| Optimization algorithm
The membership function domain and fuzzy rules of fuzzy controllers are usually set based on expert experience, making it difficult to achieve the best control effect.To solve this problem, genetic algorithm (GA) is used to optimize the vertex parameters of the membership function of the fuzzy controller, as shown in Figure 14.

| Optimization results
The membership function graphs before and after the optimization with GA are shown in Figures 16 and 17, respectively.The optimization process for conditions 2 and 3 is similar and the graphs are not shown.

| Energy management strategy establishment for condition identification
An adaptive fuzzy energy management strategy has been designed for three different operating modes, divided into two parts: online identification and offline optimization, as shown in Figure 18.In the online identification part, feature parameters are selected using the GWO-LSTM neural network for condition identification, and the corresponding optimized fuzzy energy management strategy is chosen based on the detected operating condition.In the offline optimization part, a GA is employed to optimize the vertices of the fuzzy control membership functions, resulting in an optimized energy management strategy for the corresponding driving condition.
NIE ET AL.

| Comparative analysis of three energy management strategies
To validate the feasibility of the proposed energy management strategy, the CLTC-P cycle is selected.The GWO-LSTM adaptive fuzzy energy management strategy, LSTM adaptive fuzzy energy management strategy, and FUZZY energy management strategy are imported into the Advisor vehicle model and jointly simulated with MATLAB.The control effects of the three different energy management strategies are compared and analyzed.The initial value of the SOC of the battery is set to 0.5, with upper and lower limits set to 0.8 and 0.3, respectively.Figure 19 shows that the three energy management strategies have good overall speed tracking performance.
Figure 20 shows that the three energy management strategies have small fluctuations in the SOC of the battery, ranging from 1% to 11%, and the oscillation frequency of the GWO-LSTM energy management strategy is lower than that of the other two strategies.At the end of the simulation, the termination SOC for the GWO-LSTM, LSTM, and FUZZY energy management strategies are 51.20%,51.31%, and 55.12%, respectively, all in accordance with the strategy settings.Combining Figures 20 and 21, it can be observed that the output power of the battery follows the SOC variation curve, and the GWO-LSTM strategy has smaller instantaneous power changes during charging and discharging, which can avoid the detrimental effects of high instantaneous power on battery life.
Figure 22 shows that the FUZZY energy management strategy has the highest number of engine start-stop cycles, with 53 cycles, followed by the GWO-LSTM energy management strategy with 26 cycles, and the LSTM energy management strategy with the lowest at 23 cycles.The workcondition adaptive energy management strategies have a higher number of engine start-stop cycles compared to the traditional fuzzy energy management strategy, reducing the number of start-stop cycles by more than 50%.Additionally, the GWO-LSTM energy management strategy has the smallest variation in instantaneous engine power, with the output mostly at a constant power level, which helps extend battery life.
From Figure 23, it can be seen that the vehicle energy consumption for the GWO-LSTM, LSTM, and FUZZY energy management strategies are 6.43, 6.73, and 7.29 L, respectively.The GWO-LSTM energy management strategy reduces the vehicle energy consumption by 4.5% compared to the LSTM energy management strategy, and by 11.9% compared to the FUZZY energy management strategy.

| Energy consumption for three energy management strategies
The energy consumption of a plug-in hybrid electric vehicle mainly consists of fuel consumption and electricity consumption.Figures 24-26 show the energy recovery per unit distance, electricity consumption per unit distance, fuel consumption per unit distance, as well as the proportions of energy recovery, electricity consumption, and fuel consumption.Table 7 shows that the proposed energy management strategies can effectively adapt to different driving conditions.From Figure 20, it can be observed that the proportions of energy recovery for the three energy management strategies are similar.The highest energy recovery proportion is approximately 46%-47% for the highspeed driving condition, followed by approximately 40%-41% for the suburban driving condition, and the lowest is approximately 12%-13% for the urban driving condition.The proportion of energy recovery is closely related to speed variations and deceleration.Combined with Figure 6, it can be seen that the speed curve is relatively smooth under urban driving conditions, with fewer instances of abrupt acceleration and deceleration.In contrast, the speed curve is steeper under suburban and high-speed driving conditions, with more frequent instances of abrupt acceleration and deceleration, resulting in a higher proportion of energy recovery in these conditions.
From Figure 24, it can be seen that the FUZZY energy management strategy has the highest proportion of electricity consumption for urban driving conditions, at 59%.The GWO-LSTM and LSTM energy management strategies have similar proportions of electricity consumption.Combined with Figure 16, it can be seen that the SOC curves for the three energy management strategies have a similar overall trend for urban and suburban driving conditions, with the difference being that the SOC curve for the FUZZY energy management strategy has an increasing trend for high-speed driving conditions, while the SOC curves for the other two energy management strategies show a decreasing trend more in line with the actual situation, where urban driving usually consumes more fuel while high-speed driving consumes less fuel.Combined with Figure 26, it can be observed that the proportions of fuel consumption for the three energy management strategies follow the trend of engine power variation, with the FUZZY energy management strategy, which has the highest number of engine start-stop cycles, also having the highest fuel consumption.

| Hardware in the loop experiment
The energy management strategy proposed by GWO-LSTM in this paper has undergone simulation validation in MATLAB/Simulink.However, recognizing the The hardware-in-the-loop experimental system in this paper establishes a ROS2 simulation model through Simulink.Two computers are interconnected via a wired connection and the same WiFi network.Computer 1 acts as the domain controller, managing the energy management strategy of the entire system by exchanging information such as the state of charge (SOC) of the power battery, vehicle power demand, and overall energy consumption.Computer 2 serves as the vehicle model, receiving control commands from computer 1 and simulating the behavior and performance of the entire vehicle accordingly.Communication between the computers is facilitated through Ethernet connections, and the hardware-in-the-loop experiment aims to verify the accurate transmission and reception of crucial data, including SOC of the power battery, vehicle power demand, and overall energy consumption.The hardwarein-the-loop experiment framework is illustrated in Figure 27.
The paper conducts HIL experiments utilizing the CLTC-P cycle of the 1800 s to validate the real-time performance of the proposed GWO-LSTM energy management strategy.This validation is achieved by scrutinizing the error in the transmission and reception of information to confirm the real-time nature of the proposed strategy.Throughout the simulation process, some errors are encountered, which may stem from model inaccuracies or experimental precision issues.However, as depicted in Figure 28, the discrepancies between the SOC curve of the power battery and the vehicle power demand curve are insignificant, demonstrating a high degree of consistency between the two.Furthermore, Table 8 showcases minimal errors in the simulation results for overall vehicle energy consumption, further affirming the real-time efficacy of the strategy.The ROS2 communication simulation, depicted in Figure 28, also corroborates the findings of the hardware-in-the-loop experiments.

| CONCLUSION AND OUTLOOK
In this paper an adaptive fuzzy energy management strategy for a range-extended electric vehicle is proposed, utilizing a GWO-LSTM neural network.NEDC, WLTC, and US06 driving cycles are systematically categorized into three types: urban low-speed, suburban medium-speed, and highway high-speed.This categorization serves as the basis for constructing a GWO-optimized LSTM neural network for driving cycle recognition.Input parameters include the entire vehicle power demand and the SOC of the battery pack, while the power output of the range extender is determined by the fuzzy controller.The membership functions of the fuzzy controller are optimized using a GA.The ongoing simulation analysis yields the following key conclusions: (1) The optimization of the learning rate, regularization coefficient, and the number of hidden layer nodes of the LSTM neural network through the GWO algorithm is found to be effective in enhancing the recognition accuracy of the LSTM neural network.(2) The energy management strategy derived from GWO-LSTM neural network-driven driving cycle recognition demonstrates superior adaptability to diverse driving conditions.This approach significantly reduces engine start-stop times, improves engine energy utilization efficiency, minimizes fuel consumption, and enhances overall fuel economy.(3) The meticulous selection of driving cycle feature parameters is identified as a critical factor influencing recognition accuracy.Striking the right balance is deemed essential, as an excess of feature parameters increases computational complexity and diminishes real-time performance, while too few parameters compromise the accurate description of current driving cycle characteristics, consequently reducing recognition accuracy.
Looking forward, there is potential for further advancement in the study's approach to energy management for range-extended electric vehicles.Addressing the current limitations, particularly the lack of real-world validation and the need for broader consideration of driving conditions, presents opportunities for enhancing the robustness and applicability of the proposed strategies.Future research efforts could prioritize conducting on-road vehicle testing and expanding the scope of working condition analysis to ensure effectiveness across diverse geographical and operational contexts.

3 | 3 . 1 |
R b is internal resistance of the battery; V oc is open circuit voltage; P b is battery charging/dischar- ging power; I is battery current; SOC b is initial battery charge.F I G U R E 2 Motor Efficiency diagram.F I G U R E 3 Engine efficiency map.F I G U R E 4 Battery Rint model.GWO-LSTM WORKING CONDITION RECOGNITION Selection and establishment of three typical working conditions

F
Abbreviation: SOC, state of charge.

F
I G U R E 17 Membership function graph after optimization.SOC, state of charge.F I G U R E 18 Energy management strategy establishment for condition identification.GA, genetic algorithm; GWO-LSTM, Grey Wolf optimizer-long short-term memory.G U R E 19 Speed curve.GWO, Grey Wolf optimizer; LSTM, long short-term memory.F I G U R E 20 State of charge (SOC) curve.GWO, Grey Wolf optimizer; LSTM, long short-term memory.

F
I G U R E 21 Battery power curve.GWO, Grey Wolf optimizer; LSTM, long short-term memory.F G U R 22 Engine power output.GWO, Grey Wolf optimizer; LSTM, long short-term memory.F I G U R 23 Vehicle energy consumption.GWO, Grey Wolf optimizer; LSTM, long short-term memory.

F
I G U E 28 (HIL) transmission and reception diagram.SOC, state of charge.(A) Vehicle power demand and (B) T A B L E 8 Hardware-in-the-loop experiment results.
F I G U R E 1 Structure diagram of the incremental power system.NIE ET AL.
Extracted feature parameters for three types of operating conditions.
T A B L E 3 11 Grey Wolf algorithm optimal solution update process diagram.T A B L E 4 Target value of training condition.
T A B L E 5 GWO and GWO-LSTM recognition rate comparison.Abbreviations: GWO, Grey Wolf optimizer; LSTM, long short-term memory.
T A B L E 7 Energy consumption comparison between WLTC and CHTC-C driving cycles.
Abbreviations: GWO, Grey Wolf optimizer; LSTM, long short-term memory.F I G U R E 27 Hardware-in-the-loop experiment framework diagram.