Open Access

Capacity estimation and energy allocation model of new energy vehicle battery management system based on optimization algorithm

  
Sep 26, 2025

Cite
Download Cover

Introduction

New energy vehicles have significant advantages in terms of environmental protection, energy saving, green, low-carbon and other aspects, and have a broad prospect [1-2]. As the “heart” of new energy vehicles, the performance of power batteries is directly related to the mileage, acceleration performance, and service life of the whole vehicle, and the battery management system plays the role of “commander-in-chief” in the energy management of new energy vehicles by monitoring the battery status in real time, optimizing energy scheduling, and ensuring battery safety [3-6]. Therefore, during the development of new energy vehicles, the battery management system should be scientifically designed on the basis of demand, and a variety of cutting-edge technologies should be mixed to control the battery state of new energy vehicles to avoid the phenomena of over-temperature, over-discharge, over-charging, etc., so as to improve the stability of the operation of the battery of new energy vehicles and prolong the life of the battery [7-10].

Battery management system is a link between the power battery of new energy vehicles and the vehicle control system, which plays an indispensable role in ensuring the safety of vehicle operation and improving the efficiency of battery utilization [11-13]. Battery management system through the sensor real-time collection of battery voltage, current, temperature and other key parameters of information, assessment of battery state of charge (SOC), state of health (SOH), etc., for the vehicle control system to optimize the energy management strategy, rational deployment of battery energy to provide a basis for decision-making, which can help to improve the efficiency of the battery energy utilization, extend the range [14-17]. The battery management system always monitors the working status of the battery, and once overcharge/overdischarge, overtemperature/low temperature, short circuit, leakage and other abnormalities are found, it sends a warning to the vehicle control system in a timely manner and takes measures to prevent safety accidents such as disconnecting the relay and restricting charging/discharging, so as to ensure the safety of the power battery and the reliable operation of the vehicle [18-21].

This paper firstly introduces the working principle and model characteristics of the Random Forest algorithm, and on this basis introduces the mothballing algorithm to optimize the parameters of the Random Forest algorithm, and searches for the optimal parameters to construct an ideal estimation model. After that, taking advantage of the characteristics of the hybrid braking region of pure electric new energy vehicles, where both electric motors and machinery are involved in braking, and on the basis of the multi-objective optimization direction to meet the braking safety and maximize the energy recovery, the multi-objective optimization strategy based on particle swarms is proposed, so as to select the global optimal value for the estimation of the capacity of the battery management system and the allocation of the energy. Finally, the multi-objective particle swarm optimization of battery management system capacity estimation and energy allocation is evaluated in the application of new energy vehicles.

Lithium battery capacity estimation based on optimized random forests
Random Forest Algorithm

Random forest regression algorithm [22] is an intelligent algorithm for integrated learning on decision trees. Between this RF will grow a large number of decision trees which will act as classification or regression functions. Suppose the original sample St is as follows: St={(X1,Y1),(X2,Y2),,(Xt,Yt)}

Where, X represents the input quantity X={x1,x2,,xm} , the eigenfactor Fi, Y represents the output scalar, and in this paper, the battery capacity. Of course a part of the samples may appear repeatedly in that sample, and similarly a part of the samples will not appear in the sample St, and the probability of a sample not being selected is as follows: limx(11x)x=1e0.368

RF is built on top of CART in constructing each regression tree and the decision trees constructed in the training phase are uncorrelated. The bagging algorithm is used to select a number of samples (StΘ1,StΘ2,,StΘT) . i.e.: Yi=(X,stΘl)

Eq. i = 1,⋯,l, the integration produces l outputs corresponding to each tree, by averaging the outputs of all decision trees and aggregating them. So, the training output estimates are as follows: y^=sgn(i=1kY^=1ki=1kh^(X,snΘl))

l = 1,2,3…,l where Y^ is the output of the lthrd tree.

The Moth Flame Algorithm

Moths in the Moth Flame Algorithm [23] have their own characteristics of the parameters to be optimized, while the position of the moths is determined by the parameters to be optimized, and each moth has a suitable corresponding value. Moth population and flame population are two important elements to construct the MOF algorithm, where the moths can reach is the set that constitutes the solution of the required problem, in which the best position reached by the moths is the optimal solution of the required problem as well as the flame position. The main job of the moth is to continuously update the position while calculating the adaptation values to find the optimal solution. The main role of the flame is to save the best position and the optimal solution searched by the moth at the moment. During the iteration process, moths and flames are always guaranteed one-to-one correspondence, and each moth searches only in the vicinity of the flame next to it until the constraints of the algorithm itself are reached.

Algorithmic structure

The MOF algorithm can be thought of as a triad for finding the global optimum, i.e: MFO=(I,P,T)

where I refers to an arbitrarily generated position of a moth and a function of the fitness values generated at that position, OM is an aggregate of the moth fitness values to be stored, and M is as follows: I:φ{M,OM}

P denotes the function in the algorithm that guides the moth to change its position, and at the end of each search, the P function guides the moth to update its own position while storing the new position information in M*, which is described by Eq: P:MM*

T refers to the Boolean function in the algorithm that determines whether the moth search can end. To wit: T:M{true,false}

In the MOF algorithm, let M be the moth population, a single moth is denoted by Mi, M denotes the matrix of m*n, the vector position of m represents the position where the moth is located i.e., the value sought, n denotes the size of the moth population, and d is the variable dimension. Namely: M=[ m1,1 m1,2 m1,d m2,1 m2,2 m2,d mn,1 mn,2 mn,d]

The position of each moth after flight is entered into the fitness function corresponding to that moth, and the moth’s fitness value is updated by storing the new fitness value in the OM array as follows: OM=[ OM1 OM2 OMn]

Assume that the size of the storage flame F matrix is m*n. m denotes the number of flames and n denotes the variable dimension. I.e: F=[ f1,1 f1,2 f1,d f2,1 f2,2 f2,d fn,1 fn,2 fn,d]

OF denotes the acclimatization value corresponding to the ind flame and m denotes the number of moths. Then: OF=[ OF1 OF2 OFm]

The MOF algorithm searches for an optimal solution in the vicinity of the marker and updates this marker after finding a better solution, finding the optimal solution in the algorithm through iteration. The process is subdivided into two parts: flame capture and abandonment process.

Flame capture process

Since the moth individual Mj has phototropism, if it locks on to the flame F, it captures the flame in a spiral flight from the current position, with the end position being that of the flame F, and the search is carried out in a designated area: Mi=S(Mi,Fj)=Di*ebt*cos(2πt)+Fj

where S represents the logarithmic spiral function, Mi represents the ird individual moth, F, is the jth flame, and D is used to represent the distance between any moth and any flame. The shape of the spiral curve [24] can be changed according to the magnitude of the value of b. t is a random number between -1 and 1. When t = 1 indicates that the moth is farthest away from the position of the next flame, and similarly when t = −1 indicates that the moth is closest to the position of the next flame. I.e.: Di=|FjMi|

Flame relinquishment process

The process of flame volume reduction is as follows: flame_no=round(Nl*N1T)

where flame_no represents the current number of flames, n is the initial flame group size, l is the current number of iterations, and round is the rounding function based on the rounding principle.

Optimized battery capacity estimation model for RFR algorithm

In this paper, MOF is used to optimize its parameters to construct the MOF-RFR estimation model, compared with other optimization algorithms, MOF has the advantages of fewer parameters, simpler principles, and lower requirements of the operating environment. Its optimization of random forests can prevent overfitting while ensuring the accuracy of the operation, and the iterative process of the MOF algorithm is shown in Fig. 1.

Figure 1.

MOF algorithm iterative process

For the random forest algorithm parameter optimization specific steps are as follows:

Initialize the information and establish the parameters such as the size of the moth population n, the dimension of the variable d, and the maximum number of iterations T;

Solve for individual moth positions within the required range and establish the initial moth matrix;

Update the number of flames according to the parameters defined in the previous two steps using Equation (15);

Updating the fitness value of individual moths, combining and sorting the order of moths according to the size of the value, and at the same time, transferring the sorting information to the flame to update the flame information in real time;

Update the position of the moths according to Equation (13);

Update the adaptability value of individual moths again, compare the value with the flame using the update result, and select the result with the best adaptability to be assigned to the flame;

Determine whether the end condition can be satisfied, if not, continue to follow step 3), and conversely output the result;

Use the amount of trees and the number of nodes as the random forest input, construct the random forest regression algorithm with optimized parameters and output the final result.

Analysis of the results of battery capacity estimation

In this paper, the cycle life recession data of 2-8 batteries are selected to verify the estimation effect of the optimized RFR algorithm (MOF-RFR) model proposed in this paper.

When using a data-driven approach to estimate the battery capacity value, the amount of data affects the estimation accuracy of the model, and when comparing the estimation effect of different methods, it is necessary to use the same training data to train and validate the model. In this section, the full-life data of battery No. 1 is used to train different models, and the full-life dataset of batteries No. 2-5 is used to validate the capacity estimation effect of different models. Meanwhile, in order to prove that the proposed MOF-RFR model combines the advantages of MOF and RFR models and results in higher accuracy of battery capacity estimation, the estimation results of MOF-RFR model are compared with those of MOF and RFR models, respectively.

The estimation results of different methods for battery No. 2 are shown in Fig. 2, (a) and (b) are the capacity estimation results and capacity estimation errors, respectively. From the figure, it can be seen that the capacity of the battery decreases continuously with the increase of the number of cycles, and the capacity estimation values of the battery from the three models are better close to the real capacity reference value, but the battery capacity estimation results of the MOF-RFR model are better than those of the MOF or RFR models. In addition, it can be seen that the relative errors of the capacity estimation of the three models are large. Among them, the average error of capacity estimation of MOF-RFR model is 0.33%, and the average errors of MOF model and RFR model from the reference value are 4.35% and 5.79%, respectively.

Figure 2.

Different methods for the estimate of battery 2

The estimation results of different methods for battery No. 5 are shown in Fig. 3, (a) and (b) show the capacity estimation junction capacity estimation results and capacity estimation error, respectively. From the figure, it can be seen that the capacity estimation results of the three models are better. Among them, the relative error of capacity estimation of MOF-RFR model is less than 0.38%, and the average errors of MOF model, RFR model and reference value are at 3.90% and 2.81%, respectively. And the capacity estimation of MOF-RFR is better than that of MOF model and RFR model. The synthesis of Fig. 2 and Fig. 3 can show that the estimation effect of MOF-RFR on battery capacity is indeed better than MOF model and RFR model.

Figure 3.

Different methods for the estimate of battery 5

There are some limitations in testing the estimation of the model by using only the cycle life decline data of two batteries, and in order to better validate the estimation of the model, the full-life cycle decline data of six batteries were used for validation. Figure 4 shows the capacity estimation errors of No. 2-8 batteries under different methods, and (a)~(c) represent MOF-RFR, MOF and RFR models, respectively. The results show that under the three algorithms, the capacity estimation results of No. 5 battery are the best, except for the capacity estimation results of No. 6 battery using MOF-RFR, which has a larger ME, the capacity estimation results of other batteries using MOF-RFR are the smallest, and they are obviously smaller than those of MOF and RFR models. The combined estimation results of the three models are as follows: MOF-RFR model > MOF model > RFR model, in which the MAE, ME, and RMSE of the capacity estimation results of the MOF-RFR model for batteries of sizes 2-5 are less than 1.445 mAh, 4.765 mAh, and 1.974 mAh, respectively. It can be seen that the estimation of the battery capacity values using the MOF-RFR model has a good effect.

Figure 4.

The capacity estimation error of the different methods of cell 2 battery

Multi-objective optimization algorithm battery energy allocation design
Concept of multi-objective optimization algorithm

Particle Swarm Optimization (PSO) algorithm [25] is a classical population intelligence algorithm. The research background of the algorithm is to mimic a small bird flock searching for food, they compare each particle, that is, each solution, to a small bird flying alone to capture food, when the bird searches for food during flight, it is equivalent to each particle activity in D-dimensional space to find the optimal solution, the small bird flock in the process of flight, the speed of the flight, flight attitude, is based on the other flock of birds in the flight dynamically adjusted. When one of the birds finds food, which is equivalent to one of the particles searching for the optimal solution, the flock dynamically adjusts its flight, and in this way, the flock of particles dynamically searches for the optimal solution space.

The multi-objective optimization problem can be expressed as follows: min{y}=f(x)

Set of functions to be optimized: f(x)=[f1(x),f2(x),fr(x)] ;

Constraints: s.t.g(x)=[gk(x),gk(x),gk(x)] ;

Decision vectors: x=(x1,x2,xn)X ; X is the space consisting of decision vectors.

Objective vectors: y=(y1,y2,yr)Y ; Y is the objective space consisting of the objective vectors.

The optimization function will map the decision vector x to the objective vector y, assuming that the decision variable n = 2, the objective vector r = 3, in the absence of constraints (m=0) mapping relationship. The multi-objective optimization mapping relationship is shown in Figure 5.

Figure 5.

Multi-objective optimization mapping relation

From the above particle swarm optimization theory content can be summarized particle swarm optimization algorithm contains the basic elements include:

One or more objective functions, the purpose of which is to find the value or quantity that maximizes or minimizes the objective function.

A set of unknowns or variable x, whose value affects the value of the objective function.

One or more constraint functions (conditions) that the objective function has in order to limit the range of values of each variable.

Multi-objective optimization methods

The multi-objective particle swarm optimization algorithm solves the problem of how to select the global optimal value problem, in the iterative process of the algorithm, the non-inferior solution with the sparsest density of non-inferior solutions is selected as the global optimal value, so as to guide the multi-objective particle swarm to find out the set of non-inferior solutions with uniform distribution as far as possible. Firstly, the network is divided in the target adaptation space, the value of each hypercube adaptation is assigned according to the number of non-inferior solutions contained in the hypercube, the hypercube is selected according to the roulette wheel method, and the global optimal value is an arbitrary particle of the hypercube, and during the algorithmic iteration process, the non-inferior solutions are obtained in each generation and saved in the non-inferior solution set, and then the non-inferior solution set is updated generation by generation. The steps of the algorithm are as follows:

Step1: Initialize the particle swarm. Randomly initialize the particle swarm position information, calculate the target of each particle in the particle swarm, and initialize the velocity of each particle in the particle swarm Vid(0).

Step2: Establish non-inferior solution set (REP). Calculate to find the best point pid(0) traversed by each particle and exist it in the non-inferior solution set.

Step3: Update the particle population

Select REP[u] from the non-inferior solution set (REP):

Divide the network from the target space and calculate the fitness of each hypercube as follows: fitness[i]=a/b

Where a > 1, b is the number of non-inferior solutions within the ird hypercube, b = 0 when fitness[i]=0 . According to the roulette method, a hypercube is selected, and the larger the value of fitness[i] , the greater the probability of being selected, and a non-inferior solution is randomly selected as REP[u] within the selected hypercube.

Calculate the velocity [vid(k)] of the population particle [xid(k)] according to the following formula:

The velocity update formula is: vid(k+1) = χ[vid(k)]+c1rand()[pid(k)xid(k)] +c2rand()[REF(h)xid(k)]

Where: χ is the compression factor: rand( ) is a random number between [0, 1]; c1, c2 are acceleration constants usually taken as 0-2. To avoid particles flying outside the optimization range, each particle range is restricted to be: vid[vmax,vmax]xid[xmax,xmax]

Update the particle swarm position [xid(k)] and calculate the target of the particles: xid(k)=xid(k)+vid(k+1)

Step4: Update the REP.

Step5: Update the optimal solution Pid(k) found by the particle.

Step6: Terminate the judgment, if satisfied then terminate the program, otherwise go to Step3.

Electromechanical composite braking zone optimization algorithm implementation

The following multi-objective particle swarm optimization algorithm is applied to the braking force allocation strategy. The braking region division is shown in Fig. 6. On the I line and the ECE curve graph, the braking intensity Z of the point corresponding to the ECE-ZP has the following formula to determine, such that Fr = 0 the value of the horizontal coordinate of the ECE-ZP is known from Eq: FECEZP= [(0.07h+b0.85L)G[(0.07h+b0.85L)G]20.28bG2h]/2h

Figure 6.

Brake area division

This can be obtained by bringing FECEZP into Eq: ZECEZP=FECEZPmg =[(0.07h+b0.85L)(0.07h+b0.85L)20.28bh]/2h

Bringing in the parameters calculates ZECEZP = 0.1742.

Similarly the coordinate values of I-ZM (I-Ff, I-Fr) can be obtained i.e: (2504.4z(2z),2504.4(6.2+z2))(0.1742<0.z<0.7)

The coordinate values of ECE-ZM (ECE-Ff, ECE-Fr) viz: (5124.2(0.5z2+1.185z+0.0805),2562.1z2+5666.6z412.5) (0.1742<0.z<0.7)

When the braking intensity Z is between (0.1742, 0.7), the same braking intensity Z line, Fr, Ff satisfies the following constraints: { 2504.4z(2z)Ff5124.2(0.5z2+1.185z+0.0805) 2504.4(6.2+z2)Fr2562.1z2+5666.6z412.5

The braking force Ffe = FfFfm assigned to the motor when the pure electric vehicle is braking and the braking intensity Z is between (0.1742, 0.7). The motor power constraints are: 0FfeFfemax

Where Ffe−max is the maximum braking force of the motor. The maximum braking force is related to the motor and battery performance parameters. Specifically, there are the following relationships:

The objective function G1 is determined

In the pure electric vehicle for regenerative energy dynamics, taking into account the 0-100km/h acceleration time (s) and the maximum speed of the premise of the standard, the braking force distribution must be close to the ideal braking force distribution curve and below the I line. So the following brake power distribution point from the ideal brake power distribution line I line geometric distance as an objective function to characterize the dynamics, that is, when the acceleration time is shorter, the power distribution point closer to the I line corresponds to the shortest distance between the two, in the same brake power strength Z line.

According to the coordinate system distance equation can be seen: G1=(FfzIFf)2(Fr2IFr)2

Determination of objective function G2

When the pure electric vehicle performs economic braking, the 100 km hydrogen consumption (L) maximization factor is considered, so that the 100 km hydrogen consumption (L) allocation on the same braking intensity Z line tries to maximize the regenerative braking energy feedback power, i.e., even if it is obtained that Ffe is a large proportion of the total braking power allocated to the front wheels. According to the feedback power equation: G2=Ffevη(FfevηU)2R

To summarize:

The objective function of particle swarm optimization is: minG1 maxG2

Constraints: { 2504.4z(2z)Ff5124.2(0.5z2+1.185z+0.0805) 2504.4(6.2+z2)Fr2562.1z2+5666.6z412.5

In summary, the parameters of the multi-objective particle swarm optimization algorithm are determined and the particle swarm algorithm parameters are set as shown in Table 1 below.

The particle swarm algorithm parameter Settings

Parameter Iteration number(M) Population scale(N) Acceleration constant(C)
Set value 200 100 C = 2, C = 2
Parameter Inertia weight Decision vector dimension(D) Maximum speed (V)
Set value w 3 50
New energy vehicle battery management system capacity estimation and energy distribution optimization experiment

The model of the fuel cell vehicle is established, and the relevant parameters of the vehicle are shown in Table 2. And according to the actual situation of urban road driving (acceleration, deceleration, starting, idling) to choose the appropriate cycle conditions used to simulate the actual road, you can choose a variety of cycle conditions or a combination of them in ADVISOR2000. After entering the software, first select the FUEL-CELL-defaults-in model, which is a fuel cell vehicle. Then each parameter in Table 2 is entered into the whole vehicle input interface. Variables such as half-load mass, full-load mass, transmission efficiency, rated power, and rated torque can be entered directly in the input interface. Other variables such as vehicle, energy storage, motor, transmission, wheel/axle, accessory, fuel converter, and power train control need to be written in the corresponding m-files of each component and added to the work list after they are written.

The parameters of the car

Parameter name Numerical value
Half load/kg 2000
Full load/kg 2350
Windward area/m2 2.16
Wind resistance coefficient/cd 0.33
Rolling radius/m 0.308
Rolling resistance coefficient 0.0014
Main speed ratio 8.8
Transmission efficiency 0.95
Minimum power/kW 40
Maximum power/kW 75
Rated power (maximum power)/kW 45(90)
Rated torque (maximum torque)/(N·m) 110(220)
Rated speed (maximum speed)/(r/min) 4100(12500)

The NEDC condition is composed of four urban cycles and one suburban cycle, which is close to the daily demand, so the NEDC condition is adopted. When the car parameters are set, click Continue in the lower right corner to enter the next simulation setup. The experimental results of the original mixing degree under the NEDC condition are shown in Fig. 7, and (a)~(d) represent the speed, ess-soc-hist, emissions, and overall ratio, respectively. It can be seen from the figure that the car’s charging state (ess- soc-hist) has been maintained near 0.8 without substantial changes, which indicates that the car is working normally at this time and the battery is in good condition. After organizing the performance indexes of the whole car in the figure, it is found that the 100km hydrogen consumption of the fuel cell hybrid car under the NEDC condition is 83.26L, the maximum speed is 125.01km/h, and the acceleration time from 0 to 100km/h is 1088ms. By writing the m-file of FUEL_CELL_defaults_in the whole vehicle input interface for Fuel Converter and Energy Storage modules again, the mixing degree is inputted into the model. The car model was simulated again under NEDC conditions.

Figure 7.

Experimental results of the original mixing degree under NEDC condition

The experimental results of the new mixing degree under NEDC conditions are shown in Fig. 8. From the figure, it can be seen that the charge state (ess-soc-hist) of the car has been still maintained near 0.8 without substantial changes, which indicates that the new mixing degree makes the car work normally and the battery is in good condition, and does not reduce the battery life. Under NEDC conditions, the fuel cell hybrid car has a 100km hydrogen consumption of 80.94L, a top speed of 125.01km/h and an acceleration time of 1088ms from 0-100km/h.

Figure 8.

Experimental results of the new mixing degree under NEDC condition

The results of the performance index comparison before and after optimization are shown in Table 3. The optimized mixing degree ensures the 0-100km/h acceleration time and the maximum speed remains unchanged while the 100km hydrogen consumption is reduced by 2.32 L. This shows that the scheme improves the economy of the car without affecting the dynamics of the car, which leads to the improvement of the performance of the whole car. From the above, it can be seen that the feasibility of the scheme is confirmed under NEDC working conditions.

Comparison of performance indexes before and after optimization

Survey content Categories Parametric performance Numerical value
Performance indicators for new mixtures Power 0-100km/h acceleration (ms) 1088
Maximum speed (km/h) 125.01
Economy 100 kilometers of hydrogen consumption (L) 83.26
Comparison of performance indexes before and after optimization Categories Parametric performance Preoptimize After optimization Contrast
Power 0-100km/h acceleration (ms) 1088 1088
Maximum speed (km/h) 125.01 125.01
Economy 100 kilometers of hydrogen consumption (L) 83.26 80.94
Conclusion

Starting from the battery management of new energy vehicles, this paper proposes a battery management system capacity estimation model (MOF-RFR) after optimizing the random forest algorithm using the mothballing algorithm. Then it combines the multi-objective particle swarm optimization algorithm to design the energy allocation strategy for new energy vehicles, realizes the electromechanical composite braking optimization algorithm based on power and economy, and verifies its application effect in new energy vehicles. The research results show that:

The battery capacity estimation effect of MOF-RFR model is better than other models, and its average error of different battery capacity estimation is only within 1.7%, and the evaluation effect is closest to the real situation. The charge state of the car is stable (maintained at about 0.8), which indicates that the car is working normally and the battery is in good condition. At this time, under the NEDC condition, the 100km hydrogen consumption of the fuel cell hybrid car with the new mixing degree is 80.94L, which is 2.32L less than that of the original mixing degree, and its maximum speed (125.01km/h) and 0-100km/h acceleration time (1088ms) remain unchanged. This indicates that the MOF-RFR model improves the economy of the vehicle without affecting its dynamics and improves the overall performance of the new energy vehicle.

Language:
English