You are on page 1of 8

International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976

6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
292












DYNAMIC MODELING AND CONTROL OF VEHICLE USING FUZZY
LOGIC CONTROLLER


Xhevahir Bajrami
a
, Ahmet Shala
a
, Rame Likaj
a


a
Faculty of Mechanical Engineering, University of Prishtina, Prishtina, Kosovo


ABSTRACT

This paper presents the design of Fuzzy Logic Controller (FLC) like autopilot with the purpose
of improving the steering accuracy of the vehicle for trajectory tracking. The kinematics and dynamics
including state variables for the vehicle model are described.
The dynamic vehicle model consists by four wheels, two of them steering wheels (front axle).
The simulation and control of vehicle dynamic model is carried out through the scheme which is
presented in this paper. FLC is used to improve the ability of the vehicle model to follow the trajectory
of motion, based on the fundamental theories of control and particularly for FLC. The duty of the FLC
is to follow accurately the trajectory - the desired path of the vehicle, holding the position, velocity
and acceleration. This paper also presents the results of simulation, through diagrams and tables, of the
vehicle model. Simulations are performed by using MATLAB / Simulink.

Key words: Vehicle, autopilot, kinematic model, dynamic model, trajectory, fuzzy logic.

KINEMATICS MODELING OF THE VEHICLE

Analysis of the kinematics model of vehicle derives on the basis of known linear velocity of the
vehicle, point B:
B
x ,
B
y respectively v v
B
= and steering angle of front wheels: respectively
&
.
The nonholonomic constraint states that the vehicle can only move in the direction normal to
the axis of the driving wheels (rear axle) i.e., the vehicle base satisfies the conditions of pure rolling
and non-slipping in matrix form:

0 ) ( = s s C & .......................................................................................................... (1)
INTERNATIONAL JOURNAL OF MECHANICAL ENGINEERING
AND TECHNOLOGY (IJMET)


ISSN 0976 6340 (Print)
ISSN 0976 6359 (Online)
Volume 4, Issue 4, July - August (2013), pp. 292-299
IAEME: www.iaeme.com/ijmet.asp
Journal Impact Factor (2013): 5.7731 (Calculated by GISI)
www.jifactor.com
IJMET
I A E M E
International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
293



yB
x
B

x
Pv1
Pv2
A
B
E
F


a
Pv
D
C







&

mpa
P
a
b
b


v
y
O
Rmin

Fig.1. Positional analysis and kinematics model of vehicle

DYNAMIC MODELING OF THE VEHICLE

The Lagrange formulations are used to derive the dynamic equations of the vehicle:


=

|
|

\
|

q
L
q
L
dt
d
&
........................................................................................ (2)

After the calculation of Lagrange function (kinetic and potential energy), the dynamical
equations of the vehicle can be expressed in the matrix form:

= + ) , ( ) ( q q H q q D & & & ........................................................................................ (3)
where:

(

=
(

=
(

=
d
sh
M
F
and
H
H
q q H
D D
D D
q D
2
1
22 21
12 11
) , ( , ) ( &



sh
F - Nominal driving force acting on the rear axle,

d
M - Nominal torque for steering wheels.

=
|
|

\
|

=
= |

\
|

= =
+ + = |

\
|

=
2
) tan(
4
) ( tan 12
2
22
2
21 12
2
11
R
m
L
D
b
R
m
v
L
D D
m m m
v
L
v
D
rr
rr
per rr pa

& &
&

International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
294


+
|
|

\
|
+ =
+
|
|

\
|
+ =
) 1 ) ( (tan
2
) tan(
) 1 ) ( (tan
4
) tan( 2
2
2
2
2
2 2
2
1


&
& &
v
b
R
m v m H
b
R
m v m H
rr per
rr per


The final vehicle model - Lagrange equations which describe the movement of the vehicle are:


+
(

(
(
(
(

+ +


& &
& v
R
m
b
R
m
b
R
m m m m
rr rr
rr per rr pa
2
) tan(
4
) tan(
4
) ( tan 12
2 2
2
2

+
(

=
(
(
(
(
(

+
|
|

\
|
+
+
|
|

\
|
+
d
sh
rr per
rr per
M
F
v
b
R
m v m
b
R
m v m
) 1 ) ( (tan
2
) tan(
) 1 ) ( (tan
4
) tan( 2
2
2
2
2 2
2


&
& &
..... (4)

where
1
denotes the nominal driving force acting on the rear axle and
2
denotes torque for steering
wheels.
To be able to follow the sinusoidal trajectory, the vehicle nominal driving force
sh
F (t) (acting on
the rear axle CD), and its torque for steering wheels
d
M (t) (nominally to front wheels E, F) are given
at equation (4).




a) b)

Fig.2. Nominal driving force acting on the rear axle (a) and Steering wheels nominal torque (b)



0 0.5 1 1.5 2 2.5 3 3.5
-8
-6
-4
-2
0
2
4
6
8
x 10
4
Time (Seconds)
Vehicle
F
s
h
(
t
)



[
N
]
0 0.5 1 1.5 2 2.5 3 3.5
-6
-4
-2
0
2
4
6
x 10
5
Time (Seconds)
Vehicle
M
d
(
t
)



[
N
m
]
International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
295


VEHICLE FUZZY LOGIC CONTROLLER DESIGN

In case of path following from vehicle, in the open-loop feedback control strategy the velocity
and torque are in function of the calculated path and its initial start and end-position. The problem here
is the absence of an error-model due to the beforehand calculations. It means that there exists no
possibility for error compensation.
In the closed loop strategies the velocity and torque are functions of the actual state of the
system and not only of the initial and end points. Therefore disturbances and errors causing deviations
from the desired path are compensated by the use of the inputs. There are several available closed loop
control systems, like, proportional control (P), proportional integral control (PI), proportional integral
derivative control (PID), fuzzy logic control (FLC) etc. In this work the Fuzzy logic control is selected
for implementation, as so far it is known, for a highly nonlinear vehicle model, the fuzzy logic is one
of the easiest approaches for implementation, and is well suited to low-cost implementations based on
cheap sensors.
As inputs to the Fuzzy Logic Controller are taken: distance error (eq. 5) and angle error (eq. 6).
From the trajectory can be obtained the following distance error:


2 2
) ( ) ( x x y y d
desired desired err
+ = ......................................................... (5)

where: ) (x f y = - represents the actual trajectory, ) (
desired desired
x f y = - represents the desired
trajectory of the vehicle at point B.
For 1 ) ( = y y sign
desired
follows y y
desired
> and 0 >
err
d . For 1 ) ( = y y sign
desired

follows y y
desired
< and 0 <
err
d


From the trajectory can be obtained the following vehicle body rotation error ():

=
d
e ......................................................................................................... (6)

where:
d
- represents the desired angle of the vehicle to the x axis, and - represents the actual
measured angle

First Input to Fuzzy Logic Controller, distance error


Fig.3. First Input variable, distance error d

International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
296


Second Input to Fuzzy Logic Controller, angle error


Fig.4. Second Input variable, angle error e

Output from Fuzzy Logic Controller is additional steering angle "DFi"


Fig.5. Output additional steering angle DFi

In addition, due to the experience of many authors [1, 2, 5], the rule basis for the Fuzzy Logic
Controller was created as shown in Table 1.

Table.1. Proposed rule basis.
Distance
error
Angle error
e-NM e-NMe e-Z e-PMe e-PM
d-NSM DFi-PSM DFi-PSM DFi-PSM - -
d-NM DFi-PM DFi-PM DFi-PM - -
d-NMe DFi-PMe DFi-PMe DFi-PMe - -
d-NV DFi-PMe DFi-PV DFi-PV - -
d-Z DFi-PMe DFi-PV DFi-Z - -
d-PV - - DFi-NV DFi-NV DFi-NV
d-PMe - - DFi-NMe DFi-NMe DFi-NMe
d-PM - - DFi-NM DFi-NM DFi-NM
d-PSM - - DFi-NSM DFi-NSM DFi-NSM

International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
297


Figure 6, presents the structure of Fuzzy Logic Controller which is built according to the rules
given in Table1.




Fig. 6. Structure of Fuzzy Logic Controller

SIMULATION RESULTS

In the following diagrams are shown the simulation results of vehicle model. In Figure 7 is
shown the desired trajectory of the vehicle ) (x f y = .



Fig. 7. Desired trajectory of the vehicle


International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
298





Fig. 8. Error ''Ex and Ey'' in x y direction




Fig. 9. Vehicle body angle error '' Eteta '' and Front wheels steering angle error Efi




Fig. 10. Angular velocity error ''Edfi'' of the steering wheels and Vehicle velocity error Ev using
Fuzzy Logic Controller

0 0.5 1 1.5 2 2.5 3 3.5
-1
0
1
2
3
4
5
x 10
-3
Time (Seconds)
Vehicle
E
x
0 0.5 1 1.5 2 2.5 3 3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
x 10
-3
Time (Seconds)
Vehicle
E
y
0 0.5 1 1.5 2 2.5 3 3.5
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-3
Time (Seconds)
Vehicle
E
t
e
t
a
0 0.5 1 1.5 2 2.5 3 3.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-3
Time (Seconds)
Vehicle
E
f
i
0 0.5 1 1.5 2 2.5 3 3.5
-1
-0.5
0
0.5
1
Time (Seconds)
Vehicle
E
d
f
i
0 0.5 1 1.5 2 2.5 3 3.5
-0.03
-0.02
-0.01
0
0.01
0.02
0.03
0.04
Time (Seconds)
Vehicle
E
v
International Journal of Mechanical Engineering and Technology (IJMET), ISSN 0976
6340(Print), ISSN 0976 6359(Online) Volume 4, Issue 4, July - August (2013) IAEME
299


CONCLUSIONS

Based on the results shown in this paper and due to the comparisons with similar reference
results available, can be concluded:
The simulation results indicate that Fuzzy Logic Controller (FLC) has followed the desired
trajectory very good. The sinusoidal trajectory is chosen because of the fact that many authors [3, 4, 5]
considered this as the most difficult to be implemented, especially on its ends.
Maximum error for trajectory tracking, in y direction does not exceed [ ] m
3
10 5 . 1

and in x
direction does not exceed [ ] m
3
10 2

.
Maximum angle error of vehicle body, the angle does not exceed the value [ ] rad
4
10 8

.
Maximum angle error of steering wheels does not exceed the value [ ] rad
3
10 2 . 1

.
Maximum error of vehicle velocity (linear velocity) does not exceed the value [ ] s m / 02 . 0 .

REFERENCES

[1] Zadeh, L.A.; Knowledge representation in fuzzy logic, IEEE Transactions on Knowledge and
Data Engineering, Vol. 1, fq. 89-100, 1989.
[2] Yager, R. and D. Filev, Generation of Fuzzy Rules by Mountain Clustering, Journal of
Intelligent & Fuzzy Systems, Vol. 2, No. 3, pp. 209-219, 1994.
[3] R. O. Saber; Nonlinear Control of Under actuated Mechanical Systems with Application to
Robotics and Aerospace Vehicles, PhD thesis, Massachusetts Institute of Technology, 2001.
[4] E. N. Moret: Dynamic Modeling and Control of a Car-Like Robot, Blacksburg, USA, 2003.
[5] A. Shala: New Fuzzy Neural Network design using Genetic Algorithm for trajectory tracking
of mobile robot MECHROB04, Aachen, Germany, 2004.
[6] Bajrami Xh., Kopacek P., Shala A., Likaj R., Modeling and control of a humanoid robot.
Published online March 9, 2013 Springer Verlag Wien 2013.
[7] K. Kishore Kumar, M.Siva Krishna, D.Ravitej and D.Bhavana, Design of Automatic Guided
Vehicles, International Journal of Mechanical Engineering & Technology (IJMET),
Volume 3, Issue 1, 2012, pp. 24 - 32, ISSN Print: 0976 6340, ISSN Online: 0976 6359.
[8] Sanjay H. Sawant and Dr. J. A. Tamboli, Analysis and Comparison of Vehicle Dynamic
System with Nonlinear Parameters Subjected to Actual Random Road Excitations,
International Journal of Mechanical Engineering & Technology (IJMET), Volume 3, Issue 2,
2012, pp. 284 - 299, ISSN Print: 0976 6340, ISSN Online: 0976 6359.