Dual-loop PID control with PSO algorithm for the active suspension of the electric vehicle driven by in-wheel motor

Using the active suspension system of an electric vehicle driven by two rear in-wheel motors as the research object, a 14-degree of freedom coupled vehicle dynamic model is established. Based on the model, a dual-loop proportion integration differentiation controller based on the particle swarm algorithm is designed to control the active suspension in this paper. The designed controller can not only ease the vibration of the vehicle body from the road surface roughness and the unbalanced electromagnetic force but also can improve the ride comfort of the vehicle. To further verify the effectiveness of the control method, the control effect of the active suspension controller designed in this paper is compared with that of a passive suspension and a dual-loop proportion integration differentiation controller without the particle swarm algorithm. The results show that the vertical vibration acceleration, the roller angle and the pitch angle of the vehicle body are significantly improved with the dual-loop proportion integration differentiation controller based on the particle swarm algorithm. Compared with the passive suspension and the dual-loop proportion integration differentiation controller without the particle swarm algorithm, the improvement ratio of the vertical vibration acceleration is 20.92 % and 11.93 %, respectively; the roll angle improvement ratio can reach 57.23 % and 22.02 %, respectively; and the improvement ratio of the pitch angle is 30.23 % and 18.94 %, respectively. The comparison results show that the dual-loop proportion integration differentiation controller optimized with the particle swarm algorithm can better improve the ride comfort of the vehicle.


Introduction
The vehicle suspension system is a key component of improving the ride comfort and handling stability of vehicles [1].During the running process, the active suspension can produce an expected active control force based on the road condition, movement state, and vehicle load, so that the active suspension is always in the best working condition to improve the ride comfort and handling stability of the vehicle.Therefore, the control of active suspensions is an important development direction in the field of automobile suspension.
Designing the active suspension is the reasonable choice for the control method and strategy.At present, with the development of modern control theory and technology, more and more control methods have been applied to active suspension control, such as proportion integration differentiation (PID) control, optimal control, indistinct control, predictive control, neural network control, etc. [2][3][4][5][6].In these control methods, PID control is widely used because of the simpler structure, stronger robustness and effective control.In [7], a single neuron PID control is used in the control of an active suspension system.In [8], a self-tuning PID controller is designed to control the active suspension.In [9,10], the effectiveness of active suspension with a PID controller and a neural PID controller is verified based on the comparative analysis.The results show that the comprehensive performance of the active suspension controlled by the neural PID controller is better than that controlled by the PID controller.In [11], fuzzy and PID algorithms are combined and used in active suspension control.The results show that the integrated control algorithm is better than a controller with a single control algorithm.In [12], a PID controller with a self-adjusting parameter function is designed to control the active suspension and can improve the vehicle's performance to some extent.In conclusion, the above studies were all designed on the basis of traditional vehicles using a single-loop PID structure to control the active suspension.
However, for the electric vehicle (EV) driven by in-wheel motors (IWMs), the excitation in the vertical direction acted on the vehicle is not only from the road surface roughness (RSR), but also from the electromagnetic force (EMF) produced by the motor magnet gap deformation which is caused by the RSR, uneven load, etc. [13].
Focusing on the issue above, a dual-loop active suspension control structure that is based on the particle swarm optimization (PSO) algorithm and PID control is proposed in this paper.The control structure is applied to the active suspension control of EVs to reduce the shock and the vibration of the vehicle body from the RSR and EMF and to improve the ride comfort of the vehicle.Furthermore, to verify the effectiveness of the control structure proposed in this paper, a passive suspension and a dual-loop PID controller without the PSO algorithm are compared.

Active suspension dynamic model
A rear IWMs drive EV is taken as the research object.The electric wheel structure is the form of direct drive without speed reducer, the detailed structure can be found in [14].Fig. 1 shows the active suspension dynamic model of the whole vehicle.There are 14 degrees of freedom in the dynamic model, including one degree of freedom for the longitudinal movement of the vehicle, three degrees of freedom for the vertical, pitch, and roll movement of the vehicle body, six degrees of freedom for the vertical movement of the unsprung mass, and four degrees of freedom for the rotational movement of the wheels.
The vertical displacement of the join point of vehicle body and the four suspensions can be deduced as: ( Nonlinear of the adaptive suspension has been considered in the model, the nonlinear characteristics of the spring can be expressed as follow [15]: When = 0, the spring is linear.Here, = 0.01.For the damping coefficient, the nonlinear characteristics can be expressed as follow [16]: sgn( ) = 1, ≥ 0, −1, < 0. (5)

Mathematical model of the RSR
For the whole dynamic model with 14 degrees of freedom, four random RSR input signals are required to each wheel.Considering the RSR correlation among the four wheels in the space and time domain, the state equation of the four-wheel RSR input model can be expressed as follows [17]: where: .

Mathematical model of the EMF
The air gap length of the IWM is the function of time .The specific expression is as follows: Transient air gap magnetic flux density is the synthetic magnetic flux density which is caused by the no-load air gap magnetic field generated by the permanent magnet and the armature reaction magnetic field generated by the three-phase stator winding, that is [18][19][20][21]: Based on the Maxwell magnet stress tensor theory, the magnetic force density in the radial and tangential direction in 2-D magnetic field under polar coordinate can be calculated by: Transforming the magnetic force density from the polar coordinates to Cartesian coordinate, the magnetic force density in and direction is: Considering the axial length of the IWM, the forces acting on the direction of and of stator's center can be obtained by the following integral:

Dual-loop PID control structure
Vehicle vibration in the vertical direction can be considered to consist of two parts: a part caused by the RSR and EMF excitation, and another part caused by the inertia of the sprung mass [22].Aiming at these two parts of vibration, the dual-loop PID control structure that is shown in Fig. 2 is adopted to control the active suspension system.According to the control objective of active suspension, the deviation between the expected value and the actual value of the vertical acceleration, the pitch angle, the roll angle, and the suspension dynamic travel of the vehicle body is taken as the PID controller input.
For the inner loop controller, the deviation of the suspension dynamic travel ∆ ( = 1, 2, 3, 4) between the expected and actual value is selected as the input variable of four PID controllers, and the suspension control force ( = , , , ) is selected as the output variable to reduce the vibration caused by the RSR and EMF.
For the outer loop controller, the deviation between the expected and actual values of the vertical acceleration, the pitch angle, and the roll angle of the vehicle body is the PID controller input, and the control force ( , , and ) is selected as the output variable to reduce the vibration caused by the inertia of the sprung mass.According to the mechanical relationship between the vehicle body and suspension, the control force ( , , and ) can be expressed as: By solving the generalized inverse matrix of , the target control force of four suspensions ( = , , , ) can be obtained: Total control force of the suspensions is the superposition from the inner and outer loop controller, which can be expressed as:

Optimization of PID control parameters based on PSO algorithm
For the PID controller, the choice of control parameters , and plays a significant role in the control effect.Generally, the appropriate selection of PID control parameters requires repeated debugs based on the designer's experience; it is difficult to obtain the optimum value.Focusing on the above issue, the PSO algorithm is used in the dual-loop PID control structure to dynamically adjust the control parameters and to meet the optimal control effect.Fig. 3 shows the schematic of the PID controller with a PSO algorithm.
In this paper, the PSO algorithm with inertia weight coefficient is used for the PID parameter self-tuning and optimizing.In this algorithm, the speed and position of the particles can be updated as follows [23][24]: Weight coefficient decides the search ability of the particles in the global and local range.To avoid "oscillating" phenomenon in the global optimal and local optimal solution when particles searching in the solution space, the weighting factor linearly reduces from the maximum to the minimum weighted value in the speed update formula, as shown in Eq. ( 18):

. Optimization objective function
Considering the driving dynamics of the whole vehicle, the vertical acceleration, the lateral angle, the pitch angle and the relative displacement of the IWM are chosen as the control objective.The weighting coefficient method is adopted to transform the multi-objective optimization problem into a single objective optimization problem.Additionally, to conquer the numerous inconsistent problems of the above control objectives, each control variable of the active suspension is divided by the corresponding passive suspension control variable.The optimization objective function is obtained as follows: where ( ), ( ), ( ), ( − ) and ( − ) are the root mean square (RMS) value of the vertical acceleration, the roll angle, the pitch angel, the relative displacement between the stator and rotor of the left rear IWM and right rear IWM of the active suspension.( ), ( ), ( ), ( − ) and ( − ) are the RMS value of the corresponding performance index of the passive suspension.

Constraint condition
Suspension dynamic travel: The allowable limited travel [ ] of the suspension is the maximum compression travel from the balance position of the vehicle body.The suspension dynamic travel and limit travel should be appropriately, otherwise the collision probability between the frame and the axle block will be increased in the driving process.The constraint condition about the suspension dynamic travel can be expressed as: where ( − ), ( − ), ( − ) and ( − ) are the RMS of the left front, the right front, the left rear and the right rear suspension dynamic travel.
Tire dynamic load: To improve the stability and safety of the vehicle, the tire dynamic load should meet the following conditions: where , , ( ) and ( ) are the RMS of the left front, the right front, the left rear and the right rear tire dynamic load.
, and are the RMS of the left front, the right front, the left rear and the right rear tire static load.
According to the structural design requirements of the IWM, the relative displacement of the rotor and the stator should be satisfied with the following conditions: where ( − ) and ( − ) are the RMS of the relative displacement of the left rear and right rear IWMs.

Optimization objective
Based on the optimization control objective and the constraint conditions above, the optimization problem in this study is a minimal design problem with constraint conditions.The optimization control problem can be formulated as:

Simulation and result analysis
Assuming that the vehicle runs on the road of B-class, and the vehicle speed is kept at 20 m/s.For the PSO algorithm, parameter selection is critical for the algorithm efficiency.At present, the selection of the parameters mostly relies on the experience and the test.So far, many researchers have made a body of studies and have gained great achievements on the PSO parameter selection [27][28].Based on the previous works and several tests, the key PSO parameters are set as shown in Table 3.In order to verify the effectiveness of the control structure proposed in this paper, a dual-loop PID controller without the PSO algorithm and a passive suspension are adopted to control the vehicle dynamics at the same conditions.Fig. 6 shows the contrast control results of the vertical acceleration, the lateral angle, the pitch angle and the relative displacement.Here, the weight coefficient of each index in the simulation is: = 0.4, = 0.2, = 0.2, = = 0.1.To make a better comparison over the three control methods, statistical analysis of the above figures are carried out, and the RMS value of each performance indexes is shown in Table 4.As shown in Fig. 6 and Table 4, compared with the passive suspension and the dual-loop PID control without the PSO, the vertical vibration acceleration, the roll angle and the pitch angle of the vehicle body using dual-loop PID control with PSO have significant improvement, and the relative displacement of the IWM rotor and the stator has some improvement.Ratio of the difference between the index's RMS obtained from the passive suspension method (or dual-loop PID control) and the dual-loop PID with PSO control method to the index's RMS obtained from the passive suspension method (or dual-loop PID control) is used to indicate the improving degree of the performance index obtained from the control method proposed in this paper.And the calculation results show that, compared to the passive suspension and the dual-loop PID control without the PSO, the improvement ratio of the vertical vibration acceleration is 20.92 % and 11.93 %, respectively, the roll angle improvement ratio can reach 57.23 % and 22.02 %, respectively, and the improvement ratio of the pitch angle is 30.23 % and 18.94 %, respectively.Therefore, the dual-loop PID controller with PSO designed in this paper has good improvement for the ride comfort of EVs driven by IWMs.The iterative process of the controller is shown in Fig. 7.As shown in Fig. 7, after 32 iteration steps, the iterative search process converged to a stable state, and the objective function value is reduced to 0.7986.The controller developed in this paper has a good convergence.

Conclusions
To reduce the shock and the vibration of the vehicle body caused by the RSR and the EMF, a dual-loop PID control structure with a PSO algorithm is proposed for the active suspension control of EVs driven by IWMs in this paper.Based on this study, some conclusions can be obtained: 1) For EVs driven by IWMs, the excitation in the vertical direction acted on the vehicle is not only from the RSR but also from the EMF produced by the motor magnet gap deformation that is caused by the RSR, uneven load, etc.Therefore, in addition to the excitation of the RSR, the EMF must be considered in active suspension control.
2) Dual-loop PID control is adopted in active suspension control according to the different causes of vibration.For the vibration caused by RSR and EMF, the inner loop PID controller is used to reduce the deviation between the desired and the actual value of the suspension dynamic travel.For the vibration caused by the inertia of the sprung mass, the outer loop PID controller is used to reduce the deviation between the desired and actual values of the vertical acceleration, roll angel, and pitch angle.In addition, the PSO algorithm is adopted to optimize the control parameters of the PID controller to improve the blindness of the PID control parameter adjustment.
3) To verify the effectiveness of the control structure proposed in this paper, a dual-loop PID controller without the PSO algorithm and a passive suspension are adopted to control the vehicle dynamics at the same conditions.Comparative analysis shows that compared with the passive suspension and the dual-loop PID control without the PSO algorithm, the vertical vibration acceleration, the roll angle and the pitch angle of the vehicle body using the dual-loop PID control with the algorithm PSO have significant improvement, and the relative displacement of the IWM rotor and the stator has some improvement.Where, the improvement ratio of the vertical vibration acceleration is 20.92 % and 11.93 %, respectively, the roll angle improvement ratio can reach 57.23 % and 22.02 %, respectively, and the improvement ratio of the pitch angle is 30.23 % and 18.94 %, respectively.In addition, the controller developed in this paper has a good convergence.Therefore, the dual-loop PID controller with the PSO algorithm has good improvement for the ride comfort of EVs driven by IWMs.

FFig. 1 .
Fig. 1. 14-degree of freedom dynamic model Using Newton's Second Law, the mathematical model can be deduced based on Fig. 1:

5 .
-LOOP PID CONTROL WITH PSO ALGORITHM FOR THE ACTIVE SUSPENSION OF THE ELECTRIC VEHICLE DRIVEN BY IN-WHEEL MOTOR.DI TAN, CHAO LU, XUEYI ZHANG a) Nonlinear stiffness characteristic b) Nonlinear damping characteristic Fig. Nonlinear characteristic of the suspension -LOOP PID CONTROL WITH PSO ALGORITHM FOR THE ACTIVE SUSPENSION OF THE ELECTRIC VEHICLE DRIVEN BY IN-WHEEL MOTOR.DI TAN, CHAO LU, XUEYI ZHANG

6 .
displacement of the left rear IWM e) Relative displacement of the right rear IWM Fig.Comparison result of the different control method

Fig. 7 .
Fig. 7.The value of the fitness function in the whole iterative process of the fitness function 2169.DUAL-LOOP PID CONTROL WITH PSO ALGORITHM FOR THE ACTIVE SUSPENSION OF THE ELECTRIC VEHICLE DRIVEN BY IN-WHEEL MOTOR.DI TAN, CHAO LU, XUEYI ZHANG

Table 4 .
RMS value of the performance index using different control method