Stability Coordinated Control of Distributed Drive Electric Vehicle Based on Condition Switching

The distributed drive electric vehicle is a complex hybrid system including discrete events and continuous events. In order to coordinate the longitudinal and lateral motion of the distributed drive electric vehicle, a hierarchical control method was proposed. In the upper layer, the body attitude tracking controller based on sliding mode control algorithm was established to accurately analyze the driving expectation and to track the longitudinal speed, the lateral speed, and the yaw rate of the vehicle. In the lower layer, the switching controller based on the hybrid theory was established to improve the driving stability under various working conditions. The switching controller can switch between control strategies according to the working conditions. The joint simulation was carried out under various working conditions using Simulink and CarSim software. The results showed that the controller can coordinate the longitudinal and lateral motion of the vehicle well in linear acceleration and sinusoidal acceleration conditions and can strictly track the driving expectation and maintain the desired body posture. And another, the controller can be switched according to the working conditions and control strategies accurately and smoothly and can ensure stable driving in the constant speed single lane change condition. The controller can reveal the continuous behavior characteristics of the vehicle and reﬂect the characteristics of discrete events by coordinating the longitudinal and lateral motion of the vehicle. It improves the stability and control performance of the distributed drive electric vehicle under various working conditions.


Introduction
Since the 21st century, with the increasing environmental and energy problems, distributed drive electric vehicle as a new type of new energy vehicle has gradually entered the field of vision of researchers. e chassis layout of the distributed drive electric vehicle is novel. Four driving motors are installed in the wheel rim, respectively, and the transmission structure of the vehicle is cancelled, and the drive motor is controlled independently [1]. erefore, it has the characteristics of fast response speed and independent torque control and brings huge control potential for the vehicle. As a kind of vehicle chassis control technology, the longitudinal and transverse motion control technology plays an important role in improving the driving stability of vehicles. However, the research on the longitudinal and transverse motion control technology is mainly focused on the traditional internal combustion engine vehicles, and the control system is not perfect. e optimization algorithm of longitudinal and horizontal tire force is single, which cannot comprehensively consider the various working conditions faced by the vehicle in the process of driving. It is easy to cause the unreasonable distribution of the longitudinal and lateral forces of the vehicle and affect the driving attitude and handling stability of the vehicle. Some scholars use the average distribution of vehicle tire force to improve the stability of the vehicle, which does not fully consider the impact of vehicle steering and vehicle load transfer on tire force, so the vehicle stability cannot be fully improved. erefore, it is of great significance to study the longitudinal and lateral motion of the vehicle under multiple working conditions to control the vehicle's driving attitude and improve the lateral driving stability and economy.
In order to solve the above problems, this paper proposes a distributed drive electric vehicle stability controller based on multi driving conditions. e controller adopts a topdown hierarchical control architecture. e upper controller tracks the desired body posture based on the sliding mode control algorithm and calculates the longitudinal force, lateral force, and yaw moment required by the vehicle. e lower controller establishes the vehicle condition switching controller by analyzing the continuous state characteristics and discrete state characteristics of the vehicle system based on the hybrid theory and designs the control strategy for each working condition which scientifically and reasonably distributes the longitudinal and transverse forces of the vehicle, so as to ensure that the vehicle can keep stable running in all driving conditions and comprehensively improve the driving stability of the vehicle. Finally, a simulation platform is built based on Simulink and CarSim to verify the effectiveness of the stability controller for distributed drive electric vehicles under multiple working conditions.

Stability Coordination Controller
Based on a hierarchical control framework, a stability coordinated controller for multi driving conditions of a distributed drive electric vehicle is established. e specific structure is shown in Figure 1.
e stability coordination controller mainly includes the following parts: the upper vehicle reference model and body attitude tracking controller, the lower working condition switching controller, and the actuator controller. e controller receives the steering wheel angle signal and accelerator pedal signal from the driver and calculates the expected driving state of the vehicle through the reference model. e body attitude tracking controller tracks the expected driving state of the vehicle. e condition switching controller divides the driving condition of the vehicle into a straight driving condition and steering condition and optimizes the distribution of the force for the different driving conditions of the vehicle. At last, the actuator controller controls the vehicle drive/steering motor. Finally, the purpose of improving the driving stability of vehicles is achieved.

Reference Model.
e reference model is used to receive the driver's operation information (including steering wheel angle and accelerator pedal opening) and calculate the expected running state information of the vehicle (including the expected longitudinal speed, the expected lateral speed, and the expected yaw rate of the vehicle). At the same time, the reference model transmits the expected information to the vehicle body attitude tracking controller to provide the tracking target for the body motion controller.
In order to avoid coupling between the longitudinal system and transverse system, the longitudinal system and transverse system are designed separately in this paper.
Yaw rate is the key data to represent the driving state of the vehicle. erefore, it is necessary to obtain the relationship between steering wheel input and yaw rate of the vehicle. e paper establishes a linear two degrees-offreedom vehicle model as the reference model of the vehicle steering system to represent the relationship. e output results of the reference model are all the desired data.
e transfer matrix of vehicle linear two degree-offreedom steering model is as follows. (1) rough mathematical derivation, the desired yaw rate of the vehicle can be expressed as (2) Among them, After considering the yaw rate constraint, the desired yaw rate can be expressed as where µ is the ground friction coefficient and g is 9.8 m/s 2 . e reference model of the longitudinal system is mainly to obtain the expected longitudinal speed of the vehicle, which can be determined by the longitudinal acceleration in the time domain.
where k f and k r are the side deflection stiffness of front and rear wheels, respectively; δ f and δ r are the front and rear wheel angles; V x is the longitudinal speed of the vehicle; V y is the lateral velocity of the vehicle; _ φ is the yaw rate of the vehicle; m is the mass of the vehicle; l f is the distance from vehicle centroid to front axle; l r is the distance from vehicle centroid to rear axle; I z is the moment of inertia; and V x0 is the initial speed of the vehicle.

Body Attitude Tracking Controller.
e function of the body motion controller is to calculate the expected longitudinal total torque, expected total lateral moment, and expected yaw moment of the vehicle through the advanced control algorithm according to the information of the reference model. However, the vehicle system has complex nonlinear characteristics. e paper selects the sliding mode variable structure control algorithm to track the longitudinal speed, lateral speed, and yaw angle of the vehicle by comparing a variety of advanced control algorithms. e sliding mode control algorithm can make the tracking error converge to zero on the designed sliding mode surface and can track the expectation of the reference model output well. e sliding surface is designed as shown in the following equations: e design sliding mode variable structure control rate can be expressed as In order to suppress the chattering of the system, the linear saturation function is used as the sliding surface S 1 , S 2 , and S 3 .
e Lyapunov function is constructed to determine the stability of the system, as shown in the following equation: It can be seen from equation (12) that the controller satisfies the stability condition and is stable.
Finally, the total longitudinal force, total lateral force, and yaw moment required for vehicle attitude tracking are obtained.
Here, F x d and F y d represent the expected total longitudinal force and expected total lateral force. M z d is the desired yaw moment.

Condition Switching Controller.
Based on hybrid control theory, the main function of the controller is to determine and switch real-time driving conditions according to vehicle information and switch the corresponding control strategy to optimize the tire force distribution. e distributed drive electric vehicle is a hybrid system, which can switch the driving mode of the vehicle in real time according to the change of the discrete signal of the vehicle [2]. e driving condition of the vehicle is divided into two driving conditions: straight driving condition and steering condition, and appropriate control strategies are developed, respectively, as shown in Figure 2. e hybrid system is modeled by automata, as shown in the following equation: , and F yrr ; lint is the initial state of the system; ln v is the set of invariant state quantity of the system E is the set of discrete switching events: E 1 and E 2 ; and ψ specifies an allowable input field for each state. Here, F x , F y , and F z represent the longitudinal force, lateral force, and vertical load of the vehicle. At the same time,fl, frrl, and rr represent the left front, right front, left rear, and right rear wheels of the vehicle, respectively. a x and a y represent the longitudinal and lateral acceleration of the vehicle.
When the vehicle is in the straight driving condition, the vehicle adopts the tire force distribution method based on the vertical load of the tire; when the vehicle is in the steering condition, the vehicle adopts the tire force distribution method based on the minimum tire adhesion margin. e monitoring data are driver steering wheel angle δ, steering wheel angle velocity δ ω , and vehicle yaw angle acceleration _ φ. e monitoring data switching thresholds are set, respectively. When the monitoring data are lower than the system set thresholds, it is determined that the vehicle is in straight running condition; otherwise, it is determined that the vehicle is in steering condition.

Optimized Distribution of Tire Force.
e distributed drive electric vehicle has four drive motors and four steering motors. e degree of freedom required to control is far less than the number of controllable actuators. e system is highly redundant and overdrive system. erefore, the control strategy is designed by control distribution theory. e optimal distribution of tire force based on the control distribution theory can effectively improve the dynamic response of the vehicle.
Under the condition of straight driving, the longitudinal force has a great influence on the driving state of the vehicle.
And then, the vertical load of the tire will move between the front and rear axles. e driving force distribution method based on tire load can better meet the requirements of vehicle power and safety in the straight driving condition. e vertical load of tire is shown in the following equations: e total vertical load of the wheel can be expressed by the following equation: Finally, the driving force of each wheel can be shown in the following equation: where t f and t r are the front and rear track width and h is the height from the vehicle center of mass to the ground. At this driving condition, the tire lateral force is evenly distributed under the straight driving condition. When the vehicle is in the steering condition, the longitudinal force, lateral force, and yaw moment generated by the vehicle to maintain the body attitude will have an impact on the driving state of the vehicle. At this condition, the tire force distribution should focus on improving the stability of the vehicle. And the tire force distribution method based on  the tire load coefficient is adopted. e smaller the load factor of the vehicle tire, the greater the potential of the tire, the higher the stability of the vehicle.
where μ is the ground adhesion coefficient and F z is the vertical force of each tire. At steering condition, the distributed longitudinal force, lateral force, and yaw moment shall also meet the kinematic equation of the vehicle.
In addition, the longitudinal and lateral forces of the vehicle during driving should meet the constraints of the vertical forces of the tire. at is to say, the limit condition of the friction circle should be met.
At the same time, the driving force and lateral force of the vehicle also need to meet the maximum torque requirements of the motor.
where T max is the maximum output torque of the motor and r is the effective radius of the tire. In this paper, the interior point method of quadratic programming (SQP) is used to solve the problem with inequality constraints. Finally, the S-function in Simulink is used to write the objective function. And the optimization problem is solved iteratively to get the optimal distribution of tire force.

Actuator Controller.
e main function of the actuator controller is to convert the received optimal driving force and lateral force into the driving torque and steering angle of the actuator motor. Accurate control of vehicle actuators is the key to improve vehicle driving stability.
It can be seen from tire dynamics that the longitudinal force of tire can be realized by directly controlling the torque of the driving motor. According to the longitudinal force model of single wheel and the principle of moment balance, the driving moment of the driving motor can be calculated by using the following equation: (25) e tire lateral force cannot be directly transformed into the wheel angle of the steering motor. It needs to be solved indirectly by the inverse model of tire cornering. e tire model shown in equation (26) is used to realize the model [3]. e tire model can better represent the linear relationship between tire lateral force and tire cornering angle: G x and k are factors defined as According to the tire model, the angle between the tire running direction and the coordinate axis can be expressed by the following equation: e angle between the driving direction of the tire and the coordinate axis can be known from the side slip of the tire: At the same time, it can be seen from the vehicle dynamics model: Finally, it can be seen that the required wheel angle of the vehicle can be expressed by the following equation:

Simulation Verification
In order to prove the effectiveness of the stability coordinated controller designed, this paper establishes a joint simulation model of Simulink and CarSim and carries out simulation verification under the conditions of linear acceleration, sinusoidal acceleration condition, and uniform single lane change condition. e input of the coordination controller is the acceleration determined by the steering wheel angle and accelerator pedal opening of the vehicle. e simulation vehicle includes four driving motors and four Mathematical Problems in Engineering steering motors, and the specific parameters are shown in Table 1.

Linear Acceleration Condition.
e linear acceleration condition is mainly to verify the effectiveness of the vehicle coordination controller for driver driving expectation tracking.
In the condition of linear acceleration, the steering wheel angle input is always 0. e initial speed of vehicle is 36 km/ h, and the acceleration curve can be shown in Figure 3. e ground is flat. e coefficient of adhesion is 0.8. e acceleration is given to the vehicle in the 2 seconds when the vehicle is running, and the acceleration is increased to 1.5 m/ s^2 in one second and keep it for 5 seconds. At last, the vehicle acceleration is reduced to 0 in the sixth second. e specific simulation results are shown in Figures 4  and 5. Figure 4 shows the longitudinal speed chart of the vehicle. When the vehicle starts to accelerate in 1 s and stops to accelerate in 6 s, the vehicle speed accelerates from 36 km/h to 57.6 km/h. e vehicle speed curve is smooth, which tracks the expected speed of the vehicle well and meets the acceleration expectation of the driver. Figure 5 shows the actual acceleration curve of the vehicle. In the simulation process, the actual acceleration curve can better track the expected acceleration curve, and the vehicle response is fast and accurate, which fully meets the acceleration expectation of the driver. It can be seen from the simulation results of the linear acceleration condition that the actual driving speed of the vehicle can track the target speed quickly and accurately. At the same time, it can meet the acceleration needs of the driver in the linear condition, and the coordination controller can better track the driving expectation of the vehicle. erefore, the coordinated controller is effective.

Sinusoidal Acceleration Condition.
e sinusoidal acceleration condition is to verify the effectiveness of the vehicle stability coordination controller to improve the lateral stability under the steering condition. e steering wheel input and accelerator pedal input are shown in Figures 6 and 3. e initial speed of the vehicle was set as 36 km/ h. e ground is flat, and the coefficient of adhesion is 0.8. e simulation results are shown in Figures 7-9. Figure 7 shows the comparison between the actual yaw rate and the desired yaw rate of the vehicle. When the steering wheel angle and longitudinal speed increase continuously, the yaw rate of the vehicle will produce errors when tracking the desired yaw rate of the vehicle, but the errors are small where maximum error is less than 0.3 deg/s. It cannot have a big impact on the stability of the vehicle. In this condition, the controller can complete the tracking of the yaw rate as a whole and track the longitudinal direction of the vehicle better speed. It has a better impact to improve the stability of the vehicle. In the first four seconds of the simulation, the vehicle can track the longitudinal acceleration very well. However, the longitudinal acceleration of the vehicle will fluctuate due to the excessive change rate of the steering angle of the vehicle at four seconds and the sixth. erefore, it can quickly track the expected acceleration of the vehicle after the fluctuation. To sum-up, the vehicle coordination controller can better complete the driver's steering intention, track the vehicle's yaw acceleration and acceleration, and improve the vehicle's yaw stability and safety to a certain extent.

Uniform Single Lane Change Condition.
e uniform single lane change condition is mainly to verify the effectiveness of the hybrid controller in the process of vehicle driving. In this case, it is necessary to design a driver model to convert the model path input into the vehicle steering wheel input. e specific driver model is not described here. e steering wheel angle input is shown in Figure 10. e vehicle speed is set as 36 km/h. e ground is flat without slope, and the ground adhesion coefficient is 0.8.
As shown in Figure 11, the speed of the simulation vehicle is maintained at 35.999 km/h when driving straight, and the speed fluctuates slightly when turning. e maximum error is 0.003 km/h in this condition. e impact on the overall speed can be ignored basically. e vertical and horizontal coordination controller can better track the longitudinal speed of the vehicle.
It can be seen from Figure 12 that the vehicle cannot fully track the desired yaw rate in which the maximum error is less than 0.25 deg/s when turning. However, the yaw rate curve of the vehicle is smooth and has no fluctuation, which can better maintain the yaw stability of the vehicle under this working condition in this simulation process. Figure 13 is a schematic diagram of vehicle working condition switching. 1 represents straight driving condition and 2 represents steering condition. It can be seen from Figure 13 that the hybrid controller can switch vehicle conditions smoothly according to the change of    vehicle monitoring data and select the corresponding control strategy to optimize the distribution of vehicle tire force.

Conclusion
In order to improve the driving stability of the vehicle under multiple working conditions, the longitudinal and transverse stability controller of the distributed drive electric vehicle is established in this paper. e body attitude tracking controller is established based on the sliding mode variable structure control idea, and the vehicle condition switching controller is established based on the hybrid control theory. At last, the distributed vehicle is simulated and verified under the multi conditions. e simulation results show that the vehicle stability coordination controller can meet the driver's driving expectations and improve vehicle stability and safety. e vehicle condition switching controller can switch vehicle working conditions and control strategies in real time according to vehicle monitoring information and optimize tire force distribution to realize yaw stability control of the vehicle under different working conditions and meet the driving requirements of drivers under different working conditions. erefore, the vehicle stability controller is effective.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.   Mathematical Problems in Engineering 9