2013 13th Iranian Conference on Fuzzy Systems (IFSC)
A New Method for Design and Implementation of Intelligent Traffic Control System Based on Fuzzy Logic Using FPGA Meisam Ramzanzad
Hamidreza Rashidy Kanan
Electrical, Computer and IT Engineering Department Qazvin Branch, Islamic Azad University Qazvin, Iran
[email protected]
Electrical Engineering Department line Bu-Ali Sina University Hamedan, Iran
[email protected]
Abstract— In order to manage the traffic at the intersection, the traffic lights are often used. These lights are turned on and off at the predetermined time. Intelligent traffic control systems are designed to dynamically treat the problem of traffic and reduce traffic, pollution and transit time of vehicles at the intersection. In this paper we present a design of intelligent traffic control based on fuzzy logic. The input parameters for intelligent controller are selected with the various modes of intersections to be a true simulation of the intersection environment. In order to facilitate the hardware implementation and increasing the computational speed ،decision algorithm state machine in this system is written in Verilog language and has capability to implement in the Field Programmable Gate Array (FPGA). The simulation results show that the proposed traffic signal controller system (that has been) designed with fuzzy logic has better performance than other designed systems. Keywords— Intelligent Traffic Control System; Fuzzy Logic; Intelligent Traffic Signal; FPGA; State Machine
I.
INTRODUCTION
sensors at intersections or images processing of traffic, entering special machines to intersection that their presence can be achieved with image processing, GPS or the alarm sound, passerbys attempting to cross the intersection in different directions that these directions are determined by a special key. Density of vehicles in each direction as fuzzy parameters is given to input of the system and system based on rules base defined by the knowledge of expert man determines the best required time for the passage of vehicles in order to reduce waiting times and traffic volume. The output of the designed fuzzy system along with output of sensors that indicate the special car and output of sensors that indicate passerby crossing from intersection is given to input of decision making algorithm in the field Programmable Gate Array (FPGA). This algorithm is written in the Verilog language and consists of a state machine that any time determines State of traffic light (red, yellow, green) for each direction in current time and the next according to the input parameters. This algorithm also determines the required time for traffic light in each state by fuzzy logic.
Traffic is a major problem in the city that affects many people. Traffic phenomenon causes many social problems such as stress, Air pollution, excessive fuel consumption, waste of time and etc. Today many researches in the field of artificial intelligence techniques have been performed to improve traffic flow and safety for transportation Such as expert systems and fuzzy logic system and different algorithms for traffic management have been studied in several papers [1, 2]. In this research, fuzzy logic is used to design the traffic control system. Fuzzy inference enables the system to decide similar to expert human [3]. So traffic control system can make the best decision for the smooth flow of traffic at intersections so that vehicles can cross the intersection with the least possible time. In the process of designing traffic controller systems, different parameters are used as inputs to the system. For example, the input parameters can be traffic density, traffic flow, vehicle speed, entering a special car (police car, ambulance and fire), passerby crossing from the intersection and etc [4-6]. In this paper, several parameters were used as inputs in the designed intelligent system including the number of vehicles in the intersection of roads that these values can be obtained from 978-1-4799-1228-5/13/$31.00 ©2013 IEEE.
Fig .1. Block diagram of the proposed intelligent traffic control system.
Most applications of fuzzy logic with physical systems require fast performance in real Conditions. A low-cost and effective solution for implementing these systems is using high volume programmable devices such as FPGA's which can be
applied as a big programmable unit in an IC. FPGA is one of the most successful technologies for development of systems that require immediate action [7]. II.
The membership function diagram of number of cars as follows:
THE PROPOSED METHOD FOR DESIGNING FUZZY INTELLIGENT SYSTEMS
The designed system works based on the values stored in the database. Each time we need to connect to the database to accomplish the simulation. In this section, the structure and performance of the proposed system is discussed. A. Design model of fuzzy logic based traffic control system The Proposed fuzzy system for this traffic intelligent controller includes the number of vehicles and average speed of traffic flow in each direction as the system input (This value can be obtained from the sensor placed at the junction or through processing images obtained from the intersection), rules base defined by the knowledge of expert man, and required time to turn on the green light in the desired direction as output.
Fig.2. The membership function of fuzzy set (number of cars).
And the membership function diagram of average speed of traffic flow as follows:
Average speed of traffic flow can be calculated using the following equation: 𝑉𝑎𝑣𝑔 =
𝑛 ∑𝑛 𝑖=1
(1)
1 𝑉𝑖
Where, 𝑉𝑎𝑣𝑔 is the average speed of flow (meter/second); 𝑉𝑖 is the speed of each car and n in this equation is the number of cars [5]. Each input variable (linguistic variable) includes three fuzzy sets that represent the linguistic concepts of small, medium and large. The membership functions equations for small, medium and large fuzzy states and their related shapes are defined below: Fig.3. The membership function of fuzzy set (average speed).
𝜇(𝑥)𝑠𝑚𝑎𝑙𝑙
0 40 − 𝑥 ={ 20 0
𝜇(𝑥)𝑚𝑒𝑑𝑖𝑢𝑚
if if
20 < 𝑥 ≤ 40
if
𝑥 > 40
0 𝑥 − 20 20 = 60 − 𝑥 20 0 {
if
x ≤ 20
if
20 < 𝑥 ≤ 40
if
40 ≤ 𝑥 < 60
if
𝑥 > 60
0 0
if if if
x ≤ 20 20 < 𝑥 ≤ 40 40 ≤ 𝑥 < 60
if
𝑥 > 60
𝜇(𝑥)large =
𝑥−40 20
{ 1
For the waiting time of fuzzy set Z as output we used triangular membership function.
x ≤ 20 (2)
The waiting time for a fuzzy set Z has six linguistic variables that are determined by 𝑍1 , 𝑍2, 𝑍3 , 𝑍4 , 𝑍5 , 𝑍6 . And respectively equal to very small time, small time, medium time, large time, very large time and long time. The membership function diagram of waiting time as follows:
(3)
(4) Fig.4. The membership function of fuzzy set (waiting time).
Given the parameters above, we have specified rules which can be interpreted in the form, "IF the number of cars is small
and the average speed of traffic flow is small THEN the waiting time is very large.” In proposed system for calculate the membership function of waiting time Z used of Mamdani model [8]. The designed Sets of fuzzy rules are shown in following table:
The following table shows the parameters used in the design of the state machine is described. Table II. Parameters describing the state machine
Input variables
Input ==1'b0
X
Presence of vehicles on Route 2&4
Absence of vehicles on Route 2&4
Table I . Designed fuzzy rule base for system Number of cars
average speed
Input ==1'b1
linguistic variable
small
medium
large
Y
Presence of vehicles on Route 1&3
Absence of vehicles on Route 1&3
small
𝐙𝟐
𝐙𝟐
𝐙𝟏
M
medium
𝐙𝟒
𝐙𝟒
𝐙𝟑
Arrive special machines to route 1 & 3
Don’t Arrive special machines to route 1 & 3
N
Arrive special machines to route 2 & 4
Don't Arrive special machines to route 2 &4
P
passenger crossing of Route 1 & 3
passenger doesn't crossing of Route 1 & 3
Q
passenger crossing of Route 2 &4
passenger doesn't crossing of Route 2 &4
T
Special car alarm is activated
Special car alarm is not activated
F
Inter Security Code to pass from Route 2 &4
Don’t Inter Security Code to pass from Route 2 &4
G
Inter Security Code to pass from Route 1 &3
Don’t Inter Security Code to pass from Route 1 &3
large
𝐙𝟓
𝐙𝟔
𝐙𝟔
Several methods are available for defuzzification methods like Center of Gravity, Center Average and Maximum method. In this project Center Average method of defuzzification is used. B. Decision algorithm and state machine After determining the required time for the green light by the designed fuzzy system, this value as an input parameter is given to the decision algorithm and it is used for the timing of the next steps. this algorithm is designed based on a state machine that according to the input parameters determines current and future state of traffic light, and the required time that the light stays on. This algorithm is written in the Verilog language and it can implement on FPGA and CPLD. Thus this algorithm is very high-speed performance. These systems are essential for the fast computations of intelligent traffic control system are very suitable and the required price for implementation is very suitable. Block diagram of the state machine is shown below:
In this diagram 𝐻1 is the direction of East to West (1 and 3) in intersection and 𝐻2 is the direction of north to south (2 and 4) in intersection. State lights is characterized with seven different modes namely 𝑆0 ,𝑆1 ,𝑆2 , 𝑆3 , 𝑆4 , 𝑆5 , 𝑆6 . Required time of traffic light staying on, for each direction that is calculated by the fuzzy logic determined with 𝐹𝑇1 for direction 𝐻1 and 𝐹𝑇2 for direction 𝐻2 .
Fig.5. Block diagram of the state machine.
As the block diagram of the state machine shows, crossing a special machine (police, ambulance and fire) through the intersection only at emergency time (Combination of three characteristics M (N) with F (G) Plus T) causes to turn on the green light Prematurely in that direction. This causes no change to occur in non-emergency situations in intelligent traffic controller. In this system, in order to pass passengers, special keys embedded that have ability to change lights prematurely. This situation is possible only in case 𝑆6 . As the block diagram
of the state machine shows, this condition occurs when there is not any vehicle in the intersection. C. SIMULATION RESULTS AND DISCUSSION Simulation software MATLAB generated rules in rule viewer shown in Fig. 6 on the basis of our data and finally surface view has been generated.
In this figure, solid lines represent the state of traffic light for route 𝐻1 and the broken lines represent the state of traffic light for route 𝐻2 . In this simulation for state 𝑆1 and 𝑆4 in state machine, a time equal to 10 seconds and also 𝑆1 and 𝑆4 equal to 3 seconds was determined by default. III.
CONCLUSIONS AND SUGGESTIONS FOR FUTURE
An important feature of the intelligent traffic control system includes speed and high precision, reducing traffic, Air pollution and the required time to cross the intersection. Due to the Verilog language capability, the proposed system is easily implemented on FPGA that it's economically affordable. By using the proposed algorithm and the parameters of a comprehensive state machine related to simulation, a real intersection condition has caused the system to be very flexible and provides results with high accuracy. For future work in this area, genetic algorithms and neural networks can be used in order to train intelligent traffic control system. References Fig. 6. MATLAB rule viewer.
A surface views has been shown here that indicates the effect of output.
[1]
[2]
[3]
[4]
[5]
[6] Fig. 7. Surface view for number of cars & average speed
In order to simulate the environment of intersection and the system output, we considered the case that the output of the sensors used in the intersection, leads to calculation of time 𝐹𝑇1 = 80𝑠 for route 𝐻1 and 𝐹𝑇2 = 60𝑠 for 𝐻2 by the fuzzy control system. The following picture shows the output of proposed decision algorithm and state machine for traffic light at various times.
Fig.8. lights Modes in different time
[7]
[8]
L. L. Chiou Y-C, "Adaptive traffic signal control with iterative genetic fuzzy logic controller(GFLC). In: Networking,sensing andcontrol"IEEE international conference vol. 1, pp. pp 287–292, 21–23 March 2004. L. X. Lu S, Dai S, "Incremental multistep Q-learning for adaptive traffic signal control based on delay minimization strategy," In: 7th world congress on intelligent control and automation,WCICA 2008, pp. pp 2854–2858, 25–27 June 2008. A. Altinten, Erdgan, S., Hapglu, H. and Alpbaz, M., "Control of a polymerization reactor by fuzzy control method with genetic algorithm. Comput," Chem.Eng., vol. 27, p. 1031−1040, 2003. M. D. L. lukacs, R.Magalhaes,c.Fonts,M,Embirucu and I.M pepe , '' Benefits and challenges of controlling a LED afs ( adaptive front – lighting system ) using fuzzy logic,'' International Journal of Automotive Technology, vol. 12, p. 579−588, 2011. A. A. E. U. T. Özyer, "A real time traffic simulator utilizing an adaptive fuzzy inference mechanism by tuning fuzzy parameters," Aspringer ; Appl Intell vol. 36, pp. 698–720, 2012. A. R. Z. D. R. DANDEKAR, "Simulation of Adaptive Traffic Signal Controller inMATLAB Simulink Based On FuzzyInference System," National Conference on Innovative Paradigms in Engineering &Technology(NCIPET-2012); Proceedings published by International Journal of Computer Applications® (IJCA) . Z. A. O. Nasri Sulaiman, Member, Marhaban and M. N. Hamidon, "FPGA-Based Fuzzy Logic: Design and Applications a Review," IACSIT International Journal of Engineering and Technology, vol. 1, December, 2009. C. C. Lee, “Fuzzy Logic in Control System: Fuzzy Logic Controller - Part I & II,” IEEE Trans. On Systems, Man and Cybernetics, Vol. 20, No. 2, Mar/Apr. 1990, pp. 404-435.