Keywords

1 Introduction

A self-driving car or an autonomous vehicle has been researching, developing, and becoming a great tendency in the field of automobile manufacturing. Also, the number of people owning them has increased significantly in recent years because it improves comfort, luxury, and especially safety when traveling. In present-day technology, there are many levels of unmanned driving, but to ensure high levels, precise control of the trajectory according to the desired trajectory is still a core issue. Different from some previous approaches focusing on analyzing the development trend [1], planning the trajectory [2], or precisely path following with complicated algorithms [3, 4], this study proposes a simple approach to solve the problem of precise control of the car's trajectory.

In general, this system poses significant challenges to the control as it can also be considered an underactuated system [5, 6] (the system has a smaller number of control signals than the number of controlled state variables [7]). However, there is a difference with other systems [8, 9] where the un-actuated state variables are mainly secondary oscillations arising around the equilibria; all the state variables in the driverless car follow certain trajectories. The first theoretical analysis and practical application of PID were in the field of autopilot systems for ships, developed in the early 20s of the 19th century. It is simple but easy to apply for control and high efficiency. Therefore, it is widely used in industry. In this study, based on the kinematic property of the car that the precise control of the yaw angle will determine the accuracy of the side deflection, we have built a controller with a double loop combining PID controllers. Moreover, the controller parameters are optimized based on the PSO algorithm, first introduced by Kennedy, Eberhart and Shi [10, 11], which reduces the controller design time, improves the control quality, and gives relatively satisfactory results. The control structure and built algorithms have been proposed and investigated for efficiency through simulations given at the end of the paper.

2 Dynamic Model and Control Strategy

In Fig. 1, the main kinematic parameters of an autonomous vehicle operating on the road are given. For the system, the vector of state variables is defined as \({\mathbf{x}} = \left[ {\begin{array}{*{20}c} {x_{1} } & {x_{2} } & {x_{3} } & {x_{4} } \\ \end{array} } \right]^{T} ,\) where \(x_{1}\) and \(x_{2}\) are the yaw angle and the angular velocity of the vehicle; while, \(x_{3}\) and \(x_{4}\) denote the lateral position and velocity, respectively.

The vehicle’s model [12] can be given in a simple form as follows

$${\dot{\mathbf{x}}} = {\mathbf{Ax}} + {\mathbf{Bu}},$$
(1)

where \({\mathbf{A}} = \left[ {\begin{array}{*{20}c} {a_{11} } & 0 & {a_{13} } & 0 \\ 0 & 0 & 1 & 0 \\ {a_{31} } & 0 & {a_{33} } & 0 \\ 1 & {a_{42} } & 0 & 0 \\ \end{array} } \right]\), \({\mathbf{B}} = \left[ {\begin{array}{*{20}c} {b_{1} } \\ 0 \\ {b_{2} } \\ 0 \\ \end{array} } \right]\),

and \(a_{11} = \frac{{ - 2(C_{\beta f} + C_{\beta r} )}}{{mV_{x} }}\), \(a_{13} = - V_{x} - \frac{{ - 2(C_{\beta f} l_{f} + C_{\beta r} l_{r} )}}{{mV_{x} }}\), \(a_{31} = - \frac{{ - 2(C_{\beta f} l_{f} + 2C_{\beta r} l_{r} )}}{{I_{z} V_{x} }},\)

\(a_{33} = - V_{x} - \frac{{ - 2(C_{\beta f} l_{f}^{2} + C_{\beta r} l_{r}^{2} )}}{{I_{z} V_{x} }}\), \(b_{1} = \frac{{2C_{\beta f} }}{m}\), \(b_{3} = \frac{{2C_{\beta f} l_{f} }}{{I_{z} }}\).

Here, \(C_{\beta f}\) and \(C_{\beta r}\) denote the stiffness of the front and rear wheels. \(l_{f}^{{}}\) and \(l_{r}^{{}}\) are the distance from the center of the car to the front and rear wheels. \(V_{x}\) is the velocity of the car. \(I_{z}\) and \(m\) are the moment of inertia and the mass of the car. The system is controlled by the steering angle \(\delta_{f}^{{}}\).

In fact, the lateral position of the vehicle is the function of yaw angle and time. In other words, the precise control of the yaw angle will greatly determine the accuracy of the lateral orbital tracking. Because the nature of the yaw angle change will determine the lateral deflection of the vehicle. Based on the system characteristics, the control strategy is developed as follows.

Fig. 1.
figure 1

Autonomous vehicle

The inner PID control the output signal, \(\chi_{s} \left( t \right)\), can be computed as

$$\chi_{s} \left( t \right) = \lambda_{1a} \sigma_{1} + \lambda_{1b} \dot{\sigma }_{1} + \lambda_{1c} \int {\sigma_{1} d\tau } ,$$
(2)

where \(\sigma_{1} = x_{3} - x_{3T}\) with \(x_{3T}\) being the reference position of the car.\(\lambda_{1a}\), \(\lambda_{1b}\), and \(\lambda_{1c}\) are the controller parameter.

By defining the function \(\sigma_{2} = x_{1} - \chi_{s} = \tilde{\chi }_{s}\), the outer loop PID can be calculated as

$$\delta_{f} \left( t \right) = \lambda_{2a} \sigma_{2} + \lambda_{2b} \dot{\sigma }_{2} + \lambda_{2c} \int {\sigma_{2} d\tau } ,$$
(3)

where \(\lambda_{2a}\), \(\lambda_{2b}\), and \(\lambda_{2c}\) are the controller parameters.

The parameters \(\lambda_{1a}\), \(\lambda_{1b}\), \(\lambda_{1c}\),\(\lambda_{2a}\), \(\lambda_{2b}\), and \(\lambda_{2c}\) are determined by utilizing the PSO method that is proposed in the next section. The over-all control structure with the integration of the PID control and the PSO algorithm is provided in Fig. 2.

Fig. 2.
figure 2

Physical model of a bridge crane

Firstly, the particles adjust their displacement by learning by themselves from their best individual displacements and the best displacement in the global swarm. With considering a problem of minimization with D-dimensional search space, the velocity and displacement are updated by the formula as follows

$$V_{ij}^{t + 1} = \omega V_{ij}^{t} + c_{1} r_{1} \left( {P_{ij}^{t} - X_{ij}^{t} } \right) + c_{2} r_{2} \left( {G_{j}^{t} - X_{ij}^{t} } \right),X_{ij}^{t + 1} = V_{ij}^{t + 1} + X_{ij}^{t} ,$$
(4)

where \(1 \le i \le D\); \(1 \le i \le M\) with \(M\) being the population size; \(\omega\) is the inertia weight to better balance the exploitation and exploration; \(c_{1}\) and \(c_{2}\) are the coefficients of the acceleration; \(r_{1}\) and \(r_{2}\) in the interval (0,1) are the mutually independent random numbers uniformly distributed; \(P_{ij}^{t}\) and \(G_{j}^{t}\) are the best displacement of the particle i and the global optimized displacement in the swam that satisfies the conditions

$$P_{ij}^{t} = \left\{ \begin{gathered} X_{i}^{t} ,\,\,\,\,\,\,if\,\,\,f\left( {X_{i}^{t} } \right) < f\left( {P_{i}^{t} } \right) \hfill \\ P_{i}^{t - 1} ,\,\,\,\,\,\,if\,\,\,f\left( {X_{i}^{t} } \right) \ge f\left( {P_{i}^{t} } \right) \hfill \\ \end{gathered} \right., G_{{}}^{t} = P_{g}^{t} ,\,\,\,\,g = \arg \mathop {\min }\limits_{1 \le i \le M} \left[ {f\left( {P_{i}^{t} } \right)} \right].$$
(5)

3 Numerical Simulation

In Fig. 3, the process of the weight convergence following the iteration. Obviously, the weight is converged in the 6th iteration cycle, with the value being 4819.5. Consequently, the lateral position has been compelled to its desired trajectory, as shown in Fig. 5. This is coinciding and consistent with the lateral orbital tracking error (in Fig. 6) being forced to zero. The control accuracy of the outer loop PID is achieved by the precise of the inner loop PID with the yaw angle tracking error (Fig. 8) or the precise control of the yaw angle is given in Fig. 7. Eventually, the simulated route of the vehicle on the lane is shown in Fig. 4.

Fig. 3.
figure 3

The weight following the iteration

Fig. 4.
figure 4

Vehicle’s position

Fig. 5.
figure 5

Control the lateral position

Fig. 6.
figure 6

Lateral position tracking error

Fig. 7.
figure 7

Control the Yaw Angle

Fig. 8.
figure 8

Yaw angle tracking error

4 Conclusion

The study proposed a control strategy with a combination of PID dual loop structure and PSO algorithm for driverless cars. The dual PID loop is designed based on the kinematic characteristic between yaw angle and lateral position. Meanwhile, PSO is applied to optimize controller parameters to improve control quality and reduce execution time. The simulation results partly confirm the feasibility and effectiveness of the controller, which is the premise for applying to real self-driving car systems.