Fuzzy Logic Method for the Speed Estimation in All-Wheel Drive Electric Racing Vehicles

Resume This paper presents a method for the vehicle speed estimation with a Fuzzy Logic based algorithm. The algorithm acquires the measurements of the yaw rate, steering angle, wheel velocities and exploits a set of five Fuzzy Logics dedicated to different driving conditions. The technique estimates the speed exploiting a weighted average of the contributions provided by the longitudinal acceleration and the credibility assigned by the Fuzzy Logics to the measurements of the wheels’ speed. The method is experimentally evaluated on an all-wheel drive electric racing vehicle and is valid for the front and rear wheel drive configurations. The experimental validation is performed by comparing the obtained estimation with the result of computing the speed as the average of the linear velocity of the four wheels. A comparison to the integral of the vehicle acceleration over time is reported. on weighting coefficients produced by an FL. These coefficients allow evaluating the credibility of the measured values of the Five different are adopted, corresponding to five conditions, detected by a dedicated routine based on the longitudinal acceleration. The method was validated experimentally on an AWD electric racing in the case of different driving conditions and extreme maneuvers. The effectiveness of the was demonstrated by comparing the results to the output of an algorithm already deployed on the electronic control unit of the car, computing the speed as the average of velocities of the four wheels. A further comparison to the integral of the acceleration of the vehicle was presented.


ISSN 1335-4205 (print version) ISSN 2585-7878 (online version)
with tall buildings. Moreover, the latency of these devices can be in the order of magnitude of seconds and the sensing may be inaccurate due to the unavailability of the satellites signal [6]. These drawbacks discourage the employment of these solutions and induce to investigating alternative techniques based on the indirect measurement and estimation of the speed. A common method allows achieving this objective by computing the vehicle speed as the average of the linear velocity of the wheels. However, this simple approach may be strongly inaccurate when one or more wheels are locking or skidding during the extreme maneuvers, which is a common condition for racing vehicles and in the case of dirty asphalt, as well as icy or wet roads. On the other hand, model-based and filter/observer-based methods have been also investigated [7], such as nonlinear observers [8], Kalman Filter (KF) [9][10], Adaptive KF (AKF) [11][12], Extended KF (EKF) [13][14], and Unscented Kalman Filter (UKF) [15][16]. Although effective, these methods may suffer severe inaccuracies due to unmodeled dynamics or when the reference model is not tuned to represent all the driving conditions and possible vehicle setups and tuning, which can be a frequent situation when dealing with the high-performance or racing vehicles. To avoid the dependency of the vehicle model, adopting the artificial intelligence, such as Artificial Neural Networks (ANNs) [17][18][19][20][21], represents a possibility. Nevertheless, these solutions are strongly dependent on the network architecture and training datasets, which must include all the possible driving maneuvers and road

Introduction
In the last years, the automotive industry is experiencing a wide technological innovation involving several aspects. Modern cars are equipped with active driver assistance systems and intelligent algorithms allowing the design of more efficient, less polluting and safer vehicles [1]. Many of the recent solutions rely on electro-mechanical subsystems exploiting sensors, actuators and feedback control. In this context, an important enabling role is played by the latest development in the computer technology, control systems, microelectronics and artificial intelligence, which are strongly promoting the current trend of innovation [2][3]. For most of these solutions, a complete and robust real-time assessment of the vehicle dynamics is required [4]. Specifically, the estimation of the vehicle speed is a task that is considered pivotal for the vehicle's active control systems, especially when dealing with racing vehicles, which are characterized by extreme performances in terms of longitudinal and lateral dynamics. However, the direct measurement of this parameter may require an expensive and cumbersome instrumentation that, in most of the cases, cannot be adopted for the large scale production. A solution is the adoption of optical sensors, that are not used in series production cars because of their prohibitive costs, low robustness, and high sensitivity to the environmental conditions [5]. A feasible alternative is represented by the GPS-based sensors that, however, may suffer signal latency and are not effective in tunnels or in urban environments B118 B O N F I T T O e t a l .
estimation, based on the combination of five FLs, is proposed. The method is designed and experimentally validated for an instrumented All-Wheel Drive (AWD) electric racing vehicle, which has competed in the 2018 Formula Student events. The estimation is based on the computation of the weighted average of the wheel velocities and of the contribution given by the longitudinal acceleration. This average exploits the outputs of the FL block, which are four coefficients indicating the reliability of the measured speed of the four wheels and a coefficient related to the acceleration of a vehicle. The FL block is composed of five different logics dedicated to five driving conditions: acceleration, strong acceleration, braking, strong braking and coasting. An external routine allows identifying the driving condition and selecting the corresponding FL. The technique is validated experimentally by deploying the algorithm on the vehicle's ECU and comparing it to another solution computing the vehicle speed as the average of the linear velocity of the four wheels. The integral of the vehicle acceleration over time is also considered in the validation as an additional reference for evaluation of the estimation accuracy. The system was not compared to a direct measurement of velocity due to the excessive costs of the needed sensors. The main contribution of the paper is the proposal of an FL-based technique considering different driving conditions and therefore, reliable also in the case of locking and spinning of the wheels. This is made possible by the contribution of the vehicle acceleration, which is included in the speed estimation algorithm. The technique is designed for an AWD vehicle and consequently, it is valid also for other traction architectures. The layout is based on an one-stage estimation task and does not require additional enabling conditions to compute a sufficiently accurate estimation [22]. A promising approach is represented by the adoption of Fuzzy Logic (FL), that is well known in the literature to tackle control and estimation tasks in automotive engineering [23][24]. This approach is based on experience of a designer in representation of the system behavior by means of linguistic definitions. When designing an FL-based system, different layouts and processing task definitions are possible. A solution exploiting a FL to support the electronic stability control system of a light-duty pickup truck is presented in [25]. It is based on an analysis of velocity of the four wheels and exploits the FL to evaluate the reliability of these values in acceleration, braking and sliding conditions. This solution lacks accuracy since the contribution of acceleration is not included in the speed estimation and this is the cause of poor results in the case of full locking or spinning condition. A method for the speed estimation of a front wheel drive (FWD) vehicle is presented in [26]. The solution exploits two FLs to identify two classes of driving condition: a) loss of contact while cornering and b) a set composed of oversteering, front wheel sliding out and lateral sliding. This information is provided to a further FL, which estimates the vehicle speed. This method can only be applied in the case of FWD vehicles and is based on a two-stage estimation task. A combination of the FL with a state variable filter is presented in [27] for a fourwheel (4WD) drive vehicle. This technique is validated in the case of velocities that are lower than 5 km/h and in simulation only. Finally, a method based on a single stage FL is reported in [28], which does not consider different driving conditions and is not validated in the case of locking and spinning conditions.
In this paper, a method for the vehicle speed  Table 1 B119 principal directions (x, y, and z) and yaw rate r, featuring a sensitivity of 0.01 g and 0.1 deg/s, respectively. Moreover, the adopted IMU is equipped with a designed 15 Hz lowpass filter allowing to filter the measurement noise. The adopted control platform is a dSPACE MicroAutobox II, supplied with an IBM PPC 750GL-900 MHz processor and with a Real-Time Interface library block-set allowing to implement the vehicle controller developed in the MATLAB/ Simulink environment.

Layout of the estimation method
The overall layout of the velocity estimator is shown in Figure 2. The estimator is divided in two parts: a) preprocessing block and b) FL-based system.
The inputs of the algorithm are: the rotational wheels speed (n fl , n fr , n rl , n rr ), yaw rate of a vehicle γ, steering angle of the front wheels w d and longitudinal acceleration a x . Additional inputs are the vehicle track width t and the geometric distance of the front and rear axles with respect to the COG (a and b in Figure 1 and Table 1, respectively). Further details of the inputs are presented in Table 2.
A driving condition selection block is fed with the measurement of the longitudinal acceleration and allows identifying five different conditions: strong braking, braking, coasting, acceleration, and strong acceleration. These are classified considering the longitudinal acceleration range definition given in Table 3.
The pre-processing phase consists of the two blocks: a) wheel speed processing and b) FL input computation. In the first task, the rotational velocities of the four wheels are transformed into linear velocity S fl , S fr , S rl , S rr , and then transposed into the vehicle COG CG reference frame, by means of the following set of kinematic expressions: processing routines. The presented experimental validation allows demonstrating the effectiveness in different driving conditions and in the case of demanding maneuvers. Figure 1 shows the lateral (a) and upper view (b) of the racing vehicle that is used for the study. The vehicle is compliant with the Electric Formula Student Germany (FSG) regulation for the year 2018 [29]. It features an integral carbon fiber chassis built with honeycomb panels, double wishbone push-rod suspensions, an on-wheel planetary transmission system and an aerodynamic package, which can generate about 630 N of downforce at 60 km/h. The height of the vehicle Centre of Gravity (COG) is located at 0.245 m. Four synchronous electric servo-motors AMK DD5-14-10 are installed on the vehicle wheels. The electric motors are characterized by a peak torque of 21 Nm and a maximum speed of 20000 rpm and are customized for the racing purpose.

Description of the vehicle
The vehicle features a 0 to 100 km/h acceleration in 2.76 s and a maximum velocity equal to 120 km/h. It is also able to reach accelerations close to 2 g and 1.6 g in the lateral and longitudinal direction, respectively. The vehicle battery pack has a nominal voltage equal to 600 V and it can store energy up to 7.78 kWh. Table 1 reports a list of the vehicle characteristics.
The input signals are obtained by direct measurements acquired at a frequency of 100 Hz. Specifically, digital encoders integrated in the motors provide the measurements of the wheels' velocity, a Hall effect sensor integrated in the steering rack measures the wheel steering position w d and an Inertial Measurement Unit (IMU) Bosch MM5.10, which is mounted close the vehicle COG, is used to obtain both the measurements of the accelerations in the three

B120
B O N F I T T O e t a l .
Then, the maximum deviation between the faster and the slower tire-ground contact patch velocity is computed, using the following relation: where i = {front, rear} and j = {left, right}.
Here Sij T and Smax T are selected as inputs of the Fuzzy Logic because they contain information about the status of the wheels. i.e. normal grip, skidding, locking, spinning. In particular, Smax T allows detecting the occurrence of limit conditions in at least one wheel and the Sij T allows identifying the status of each wheel.
where n fl , n fr , n rl , n rr are the angular speeds of each wheel, R w is the wheel radius, x is the transmission ratio. In this computation, since the sideslip angle ranges from -15° to 15°, it can be neglected with minor effects [30].
In the second task, the difference between the tireground contact patch and the vehicle velocity at the previous instant is computed for each wheel as:  where k fl , k fr , k rl , k rr , k ax are the outputs of the five FLs. These coefficients express the level of credibility of the measured represented in Figure 3. The first stage is the fuzzification, which converts the input measured variables, that are discretized through the adoption of membership functions, in linguistic variables. The output of this block is provided to the inference motor. This block also receives the rule base, which is defined on the basis of the designer experience. Finally, the output of the inference motor is processed by the defuzzification block by means of the The integration time T s is equal to the sampling time of the estimation algorithm (0.01 s).

Fuzzy logic design
The overall layout of the designed FL-based system is based on the classical architecture of a Fuzzy Logic wheels speed, although the reliability coefficient of all the four wheels is still the same.
Since the design of the rule base is conducted on a 4WD architecture, it is valid also for other types of vehicle's drivetrain. As a matter of fact, it is well known that the 4WD vehicle is the most critical configuration, since each wheel can spin or be locked, at any time. The rules for all the considered driving conditions (FL1, FL2, FL3, FL4 and FL5) are listed in Table 4, Table 5 and Table 6 for the strong braking and strong acceleration, braking and acceleration and coasting, respectively.
The output membership functions allow performing the defuzzification process and are defined with triangular functions on three levels (S, M, B), as represented in Figure  5. The selected defuzzification method is the centroid algorithm [31].

Results and discussion
The algorithm performance has been evaluated experimentally by comparing the speed estimated by the proposed technique to that obtained by a method based on the average of the speed of the four wheels. The latter is a common algorithm in many passenger vehicles and, in this study, it was already deployed on the electronic control unit of the car. The integral of the vehicle longitudinal acceleration is taken as the reference condition for both cases. In this case, possible error drifts, caused by the integral computation, are limited by resetting the integral accumulation when all the four wheels are rotating at the same speed and the steering angle is zero. In this condition, the tires are supposed to be within the adhesion limits and, consequently, the velocity of the wheels contact patch is equal to the velocity of the vehicle. This method allows obtaining a sufficiently reliable reference value. A comparison to a direct measurement of the speed is not provided in this work due to the high costs of the needed sensor. Figure 6 shows results of the first test, which is aimed to evaluate the estimation accuracy in the case of high values of longitudinal accelerations and braking. Figure  6.a shows a severe acceleration occurring in the initial part membership functions allowing to translate the output linguistic variables in numbers defined in physical units.
The inputs of the Fuzzy system adopted in this study are: the driving condition (dc), the difference between the tire-ground contact patch and the vehicle velocity ( Sij T ), and the maximum deviation between the faster and the slower tire-ground contact patch velocity ( Smax T ). The driving conditions allow selecting the correct FL. The inputs Sij T and Smax T are converted in linguistic variables and discretized by means of the membership functions. Afterwards, they are provided to the inference motor. The outputs of the Fuzzy system are the five weighting coefficients (k fl , k fr , k rl , k rr , k ax ) allowing to perform the final speed estimation task.

Input membership functions
The inputs Sij T (Equation (2)) and Smax T (Equation (3)) are provided to two sets of input membership functions. Each Sij T input is associated to five levels (NB, NS, Z, PS, PB) through trapezoidal membership functions, which are depicted in Figure 4. The numerical definition of these levels is different for each driving condition. The selection of the membership functions is conducted with a trial and error procedure. On the other hand, the Smax T input is associated with two levels (PS and PB) through trapezoidal membership functions, which are the same for each driving condition. The numerical levels of the functions have been defined considering that the limit condition occurs for values of Smax T higher than 0.3.

Rule base and output membership functions
For each driving condition, the rules have been defined according to the vehicle state, in order to assign a high level of credibility to the velocity if the wheels are in the normal conditions and vice versa. During the strong braking for instance, the front axle has a higher torque applied to the wheels and this can bring to the locking of the wheels. Therefore, the rules of the rear wheels will assign a higher coefficient of reliability to the measurements of the real output coefficients. The occurrence of the wheels spinning is visible when one of the coefficients k fl , k fr , k rl , k rr goes to zero. In correspondence to these conditions, the coefficient related to the longitudinal acceleration (k a x ) increases. Figure 7.e shows that the involved FL in this case is always FL3, since the value of the longitudinal acceleration recorded during the test is always included within the range (-0.3÷0.3) m/s 2 and, therefore, the driving condition is always dc3, as indicated in Table 3.
The results obtained during the portion of the track lap are illustrated in Figure 8. During the acquisition, a lateral acceleration of 2 g and a longitudinal acceleration of 1.5 g are recorded. In correspondence to demanding manoeuvres, front wheels spinning occurs. These conditions are visible in Figure 8.a and in Figure 8.d, where the coefficients related to the spinning wheel go to zero. The results represented in Figure 8.c demonstrate the accuracy of the proposed method both during the braking-cornering phase and the acceleration-cornering phase, even during the spinning conditions. As illustrated in Figure 8.c, the estimated vehicle speed SCG t is similar to the reference S int , whilst S AVG is affected by a considerable estimation error. The output coefficients k fl , k fr , k rl , k rr and k a x are represented in Figure 8.d. When a wheel loses the grip, k a x increases its value, while the coefficients related to the wheel speed decrease. Figure 8.e shows the involved FLs according to the driving conditions.

Conclusions
In this paper, a vehicle speed estimation exploiting a Fuzzy Logic based algorithm has been presented. The method exploits a weighted average of the wheel velocities and longitudinal acceleration integral based on weighting coefficients produced by an FL. These coefficients allow evaluating the credibility of the measured values of the wheels speed. Five different FLs are adopted, corresponding to five driving conditions, detected by a dedicated routine based on the longitudinal acceleration. The method was validated experimentally on an AWD electric racing car in the case of different driving conditions and extreme maneuvers. The effectiveness of the solution was demonstrated by comparing the results to the output of an algorithm already deployed on the electronic control unit of the car, computing the speed as the average of velocities of the four wheels. A further comparison to the integral of the acceleration of the vehicle was presented.
of the acquisition. The vehicle starts from standstill with a longitudinal acceleration of about 1.3 g (solid line in Figure  6.b), which leads the vehicle to hard spinning conditions caused by a huge reduction of the vertical forces on the front wheels, as visible from the solid line with the star marker (front right wheel velocity) and solid line with the square marker (front left wheel velocity). In the last part of the acquisition, a sudden deceleration takes place causing a complete lock of the front left wheel (solid line with the square marker). Figure 6.c shows comparison of estimation of the proposed method SCG t (black line) to that obtained from the average of the four wheel velocities S AVG (red line). Both results are compared to the reference output obtained from the integral of the acceleration S int (blue line). The occurrence of the spinning and locking conditions on the front wheels causes a lack of accuracy in S AVG , with an error of about 5 m/s. The estimation SCG t , on the contrary, is closer to S int . Figure 6.d illustrates behaviour of the output coefficients (k fl , k fr , k rl , k rr ), which assume a low value in correspondence of the locking and spinning conditions and a value close to 1 in normal adherence condition.
The coefficient k a x , adopted to include the contribution of the longitudinal acceleration, as described in Equation (4), varies according to the four wheels behaviour: its value is low in the case of the normal adherence conditions and is higher otherwise. The detail of the alternance of the FLs involved in the computation of the output coefficients is shown in Figure 6.e.
The second test is conducted to evaluate the method performance during the skid-pad manoeuvre, where the car is driven along a figure-of-eight circuit. The lateral acceleration is almost constant and equal to about 1.5 g (dashed line in Figure 7.b) and the longitudinal acceleration has an almost null value (solid line in Figure 7.b). The plot of velocities of the four wheels is given in Figure 7.a and it shows that the wheels are very close to the adherence limit, due to the high lateral acceleration, which is the cause of slight spinning. The two rear wheels are generally faster than the front ones because of the vehicle torque distribution. Moreover, the internal wheels are slightly slower than the external ones. Figure 7.c shows that the estimation SCG t is accurate with respect to the speed obtained by integrating the acceleration S int . The speed computed as the average of the four wheels speed S AVG is accurate as well, since the four speeds have always a similar velocity (Figure 7.a). The small difference between the four values is caused by the slip ratio of the tires and by the occurrence of the small local spinning. Figure 7.d presents behaviour of the FL