(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
Fuzzy Logic in a Low Speed Cruise-Controlled Automobile Mary Lourde R., Waris Sami Misbah, Department of Electrical & Electronics Engineering BITS, Pilani-Dubai, Dubai International Academic City, U.A.E MATLAB. It is the most commonly used platform by most of the scientific organizations.
Abstract — Traffic congestion is a major problem that drivers face these days Long rush hours exhibit both mental and physical toll on a driver. This paper describes the design of cruise control system based on fuzzy logic, in order to reduce the workload on a driver during traffic congestion. The proposed low speed cruise control system operates by sensing the speed and headway distance of the preceding vehicle and controlling the host vehicle’s speed accordingly. The vehicle speed is controlled by controlling throttle and the brakes. The fuzzy logic based cruise controlled vehicle is simulated using MATLAB Simulink and the results are presented in this paper.
In order to make the fuzzy logic cruise control system more realistic, we need to model a commercially available car on MATLAB and then integrate the fuzzy cruise control system to the vehicle model. The car chosen for modeling is Toyota Yaris 2007 Sedan[1]. The reason behind the selection of this car is the availability of technical information of its control system. III.
Keywords - fuzzy logic, cruise control, low speed, and traffic congestion.
The modeling of the vehicle’s drive train and dynamics is done by mapping on the specifications of a Toyota Yaris onto a demonstration model in MATLAB[6]. The automatic drivetrain model available in SIMULINK is taken as the base model for the system development.
I. INTRODUCTION A cruise control system is a general feature found in most of the automobiles today. A basic cruise-controlled car travels at constant speed set by the driver, allowing automatic movement of the vehicle without the driver pressing the accelerator. The driver sets the speed as desired and then the cruise control system maintains that speed by controlling the throttle of the car. A typical cruise control system comes with features such as acceleration, coasting and resume functions. Since the cruise control system replaces the driver, it must be able to imitate human behavior. The use of fuzzy logic is an ideal tool for this purpose. Fuzzy logic, which also means imprecise logic, when applied to system makes it user friendly. A fuzzy system involves a set of linguistic rules applied on set of input and output parameters, in order to control a system.
Figure 1. Block diagram of basic Drivetrain system
The inputs to the drive train are the throttle opening and brake torque. The engine, vehicle dynamics and the automatic transmission have been modeled using non-linear differential equations. The transmission control unit has been modeled in STATEFLOW as it involves decision-making based on the current state of the vehicle.
Conventional cruise control systems generally operate at speeds greater than 40 km/h; mostly used by drivers at highways. For speed lower than this, the vehicle needs to be controlled manually. A cruise control system that operates at lower speed is rarely available. II.
MODELING OF THE VEHICLE ON MATLAB
Reference [6] gives the complete details of modeling equations used by Mathworks to design this drive train. The complete Drivetrain model used for simulation is shown in figure 3 below. The engine subsystem was modified according to the engine-torque curve of Toyota Yaris. Default transmission gear ratios were modeled to that of Toyota Yaris. The shift schedule used by the shift logic block and the vehicle dynamics parameters were modified by the corresponding Toyota Yaris values. Any subsystem for which the corresponding Toyota Yaris specification was not available, the default value used by Mathworks has been retained.
SOFTWARE USED TO SIMULATE THE SYSTEM
The software used for the modeling of the system is MATLAB/SIMULINK. It has several toolboxes available such as the Fuzzy Logic Toolbox, SIMULINK, Image processing, Simdriveline, SimMechanics, SimScape etc. all of which can be integrated with a control system. This allows the user to develop most of the real world conditions in
68
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
Figure 2. Complete Drivetrain SIMULINK model used for the simulation [6]
Simulation One
Figure 3. Simulation 1 results of a Toyoto Yaris 2007 automobile under normal running environment
69
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
IV.
vehicle. From the simulation1 results shown in figure 3 above it is seen that the vehicle speed as well as the engine speed closely follows as required by the instruction specified by the throttle profile of the vehicle.
MODEL TESTING OF THE AUTOMOBILE
The vehicle model is tested for accuracy and compared with the actual operation of Toyota Yaris. Several simulations, with various inputs, were carried out to verify the simulation model of the vehicle of which two set of results are given below.
As we can see from the graph, the vehicle speed reaches its maximum value of 120 mph, which is the top speed of Toyota Yaris. The maximum engine rpm reached is 4100, which is about 100 revolutions less than that of Toyota Yaris. The up shifts take place at 10 mph and 40 mph, which are close to the shift schedule of Toyota Yaris.
The vehicle’s throttle profile are selected to simulate the real time operation of the engine and vehicle speeds and the gear positions are also observed to verify the working of the Simulation two
Figure 4. Simulation 2 results of the automobile in heavy traffic environment
70
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
Figure 4 shows a typical example of a heavy traffic environment as the vehicle stays below 10 mph for a major amount of time during the simulation. The simulation1 is carried out for 300 seconds and the simulation2 is done for 600 secs. In simulation 2, in addition to the throttle profile, the second input brake torque is also applied. These two simulation results proves the model of the automobile in the Simulink platform. V.
DESIGN OF THE FUZZY LOGIC CRUISE CONTROL SYSTEM
The objective of the fuzzy controller is to control the vehicle in a congested slow moving traffic environment. Therefore, the design of the fuzzy controller must be based on the variables that affect the vehicle’s movement in such an environment A. Input to the Fuzzy Controller In order to control the vehicle longitudinally, a sensor must detect a vehicle ahead and provide the distance and relative velocity of that vehicle with respect to the host vehicle. Therefore, a 24 GHz radar sensor can be installed in the vehicle since it has a very short range [7]. The sensor is not modeled in MATLAB/SIMULINK instead, an output profile coming from a sensor is assumed and provided as an input to the fuzzy controller. There are two output profiles from the sensor. They are relative velocity and relative distance between two vehicles. The figure below shows two typical unfiltered measurement profiles from a sensor [8].
B. Definition of Input Membership Functions Inputs to the fuzzy controller are relative velocity and the distance between the two vehicles. Therefore, we need to define membership functions for fuzzy variables relative velocity and relative distance. The range for the fuzzy variable relative velocity chosen is 10 km/h to +10 km/h. The speed range chosen is the typical range that vehicles travel in a congested traffic situation. The range of relative distance is chosen 0.5 to 2m, which again is the typical range in a congested traffic situation. Most of the membership functions chosen in this system are triangular shaped as it has less parameters and responds rapidly when compared to other functions. This helps the inference system, to make decisions more effectively when compared to other membership functions. Literature also shows that most commonly used membership function is triangular shaped, due to its effectiveness in a real-time environment and economic feasibility. 1)
Relative Velocity
The relative velocity fuzzy variable has the following linguistic values: mildly negative (MN), mildly positive (MP), negative (N), positive (P), very negative (VN), very positive (VP) and null (N). The figure 6 below shows the membership function definition for relative velocity.
Figure 6. Membership function for Relative Velocity
2)
Figure 5. Output profiles from a radar sensor
It can be observed from the above profiles, that when relative velocity is positive, the distance between the vehicles increases. The distance between cars will keep on increasing, as long the relative velocity is positive. The rate of change of distance varies the rate of change of relative velocity. When relative velocity becomes negative, the distance between the vehicles starts decreasing. Relative distance decreases as long as the relative velocity remains negative.
Relative Distance
The fuzzy variable for relative distance has the following linguistic values: very very close (VVC), very close (VC), close (C), Mildly Close (MC), distant (D), very distant (VD) and very very distant (VVD). The figure 7 below shows the membership definition for relative distance
Figure 7. Membership function for relative distance (0.5 - 2 m).
71
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
C. Output of the Fuzzy Controller 1) Throttle Control The linguistic values for throttle control are down (D), down very low (DVL), down low (DL) down medium (DM), up (U), up very low (UVL) up low (UL), up medium (UM) as shown in figure 8 below. The throttle control membership functions are classified into two major categories, Up and Down. These two are further divided into subcategories normal, low, very low and medium. This is to enhance the control of the vehicle at different relative velocities and distances.
be formed in order to control the output variables throttle and brake based on the input variables, relative velocity and relative distance. A set of 31 rules for throttle control and another set of 34 rules for brake control is composed. All the rules are conditional. Table 1 shows set of rules for brake control and Table 2 shows the rule set for throttle control. TABLE I. RD
RS
VVC VC
Figure 8. Membership function for Throttle Control
VN
N
MN
NULL
MP
P
VP
HRD
VH
-
HRD
L
L
-
VH
H
VH
-
L
L
C
-
H
M
-
L
L
VL
MC
-
H
L
-
L
VL
-
D
-
M
M
-
L
NULL
NULL
VD
-
M
M
-
L
NULL
NULL
VVD
-
M
M
NULL
-
NULL
NULL
TABLE II.
Majority of the membership functions cross each other. The membership functions have been made to cross in order to allow for smooth transition from one membership function to other, while the input values are changing. If the cross points are not included, discontinuities might arise in the operation of the controller as no rule will be fired at the end of each membership function. 2) Brake Control Controlling the brake along with the throttle allows better control of the car. Since the vehicle is assumed to travel in congested traffic situation, it will be required to stop frequently. The linguistic values for the fuzzy variable brake control are no brake (NB), slow brake (SB), medium brake (MB), high brake (HB) and hard brake (HDB). The figure 9 below shows the membership functions of the brake control
Figure 9. Membership function for brake control
D. Construction of the Rule Base The construction of rules base determines relation between input and output membership functions. This means that the fuzzy controller will give a certain output depending upon the input and the rules that are executed. A set of rule guides the fuzzy inference system to make decision regarding the control of the output variable. A rule can take three forms conditional, unconditional and an assignment. In this system case rules must
72
RULE BASE FOR BRAKE CONTROL
RD RS VVC VC C MC
VN D DM -
D
-
VD VVD
-
RULE BASE FOR THROTTLE CONTROL N D DM DM DL DV L -
MN D DM DL DVL
NULL NULL -
MP DM DM DVL UVL
P UVL UVL UL
VP UM
DV L
-
UL
UM
U
-
U
UM -
U U
U U
E. Defuzzification Method The final output of the fuzzy controller must be a discrete value. In order to achieve this, a method called defuzzification must be applied. The centroid method was used to defuzzify the output fuzzy variables, since all the membership function definition are triangular. The centroid method makes it easier to defuzzify a triangular shaped membership function and reduces the overall computational task allowing the system to respond effectively F. Selection of Inference Method The fuzzy logic toolbox provided in MATLAB has two inference methods, Mamdani inference method and the Sugeno method .The Mamdani method is commonly employed in most of the applications due to the fact that the Mamdani method gives outputs as fuzzy variables. Whereas Sugeno method gives linear output. As both the outputs (throttle and brake) used in this controller are fuzzy variables, Mamdani method is selected for the inference. G. Fuzzy Logic Cruise Control System model in MATLAB/SIMULINK The fuzzy logic cruise control system needs to be integrated with the vehicle model. The vehicle model
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
has throttle opening and brake torque as its inputs. Two fuzzy controllers are used to control the throttle and brake respectively. Figure 10 shows the complete MATLAB-SIMULINK block
diagram of the Fuzzy Logic Cruise Controlled automobile.
Figure 10. Complete MATLAB/SIMULINK model of the Fuzzy Logic Cruise Control System
VI.
1000 lb-ft and throttle is reduced to about 1%. Both the relative velocity and relative distance remain constant during the next 200s and so does the brake torque and throttle. We can observe that during this period of 200s that the vehicle speed remains zero. Therefore, it can concluded during this period, the vehicles are at a stop. This is a typical situation of vehicles being stuck in a heavy traffic environment. The cruise control system has successfully detected the vehicle approaching the preceding vehicle and brings the vehicle to stop when the minimum distance is reached.
SIMULATION OF THE FUZZY LOGIC CRUISE CONTROL SYSTEM
A. Simulation3 - Low speed cruise control system case i The fuzzy logic cruise control system simulation is simulated for thirty minutes with the assumed profile for relative velocity and relative distance as shown in figure 11. The throttle position, brake torque and vehicle speed are the output variables observed. Initally as the relative velocity and distance increase, the speed of the vehicle increases. An increase in throttle opening and the lowering of the brake can be observed. At 100s, relative velocity begins to decrease, however the relative distance still increases, although at a lower rate. This is due to the fact that relative distance will increase as long as the relative velocity is positive. The relative distance starts to decrease the moment, relative velocity crosses the zero mark. The throttle is reduced and the brake torque applied increases as the relative velocity and relative distance and consequently, we see a decrease in vehicle speed. The vehicle speed continues to decrease further as relative velocity increases in the negative direction.
At 800s, as both the relative velocity and distance begin to rise,the throttle increases and the brake torque is lowered allowing the car to acclerate and maintain constant speed for about 200s.Then as relative velocity and distance increase to a higher value, we see a further rise in throttle value and lowering of brake. During the final stage of the simulation, the relative velocity and distance begin to decrease and therefore the cruise control system lowers the throttle and increases the brake in order to adjust the speed of the vehicle. Finally, as the vehicle approaches the preceding vehicle, a drop in the throttle and an increase in the brake torque can be seen, which bring the vehicle to a stop.
At 600s, the relative velocity becomes zero and the relative distance reaches its minimum value. Therefore, the fuzzy cruise control system increases the brake torque to
73
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
During the simulation, we observe that vehicle speed remains constant for a certain period, even though both the relative velocity and distance are varying. This is because of the fuzzy logic controller being assigned rules to maintain a certain speed of the vehicle for a certain range of relative
velocity and relative distance. The fuzzy controller takes into account the degree of change in both the relative velocity and the distance. This condition can be observed in the following simulations as well. B. Simulation4 –Low speed cruise control system case ii In the intial phase of simulation, the vehicle speed increases as the both realtive velocity and distance increase. A further rise in vehicle speed(16 km/h at about 200s) is observed as shown in the figure 12 when relative velocity and distance increase further. During this period appropriate changes made by the fuzzy logic controller, can be observed, to the throttle and the brake torque to bring about this rise in vehicle speed. The vehicle speed remains constant for about next 600s. At 400s, the relative velocity reaches zero and the relative distance reaches the maximum value (2m) Both of them remain at that value for the next 200s. During this period, the both the throttle and brake torque remain the same and so does the vehicle speed. This is sitaution, where both the vehicles move at constant speed and headway distance. The fuzzy logic controller has managed to detect this and has responded correctly. At 800s, the relative velocity decreases negative and subsequently the relative distance alos begins to decrease. Therefore, we see a drop in the throttle and an increase in the brake torque applied. The vehicle speed, thereby decreases to 5.80 km/h and remains at this speed until the the relative velocity crossed the zero. As mentioned in the analysis of the previous simulation, the vehicle speed remains the same even though both relative velocity and distance decrease. The reason being the same as metioned earlier. In the final phase, the vehicle speed increases as both the relative velocity and distance increase. Appropriate changes in throttle and brake can be observed during this period. Discontinous spikes in the throttle and brake graphs can be observed whenever the relative velocity crosses the zero the mark. This reason behind this is that no rule is executed by the fuzzy controller at that very instant. However, this does not have an effect on the vehicle speed,since the time span for which these discontuinities occur is negligible. C. Simulation5 – Low speed cruise control system case iii As the simulation begins, the vehicle acclerates as both relative velocity and distance increase. Further changes in vehicle speed can be observed as relative velocity and distance continue to increase. The fuzzy logic controller has adjusted to vary the throttle and brake appropriately to raise the vehicle speed. The results are shown in the figure 13. The vehicle speed begins to decrease at 300s due to the realtive velocity crossing the zero mark. To lower the vehicle the speed the fuzzy controller has increased the brake torque and has simulatanouelsy lowered the throttle. As the relative velocity and distance continue to decrease, we can observe the further decrease of throttle and increase of brake torque in order to lower the vehicle speed.
Figure 11. Simulation3- Low speed cruise controlled system case i
74
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
The vehicle speed rises again the moment the relative velocity crosses the zero mark at 600s. The fuzzy controller the varies the throttle and the brake torque to bring about this change in vehicle speed.
In the last phase of the simulation, the throttle is lowered and the brake torque is increased, since relative velocity becomes negative and the vehicles starts approaching each other. The vehicle decelerates to about 1km/h at the end of the simulation. The fuzzy controller has effectively managed to control the vehicle appropriately throughout the simulation.
Figure 12. Simulation 4 –Low speed cruise control system case ii
Figure 13. Simulation 5 –Low speed cruise control system case iii
75
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
D. Simulation 6 –Low speed cruise control system case iv The vehicle initally accelerates to 7.86 km/h as relative velocity and distance increases and moves at constant speed for another 70s. Then vehicle speed further increases to 16 km/h at 100s. Throttle and brake response during this period can be seen in figure 14. The throttle and brake remain the same till the vehicle remains at this speed
E.
Simulation7 – Switching of cruise control system to manual mode This simulation is performed in order to demonstrate that the cruise control system can be switched to manual mode whenever the driver wishes to take over the control of the vehicle.
Figure 14. Simulation 6 – Low speed cruise control system case iv
At 225s, relative velocity crosses the zero mark and the vehicle speed begins to decrease. The throttle is lowered further and brake increases in order to lower the vehicle speed further. At 275s, the relative velocity remains constant and therefore, the brake and throttle remain constant. Hence, it can be concluded that the fuzzy controller has responded appropriately when relative velocity is constant.
Figure 15. Simulation 7 – Switching of cruise control system to manual mode
The vehicle intially responds to the changes in the relative velocity and distance as it is being controlled. The driver applies the brakes at 150s, as the manual brake graph shown in figure 15. The same brake profile can be seen in brake torque graph. For the next 150s, we can observe from
Finally, the vehicle speed begins to increase as the relative velocity crosses the zero mark. Appropriate changes in the throttle and brake torque can be observed from the figure 14.
76
http://sites.google.com/site/ijcsis/ ISSN 1947-5500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 4, July 2010
the brake torque graph, that the brake torque profile remains the same as the manual brake profile. This shows that the vehicle is being controlled by the driver. A similar observation can also be made with respect to throttle graph.
enhanced to a real time system by extending the model of the automobile with feed back sensors appropriately on MATLAB. This will enable the movement of the vehicle in any direction required when simulating the vehicle.
This switching of control of the vehicle is performed by adding a switch to the output of the fuzzy logic brake controller and manual brake. The switch has a control input and two data input port. The control input allows the first input, if it is above zero. The brake input has been given both as the control input and the first input. The fuzzy logic brake controller output is given as the second input to the switch. The moment the driver presses the brake pedal, and the brake torque increases above zero, the fuzzy logic controller connection to the vehicle is cut off by the switch and it allows the manual brake input to the vehicle and hence the control of the vehicle is switched to the manual mode. A similar method is applied for the throttle input.
A complete VRML (virtual reality machine language) model for an urban traffic environment shall be designed. This will allow testing of the vehicle in a congested traffic enviroment. The 3D traffic environment will require several external variables such as detection of traffic lights, pedestrians, intersections along with the movement of the vehicle in the congested traffic environment. The fuzzy logic system must be able to incorporate the environmental conditions when the vehicle is moving in the above 3D model. The VRML realm builder along with the virtual reality toolbox allows the connection of the fuzzy cruise control system to the 3D system. This will make the testing of the system more realistic.
VII. CONCLUSION AND FUTURE WORK
ACKNOWLEDGEMENTS
In this project a Fuzzy logic controlled low speed cruise control system is designed successfully and extensive simulation is carried out to test the results..The basis of the design of this control system was to control the vehicle in a congested traffic situation.The inputs to vehicle model are the throttle and brake. Therefore, two separate fuzzy logic controllers were modeled to control these vehicle actuators. To control the throttle, a set of 33 rules were constructed and to control the brake, a set 35 rules were constructed. As both these control variables are fuzzy variables, Mamdani Inference method is chosen to give the output. Two different fuzzy controllers for brake and throttle are used to have better control over the vehicle, by allowing them to operate independently.
I would like to express my sincere gratitude to Dr. M. Ramachandran – Director, Bits Pilani, Dubai for granting me an opportunity to perform this project in the college environment and use its resources. I would also like to thank my thesis guide Dr.Mary Lourde R for her constant guidance and support, which has helped me in making this project. REFERENCES [1]
Toyota Yaris Sedan Specification , www.thecarconnection.com 2007 Toyota Yaris 4dr Sedan Auto S (Natl) http://www.thecarconnection.com/specifications/toyota_yaris_2007_4 dr-sdn-auto-s-se_performance-specs [2] R. Garcia et al., “Frontal and Lateral Control for Unmanned Vehicles in Urban Tracks,”IEEE Intelligent Vehicle Symp. (IV2002), vol.2, IEEE Press, 2002, pp. 583–588. [3] José E. Naranjo, et al., “Using Fuzzy Logic in Automated Vehicle Control” IEEE INTELLIGENT SYSTEMS, January 2007:36-44 [4] M.A. Sotelo et al., “Vehicle Fuzzy Driving Based on DGPS and Vision,” Proc. 9th Int’l Fuzzy Systems Assoc., Springer, 2001, pp.1472–1477. [5] A. Broggi et al., “The Argo AutonomousVehicle’s Vision and Control Systems,” Int’l J. Intelligent Control and Systems, vol. 3, no.4, 2000, pp. 409–44. [6] Using Simulink and Stateflow in Automotive Applications, www mathworks.com Modeling an Automatic Transmission Controller http://www.mathworks.com/products/simulink/demos.html?file=/prod ucts/demos/shipping/simulink/sldemo_autotrans.html [7] K. Naab et al., “Stop and Go Cruise Control”, “International Journal of Automative Technology”, Vol 1,No .2, June 2000, pp 61-69 [8] K. Hedrick, J. Jang, and A. Potier, "Cooperative Multiple-Sensor Fusion for Automated Vehicle Control" (April 1, 2004). California Partners for Advanced Transit and Highways (PATH) [9] Fancher et al.,“Intelligent Cruise Control Field Operational Test (Final Report)”,University of Michigan Transportation Research Institute (1998). [10] Ing. Ondřej Láník, “Fuzzy Logic Vehicle Intelligent Cruise Control Simulation”, Czech Technical University in Prague, Faculty of Mechanical Engineering,Technická 4, CZ – 166 07 Praha 6, Czech Republic. [11] Micheal Klotz, Rohling H, “24 Ghz for Automotive applications”, Journal of Telecommunications and Technology, April 2001, pp 1114.
In order to maintain a safe distance between the controlled vehicle and the preceding vehicle, two variables are required; the relative velocity and distance between the vehicles. The sensor profile of these variables were assumed from a research report [8]. Using the basis of this profile, different input relative velocity and distance profiles were given to fuzzy logic cruise control system for testing. The simulation results shows that fuzzy logic cruise control system operates well to control the vehicle effectively based on different input profiles provided to the system.The fuzzy cruise control system completely controls the vehicle without the intervention of the driver. The maximum speed that the vehicle reaches when the cruise control sytem is operating is 16 km/h. This is the typical speed range of vehicles moving in a congested traffic situation.This leads to the conclusion that the fuzzy logic system is able to control the vehicle very well in a low speed heavy traffic environment. Moreover, a switching function has been attached to the system which allows the driver to take over the operation simply by pressing the brake or the throttle without any difficulties. The drivetrain model used in this system is a very basic one and the vehicle can be controlled in the longitudinal direction only. This low speed cruise control system can be
77
http://sites.google.com/site/ijcsis/ ISSN 1947-5500