Cruise Control System Based on Joint Simulation of CarSim and Simulink

Show more

1. Introduction

Formula Student Electric China was developed on the basis of the Formula Student China. It needs to design a pure electric racing car to complete the competition items. One of the competition items is the 8-word route, which requires the car to steer continuously around two rings. This not only tests the operational stability of the car, but also requires the driver to have a better control over the speed and steering of the car. When doing this competition item, the driver often turns the car into an unstable state because he can’t balance the control of the steering wheel and the throttle. The cruise control system, also known as the constant speed driving system, enables the vehicle to automatically change the throttle opening during the system activation and keep running at a stable speed to reduce the driver’s driving load [1] . Therefore, in order to assist the driver in controlling the steering of the car and the driver only needs to control the steering wheel when steering without paying too much attention to the speed and the throttle control, the cruise control system must be applied to the car. The cruise control system has strong nonlinearity and uncertainty. The Conventional PID control cannot meet the actual cruise control requirements [2] . In order to improve the precision and stability of cruise control, and apply the cruise control system to the continuous steering of the racing car, the FSEC car model is built by CarSim, the fuzzy PID controller is set up in Simulink, and the effectiveness of the combined simulation and analysis method based on CarSim and Simulink is proved.

2. Fuzzy PID Control System

2.1. Conventional PID Control

PID control is an algorithm of proportional-integral-derivative control. According to the deviation between the actual vehicle speed and the set vehicle speed, the vehicle cruise control with constant parameters of the system is realized. During driving of the vehicle, the driver sets a certain vehicle speed value to the controller, and when the vehicle speed sensor also inputs the actual vehicle speed value to the controller, the deviation between the set vehicle speed value and the actual vehicle speed value is obtained. The proportional control of the controller outputs a corresponding control amount according to the magnitude of the deviation of the vehicle speed to control the rotation speed of the motor so that the traveling speed approaches the set vehicle speed value. The integral control of the controller accumulates the vehicle speed deviation and reduces the vehicle speed deviation by increasing the control amount, so that the traveling vehicle speed can maintain a constant and stable working state. The differential control of the controller serves as an estimate. When the characteristics of the controlled object are complex, strongly nonlinear, or time-varying, the conventional PID control parameters will oscillate the control system when adjustment is not appropriate, and it is difficult to achieve effective control [3] .

2.2. Fuzzy Controller Design

The absolute value of the speed error of the cruise control system |E| and the absolute value of the speed error change rate |EC| are used as input variables of the fuzzy controller. The domain theory of two input variables is −3 to 3. The corresponding fuzzy subset is {NB, NM, NS, Z, PS, PM, PB}. The output variables are the proportional coefficient Kp, the integral coefficient Ki and the differential coefficient Kd. Their fuzzy subsets are {NB, NM, NS, Z, PS, PM, PB}.

Control rules are formulated from aspects of system stability, response speed, overshoot and steady state accuracy. When the vehicle speed error value is small, it is necessary to increase the proportional control function and reduce the integral control function. The system can have a certain error [4] . The fuzzy controller has two input variables, |E| and |EC|, and three output variables, Kp, Ki, and Kd, which summarize the fuzzy control rule table. Subordinate function and parameter adjustment rules are inputted into the fuzzy logic toolbox to obtain the PID parameter fuzzy matrix table [5] . When the control system is running, data processing is performed on the results of the fuzzy rules, and then the tuning of the PID parameters is completed.

Fuzzy PID control system design is as follows. The absolute value of velocity error |E| and the absolute value of velocity error change rate |EC| are added to the input end of the fuzzy controller. The fuzzification process turns it into a fuzzy input variable. The fuzzy output is derived according to the fuzzy inference rule, and the exact control quantity Kp, Ki and Kd are output through the process of ambiguity resolution. In the application of the actual PID controller, it is necessary to multiply the appropriate scaling factor Gp, Gi and Gd to get the true PID parameters Kp’, Ki’ and Kd’. The fuzzy PID control diagram of cruise control system is shown in Figure 1.

3. Cruise Control System Based on Matlab and Fuzzy PID

A PID controller is set up to adjust the PID control parameters in real-time in the fuzzy control process to improve and optimize the control effect. The actual vehicle speed and the set vehicle speed are taken as the input quantity, and the PID controller outputs the driving force. Run Matlab software to open the Fuzzy Logic Editor window. Add input and output variables in the fuzzy logic editor window and modify the respective names. Based on the defined input and output variables and their fuzzy subsets, the membership functions of each variable

Figure 1. The fuzzy PID control diagram of cruise control system.

are edited. The range of the input variable is [−3, 3], and the range of the output variable is [−3, 3]. Based on the summarized fuzzy control rule table, 49 control statements are listed, and control statements are entered into the rule editor. After editing the control rules, open the rules observer. When the input variable takes different values, the system determines the control amount of each output variable according to the center-of-gravity method. The control table of PID parameters is obtained, and the control surface of the output variable is shown in Figure 2. The control surface is nonlinear, which indicates that the fuzzy control itself is nonlinear, and the fuzzy control system which is established is stored in the working directory. The fuzzy controller is used to adjust the 3 parameters of PID control, and the fuzzy PID control system is established by combining fuzzy control and PID control effectively.

4. CarSim Vehicle Model Establishment and Simulation Environment Settings

After the text edit has been completed, the paper is ready for the template. Duplicate the template file by using the Save As command, and use the naming convention prescribed by your journal for the name of your paper. In this newly created file, highlight all of the contents and import your prepared text file. You are now ready to style your paper. In order to ensure the accuracy of the vehicle model, a virtual dynamic simulation software CarSim was used to establish a dynamic system model that can simulate the running status of the vehicle in real time and reflect the dynamic characteristics of the system. Based on the F3 model in the vehicle model database, the racing model was established based on the FSEC racing parameters, as shown in Table 1.

In the setting of the simulation environment, a road map for the 8-word route is established, as shown in Figure 3. Two circles with the radius are arranged in a figure eight. The distance between the two centers is 18.25 meters. The inner diameter is 15.25 meters and the outer diameter is 21.25 meters. The track is 3 meters wide.

5. Joint Simulation and Result Analysis

5.1. Joint Simulation Model

CarSim provides a joint simulation interface with Simulink and implements connection communication between the two through S function [6] . The dynamic model set in CarSim can be imported into Simulink to facilitate the design of the controller in Simulink for optimal simulation. The input and output of the module are set in the interface Import Channel and Output Channel of CarSim. Export represents the status of the vehicle output from the CarSim to the Simulink control module for status feedback. The Export channels in this article are the longitudinal speed of the vehicle. Import represents the input of the vehicle model, indicating that the vehicle state is controlled by the controller to obtain a suitable control quantity, which is input into the vehicle model and

Figure 2. PID parameters. (a) Kp; (b) Ki; (c) Kd.

Table 1. The main parameters of the vehicle model.

Figure 3. 8-word route.

Figure 4. The joint simulation model.

realizes a closed-loop control. The Import channels in this article are the opening of the throttle and the pressure of the master cylinder. The joint simulation model is shown in Figure 4.

5.2. Simulation Results

Set simulation mode in CarSim to Simulink joint simulation and run the model to get the speed curve of the car under fuzzy PID control; set the simulation mode again to run the model without fuzzy PID control mode to get the racing speed curve without fuzzy PID control. The results of the two simulations are shown in Figure 5.

Figure 5. Simulation results. (a) Model with fuzzy PID control; (b) Model without fuzzy PID control.

As can be seen from the figure, the speed of the racing car with fuzzy PID control is maintained stably at the set vehicle speed from the start, and the speed of the racing car not adopting the fuzzy PID control fluctuates up and down. At the same time, the racing car does not turn stably due to the fluctuation of the vehicle speed. The time of completing 8-word route with the fuzzy PID control vehicle is 23.875 s, while the time of the vehicle without fuzzy PID control is 25.425 s and the time shortens 1.55 s. It shows that the cruise control system using fuzzy PID control can effectively stabilize the speed and improve the continuous steering performance of the vehicle.

6. Conclusion

In this paper, CarSim and Simulink are used for joint simulation, and the cruise control system for racing car is tested. The simulation results show that when the cruise control system with fuzzy PID control is applied to the car, the steering speed of the vehicle can be kept in an exact value. Compared with the unused car, the time of the completion of the project is shortened and the driver’s driving load is reduced. This method laid a foundation for subsequent vehicle control design and parameters.

References

[1] Liu, W.B., Huang, W., Diao, J., et al. (2015) Design and Test of Automobile Cruise System Based on PID Control. Internal Com-bustion Engine & Powerplant, 4, 29-31+47.

[2] Chen, G. and Zhang, W.G. (2012) Speed Control of Vehicle Robot Driver Based on Adaptive Fuzzy PID Control. Automotive Engineering, 6, 511-516.

[3] Liu, H.P., Long, C.J., Wan, P., et al. (2015) Fuzzy Self-Adjusting Proportion Integration Differentiation for Eppo Quadrocopter. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 1, 71-77.

[4] Zhao, B., Dong, H. and Zhang, J. (2018) Simulation of Vehicle Driving Speed PID Control System Based on Simulink. Automobile Applied Technology, 2, 127-129.

[5] Chen, G.G., Huang, S.W., Liu, J.C., et al. (2016) Research on Fuzzy Variable Pitch Control System for Wind Turbines Based on Simulink. Research and Exploration in Laboratory, 4, 90-94.

[6] Wang, L.F., Lv, S.M. and Chen, R.Z. (2015) CarSim-Based Automotive Steer-By-Wire (SBW) System Steering Feeling Simulation and Performance Research. Forestry Machinery & Woodworking Equipment, 10, 20-24.