You are on page 1of 16

IMAT3406 FUZZY LOGIC AND KNOWLEDGE

BASED SYSTEMS

Fuzzy Inference System – Automated Vehicle Control


System

1
Contents
1. Abstract ............................................................................................................... 3

2. Introduction .......................................................................................................... 3

2.1 Literature review ............................................................................................... 4

3 The System ...................................................................................................... 5

4 Experimental design and Evaluation.................................................................... 6

4.1 Inputs................................................................................................................ 6

4.2 Outputs ............................................................................................................. 8

4.3 Rule sets .......................................................................................................... 9

4.4 Testing............................................................................................................ 10

5 Defuzzification methods ................................................................................. 11

6 Conclusion ......................................................................................................... 11

7 Reference .......................................................................................................... 13

Appendices .............................................................................................................. 15

A. Fuzzy Set ....................................................................................................... 15

B. Rule set .......................................................................................................... 16

2
1. Abstract
Automated vehicle control systems are essential for driverless cars. Such
vehicles offer significant benefits with regard to better use of road safety and
space (Millard-Ball, 2016). Automated vehicles provide ways to collect inputs
from their surrounding environment using (i.e. sensors, camera and GPS) and
process them to make decisions by using fuzzy logic techniques or other artificial
intelligent methods (Andrew, 2013). Systems based on fuzzy logic techniques are
capable of managing large complex calculations and performance very well
under unpredictable environments (Grush, 2016). Additionally, fuzzy logic is the
better choice to develop such systems as it allows the incorporation of human
decisions into the application control algorithms (Brad, 2011).

This report discusses the implementation of fuzzy inference system for


automated vehicle control systems. The final implemented system will take some
inputs, such as, the distance between the car and other obstacles on the road,
traffic lights, road quality and visibility, then processes them to decide if the
vehicle has to accelerate, slow down or stop.

2. Introduction

Driverless cars and automated vehicle technologies presents enormous


opportunities. It makes road safety better, reduces emissions and makes the
overall driving experience easier (Burkhard, 2013). Additionally, it enables drivers
to spend their time on other things than driving during the journey. It also
improves the mobility for those unwilling and unable to drive, by enhancing their
quality of life. Consequently, automated vehicles can offer significant
environmental, social and economic benefits (Ben and Steve, 2013).

Millard-Ball (2016) argues that even though, drivers have access to sophisticated
modern vehicles, with greater driver assistance technologies, the driver still have
to focus on driving all the time. The drivers spend more than 200 hours, which is
equivalent to six working weeks behind the wheel every year (James, 2014).
However, all these will be changed by the introduction of automated vehicle
technologies. Automated vehicles will allow drivers to decide if they want to drive
and be in control, or let the vehicle be in control and handle the driving task

3
(Daniel and Kara, 2013). Therefore, this is a major opportunity and drivers can
spend their journey time to do other things (Fehr and Peers, 2014).

Moreover, most common causes of collisions and road accidents are due to
driver distractions, fatigue, or speeding. With driverless cars, all these will be
eliminated, as automated vehicles use cameras and sensors to observe their
surrounding environment. Additionally, they exchange information with other
vehicles regularly to make sure accident free travelling (Jerome and Alain, 2013).
Furthermore, driverless cars come with other technologies that assist the human
driver, such as, lane controlling technologies, parking sensors and anti locking
barking systems (Fagnant and Kockelman, 2013). These technologies are getting
sophisticated each year and eventually, will be capable of working without the
driver input. Automated vehicles provide significant safety benefits. For instance,
automatic emergency braking, lane departure warning and electronic stability
control have all been assessed to have improved safety based on existing
evidence (Kara, 2016).

Finally, automated vehicles are required to follow all road traffic laws and the
guidance in The Highway Code. They are expected to provide significant user
safety, reduce collisions, injuries and death.

2.1 Literature review


In this modern era, motor vehicles are essential parts of our daily life. However,
due to high speed and other human errors, car accidents nowadays happen very
often (James, 2014). Thus, new methods other than the conventional methods of
controlling vehicles were demanded (William, 2009). As a result, automated
vehicles were introduced to control the different components of automobiles,
such as the steering wheel, braking pedal, and gas pedal and so on (Tristan,
2014).

Automated vehicles use artificial intelligent or fuzzy logic techniques to determine


the vehicle motion status based on its surrounding environment conditions
(Shelley, 2015). Automated vehicles use sensors and cameras to plan their
operations. However, the environment that the vehicle operates could be diverse
and many uncertainties settings could come forward during its operation, such as
the road flatness, orientation and obstacle position (Tom, 2013). Therefore, new

4
methods to manage the process of the whole system other than the conventional
method are needed (Ben and Steve, 2013). This can be solved by using
algorithms or artificial intelligent techniques, such as, fuzzy logic methods, which
are better ways to develop such systems, as fuzzy logic has the ability to cope
with imprecise information in sensor measurements and heuristic rule based
knowledge (Jerome and Alain, 2013).

Moreover, fuzzy logic is a great way to design vigorous individual components


and it is a better choice when an exact model of the system to be controlled
cannot be found (Thomas, 2014).

Furthermore, fuzzy logic has the advantage of using it for representing


uncertainties, such as vagueness or imprecision which are very difficult to solve
by using probability theory. In addition, fuzzy logic provides greater reliability and
flexibility to users, which means that users can chose the solution that best fits
the type of problem they want to deal with (Tristan, 2014).

3 The System
In this coursework, an automated vehicle control system that assists driverless
cars is about to be developed. This project will implement a fuzzy system that
determines the acceleration speed of a car, based on multiple input variables.
These inputs include the distance between the car in question and other
obstacles on the road (i.e. close or far away), the quality of the road (i.e. smooth,
rough or bumpy), the road visibility (i.e. good or poor) and status of traffic lights
(red, amber or green). The final implemented fuzzy system will process these
input variables and then produce an output that shows the level that acceleration
speed of the car should be adjusted.

Moreover, the system will use a set of (if and then rules) that determines how the
system will react to increase the acceleration speed, for example, slow it down or
stop the car completely. In addition, these rules establish the level of membership
that each of the inputs mentioned above has to a specific fuzzy set, for example
determining how close an object is or if the traffic lights are green or red. The
technique of determining if an input has a level of membership is called Mamdani
fuzzy inference method. This project uses Mamdani fuzzy inference to produce
an output that has a membership level of fuzzy set.

5
After the fuzzy model is implemented, then a suitable defuzzification method will
be selected to extract the final acceleration speed output from the fuzzified data.
The defuzzification method will be selected in the testing phase, as the system
will be tested with three different defuzzification methods to discover the best
suitable and consistent method for the system.

4 Experimental design and Evaluation

4.1 Inputs
As already mentioned in the introduction, the system takes in the following four
inputs and then processes them to make an accurate calculation when adjusting
the acceleration speed.

4.1.1 Distance
By using sensors and cameras, the distance between the vehicle and other
obstacles on the road will be provided to the system as integer between 0 and
55 as a measurement of metres. This integer will be used to calculate the
level of membership the current distance has to ‘distance category’. The
function used to implement the distance fuzzy sets is the Gaussian function
that will provide a symmetric cure shape.

The categories for distance:

 Very close
This is to check if the obstacle on the road is very close to decide how
much acceleration speed is needed.
 Close
This is to check if the obstacle on the road is close to adjust the
acceleration speed to prevent collision.
 Far away
This is to check if the obstacle on the road is far away so that the
acceleration speed can be adjusted to the normal road speed.

4.1.2 Road Quality

The road quality will be provided to the system as an integer between 0 and
100 as measurement of percentage. This integer will be used to calculate the

6
level of membership the current road quality has to ‘road quality category’.
This is implemented using trapezoidal function to transition between
categories.

The categories of road quality:


 Smooth
This level of membership is to determine if the road surface is smooth
to adjust the acceleration speed.
 Rough
This level of membership is to determine if the road surface is rough to
adjust the acceleration speed.
 Bumpy
This level of membership determines if the road surface is bumpy to
adjust the acceleration speed.
4.1.3 Road Visibility

Similarly, the road visibility will be provided to the system as an integer


between 0 and 200 as measurement of metres. This integer will be used to
calculate the level of membership the current road visibility has to ‘road quality
category’. Similarly, to the road quality, this uses trapezoidal function to
transition between categories.

The categories road visibility:


 Poor
This is to check if the road visibility is poor and then adjust the
acceleration speed.
 Moderate
This is to check if the road visibility is moderate and then adjust the
acceleration speed.
 Very Good
This is to check if the road visibility is very good and then adjust the
acceleration speed.
4.1.4 Traffic Lights

The status of traffic lights will be provided to the system as an integer


between 0 and 60 as a measurement of seconds. This integer will be used to

7
calculate the level of membership the current traffic lights has to ‘traffic lights
category’. Similarly, to the road quality, this uses trapezoidal function to
transition between categories.

The categories traffic light:

 Red
This checks if the traffic lights are red and then reduce the acceleration
speed until the vehicle comes to stop.
 Amber
This checks if the traffic lights are amber and then slows down the
vehicle speed so that the vehicle is ready to stop if the lights change to
red or accelerate if the change to green.
 Green
This checks if the traffic lights are green and then adjusted the speed
to the normal road speed.

4.2 Outputs

4.2.1 Acceleration Speed

The output of the system will be a fuzzy set that describes a percentage of
how much the acceleration speed should be adjusted.

The categories acceleration speed:

 Stop – this means that the input variable are indicating that the vehicle
needs to stop, for example, either there is an obstacle ahead or the
traffic lights are red.
 Slow down – this allows the vehicle to slow down because, for
example, either the traffic lights are showing amber or the road quality
is rough.
 Accelerate – this means that the vehicle can accelerate, as there is
nothing to worry about.

8
4.3 Rule sets

Now that we defined all the necessary fuzzy sets, it is time to fuzzify the obtained
data to select the specific set that each input data belongs to. To achieve we use
(if and then) fuzzy rules that are based on Mamdani fuzzy inference. After
evaluating these fuzzy rules, the system will have the ability to make decisions
and produce an accurate output that is based on the obtained input data.

Moreover, the fuzzy inference system carries out specific tasks when a set of
criteria have been met. For instance, if the system determines that the traffic
lights are red or the road visibility is poor, the system will respond by stopping the
car or slow down the acceleration speed of the vehicle.

A full outline of the rules is shown below:

A. High extreme rules – acceleration cases:


These rules apply to the extreme high cases of the system and the output
value is extreme high too. For example, distance is far away, road quality is
smooth, road visibility is very good, and traffic lights are green. These cases
produce an output value speed that is high, meaning the acceleration speed
will be adjusted to accelerate.
B. Moderate rules – slowing down cases:
These rules apply to the moderate cases of the system and the output value
is moderate too. For example, distance is close, road quality is rough, road
visibility is poor, and traffic lights are amber. These cases produce an output
value speed that is moderate, meaning the acceleration speed will be
adjusted to slow down.
C. Low extreme rules – stopping cases:
These rules apply to the extreme low cases of the system and the output
value is extreme low too. For example, distance is very close, road quality is
bumpy, road visibility is poor, and traffic lights are red. These cases produce
an output value speed that is extreme low, meaning the acceleration speed
will be adjusted to stop.

9
4.4 Testing
After the theoretical analysis of the Fuzzy Inference Systems, a testing section followed, where a variety of input data stored in
an excel file are provided to the system. Then the experimental input data parsed and interpreted accordingly by using methods
provided by MATLAB. The FIS then processed the input data by applying the five-defuzzification methods offered by MATLAB,
such as, centroid, bisector and largest, middle, smallest of maximum. Following the testing phase, was to evaluate and assess
the performance of each of the deffuzification methods and select the most appropriate one.

The following Figure - 1 shows the full test results:

Input variables Output variables


Rules
Road
Distance Road Quality Traffic Lights SOM MOM LOM Centroid Bisector
Visibility

Extreme high cases


22.00 53.00 199.00 19.00 40.00 60.00 80.00 55.63 56.00
- Accelerate

Moderate cases –
20.00 20.00 89.00 41.00 9.60 15.60 21.60 16.52 16.80
Slow down

Extreme low cases -


16.00 9.00 60.00 11.00 0.00 2.40 4.80 2.40 2.40
Stop

Figure 1

10
5 Defuzzification methods

Defuzzification is the final phase in the FIS and it is the opposite process of
Fuzzification. It will produce an output in a fuzzy set by taking the aggregate output
fuzzy set. However, the final output value will be a crisp value corresponding to each
of the output variables. Most commonly used defuzzification method is the centroid
defuzzification, which finds a centre point of the aggregate fuzzy set.

The implemented FIS was tested with all five-defuzzification methods that MATLAB
offers. By looking the test data (see, figure 1) and its output, it can be seen that the
centroid and bisector defuzzification methods produce a much smoother transitions,
while, the other three defuzzification methods (LOM, SOM, MOM) provide the
system with sudden changes. However, the centroid method produces the most
accurate output results and thus, it is selected to be the appropriate defuzzification
method for this FIS.

6 Conclusion

An automated vehicle control system has been developed which can be fed data that
is supposed to be gathered from the environment using various sensors and
cameras. However, in this project, it was not possible to use real data, as the
equipments that are required to gather just information were not available.

Apart from that, the implemented FIS performed very well under the specified
requirements. The test driven development approach that is used for developing the
system allowed to make some essential decisions and identifying the most suitable
choices before the system deployment. Additionally, the literature review assisted to
make sure that the right decisions were taken before the beginning of the system
development. After development, the system was tested with dummy data that is
stored in an excel spreadsheet and with ten test rules to see how the system
performs. The result showed that the system performed well and particularly, under
the centroid defuzzification method, which produced the most appropriate output
results.

For future work, the FIS implementation could be expended and tested with other
models, such as, Zero-Order TSK. Additionally, more input data and test rules could

11
be tested against the system to deal with unexpected conditions. However, the
addition of more data and rules could make the system implementation and testing
more difficult. Finally, as already mentioned the system was tested against dummy
data, however, real life data could be more useful in future testing.

12
7 Reference
Andrew, K. (2013) The Future of Travel: How Driverless Cars Could Change
Everything. Institute of Engineering and Technology

Ben, S. Steve, G. (2013) A Self-Driving Future: At the Intersection of Driverless Cars


and Car Sharing, Sightline Institute.

Brad, B. (2011) History of Hybrid Vehicles: Hybrid Vehicles. New York, pp. 10-50

Burkhard, B. (2013) Auto Correct: Has the Self-Driving Car at Last Arrived. Institute
of Engineering and Technology

Daniel, J. Kara, M. (2013), Preparing a Nation for Autonomous Vehicles:


Opportunities, Barriers and Policy Recommendations: Eno Foundation

James, M. (2014) Autonomous Vehicle Technology a Guide for Policymaker: RAND

Jerome, M. Alain, L. (2013) The Revolutionary Development of Self Driving Vehicles


and Implications for the Transportation Engineering Profession: ITE Journal, pp. 21-
50

Kara, K. (2016) Implications of Connected and Automated Vehicles on the Safety


and Operations of Roadway Networks: University of Texas Centre for Transportation
Research

Millard-Ball, A. (2016) Pedestrians, Autonomous Vehicles, and Cities: Journal of


Planning Education and Research, pp. 1-7

Shelley, R. (2015) The Future of Transportation: Connected Vehicles to Driverless


Vehicles…What Does It Mean To Me. ITE Journal. pp. 24-30

Steven, E. (2016), Implications to Public Transportation of Emerging Technologies,


Centre for Urban Transportation Research

Thomas, F. (2014) Driverless Cars: A Driving Force Coming to a Future Near You.

Tom, B. (2013) Autonomous Vehicles: Drivers for Change: Roads and Bridges,
Summer, pp. 5-10

13
Tristan, C. (2014) When Will You Be Able To Buy A Driverless Car. International
Journal of Vehicle Autonomous Systems

William, E. (2009) Buckle Up Your Seatbelt and Behave: Smithsonian Magazine

14
Appendices
A. Fuzzy Set

15
B. Rule set

% the first 4 rules represented the extreme cases


rule1 = [1 1 1 1 1 1 1];
rule2 = [2 2 2 2 2 1 1];
rule3 = [3 3 3 2 2 1 1];
rule4 = [3 3 3 3 3 1 1];

% distance = very close : output speed = stop


rule5 = [1 0 0 0 1 1 1];
% road visibility = good : output speed = accelerate
rule6 = [0 0 3 0 3 1 1];

% input:
% distance = far away
% road quality = smooth
% road visibility = moderate
% output:
% speed = accelerate
rule7 = [3 1 2 0 3 1 1];

% input:
% distance = close
% traffic lights = green
% output:
% speed = slow down
rule8 = [2 0 0 3 2 1 1];

% input:
% traffic lights = red
% output:
% speed = stop
rule9 = [0 0 0 1 1 1 1];

% input:
% distance = very close
% road quality = bumpy
% output:
% speed = stop
rule10 = [1 3 0 0 1 1 1];

16

You might also like