Adaptive LQR Path Tracking Control For 4WS Electric Vehicles Based On Genetic Algorithm
Adaptive LQR Path Tracking Control For 4WS Electric Vehicles Based On Genetic Algorithm
Abstract—The four-wheel steering electric vehicles are errors converge to zero fast. A systematic algebraic approach for
considered as ideal autonomous vehicles, and the linear quadratic selecting the weight matrices of LQR was proposed in [7].
regulator (LQR) is widely adopted in path tracking control. The Nevertheless, manual parameter tuning work will be more
choice of Q and R matrices is an essential problem in LQR design. cumbersome with increased parameters. Therefore, some
However, the weights of the LQR controller are typically designed intelligent algorithms such as differential evolution algorithm
based on empirical methods, which are cumbersome and (DEA) [8], particle swarm optimization (PSO) [9] and ant
inefficient when the scenario changes. This study proposes an colony algorithm (ACA) [10] are used to solve this problem.
adaptive LQR path tracking controller. The parameters of Q and
R matrices are optimized through a new fitness function of the The genetic algorithm (GA) was presented by John Holland
genetic algorithm and form an offline table. Finally, an online [11]. It can use simple coding technology and population
adaptive LQR controller is developed by selecting Q and R reproduction mechanism to describe complex phenomena so as
through looking up the table. The simulation results show the to solve difficult problems. Compared with traditional
effectiveness of the proposed controller in improving tracking optimization algorithms, GA conducts random exploitation of
accuracy and vehicle stability simultaneously. The max lateral the population to find the optimal global solution instead of
acceleration can be limited to 2.65m/s2 with high tracking accuracy searching at a single point, so that it can ensure the global
at low speed. Moreover, it can still track the reference path at high optimality of the solution [12]. In addition, GA directly uses a
speed.
fitness function to evaluate individuals and is also suitable for
Keywords—four-wheel steering, path tracking, linear quadratic
multi-objective optimization problems. Compared with other
regulator, genetic algorithm intelligent algorithms, GA has fast operation speed and group
convergence in different situations [13]. Therefore, we consider
I. INTRODUCTION using GA to determine the parameters of Q and R matrices.
In recent years, driverless technology has been regarded as a Many researchers raised different fitness functions as an
significant way to address traffic congestion and accidents. The essential part of GA design for path tracking. Tracking errors
research of path tracking control on electric vehicles (EVs) is an and their max values were adopted at the sampling time to
essential part. Its development directly affects the safe, stable calculate the total fitness in [14], yet the max values were
and accurate driving of EVs along the predetermined reference variable each time, and the iterations were unfair. The fitness
path [1]. Common control algorithms for path tracking mainly was calculated mixed with the influence of the LQR parameters
include sliding mode control (SMC) [2], model predictive themselves in [15]. Tracking errors and the control input were
control (MPC) [3], robust control [4], etc. Among them, the employed as the fitness function in [16], but neglected the
LQR based on the optimal theory is widely used because of fast influence of dimensions.
convergence, high precision and convenient tuning [5]. It is
easy-to-design and available to a multiple-input multiple-output Based on the literature review, the specific goal of this paper
system. However, most control algorithms of path tracking are is to design GA to improve the parameter selection of the LQR
based on front-wheel steering EVs. In contrast, four-wheel matrices and advance the controller for the path tracking of 4WS
steering (4WS) EVs demonstrate better path tracking EVs. In the “Modeling of 4WS vehicle” section, the vehicle
performance in that they possess four independent steering dynamics model is built, and the four-wheel steering inputs are
motors and steering control degrees of freedom. derived based on the Ackermann geometry. In the “Path tracking
controller design” section, the controller is illustrated based on
The vital problem in designing an LQR controller is to select the discrete path tracking model. In the “Genetic algorithm
the proper weight parameters that impact the control optimization” section, the parameters of LQR is optimized with
performance. Matrices Q and R denote the relative importance GA and a fitness function considering tracking accuracy and
of control errors and energy loss, respectively. Conventionally, vehicle stability is applied for it. Finally, the control algorithm
Q and R matrices are chosen based on the trial-and-error method, is simulated in the double lane change and cosine steering
which is tedious to tune the controller gains iteratively. In [6], maneuvers, and the results are discussed in section V.
the impact of LQR weight matrices on pole positions was
discussed by adjusting a single variable to make the tracking
a
Fyf = -Cf f , f = + vx
- f
b
(1)
Fyr = -Cr r , r = - vx
- r
Fig. 3. Controller framework.
where β and φ represent the side slip angle and the yaw angle,
A. Path Tracking Model
respectively. δf and δr are front and rear wheel steer angles.
The path tracking model is built in Fig. 4, which reveals the
It is commonly supposed that the steering angles of vehicle relationship between the target path and the actual vehicle. In
wheels are minimal for linear system modeling. According to parallel with the vehicle body coordinate frame oxy, the Frenet
Newton’s Second Law, the vehicle lateral dynamics equations frame odxdyd fixed with a projection point denotes the desired
can be written as: vehicle direction at the same X coordinate, and φd expresses the
reference yaw angle. The path tracking problem of the 4WS EV
can be solved by minimizing the perpendicular offset ed and the
mvy + mvx = 2[Cf f + Cr r - Cf + Cr - Cf a - Cr b ]
vx
(2) head error eφ.
Iz = 2[aCf f - bCr r - aCf - bCr - vx
Cf a2 + Cr b2 ]
Authorized licensed use limited to: Shanghai Jiaotong University. Downloaded on February 18,2025 at 12:53:35 UTC from IEEE Xplore. Restrictions apply.
Derived from kinematic geometry, the perpendicular offset B. Feedforward Controller
ed and the head error eφ can be written as: Intending to ensure control accuracy and stability, we utilize
a feedforward controller to decrease the tracking error caused
ed = X⃑ - X⃑d ·y⃑d , e = - d (4) f
by d and d . The control quantities U f = [ f rf ]T should be
selected appropriately to eliminate external error. They are
On the basis of the Frenet formulas, their first-order and
second-order derivatives can be arranged as: calculated as follows:
Authorized licensed use limited to: Shanghai Jiaotong University. Downloaded on February 18,2025 at 12:53:35 UTC from IEEE Xplore. Restrictions apply.
TABLE II. PARAMETERS OF GA becomes smaller and smaller with the increase of generations
Parameter Specification to ensure convergence stability.
Encoding method Real encoding
xg
Variable range (0,500) xnew = 1 - s xold + s ·mut ·xrange , s = 1 - (15)
Population size 80 xgen
Generations 80
Elite count 8 where xg and xgen are the current generation and entire
Crossover fraction 0.8
Mutation fraction 0.1 generations. So s can represent the limited mutation range.
mut is a random factor from 0 to 1, and xrange is the variable
range.
B. GA Optimization Result
To improve the path tracking performance under different
longitudinal velocities conditions, controller parameters are
determined from the offline table. The road adhesion
coefficient is 0.85, and the longitudinal velocity is set at 5m/s,
10m/s, 15m/s, 20m/s and 25m/s, respectively. The 4WS EV is
tested in the typical double lane change (DLC) maneuver,
which can verify both the path tracking performance and the
vehicle stability.
Fig. 6. General GA architecture.
The final values of GA exploration are shown in Table Ⅲ
The fitness calculation determines the evolution direction of after continuous iterations and calculations. Fig. 7 shows that
GA. Considering control accuracy and vehicle stability with the genetic iterations increasing, the fitness value of the
simultaneously, the fitness function F is designed with the path best individual decreases continuously. In addition, the
tracking error, steering angles, the side slip angle, the lateral difference in the fitness value among each population is
acceleration and the yaw rate except for the influence of Q and extraordinarily reduced and tends to be stable in the final
R. Moreover, these variables are divided by the average values generation depicted in Fig. 8.
fixed from one test to eliminate different dimensional effects.
TABLE III. THE FINAL VALUES ABOUT LQR
2 2 2 Longitudinal
tf ed t t f t t r t Q R
F = ln( ∑t = 0 ∑tf= 0 ∑tf= 0 velocity (m/s)
|ed |mean f |r |mean 5 diag[372.62, 6.27, 169.86, 53.65] diag[34.85, 16.43]
mean
10 diag[325.75, 2.57, 151.23, 136.93] diag[10.64, 90.44]
15 diag[344.51, 1.72, 76.21, 169.79] diag[34.69, 29.61]
3 2 2 2 20 diag[58.62, 2.22, 35.77, 43.60] diag[261.61, 314.35]
t ay t t t t t
∑tf= 0 ∑tf= 0 ∑tf= 0 ) (13) 25 diag[14.57, 1.63, 145.93, 91.66] diag[312.51, 196.85]
ay ||mean mean
mean
where xnew is the new variable value as the child, and xold1 and
xold2 are the parents from the selection.
Mutation can prevent GA from converging prematurely and
falling into an optimal local solution, as a supplement after the
crossover is completed. The random mutation method is used
to replace the original individuals, and the mutation range Fig. 8. Population fitness when vx = 15m/s.
Authorized licensed use limited to: Shanghai Jiaotong University. Downloaded on February 18,2025 at 12:53:35 UTC from IEEE Xplore. Restrictions apply.
V. SIMULATION AND ANALYSIS control vector U cannot be too small, and the R weight matrix
should be increased at high speed.
A. DLC Path Tracking Test
Co-simulation is carried out based on the Carsim-Simulink The control design with GA comprehensively considers the
platform to evaluate the control performance optimized with GA, tracking accuracy and vehicle stability, balances the weights of
and a group of reference empirical parameters [18] is chosen to path tracking error and control inputs through selecting the
be compared. The reference weight matrices are given by Q = appropriate matrices of LQR, and avoids tuning the controller
diag[1000, 10, 300, 3] and R = diag[1, 2]. parameters tediously.
Fig. 9 reveals that the max lateral tracking error can be both
limited to 0.04m under the 10m/s longitudinal velocity condition.
However, the tracking control effect is deteriorated by the
reference parameters at high speed, and the absolute mean
lateral tracking error is 2.01m. In contrast, it is 0.05m after GA
optimization, reduced by 97%. Fig. 10 illustrates the vehicle
stability analysis of them. The lateral acceleration resulted from
the reference parameters is extensive, with many abrupt changes
owing to the little R matrix when the longitudinal velocity is
10m/s. The root mean square (RMS) value is 2.78m/s2. By
comparison, it is 1.03m/s2 advanced by the optimized
parameters, decreased by 63%. The state vector X is set with a
greater weight to reduce tracking error. To restrain abrupt
changes caused by the discrete path tracking, the weight of the Fig. 12. Tracking with different longitudinal velocities in cosine path tracking.
Authorized licensed use limited to: Shanghai Jiaotong University. Downloaded on February 18,2025 at 12:53:35 UTC from IEEE Xplore. Restrictions apply.
REFERENCES
[1] E. Yurtsever, J. Lambert, A. Carballo, and K. Takeda, "A survey of
autonomous driving: Common practices and emerging technologies,"
IEEE access, vol. 8, pp. 58443-58469, 2020.
[2] M. Yue, X. Hou, M. Fan, and R. Jia, "Coordinated trajectory tracking
control for an underactuated tractor-trailer vehicle via MPC and SMC
approaches," in 2017 2nd International Conference on Advanced
Robotics and Mechatronics (ICARM), 2017: IEEE, pp. 82-87.
[3] H. Wang, B. Liu, X. Ping, and Q. An, "Path tracking control for
autonomous vehicles based on an improved MPC," IEEE Access, vol. 7,
pp. 161064-161073, 2019.
[4] Z. Yang, J. Huang, D. Yang, and Z. Zhong, "Design and optimization of
robust path tracking control for autonomous vehicles with fuzzy
uncertainty," IEEE Transactions on Fuzzy Systems, 2021.
[5] Q. Yao, Y. Tian, Q. Wang, and S. Wang, "Control strategies on path
tracking for autonomous vehicle: State of the art and future challenges,"
IEEE Access, vol. 8, pp. 161211-161222, 2020.
[6] Z. Fan and H. Chen, "Study on path following control method for
automatic parking system based on LQR," SAE International Journal of
Passenger Cars-Electronic and Electrical Systems, vol. 10, no. 1, pp. 41-
50, 2017.
Fig. 13. Stability analysis in cosine path tracking. [7] E. V. Kumar, J. Jerome, and K. Srikanth, "Algebraic approach for
selecting the weighting matrices of linear quadratic regulator," in 2014
The simulation results are shown in Fig. 12 and Fig. 13. international conference on green computing communication and
Under the different longitudinal velocities, the max lateral electrical engineering (ICGCCEE), 2014: IEEE, pp. 1-6.
tracking errors are 0.04m, 0.05m and 0.16m, respectively. It [8] X. Deng, X. Sun, R. Liu, and W. Wei, "Optimal analysis of the weighted
indicates that the controller optimized with GA still applies to matrices in LQR based on the differential evolution algorithm," in 2017
29th Chinese Control And Decision Conference (CCDC), 2017: IEEE, pp.
some complicated conditions and needs not to be constantly 832-836.
adjusted, which requires a high expenditure of time. Although [9] H. Maghfiroh, M. Nizam, M. Anwar, and A. Ma’Arif, "Improved LQR
the proposed controller can ensure tracking accuracy and vehicle Control Using PSO Optimization and Kalman Filter Estimator," IEEE
stability, the path tracking at high speed is more challenging. Access, vol. 10, pp. 18330-18337, 2022.
The maximum lateral acceleration can exceed 0.5g. [10] G. Chen and J. Liu, "Mobile Robot Path Planning Using Ant Colony
Algorithm and Improved Potential Field Method," Computational
In the future, we will expand the controller's application and Intelligence and Neuroscience, vol. 2019, no. b, pp. 1-10, 2019.
improve the model fidelity on path tracking because of the [11] J. H. Holland, Adaptation in natural and artificial systems: an introductory
limitations of the linear model in extreme maneuvers. analysis with applications to biology, control, and artificial intelligence.
MIT press, 1992.
VI. CONCLUSION [12] S. Arrigoni, F. Braghin, and F. Cheli, "MPC trajectory planner for
autonomous driving solved by genetic algorithm technique," Vehicle
In this paper, a path tracking controller for 4WS EVs is System Dynamics, pp. 1-26, 2021.
designed. The control algorithm consists of the LQR and the
[13] H. Yu, C. Zhao, S. Li, Z. Wang, and Y. Zhang, "Pre-Work for the Birth
feedforward control. Based on the relationship between the of Driver-Less Scraper (LHD) in the Underground Mine: The Path
weight matrix and the control effects, the fitness function can Tracking Control Based on an LQR Controller and Algorithms
guide to tune the parameters of the LQR controller in an efficient Comparison," Sensors, vol. 21, no. 23, p. 7839, 2021.
way. It can be adopted to different scenarios based on the GA [14] Y. Meng, X. Gan, Y. Wang, and Q. Gu, "LQR-GA controller for
technology to solve the problem of parameter adjustment. The articulated dump truck path tracking system," Journal of Shanghai
simulation results reveal that the designed controller has both Jiaotong University (Science), vol. 24, no. 1, pp. 78-85, 2019.
satisfactory path tracking and vehicle stability. The max lateral [15] R. Bhushan, K. Chatterjee, and R. Shankar, "Comparison between GA-
based LQR and conventional LQR control method of DFIG wind energy
tracking error can be limited to 0.04m, and the RMS value of system," in 2016 3rd International Conference on Recent Advances in
lateral acceleration is 1.03m/s2 when the longitudinal velocity is Information Technology (RAIT), 2016: IEEE, pp. 214-219.
10m/s. The RMS value of lateral tracking error is 0.08m under [16] J. Gu and D. Fang, "Genetic Algorithm Based LQR Control for AGV Path
the 20m/s longitudinal velocity condition. Tracking Problem," in Journal of Physics: Conference Series, 2021, vol.
1952, no. 3: IOP Publishing, p. 032012.
ACKNOWLEDGMENT [17] A. E. Eiben and J. E. Smith, Introduction to evolutionary computing.
Springer, 2003.
The paper is supported by Beijing Natural Science
Foundation (3224064), the China Postdoctoral Science [18] P. Hang and X. Chen, "Path tracking control of 4-wheel-steering
autonomous ground vehicles based on linear parameter-varying system
Foundation (2021M701884), and the Shuimu Tsinghua Scholar with experimental verification," Proceedings of the Institution of
Program (2021SM027). Mechanical Engineers, Part I: Journal of Systems and Control
Engineering, vol. 235, no. 3, pp. 411-423, 2020.
Authorized licensed use limited to: Shanghai Jiaotong University. Downloaded on February 18,2025 at 12:53:35 UTC from IEEE Xplore. Restrictions apply.