Final Report Automatic Brake System Using Fuzzy Logic
Final Report Automatic Brake System Using Fuzzy Logic
net/publication/333617977
CITATIONS READS
0 4,326
1 author:
Saif H. Alrubaee
Al-Farahidi University
12 PUBLICATIONS 6 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Filter Bank Multi-Carrier Modulation Technique for Vehicle-to-Vehicle Communication View project
All content following this page was uploaded by Saif H. Alrubaee on 05 June 2019.
Contents
1 OVERVIEW ...................................................................................................... 2
2 INPUT-OUTPUT OF FL SYSTEM .................................................................... 3
3 DESIGN STRUCTURE..................................................................................... 4
1 Fuzzification ................................................................................................ 4
2 Rule Base & Inference Engine ................................................................... 6
3 Defuzzification ............................................................................................. 7
4 Performance of FL system. ........................................................................ 7
5 Discussion on comparison with other FL structure .............................. 10
CONCLUSION ...................................................................................................... 10
PYTHON CODE .................................................................................................... 11
REFERENCE ........................................................................................................... 16
1 OVERVIEW
Human judgment error may cause serious accidents due to inaccurate reaction time and time
consumes to perform full braking. In many such cases, the main cause of such accidents is the
distraction through driving and failure to react in such enough time. Moreover, the fully
intelligent vehicle, which is called driverless car, will totally automate without any human
interaction. Each vehicle will utilize both its speed sensor which measures the wheel speed
and distance sensor which is based on ultrasonic waves to compute the safety distance
between the vehicle and its neighbours by controlling the brake pressure force on the brake
pedal.
The automatic brake system, which make the driving journey safer, has developed from
25 years ago, in recent years (Aras 2013), it is developed significantly utilizing the artificial
intelligent methods and algorithms, which increase the accuracy and response time. In this
project, we proposed fuzzy controller with two inputs, vehicle speed and inter-vehicle
distance, and one output, brake force, to create a safety distance between vehicles under
different circumstances which waves from too fast speed to too low speed and from a too
close distance to far distance. The main problem of this project is as follows:
• Human driving, which involves reaction times, delays, and judgment errors is not
enough to avoid emergency braking or road accidents.
• Moreover, and in many such cases, the cause of the accident is driver distraction and
failure to react in time.
• So, in this project, we design human free brake system that maintains both the vehicle
speed and inter-vehicle distance, to automatically decelerate the vehicle on urgent
demands by controlling the brake force pressure.
For measuring purposes of the distance between two consequence vehicles, usually
ultra-sonic sensor is used which is considered very popular and low cost. Figure 1 shows a
type of ultra-sonic sensor. Simply, it comes with a separate transmitter, called TRIGGER and
a receiver, called ECHO. The sender sends 8 pulses of 40 kHz, which when hits an obstacle
stands at the front of the ultra-sonic module gets back and received from the receiver side. By
simple calculation on the receiver side and depending on the duration of the sum of the
travelling time, when the signal transferred until when it received back, the distance between
the vehicle and the next one could be estimated.
(a) (b)
Figure 2 (a) Ultra-sonic sensor (b) Ultra-sonic signal radiation
The speed sensor is based on Hall effect principle which generate an electrical signal
when a magnetic field moves near a metal, these pulses are transferred to an engine electronic
control unit (ECU) which compute the relative speed of the vehicle depending on the
transferring pulse frequency. Higher frequency means high speed and low frequency means
low speed, Figure 3 shows a vehicle speed sensor installed on a wheel (crack shaft wheel),
which it rotates with vehicle engine. The speed sensor radiates a magnetic field € that cut the
cam’s wheel and then electrical pulses are generated.
Figure 3 Speed sensor principle
3 DESIGN STRUCTURE
Our fuzzy logic design is consisting of inputs, output, and Mamdani-Fuzzy inference engine.
The output is the brake force and is defuzzied using the centroid method. The block diagram
below depicts that.
We divide the distance range from 0-10 m to three sub ranges, very close(V_cls), close, and
far. The inter-vehicle distance is classified as follows:
Very close distance (0-5 m), Triangular.
Close distance (2-8 m), Triangular.
Far distance (5-10 m), Triangular.
We have chosen triangle membership function since as the vehicle become close, the
value of the crisp input (V_cls) increase dramatically, at the middle membership, there are
marginal space starts from 4 and ends at 6m, after that, the distance considers far.
Then, we divide the vehicle speed from 0 to 10 m/s to 5 different ranges as follows:
The output of our fuzzy system is the amount of brake force and is classified as follows:
Antecedent Consequent
In the fuzzy base rules, we consider the inter-vehicle distance is the dominator since may be
the speed is too fast but the vehicle is drived far away from the targeted vehicle.
3 Defuzzification
We used Mamadni inference engine which is the simplest one and to extract the crisp output
we used a centroid method.
4 Performance of FL system.
We imply our design fuzzy controller using the python programming using the popular fuzzy
library skfuzzy version 2. After running the python code, and set the distance value of 8 m
and speed to 3 m/s, then the defuzzification figure will be as follows:
Figure 6 Defuzzied crisp output value on python shell when d=8m and S= 3 m/s
Figure 7 3D projection of our proposed controller
When we adjust the inter-vehicle distance to 2m, the inter-vehicle distance is the dominator,
the brake force must increase greatly to prevent the car from accident.
Figure 10 Defuzzied crisp output value on python shell when d=6m and S= 9 m/s
We compare our design with the work in (Mamat & Ghani 2009) , which it use beside fuzzy
controller, A proportional–integral–derivative (PID) controller. Our results are closed with
own improvement in the output crisp. As it’s clear, the top level of 3D plot is flat in the
targeted paper, but in our proposed design, it variates until reach the steady state. More
drawback in this work, in our opinion, is the position and velocity range, both are too wide
range and no need to consume computing effort upon them.
CONCLUSION
Safe driving is essential for both community and automotive manufactures since it reduces
the human death numbers and accidents cost. Many modules and applications are developed
recently to increase the safety factor through driving. An automatic brake system that adapts
the brake pressure based on inter-vehicle distance and speed is proposed in this project. The
proposed fuzzy control performs significantly as the distance decrease reaching the dead
zone. We consider the too close distance is the dominator in our design. Finally, comparing
our design with another one in the literature shows that they are close together.
PYTHON CODE
import numpy as np
####################################################
####################################################
11
No_brake = fuzz.trimf(Brake_F, [8, 12, 16])
ax0.set_title('Inter-vehicle distance')
ax0.legend()
ax1.set_title('Speed')
ax1.legend()
ax2.set_title('Brake_Force_Amount')
ax2.legend()
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
12
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()
plt.tight_layout()
#dis=np.arange(0, 11, 1)
Brake_F = ctrl.Consequent(Brake_F,'Brake_F')
###################################################
#distance.view()
####################################################
#speed.view()
####################################################
13
Brake_F['IG'] = fuzz.trapmf(Brake_F.universe, [16, 20, 24, 24])
#Brake_F.view()
#distance.view()
"""
"""
braking = ctrl.ControlSystemSimulation(brake_ctrl)
# Pass inputs to the ControlSystem using Antecedent labels with Pythonic API
# Note: if you like passing many inputs all at once, use .inputs(dict_of_data)
braking.input['distance'] = 8
braking.input['speed'] = 3
14
# Crunch the numbers
braking.compute()
print (braking.output['Brake_F'])
Brake_F.view(sim=braking)
""""""
x, y = np.meshgrid(upsampled, upsampled)
z = np.zeros_like(x)
# Loop through the system 21*21 times to collect the control surface
for i in range(10):
for j in range(10):
sim.input['distance'] = x[i, j]
sim.input['speed'] = y[i, j]
sim.compute()
z[i, j] = sim.output['Brake_F']
ax = fig.add_subplot(111, projection='3d')
15
linewidth=0.4, antialiased=True)
ax.view_init(10, 20)
plt.show()
REFERENCE
Aras, A. A. 2013. Design of a Controller for Abs Anti Lock Breaking System Using Fuzzy Logic
Control. California State University, Northridge,
Mamat, M. & Ghani, N. 2009. Fuzzy Logic Controller on Automated Car Braking System. 2009
IEEE International Conference on Control and Automation, pp. 2371-2375.
16