You are on page 1of 6

Vehicle Speed Control Through Fuzzy Logic

Khizir Mahmud

Lei Tao

Department of Electrical Engineering


Northwestern Polytechnical University
Xian 710072, P.R. China
khizirbd@gmail.com

Electrical Engineering and Automation School


Northwestern Polytechnical University
Xian 710072, P.R. China
lttiger@nwpu.edu.cn

AbstractFuzzy logic can be used to construct a nonlinear


controllers by heuristic information which can replace the human
intelligence working in a chain to complete a process. So it is a
smart option to use the fuzzy logic to construct a controller to
control a vehicle. Different DC motors like the shunt motors are
prominent and flexible for electric vehicles. To control the vehicle
dynamics like acceleration, braking, gear and terrain need to
control the motor speed in proper way. So this paper advocates a
novel approach to design and analyze a controller using fuzzy
logic to control the speed of the vehicle. Traditional control
sometimes take long time to determine optimum control
parameters. But the designed fuzzy logic controller has the self
tuning algorithm which can adjust the control parameters to gain
the optimum control characteristic automatically.

II.

SYSTEM MODEL DESCRIPTION

Recently large number of cars are equipped with an auto


cruise function. It controls the throttle opening electronically to
maintain constant velocity. Many of the cruise functions use
the classic control method of PID by taking the manipulated
variable which is calculated from control error [2]. Typical
function sketch of the automatic speed control has been
illustrated in the figure 1 and the traditional control strategy in
the figure 2. In the controller a function has been incorporated
which can accelerate or decelerate the vehicle velocity
momentarily [2].

Keywordscontroller; fuzzy logic; PID; speed control; vehicle

I.

INTRODUCTION

By the development of the technology, engine and some


other vehicle accessories are controlled by electronic devices.
The main objectives of the vehicle parts development is to
reduce fuel cost, minimize pollution, reduce accessories and
manufacturing cost and improve safety. But some
environmental factors like humidity, temperature and some
internal factors like vibration and speed can deteriorate the
vehicle condition. Appropriate vehicle speed based on the
condition can meet the fuel economy and good engine
condition and also can help the drivers from any kind of
hazard. If the drivers manual speed control can be supersede by
a cruise control system then it will be more reliable and
economic and efficient. So the cruise control system and
specially the fuzzy logic to control the vehicle speed is very
important for the modern vehicle system. PID (proportional,
integral, derivative) controller is the most commonly used
traditional controller. But the fuzzy logic controller can be a
best alternative of the PID controller for its more appropriate
tools in control systems as it can be replaced as the human
experience. Hardware implementation of the fuzzy controller
can be done in various way. General purpose microprocessor,
microcontroller, programmable logic device (PLD), field
programmable gate array (FPGA) are the most prominent to
implement fuzzy logic controller. Microprocessor based
controllers are more economical and flexible, but sometimes
face difficulty in high processing input output signals. FPGA is
the most attractive option as it can process data fast,
reprogrammed unlimited times and also flexible [1].

Fig. 1. Total system overview

Fig. 2. Overall block diagram of the system

The dynamic equation of the vehicle is given below

 (t ) =

1
( Ap 2 (t ) d + f (t ))
m

a. Test input 1: for the time 0t10 velocity is assumed as


d (t ) =18m/sec and for the time 10 t 30 velocity is

1
f (t ) = ( f (t ) + u (t ))

Here, u represents as control input, when u > 0 then it


represents throttle input and when u < 0 then it represents
brake input, m = 1300 kg represent as the vehicle mass,

Ap = 0.3 Ns 2 / m 2

represents

the

aerodynamic

drag,

d = 100 N represents as friction force in constant, driving


and braking force is denoted by f and = 0.2 is set in sec.
The main goal of the research is to design a controller by
fuzzy logic which can control automobiles speed to a driverspecified value [3].

assumed as

d (t ) 22 m/sec.

b. Test input 2: for the time 0t10, velocity is assumed as


d (t ) =18m/sec and at t=25sec, velocity d (t ) increases

m / sec and for the


25 t 30 it become d (t ) = 22 m/s.
c: Test input 3: for the time 0 t the velocity is assumed as
d (t ) =22. For representing the vehicle initial state it is
linearly like ramp from 18m/sec to 22

time

assumed that x (0) .


By using, x(0) = [18,197.2, 20] for test input 1 and 2 the
results has been shown in the following figures step by step.
T

Fig. 3. Block diagram of the vehicle model

III.

SPEED CONTROLLER DESIGN USING FUZZY LOGIC

There are two fuzzy controller have been designed. One


with the PI and another with the PD. Both controller has been
analyzed in the following.

Fig. 5. Fuzzy interface system editor

A. Design of PI Fuzzy Controller


In the following a system has been considered to track a
step or ramp change in the driver-specified speed value d (t )
very accurately [4]. A PI fuzzy controller can be used as
shown in Fig. 4. In Fig. 4, the fuzzy controller is denoted by
; g 0, g1 and g 2 are scaling gains and b(t ) is the input of
the integrator.

d (t )

u (t )

g1

(t )

g0

b(t )
d
b(t )
dt

g2

Fig. 6. Close loop system with PI fuzzy controller


Fig. 4. PI fuzzy controller design

For the reference input, three different test signals have been
used [5].

TABLE I.

RULES BASE FOR CONTROLLING THE SPEED

NB

NM

NS

ZE

PS

PM

PB

NB
NB
NB
NB
NM
NS
ZE

NB
NB
NM
NM
NS
ZE
PS

NB
NM
NS
NS
ZE
PS
PM

NB
NM
NS
ZE
PS
PM
PB

NM
NS
ZE
PS
PS
PM
PB

NS
ZE
PS
PM
PM
PB
PB

ZE
PS
PM
PB
PB
PB
PB

E
E
NB
NM
NS
ZE
PS
PM
PB

pi_1/Signal Builder : Group 1


Signal 2

23

Fig. 7. Membership function editor

22

21

20

19

18

17

10

15
Time (sec)

20

25

30

Fig. 10. Reference test signal 1 curve


Test Signal 1
22.5
22
21.5

Fig. 8. Rules viewer of the fuzzy controller


Magnitude

21
20.5
20
19.5
19
18.5
18

10

15
Time

20

25

30

Fig. 11. System output curve by applying reference test signal 1

Fuzzy Controller Output


7000
6000

Fig. 9. Surface viewer of the fuzzy logic controller

5000

M
agnitude

4000

Figure 5 shows the Fuzzy inference system where there are


two inputs. One is speed error and other is the change in error.
Each input has seven membership functions ranging from -1 to
1 as shown in figure 7. This fuzzy controller has one output
which is shown in figure 5. As each input has seven
membership functions therefore total rules defined for this
controller are 7x7 = 49 as shown in figure 7 and 8. Figure 9
shows the surface viewer of the controller system. The rules
are defined according to the following algorithm which has
shown in table 1 [6].

3000
2000
1000
0
-1000

10

15
Time

20

25

Fig. 12. Fuzzy controller output curve by applying reference test signal 1

30

Output of Reference Signal1

B. Design of PD Fuzzy Controller

22.5

d (t )

then its better to use the PD fuzzy logic controller which has
been depicted in Figure 13. A backward difference has been
used to represent the derivative [7].

c(t ) =

e(t ) e(t h)
h

22
21.5
21
Magnitude

If it is necessary to make a step change in velocity

20.5
20
19.5
19

Here, h represents the step size of integration and during


implementation it becomes sampling period. An electrical
configuration of the controller designed with PD is depicted in
the following figures.

18.5
18

10

15
Time

20

25

30

Fig. 15. System output curve applying reference signal 1 to the PD fuzzy logic
controller
Fuzzy controller output
14000
12000
10000

Magnitude

8000
6000
4000
2000
0

d (t )

-2000

u (t )

g1

(t )

g0

10

15
Time

20

25

30

Fig. 16. Fuzzy controller output applying the reference signal 1


fuzzy_logic_pd_signal2/Signal Builder1 : Group 1

d
g2
dt c(t )

Signal 2

23

22

21

20

Fig. 13. Speed controller design using PD fuzzy logic

19

The controller which has been designed with PD


(proportional-derivative) is tested by applying three different
reference signal. The reference signal and the system output
and the controller output has been depicted in the following
figure.

18

17

10

20

25

30

Fig. 17. Reference signal 2 curve applied to the PD fuzzy logic controller

pi_1/Signal Builder : Group 1

Output of Reference Signal 2


25

Signal 2

23

15
Time (sec)

20

22

Magnitude

21

20

15

10

19

18

17

10

15
Time (sec)

20

25

Fig. 14. Reference signal 1 curve applied to the PD fuzzy logic controller

30

10

15
Time

20

25

30

Fig. 18. System output curve applying reference signal 2 to the PD fuzzy logic
controller

2.5

Output of Fuzzy Controller

x 10

Magnitude

1.5

0.5

-0.5
0

10

15
Time

20

25

30

For the better simulation of the fuzzy logic controller its


necessary to choose specific input. For the designing process it
is necessary to know the input and for post processing outputs
is necessary so that can design the four components of the
fuzzy logic based controller [8]. Controller fuzzification
interface processes the inputs so that it can be interpreted and
compared with the method of the rule-base. The rule-base
stores the information of the knowledge. It stores as the set of
rules for the best control of system. Based on the condition
and specific time the interface of the engine evaluates about
the appropriate input to the plants. After that the
defuzzification interface converts the information to the
system.

Fig. 19. PD fuzzy controller output using reference signal 2

IV.

pi_signal3/Signal Builder : Group 1


23
Signal 2

COMPARISON BETWEEN FUZZY CONTROLLER AND PID


CONTROLLER

22.8
22.6
22.4
22.2
22
21.8
21.6
21.4
21.2
21

10

15
Time (sec)

20

25

30

Fig. 20. Reference signal 3 curve applied to the PD fuzzy logic controller
Output of Reference Signal3
25

M
agnitude

20

15

With the advance of technology, Fuzzy control system has


become popular and reliable control system than traditional
PID control system. Actually fuzzy control is based on such
logic which is closer to human thinking than traditional logical
system [9][10]. Fuzzy logic controller can provide an expert
knowledge on an automatic control strategy in a system chain.
Fuzzy logic control system can handle the uncertainity of any
process. PID controllers are widely used in the industrial or
any process control. But sometimes shows the poor
performance. Specially when the system is nonlinear and has
insufficient information of parameters of the system then the
tuning of the controller is difficult. So the fuzzy controller
gives better performance than PID controller. A combined
circuit diagram of vehicle speed control has been shown
below. Here, both PID and fuzzy controller has been added
with the system to evaluate the performance simultaneously.

10

10

15
Time

20

25

30

Fig. 21. System output curve applying reference signal 3 to the PD fuzzy logic
controller
4

Output of Fuzzy Controller

x 10

3.5
3

Magnitude

2.5
2
1.5
1
0.5
0
-0.5

10

15
Time

20

25

Fig. 22. PD fuzzy logic controller output applying reference signal 3

30

Fig. 23. Circuit diagram to evaluate the performance for both PID and fuzzy
logic controller for vehicle speed control

V.

CONCLUSION

To control the automobiles speed, a speed control design


method using fuzzy logic is presented in the paper. PI fuzzy
logic controller and PD fuzzy logic controller has been
designed and analyzed to control the vehicles speed to a
desired value specified by the driver. The simulation results of
the controller show the effectiveness and validity of the
technique. Actually the method of modeling the fuzzy logic
controller is similar to the fundamental rule of conventional
control system. But in fuzzy logic based control gives more
emphasis on the use of heuristics. Some common close loop
specification of the conventional control like stability, steady
state error, overshoot, disturbance rejection properties,
insensitivity to system parameter variations are also checked
and applied to the fuzzy control design.

REFERENCES
Fig. 24. System output curve for both PID and fuzzy logic control (cyan color
represents the system output by using fuzzy logic controller and the yellow
represent the system output by using PID controller)

In the figure 24, system output curve has been depicted for
both PID controller and fuzzy controller in the same time
scale. For a specific input signal both controller has been
tested in 50 sec period to evaluate the performance. For both
controller the output is smooth and dont have any overshoot.
But for the rise time and settling time, fuzzy controller is more
better than PID controller. Fuzzy controller has less rise time
and settling time and system comes to the steady state very
fast than conventional PID controller. A comparison of
different control paramerters for both PID and fuzzy controller
has been shown below.
TABLE II.

COMPARISON BETWEEN FUZZY CONTROLLER AND PID


CONTROLLER IN DIFFERENT PARAMETERS

Parameters
Rise time
Settling time
Peak overshoot in %
Transient behavior

Fuzzy controller
1 sec
3.8 sec
0
smooth

PID controller
2.45 sec
22.5 sec
0
smooth

[1]

Chuen Chien Lee, Fuzzy Logic in Control System: Fuzzy Logic


Controller- Part 1, IEEE Transactions on Systems, Man and
Cybernetics, Vol- 20, No- 2, March/April, 1990
[2] Hyeoun-Dong Lee, Seung-Ki Sul, Fuzzy-Logic-Based Torque Control
Strategy for Parallel-Type Hybrid Electric Vehicle, IEEE Transactions
on Industrial Electronics, VOL.45, NO.4, August, 1998
[3] Hyeoun-Dong Lee, Euh-Suh Koo, Seung-Ki Sul, Joohn-Sheok Kim,
Torque Control Strategy for a Parallel-Hybrid Vehicle using Fuzzy
Logic, IEEE Industry Applications Magazine, November/ December
2000.
[4] R. Pusca, Y. AIT Amirat, A. Berthon, Fuzzy Logic Speed Estimator to
Drive a Four Electric Wheels Truck, IEEE Transactions, 2004
[5] Jos E. Naranjo,Carlos Gonzlez,Ricardo Garca,and Teresa de Pedro,
Miguel A. Sotelo, Intelligent Transportation systems Using Fuzzy
Logic in Automated Vehicle Control, IEEE Intelligent Systems,
January/ February 2007
[6] M. Nasir Uddin, M. Azizur Rahman, High-Speed Control of IPMSM
Drives Using Improved Fuzzy Logic Algorithms, IEEE Transactions on
Industrial Electronics, VOL.54, NO.1, February 2007
[7] Mohamed B. Trabia, Linda Z. Shi, Neil E. Hodge, A Fuzzy Logic
Controller for Autonomous Wheeled Vehicles, Mobile Robots, Moving
Intelligence, ISBN: 3-86611-284-X, PP. 576, ARS/plV, Germany,
December, 2006
[8] Liu Luoren Luo Jinling, Research of PID Control Algorithm Based on
Neural Network, Energy Procedia, SciVerse Science Direct,
ELSEVIER, ESEP 2011, Singapore, 9-10 December, 2011
[9] Philip A. Adewuyi, DC Motor Speed Control: A Case between PID
Controller and Fuzzy Logic Controller, International Journal of
Multidisciplinary Sciences and Engineering, Vol. 4, No. 4, May 2013
[10] 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), ISSN: 2278-3075, Volume-1,
Issue-1, June 2012

You might also like