# A Novel Optimal Control Strategy of Four Drive Motors for an Electric Vehicle
## 2 Simulation Platform and Optimal Energy Management
### Optimal Energy Management of the Front and Rear Axle Motors  
Due to the optimal energy distribution design of the four-wheel-side motors, during turning or straight-line driving, there is an uneven torque distribution among the four  
Figure 8: The software development workflow for four-wheel-side motors.  
Figure 7: The schematic configuration of the nested loop for four-wheel-side motors.  
wheels. Through analysis using the CarSim vehicle dynamics software(R) (2021, CarSim, Santa Clara County, CA, USA), a phenomenon of the vehicle \"swaying\" or \"yawing\" was observed [31; 32]. Therefore, an optimal energy distribution design for the front and rear axle motors was established to improve this, as shown in Figure 9. A grid search based on the mechanical efficiency matrix of motor torque and speed ensures that the four-wheel-side motors can maintain the demanded power of the vehicle and operate all motors within their optimal efficiency ranges, achieving energy-saving effects. However, the optimal energy distribution design for the four-wheel-side motors can cause the vehicle to deviate from its ideal trajectory due to uneven torque distribution among the wheels during driving. Therefore, in subsequent designs, the optimal energy distribution design for the front and rear axle motors is used to address this issue. For definitions of related parameters, please refer to the description of the optimal energy distribution design for the front and rear axle motors. The revised formulas for various power distribution ratios are shown in  
\[T_{m,FL}=T_{m,FR}=\frac{\alpha\times T_{d}}{2} \tag{26}\]  
\[T_{m,RL}=T_{m,RR}=\frac{(1-\alpha)\times T_{d}}{2} \tag{27}\]  
\[T_{m,FL}+T_{m,FR}+T_{m,RL}+T_{m,RR}=\frac{\alpha\times T_{d}}{2}+\frac{\alpha \times T_{d}}{2}+\frac{(1-\alpha)\times T_{d}}{2}+\frac{(1-\alpha)\times T_{d} }{2} \tag{28}\]  
\[T_{d}=T_{m,FL}+T_{m,FR}+T_{m,RL}+T_{m,RR} \tag{29}\]  
Under the same motor equivalent fuel consumption minimization strategy, the \(J\) function determines the optimal motor equivalent energy consumption. The optimal energy distribution loop is shown in Figure 10. Discretized variables include the demanded power, motor speed, and power distribution ratio of the front and rear axle motors (\(\alpha\)). These are used to conduct a global search, calculating the total electrical energy consumption or equivalent fuel consumption of the front and rear axle motors under different variables. The optimal distribution can be derived in a two-dimensional table formula as follows:  
\[J^{*}(a,b)=min[J(a,b,c)] \tag{30}\]  
Figure 9: CarSim software analysis of the four-wheel-side motors for the electric vehicle.  
After the optimization calculations, a two-dimensional parameter table is constructed and integrated into the control mode. This optimization is conducted using a multi-dimensional table approach to observe the overall vehicle output benefits. The development workflow is shown in Figure 11. Since the optimal control is integrated using a look-up table with four-dimensional parameters, it significantly reduces the real-time computation resources and meets the real-time computation requirements of embedded systems.