Proceedings of 2015 International Conference on Fuzzy Theory and Its Applications (iFUZZY) The Evergreen Resort Hotel (Jiaosi), Yilan, Taiwan, Nov. 18-20, 2015
Speed control design for a vehicle system using fuzzy logic and PID controller Olivier Munyaneza, Bernard B. Munyazikwiye and Hamid Reza Karimi
[9]. The linguistic variables are converted into crisp set via defuzzification process.
Abstract— This paper consists of designing fuzzy and PID controllers for controlling the vehicle speed. The dynamic of the system is modeled to provide a transfer function for the plant. Fuzzy and PID controller are designed for linear model. The external disturbances such road grade is considered to stabilizing the system. Both controllers are modeled using MATLAB Simulink software. Finally, a comparative assessment of each simulated result is done based on the response characteristics.
Fuzzy logic toolbox, helps to create and edit fuzzy inference system[10]. In addition, the effect of increasing input uncertainty may be easier to understand and control than to change parameters of membership functions on sets of fuzzy rules [11]. Fuzzy logic has been used for different applications: in [12] , it has been used for materil flow cntrol systems of a manufactuing plant. According to [13], it was proved that fuzzzy locgic can successfully address the problem of stability and gain performance analysis of a discrete positive system and in [14], a novel Stability Criteria for T-S Fuzzy Systems was developed. Also from [15], a Takagi-Sugeno (T-S) fuzzy was used to control the nonlinear behavior of an electric power steering system and stabilization conditionss with constrained and saturated control input. Fuzzy logic approach can be used in wastewater management. In[16], a rubust adptive fuzzycontrller was deigned and implemented on automatic regulator of wastewater pre-treatment and guaranted the level of polution to a fixed point on the outlet side of the sewer collector. Other aplications can be found from [17-19].
Key words: cruise control, fuzzy logic, PID control, controller. I. INTRODUCTION Cruise control is designed to solve a number of problems faced by the drivers and passengers such as fatigue duty and traffic accident, and it is performed only as a velocity control [1]. Nowadays, the cruise control has become a common feature in automobile. This system reduces the driver’s tasks for adjusting the gas pedal and checking the speedometer frequently. Cruise control works by using the principles of automatic control system on throttle position setting. The drawback of this system is that, it is not possible to automatically reduce speed in case of dangerous situation [2]. The historical background of automated cars was developed back in 1930’s. In the late 1980 and beginning of 1990’s, the main initiative was to improve the highway capacity and safety with automation in highway and vehicle level [3]. During 1990s, the capability for car automation systems was demonstrated in Europe, Japan and the United State [4]. The idea of fuzzy logic was invented by Professor L.A Zadeh of the University of California at Berkeley in 1965 [5]. The fuzzy theory provides a mechanism that represents a linguistic construction such as: many, high, low, medium, small [6]. Fuzzy rules can came from brain or they can ask an expert for the if-then rules or the expert can ask themselves to state the rules and tune them [7]. Fuzzy logic is one of expert system techniques and fixes its ability in solving most expert problem [8]. A common fuzzy inference system is the Mamdani type. The result from Mamdani’s inference for a given fuzzy rule is the part of the fuzzy set that lies under the activation degree
A conventional controller which is mostly used for many industrial applications is the Proportional Integral and Derivative (PID) controller. PID controller can be understood as a controller that takes the present, the past, and the future of the error into consideration, it is also a method of control loop feedback. The controller parameters are proportional gain K p , integral time Ti , and derivative time Td [20]. Advantages and disadvantages of those parameters are discussed in [20]. Cruise control in a car and a plant thermostat are common examples of how controllers are used to autommatically adjust some variable to hold the measurement at the set point. The output of PID controllers will change in response to a change in measurement or set-point. Several methods for tuning a PID loop are used to adjust the gains constants. Ziegler and Nichols (Z-N) provide a better tuning method of PID. Z-N is the most known and most widely used to tune a PID controllers [21]. Tuning a controller is aimed at obtaining 25% maximum overshoot in step response and reducing both, rising and setling time. In modeling of a cruise control system, the model should represent the most general situation, so that it will take into acount all of the important parameters [22].
Olivier Munyaneza is with the Mechanical Engineering of the University of Rwanda, Rwanda (e-mail:
[email protected] ). Bernard B. Munyazikwiye is with the Department of Engineering, Faculty of Engineering and Science of the University of Agder, Grimstad, Norway (e-mail:
[email protected]). Hamid Reza Karimi is with the Department of Engineering, Faculty of Engineering and Science of the University of Agder, Grimstad, Norway, (e-mail:
[email protected]).
978-1-4673-6570-3/15/$31.00 ©2015 IEEE
56
In this paper, a comparison of between Fuzzy and PID controllers’ performance to control the speed of a vehicle to a constant speed of 60 km/h is presented.
d 2 Fd dt 2
1
W
C1Gu(t T ) GFd
(5)
In equations (4) and (5), Gv is the discrete output GFd is the
Finally, this paper shows the simulated result for both controllers with its corresponding response characteristics. Fuzzy logic controller provide a smooth oscillation compare to PID.
discrete driving force and C a is the aerodynamic coefficient. The transfer function of the model can be obtained by solving the state equations for the ration of
II. METHODOLOGY
'v( s ) 'u ( s )
A. Mathematical modeling The purpose of cruise control system is to regulate the vehicle’s speed and follow the driver’s command. Based on the command from the driver v d and the feedback signal
C1 MW 'v(s) 'u(s) § 2Ca v ·§ 1 ·§ 1 · ¨s ¸¨ s ¸¨ s ¸ M ¹© T ¹© W ¹ ©
from the speed sensor, the controller maintain vehicle’s speed v a by adjusting the throttle control u to increase or decrease
The parameters values are selected based on car designed specifications and other constants are adopted from [23]. In calculation, the values of corresponding parameters ܥ ;ܯ1; ܶ; ߬; ݃ ;ܽܥare 5180 Kg; 743; 1s; 0.2s; 0.85ܰ/݉ݏ2; and 9.81݉/ݏ2 respectively.
the engine driver force Fd Fig. 1 the model of the vehicle indicating all forces acting on it when it is I motion.
(6)
B. Fuzzy controller design The fuzzy logic controller used in cruise control system has two inputs: speed error (e) , derivative of error d (e) and one output , the actuator control (u ) . The control system consists of three main stages: Fuzzification, fuzzy inference system and Defuzzification. The linguistic variables such as (High Negative, Small Negative, Medium Positive, etc ) are used to represent the domain knowledge with their corresponding values lying between -50 to +50 for inputs and -3000 to +3000 for output. Fuzzification stage converts the crisp values into fuzzy rules, while fuzzy inference system processes the inputs data and computes the controller outputs in scope with the rule base and data base. Fig. 2 shows the block diagram of the plant within FLC (fuzzy logic controller).The defuzzification interface transforms the conclusions reached by the inference mechanism into the output of the plant [24].
Figure 1: Model of the vehicle in motion According to Newton’s law of motion [22], the longitudinal dynamics of the vehicle is
dv (1) Fa Fg dt Where M is the total mass of vehicle and passengers, Fa is the aerodynamic drug, Fg is the force due to gravity and Fd
M
Fd the engine driving force. Assume that there is no grading which exists during the movement of the car. The corresponding equations become:
dv dt dFd dt
1 ( Fd Ca v 2 ) M 1
W
(C1u (t T ) Fd )
(2)
(3) Figure 2: Block diagram of fuzzy cruise control
Equation (2) possesses a squared term which makes it to be nonlinear equation. To overcome with this problem is to linearize all the state equations by differentiating both sides of the equation. 2
d v dt 2
1 2Ca vGv GFd M
The structure of membership functions for the inputs and output variables of cruise control system are shown in Fig. 3, 4, 5 respectively.
(4)
57
LP: Large Positive HP: Add high positive Triangular membership functions (trimf) have been used is because of their simplicity. These memberships have an important role in the control of the system. Cruise control system is controlled based on the rules designed by the expert’s knowledge. The rules base used are shown in Table 1. The table consists of seven membership functions for both inputs. Forty nine rules are generated from those memberships as an output.
Figure 3: Membership function for speed error
TABLE 1: LOOK UP TABLE CONSTRUCTION Speed error-e
Change of Error--de
Figure 4: Membership function for derivative error
LN
MN
SN
ZE
SP
MP
LP
LN
HN
HN
HN
HN
MN
SN
ZE
MN
HN
HN
MN
MN
MN
ZE
SP
SN
HN
HN
MN
SN
ZE
SP
MP
ZE
HN
HN
HN
ZE
SP
MP
HP
SP
MN
MN
ZE
SP
SP
HP
HP
MP
MN
ZE
MN
MP
MP
HP
HP
LP
ZE
MN
MN
HP
HP
HP
HP
Table 1 can be interpreted as follow: If the error is Large Negative (LN) and derivative error is Medium Positive (MP) then the actuator control is Medium Negative (MN). In addition, each statement from Table1 has its own meaning. For examples: 1. The error is Small Negative and derivative error is Small Positive, this indicates that the actual speed is somehow higher than the desired speed and dropping to the desired speed after. 2. The error is Large Positive and derivative error is Large Negative, this indicates that the actual speed is very below the desired speed but still increasing.
Figure 5: Membership function for output actuator control The corresponding abbreviations are: HN: High negative LN: Large Negative MN: Medium negative MN: Medium Negative SN: Small negative SN: Small Negative
C. Modeling of cruise control system by Simulink
ZE: Zero
SP: Small positive
The Simulink model is created in Matlab under Fuzzy logic Toolbox with a feedback control system. The block diagram is illustrated in Figure 6. In this model, the speed errors
MP: Medium Positive
vd va
SP: Small Positive
MP: Medium positive
58
and derivative of error
de are the feedback dt
inputs, whereas desired actuator control u is the output of fuzzy logic controller. The input for fuzzy logic model is a unit step with the desired speed of 60 Km/h, a road slope of 15 degree is the disturbance to the system. The output of the model which is speed is plotted by the means of scope block.
K i = integral gain K d = derivative gain The closed loop transfer function is resulted from the transfer function of the controller, plant and a unit feedback.
C ( s) R( s )
K p G(s)
(9)
1 K p G( s)
The values of gains are determined by using the Ziegler Nichol tuning method. All the values needed for the transfer function are given in section A. The tuning values are shown in TABLE 2. TABLE 2: PID TUNING VALUES
Figure 6: Simulink model with FLC for cruise control
D. PID Controller design
³ e(t )d (t ) K 0
d
de(t ) º » dt ¼
U ( s) E ( s)
K p (1
1 K d s) Ki s
90.45
27
44.3205
60.23
III. RESULTS AND DISCUSSIONS In this work, both uncontrolled and controlled model are simulated and compared based on the design specifications. All the simulation results are shown in Figure 9, Figure 10, and Figure 11 respectively. The speed (Km/h) versus time (sec) relationship of uncontrolled model shows that both the maximum speed and time limits are exceeded, it is clear that the design specification doesn’t match.
(7)
Transfer function of PID controller is:
GPID ( s)
78
Figure 8: Simulink model with PID for cruise control
PID controller looks at the current value of the error, the integral of the error over a recent time interval, and the current derivative of the error signal. In practice, the output of PID is given by: t
126.63
controller block. The result from the Simulink scope is transferred to the M-file to generate a PID code.
Figure 7: Block diagram with PID controller for cruise control
ª 1 K p «e(t ) Ki ¬
Manual tuning values
PID controller Simulink model is illustrated in Figure 8, the tuning values of K p , K i and K d are substituted in the PID
A proportional integral derivative (PID) is a common controlling method, and application of PID involves choosing Kp, Ki and Kd that provide satisfactory closed loop performance [25]. Figure. 7 shows the block diagram of the system with PID. The error signals are used to adjust inputs to the process in order to bring back the measured values to the set point.
u (t )
Initial tuning values
(8)
Where: K p = proportional gain
59
Figure 9: Uncontrolled response
Figure 11: Overall responses for PID control
Figures 10-11 show responses of the system using Fuzzy logic and PID controller respectively. It is clear that fuzzy logic controller has small overshoot and small amplitude compared to PID controller. This means that fuzzy controller provides smooth response. Figure 11 shows the responses of the tuned PID controller. The blue color represent the response of tuned initial value with high oscillation while the green color shows the manual tuned response which gives better performance with fast response and settling time.
To know the stability of the system; the percentage overshoot (%OS), peak amplitude, settling time (TS ), steady state error and rise time (TR ) are compared and summarized in Table 3. After comparing both controllers, fuzzy logic is more stable than PID controller. TABLE 3: COMPARISON RESULT FOR FUZZY AND PID Controller Fuzzy PID tuning logic initial 3.2% 61.7%
manual 19.1%
62
97
71.4
Settling time
14
10
5.84
Rise time
6
0.577
0.723
Steady state error
60
60
60
Specifications Percentage overshoot Peak amplitude
IV. CONCLUSION In this paper, the idea of fuzzy logic and PID controllers is presented. The controllers have been designed for cruise control system. The characteristics of Fuzzy and PID responses are shown in TABLE 3. Better control performance and great stability can be estimated from fuzzy controller. PID controller produces the responses with small rise time compared to Fuzzy logic controller, but it offers high percentage overshoot and peak amplitude which can cause poor performance of the system. Further work can be done by the use of a Fuzzy-PID controller.
Figure 10: Speed control response with fuzzy
60
REFERENCES [1] S. D. Sandhya M Bharadwaj1, "Design of autonomous cruise control unit for intelligent vehicles," International Journal of Emerging Technology and Advanced Engineering, vol. 5, no. 6, june 2015. [2] Noor Cholis Basjaruddin, Kuspriyanto, Didin Saefudin, Ilham Khrisna Nugraha, "Developing Adaptive Cruise Control Based on Fuzzy Logic," International Journal of Electrical and Computer Engineering (IJECE), vol. 4, pp. 944-951, December 2014. [3] Ardalan Vahidi and Azim Eskandarian, "Research Advances in Intelligent Collision Avoidance," IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, vol. 4, September 2003. [4] Alex Forrest, Mustafa Konca, Autonomous Cars and Society, Worcester: Worcester Polytechnic Institute, 2007, p. 9.
[17] Shi, S.K. Nguang, H.R. Karimi, R.K. Agarwal, Robust finite-time fuzzy H∞ control for uncertain time-delay systems with stochastic jumps, J. Franklin Institute, DOI: 10.1016/j.jfranklin.2014.04.004. [18] T. Youssef, M. Chadli, H.R. Karimi; M.Zelmat, Design of Unknown Inputs Proportional Integral Observers for TS Fuzzy Models. Neurocomputing, Volume 123, 10 January 2014, pp 156-165. [19] B. Q. Sun, H. Guo, H. R. Karimi, Y. Ge , S. Xiong , Prediction of stock index futures prices based on fuzzy sets and multivariate fuzzy time series, Neurocomputing151(2015)1528–1536. [20] Karl J.Astrom and Tore Hagglund, PID Controllers: Thery, Design and Tuning, 2. ed., Ed., 1934.
[5] L.A, Zadeh, "Fuzzy set," int.J. information control, pp. 338-353, 1965. [6] Gaurav, Amrit Kaur, "Comparison between Conventional PID and Fuzzy Logic Controller for Liquid Flow Control: Performance Evaluation of Fuzzy Logic and PID Controller by Using MATLAB/Simulink," International Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 1, no. 1, p. 84, June 2012. [7] Hyun Mun Kim, Julie Dickerson 1, Bart Kosko, "Fuzzy throttle and brake control for platoons of smart cars," Fuzzy Sets and Systems, pp. 209-234, 1996. [8] M. A. Mohammed, "Design and Implementing an Efficient Expert Assistance System for car evaluation via fuzzy logic controller," International Journal of Computer Science and Software Engineering (IJCSSE), vol. 4, no. 3, pp. 60-68, march 2015. [9] Th. Fraichard, Ph. Garnier, "Fuzzy control to drive car-like vehicles," Robotics and Autonomous Systems, pp. 1-22, 2001. [10] Mathworks.R2015a, [Online].
[16] S. Bououden, M.Chadli, H.R.Karimi, Control of uncertain highly nonlinear biological process based on Takagi–Sugeno fuzzy models, Signal Processing 108(2015) pp195–205.
"http://www.mathworks.com/help/toolbox/ident/,"
[11] W. Duch, "Uncertainty of data, fuzzy membership functions,," IEEE TRANSACTION ON NEURAL NETWORKS, vol. XX, 2004. [12] H. R. Karimi, B. Scholz-Reiter, "Toward learning autonomous Pallets by using fuzzy rules, applied in a Conwip system”, Int. J. Advanced Manufacturing Technology, February 2013, Volume 64, Issue 5-8, pp 1131-1150. [13] Z. Duan, Z. Xiang, H.R. Karimi, Stability and l1-gain Analysis for Positive 2D T-S Fuzzy State-delayed Systems in the second FM Model, Neurocomputing, Volume 142, 22 October 2014, pp 209-215. [14] X. Zhao, L. Zhang, P. Shi, H.R. Karimi. Novel Stability Criteria for T-S Fuzzy Systems. IEEE Transactions on fuzzy systems, VOL. 22, NO. 2, 2013, pp. 313-323. [15] D. Saia, M. Chadli, H. R. Karimi, S. Labiod, Fuzzy Control for Electric Power Steering System with Assist Motor current input constraints, Journal of the Franklin Institute, DOI:10.1016/j.jfranklin.2014.05.007, Volume 352, Issue 2, February 2015, pp 562-576.
61
[21] Ch. Bhanu Prakash, R. Srinu Naik, "Tuning of PID Controller by Ziegler-Nichols Algorithm for Position Control of DC Motor," International Journal of Innovative Science, Engineering & Technology, vol. 1, pp. 379-382, 3 May 2014. [22] Khairuddin Osman, Mohd. Fuaad Rahmat, Mohd Ashraf Ahmad, "Controller Design for a Cruise Control system," Kuala Lumpur Malaysia, 2009. [23] Frank, Andrew, S.J.Liu, S.Liang, "Longitudinal Control Concepts For Automated Automobiles and Trucks Operating on a Cooperative Highway," Society of Automotive Engineers Technical paper series (801708), 1989. [24] N. P.-D. 1 and E. J. H.-L. 2. G. V.-P. 3. *, "Comparative Analysis Between Conventional PI and Fuzzy Logic," sustainability, , 17, January 2015, pp. 5398-5412. [25] M. S. Ankita Nayak1, "Study of tuning of PID controller by using Particle swarm optimization," International Journal of Advanced Engineering Research and Studies, pp. 346-350, march 2015.