Parameters optimization of two-speed powertrain of electric vehicle based on genetic algorithm

Aiming at the shortcomings of only optimizing the gear ratios of two-speed transmission in the optimization process of two-speed powertrain parameters of electric vehicles, the optimization of two-speed powertrain parameters of electric vehicles based on genetic algorithm is proposed. The optimization process is to optimize the main performance parameters of the drive motor and the gear ratios of two-speed transmission. That is, taking the economy and dynamic of the electric vehicle as the fitness function, the gear ratios of two-speed transmission is optimized under the main performance parameters of different drive motors, so as to find the powertrain parameter with the best fitness function value. Among them, the AMESim software is used to build the vehicle optimization model, the genetic algorithm is improved by MATLAB, and the improved genetic algorithm is used to optimize the vehicle optimization model. The results show that the optimization of the vehicle’s economic and dynamic performance has been improved, indicating that this optimization method is effective.


Introduction
Today's stringent environmental standards and new fuel economy regulations have obliged automobile manufacturers to design vehicles with improved fuel economy and better emission performance. To comply with these new challenging requirements, the automotive industry has a strong tendency toward using ''green'' technologies. 1 Among them, the development of electric vehicles is relatively rapid, and related technologies continue to progress, and gradually become mature. And the drive motor and transmission are the key components of the pure electric vehicle drive system. It is necessary to do reasonable parameter matching and design optimization to make it possible to maximize the driving range of the vehicle under the same power battery conditions. 2,3 At present, most electric vehicles use fixed speed ratio reducers, which can simplify the structure and reduce the weight and cost. However, to meet the acceleration performance and the maximum speed of the 1 School of Automotive and Transportation Engineering, Hefei University of Technology, Hefei, China vehicle at the same time, higher requirements are imposed on the design of the motor system with a fixed speed ratio. 4 An electric vehicle that matches a two-speed transmission reduces the performance requirements of the drive motor while improving overall vehicle power and economy. [5][6][7] Many literatures have studied the feasibility of multi-speed transmission. The literatures compare the electric vehicle matching the power system of the single-stage reducer with the electric vehicle matching the power system of the twospeed transmission, which shows that two-speed transmission can improve vehicle performance better than single-stage transmission. 8,9 The literature focuses on the possibility of using a transmission over 2 speeds in a pure electric vehicle (EV), and the results demonstrate that the efficiency and performance of the motor are improved by adding gears. However, under conditions of different routes, the requirements of the quantity of speeds are different. 10 A new all-electric vehicle layout was developed, including two powertrains, each of which included a two-speed transmission for improving vehicle acceleration and grade ability. [11][12][13] Therefore, the development of electric vehicle transmission systems has become a trend.
In the research of multi-speed electric vehicle research, the gear ratio optimization design of the transmission is an important part. Countries have studied the gear ratio matching and optimization of electric vehicles. The literatures take the energy consumption of the whole vehicle as the optimization objective and adopts the standard working condition to optimize the gear ratios. 7,[14][15][16][17][18] And in literature, 17 the enumeration algorithm is used to optimize the gear ratios of the two-speed transmission of the electric vehicle under the ECE-EUDC-LOW working condition, and the power and economy of the whole vehicle are improved. But it does not consider the influence of shift schedule on the optimization of gear ratios, so the literatures considers the influence of shift schedule on the optimization of gear ratios when carrying out the optimization of twospeed transmission of electric vehicle. 2,5,19 And in order to obtain the best economic performance of vehicle, the corresponding shift schedule is adopted to adapt to different gear ratios in the literature. 19 And this method takes the gear ratios of the transmission system as the design variable and establishes the objective function considering the lightweight design principle of the transmission system. In the literatures, the two-speed transmission of pure electric special vehicle is optimized, which greatly improves the performance of special vehicle. [20][21][22] A new structure of electric vehicle transmission system has been developed in literature, and its gear ratios has been optimized. 23,24 And in literature, 24 a novel two-speed I-AMT (Inverse Automated Manual Transmission) is studied, and the dry clutch is located at the rear of the transmission so that the traction interruption of traditional AMT can be canceled. And after the gear ratios are optimized using Dynamic Programming, gear shift control is addressed, and smooth shift process without torque hole is achieved through feed-forward and feed-back control of the clutch and the motor .
But at present, most of the research on the optimization of electric vehicle powertrain parameters is carried out for the transmission gear ratios optimization, and the optimization of the main performance parameters (peak torque, peak speed) of the drive motor is not considered. Generally give the drive motor parameters directly, and then optimizing the transmission ratios, does not guarantee that the drive motor parameters and transmission ratios are optimal.
Therefore, this article takes the design optimization of electric vehicle powertrain parameters as the objective, based on New European Driving Cycle (NEDC) working conditions, with economic and dynamic optimization as the optimization goal, and uses improved genetic algorithm to optimize parameters.

Vehicle model
The whole vehicle modeling of electric vehicles mainly includes vehicle longitudinal dynamics model, battery model, drive motor model, transmission model, transmission control unit (TCU) model, and vehicle control unit (VCU) model.

Vehicle longitudinal dynamics model
This research focuses on the dynamic and economy performance of the EV, thus only the longitudinal dynamics is considered in the vehicle model, regardless of the vertical vibration and handling stability. According to the vehicle kinematics equation, the vehicle resistance is as follows where F w is the air resistance, N; F f is the rolling resistance, N; F a is the ramp resistance, N. The vehicle driving dynamic formula is as follows where T d is the torque generated by the drive motor in the drive mode, NÁm; i g is the gear ratio of the current gear; i 0 is the ratio of the final drive; r is the rolling radius of the wheel, m; h t is the current gear transmission efficiency. The vehicle braking force formula is as follows where T b is the torque that the driving motor emits in the braking mode, NÁm; F cb is the normal braking force, N. The vehicle longitudinal dynamic balance formula is as follows where a is the longitudinal acceleration of the vehicle, m/s 2 ; m is the mass of the whole vehicle, kg.
The main parameters and performance indicators of the whole vehicle are shown in Table 1.

TCU model
The TCU model is mainly for gear decision making and is divided into dynamic decision making and economic decision making.
Dynamic parameter calculation. Motor speed under each gear is as follow where v is the current speed of the vehicle, km/h; g is the gear number of different gears. Motor rated speed is as follow where P max is the peak power of the motor, kW; T max is the constant torque maximum of the external characteristics of the motor, NÁm.
Motor torque under each gear is as follow Dynamic shift decision. The driving torque at the wheel end of each gear is as follow The purpose of the dynamic shift decision is to keep the maximum output torque of the vehicle at its best, so as to ensure the best dynamic performance of the vehicle. Figure 1 is a flowchart of the dynamic shift decision. After the dynamic shift decision, the power of vehicle can be guaranteed. Figure 2 is a dynamic shift diagram of the AMESim vehicle model. It can be seen from the figure that the first gear torque is larger at low speed and the second gear torque is larger at high speed. The dynamic shift strategy determines the gear that the transmission should currently hang, it indicates that the dynamic shift decision logic is correct. At the same time, the dynamic shift strategy ensures that the shift schedule is matched with the parameters of the powertrain in real time.
Economic shift decision. The purpose of the economic shift decision is to optimize the operating efficiency of the motor to ensure the best economic performance of the vehicle. Figure 3 is a flowchart of economic shift decision-making, which can ensure the economics of the whole vehicle through economical gear decision. Figure 4 shows the economic shift diagram of the AMESim vehicle model. It can be seen from the figure that the efficiency of the motor in the first gear and the efficiency of the motor in the second gear are constantly changing with the operation of the motor. The economic shift decision can be judged according to the operating efficiency of the motor under each gear to ensure that the motor operating efficiency is in the best state, indicating that the economic gear decision logic is correct. a in the flowchart is to avoid cyclic shifting. At the same time, the economic shift strategy ensures that the shift schedule is matched with the parameters of the powertrain in real time.

VCU model
Because the model in this article is only for the vehicle transmission system, the execution logic of VCU model in this article only includes the torque command and brake force distribution command of driving motor generated according to the current vehicle power demand, so as to ensure the smooth operation of the vehicle.
The speed of motor is as follow where i g is the gear ratio of the current gear. Drive torque command is as follow where T max n ð Þ is the maximum motor torque corresponding to the motor speed at the current vehicle speed, NÁm.
Conventional Brake Command: When the vehicle is braking, the motor can recover the braking energy in generator mode and store the recovered energy in the battery. This model adopts the series brake recovery strategy.  Motor braking torque is as follow Total braking torque is as follow where CB max is the maximum torque value of the conventional brake, NÁm. Brake torque request is as follow Wheel brake torque command is as follow Battery model where U pp is the battery positive voltage, V; U np is the battery negative voltage, V, take 0 V here. Battery current is as follow where I d is the battery current when the motor is in drive mode, A; I b is the battery current in the motor brake mode, A. Drive energy consumption is as follow where I bat = I d , A; W d , kWÁh. Brake recovery energy is as follow where The total energy consumption at the battery end is as follow where W, kWÁh.

Driving motor model
The driving motor model in this article is a simplified motor or generator model. The output torque and power loss can be determined by data files or characteristic parameters. When the motor is in drive mode, the mechanical power of the motor is as follow When the motor is in generation mode, the mechanical power of the motor is as follow When the motor is in drive mode, the loss power of the motor is as follow where F is an interpolation function, and the loss power of the current motor, kW, is obtained by interpolating the experimentally measured motor loss power data. When the motor is in drive mode, the input power of the motor is as follow When the motor is in drive mode, the efficiency of the motor is as follow h is also considered to be the efficiency of the motor in the generation mode because only the experimental data of the loss of power when the motor is driven are measured. Using the experimental data of the driving motor, the efficiency MAP diagram of the driving motor is obtained by MATLAB interpolation calculation, as shown in Figure 5.
When the vehicle is driving, the motor input current is as follow When the vehicle is braking, the motor input current is as follow The main operating characteristic parameters of the drive motor are rated power, peak power, peak torque, and maximum speed. The peak torque and maximum speed of the drive motor in this article are optimized parameters, so they are not given here. Only the rated power and peak power are given. The rated power is determined by the highest designed vehicle speed, and the peak power is determined by the designed upper limit of 100 km acceleration time. The specific parameters are listed in Table 2.

Transmission model
The transmission model in this article uses a simplified transmission model. Input shaft speed is as follow Input shaft torque is as follow where n is the motor output speed, r/min; T is the drive motor output torque, NÁm. Output shaft speed is as follow Output shaft torque is as follow

AMESim vehicle model
The whole vehicle model in this article uses the AMESim software to build a pure electric vehicle model as shown in Figure 6.

Optimization of powertrain parameters based on genetic algorithm
Optimization ideas using improved genetic algorithms In the article, when the dynamic assembly parameters are dynamically optimized, the economic and dynamic indicators calculated by the AMESim vehicle model are used as the fitness function. First, the genetic algorithm is used to select the driving motor parameters. Then, this parameter and genetic algorithm are used to optimize the gear ratio iteratively. Second, the motor parameters are iteratively optimized, and finally the optimal powertrain parameters are obtained. In order to avoid optimizing different gear ratios under the same drive motor parameters, the parameter storage link is added to ensure that the gear ratio optimized under the same drive motor parameters is optimal. The optimization process is shown in Figure 7.

Design variable
In the case where the vehicle parameters are determined, the powertrain parameters including the drive motor parameters (T max and n max ) and the transmission ratio parameters (i 1 and i 2 ) are parameters that affect the vehicle's dynamic and economy. Therefore, the optimization design variable of this article is as follow Objective function In this article, the dynamic optimization of the transmission system gear ratios will be based on the vehicle dynamic performance as the constraint conditions, and  Economic goal. The energy consumption of an electric vehicle running a single NEDC operating condition is an economic goal where W is the total energy consumption of the battery for an electric vehicle running a single NEDC condition, kWÁh.
Dynamic goal. Assuming that a pure electric vehicle performs an acceleration test on a horizontal road surface at 0-100 km/h, the acceleration time is as follow where F t is the driving force of the whole vehicle, N; d is the conversion coefficient of automobile rotating mass. This model aims to realize the economical and dynamic indicators of the vehicle at the same time. The model operation is controlled in two stages, as shown in Figure 8, the former stage is the NEDC working condition (the black dotted line encircles the area), and the latter stage is the vehicle full throttle acceleration phase (black solid line encircled area). In the previous stage, the energy consumption value of the NEDC working condition is taken as the economic performance, and in the latter stage, the acceleration time value of the vehicle is taken as the dynamic performance.
Conversion of multi-objective optimization problems. In this article, the weighting coefficients are introduced for the above two objective functions, and a new optimization objective function is constructed where l 1 , l 2 is a coefficient between 0 and 1; 1.6 is the lower limit of energy consumption for the single NEDC operating conditions; 12 is the upper limit of the car acceleration time. This can align the economic goals with the dynamic goals in the order of magnitude, which is conducive to the accuracy of the optimization results.

Constraint condition
In this article, the maximum speed, the maximum gradient, the maximum adhesion, and the driving resistance are the basic elements to establish the constraints.
Drive motor parameter constraint. The parameters of the drive motor in the article take the parameters commonly used in the market. The peak torque of the drive motor is taken as 150-200 NÁm. The peak speed of the drive motor is taken as 8000-12000 r/min.
Gear ratio constraint of transmission. In this article, the transmission ratio constraint is established with the maximum speed, maximum grade, maximum adhesion, and driving resistance as the dynamic conditions. Determination of the total gear ratio constraint of 1st gear. When a pure electric vehicle runs at a constant speed on the ramp of the maximum climbing angle in 1st gear, the driving force equation is as follow F t = mgf cos a + mg sin a + C D Au 2 where F t is the driving force that the vehicle needs when driving, N; T max is the maximum torque of the drive motor, NÁm; r is the radius of the wheel, m; m is the vehicle full load quality, kg. The maximum torque provided by the drive motor needs to be greater than the resistance torque after deceleration and torque increase of the transmission system. Substituting equation (35) into equation (36) can be obtained as follow The driving force of the driving wheel must not exceed the maximum adhesion requirement of the ground where F z is the normal reaction of the ground to the drive wheel, N, axle load distribution ratio is 55%; u is the road adhesion coefficient, take 0.8 here.
Determination of the total gear ratio constraint of 2nd gear. Generally, the driving motor speed corresponding to the highest speed is n, take n = 0.95n max here When the pure electric vehicle runs at the highest speed u max on a good straight road, the driving force equation is as follow At this time, the output torque of the driving motor should be greater than the resistance torque after decelerating and increasing the torque of the transmission system Optimized contrast and analysis The simulation optimization of powertrain parameters in this article is divided into three aspects: only consider the vehicle dynamics, that is, l 1 = 0, l 2 = 1, as shown in Figure 9; only consider the overall vehicle economy, that is, l 1 = 1, l 2 = 0, as shown in Figure 10; consider the economics and dynamic performance of the whole vehicle, that is, l 1 and l 2 take a certain ratio of coefficients at the same time, when l 1 = 0.9 and l 2 = 0.1, as shown in Figure 11, when l 1 = 0.8 and l 2 = 0.2, as shown in Figure 12. It can be seen from the figure that under different vehicle performance optimization indicators, the overall trend of the fitness function value is downward, which is consistent with the optimized design idea, indicating that the vehicle performance tends to be optimal. The final fitness function no longer changes, that is, the vehicle performance has reached the optimal value of this optimization. It can also be seen from the optimization diagram that the number of optimization iterations is 50, that is, the motor parameters (peak torque and peak speed) are iterated 50 times. The transmission parameters (first gear ratio and second gear ratio) are shown in the figure as the optimum values for the current motor parameters, which are also iterated 50 times. From the changes in the parameters and performance indicators of the iterative graph, it can be seen that 1. The change trend of the first gear ratio and the second gear ratio is basically the same, and the change trend of the peak speed of the motor is basically the same, while the change trend of the peak torque of the motor is contrary, which is consistent with the constraint conditions of the gear ratio. 2. The product of the first gear ratio and the peak torque of the motor, that is, the maximum output torque of the transmission has a great influence on the dynamic performance of the vehicle (100 km acceleration time). At the same time, it can be seen that the larger first gear ratio can effectively reduce the peak torque of the motor. 3. In the process of economic performance and comprehensive performance optimization, the change process of the fitness function is consistent with the change process of economic indicators, which is caused by the large proportion of economic indicators in the fitness function. 4. In the process of comprehensive performance optimization, it is not seen that the economic performance is opposite to the overall change trend of dynamic performance. And if only the gear ratio is optimized, the economic performance and dynamic performance trend are opposite. This shows that the overall optimization of the powertrain parameters can effectively weaken the sensitivity of the optimization parameters to the contradiction between the economic performance and dynamic performance of the vehicle. Table 3 lists the comparison of the optimization results of the optimization methods provided in this article. It can be seen from the table that both the dynamic index and the economic index are optimal in the optimization process of dynamic performance and economic performance, but the relative indicators are poor. In the comprehensive performance optimization, when the economic weighting coefficient l 1 and the dynamic weighting coefficient l 2 are 0.8 and 0.2, respectively, the economic performance and dynamic performance of the vehicle are better optimized. When the economic and dynamic weighting coefficients are 0.9 and 0.1, respectively, the results of optimization are similar to those of economic performance optimization, which shows that the appropriate economic and dynamic weighting coefficients will have a greater impact on vehicle performance optimization. At the same time, it can be seen from the table that the bigger the dynamic weighting coefficient is, the larger the  maximum torque outputted in each gear of the transmission, and the proper increase of the dynamic weighting coefficient can greatly increase the vehicle dynamic performance, while the economic decline is small. Table 4 shows the comparison of the optimization results of the general method, that is, the optimization of the motor parameters is not considered but only the gear ratio parameters. Here, the peak torque of the motor is 170 NÁm, the peak speed is 9000 r/min, and other vehicle parameters are unchanged. The genetic algorithm is used to optimize the gear ratio. Compared with the optimization results in Tables 3 and 4, it can be seen that under the same weighting coefficient, the results of the optimization method provided in this article are better than the optimization results of this method. Figure 13 is the operating efficiency diagram of the operating conditions under different powertrain Figure 11. Comprehensive performance optimization of power assembly parameters (l 1 = 0.9, l 2 = 0.1). optimization parameters. Figure 13(a) is the operating point efficiency diagram of the powertrain dynamic parameters (l 1 = 0, l 2 = 1); Figure 13(b) is the operating point efficiency diagram of the powertrain economic parameters (l 1 = 1, l 2 = 0); Figure 13(c) is the operating point efficiency graph under the powertrain comprehensive performance (l 1 = 0.9, l 2 = 0.1) parameters; Figure 13(d) is the operating point efficiency graph under the powertrain comprehensive performance (l 1 = 0.8, l 2 = 0.2) parameters. It can be seen from Figure 13 that the greater the economic performance weighting coefficient, the greater the proportion of the motor operating point in the high efficiency zone, the better the economic performance of the corresponding vehicle, which affects the motor operating point during the braking energy recovery process obviously. It can be seen that the greater the economic performance weighting coefficient, the more advantageous it is for the motor to operate in the high efficiency zone during braking. So it is very necessary to consider the braking energy recovery when optimizing the electric vehicle powertrain parameters.

Conclusion
By optimizing the powertrain of electric vehicle from three aspects of power performance, economic performance, and comprehensive performance, the economic performance and dynamic performance of the whole vehicle meet the design requirements. After optimizing the comprehensive performance, the economic performance and dynamic performance of the whole vehicle are well balanced, and the synchronous improvement of the economic performance and dynamic performance of the whole vehicle is realized.
Through optimization of the powertrain parameters and analysis of the results, it can be seen that the weighting of economic performance and dynamic performance in the fitness function has an important impact on the balance of economic and dynamic contradictions; optimizing the powertrain parameters can effectively reduce the sensitivity of the optimization parameters to the contradiction between the economic performance and the dynamic performance of the vehicle; it is necessary to consider the braking energy recovery in the optimization process, which contributes a lot to the economic performance index. The comparison between Tables 3 and 4 shows that the optimization method provided in this article is better than the general optimization method.
Therefore, it is necessary to consider the optimization of powertrain parameters when optimizing the economic performance and dynamic performance of electric vehicles. The powertrain parameters can be fully utilized to achieve the global optimization of performance indicators.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by a National Key Research and Development Program of China (2017YFB0103700).