Stability-Considered Lane Keeping Control of Commercial Vehicles Based on Improved APF Algorithm

Regarding the lane keeping system, path tracking accuracy and lateral stability at high speeds need to be taken into account especially for commercial vehicles due to the characteristics of larger mass, longer wheelbase and higher mass center. To improve the performance mentioned above comprehensively, the control strategy based on improved artificial potential field (APF) algorithm is proposed. In the paper, time to lane crossing (TLC) is introduced into the potential field function to enhance the accuracy of path tracking, meanwhile the vehicle dynamics parameters including yaw rate and lateral acceleration are chosen as the repulsive force field source. The lane keeping controller based on improved APF algorithm is designed and the stability of the control system is proved based on Lyapunov theory. In addition, adaptive inertial weight particle swarm optimization algorithm (AIWPSO) is applied to optimize the gain of each potential field function. The co-simulation results indicate that the comprehensive evaluation index respecting lane tracking accuracy and lateral stability is reduced remarkably. Finally, the proposed control strategy is verified by the HiL test. It provides a beneficial reference for dynamics control of commercial vehicles and enriches the theoretical development and practical application of artificial potential field method in the field of intelligent driving.


Introduction
With the rapid development of high-level highway networks and modern transportation industry, the traffic accidents of commercial vehicles are obviously increased, among which 20% of traffic accidents are caused by lane departure statistically [1,2].Advanced driver assistance systems (ADAS) have emerged as an efficient way of reducing traffic accidents and improving driving comfort [3][4][5], which is also an inevitable stage in the development of autonomous vehicles (AVs).As an important part of ADAS [6], lane keeping system (LKS) helps drivers to regulate driving direction automatically when lane departure is detected, thus alleviates the driving fatigue and improves the driving safety [7], which attracts more attentions of several researchers.
Path tracking control is one of the most important research aspects of LKS, in which the control aim is to ensure the lane tracking errors such as lateral deviation and course deviation approach to zero [8,9].Many advanced control algorithms have been applied in LKS controller to achieve accurate lane tracking, such as robust control [10,11], model predictive control [12], sliding mode control [13], and fuzzy control [14].Most of the algorithms mentioned above are model-based or deviation-based algorithms.The model-building errors and external input disturbance may affect the control accuracy.On the other hand, especially at high speed, above algorithms cannot function well in the aspect of path tracking due to time delay and the fragility of algorithms themselves in a complex environment.
Artificial potential field (APF) algorithm is favored by many scholars in the area of vehicle dynamics control [15,16] due to its visualized mathematical presentation and strong control ability in complex dynamic environments.Besides, the potential field item can be increased according to the different requirements and the algorithm can be combined with the vehicle dynamics.APF algorithm has been also applied in the lane keeping control by some researchers.In Ref. [17], Rossetter et al. carried out the research about Lyapunov based performance guarantees for the potential field lane-keeping assistance system.In Ref. [18], Wang Qidong et al. proposed a lane keeping control method based on parameter-varying artificial potential field.It can be found from previous researches that the gravitational field is constructed only based on the pre-sight deviation in traditional road artificial potential field algorithm, which leads to long regulation time and poor tracking accuracy in the process of lane keeping for commercial vehicles.In addition, the lateral stability in the lane keeping process is another significant concern.There is no doubt that commercial vehicles are more prone to be instable due to higher center of mass, larger mass and longer wheelbase [19].According to statistics, 20% of commercial vehicle accidents are caused by lateral roll and lateral instability, 66% of which occur during the turning process [20].Therefore, it is of great significance to take above two problems into consideration comprehensively.From this viewpoint, the improved APF controller considering the stability of the commercial vehicle is designed to generate the target front wheel angle, which combines road environment information with vehicle dynamics parameters to deduce improved artificial potential field function.
In the improved artificial potential field function, the time to lane crossing (TLC) and parameters related to vehicle stability such as yaw rate and lateral acceleration are taken as repulsion potential field on the basis of gravitational potential field with the previewing lateral deviation.The improved artificial potential field function is a linear combination of the gravitational potential field and the repulsion potential field.The gains in the potential field function play an important role in system stability and lane keeping performance.In this paper, adaptive inertia weight particle swarm optimization (AIWPSO) algorithm is applied to optimize the gains in the potential field function taking the comprehensive evaluation index including path tracking accuracy and lateral stability as the optimization function, and taking the result of stability demonstration based on Lyapunov methodology as the constraints.AIWPSO algorithm is an improvement of PSO algorithm through adaptive adjustment of inertia weight, which is beneficial to realize rapid convergence of algorithm and improve global search capability [21,22].
The paper is organized as follows.Vehicle dynamics model is constructed in Section 2. The design and stability analysis of lane keeping controller based on improved APF are carried out in Section 3. In Section 4, comprehensive evaluation index is established and the controller parameters are optimized based on AIWPSO algorithm.Simulations and HiL tests are carried out in Section 5 to verify the proposed control strategy based on improved APF algorithm.Followed are the conclusions in the Section 6.

Vehicle Dynamics Modeling
A three-degree-of-freedom (3 DOF) dynamics model of the commercial vehicle is built in this paper as a reference model for the controller as shown in Figure 1.In the model, the front wheel angle δ f is taken as the input variable.β and ω r represent the sideslip angle and yaw rate, respectively.The generalized lateral tire forces are denoted by F xi and F yi (i = 1, 2, 3, 4) , where we have F yf = F y1 + F y2 and F yr = F y3 + F y4 .Accord- ing to the linear tire model, we have Based on parallel axis theorem, the relationship between the roll inertia moment I x and the inertia moment I xeq about the roll axis through the C.G. of the sprung mass m s is described as I xeq = I x + m s h 2 g .To simplify the controller design, it is assumed that sin φ ≈ φ , cos φ ≈ 1 , and β is small enough.Given a vehicle with total mass m , yaw inertia moment I z and roll iner- tia moment I x , the equations of vehicle dynamics are obtained in Eq. (1) [23]: where k f , k r represent cornering stiffness of the front and rear wheel respectively, k is the equivalent roll stiffness of suspension, c is the equivalent damping coefficient of sus- pension, φ is the roll angle, φ is the roll rate, h g refers to the distance from center of mass to roll center.
After transformation, we have the following state-space equation where A , B are coefficient matrix, δ f is the con- trol input variable and state variable is chosen as (1) The coefficient matrix can be given as follows: Considering that the 3-DOF vehicle dynamics model is simplified, in order to verify the accuracy, it is compared with the Trucksim vehicle model under the condition of same input at the speed of 70 km/h.The input is sinusoidal tire angle with amplitude of 2° and frequency of 0.6 rad/s as shown in Figure 2. The outputs are roll angle, yaw rate and lateral acceleration as shown in Figure 3. From the comparison results, it can be seen that the 3-DOF vehicle dynamics model has high accuracy, which meets the requirement of APF controller reference model.

Overall Control Strategy
The improved artificial potential field (APF) algorithm is applied to design the overall control strategy, including improved potential field function construction considering vehicle stability, establishment of comprehensive evaluation index and

Design of the Improved APF Controller
As is presented in Section 2, the vehicle dynamics model can also be described as the following form: with In Eq. ( 3), the first two items M and H are related to the inherent properties of the vehicle, and the last item G 1 is the control item determined by the external inputs, which is mainly composed of driver input item G d and potential field function control item G v , in which the force of potential field is the partial derivative of each potential field with respect to the potential field variable and the direction points to the lane centerline.
When the vehicle is at the centerline, there is no lateral deviation and the potential field function control item has almost no influence on the vehicle which is mainly controlled by the driver input item G d .When the vehi- cle departures, the controller will enable the lane keeping function, which is completely controlled by the potential field function control item G v , namely, G d =0.By substi- tuting the vehicle dynamics model into the potential field function, the target front wheel angle can be obtained by Eq. ( 4).

Establishment of Improved APF Function
As a virtual force method, the basic principle of the artificial potential field method is to construct artificial potential field function and represent the influence of vehicle risk level in the lane environment.Due to the low control accuracy of the traditional road artificial potential field and the instability of commercial vehicles, in this paper, the potential field function is improved on the basis of the traditional road APF, which introduces TLC, yaw rate ω r and lateral acceleration a y into the function to con- struct the virtual repulsion potential field.

Road Artificial Potential Field Function
The road artificial potential field represents risk level of the vehicle in different areas of the lane.The motion direction of the vehicle in the artificial potential field is consistent with the declining direction of the potential field [24,25].
The road artificial potential field takes the lateral deviation of the preview point as the variable of potential field.The schematic of driver's preview is shown in Figure 5.When the vehicle drives, the centerline has certain gravitation on the vehicle by the potential field, and the gravitation force increases with the deviation.The gravitation force is the (4) Diagram of driver's preview largest at the edge of the lane and the gravitation force is 0 at the centerline.The road artificial potential field function designed in this paper is a quadratic function shown in Eq. ( 5): where c 1 is the gain of artificial gravitational potential field function, e is the lateral deviation between the vehi- cle's center of mass and the lane centerline, x cf is the dis- tance from the center of mass to the action point of the potential field force, x la is the preview distance, ϕ is head- ing angle.

TLC Artificial Potential Field Function
Time to lane crossing (TLC) is an important parameter to judge whether the vehicle will deviate the lane.In this paper, TLC is introduced to establish a potential field function shown as follows: with where c 2 is the gain of artificial potential field function of TLC, 1/τ max is the threshold of TLC, which is time-vary- ing with vehicle adjustment time t 1 , vehicle response time t 2 and driver response time t 3 .Due to the complexity of TLC calculation, TLC artificial potential field function is simplified and the control variable regarding TLC artificial potential field is given in Eq. (7) to facilitate the stability proof:

Yaw Rate Artificial Potential Field Function
In this paper, yaw rate is introduced into the artificial potential field.The limit of yaw rate ω µ under the condi- tion of critical instability is the potential field source to construct the repulsion field.The artificial potential field function of yaw rate is shown in Eq. ( 8): (5) with where c 3 is the gain of artificial potential field function of yaw rate, ω r is the yaw rate, ω µ is the limit of yaw rate, µ is the road adhesion coefficient.

Lateral Acceleration Artificial Potential Field Function
It is known that the front wheel angle has great influence on the lateral acceleration, and sharp variation of front wheel angle is likely to result in the vehicle rollover [26].The lateral acceleration, in this paper, is introduced into the artificial potential field to avoid the vehicle rollover resulted from excessive lateral acceleration.The maximum lateral acceleration of critical rollover is the potential field source to construct the repulsion field.The artificial potential field function of lateral acceleration is presented in Eq. ( 9): where c 4 is the gain of artificial potential field function of lateral acceleration, a y max is the maximum lateral accel- eration of critical rollover.

Lane Keeping Controller Based on APF
Combining the artificial potential field functions mentioned above, the general artificial potential field function is presented in Eq. ( 10): The output of lane keeping controller is shown in Eq. ( 11): (8) V (11) ∂V ay a y ) + δ TLC .

Lyapunov-Based Proof of Controller Stability
Lyapunov function for the control system shown in Eqs. ( 12) and ( 13) is constructed by the vehicle's kinetic energy and a new potential energy-like term [27]: with where T 1 is vehicle's kinetic energy of three free degrees of lateral, yaw and roll.
Because TLC potential field function is simplified and integrated into the controller directly, it can be ignored in the stability proof.Therefore, the new potential energylike term is constructed in Eq. ( 14): where V ela1 is reconstructed as Eq. ( 15): In order to implement the system stability proof, the following criteria need to be met: Criteria I: L > 0, Criteria II: L ≤ 0.
The criteria I can be demonstrated by verifying that the kinetic energy and potential energy are both positive.It is obvious that the kinetic energy T , potential energy items V ωr and V ay are positive if only c 3 and c 4 are positive.It needs to be checked whether the potential energy item V ela1 is positive.Converted into the matrix format, V ela1 is given by V ela1 =q T 0 V n q 0 , where q 0 = e ϕ T and the matrix V n is presented as follows: Based on Sylvester's theorem, a necessary and sufficient condition for a matrix to be positive definite is for all the principal minors to be strictly positive, so |V n | > 0 only if x cf x la > 0 .By definition the condition must be met when c 3 and c 4 are more than 0.
To meet Criteria II the derivative of Eq. ( 12) needs to be obtained.L is divided into Ṫ1 + Vela1 and Vωr + Vay to be proved respectively as is shown in Eq. ( 16): (12 with Combining with 3-DOF vehicle dynamics model, after arrangement, Eq. ( 17) can be obtained: The above equation is transformed into a matrix form as shown in Eq. ( 18): where q 1 = v y ω r φ ϕ φ T and matrix P is given as: with Only when the matrix P is proved to be nonnega- tive definite, in other words, the determinants of every order sequential principal minors are not less than 0, LT 1 +ela ≤ 0 can be met.Owing to ς p11 is greater than 0, namely the determinant of first order sequential principal minor is greater than 0. After the calculation, it can be found that the determinants of second and third Ṫ1 + Vela1 =mv y vy + I z ω r ωr + I x φ φ − 2c 1 x la ϕ 2 v x − 2c 1 x la ϕv y . ( Tang et al.Chinese Journal of Mechanical Engineering (2024) 37: 19 order sequential principal minors are both greater than 0 shown as follows: The determinant of the fourth order sequential principal minor is shown as follows: The range of c 1 can be obtained from Eq. ( 21): The sum of yaw rate and lateral acceleration artificial potential field is shown in Eq. ( 22): Given the variables are in the denominator and ω r /ω µ ≤ 1 , the Taylor expansions are conducted for two terms shown in Eq. ( 23): The derivative of V ωr and V ay can be given by Eq. ( 24): After arrangement, the sum of the derivative of V ωr and V ay can be obtained and be converted into matrix form as: where q 2 = vy ω r v y φ φ 1 T and the matrix Q is given as: V ωr + V ay =c 3 (

(25)
Vωr + Vay = −q T 2 Qq 2 , As long as the matrix Q is positive definite, Vωr + Vay will be less than 0. According to the form of matrix Q, it can be seen that the positive definite of matrix Q can be proved only by the first and second order sequential principal minor.
Just need to meet following conditions: To sum up, the Lyapunov stability of the control system is demonstrated under the conditions shown in Eq. ( 27) which are used for the constraints of controller parameters optimization:

Comprehensive Evaluation Index of Lane Keeping Control System
To evaluate the performance of lane keeping control system mentioned in this paper, a comprehensive evaluation index including path tracking accuracy and lateral stability is established.The evaluation index of path tracking accuracy includes lateral deviation index and course deviation index.The evaluation index of lateral stability is consisted of the evaluation index of vehicle sideslip risk and the evaluation index of vehicle rollover risk [28,29].The evaluation indexes representing path tracking accuracy are given by the following expressions: , where J e is the lateral deviation index, J ϕ is the course deviation index, f (t) is the desired trajectory, y(t) is the actual trajectory, E * is the standard threshold of trajec- tory error, t n is the test time, ϕ(t) is the actual course angle, ϕ * is the standard threshold of course angle deviation.
The evaluation indexes about lateral stability are given as follows.
where J φ is the evaluation index of vehicle rollover risk, φ(t) is the roll angle, φ is the standard threshold value of vehicle rollover risk, J c is the evaluation index of vehicle sideslip risk, J cf is the evaluation index of sideslip risk of vehicle front axle, J cr is the evaluation index of side- slip risk of vehicle rear axle, F ZAf (t) is the lateral force on the front axle of vehicle, F ZAr (t) is the lateral force on the rear axle of vehicle, G ZAf (t) is the load on the front axle of vehicle, G ZAr (t) is the load on the rear axle of vehicle, µ * is the standard threshold value of vehicle sideslip risk.
Combining with Eq. ( 28) -Eq.( 33), the comprehensive evaluation index of lane keeping control system is given by following expression: where w e is the weight coefficient of J e , w ϕ is the weight coefficient of J ϕ , w ϕ is the weight coefficient of J ϕ , w c is the weight coefficient of J c .The weight coefficients of the above evaluation indexes are obtained by entropy weight method [30,31] which determines the index weight coefficients according to the amount of information provided by the observed values of each sub-index, with a sample size of 100 groups.The data source of evaluation index is to select 100 different parameter combinations by sampling different gains of potential field function and substituting them into the simulation model.Evaluation index data is obtained by Trucksim and Simulink cosimulation.The weight coefficients are calculated by Eq. ( 35) and Eq. ( 36) and the results are shown in Table 1. (30)

.2 Parameters Optimization Based on AIWPSO Algorithm
In order to obtain the optimal controller parameters, the optimization based on AIWPSO algorithm is carried out in which the comprehensive evaluation index and the range of controller parameters are taken as fitness function and optimization constraints respectively.Compared with PSO algorithm, AIWPSO algorithm has both global and local particle swarm search capabilities due to the adaptive inertia weight w with the environment as shown in Eq. (37): where w max and w min represent the maximum and mini- mum value of the inertia weight, f avg and f min represent the average and minimum fitness value of all current particles.In the algorithm, population size is set as 100 and the number of iterations is set as 100.The optimization iteration result is shown in Figure 6 in which Y-axis represents the fitness value and X-axis represents the number of iterations.By comparison, it is obvious that the convergence rate of AIWPSO is faster than that of PSO and the AIWPSO algorithm gets smaller fitness value.The optimal parameters based on AIWPSO algorithm are shown in Table 2.

Simulation Analysis of the Control Strategy
In order to verify the improved APF algorithm in lane keeping control of commercial vehicle, simulations on the Trucksim-Simulink platform are conducted under (35) straight road condition and double lane change condition with initial deviation.The vehicle parameters are shown in Table 3.The straight road condition with initial deviation is applied to validate the deviation correction ability of control algorithm.The double lane change condition including straight road and curve road is used to verify the path tracking effect and lateral stability under comprehensive road condition.Besides, the control effect of the improved APF algorithm is compared with the single point pre-sighting driver model and traditional road APF algorithm.
Case 1: Lane keeping control simulation is conducted under straight road condition at the speed of 70 km/h.The initial lateral deviation is set as 0.5 m.The results are shown in Figure 7.
From the figures, it can be seen that the control effect under the improved APF algorithm is generally better than the single point pre-sighting driver model and the road APF algorithm.In Figure 7(a), the average lateral deviation under the improved APF algorithm is reduced by 14.46% and 20.85% respectively compared with the single point pre-sighting driver model and the road APF algorithm at the speed of 70 km/h.The peak overshoot of lateral deviation under the improved APF algorithm is 22.78% and 65.99% lower than the single point pre-sighting driver model and the road APF algorithm respectively.In Figure 7(b), the average course deviation under the improved APF algorithm is reduced by 22.77% and 31.62% by comparison respectively.It can be also found the course deviation under the improved APF algorithm achieves fast convergence to zero smoothly with smaller overshoot.
Case 2: Lane keeping control simulation is carried out under double lane change condition at the speed of 70 km/h.The path of double lane change condition is shown in Figure 8 and the results are shown in Figure 9.
Under double lane change condition, four indicators are utilized to demonstrate the control effect of the improved APF algorithm, among which lateral deviation and course deviation represent the path tracking accuracy, yaw rate and roll angle represent the lateral stability of the vehicle.Among the three algorithms mentioned above, as shown in Figure 9, the fluctuating range of the indicators is largest under the road APF algorithm, which shows that the road APF algorithm may not meet the requirement of lane keeping control of commercial vehicles.The road APF algorithm only contains gravitational field based on the pre-sight deviation without considering repulsion field and vehicle dynamics constrains, which leads to low tracking accuracy and poor lateral stability in the process of lane keeping for commercial vehicles.In detail, in Figure 9(a), (b), the average lateral deviation under the improved APF algorithm is reduced by 21.27%

Experiment Verification of the Control Strategy
In order to verify the effectiveness of lane keeping control strategy based on the improved APF in the actual controller, the hardware in the loop (HiL) test for the proposed control strategy is carried out.The overall schematic diagram of HiL test is shown in Figure 10.
In the HiL test, the actual controller is connected to the virtual controlled model by communication card, which not only reduces the development cycle of electromechanical products, but also reduces the interference of some unnecessary factors on the control effect.The hardware of the HiL test platform is consisted of the upper computer, the simulator and D2P controller.The software system of the HiL test platform mainly includes controlled object model, control model and upper computer  The test is implemented under the double lane change condition at the speed of 70 km/h.The HiL test results are shown in Figure 11.
Figure 11 shows the comparison of lane keeping control effect between simulation and HiL test under double lane change condition.In Figure 11(a), (b), it can be seen from the HiL test results, the lateral deviation increases to a certain extent, and the heading angle is adjusted when the vehicle completes the second large angle steering, but the driving path is basically the same with that in  Although the peak value has a certain increase, the increase range is small, and it does not exceed the stability limit, so as to ensure that it is not in the instable state.
In general, there are some differences between the HiL test results and simulation results in part which results from the delay and discrete setting of HiL test environment, and the control is continuous in the simulation while discretization preprocessing is required in HiL test.In addition, the running carrier of HIL test is different from that of simulation.The differences are yet within the reasonable range and the trend of the observed variables in HiL test is basically consistent with that in the simulation, which reflects the effectiveness and feasibility of the commercial vehicle lane keeping control based on the improved APF algorithm in the actual controller significantly.

Conclusions
The improved APF control algorithm is proposed for the lane keeping system in the commercial vehicle to achieve better path tracking accuracy and the lateral stability.Main conclusions are drawn as follows.From the results, it can be seen that the accuracy of path tracking is improved by introducing the TLC potential field.In terms of lateral stability, the introduction of yaw rate and lateral acceleration as repulsive force field not only guarantees the path tracking accuracy, but also improves the lateral stability especially under the condition of sharp corner.(4) This paper only considers the lateral control of the vehicle during the path tracking.In the future, we shall put more efforts in the coordination of the lateral and longitudinal control to improve the control effect of the lane keeping system especially under severe conditions.
based on adaptive inertia weight particle swarm optimization (AIWPSO) algorithm.The time to lane crossing (TLC) is taken as the source of repulsive force field, which increases the potential field constraint.The yaw rate and lateral acceleration are introduced to improve the driving stability of the commercial vehicle.A comprehensive evaluation index is established including evaluation indexes of lateral deviation, course deviation, vehicle sideslip risk and vehicle rollover risk.The comprehensive evaluation index is taken as the optimization function to optimize parameters of the controller.The overall control schematic diagram is shown in

Figure 1 3 -Figure 2 Figure 3 Figure 4
Figure 1 3-DOF dynamics model of the commercial vehicle

Figure 4 .
Figure 4.The controller outputs the target front wheel angle and the electro-hydraulic hybrid power steering (EHHPS) system implements the tracking of the target front wheel angle.From the steering system, the real front wheel angle is transmitted to the vehicle model in Trucksim software.The vehicle dynamics parameters and lane line information from the vehicle model are the inputs of the potential field function in the lane keeping controller and then a closed-loop lane keeping control is carried out.

Figure 6
Figure 6 Optimization convergence curve

Figure 7 Figure 8
Figure 7 Lane keeping deviation under straight road condition at the speed of 70 km/h

Figure 9
Figure 9 Comparison of control effect under double lane change condition at the speed of 70 km/h

( 1 )
In this paper, the dynamics model of vehicle in MATLAB/Simulink is constructed and verified by the comparison with Trucksim vehicle model.TLC, yaw rate and lateral acceleration are introduced into the traditional road artificial field function to establish the improved artificial field function.(2) The stability of the improved APF control system is proved based on Lyapunov theory and the ranges of the controller parameters are determined.Comprehensive evaluation index is established and the controller parameters are optimized based on AIWPSO algorithm.(3) The simulations and HiL tests are carried out.

Figure 10
Figure 10 Schematic diagram of HiL test

Figure 11
Figure 11 Comparison of HiL test results with simulation results: (a) Lateral deviation, (b) Course deviation, (c) Yaw rate, (d) Roll angle

Table 1
Weight coefficient of each evaluation index

Table 2
Controller parameters after optimization

Table 3
Vehicle parameters