**1. Introduction**

As a key part of autonomous driving technologies, automatic parking technology can release the human driver from complicated parking procedures and can park more efficiently. Accordingly, automatic parking technology has gained a lot of attention, and the correlative research is increasing [1].

According to the procedures of parking, the research of automatic parking technology has been divided into two major aspects, which include parking slots detection, and parking path planning and tracking. In the aspect of parking slots detection, Huang, C.C. and Wang, S.J. proposed a three-layer Bayesian hierarchical detection framework to detect parking slots [2]. Suhr, J.K. proposed a method based on estimating parallel line pairs so as to detect a parking slot [3], and used a hierarchical tree structure method to recognize various parking slot markings [4]. Yu Cheng proposed an approach for parking slots detection based on video images [5]. Jung, H.G. and Yun, H.L. proposed a method based on target position-designation to mark the parking slot [6]. In another aspect, research on parking path planning and tracking have been developed, for example, Vorobieva, H. proposed a path-planning method based on corresponding geometry and tracking the path with a controller, based on traveled distance [7]. Li, B. and Wang, K. used a simultaneous dynamic optimization method to optimize the maneuver planning [8]. Xu, J. proposed an automatic parking method based on computer vision [9]. Sugeno, M. and Murakami, K. designed fuzzy logical controller rules, based on the experience of human drivers, to park the vehicle [10]. On this foundation, Zhan, Y.N. and Collins, E.G. optimized the membership functions of the fuzzy logical controller by using a genetic algorithm to park the vehicle more efficiently [11]. Yin, Y.A. also improved the fuzzy controller based on images using a genetic algorithm [12].

The fuzzy logical control applied in automatic parking has gained a lot of attention, since Kong, S.G. applied an adaptive fuzzy logical control algorithm to back up a truck-and-trailer in 1992 [13]. Liang, Z. designed an automatic parking path tracking controller based on self-organizing fuzzy control [14]. Xiong, Z.B. proposed an automatic parking algorithm based on the preview fuzzy control [15]. Grzegorzewski, P. proposed an efficient algorithm for checking separability, which can be easily applied in practice [16]. The fuzzy logical control applied in automatic parking becomes the mainstream method, with the advantage of improving robustness against uncertainties and of simulating the nonlinear control of the human driver [17].

However, fuzzy logical control in automatic parking still has some limitations. In reality, the uncertainty of a vehicle's initial position results in the fuzzy logical controller not being able to park the vehicle successfully, for example, if the initial parking position is outside of the range of the effective parking position where the fuzzy logical controller can park the vehicle successfully. The effective parking position depends on the rules of the fuzzy logical controller. In other words, if the fuzzy logical controller is confirmed, the range of the effective parking position will be confirmed. Hence, the confirmed fuzzy logical controller cannot park successfully if the vehicle is outside the range of the effective position.

Our objective is solving this problem (the confirmed fuzzy logical controller cannot park successfully if the vehicle is outside of the range of the effective position) by sliding the mode variable structure control (SMVSC). The SMVSC is insensitive to the disturbance and responds quickly [18], so it is often used to track trajectory [19]. Recently, Yue, M. proposed a method based on a model predictive control (MPC) and SMVSC in order to track the coordinated trajectory of vehicles [20]. The solution can be divided into two steps, with the first step using the SMVSC method drive the vehicle from an initial position to the range of an effective parking position, and the second step parking the vehicle from the effective parking position to the target slot.

In this paper, a method based on the sliding mode variable structure control (SMVSC) and fuzzy logical control is proposed in order to park a car, from an initial position where it is outside the range of an effective position. The procedures can be divided as follows. SMVSC drives the vehicle to the range of the effective position to prepare for parking. Afterwards, the fuzzy logical controller parks the vehicle into the target slot. The results, based on MATLAB, show that the control method combining the SMVSC with fuzzy logical control can realize parking from a random initial position, where it is outside the range of an effective parking position.

In this paper, Section 2 presents an algorithm of SMVSC, to drive the vehicle from a random initial position to the effective position. Section 3 discusses the fuzzy logical controller that is used to park the vehicle from the designated position. Section 4 describes the results of the experiment, based on MATLAB Simulink. The conclusion remarks are presented in Section 5.

#### **2. Algorithm of the Sliding Mode Variable Structure Control**

The vehicle's position and pose in the 2D plane can be defined as (*<sup>x</sup>*, *y*, *<sup>θ</sup>*). As shown in Figure 1, (*<sup>x</sup>*, *y*) are the coordinates of the center point of a vehicle's rear axle, *θ* is the course of the vehicle, *ϕ* is the front-wheel corner, *L* is the wheelbase, and *V* is the speed of the vehicle. The dynamical equations of the vehicle can be expressed in Equation (1), as follows:

$$\begin{cases} \dot{\mathbf{x}} = v \cos \theta \cos \varphi \\\ \dot{\mathbf{y}} = v \sin \theta \cos \varphi \\\ \dot{\theta} = \frac{v}{L} \sin \varphi \end{cases} \tag{1}$$

**Figure 1.** Mode of vehicle.

If *ϕ* is small enough, then cos *ϕ* ≈ 1 and sin *ϕ* ≈ tan *ϕ*; thus, the dynamical equations of the vehicle are shown as follows:

$$\begin{cases} \dot{\mathbf{x}} = \upsilon \cos \theta \\ \dot{y} = \upsilon \sin \theta \\ \dot{\theta} = \frac{\upsilon}{L} \tan \varphi = \omega \end{cases} \tag{2}$$

where *ω* is the yaw rate.

> The dynamical equations in matrix form are governed by the following equations:

$$
\dot{P} = \begin{bmatrix}
\dot{\mathbf{x}} \\
\dot{y} \\
\dot{\theta}
\end{bmatrix} = \begin{bmatrix}
\cos\theta & 0 \\
\sin\theta & 0 \\
0 & 1
\end{bmatrix} \begin{bmatrix}
v \\
\omega
\end{bmatrix} = Jq\_\prime \tag{3}
$$

where *J* = ⎡⎢⎣ cos *θ* 0 sin *θ* 0 0 1 ⎤⎥⎦ and *q* = M *vω* N.

As shown in Figure 2, (*xc*, *yc*, *<sup>θ</sup>c*) is the vehicle's initial position and pose, and (*xr*, *yr*, *<sup>θ</sup>r*) is the vehicle's ideal position and pose. According to the geometric relationship between (*xc*, *yc*, *<sup>θ</sup>c*) and (*xr*, *yr*, *<sup>θ</sup>r*), the error (*xe*, *ye*, *<sup>θ</sup>e*) can be defined as Equation (4), as follows:

$$P\_{\varepsilon} = \begin{bmatrix} \mathbf{x}\_{\varepsilon} \\ \mathbf{y}\_{\varepsilon} \\ \boldsymbol{\theta}\_{\varepsilon} \end{bmatrix} = \begin{bmatrix} \cos \theta\_{\varepsilon} & \sin \theta\_{\varepsilon} & 0 \\ -\sin \theta\_{\varepsilon} & \cos \theta\_{\varepsilon} & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} P\_r - P\_c \end{bmatrix} \tag{4}$$

where *Pr* and *Pc* are ⎡⎢⎣ *xr yr θr* ⎤⎥⎦ and ⎡⎢⎣ *xc yc θc* ⎤⎥⎦, respectively.

According to the derivative of error, Equation (4), and the dynamical equation, Equation (2), the differential equation of error is proposed as Equation (5), as follows:

$$\dot{P}\_{\varepsilon} = \begin{bmatrix} \dot{\mathbf{x}}\_{\varepsilon} \\ \dot{y}\_{\varepsilon} \\ \dot{\theta}\_{\varepsilon} \end{bmatrix} = \begin{bmatrix} y\_{\varepsilon}\omega\_{\varepsilon} - v\_{\varepsilon} + v\_{r}\cos\theta\_{\varepsilon} \\ -\mathbf{x}\_{\varepsilon}\omega\_{\varepsilon} + v\_{r}\sin\theta\_{\varepsilon} \\ \omega\_{r} - \omega\_{\varepsilon} \end{bmatrix} \tag{5}$$

where *vr* and *ωr* are the ideal speed and ideal yaw rate, respectively. *vc* and *ωc* are the current speed and current yaw rate, respectively.

**Figure 2.** Diagram of the error between (*xc*, *yc*, *<sup>θ</sup>c*) and (*xr*, *yr*, *<sup>θ</sup>r*).

It can be pointed out from the above analysis that, according to the numerical values of *Pe*, *vr*, and *ωr*, SMVSC aims to output *vc* and *ωc* to make *Pe* converge to zero.

**Lemma 1.** [21] *If any x* ∈ *R and* |*x*| < <sup>∞</sup>*, then ϕ*(*x*) = *x*sin-tan−1*x*. ≥ 0*, if and only if for x* = 0, then the equality holds.

If *xe* = 0, then the Lyapunov function can be described using Equation (6), as follows:

$$V\_y = \frac{1}{2} y\_c^2 \tag{6}$$

with the hypothesis of *θe* = − tan−<sup>1</sup>(*vrye*), .*Vy* = *ye* .*ye* = *ye*(−*xeωc* + *vr* sin *<sup>θ</sup>e*) = <sup>−</sup>*yexe<sup>ω</sup>c* − *vrye* sin-tan−<sup>1</sup>(*vrye*)., according to the Lemma 1, *vrye* sin-tan−<sup>1</sup>(*vrye*). ≥ 0 (if and only if *vrye* = 0, then the equality holds), hence . *Vy* ≤ 0.

It can be seen that if *xe* converges to zero and *θe* converges to − tan−<sup>1</sup>(*vrye*), then *ye* converges to zero, thus the switching function is designed using Equation (7), as follows:

$$s = \begin{bmatrix} s\_1 \\ s\_2 \end{bmatrix} = \begin{bmatrix} x\_\varepsilon \\ \theta\_\varepsilon + \tan^{-1}(v\_r y\_\varepsilon) \end{bmatrix} \tag{7}$$

We designed a sliding mode controller to let *s*1 and *s*2 converge to zero, which means that *xe* converges to zero and *θe* converges to − tan−<sup>1</sup>(*vrye*) to make *ye* and *θe* converge to zero.

The constant rate reaching law can be expressed as follows:

$$
\dot{s} = -k \text{sgn}(s) \tag{8}
$$

It is unavoidable for the sliding mode control to generate chattering effect, but the chattering effect can be decreased by replacing Equation (8) with Equation (9), as follows:

$$\dot{s} = -k \frac{s}{|s| + \delta} \tag{9}$$

where *δ* is a positive number.

Thus, the constant rate reaching law for Equation (7) can be described using Equation (10), as follows: 

$$\dot{s} = \begin{bmatrix} \dot{s}\_1 \\ \dot{s}\_2 \end{bmatrix} = \begin{bmatrix} -k\_1 \frac{s\_1}{|s\_1| + \delta\_1} \\ -k\_2 \frac{s\_2}{|s\_2| + \delta\_2} \end{bmatrix} \tag{10}$$

Using Equation (5), as well as the derivative of Equations (7) and (10), Equation (11) is obtained, as follows:

$$\dot{s} = \begin{bmatrix} \dot{s}\_1 \\ \dot{s}\_2 \end{bmatrix} = \begin{bmatrix} -k\_1 \frac{s\_1}{|s\_1| + \delta\_1} \\ -k\_2 \frac{s\_2}{|s\_2| + \delta\_2} \end{bmatrix} = \begin{bmatrix} y\_\epsilon \omega\_\epsilon - v\_\epsilon + v\_r \cos \theta\_\epsilon \\ \omega\_r - \omega\_\epsilon + \frac{\partial u}{\partial v\_r} \dot{v}\_r + \frac{\partial u}{\partial y\_\epsilon} (-\mathbf{x}\_t \omega\_\epsilon + v\_r \sin \theta\_\epsilon) \end{bmatrix} \tag{11}$$

where *α* = tan−<sup>1</sup>(*vrye*), *∂α ∂vr* = *ye* <sup>1</sup>+(*vrye*)<sup>2</sup> , *∂α ∂ye* = *vr* <sup>1</sup>+(*vrye*)<sup>2</sup> .

Changing the form of Equation (11), the control law is designed and shown, as follows:

$$q\_{\mathcal{E}} = \begin{bmatrix} v\_{\mathcal{E}} \\ \omega\_{\mathcal{E}} \end{bmatrix} = \begin{bmatrix} y\_{\mathcal{E}}\omega\_{\mathcal{E}} + v\_{\mathcal{V}}\cos\theta\_{\mathcal{E}} + k\_1 \frac{s\_1}{|s\_1| + \delta\_1} \\ \frac{\omega\_{\mathcal{V}} + \frac{\beta\mathbf{a}}{\delta v\_{\mathcal{V}}}\dot{v}\_{\mathcal{V}} + \frac{\beta\mathbf{a}}{\delta y\_{\mathcal{E}}}(v\_{\mathcal{V}}\sin\theta\_{\mathcal{E}}) + k\_2 \frac{s\_2}{|s\_2| + \delta\_2}}{1 + \frac{\beta\mathbf{a}}{\delta y\_{\mathcal{E}}}\mathbf{x}\_{\mathcal{E}}} \end{bmatrix} \tag{12}$$

The function relationship between *ϕ* and *qc* is given by Equation (2), and we changed the form of Equation (2), resulting in Equation (13), as follows:

$$p\_{\mathcal{L}} = \sin \mathbf{x}^{-1} \left(\frac{w\_{\mathcal{L}}L}{v\_{\mathcal{L}}}\right) \tag{13}$$

In this section, the purpose of SMVSC is for driving a vehicle from a random initial position and pose, to the ideal position and pose [22,23]. As shown in Figure 3, (*xr*, *yr*, *<sup>θ</sup>r*) represents the ideal position and pose. *ωr* and *vr* are the ideal yaw rate and ideal speed of the vehicle, respectively. According to Equation (4), by combining the ideal position and pose (*xr*, *yr*, *<sup>θ</sup>r*) with the current position and pose (*xc*, *yc*, *<sup>θ</sup>c*), we defined the error of position and pose (*xe*, *ye*, *<sup>θ</sup>e*), as shown in Figure 2, which is the input of SMVSC. The output of SMVSC, *ωc* and *vc*, which depend on (*xe*, *ye*, *<sup>θ</sup>e*) and *ωr*, *vr*, decide the corner of front wheel, *ϕ<sup>c</sup>*. Lastly, according to *vc* and *ϕ<sup>c</sup>*, SMVSC controls the vehicle.

**Figure 3.** Relationship among variables of the sliding mode variable structure control (SMVSC).

#### **3. Fuzzy Logical Controller**

As shown in Figure 4, *w* is the weight of the parking slot and h is the height of the parking slot. (*<sup>x</sup>*, *y*) are the coordinates of the center point of the vehicle's rear axle, and *θ* is the course of the vehicle. In order to adapt to the different sizes of the parking slot, we replaced (*<sup>x</sup>*, *y*) with (*xa*, *ya*) [24], which is defined by Equation (14), as follows:

$$\begin{cases} \begin{array}{c} \chi\_{a} = \frac{\chi}{w} \\ y\_{a} = \frac{\chi}{h} \end{array} \end{cases} \tag{14}$$

**Figure 4.** Coordinate system and target parking slot.

There are three inputs for the fuzzy logical controller, *xa*, *ya*, and *θ*. The output is the front-wheel corner, *ϕ*. The parking speed is the constant. The diagram of the fuzzy logical controller is shown in Figure 5, as follows:

**Figure 5.** Diagram of the fuzzy logical controller.

The algorithm of the fuzzy logical controller is the Mamdani algorithm [25], and the membership functions are shown in Figures 6–9, the abbreviations in Figures 6–9 are the name of membership function, and the parameters of the membership functions are shown in Table 1.

**Figure 6.** Generated membership function for *xa*.


The parking strategy is described in Figure 10. Leave 2 m between the vehicle and the parking slot. Keep the vehicle in reverse, with the speed of *v* (m/s), until the distance between the extended line of the parking slot line and the tail of the vehicle reach 1 m. Then, let the front-wheel corner, *ϕ*, turn 35◦. When the course of the vehicle, *θ*, reaches 90◦, it returns to *ϕ*.

**Figure 10.** Diagram of the parking strategy.

According to the parking strategy, the fuzzy rules are designed and are shown in Tables 2–5.

**Table 2.** Fuzzy rules when *xa* is S.





**Table 4.** Fuzzy rules when *xa* is P.


There are nine rules in the fuzzy rule base.

Finally, the center average is used in the defuzzifier to calculate *ϕ*.
