**5. Conclusions**

In this paper, the trajectory tracking control module of an x-by-wire electric vehicle is designed. A trajectory tracking control algorithm based on a hierarchical control architecture is designed to perform effective trajectory tracking control for an x-by-wire electric vehicle, which facilitates the subsequent further development of each layer. The control algorithm includes the trajectory tracking layer, tire force distribution layer, and actuator control layer. The trajectory tracking layer uses longitudinal force, lateral force, and yaw moment as control variables and designs an MPC algorithm to control the vehicle to follow the desired trajectory. The tire force distribution layer distributes the desired resultant force/moment to each vehicle tire. In this paper, the tire force distribution problem is transformed into a quadratic programming problem with constraints to solve such that the longitudinal force and lateral force of each tire in the vehicle coordinate system are obtained. The actuator control layer can obtain the longitudinal force and lateral force in the tire coordinate system through coordinate system transformation in order to obtain the vehicle turning angle and vehicle driving/braking torque control amount. Through the arctangent function tire model, the expected tire slip angle is obtained, and then the vehicle steer angle and driving torque are obtained. In order to verify the effectiveness of the algorithm, the effectiveness of the proposed control algorithm is verified based on simulation experiments.

**Author Contributions:** Conceptualization, Z.W. and H.Z.; methodology, Z.W.; software, H.Z.; validation, Y.L., C.K., and H.Z.; formal analysis, Z.W.; investigation, H.Z.; data curation, C.K.; writing—original draft preparation, Z.W., Y.L., and H.Z.; writing—review and editing, Z.W. and H.Z.; visualization, Z.W. and H.Z.; supervision, H.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the National Key Research and Development Program of China under Grant, gran<sup>t</sup> number 2021YFB2500703.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** Chuyo Kaku is an employee of Jiangsu Chaoli Electric Co., Ltd., Danyang 212321, China. The paper reflects the views of the scientists and not the company. Dr Kaku is a part-time professor in our research group; however, his formal affiliation is a company.
