Fuzzy Logic & It's Applications
Fuzzy Logic & It's Applications
Authorised By
Email: [email protected]
Engineeringpapers.blogspot.com
Fuzzy logic models, called fuzzy inference systems, FL offers several unique features that make it a
consist of a number of conditional "if-then" rules. For particularly good choice for many control problems.
the designer who understands the system, these rules
are easy to write, and as many rules as necessary can 1) It is inherently robust since it does not require
be supplied to describe the system adequately precise, noise-free inputs and can be programmed to
(although typically only a moderate number of rules fail safely if a feedback sensor quits or is destroyed.
are needed). The output control is a smooth control function
despite a wide range of input variations.
Fuzzy logic models, called fuzzy inference systems,
consist of a number of conditional "if-then" rules. For 2) Since the FL controller processes user-defined
the designer who understands the system, these rules rules governing the target control system, it can be
are easy to write, and as many rules as necessary can modified and tweaked easily to improve or drastically
be supplied to describe the system adequately alter system performance. New sensors can easily be
(although typically only a moderate number of rules incorporated into the system simply by generating
are needed). In fuzzy logic, unlike standard appropriate governing rules.
conditional logic, the truth of any statement is a
matter of degree.
3) FL is not limited to a few feedback inputs and one
or two control outputs, nor is it necessary to measure
Fuzzy logic emerged as a consequence of the 1965 or compute rate-of-change parameters in order for it
proposal of fuzzy set theory by Lotfi Zadeh.Though to be implemented. Any sensor data that provides
1
some indication of a system's actions and reactions is be bad today, but fine tommorow, then we make a
sufficient. This allows the sensors to be inexpensive descision not to go today, and postpone it till
and imprecise thus keeping the overall system cost tommorow. Rules associate ideas and relate one
and complexity low. event to another.
Fuzzy machines, which always tend to mimic the
4) Because of the rule-based operation, any behaviour of man, work the same way. However, the
reasonable number of inputs can be processed (1-8 or descision and the means of choosing that descision
more) and numerous outputs (1-4 or more) generated, are replaced by fuzzy sets and the rules are replaced
although defining the rulebase quickly becomes by fuzzy rules. Fuzzy rules also operate using a series
complex if too many inputs and outputs are chosen of if-then statements. For instance, if X then A, if y
for a single implementation since rules defining their then b, where A and B are all sets of X and Y. Fuzzy
interrelations must also be defined. It would be better rules define fuzzy patches, which is the key idea in
to break the control system into smaller chunks and fuzzy logic.
use several smaller FL controllers distributed on the A machine is made smarter using a concept designed
system, each with more limited responsibilities. by Bart Kosko called the Fuzzy Approximation
Theorem(FAT). The FAT theorem generally states a
5) FL can control nonlinear systems that would be finite number of patches can cover a curve as seen in
difficult or impossible to model mathematically. This the figure below. If the patches are large, then the
opens doors for control systems that would normally rules are sloppy. If the patches are small then the
be deemed unfeasible for automation. rules are fine
2
with proximity sensorswhich can activate a change in iii) no right and left turns are considered;
the cycle time or the lights.In the case of a less iv) the fuzzy logic controller will observe the
traveled street which may not need aregular cycle of density of the north and south traffic as one
green lights, proximity sensors will activatea change side and the west and east traffic as another
in the light when cars are present. This type ofcontrol side;
depends on having some prior knowledge of v) the East-West lane is assumed as the main
trafficflow patterns at the intersection so that signal approach;
cycle timesand placement of proximity sensors may vi) The minimum and maximum time of green light
be customized forthe intersection.Fuzzy logic traffic is 2 seconds and 20 seconds respectively.
lights control is an alternative toconventional traffic
lights control which can be used for awider array of Fuzzy Logic Traffic Lights Controller
traffic patterns at an intersection. A fuzzylogic Design
controlled traffic light uses sensors that count A fuzzy logic controller was designed for an isolated
carsinstead of proximity sensors which only indicate 4-lanetraffic intersection: north, south, east and
thepresence of cars. This provides the controller with west.In the traffic lights controller two fuzzy input
trafficdensities in the lanes and allows a better variables are chosen: the quantity of the traffic on the
assessment ofchanging traffic patterns. As the traffic arrivalside (Arrival) and the quantity of traffic on the
distributionsfluctuate, the fuzzy controller can change queuing side(Queue). If the north and south side is
the signal lightaccordingly.The general structure of a green then thiswould be the arrival side while the
fuzzy traffic lights control system. There are two west and east side wouldbe considered as the queuing
electromagneticsensors placed on the road for each side, and vice-versa. Theoutput fuzzy variable would
lane. The first sensorbehind each traffic lights counts be the extension time needed
the number of cars passingthe traffic lights, and the for the green light on the arrival side (Extension).
second sensor which is locatedbehind the first sensor Thusbased on the current traffic conditions the fuzzy
counts the number of cars coming tothe intersection rules canbe formulated so that the output of the fuzzy
at distance D from the lights. The numberof cars controller willextend or not the current green light
between the traffic lights is determined by time. If there is noextension of the current green time,
thedifference of the reading between the two sensors. the state of the traffic lights will immediately change
This isin contrast to conventional control systems to another state, allowing the
which place aproximity sensor at the front of each traffic from the alternate phase to flow.
traffic light and canonly sense the presence of a car
waiting at the junction, notthe number of cars waiting Description Of Software
at the traffic. The distancebetween the two sensors D, A software was written to simulate the effectiveness
is determined accordinglyfollowing the traffic flow of thefuzzy logic controller in controlling traffic
pattern at that particularintersection. The fuzzy logic conditions at anisolated junction. The software was
controller is responsible forcontrolling the length of written in Visual Basicusing event-driven
the green time according to thetraffic conditions. The programming techniques and it isdesigned to work
state machine controls the sequenceof states that the under the Windows environment. A mockjunction is
fuzzy traffic controller should cyclethrough. There is simulated in the software to show incoming
one state for each phase of the trafficlight. There is andoutgoing traffic. The software is highlygraphical
one default state which takes place when noincoming in nature and 'pop-up' and 'pull-down' menus
traffic is detected. This default state correspondsto areaccommodated for easier user manipulation. The
the green time for a specific approach, usually to the density oftraffic in any one lane can be set as
mainapproach. In the sequence of states, a state can required from 0% to100% by sliding the 'scroll bar' at
be skippedif there is no vehicle queues for the the side of the lanes. Thebulb and lines across each of
corresponding the lanes show the sensorslocation. In real
approach. application, such sensors would be of
theelectromagnetic type embedded in the roads. Such
Design Criteria And Constraints sensorcan easily detect vehicles such as cars, lorries,
In the development of the fuzzy traffic lights control buses, etc.which are made of metals, through
systemthe following assumptions are made: electromagnetic
i) the junction is an isolated four-way junction induction. Several analyses such as density of traffic,
with traffic coming from the north, west, south movement time, waiting time, cost, etc. can be made
and east directions; in thesoftware using one of the available menus.
ii) when traffic from the north and south moves, Brief Description on Usage and Software Facilities
traffic from the west and east stops, and viceversa;
3
The software has a number of facilities for easy user time (minutes)/car = 4*(100% / flow %)
manipulation and also analysis of the performances The traffic flowrate can be set in two different
of the modes.
fuzzy and fixed-time controllers. This section briefly The user can set the flowrate by changing the scroll
explains the facilities available and information on bar setting at the side of each lane. There is a facility
how to where the user can set different flowrates at every
use the software. minute. This facility is useful for determining how
the controller will perform at a given intersection
ControllerUpon starting the software, the user can over the course of an entire day or some other time
choose thetype of controller in the simulation. By period.
using thismenu the user may choose to simulate v) Extension-Time
The actual green time extension in seconds for the
theperformance of either (1) a fixed-time controller,
output of the fuzzy logic controller is presented in
or (2)a fuzzy logic controller or (3) both. The fixed- the Extension-Time facility. These timings are
timecontroller is a conventional type of controller generated automatically by the fuzzy logic controller
that isopen-loop in nature. It uses a preset cycle time and they are dependent on the settings of the
tochange the lights. The default cycle time for membership functions and rules. Negative values in
thegreen, amber and red signal lights, respectively, the table indicate immediate change. From the table,
are the user can determine whether the rules and
membership functions have been well configured or
11, 4, and 15 seconds. There is also an option for the not.
user to change the cycle time to any desired value. vi) GraphThe Graph facility allows the user to
In choosing the fuzzy logic controller to control the visualize andanalyze the performance of the
traffic lights, the cycle time for the green lights is controllersgraphically. There are seven types of plots
determined according to the density of the traffic. that areavailable in this facility which are as follows:
The user may set up his/her own fuzzy control rules · Car Sensed - shows the number of carswithin the
or may use the default rules as given. There is also sensed area at each instant.
an option to configure the membership functions as · Flow density - shows the traffic flowrate
desired. Using the third option, the software will in each lane for every minute.
simulate both of these controllers sequentially. First · Wait Time - shows the total waiting timeof the cars
the fixed-time controller is simulated then followed at the junction for each lane for every minute of the
by the fuzzy controller according to the set time as simulation.
requested. This third option is mainly used for · Move Time - shows the total moving time of the
comparing the performance of the fixed-time and cars at the junction for eachlane for every minute of
fuzzy logic controllers. To start the simulation the the simulation.
user has to define the type of controllers intended · Car In - calculates the number of carsmoving into
and configure the relevant parameters which are the sensed area in each lanefor every minute of the
discussed below. Then by clicking the GO menu, simulation.
simulation will actually start. The simulation can be · Car Out - calculates the number of carsmoving out
stopped at any time by clicking the STOP facility. of the sensed area in eachlane for every minute of the
ii) Real Time simulation.
The simulation software also provides real time · Cost Function - provides numericalcalculation of
control using a dedicated fuzzy micro-controller the cost using either ofthe controllers. A lower value
AL220 by Adaptive Logic Inc., USA. indicatesbetter performance of the controllers
iii) Cycle-Time minimizing the waiting time and also fuelcosts. This
The cycle time is the time that the fuzzy controller is calculated as follows:
need to decide on the extension of the current green Cost = (Car In / Car Out)*(WaitTime / Drive Time)
time period. It is not necessary to evaluate the vii) Restart
system every second. This cycle time is dependent The Restart facility resets the simulation back to the
on the fuzzy rules and membership functions. initial state.
iv) Flowrate viii) Exit
Flowrate facility can be used to calculate the number This facility quits the simulation and brings the user
of cars passing through a lane in one minute. The back to the previous Windows environment.
percentage of the flowrate is given by the following
formula: Application Areas
4
Fuzzy logic is used in the operation or programming
of:
CONCLUSION
5
6
7