**2.2 The speed control module**

The aim of this unit is to control the speed of the autonomous electric vehicle using information coming from the image processing unit as speed reference and then, input it to the control unit. The studied traction system is composed of BLDC motor, three phase Mosfets inverter, a gearbox bloc associated with mechanical differential used for speed adaptation for the shaft and the two wheels

**Figure 7.** *Proposed CNN's structure.*

*Advanced Driving Assistance System for an Electric Vehicle Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.98870*

(see **Figure 8**). The traction system can be changed by a single wheel [31] if we don't take in consideration the mechanical differential part.

**Figure 8** shows the control strategy of the AEV using BLDC motor. The feedback signals are the motor speed signal measured by the speed sensor and the rotor's position taken from the three hall sensors. The speed controller unit receive the reference speed signal from the digital processing unit (detected from the trafic speed sign) and the actual speed of the motor (actual vehicle speed). Then, the generated PWM refers to the error between the reference speed and the measured speed as well as the commutation sequence of three hall sensor signals *Hsa*, *Hsb* and *Hsc* (**Figure 9**) in order to control the three phase inverter switches [32].

The three phase inverter consists of six Mosfet switches *Qi*,*i*¼1,*::*,6 and six freewheeling diode as shown in **Figure 10**. Considering that the motor is in clockwise

**Figure 8.**

*Control strategy block diagram of the EV drive system using BLDC motor.*

**Figure 9.** *Hall sensors output signals in a 360 electrical degrees cycle.*

#### **Figure 10.**

*Equivalent circuit of the BLDC motor associated with three-phase inverter.*


#### **Table 1.** *Hall sensors output and the switch state.*

revolution, the state of the six switches (*Sw*1, *Sw*2, *Sw*3, *Sw*4, *Sw*<sup>5</sup> and *Sw*6), depending to the three Hall sensors state (*Has*, *Hsb* and *Hsc*), are shown in **Table 1**.

### *2.2.1 Mathematical model of the studied BLDC motor*

The BLDC motor has three windings coupled in Y-connected on the stator with a permanent magnets rotor with. If we neglect any saturation effects with a constant parameters in the three phase.

The electrical equations of the BLDC motor are described by:

$$
\begin{bmatrix} V\_{as} \\ V\_{bs} \\ V\_{c\varepsilon} \end{bmatrix} = \begin{bmatrix} R\_{\varepsilon} & 0 & 0 \\ 0 & R\_{\varepsilon} & 0 \\ 0 & 0 & R\_{\varepsilon} \end{bmatrix} + \frac{d}{dt} \begin{bmatrix} L\_{aa} & L\_{ab} & L\_{ac} \\ L\_{ba} & L\_{bb} & L\_{bc} \\ L\_{ca} & L\_{cb} & L\_{cc} \end{bmatrix} \begin{bmatrix} i\_{a} \\ i\_{b} \\ i\_{c} \end{bmatrix} + \begin{bmatrix} e\_{a} \\ e\_{b} \\ e\_{c} \end{bmatrix} \tag{2}
$$

Where:


*Advanced Driving Assistance System for an Electric Vehicle Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.98870*


$$\begin{cases} L\_{aa} = L\_{bb} = L\_{cc} = L \\\\ L\_{ab} = L\_{ba} = L\_{ac} = L\_{ca} = L\_{bc} = L\_{cb} = M \end{cases} \tag{3}$$

The state space representation of motor becomes:

$$
\begin{bmatrix} V\_{as} \\ V\_{bs} \\ V\_{c\varepsilon} \\ \end{bmatrix} = \begin{bmatrix} R\_{\varepsilon} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & R\_{\varepsilon} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & R\_{\varepsilon} \\ \end{bmatrix} + \frac{d}{dt} \begin{bmatrix} L & M & M \\ M & L & M \\ M & M & L \\ \end{bmatrix} \begin{bmatrix} i\_{a} \\ i\_{b} \\ i\_{c} \\ i\_{c} \\ \end{bmatrix} + \begin{bmatrix} e\_{a} \\ e\_{b} \\ e\_{c} \\ e\_{c} \\ \end{bmatrix} \tag{4}
$$

In addition, at balanced condition of motor phase, we have:

$$i\_a + i\_b + i\_c = \mathbf{0} \tag{5}$$

and

$$L\_t = L - M\tag{6}$$

so the state space representation is:

$$
\begin{bmatrix} V\_{ds} \\ V\_{bs} \\ V\_{c\epsilon} \\ \end{bmatrix} = \begin{bmatrix} R\_{\epsilon} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & R\_{\epsilon} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & R\_{\epsilon} \end{bmatrix} + \frac{d}{dt} \begin{bmatrix} L\_{\epsilon} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & L\_{\epsilon} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & L\_{\epsilon} \end{bmatrix} \begin{bmatrix} i\_{d} \\ i\_{b} \\ i\_{\epsilon} \end{bmatrix} + \begin{bmatrix} e\_{a} \\ e\_{b} \\ e\_{\epsilon} \end{bmatrix} \tag{7}
$$

The three back EMF (have trapezoidal form) are represented by:

$$\begin{bmatrix} \boldsymbol{\varepsilon}\_{a} \\ \boldsymbol{\varepsilon}\_{b} \\ \boldsymbol{\varepsilon}\_{c} \end{bmatrix} = o\_{m} \boldsymbol{\lambda}\_{m} \begin{bmatrix} \boldsymbol{f}\_{as}(\boldsymbol{\theta}\_{r}) \\ \boldsymbol{f}\_{bs}(\boldsymbol{\theta}\_{r}) \\ \boldsymbol{f}\_{cs}(\boldsymbol{\theta}\_{r}) \end{bmatrix} \tag{8}$$

Where:


#### *2.2.2 Implementation of NARMA-L2 neuro controller for speed regulation*

Many speed controllers have been frequently used in literature, such as PI (proportional integral) and PID (Proportional integral derivative) (PID), given their simple structure, rapid-reaction and reasonable cost. However, they exhibit a slow response when associated with dynamic loads. Recently, intelligent-based


**Table 2.**

*Functions f as*ð Þ *θ<sup>r</sup> , f bs*ð Þ *θ<sup>r</sup> and f cs*ð Þ *θ<sup>r</sup> .*

controller, such as neural networks control (NNC), genetic algorithms and fuzzy logic control, were exploited in the speed control of BLDC [2]. Among these techniques, the neural networks are considered in this chapter, because they are the most suitable to handle the non-linearity of the BLDC system that contains uncertainties. Thus, an intelligent neuronal controller is proposed, based on Nonlinear Auto-regressive Moving Average Level-2 model (NARMA L2).

There are two steps involved in the control process. The first step is the feedback linearization to identify the system to be controlled, while the second step is the training of the system's dynamics. Generally, the NARMA L2 nonlinear description of the system is represented by a discrete-time *nth* order equation (Eq. (9))

$$\begin{aligned} y(k+d) &= f(y(k), y(k-1), \dots y(k-n+1), u(k), u(k-1), \\ &\dots, u(k-n+1)) + g(y(k), y(k-1), \dots y(k-n+1), \\ &u(k), u(k-1), \dots, u(k-n+1)) \, u(k) \end{aligned} \tag{9}$$

Where *u k*ð Þ is the system input, *y k*ð Þ the system output and *d* is the system delay. *f*ð Þ*:* and *g*ð Þ*:* are the additive and the multiplicative non-linear terms respectively, to be approximated in the training step. The **Figure 11** shows the structure of NARMA-L2 Model (**Figure 12**).

**Figure 11.** *NARMA-L2 Model.*

*Advanced Driving Assistance System for an Electric Vehicle Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.98870*


#### **Figure 12.** *Specifications of the plant model.*
