A new adaptive PSO-PID control strategy of hybrid energy storage system for electric vehicles

Research on optimization of control strategy for hybrid energy storage system (HESS) of the electric vehicle (EV), a new adaptive control strategy based on particle swarm optimization (PSO) algorithm is proposed in this paper. The steady-state power of the filtered power is used as the ideal output power of the battery. For the steady-state current output of the battery, the output power of the ultracapacitor is dynamically adjusted by the proportional-integral-derivative (PID) controller to construct a power difference control structure. The parameters of PID controller are optimized by PSO algorithm, and the target test is compared and analyzed based on MATLAB/Advisor. The research results show that the proposed PSO-PID control strategy can quickly eliminate the power deviation and achieve the approximate global optimization of the EV energy management strategy. Compared with the pre-optimized PID control strategy, the output current and power of the battery pack are smoother and the total power consumption is reduced by 3.8360% and 0.5125%, respectively. Then, the energy consumption parameters of PSO-PID are compared with the theoretical minimum energy consumption calculated by dynamic programming (DP) algorithm, and the deviation is less than 1% under both conditions.


Introduction
Automobile brings convenience to human beings and challenges to environmental pollution and energy crisis at the same time. Nowadays, new energy vehicles are the focus of automobile industry research. Different from traditional fuel vehicles, new energy vehicles can effectively reduce the dependence of vehicles on fossil fuels. Among them, EV has the advantages of zero emission and low running noise, but its development is subject to technical obstacles such as short and unstable mileage, battery life, and lack of power during heavy load operation. Single energy storage system can not meet the requirements of EVs, the HESS is needed to ensure the mileage and power performance of the vehicle. HESS is composed of high energy density battery and high power density ultracapacitor. The two energy sources complement each other and can improve the energy utilization and power performance of the vehicle. The adoption of appropriate energy management strategy for the composite power system has a great impact on the battery cycle life, vehicle power 1 performance and economy, and can optimize all aspects of the performance of EVs.
The early research on energy control strategy is not mature, most of the research took the speed as the main control parameter of the energy system. Because the speed-based energy management strategy has simple design structure and easy technical implementation. There are many shortcomings in this control method. When the vehicle is cruising at high speed and does not need high power output of power supply, because the vehicle speed is too high, the energy system will be required to output high power, increase the load of power supply system and reduce the economy of the vehicle. [1][2][3] At present, domestic and overseas scholars have made extensive research in this field. There are many mature research results of energy management strategy based on HESS. The research on energy management strategy is basically based on regulating the output power of energy storage equipment. And there are four main energy management strategies for HESS: fuzzy logic control, static logic threshold control, instantaneous optimal control, and global optimal control. 4 Lagorse et al. 5 proposed a distributed energy management strategy based on multi-agent, and controlled the energy flow of hybrid energy system through fuzzy logic. For the energy control strategy of hybrid electric vehicle (HEV) power supply, Erdinc et al. and Chun et al. 6,7 proposed a control strategy based on wavelet transform combined with logic threshold and fuzzy logic to avoid sharp and transient changes in energy demand and prolong battery life. Li et al. 8 based on the battery terminal voltage and state of charge (SOC), to overcome the problem of battery over discharge and related damage caused by inaccurate SOC estimation, proposed the battery working state parameters to manage with fuzzy logic. Banvait et al. 9 proposed an energy management strategy based on the logic threshold rule to optimize the fuel economy model in view of the limited electric drive mode of HEV. Some scholars also use algorithms to optimize the control strategy and optimize the performance of HESS by changing the membership function of fuzzy logic and the threshold value of fuzzy rules or threshold logic. [10][11][12] In the framework of multi-objective optimization, Farouk et al. 13 use genetic algorithm and pareto frontier analysis to optimize the parameters of power management strategy, comprehensively considering hydrogen consumption, battery load and acceleration performance, and verified the optimization results on the test bench.
Most global optimal control strategies are based on DP algorithm. Wei et al. 14 used the global optimization of dynamic programming and the real-time performance of equivalent consumption minimization strategy (ECMS) in hybrid electric vehicle operation strategy optimization, the optimization model of HEV operation strategy is obtained by combining ECMS and DP. Hung and Wu 15 designed a multi-for-loop structure with a preset cost function to globally calculate the optimal crossover of hybrid energy system, and combined with a rule-based three-mode strategy to search for optimal power allocation. Odeim et al. 16 studied the optimization of off-line and real-time power management strategies for hybrid electric vehicles, and proposed a new form of real-time strategy optimization problem, which allows the controller to optimize once in a set of driving cycles and apply it to two forms of real-time controllers to compare the control effect.
To sum up, in the actual working condition of EV, if the battery maintains a steady state of low load operation, and the ultracapacitor provides the high frequency power demand in the heavy load condition, it can greatly prolong the life of the battery pack and make the HESS reach an optimal operation state. Because the logic threshold and fuzzy logic control rules are relatively fixed, it can not be adjusted to the optimal power allocation in real time. Therefore, this paper takes the control strategy of HESS as the research object, and proposes an adaptive energy management strategy optimization method based on PID control. By filtering the demand power, the low frequency part of the demand power is borne by the battery, and the output power of the ultracapacitor is dynamically adjusted by PID controller to make it bear the high frequency power output. The two work together to output the power required by vehicle. PSO algorithm is introduced to optimize the parameters of PID controller, and a new PSO-PID control strategy is designed to optimize the adaptive control strategy of compound electric derivation of EVs.

Structure and model description of energy system
The HESS model The battery-ultracapacitor composite energy system has three structural forms: passive, semi-active, and fully active. In the passive structure, the battery and the ultracapacitor are connected in parallel, the structure is simple, but the working current can not be controlled. Based on the passive structure, the full active structure adopts two DC/DC converters which are respectively connected to the battery and the ultracapacitor, which can flexibly adjust the current, but the cost is too high. In this paper, a semi-active composite energy system structure is adopted, the ultracapacitor is connected to the DC/DC converter, the battery is connected in parallel, and the end of the battery is connected with the load. Compared with connecting the load with the ultracapacitor end, the system is easier to control, the bus voltage is more stable, and the system cost is reduced at the same time. 17 The system structure diagram is shown in Figure 1.

The battery model
Battery is a complex non-linear electrochemical energy storage device. On the one hand, it is difficult to describe the interaction and reaction in the control process by precise formula. On the other hand, it needs a lot of data input and learning to fully use the data modeling generated by experiments. Since the equivalent circuit model does not need to have a deep analysis of the electrochemical reaction inside the battery. The open circuit voltage, DC internal resistance, and polarization internal resistance of the battery are described through the circuit to realize the characterization of the external characteristics of the battery, 18 so the equivalent circuit model is selected for modeling.
The internal resistance of the battery is divided into ohmic internal resistance and polarization internal resistance. Ohmic internal resistance includes electrode material, electrolyte, diaphragm resistance, and contact resistance of various parts. Polarization internal resistance is the resistance caused by polarization during electrochemical reaction. In this study, the effectiveness of the control strategy and optimization algorithm is mainly verified by comparison, and the small range error of single group of data can be ignored. Therefore, the effect of battery polarization is not considered, and the Rint equivalent circuit model is used to describe the battery, as shown in Figure 2, including an ideal voltage source U and an equivalent series internal resistance R.
The mathematical description of the battery model is as follows.
where U 0 is the open circuit voltage. R 1 is the equivalent internal resistance of the battery. Q bat is the state of energy (SOE). P bat is the battery power.
For EVs, the energy capacity of the battery can affect the running state of the vehicle, and its mathematical model is shown in formula (3).
where U i, SOC ð Þ is a function of all cell currents and their SOC.

The ultracapacitor model
The power density of ultracapacitor is high, but the energy density is much lower than that of storage battery. Because of its low energy density and the correlation between voltage and charged state, ultracapacitor can not drive EVs alone, but as an auxiliary power source.
The equivalent circuit model uses resistors and capacitors to describe the dynamic working characteristics of supercapacitors, which has practical physical meaning and practicability, so the equivalent circuit model is also used to describe the ultracapacitor. As the result of parameter identification of the ultracapacitor equivalent circuit directly affects the accuracy of the model, it is necessary to use the appropriate model to describe it. 19 Because this study mainly proposes the control strategy and optimizes the strategy on this basis. Therefore, the classical equivalent circuit model is selected for modeling. As shown in Figure 3, the model is composed of a large resistance R 1 in series, a group of parallel resistance R 2 and an ideal capacitor C. The model parameters are obtained by measuring the voltage response in the charging process.
The ultracapacitor terminal voltage can be described as  where U 0 is the terminal voltage of the ultracapacitor. U is the voltage of capacitor; I is the working current.
The capacity of ultracapacitor is related to the working current and temperature, which can be seen from formula (5).
Regardless of the influence of temperature, the mathematical model of capacity can be calculated according to the definition of the ultracapacitor, as shown in formula (6).
At the time of n + 1, the electric quantity and working voltage of the ultracapacitor can be described as Within a reasonable operating voltage range V min , V max ½ , SOC of the ultracapacitor can be described as In conclusion, the mathematical model of energy capacity is shown in formula (10).
The DC/DC converter model DC/DC converter can convert the working voltage of direct current (DC) power supply and stabilize the voltage. 20 In this paper, the bidirectional DC/DC converter is used. In the HESS, the converter is connected in series with the ultracapacitor, which can adjust the output of the power supply and stabilize the bus voltage. The circuit mathematical model is described as follows.
where a uc 1 , a uc 2 are control inputs, representing the converter duty ratios for ultracapacitor. i load is disturbance. i bat , i uc are state vectors, representing the current of battery and ultracapacitor. V bus is the DC bus voltage. L uc represent the converter inductance of DC/DC converter. C f represents the DC bus capacity.

Control strategy and optimization of HESS
PID difference power control strategy PID control is one of the earliest developed control strategies. Because of its simple algorithm, high robustness and reliability, it is widely used in industrial process control. PID control constitutes the control deviation according to the given value and the actual output value, and forms the control quantity through the linear combination of the deviation according to the proportion, integration, and differentiation, and carries out the linear control on the controlled object. 21 The principle of conventional PID control system is shown in Figure 4, which is a typical unit negative feedback control system. The system is generally composed of PID controller and controlled object.
The mathematical model of conventional PID controller structure is described in formula (14).  where e is the deviation, that is, the control input. u is the controller output; k P is the proportional coefficient.
The battery life in HESS is generally affected by the working mode and temperature. In this study, the temperature effect is ignored, and the PID control is used as the core to optimize the battery working mode by controlling the power system, and a new power difference control structure is constructed.
The proposed new energy control strategy is based on ultracapacitor, as shown in Figure 5. Firstly, the required power from bus is filtered, and the lowfrequency stable power obtained by filtering is taken as the ideal output power of the battery pack. During the operation of the power system, the battery is kept in an ideal operation state. The high-frequency power obtained by filtering is used as the ideal output power of ultracapacitor. There is a difference between the actual output power and the ideal output power, and the overall output power of the power system needs to meet the bus power requirements, so the power difference is compensated by the battery.
The purpose of the control is to optimize the working mode of the battery and keep the output close to the ideal state, so the power difference should be as small as possible. The output power of the ultracapacitor is close to the ideal state by PID control, which makes the compensation power of the battery as small as possible, so as to maintain the low-frequency stable power output of the battery. Thereby, under the condition of meeting the power demand, the ideal energy control of the power system is realized.
The ideal output power of the ultracapacitor is shown in formula (15).
where P req , P l , and P h are respectively the demand power, the low frequency part of the demand power, and the high frequency part of the demand power.
The difference between the ideal output power and the actual output power, that is, the power deviation can be described as where D P is the power deviation. P uc is the actual output power of the ultracapacitor. The purpose of PID controller is to control the output power of the ultracapacitor by outputting PMW signal, and then control the output power and working current of the battery. There is a positive and negative relationship between the feedback deviation of output power of the ultracapacitor and the input quantity of PID controller, which is described by mathematical model as The presence of differential gain in PID control is mainly used to overcome the hysteresis of the controlled object, and is commonly used in temperature control systems to eliminate the problem of measurement signal transfer delay. In this study, the PID controller is used to limit the power output of the ultracapacitor, the power signal hysteresis is small and has very little influence on the final simulation results. Therefore, the differential gain is set to 0 in this paper to save the operation space and make the optimization performance of the algorithm better. The constraint of PID control parameters is shown in formula (18).
Optimization of energy management strategy In the process of designing and applying PID controller, three parameters of the controller determine the control quality. The proportional function makes the input and output of the controller proportional. It can reduce the deviation, accelerate the response speed, shorten the regulation time, but it will make the dynamic performance of the system worse, and even make the closed-loop system unstable. The introduction of the integral function is beneficial to eliminate the steady state error, but reduces the stability of the system. According to the trend of deviation change, differential function can speed up the system response, reduce overshoot effectively, and improve the dynamic characteristics of the system. But it is too sensitive to reducing the interference suppression ability of the system. 22 Therefore, the parameter selection of PID controller must take into account the dynamic and static performance index requirements. Only reasonable selection of proportion, integral and differential parameters can better optimize the control performance.
To summarize, the optimization of PID adaptive control strategy is to optimize the parameters of PID controller. In this study, the algorithm is used to calculate and optimize PID parameters to make the power distribution of the HESS closer to the ideal state, so as to achieve the purpose of optimal control.
Evaluation function of algorithm. In the algorithm optimization, the working current of the battery and the total power consumption of the HESS are taken as the multi-objective parameter optimization objects. The mathematical model of the optimization problem is shown in formula (19).
Taking the output current of battery and the power consumption of the HESS as the multi-objective optimization model, the evaluation index model of battery current is as follows.
Generally, the total energy consumption of vehicles can be used as the economic evaluation standard of EVs. The research object of this paper is the EV, so the energy consumption of the HESS is used as the evaluation index.
In order to calculate the energy consumption of the HESS, it is necessary to consider the loss of each component, including battery loss, ultracapacitor loss, DC/ DC converter loss, line loss, and motor loss, etc. Battery and ultracapacitor, DC/DC converter are the main loss objects, ignoring other losses, the mathematical model expression is shown in formula (21).
where, P b , P uc are the output power of the battery and ultracapacitor. E l b , E l uc , and E l dc are the consumption of battery, ultracapacitor, and DC/DC converter, respectively. I b , I uc are the working current of battery and ultracapacitor respectively. h in is the input current of DC/DC converter.
Combined with formula (19-21), a multi-objective optimization model is obtained, which takes the working current of battery and the energy consumption of the HESS as the optimization objective. It can be written as For the weight ratio assignment of multi-objective weighting function, the weight ratio assignment in this paper is shown in formula (23).
PSO algorithm optimization. The algorithm represents a systematic method to describe the strategy mechanism of solving the problem. Most of the algorithms have similar processes. First, after initializing the group, the group is evaluated according to the evaluation function set by the optimization goal, and then updated iteratively until the algorithm is terminated. Its purpose is to find the optimal solution. The difference is the evaluation function, iteration method, update method and so on. Choosing the appropriate algorithm for the optimized data type can find better results in a shorter time.
The optimization object in this paper is the control parameters of the PID controller, which, as can be seen from ''PID difference power control strategy,'' belong to the continuous values with constraints. Therefore, the optimization problem in this study is equivalent to the nonlinear global optimization of continuous values.
The traditional method for global optimization is a numerical optimization method based on gradient information, which is discussed in reference. [23][24][25][26] The optimization idea of the gradient descent method is to use the negative gradient direction of the current position as the search direction. The closer the gradient descent method is to the target value, the smaller the step size and the slower the advance. The closer to the optimal solution in the optimization process, the slowest the optimization will be. The problem with the gradient descent method is that, in general, its solution is not guaranteed to be globally optimal, and the gradient descent method may not be the fastest.
Therefore, heuristic algorithms have better performance in global optimization than the traditional gradient descent method. There are also a large number of scholars solving optimization problems based on heuristic algorithms, such as genetic algorithm, particle swarm optimization algorithm, ant colony algorithm, simulated annealing algorithm and so on. [27][28][29][30] In order to ensure global optimization, it is necessary to go beyond the limits of local optimality. And in a heuristic algorithm, the fall into local optimality cannot be avoided. The heuristic, which is essentially a greedy strategy, is also objectively determined to miss better solutions that do not conform to the greedy rule. 31 When the local optimum is solved, various heuristic algorithms can find the global optimum solution to achieve the same optimization in some applications of the actual optimization problem. Therefore, the choice of algorithm at this point needs to be based on performance. Depending on the optimization problem, choose the algorithm with the fastest optimization speed.
According to the references, 32,33 PSO algorithm usually has faster convergence compared to other algorithms, especially in the early stage of the algorithm. However, due to large acceleration coefficients and large speed settings, PSO is more likely to miss the global optimum, making the algorithm not converge or fall into a local optimum. Therefore, the algorithm needs to be constrained to ensure that it can find the global optimum. References 34,35 has also been studied PSO algorithm. Most of the models of PSO are known to be time-invariant linear models under the assumption that the local optimal solution and the global optimal solution are invariant. For continuous value optimization problems, PSO algorithm has a memory function and moves toward the global and local optimum in each iteration.
The above shows that the optimization problem in this study is the nonlinear global optimization of continuous values, which matches the type of data applicable to the PSO algorithm. By limiting the range of PID control parameters and setting the parameters of the algorithm rationally makes the algorithm have faster convergence without falling into a local optimum. Therefore, in this control system, the PSO algorithm is used to optimize the PID control parameters, which can realize the global optimization of the algorithm and greatly shorten the optimization time.
PSO algorithm originates from the research on the behavior of bird flock predation, and the basic core is to make the movement of the whole group evolve from disorder to order in the problem-solving space by sharing information among individuals in the group, so as to obtain the optimal solution of the problem. In this algorithm, a massless particle is designed to simulate the birds in the flock. The particles have only two attributes: speed and position. The speed represents the speed of movement and the position represents the direction of movement.
Each particle searches for the optimal solution separately in the search space, which is recorded as the current individual extreme value, while the individual extreme value is shared with other particles in the whole particle swarm, and the optimal individual extreme value is found as the current global optimal solution of the whole particle swarm. All particles in the particle swarm adjust their speed and position according to the current individual extreme value they found and the current global optimal solution shared by the whole particle swarm. 36,37 The running process of the algorithm is shown in Figure 6. The parameters of the PID controller are optimized by using the PSO algorithm. After initializing the particle swarm, the local optimal P best and the global optimal G best of the particle are obtained by calculating the individual fitness value, so as to update the speed and position of the particle. Through continuous iteration, the optimal particle is obtained after meeting the goal, and the algorithm is finished.
Combined with the formula (22), the fitness function of the algorithm can be set as The parameters of PID controller are optimized by PSO algorithm, and the optimization range of parameters is as follows.
In order to optimize the objective function, the algorithm updates the specific rules as shown in the formula (26).
where v is the inertia factor, and its value is non-negative. v i , x i are the particle velocity and position. rand() represents random number. c 1 , c 2 are learning factors.
To optimize with PSO algorithm, the setting parameters of algorithm need to be obtained. In this study, the dimension search space is the PID control parameter value space.
PSO does not have a high requirement for the number of groups, and a general scale of 20-40 can have a better optimization effect. So, the particle swarm size is set as The learning factors represent the acceleration weights for particles to advance to the individual optimal and global optimal, the learning factors are set as Generally, the maximum moving speed of the particles is set to 10% to 20% of the corresponding dimension search space. Due to the small search space, the moving speed is described as formula (29).
Since there are three optimization parameters, the dimension of algorithm is set as After many tests of algorithm optimization, it was found that each iteration converged within 50 times, so the maximum number of iterations is set as Set the minimum fitness value as shown below.
The inertial factor v affects the speed of particle movement. Therefore, set v to a dynamically changing value, set v to take a larger value at the beginning of the search, and then gradually decrease the value of v as the number of iterations continues to increase.

Dynamic programming
Dynamic programming algorithm, based on Bellman principle, is a multi-stage optimal decision-making algorithm. Its essence is to solve complex problems by decomposing the original problem into relatively simple subproblems. The problem of optimizing power output by controlling the power system proposed in this paper can be regarded as a multi-stage decision-making problem with discrete time as the stage. In each time period, the output is carried out in the optimal energy distribution mode to get the optimal control effect. Therefore, DP algorithm is suitable for the control of power system. 38 The limitation of DP algorithm is that it needs to get the condition information in advance and ensure the driver's power demand is consistent with the condition power demand. This makes DP algorithm can only calculate the optimal solution of the control system offline, and it can be said that the optimal solution obtained by DP algorithm is the theoretical optimal solution. DP algorithm selects the optimal control in each stage, and finally obtains the optimal solution of the system. The simulation conditions obtained in advance are divided into n segments, and the overall optimization problem of the system is decomposed into several small progressive problems. The mathematical model is expressed as follows.
In the phase N: In the phase k: Where J k x k ð Þ ð Þ is the optimal solution function of state x k ð Þ.
Every stage of the system runs according to the optimal control law until the end, and the optimal solution is obtained. The optimal control law formula in every time k is: In order to establish the multi-step decision-making process of energy management, the state variables and control variables of the control system must be discretized. The optimization of HESS is constrained.
The total energy consumption and battery current are discretized to a finite concentration.
After initializing the algorithm, there are N stages in total, and J k x k ð Þ ð Þ is calculated in each stage. The optimal solution obtained after the end of all phases is the optimal optimization function of the whole control system, that is, the lowest value of energy consumption is obtained.

Result analysis and discussion
In order to verify the rationality of the proposed PID control strategy and the effectiveness of PSO algorithm, the EV model of MATLAB/Advisor is used for simulation analysis. The vehicle parameters for simulation are shown in Table 1.
The modified top-level model of EV is shown in Figure 7. In the vehicle model, the default transmission is single speed transmission, and the vehicle load is constant power load. Due to the zero emission and zero pollution of EVs, the emission post-processing module is ignored and the emission output is zero.
The working condition method is an experimental method to evaluate the running condition of vehicles, and the essence of different test conditions is to simulate the running conditions of cities or suburbs in these areas, including acceleration, climbing, deceleration, and uniform speed condition. 39 In this study, the simulation analysis is carried out under two driving cycles: UDDS and NEDC. The schematic diagram of its operating condition is shown in Figure 8.

Result analysis
In order to verify the rationality of the proposed PID power difference control structure, the simulation results of single energy storage system (SESS) and HESS with PID control strategy are compared under two different operating conditions, as shown in Figure 9.   It can be seen that in the simulation process of HESS equipped with PID power difference control, the battery current output is more stable and the peak value is lower. When the operating condition simulation is terminated, SESS consumes more battery power, indicating that its battery life is not as good as HESS equipped with PID control strategy.
Based on the PID difference control strategy, the PSO algorithm is used for optimization to obtain the PSO-PID control strategy. In order to get the optimized performance of the algorithm, choose to simulate under UDDS and NEDC conditions. The convergence curve of the algorithm under the two operating conditions is shown in Figure 10, and the optimized PID control parameters are shown in Table 2. Figure 11 is the torque comparison diagram. As shown in figure, the motor output torque curves of the HESS based on the two control strategies basically coincide in the test process of two different operating conditions, which verifies that the PSO-PID control strategy is to optimize the battery performance and total power consumption on the premise of maintaining the power performance of the vehicle.
It can be seen from the Figure 12 that in the simulation process of the HESS based on PSO-PID control strategy, the output current of the battery fluctuates less and maintains a steady-state output state, and the peak current is lower, which can be obtained from Table 3. After being optimized by PSO algorithm, the output peak current of the battery is 17:9350A and 2:1906A lower than that before optimization.
As shown in Figure 13, under the conditions of UDDS and NEDC, compared with the PID control strategy, the PSO-PID control strategy proposed in this paper has smoother power output of the battery and greater fluctuation of the ultracapacitor output power. Therefore, it can be known that when the optimized strategy controls the output power of the composite   power supply, the ultracapacitor undertakes the power output of the high frequency part in the working process. By comparing the total energy consumption of the HESS in Figure 14. It can be seen that under the two operating conditions, the total energy consumption of the HESS using PSO-PID control strategy at the end of the simulation is lower than that before optimization. As shown in Table 2, the optimized control strategy is 3:8360% and 0:5125% lower than that before optimization, respectively. Table 3 also shows the theoretical minimum energy consumption value of the proposed power difference control structure under two conditions calculated by DP algorithm. The results show that the theoretical minimum energy consumption in UDDS is only 0.9066% lower than that in PSO-PID, and 0.2245% lower in NEDC. The difference between DP algorithm and PSO-PID optimized value is less than 1%, which proves the effectiveness of PSO-PID. On the premise of ensuring the power performance of the vehicle, the PSO-PID control strategy can optimize the battery output current, compensate the high frequency power output by the supercapacitor, and reduce the total energy consumption of the HESS. It has the effect of energy saving while protecting the operation of the battery.

Discussion
In this study, the power difference control strategy based on PID is proposed for HESS, and PSO algorithm is used to optimize the system. It can be said that an optimal control system based on PID is designed for the power system. After the above simulation results verify the control performance of the system, it is necessary to further evaluate the stability and robustness of the control system itself. Stability refers to the ability of the system to resist external interference to maintain the ideal working state, while robustness refers to the ability of the system to resist external interference when the internal structure is disturbed. 40,41 In Lyapunov's discussion of stability, stability refers to the criterion that the equilibrium state of a system is stable or unstable. It mainly involves stability, asymptotic stability, large-scale asymptotic stability, and instability. The control system proposed in this study makes the power output of the power system approach the ideal working state by matching the simulation conditions. External interference can be defined as working condition and bus power demand. According to the description of power difference control system in ''PID difference power control strategy,'' for bus power demand, PID control can better limit the power output, so that the ultracapacitor can output high-frequency power to maintain the stable operation of the battery. For different simulation conditions, UDDS and NEDC are taken as examples in this paper. PSO algorithm can optimize PID control parameters to achieve the matching of control system. Therefore, the control system has good stability.
The internal disturbance of the control system is mainly the PID control parameters and the internal friction of each control component. Because the internal friction of components is ignored in this study, only the interference of PID control parameters to the system is considered. It can be seen from the simulation structure that after the PID control is optimized based on PSO algorithm, the system still maintains the optimal energy allocation. Therefore, the system has good robustness.
In conclusion, the control system proposed in this paper has better optimal control ability under the premise of maintaining good robust stability.

Conclusion
This study takes the EV equipped with semi-active HESS as the research object, constructs a new PID energy management structure. On this basis, using PSO algorithm to optimize the parameters of PID controller, and puts forward the PSO-PID energy management strategy.
(1) A new energy control structure of the HESS is established in this paper. Based on PID control strategy, the power difference is used as the