Can PID Make the Electronic Stability Program More Effective? Research on Co-simulation of Electronic Stability Program Zheng Wu1, Xinshang Zhang1, Cunfeng Kang1*, and Guanchen Zong1 1 Faculty of Materials and Manufacturing, Beijing University of Technology, Beijing, China * Corresponding author: kangcunfeng@bjut.edu.cn Abstract In today's environment where vehicle are gradually spreading to every household, it is extremely important to make vehicle more stable and safe. As an important part of the automotive active safety system, the electronic stability system (ESP) plays an extremely important role in the safety and stability of vehicle. It is also a very important question to choose which method to control more effectively and simply. In order to explore the feasibility of PID control in the vehicle lateral stability algorithm, a joint simulation research of the vehicle model based on Carsim and Simulink was carried out. We first use CarSim to generate a car simulation model and import it into Simulink, then import the two-degree-of-freedom dynamic model of the car into the co-simulation model, and then integrate the PID control algorithm into the co-simulation model. After those procedures we do the co-simulation experiments at speeds of 40km/h and 80km/h. Finally, we confirmed the feasibility of PID control in the vehicle lateral stability algorithm and obtained a strong proof of its control effect. Keywords Control Algorithms, Dynamics Simulation, Electronic Stability System, Carsim, Simulink 1. Introduction With the development of the vehicle industry, the increasing popularity of vehicle and the increasing awareness of people's safety, consumers are increasingly demanding the safety of vehicle, and paying more attention to the active safety systems of vehicle. Electronic stability system (ESP) is an important part of the active safety system of vehicle. It is an important milestone in the field of vehicle safety protection to control the lateral stability of the vehicle. It is of great significance to develop a cheap and multifunctional ESP system to reduce the incidence of traffic accidents in China. Functionally, the ESP system inherits and extends the anti-lock braking system (ABS). Structurally, ESP is based on the hardware of the ABS system. The complex stability control algorithm has been upgraded. The ESP system can judge the state of the vehicle in a very short period of time, formulate a correction strategy, and send action commands, which can realize the lateral stability control of the body in emergency situations. After studying various vehicle electronic stability control algorithms and simulation verification methods, it is determined that the accuracy of vehicle mathematical model and the effectiveness of vehicle lateral stability control system should be verified by comparative basic control algorithms, and then the research idea of vehicle lateral stability control algorithm should be further expanded and improved. In this paper, Simulink and the special simulation software Carsim will be used for joint simulation. This method refers to a joint simulation method based on Simulink and CarSim software proposed by Sun Yuedong, Guo Sen and Zhou Ping [1]. The co-simulation method can provide intuitive data for handling stability, braking, smoothness, power and economy of the vehicle, and this method will also be used in this paper. This paper will be divided into four parts. The second part will introduce the simulation method and obtain the simulation data. In the third part, the data is analyzed, and the feasibility of the control algorithm is obtained. Finally, Section four will conclude, presenting the limitations of the conclusions drawn from the study and future directions. Copyright Β© 2022 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). 2. Literature review 2.1. Research on Simulation Technology Simulation technology is a simulation model technology that reflects the behavior or process of the system by using simulation hardware and software, through simulation experiments and with the help of certain numerical calculations and problem solving. With the development of the times, the things represented by the simulation hardware and software are constantly changing. At first, people use mathematical formulas to model and obtain data through calculation. This is mathematical reasoning, which is the most basic simulation method. With the development of science and technology, in the 1940s and 1950s, digital simulation was adopted by using digital-analog mixed simulation and computers and other electronic components to carry out simulation calculation. In the 1960s and 1970s, there appeared a programming language specially designed for simulation [2]. In the 1980s and 1990s, due to Moore's Law, the performance of computers was constantly updated. Since MATLABworks launched Simulink, the traditional method was abandoned, and everyone chose to use Simulink for dynamic simulation. For the field of automotive, there are two ways to use Simulink to simulate. There are two commonly used methods of simulation. The first method is to simulate the control model and the vehicle dynamics model with Simulink. The second is to use Simulink to co-simulate with dedicated simulation software. For the first method, B. D. Mahajan, A. Divekar, et al. proposed the use of Simulink to simulate the quarter suspension of the car [3] and achieved good results. As for the second method, X. He, H. Cheng, Z. Liu, et al. proposed the research on the co-simulation of automotive anti-lock braking system based on Carsim and Simulink [4].The dual-motor decentralized drive wheeled electric vehicle simulation based on ADVIAOR software and Simulink proposed by Wang Liangmo, and Bai Weijun [5] shows the unique advantages of this method. 2.2. Research on vehicle lateral stability control algorithm The vehicle lateral stability control algorithm is the key to stabilize the vehicle body and avoid accidents in the critical moments of the vehicle electronic stability system. When the ESP system judges the unstable tendency of the vehicle through the vehicle mathematical model, it will call the vehicle lateral stability control algorithm to judge the vehicle state in a very short time, formulate the correction strategy and issue the action instruction according to the driver's input and the feedback of various sensor. In 2010, Yuan Chaochun, Chen Long et al. proposed and verified the ESP control method based on Mu control theory [6]. In the same year, Li-qiang Jin, Chuan-xue Song et al. proposed a controll algorithm of combination with logic gate[7]. In 2011, Chih-Hsien Yu, Chyuan-Yaw Tseng et al. proposed a vehicle electronic stability control method based on slip ratio and yaw angle [8]. In 2019, Chao Li, Chengkun He et al. proposed yaw stability control based on a novel electronic hydraulic braking system [9]. It can be seen that many control methods can be applied to the vehicle stability algorithm. By comparing the above control algorithms, the PID control algorithm is an effective method for continuous system dynamic correction. This algorithm is convenient to implement and effective in control, and it is more suitable as the lateral stability control algorithm of vehicle. 3. The establishment of simulation model 3.1. Selection of vehicle simulation methods under pure software conditions In various automotive-related research topics, there are two mainstream simulation methods for simulation experiments under pure software conditions: the first is that both the controller model and the vehicle dynamics model are simulated using Simulink, which has the advantage of speed. In the first method, all the factors are easy to control, but the simulation accuracy is influenced by the model accuracy, which is not intuitive. For example, D. Mahajan, A. Diver and others put forward the simulation of vehicle quarter suspension by Simulink [3]. The second is to use Simulink and special simulation software for co-simulation. The advantage is that the simulation results are more accurate, intuitive and convenient, but the speed is slow and the configuration is complicated, which requires a certain understanding of the corresponding simulation software, such as Research on the co-simulation of anti-lock braking system based on Carsim and Simulink proposed by X. He, H. Cheng, Z. Liu, et al. [4]. Because the purpose of this simulation experiment is to verify the availability of the vehicle two-degree- of-freedom prediction model and the effectiveness of the vehicle electronic stability control algorithm, the process needs to be intuitive, and the interference factors can be decreased. Comprehensive consideration, the method of co-simulation using Simulink and special simulation software is more suitable. After referring to relevant information and considering the needs of this experiment, the second method is adopted to complete the simulation test with CarSim platform. 3.2. PID model construction and parameter configuration PID stands for proportional, integral, and differential. The PID control algorithm, as its name suggests, is a type of control method that incorporates proportional, integral, and differential linkages. In continuous systems, it is the most developed and commonly used control algorithm. The essence of PID control is to operate based on the input's deviation value and the functional relationships of proportion, integration, and differentiation, with the output being controlled based on the operation outcomes. According to the PID control principle, the Simulink simulation model of the PID controller is established, as shown in Figure 1: Figure 1: PID controller simulation model In the model, π‘Ÿ(𝑑),as a control signal, is the nominal value of the vehicle yaw rate generated by the vehicle dynamics prediction model. 𝑦(𝑑),as a feedback signal, is the actual value of the yaw rate generated by the vehicle dynamics simulation model. 𝑒(𝑑)is the input value of the PID control module. 𝑒(𝑑), as an adjustment signal, is the output value of the PID control module, which is responsible for adjusting the relevant variables of the vehicle simulation model.𝐾𝑝 , 𝐾𝑖 ,𝐾𝑑 is the control parameter of the PID algorithm, and the effect of the PID controller depends on the correct adjustment of its parameters. Because the adjustment of PID parameters is complicated and cumbersome, and closely related to the controlled system, the adjustment process is omitted here, and the effectiveness of the PID control algorithm is verified only by qualitative experiments. 3.3. Construction and parameter configuration of vehicle dynamics simulation platform In order to make the simulation results coincide with the real situation, it is necessary to configure CarSim platform according to the parameters of the simulation vehicle. The vehicle dynamics simulation model established by Carsim software covers vehicle body parameters, system parameters, animator data parameters and tire parameter configuration. Vehicle body parameters, system parameters and animator data parameters both use the C-Class, Hatchback model and tire parameter configuration is shown in Table 1. Table 1 Parameter configuration of tire Front tire Rear tire Suspension type Independent Suspension type Independent C-Class, Hatchback-Front Rear Kinematics: C-Class, Hatchback-Rear Independent Suspension Independent Suspension Front compliance: C-Class, Hatchback-Front Rear compliance: C-Class, Hatchback-Rear Independent Comp Independent Comp Right-front Tire: tire 205/55 R16 Right-rear Tire: tire 205/55 R16 Left-front Tire: tire 205/55 R16 Left-rear Tire: tire 205/55 R16 3.4. Established Carsim and Simulink co-simulation model After completing the vehicle parameter configuration of the CarSim simulation platform, it is necessary to import the car simulation model generated by CarSim into Simulink, and then import the previously established two-degree-of-freedom dynamic model of the car into the co-simulation model, and then integrate the PID control algorithm into the joint simulation model. First, a simulation model associated with CarSim in real time is established in Simulink, as shown in Figure 2. Figure 2: Co-simulation model Next, open the Electronic Stability Controller module, add the established 2-DOF dynamic model, as shown in Figure 3 Figure 3: The model that added 2-DOF dynamic model Then add the PID control module and adapt it with the output signal 𝑒(𝑑), and the co-simulation model is completed. 4. Discussion 4.1. Test method of Electronic Stability System The sine-with-dwell test is the first method. The steering angle input that mimics a sine waveform in the test is referred to as "sinusoidal." The term "dwell" refers to the steering wheel maintaining its negative angle limit for 500 milliseconds. The vehicle speed is 802 km/h during the test, the steering wheel angle begins at 1.5A (A value is the steering wheel angle equal to the lateral acceleration of 0.3g), and the amplitude of the steering wheel angle is gradually increased by 0.5A for several tests until it reaches 6.5A. The second method is the double lane-change test. The double lane change test is also known as the snow and ice road test or the elk test. The double lane-change test should be carried out on a uniform and flat compacted snow road or a road surface with a similar peak braking force coefficient. There should be no obvious change in the peak braking force coefficient of pavement before and after the test. The test site should be wide enough to ensure the safety of the test. The measured distance is from the beginning of stage 1 of the lane to the end of stage 5. When entering the first stage, the suggested speed is 80Β±3 km/h, which can be higher or lower, and recorded in the test report. During the test, no traffic cone was encountered as a smooth passage. Throughout the test, the accelerator position should be kept as stable as possible. Other control methods (such as specific steering control, etc.) can also be used. The test report should record the vehicle speed when driving out of the fifth segment. The sine-with dwell test and the double line shift test have scientific design and rigorous processes, and their effectiveness has been confirmed in practice tests in many countries. However, it can be found from the test process that both the sine-with dwell test and the double line shift test are very dependent on external factors. The sine-with dwell test needs to measure the value of the reference "A" of the corner increment through the slow-increment steering test on site, and then determine the input variable in the formal test according to its value. In the double line shift test, it is more dependent on the driver's response and skill, and cannot be quantified. Therefore, according to the characteristics of computer simulation environment, the test method of vehicle lateral stability system is improved by combining the steering wheel input method of sinusoidal hysteresis test and the evaluation standard of double-line shift test. The improved test process is as follows: The steering wheel angle input is a fixed input that changes with time, and its input curve is shown in Figure 4. Experiments were carried out under the normal road friction coefficient of 1.0 and a low-adhesion road friction coefficient of 0.5. Figure 4: Steering wheel angle input The initial speed measurement was used as the variable in the test, and the vehicle speeds were set to 40 km/h and 80 km/h, respectively. During the test, there was no throttle or brake motion. Test the simulated condition of the car without the intervention of the vehicle lateral stability control and with the involvement of the vehicle lateral stability control at each speed level, and record the vehicle's yaw rate curve. The yaw rate curves of each group are compared, and the impact of the vehicle's lateral stability control program on vehicle body motion under normal and low adhesion road conditions is investigated. 4.2. Simulation results Under normal road conditions, when the initial speed is 40km/h, the yaw rate change curve of the vehicle is shown in Figure 5. The vehicle runs smoothly and turns normally. The actual value of the yaw rate is very close to the nominal value, and the vehicle lateral stability control system is not triggered. a) Without lateral stability control b) With lateral stability control Figure 5: Yaw rate curve at initial speed of 40km / h Under normal road conditions, when the initial speed is 80km/h, the yaw rate change curve of the vehicle is shown in Figure 6. Without lateral stability control, the vehicle will be unstable. After the lateral stability control system is involved, the vehicle instability is suppressed, but the yaw rate curve has some fluctuations, which can be basically ignored a) Without lateral stability control b) With lateral stability control Figure 6: Yaw rate curve at initial speed of 80km / h In the state of low adhesion road surface, when the initial speed is 40km/h, the yaw rate change curve of the car is shown in Figure 7. Without lateral stability control, the car runs stably but slightly shakes. After the intervention of lateral stability control system, the car body is more stable. a) Without lateral stability control b) With lateral stability control Figure 7: Yaw rate curve at initial speed of 40km / h Under the condition of low-adhesion road surface, when the initial speed is 80km/h, the yaw rate change curve of the vehicle is shown in Figure 8. When there is no lateral stability control, the yaw rate value is greatly reduced, and the vehicle has a serious understeering situation. After the intervention of the lateral stability control system, the vehicle recovered the steering force to a certain extent, but the yaw rate fluctuated greatly, causing serious lateral shaking of the vehicle. a) Without lateral stability control b) With lateral stability control Figure 8: Yaw rate curve at initial speed of 80km / h 4.3. Data Analysis Through the above experiments, the validity of the 2-DOF dynamic model and the PID stability control model is proved, and the important role of the vehicle lateral stability control system in stabilizing the body attitude is also proved, which can effectively prevent the vehicle from understeering and oversteer situation. However, from the simulation results of different vehicle speeds, it can be seen that although the lateral stability control system can greatly reduce the instability of the vehicle, it can not completely prevent the vehicle from losing control at high vehicle speed. 5. Summary In today's environment where vehicle safety has gradually become a hot spot, we mainly discussed the feasibility of the application of PID control in the vehicle lateral stability algorithm. We verified this problem based on the co-simulation of Carsim and Simulink. A vehicle dynamics simulation platform is built, and the effectiveness of the PID lateral stability control algorithm is verified through the co-simulation of CarSim and Simulink, and the role of the vehicle electronic stability system in vehicle lateral stability control is also verified. Finally, two testing methods of automotive electronic stability systems provide a reliable basis for the data results. This paper's main contribution is based on two factors. First, a PID stability control model is developed, and the model's suitability for a vehicle lateral stability algorithm is demonstrated. It teaches others how to control the vehicle's lateral stability. At the same time, it has been shown that the vehicle's lateral stability control system plays a vital role in maintaining the vehicle's posture and can effectively avoid understeering and oversteering. The vehicle's lateral stability control system is proven to be reliable. The limitations of this paper mainly exist in the following two aspects. First, it can be seen from the simulation results of different vehicle speeds that although the lateral stability control system can greatly reduce the occurrence of vehicle instability, it cannot completely avoid vehicle loss of control when the vehicle speed is high. Secondly, the construction of the vehicle model may also produce some inaccuracies under different conditions, which still need to be improved. According to our research, future research directions can be launched from the following aspects. First of all, we have perfected the conditions and laid the foundation for the improvement of the lateral stability control algorithm of the automotive electronic stability system. On this basis, the algorithm can be optimized and improved continuously. Secondly, the model can continue to be optimized on the limitations of certain conditions, so that the model can adapt to more conditions. 6. References [1] Sun Yuedong, Guo Sen, Zhou Ping. Research on the joint simulation of CarSim and Simulink in ESP system [J]. Mechanical Design and Manufacturing, 2018(03):16-18+22. [2] Gu Yinfang, Yuan Shihua, Wei Li, et al. Development and prospect of simulation technology [J]. Hebei Industrial Science and Technology, 2000,17 (5): 36-39. DOI: 10.3969/J. ISSN.1008- 1534.2000.05.00 [3] B. D. Mahajan and A. A. Divekar, "Modeling and system identification of a quarter car suspension using Simulink," 2016 IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT), 2016, pp. 180-183, doi: 10.1109/RTEICT.2016.7807808. [4] X. He, H. Cheng, Z. Liu, J. Yang and D. Ma, "Research on Co-simulation of Anti-lock Brake System Based on Carsim and Simulink," 2021 IEEE 5th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), 2021, pp. 808-812, doi: 10.1109/ITNEC52019.2021.9586820. [5] Wang Liangmo, Bai Weijun. Simulation of dual-motor decentralized driving wheeled electric vehicle [J]. Journal of Agricultural Machinery, 2007,38 (1): 193-194. DOI: 10.3969/J. ISSN.1000- 1298.2007.01.049. [6] C. Yuan, L. Chen, S. Wang and H. Jiang, "Research of electronic stability program based on the Mu control theory," 2010 International Conference on Computer and Communication Technologies in Agriculture Engineering, Chengdu, 2010, pp. 379-3 [7] L. Jin, C. Song and J. Li, "Controll algorithm of combination with logic gate and PID control for vehicle electronic stability control," 2010 2nd International Conference on Advanced Computer Control, Shenyang, 2010, pp. [8] Chih-Hsien Yu, Chyuan-Yaw Tseng and Yuan-Sheng Hsu, "Electronic stability control for direct- drive Electric Vehicle," 2011 International Conference on Electric Information and Control Engineering, Wuhan, 2011, pp. 4987-4991. [9] C. Li, C. He, Y. Yuan and J. Zhang, "Yaw Stability Control Based on a Novel Electronic Hydraulic Braking System," 2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC), Chongqing, China, 2019, pp. 1395-1399.