Electronic Stability Control for Improving Stability for an Eight In-Wheel Motor-Independent Drive Electric Vehicle

An electronic stability control (ESC) based on torque distribution is proposed for an eight in-wheel motor-independent drive electric vehicle (8WIDEV). The proposed ESC is extremely suitable for the independent driving vehicle to enhance its handling stability performance. The vehicle model is established based on a prototype 8WIDEV. A hierarchical control strategy, which includes a reference state generation controller, an upper-level vehicle controller, and a lower-level optimal control allocation controller, is utilized in the ESC. The reference state generation controller is used to obtain the ideal reference vehicle state. The upper-level vehicle controller is structured based on sliding mode control, which obtains the generalized objective force during 8WIDEV movement, therein considering the side slip angle and yaw rate. The lower-level optimal control allocation controller attempts to allocate the vehicle’s objective force in each motor optimally and reasonably. The model is validated by field measurement results under the step input condition and snake input condition. Simulation results from a hardware-in-the-loop (HIL) simulation platform indicate that the ESC based on the optimized allocation proposed for 8WIDEV achieves better stability performance compared with direct yaw moment control (DYC).


Introduction
e structure of an electric vehicle driven by in-wheel motors is different from that of traditional vehicles driven by internal combustion engines in that it does not use an engine or transmission, places the motor inside the hub appropriately, and uses a battery as the power supply.e eight in-wheel motor-independent drive electric vehicle (8WIDEV) has eight independent controllable motors, which has the potential to improve the vehicle handling stability [1,2].e 8WIDEV system is a typical redundantly actuated system and has greater flexibility than four in-wheel motor-independent drive electric vehicles [3].Due to its many advantages, 8WIDEV is widely used as a special vehicle.However, 8WIDEV has different characteristics from 4WIDEV, a high center of mass and complicated driving conditions.Because the executor has numerous and more complex nonlinear characteristics, the vehicle control strategy is more complicated [4].
Currently, there are three commonly used control structures for the dynamic control of a vehicle driven by inwheel motors: decentralized, centralized, and hierarchical control structures.Because of its flexibility, the hierarchical control strategy is more suitable for solving complex nonlinear and redundant systems with executive constraints, compared with decentralized and centralized control structures [5][6][7][8].e hierarchical control structure uses a control law in the upper controller to solve the complex and nonlinear problem of the vehicle.e lower-level optimal control allocation controller used in the hierarchical control structure assigns the target moment to the actuators under the constraint condition [9,10].A commonly used control method considers the problem as a control allocation problem with constraints [11,12].Most research on vehicle control systems is now directed at 4WIDEV, having made great progress [13][14][15].A state feedback-based control system using direct yaw moment control is set up for 4WIDEV, effectively reducing the modeling difficulty.
Comparing with the widely used model following control, the stability of the vehicle is improved [3,8,16].A control strategy with an optimal target is proposed to improve the electric drive vehicle dynamic stability and maneuverability.In lower-level optimal control allocation controllers, an optimization algorithm is used to distribute the motor torque to achieve effective control [17,18].Based on a hierarchical control structure, an ESC system suitable for a 4WIDEV is presented.ree levels of control logic are designed in the ESC system, which contains a torque distribution algorithm based on a minimum-objectivefunction to enhance the vehicle's stability [19].Fully utilizing the hierarchical structure, a linear quadratic regulator control method is obtained by controlling the yaw rate to design the upper-level controller, and a fast calculation method is used to achieve a fast motor torque distribution [20].Taking two variables reflecting the advantages and disadvantages of the vehicle's lateral movement in the motion control unit, the objective yaw moment is obtained by fuzzy logic control.However, this method is highly dependent on engineering and a lack of control accuracy [21].A new control method is proposed based on model predictive control (MPC) theory to address the issues of multiple objectives with constraints, which can maximize the regeneration efficiency while maintaining the vehicle dynamics [22].ese methods focus on the vehicle torque allocation but do not optimize the vehicle handling stability for vehicle motion control.
However, fewer studies have focused on the 8WIDEV with high weights.As the number of driving wheels increases, the 8WIDEV becomes applicable to more complicated driving conditions, given its greater flexibility and maneuverability.To improve the 8WIDEV handling stability, the longitudinal dynamic control and lateral dynamic control are constructed.e target lateral force and target yaw moment are obtained by controlling the two corresponding vehicle variables in lateral control [23].A hierarchical control allocation strategy is developed by considering the real-time performance of the control for multiaxle land vehicles equipped with independent driving wheels [24].Because the vehicle's steering wheel angle is not large, the distribution of the motor torque needs to satisfy the demanded lateral force of the vehicle, and the torque of the motor readily experiences a saturated amplitude.Vehicle stability control is mainly reflected in two variables.Vehicle handling stability is not only related to the vehicle longitudinal speed but also directly related to vehicle yaw speed and side slip angle, which is directly related to the vehicle heading angle, and determines the performance of the vehicle trajectory tracking.In addition, although the two variables are controlled simultaneously sometimes and the target yaw moment and lateral force are obtained, the motor output torque readily becomes saturated for a vehicle without active steering [10,23].Based on nonlinear control theory, a fuzzy logic method, the yaw moment is obtained by controlling the lateral slip angle and yaw rate.However, it is not easy to establish precise mathematical relations for this control method, and it is more dependent on experience [21].e yaw rate is mathematically related to yaw moment; thus, it can be directly controlled.However, the relationship between the side slip angle and yaw moment represents an "un-matching system," which can be expressed as that the side slip angle being tracked to an ideal stare quantity by controlling the yaw rate as an intermediate variable; however, the actual yaw rate is not sufficient to track its reference value [25].
e required lateral force can be calculated via steering angle control, and the expected yaw moment is obtained by fully utilizing the yaw rate. is integrated control method can be used by active steering vehicles [26].e control configuration vehicle principle is structured to improve the flexibility and performance of the structure layout.Although this method can focus on the side slip angle control, it is only suitable for steer-by-wire vehicles, which presents limitations for use in vehicles without active steering or auxiliary steering.
Most control allocation rules now adopt traditional allocation methods such as average allocation and direct control allocation.ese methods are faster in calculating the torque distribution; however, their torque allocation method is simple.e vehicle dynamics constraints and the optimization of the torque distribution need to be fully considered [27,28].Considering the nonlinear saturation and coupling relationship of the tire force and torque saturation amplitude of the drive motor, a lower-level optimal control allocation controller is constructed.A nonlinear tire is regarded as a more extensive "constrained nonlinear actuator" in the control allocation.e optimization-based control allocation method with weighted least square (WLS) is used for the torque force distribution; this can effectively increase the computation speed [29].
In this paper, ESC based on a hierarchical control strategy is established to enhance the performance of the handling stability and trajectory capability of 8WIDEV.
e hierarchical control structure includes the reference state generation controller, the upper-level vehicle controller, and the lower-level optimal control allocation controller.By utilizing the classic reference model of the vehicle, a monorail of four-axle vehicles based on a two DoF model is established to obtain the required reference state of the vehicle.
e reference state generation controller is designed using the reference state of the vehicle.In contrast to the linear control method, attempting to consider vehicle nonlinearity and uncertainty, the upperlevel vehicle controller is built using the nonlinear control method, therein achieving strong robustness to vehicle parameter uncertainties and external disturbances.e upper-level vehicle controller includes a yaw moment synthesis controller, therein considering the two control variables related to lateral motion tracking while adjusting the weight coefficient.Actuator torque allocation for redundant systems is modeled as a constrained optimization problem.e main contribution of this paper lies in the following points.First, based on prototype vehicle parameters, a dynamic model of an 8WIDEV is established.
is model can fully reflect the dynamic characteristics of 2 Shock and Vibration the vehicle and provide a favorable basis and conditions for verifying the control method.e effectiveness of the vehicle model is verified through comparison simulations in MATLAB/Simulink with the experimental results for the prototype vehicle.Second, the vehicle slip angle and the yaw rate tracking are realized via sliding mode control, and the corresponding yaw moment is obtained.is provides the advantage of avoiding the saturation of the motor torque caused by satisfying the lateral force requirement.e stability control strategy proposed in this paper improves the stability of vehicles according to the simulation and contrasts with DYC control.ird, because most previous stability control studies on the 8WIDEV lack validation, in this paper, a hardware-in-the-loop (HIL) experiment verifies that the ESC proposed improves vehicle handling and stability [30,31].e structure of this paper is divided into the following main parts: first, the 22-DoF vehicle dynamic model is introduced, including the vehicle body model, suspension model, wheel model, tire model, and electric motor model.Second, a vehicle control strategy for the 8WIDEV based on a hierarchical structure is proposed, whereby the ESC system in the vehicle improves the vehicle handling stability.Finally, analysis of a simulation experiment and a hardware-in-the-loop (HIL) experiment to verify the vehicle dynamic model established in MATLAB/Simulink demonstrates the dynamic characteristics of the 8 × 8 prototype vehicle and verifies the effectiveness of the control strategy proposed in this paper to improve the vehicle handling stability and good trajectory tracking ability.Finally, we conclude the paper, therein describing valuable observations obtained in this study.

Vehicle Model
e research in this paper focuses on a 8WIDEV handling stability project.e 8 × 8 prototype vehicle is shown in Figure 1. e 8WIDEV is equipped with eight independently controllable in-wheel motors, which can be described as larger unsprung masses.e importance of vehicle dynamics control is to establish a nonlinear vehicle dynamics characteristic model that can reflect the vehicle dynamics characteristics.
is section mainly describes the 22-DoF vehicle dynamic mode, including a model of the vehicle body, suspension, tires, wheels, and electric motor.e vehicle body model usually only considers motion in three directions.Considering the static and unsteady problem of the suspension system and the body in the vertical dynamics, a suspension model based on the static equilibrium is constructed, and the vehicle body model considers the 6-DoF of the body.Considering the effects of the slip rate, side slip angle, road adhesion coefficient concerning the tire forces, nonlinear saturation, and coupling of the total tire force, a tire model based on the nonlinear saturation and coupling characteristics of the tire is established.2 shows the planer motion of the vehicle body, which is considered as a general rigid body with 6-DoF, including translational and rotational degrees of freedom in three directions.e equations of motion for the vehicle model can be expressed as follows:  Shock and Vibration 3 where F f � mgf r cos α f and F w � 1/2C D A j ρv 2 x .F f and F w are the rolling resistance and air resistance, respectively; F i is the slope resistance; F i � mg sin α f ; a x , a y , and a z are the longitudinal, lateral, and vertical acceleration of the vehicle, respectively; v x , v y , and v z are the longitudinal, lateral, and vertical velocity of the vehicle, respectively; ω x , ω y , and ω z denote the roll, pitch, and yaw rate, respectively; ϕ and θ are the roll angle and pitch angle, respectively; and F xij , F yij , and F zsij represent the longitudinal force, lateral force, and vertical force in the vehicle coordinate system, respectively.To clarify the variables, i � 1/2/3/4 denotes the first/second/third/ fourth axis, and j � 1/2 denotes the left/right wheel of the vehicle.h c , d i , and l i represent the centroid height, track width, and distance from the axles to the centroid; m and m b are the vehicle mass and spring mass, respectively; f r , α f , C D , A j , and ρ denote the rolling resistance coefficient, gradient, air resistance coefficient, windward area, and air density, respectively; and I x , I y , and I z are the moment of inertia around the x-axis, y-axis, and z-axis, respectively.e tire coordinate system is shown in Figure 3. e relationship between the tire force in the vehicle coordinate system and in the tire coordinate system can be expressed by the following equations, which provide representations in different coordinate systems:

Suspension Model.
e suspension and vehicle body in the vehicle vertical dynamics represent a statically indeterminate problem.Based on the traditional displacement method, the suspension force and vertical force of the tire are solved.In addition, the suspension model is built based on suspension parameters and suspension system theory of 8WIDEV and mainly refers to the dynamic method of multiaxle vehicle suspension modeling [23].First, the suspension force F 1zsij and tire load F 2zsij under the static balance of the vehicle are solved by the displacement method.Second, the dynamic suspension force F 2zsij and the dynamic tire load F 2zwij are calculated in the motion state relative to the static equilibrium state, being based on the motion differential equation.
Under static balance of the vehicle, the balance of the vehicle vertical force and the balance equation of the body moment are given as follows:    Shock and Vibration It is assumed that the stiffness of each axle suspension is the same, and the static suspension force of each axle is obtained: where e static forces of each suspension are described as follows: en, the static vertical load of each wheel is described as follows: where m wij is the mass of each electric wheel.e dynamic force of suspension caused by a change in the body posture is mainly reflected in the vehicle load transfer caused by the movement of the vehicle and the pitch motion.
e dynamic suspension force expression is as follows: e vertical movement, tilting movement, and pitching movement of the body lead to the vertical deformation of the suspension expressed as follows: e dynamic vertical force of the wheel caused by the unevenness of the pavement is as follows: e suspension system and the vertical load of the tire can be expressed as follows: where z wij and z sij are the vertical displacement of the vertical position and the vertical displacement of the suspension system, respectively; K wij and C wij are the corresponding K and C tire characteristics; and K sij and C sij denote the K and C characteristics of the suspension.

Wheel Model.
Based on the dynamic analysis of wheels in automobile theory [26], the differential equation for wheel motion can be written as follows: where T wheelij , I wij , ω ij , and R wij represent the electric wheel torque, the moment of inertia, the angular velocity, and the effective radius of the tire, respectively.
where T fij is the tire rolling resistance moment and F zwij and f r correspond to the vertical force of the wheel and the rolling resistance coefficient.
2.4.Tire Model.Tires have strong nonlinear characteristics, which are mainly manifested in the relationship between the lateral force and the cornering angle of the tire and the relationship between the lateral force and the longitudinal force of the tire.It is important to establish a tire model that can reflect the nonlinear characteristics of vehicle tires.Currently, the "magic" tire model, power exponential unified tire model, and swift tire model are commonly used in tire modeling.In vehicle dynamics research, the widely used "magic" tire model established by Professor Pacejka [32], based on test data and formula obtained by trigonometric function fitting, can be used to completely and accurately describe lateral/longitudinal forces.e "magic" tire model is more suitable for multiwheeled vehicles of large mass and high centroid, and it is often used in multiaxle vehicle tire modeling; this model is used in the tire modeling of the 8WIDEV.e tire model, based on exact mathematical formulas, clearly describes changes in the tire longitudinal slip ratio/lateral forces with changing tire slip ratio/side slip angle.e longitudinal force and lateral force are obtained by considering the influence of the ground adhesion coefficient by modifying the basic expressions.eir specific description is given as follows: where μ denotes the ground adhesion coefficient; λ xij and α yij are the corresponding longitudinal slip rate and side slip angle of the corresponding tire, respectively; and B x/y , C x/y , D x/y , and E x/y are gated by the fitting parameters of the tire model.

Shock and Vibration
Another way to express the longitudinal/lateral tire force and the tire slip rate/side slip angle is shown in Figure 4. Figure 4 shows the relationship between the tire force and the slip rate clearly and is accurately expressed by the magic formula tire model.Figure 4 shows the tire longitudinal force and tire lateral force with respect to the tire slip rate when the tire vertical load is 4 kN and the road adhesion coefficient is 0.8.e red solid line, black dashed line, and black dashed line in Figure 4 represent the results at three different tire corners, respectively.e three groups of lines that first increase and then decrease are the result of the change of tire longitudinal force with tire side slip angle, while the remaining three groups are the result of the change of tire lateral force with the tire slip rate.Taking the red solid line as an example, when the slip angle of the tire is 0.8 and the slip ratio of the tire is less than 0.2, the relationship between the longitudinal force of the tire and the cornering angle is almost linear and the tire longitudinal force increased with the slip rate.And when the slip rate is 0.2, the tire longitudinal force reaches the maximum value.When the tire slip rate continues to increase, the longitudinal force decreases nonlinearly with the tire slip rate.e tire lateral force decreases nonlinearly with the increase of the tire slip rate.When the side slip angle of tire is the other value, the tire force has similar analysis results with the change of the tire slip rate.It can also be seen that, at the same slip rate, such as 0.2, the bigger the side slip angle, the larger the longitudinal force of the tire, and the smaller the lateral force of the tire.

Electric Motor Model.
e parameter matching and selection requirements of in-wheel motors are decided by the power and torque of the vehicle dynamics performance.It is important to describe the process of choosing motor specification based on the vehicle dynamics.e full load of the vehicle is tens of tons, and considering the relatively large available space for the hub, a planetary gear reducer for the drive system was selected, with a transmission ratio preset as 10.Next, the choice of motor specification was divided into two parts: the motor power demands and the motor torque and speed requirements.First, we introduce the power demands of the motor.e motor power depends on the vehicle power demand.Equation ( 21) expresses the vehicle power demand: where η is the mechanical transmission efficiency.
Based on the vehicle dynamics performance, the vehicle power demand mainly concerns three aspects: (1) the requirements for achieving maximum speed, (2) achieving the maximum gradability performance, and (3) satisfying the acceleration performance requirements of the vehicle.e vehicle maximum speed is the top speed on a straight and good road with full load or half load.In this case, the slope resistance and acceleration resistance are zero.e vehicle power demand can be obtained as follows: where v max and P v max are the vehicle maximum speed and maximum power under the maximum speed demanding situation.e climbing ability of the vehicle is determined such that all the power overcomes the slope resistance after overcoming the rolling resistance.Moreover, the vehicle can maintain a uniform speed: where α s and v i are the maximum gradient and the steady speed in this case and P i is the vehicle power demand when realizing the maximum gradient.e maximum power P a should enable the vehicle to reach 50km/h in 50s.erefore, the vehicle's maximum power demand and rated power should not be less than 1019 kW and 526 kW, respectively.Note that some in-wheel motors cannot effectively provide power in situations whereby the motor cannot function normally or whereby the vehicle is on a slippery or uneven road.Finally, the required rated power of each motor is no less than 87 kW.Second, we calculate the motor torque and speed requirements.
e maximum speed and rated speed of the wheel motor are decided by the maximum speed and commonly used speed, respectively.e maximum speed and rated speed of the motor can be calculated as follows: e maximum speed n max � 4420 r/min and the rated speed n max � 2652 r/min are calculated.e peak torque of the selected in-wheel motor is determined by the dynamic factor of the vehicle: where T max , D, and z are the peak torque of the motor, the dynamic factor, and the number of in-wheel motors.e peak torque is 992 kW when all eight motors are operating properly.e rated torque of the motor is determined by the 6 Shock and Vibration rated speed and rated power.e following equation describes their relationship: e rated torque of the motor is not less than 315 Nm after calculation.Permanent magnet synchronous motors (PMSMs) are used as in-wheel motors to meet the vehicle performance requirements.By analyzing the requirements of vehicle dynamic performance, the rated power of the motor is finally chosen as 90 kW, and the rated torque is 340 Nm. e final selection of the motor specifications is shown in Table 2. e PMSM is designed and manufactured by the motor manufacturer based on the basic motor demands and requirements.
After choosing the motor model, the PMSM was manufactured.A bench test of the PMSM was conducted in the laboratory, and the calibration was performed, as shown in Figure 5. e PMSM is installed on the bench, which is controlled by the on-off switch of the IGBT of the PWSM controller.e motor is calibrated by controlling the voltage and output torque of the motor and recording the current.Figure 6 shows the external characteristic curve of the motor at peak power and rated power, respectively, and interprets the relationship between motor torque and motor speed.
e vehicle controller, which contains the electric stability control system, sends the target torque command to the motor controller.e main research topic here is the vehicle control strategy toward improving the vehicle handling stability.e response speed of the PMSMs is high compared with the wheel dynamics; thus, the input and output of this motor torque is described as a first-order system: where τ m represents the damping ratio.A planetary reducer is adopted between the in-wheel motor and the hub.us, the output torque of the electric wheel is where η ij and i ij are the transmission ratio of the reducer and the efficiency of the mechanical transmission, respectively.

Control Structure
An electronic stability control (ESC) is proposed in this paper for the object under study in this paper, 8WIDEV, to improve the vehicle stability performance, therein adopting a hierarchical control structure.A hierarchical control structure is suitable for over-driven electric vehicles, as shown in Figure 7, which includes the upper controller and lower controller.e upper controller can be applied to inwheel motor-independent drive electric vehicles with strong and complex nonlinearities.e generalized target forces, such as the target lateral force and the target yaw moment, can be obtained by using nonlinear or linear methods.e lower controller can fully utilize the overdrive of the inwheel motors to realize the distribution of the generalized force for the torque of each in-wheel motor.e hierarchical control structure is superior to the centralized control structure in terms of control flexibility and fault tolerance.erefore, the commonly used hierarchical control structure is designed to control the handling stability of the 8WIDEV.e upper controller mostly controls the vehicle speed and yaw angular speed.Vehicle handling stability can be improved at low speed and good working conditions.e lower controller realizes the distribution of each motor's torque by using different distribution methods.By reasonably and effectively allocating the torque control vehicles for each inwheel motor, the vehicle can track the reference path preferable.e ESC proposed in this paper fully utilizes the hierarchical structure and improves it on this basis.
e ESC includes a reference state generation controller, an upper-level vehicle controller, and a lower-level optimal control allocation controller, as illustrated in Figure 8. e reference state generation controller based on a 2-DoF model is designed to obtain the reference side slip angle.e upperlevel vehicle motion controller, including a yaw moment synthesis controller and a longitudinal motion controller, obtains the corresponding control objective force to meet the stability requirements of the vehicle during the moving process.Because of the advantages of sliding mode control, the upper-level vehicle controller fully utilizes its nonlinear characteristics; this can help in establishing an accurate mathematical relation, compared with fuzzy logic control, and effectively mitigate chattering by selecting an appropriate sliding surface and linear saturation function.Considering the vehicle's handling stability under comprehensive operating conditions, the side slip angle and yaw angular velocity of the center of mass are considered simultaneously in the lateral stability.e in-wheel motor's torque distribution is realized by the optimization-based control allocation method under the constraints.e optimization control allocation, including the minimum tire load rate and error approximate minimization function, considers the friction circle constraint and the motor's external characteristic constraint, therein using the weighted least square method (WLS) to improve the distribution efficiency.By optimizing and designing the upper and lower controllers, the vehicle handling stability can be significantly improved.

Reference State Generation Controller.
e most commonly used reference model in vehicle dynamic control, as

Shock and Vibration
shown in Figure 9, is the linear reference model based on the idea of a traditional two-axle vehicle [12]. is reference dynamic model can calculate the reference state of a vehicle according to the driver inputs.e research object in this paper adopts a mechanical double front axle steering mechanism based on Ackerman steering theory.e state equation of the double front axle steering vehicle can be described as follows:  Shock and Vibration where C 1 is the lateral stiffness of each axle, M denotes the vehicle weight when fully equipped, and I z is the z-axis moment of inertia.
e ground adhesion vehicle limits the maximum lateral acceleration; thus, the maximum yaw rate is limited by the maximum lateral acceleration and the longitudinal speed.

Shock and Vibration
Similarly, satisfying the vehicle lateral safety, the side slip angle is subject to the longitudinal speed [26]: Based on the above analysis, the vehicle's two ideal variables are described by the following equation: In a sense, to simplify the algorithm, it is assumed that the vehicle acceleration and the displacement of the accelerator/brake pedal are linear.us, the expected speed of the vehicle is obtained: where v o is the initial vehicle longitudinal velocity at time t o and a x denotes the desired longitudinal acceleration/ deceleration.

Upper-Level Vehicle Controller.
e upper-level vehicle controller contains the vehicle longitudinal motion controller and the vehicle yaw motion synthesis controller, whose purpose is to generate the objective longitudinal force and the objective yaw moment of the vehicle as needed.By tracking the longitudinal speed, the vehicle longitudinal motion controller obtains the desired longitudinal force.e side slip angle, as another variable, is controlled to obtain the objective yaw moment, instead of obtaining the lateral force required by the vehicle, which reduces the saturation of the tire longitudinal force distribution due to the lateral force required by the vehicle.e vehicle yaw moment synthesis controller obtains the synthetic moment by controlling the side slip angle and the yaw rate.
Vehicle handling stability is mainly determined by the longitudinal speed and yaw rate.According to the deviation from the reference state and actual state, the desired longitudinal force X des produced by the tire longitudinal and the lateral forces Y des are calculated.Using the same method, the desired lateral force and the desired yaw moment M zdes can be obtained.
e upper-level vehicle controller is designed using differential equations (1), (2), and ( 6). e simplified differential equation is expressed as follows: where f represents the sum of the air resistance, slope resistance, and rolling resistance.e tire force control is realized by the actuator.Because of the nonlinear coupling between the longitudinal and lateral forces, the actuator faces difficulties in controlling the lateral force accurately.Moreover, the output torque of the motor and brake directly affects the longitudinal force of the tire.e vehicle studied in this paper does not utilize active steering; thus, it is difficult to control the lateral force accurately by compensating with the steering angle.
In this paper, the resultant force and yaw moment produced by the tire longitudinal force are taken as the target control force: where in which X ydes , Y ydes , and M zydes are the reference longitudinal force, lateral force, and yaw moment of the vehicle generated by every tire lateral force.X xdes , Y xdes , and M zxdes are the corresponding force/yaw moment of the vehicle by the longitudinal force of the obtained tire vector decomposition.
Because of its strong robustness and anti-interference ability, sliding model control (SMC) is adopted in this paper to address the vehicle nonlinearity, unmodeled dynamics, and parameter uncertainty [28].e fundamental aspect of the sliding surface design is to make the vehicle track the objective of the longitudinal speed, side slip angle, and yaw rate.e sliding surface is selected as follows: where S v x , s β , and s ω z are the sliding surface and κ is the integral coefficient.e control error gradually weakens or decreases to zero as s i approaches zero.
e switching function can be used to improve the quality of the sliding mode motion, as can the proper selection of the reaching law.e constant velocity reaching law is adopted in this paper.It can be described by the following equation: us, the sliding mode function and the approach law are further expressed as follows: In the sliding mode control law, we use the Lyapunov stability theory to design an appropriate sliding mode control to satisfy the reachability condition.e Lyapunov function is constructed as follows: is represents the distance from the system curve to the switching function, and the Lyapunov inequality is described as follows: As long as the Lyapunov arrival condition is satisfied, the moving points outside the sliding mode will reach the surface in a finite time approaching to the sliding surface.us, the inequality ε i > 0 should hold.To mitigate chattering caused by the switching of system state values near the sliding mode surface, the linear saturation function takes the place of the sign function as in the following equation: rough equations ( 34)-( 42), the objective reference longitudinal force and the objective yaw moment, given the generalized target force to be obtained, are obtained: where M zx−βdes and M zx−ω z des are calculated by the corresponding actual variables tracking the ideal reference side slip angle and the ideal reference yaw rate, respectively.However, M zx−βdes is obtained by controlling the vehicle side slip angle, with ω z−β taken as an intermediate variable, and tracking the ideal reference side slip angle.e yaw moment synthesis controller obtains the objective yaw moment though a joint action calculation result though two variables by adjusting the corresponding weight coefficient [19]: where K 1 and K 2 are the weight coefficients of the yaw moment.If the variation rate of the state quantity deviation is increased, the corresponding weight coefficient increases; otherwise, the corresponding weight coefficient decreases.e 8WIDEV can satisfy the stability control requirements as long as the tire force satisfies the generalized force in the vehicle v � X xdes M zxdes   T in the lower-level controller.

Lower-Level Optimal Control Allocation Controller.
As the most important part of the ESC system, the lowerlevel controller plays a crucial role in the motor torque distribution and manages the distribution of the longitudinal force/yaw moment acquired by the upper-level vehicle controller.e force of each tire, including the tire longitudinal force and the tire lateral force, can be controlled theoretically.However, the wheel steering angle is directly related to the input of the steering wheel driver, and the 8WIDEV, as the research object in this paper, does not utilize active steering.e lateral force of the tire is difficult to control accurately.erefore, the resultant force of the tire longitudinal force in the vehicle coordinate system is taken as the target force, defined as v. e two different torque distribution methods, concretely speaking, the rule-based braking torque distribution and optimization control allocation, are described in the following parts.
e rule-based braking torque distribution is designed using the traditional DYC.Correspondingly, the ESC proposed in this paper uses the optimization torque allocation method.
e two allocation methods are introduced in the following two sections.

Rule-Based Braking Torque Distribution.
According to the description of the vehicle steering in vehicle theory, the effect of each wheel generating a braking force on the yaw moment of the vehicle is different.e main contribution to the internal yaw moment of the vehicle comes from the rear inner wheel, whereas the lateral yaw moment produced by the front inner wheel is the most effective [22].First, we determine the value and direction of the yaw moment of the required motion.Second, the required yaw moment satisfies the requirements according to the braking torque distribution.Considering the different effects of each in-wheel motor on the yaw moment of the vehicle, a rule-based braking torque distribution is proposed in this paper and as a contrastive control strategy.

Shock and Vibration
e dynamic distribution ratios of power from the main to secondary system are 0.5 : 0.25 : 0.15 : 0.1.
During vehicle steering, there are two cases of note: insufficient steering and excessive steering.Figure 10 shows the case of insufficient steering during a left turn.e desired yaw rate is nonnegative and larger than the actual yaw moment.eir expressions are given as follows: By comprehensively analyzing and compensating the lack of vehicle steering in this case, the required yaw moment is found to be toward the inside, the inner rear wheel is the main brake wheel, and the other wheel on the left is the secondary brake wheel.e left wheel force produces the required yaw moment as follows: where ∇M zb and F bij are the additional yaw moment and the braking force exerted by each motor, respectively.e rules for the other cases, including the excessive steering in the left turn and excessive steering and insufficient steering in the right turn, are the same as in the above case.

Optimization Torque Distribution.
Actuator torque allocation for redundant systems can be described as a constraint optimization problem.Considering the nonlinear saturation and coupling relationship of the tire force and torque saturation amplitude of the drive motor, the lowerlevel optimal control allocation controller is constructed.
e nonlinear tire is regarded as a more extensive "constrained nonlinear actuator" in the control allocation.e optimization-based control allocation method-weighted least square method (WLS) is introduced in this paper and can achieve the required vehicle stability performance [6].
According to equations ( 1)-( 3), (7), and ( 8), the relationship between the objective force and the tire longitudinal force can be expressed by (48) B and u denote the coefficient matrix and the output variable, respectively.
e maximum tire longitudinal output force cannot exceed the tire friction ellipse constraint and external characteristic curve of the motor torque.First, the tire force is limited by the ground adhesion and the dynamic vertical force of each tire.According to the concept of the tire friction circle, the tire longitudinal force and lateral force need to satisfy the following conditions: where T m max , R w , and i g are the maximum in-wheel motor output torque, wheel radius, and deceleration ratio of the reducer.Second, the friction circle coupled with the longitudinal force and lateral force also limits the output tire longitudinal force.Overall, considering the friction circle constraint and the maximum torque constraint of the in-wheel motor, the constraint of the longitudinal force of the tire can be merged into the following equation: where e constraint condition Bu � v is an equality constraint.It is possible that there is no solution in the limit condition.To address this possible problem, the minimum error approximation ‖Bu − v 2 ‖ is used to replace the equality equation constraint.e main goal of the optimal allocation is to minimize the allocation error.e objective equation can be expressed by the squared norm: where W v is the diagonal weighted matrix for adjusting the tracking performance.It is defined as follows: 12 Shock and Vibration To improve the vehicle stability by guaranteeing the output reserve of the tire longitudinal force, the vehicle's stability margin is also considered when the vehicle torque is allocated.
erefore, considering further improvement in the stability under the limit condition and maneuverability under good conditions, an additional objective function is used based on the principle of the small tire load rate by reserving the load of the longitudinal force.Its norm expression is expressed by the following condition: where W u means the diagonal weighted matrix.e distribution of the objective force/moment obtained by the upper-level vehicle controller into the longitudinal force of each tire is an optimization-based control allocation problem with a boundary constraint. is leads to a linear constrained quadratic programming problem.Such problem can be expressed as follows: is problem is typical of the two-step optimization of sequential least squares (SLS).By setting the weight coefficient c, the above two-step algorithm can be integrated into a one-step algorithm and solved by weighted least square (WLS) [17].
e active set method algorithm is used to calculate the target torque of the in-wheel motor, as shown in Figure 11.In the active set method, it is important to calculate p k and judge whether p k is zero.Following this process, the optimal solution x of the constrained optimization objective can ultimately be obtained.

Vehicle Model Verification and Analysis of Control Strategy
e 8WIDEV developed by our lab is a modified 8 × 8 prototype vehicle, whose basic structural parameters are shown in Table 1.Section 4.1 mainly concerns the comparative analysis of the vehicle model simulation and vehicle experiments under the same conditions, and analysis of the ESC in the hardware-in-the-loop simulation platform is presented in Section 4.2.

Vehicle Model Validation. First, we verify the effectiveness of the vehicle dynamic model built-in MATLAB/
Simulink.e validity of the vehicle dynamic model can be approximately verified by comparing the prototype vehicle results with the simulation results of the dynamics model of the 8WIDEV under different and the same conditions.e experimental vehicle is equipped with gyroscopes, accelerator/brake pedal signal sensors, and a steering wheel angle sensor and is driven by eight in-wheel motors with equal torque.
rough comparison of the experimental vehicle test data and simulation of the vehicle model, the accuracy of the model is verified.Under this scheme, deviations between the torque values obtained by each wheel and those of the wheels in the prototype vehicle are unavoidable.However, under the premise of sufficient power and satisfying the given vehicle working conditions, the influence of the deviations on the handling stability is not significant.
e vehicle angle step input and snake condition test are typical conditions for testing vehicle dynamics and are also important conditions in testing vehicle handling stability.erefore, the two conditions are utilized based on controllability and stability test procedures for automobiles-the Pylon course slalom test of GB/T 6323.1-1994-tocompare the results of the experimental vehicle and the simulation results of the vehicle model.e vehicle model established in MATLAB/Simulink uses the built-in MATLAB/Simulink Dormand-Prince algorithm to solve the problem.
Figure 12 shows the experimental 8WIDEV with angular steps at the laboratory site of a cooperating company.Figure 1 shows the experimental vehicle with angular steps at the experimental site.In the steering wheel angle step input condition, the longitudinal speed is set to a constant value of 80 km/h.Figure 12 describes the results of the prototype vehicle results and the 8WIDEV simulation, including the (a) steering angle, (b) yaw rate, (c) lateral acceleration, and (d) body roll angle.Figure 12(a) shows the comparison of the data collected from the steering wheel angle sensor and the simulation results from MATLAB/Simulink.e simulation results reach their maximum in a very short period of time and remain unchanged for a typical angular step change of 2 seconds.In contrast, the experimental vehicle was slightly delayed; however, it also completed a step change in 0.4 seconds and remained unchanged.Both vehicles ended up at 57 degrees.Figure 12(b) shows the comparison results of the vehicle yaw rate under experimental and simulation conditions.e final steady-state value of the vehicle simulation and experimental results is approximately 5.8 deg/s.In addition, through comparative experiments, it is found that the time for simulation stabilization in MATLAB/Simulink is 0.3 s faster than that in the experimental vehicle experiment.Figure 12(c) shows the results of the changes in the lateral acceleration of the vehicle dynamics.e lateral acceleration of the vehicle increases gradually from zero at 2 s to 2 m/s 2 in the 3.4 s. e lateral acceleration of the experimental vehicle was stabilized at 2 m/s 2 at 3.6 s, which shows a delay of 6% compared with the simulation results.e amplitude in the simulation results is slightly larger than that in the experimental results.Figure 12(d e vehicle during the snake experiment passes through four piles at a constant speed of 50 km/h.Figure 13 shows the 8WIDEV performing the snake experiment at the Shock and Vibration experimental site.Figure 14  e solid line in Figure 14 represents the simulation results in MATLAB/Simulink, while the dotted line represents the experimental results of the experimental vehicle.Figure 14(a) shows the trajectory of the 8WIDEV in geodetic coordinates.
e maximum lateral displacement of the 8WIDEV model simulation is 4.7 m, which is larger than the maximum lateral displacement of the experimental vehicle by 4.5 m. e error is less than 5% when comparing their trajectories.Figure 14(b) shows the longitudinal speed changes over time.ese changes basically stabilized at a fixed speed of 50 km/h.In addition, the lateral motion of the vehicle caused fluctuations of the vehicle longitudinal speed, where the maximum fluctuation value was not more than 2 m/s 2 .e vehicle is turning at the maximum steering wheel angle of 200 deg, as described in Figure 14(c).e yaw rate maximum was 20 deg/s during maximum lateral displacement, as illustrated in Figure 14(d).Figures 14(e) and 14(f ) show that the roll angle and lateral acceleration follow the same rule.e results of MATLAB/Simulink simulation are consistent with the results of the experimental 8WIDEV.By comparison, each index response process of the simulation of the vehicle dynamics model built-in MATLAB/Simulink and the results of the experimental prototype are the same.
rough the simulation test and real vehicle test of the 8 × 8 prototype vehicle, the response speed of the vehicle model is found to be related to the real vehicle test.e main reason for this is that the simulation model does not consider the characteristics of free travel, inertia, and stiffness of the steering system, and there are differences between the actual driver's operation and an ideal driver's operation in the simulation model.In terms of response amplitude, the deviation between the simulation results and the real vehicle tests is large at the peak, mainly because the simulation model neglects the inertia of certain rotating parts in the real vehicle and simplifies the suspension system to be a massfree, fixed stiffness, and fixed damping object.In addition, the accuracy of the tire model also produces deviations from the test results.However, these deviations are essentially unavoidable.Generally, the test results are consistent in terms of their trend, and the deviations between the results are within a reasonable range.erefore, from a practical point of view, the simulation model can accurately reflect the response characteristics of the real vehicle.From a theoretical point of view, the accuracy of the simulation model can satisfy the requirements of vehicle dynamics research and can be used as a simulation model for vehicle handling and stability control.
It is demonstrated that the vehicle model based on MATLAB/Simulink can reflect the dynamic characteristics of the 8 × 8 prototype vehicle.e errors between the vehicle model and experimental vehicle remain as less than 8%. is is sufficient to show that the vehicle model can replace the experimental 8WIDEV for simulation experiments, thereby providing a favorable basis and conditions for the validation of the control strategy of handling stability.e HIL platform includes a AC/DC inverter, dSPACE/ AutoBox, VCU, brake/accelerator pedal, steer wheel, CAN bus, and related accessories.
Figure 15 shows a process schematic of the HIL platform.e VCU includes the ESC strategy code automatically generated by the real-time workspace (RTW) provided by MATLAB/Simulink, and the manual code integration is conducted in CodeWarrior.e necessary hardware-related codes, such as the header file, interrupt service program, and hardware-related codes, are included.e ESC strategy is transformed into a real-time code in this way.e vehicle dynamic simulation model is embedded in dSPACE/ AutoBox in the form of a real-time simulation model.First, the RTW real-time code generation environment provided by MATLAB/Simulink is used to automatically generate real-time code for the vehicle dynamic simulation model.en, the real-time code of the vehicle dynamic simulation model is downloaded to the AutoBox real-time simulator by using the Real-Time Interface (RTI) provided    Shock and Vibration and the ESC strategy achieves good performance in trajectory tracking compared with the DYC.It can also be seen that the trajectory controlled by the DYC cannot track the desired path well in the second section of the straight line because the actual path cannot converge quickly to the desired path description, and there is a certain amplitude of left-right swing along the desired path.From Figure 17(b), the longitudinal speed is approximately stable at the expected velocity and can track the expected speed under the ESC system proposed in this paper.In addition, the longitudinal speed controlled by the DYC is lower than the expected speed in the lane-change process and shows a small fluctuation.Two variables can be controlled under the DYC and ESC in Figures 17(c) and 17(d).e yaw rate and side angle of the vehicle in the last straight line oscillate slightly, and it requires approximately 3 s to stabilize.Figure 17(e) shows that the trajectories in the phase diagrams of the two control methods can converge to zero. is proves that the two control methods are effective at ensuring vehicle stability, which is consistent with Figure 17(a).e phase diagram of the side slip angle and side slip angle rate is an important basis for judging vehicle stability.Figure 17(f ) also proves this point because the error of the expected yaw rate and the actual yaw rate is smaller when controlled by the optimization method.
e proposed method and DYC can guarantee proper vehicle handling and stability at high speed from the vehicle kinematics analysis.In addition, the ESC based on optimal control has a faster tracking performance and greater stability compared with the DYC based on the rulebased braking torque distribution.
Figures 18(a) and 18(b) show the eight in-wheel motor torque distribution of the ESC. Figure 18(a) shows the front four in-wheel motor driving/braking torque, while Figure 18(b) shows the rear four in-wheel motor driving/ braking torque.Figures 18(c) and 18(d) both describe the eight in-wheel motor torques controlled by the DYC.e optimal output change rate of the in-wheel motors controlled by the ESC is small, in contrast to the DYC distribution.Based on the optimal control method, the utilized maximum negative and positive torques of the motor of the ESC are −100 Nm and 200 Nm.e motor almost operates in the rated torque range and fully utilizes the independent control of each motor.e DYC based on the rule-based braking torque distribution is essentially different from the control methods proposed in this paper and realizes the stabilization of the vehicle by applying braking torque to the motors after the torque distribution is determined.erefore, when the braking torque is applied, the negative motor torque readily saturates such that the peak torque of the motors can be easily reached.e breaking torque of the left first and left third in-wheel motors already exceeded −330 Nm, which negatively affects vehicle handling and stability.Shock and Vibration

Discussion and Conclusions
Each in-wheel motor is independently and precisely controlled, making the system more likely to achieve vehicle dynamic stability control.e ESC proposed for an 8WIDEV improves the vehicle handling and control stability.A hierarchical top-down control structure includes a reference state generation controller, an upper-level vehicle controller, and a lower-level optimal control allocation controller.e upper-level vehicle controller, including the yaw moment synthesis controller, comprehensively considers the objective yaw moment calculated from the error of the side slip angle and the error of the yaw rate by adjusting the weight coefficient.
e lower-level optimal allocation controller based on an accurate control allocation method takes not only the friction circle constraint of the mutual coupling of the tire longitudinal force/lateral force and external characteristic constraint of the in-wheel motor into account but also utilizes an advanced fast calculation method, WLS, for the torque distribution in each in-wheel motor.e effectiveness of the vehicle dynamic model based on prototype parameters is verified by comparison under two different conditions.e validity of the vehicle dynamic model established in this is verified by comparing simulation and experiment results.In addition, the HIL experimental results confirmed that the ESC proposed in this paper, compared with the DYC, can improve the handling and control stability of the vehicle.Each motor has two different working modes, which can coordinate generating the desired yaw moment.Both simulation results and experimental results have shown that the transient response speed of the vehicle is high.
Our next task is to apply the ESC proposed in this paper to the experimental vehicle after completing debugging and verifying the ESC control strategy.More importantly, the inwheel motor more effectively enables the regeneration of energy to the battery during braking and thus increases the vehicle's range, which is another hot topic and direction worth studying.

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

igure 4 :
Tire force under different conditions.
12 a 21 a 22 a 31 a 32 a 41 a 42 b 11 b 12 b 21 b 22 b 31 b 32 b 41 b 42  .
) shows the changes in the roll angle of the vehicle of vehicle dynamics.It also produces the same analysis results as the lateral acceleration.Figures 12(b)-12(d) show that the steady-state values of the yaw rate, lateral acceleration, and roll angle and their corresponding times are approximately equal.ere is a slight difference between experiment and simulation in terms of transient response with the stepped input of the same steering wheel angle.
displays the simulation results of the vehicle dynamics model and the results of the prototype vehicle, including the (a) longitudinal and lateral displacement, (b) longitudinal speed, (c) steering wheel angle, (d) yaw rate, and (e) roll rate and lateral velocity.

Figure 11 :
Figure 11: e active set method algorithm.

16
Shock and Vibration by dSPACE such that the AutoBox is equivalent to the "experiment vehicle" that can operate in real time.e information exchange and interconnections between the VCU and dSPACE/AutoBox are realized by the CAN bus.e PC interacts with dSPACE/AutoBox through the ControlDesk test kit for, e.g., adjusting parameters online, displaying the status of the control system and data storage, and tracking the response curve of the process.eabove introduced the construction of the HIL simulation platform.e construction of the test bed mainly concerns the process and theory of building the HIL simulation platform.e completed HIL simulation platform is shown in Figure16.especific experimental process is given below.During the test, the driver inputs the driving intent instructions to the VCU through the A/D interface.e vehicle controller filters and calibrates these signals linearly for the acceleration/brake pedal and steering wheel sensor signals, which are converted into digital signals.Based on these signals and the real-time vehicle status feedback, such as the in-wheel motor working status and the wheel angle of dSPACE/AutoBox, the real-time operation control algorithm is implemented, and control instructions are sent to dSPACE/AutoBox for real-time control.Simultaneously, the AutoBox DS1005 processing board receives the in-wheel motor torque command sent by the VCU and runs the vehicle dynamic simulation model in real time through the real-time control module.e real-time change of the vehicle state value and the in-wheel motor state value are fed back to the monitoring interface of the ControlDesk and PC. e measurement, control, parameter adjustment, and monitoring interface based on the ControlDesk integrated testing software can interact with the vehicle motion parameter signals and driving environment information.edouble-line simulation with a driver-in-loop setup is a classic test condition for vehicle stability testing; this testing type is selected in this paper and sets a constant longitudinal vehicle speed of 100 km/h.e purpose of the high-speed setting is to conduct investigations and evaluate the stability performance of the vehicle.e DYC method based on the hierarchical control structure utilizes the same reference model and upper controller as the ESC.e difference between them is that the DYC method uses the proposed method in Section 3.3.1 in the lower controller, whereas the ESC uses the optimization torque distribution in the lower controller.

Figure 18 :
Figure 18: HIL simulation results: (a) ESC torque distribution of front four wheels; (b) ESC torque distribution of rear four wheels; (c) DYC torque distribution of front four wheels; (d) DYC torque distribution of rear four wheels.

Table 1 :
e basic structure parameters of the 8WIDEV.

Table 2 :
Basic specifications of motor.

)
10 Shock and Vibration where ε u , ε β , and ε ω z are the approaching law constant.e yaw moment is not directly related to the vehicle side slip angle, and therefore, an intermediate variable is constructed.e intermediate control variable is obtained by the following equation: