Professional Documents
Culture Documents
THESIS
MASTER OF TECHNOLOGY
(Electronics & Communication)
SUBMITTED BY
VIKRAM MUTNEJA
APRIL 2008
THESIS
MASTER OF TECHNOLOGY
(Electronics & Communication)
SUBMITTED BY
VIKRAM MUTNEJA
APRIL 2008
I hereby certify that the work which is being presented in the thesis entitled MODELING
AUTONOMOUS NAVIGATION OF A NON-HOLONOMIC VEHICLES PARKING
USING TYPE-II FUZZY SETS in partial fulfillment of requirement for the award of the
degree of Master of Technology (Electronics & Communication Engineering) submitted in the
Department of Electronics & Communication Engineering at Giani Zail Singh College of
Engineering & Technology, Bathinda under Punjab Technical University, Jalandhar is an
authentic record of my own work carried out during a period from March, 2007 to April, 2008
under the supervision of Er. Neeraj Gill and co-supervisor Er. Satvir Singh Sidhu. The matter
presented in this thesis has not been submitted in any other University/Institute for the award of
M.Tech Degree.
(Vikram Mutneja)
(Uni. Roll No.: 316049619)
This is to certify that the above statement made by the candidate is correct to the best of my
knowledge and belief.
The M.Tech viva-voce examination of Vikram Mutneja has been held on and
accepted.
i
ABSTRACT
Only the starting and end points are specified, and the robot itself works out the trajectory. Two
trajectory-traversing algorithms namely, Linear Paths Approximation (LPA) and Continuous
Curves Approximation (CCA) for non-holonomic motions have been integrated in the design of
systems graphical user interface.
The fuzzy logic system uses two input variables and one output variable relevant to the steering
process. The variables take on linguistic values for invoking the rule-base to deliver decisions
to steer the vehicle to reach its final position. The Fuzzy logic system was originally developed
by using type-1 fuzzy sets (T1 FS), and then modified to interval type-2 fuzzy logic system by
making use of interval type-2 fuzzy sets (IT2 FS) to handle uncertainty in the representation of
input variables by linguistic means.
The response of interval type-2 fuzzy logic system (IT2 FLS) becomes equivalent to that of
type-1 fuzzy logic system as the extent of uncertainty is reduced by reducing the Footprint of
Uncertainty (FOU) to zero. The simulation results of autonomous navigation system based on
interval type-2 fuzzy sets definitely improve as the FOU increases up to a limit, beyond which
a kind of aliasing of variable values tends to invoke the rule-base such that even non-desirable
rules tend to fire.
Apart from the automatic motion simulation, manual controls for motion simulations have also
been integrated in the graphical user interface, which are helpful to evaluate vehicles
navigation in different conditions including successful as well as unsuccessful cases. Two types
ii
of manual controllers have been designed, first one is mouse operated and second one is
keyboard operated.
The response of the system has been studied by taking into account navigational error which
marks a case as unsuccessful if vehicles trajectory is non-converging and positional errors
which accounts for orientation or distance error in final parking position. Apart from simulation
parameters, important conclusions have been withdrawn by studying the response of the system
w.r.t maximum possible variations in the FOU width, by taking different initial positions
varying along the x-axis to draw D vs. W plots.
iii
ACKNOWLEDGEMENTS
I would like to place on record my deep sense of gratitude to Dr. Savina Bansal, Head of
Department of Electronics & Communication Engineering, GZSCET, Bathinda, for her
generous guidance, help and useful suggestions.
I express my sincere gratitude to my guide, Mr. Neeraj Gill, Assistant Professor, Department of
Electronics & Communication Engineering, GZSCET, Bathinda for his stimulating guidance &
continuous encouragement and supervision throughout the course of thesis work.
I greatly acknowledge the great help rendered by my co-guide, Mr. Satvir Singh Sidhu, AP &
HOD, Department of Electronics & Communication Engineering, SBSCET, Ferozepur, for his
continuous encouragement & providing me deep insights into the various details of this
research work.
I also wish to extend my thanks to all those faculty members & other staff members of
GZSCET, Bathinda & SBSCET, Ferozepur, who have directly or indirectly helped me to
complete this research work.
I express my sincere thanks to my family, who supported me whole heartedly with great
patience during the completion of my research work.
Finally, I acknowledge my deepest gratitude to Almighty, this omnipresent power who always
gave me courage to accomplish this task.
(VIKRAM MUTNEJA)
iv
LIST OF FIGURES
Page No.
FIGURE 1.1: TYPE-1 FUZZY LOGIC SYSTEM 2
FIGURE 2.2: FLS VARIABLES FOR GOLF CART AUTONOMOUS NAVIGATION PROBLEM 16
v
FIGURE 4.5: MEMBERSHIP FUNCTIONS OF AXIS ANGLE 36
FIGURE 8.2: PATH TRACES FOR MIN & PRODUCT T-NORMS (A) & (B) 67,68
FIGURE 8.3: PATH TRACES FOR TRAJECTORY TRAVERSING ALGORITHMS (A) & (B) 69
FIGURE 8.5: SIMULATION OUTPUT FOR DIFFERENT IT2-FS WIDTH VALUES (0-200) 67
vi
LIST OF TABLES
Page No.
TABLE 2.1: A FUZZY STEERING CONTROL SYSTEMS INPUT & OUTPUT VARIABLES 17
vii
NOMENCLATURE
DE DISTANCE ERROR
DR DISTANCE RANGE
FS FUZZY SETS
IP INITIAL POSITION
LMF LOWER MF
viii
LPA LINEAR PATHS APPROXIMATION
MU MEMBERSHIP FUNCTION
OE ORIENTATION ERROR
TYPE-2 TYPE-II
T1 TYPE -1
T2 TYPE -2
TC TRAJECTORY CONTROLLER
TF TUNING FACTOR
TR TURNING RATIO
UC UNSUCCESSFUL CASE
UMF UPPER MF
W FOU WIDTH
MEMBERSHIP FUNCTION
T TYRE ANGLE
ix
CONTENTS
Page No.
Candidates Declaration i
Abstract ii-iii
Acknowledgments iv
List of Figures v-vi
List of Tables vii
Nomenclature viii-ix
Contents x-xiv
CHAPTER 1 : INTRODUCTION 1
x
1.7.3 Design of Simulation Module 11
1.7.4 Design of Type-1 Based FLC 11
1.7.5 Design of GUI 11
1.7.6 Programmed Version of T1 Based System 11
1.7.7 Type-1 to Interval Type-2 Conversion 12
1.7.8 Modification of GUI 12
1.7.9 Waveforms Generation 12
2.1 Trajectory-Traversing 13
xi
4.2.3 Comparison of Case 1 and Case 2 35
6.1 GUIDE 49
6.1.1 Laying Out GUI 50
xii
6.1.2 Programming GUI 50
xiii
7.2.6 Normalizing of vehicle orientation angle 59
7.2.7 Navigational Data Logging 59
7.2.8 Tuning of Steer Angle 59
7.2.9 Turning Ratio (TR) 60
7.2.10 Trails 61
9.1 Conclusions 75
Publications 77
References 78-80
Appendix I : List of Systems Software Files 81
Appendix II : Matlab Code 82-99
xiv
CHAPTER 1
1 INTRODUCTION
The chapter first contains the basic introductory part which includes introduction to
autonomous navigation, holonomic & non-holonomic types of vehicles, type-1 & type-2 based
fuzzy logic systems, development environment i.e. MATLAB. Further it discusses objectives
of the thesis, steps undertaken for accomplishment of this work & finally briefing of
organization of the thesis.
A. Holonomic Robots
Some of commercial and research robots are holonomic. Such vehicles have decoupled
translation and rotation motion. Holonomic robots are able to vary each component of their
position and orientation in-dependently. By turning on the spot they can move in any direction
regardless of their orientation. Therefore they can easily reach the final orientation-angle by
means of a single rotation, once the 2D position has been attained.
1
It is very difficult to design a true holonomic vehicle as there are always some limitations
imposed by the physical design of the vehicle on its kinematics. The design of the holonomic
vehicles requires the intensive study of the carriage unit, the specialized design of the wheels,
their rotational & control mechanism.
B. Non-Holonomic Robots
They may not be able to change their orientation without changing position and/or may only be
able to move in limited number of directions depending on their shape & orientation of
wheels/legs. Therefore Non-holonomic vehicles are forced to translate their motion for turning
to a final orientation. Thus non-holonomic vehicles require a much finer and intelligent control
strategy than holonomic ones. Examples of non-holonomic four wheelers are robots such as
ROJO, which has been successfully used in area of agriculture, others are four wheeler
commercial vehicles such as cars, trucks etc.
1.2.1 Fuzzifier
This unit named fuzzifier converts each of the input data to degrees of membership by a lookup
in one or several membership functions. The fuzzifier in fact matches the input data with the
2
conditions of the rules to determine how well a particular input instance matches with the
conditions of each rule.
1.2.2 Rule-Base
This is basically a linguistic controller containing rules in the if-then-and or if-then-or format.
Every element in the Universe of Discourse (complete range of input variable) is a member of a
fuzzy set to some grade, known as Degree of Membership, may have value between 0 to 1. This
function that ties a number (0-1) to each input instance, is called the membership function. e.g.
Fig. (1.2) shows examples of type-1 membership functions mf1 to mf7.
With the definition of the rules and membership functions in hand, we now need to know how
to apply this knowledge to specific values of the input variables to compute the values of the
output variables. The output is obtained from the Inference Engine in form of output fuzzy sets,
one from each of the rules for each input instance. This process is referred to as Inferencing
and subunit referred to as Inference Engine. The fuzzy sets from different rules are aggregated
to form a single output fuzzy set. This process is called as Composition. After the aggregation
process, there is a fuzzy set for each output variable that needs de-fuzzification.
Thus the process of fuzzy inference involves all of the pieces that are: Membership Functions,
Fuzzy Logic operators, and if-then rules. There are two types of fuzzy inference systems:
Mamdani-Type & Sugeno-Type. These two types of inference systems vary somewhat in the
way outputs are determined. Sugeno type systems expect the output to be of crisp type while
Mamdani type inference expects the output membership functions to be of fuzzy sets. It is
possible, and in many cases much more efficient, to use a single spike as the output
membership-function rather than a distributed fuzzy set. This is sometimes known as a
Singleton Output Membership Function, and it can be thought of as a pre-defuzzified fuzzy set.
It enhances the efficiency of the defuzzification process because it greatly simplifies the
3
computation required by the more general Mamdani method, which finds the Centroid of a
two-dimensional function.
1.2.4 De-Fuzzifier
The resulting output fuzzy set must be converted to a crisp number that can be sent to the
process as a control signal, which is known as de-fuzzification. There are different methods of
de-fuzzification, most common are Centroid and Maximum methods. In the Centroid
method, output crisp value is computed by finding the center of gravity (COG) of the
membership function of output fuzzy set. In the Maximum method, one of the variable values
at which the fuzzy subset has its maximum truth-value is chosen as the crisp value for the
output variable. There are several variations of the Maximum method that differ only in what
they do when there is more than one variable value at which this maximum truth-value occurs.
One of these, the Average-of-Maxima method, returns the average of the variable values at
which the maximum truth-value occurs.
4
A type-2 FLS has similar blocks as that of type-1 except one additional block, which is called
as Type-Reducer named so as it reduces the fuzzy set from type-2 to type-1 as shown in block
diagram in Fig. (1.4).
This unit lies in between Inference Engine and De-fuzzification unit in case of T2 based fuzzy
logic systems as shown in Fig. (1.4). It converts the type-2 fuzzy output from the inference
engine to the type-1 before being applied to the de-fuzzifier. De-fuzzifier cannot directly work
on type-2 output as it has to produce the crisp output which it can produce from type-1 only.
Transformation of system from Type-2 to Type-1 involves transforming the fuzzy sets of the
system variables. Fig. (1.5) represents the transformation at basic level from T1 to T2. Blurring
of the boundaries can be thought of as moving a triangular MF to the left-right & up-down in a
non-uniform manner. So we get the three dimensional blurred version of T1 FS. The blurring
accounts for the presence of uncertainties in the measurement operations being performed by
sensors & accompanied circuitry. A Tilde Symbol over the name of the fuzzy set signifies that it
is a type-2 FS.
5
Next in the process of generation of T2 FS is cleaning things up, so as to get the sharp
boundaries of the T2-FS which can be used further for the inferencing process (see Fig. 1.6).
"Clean things up" means using well-defined geometric shapes for the upper and lower bounds
of the blurred MF. Here we use a trapezoid to clean up the upper bound of the blurred MF, and
a triangle to clean up the lower bound of the blurred MF. Fig. (1.6) above explains the cleaning
up process for IT2-FS.
MATLAB is an interactive system whose basic data element is an array that does not require
dimensioning. This facilitates solving many technical computing problems, especially those
with matrix and vector formulations which are harder to implement in other non-interactive
languages such as C or FORTRAN. It integrates computation, visualization, and programming
in an easy-to-use environment where problems and solutions are expressed in familiar
mathematical notation. Typical uses include:
B. Algorithm development
C. Data acquisition
G. Graphics
In industry, MATLAB is the tool of choice for high-productivity research, development, and
analysis. MATLAB features a family of add-on application-specific solutions called toolboxes.
Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized
7
technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that
extend the MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural networks, fuzzy
logic, wavelets, simulation, and many others. The MATLAB system consists of five main parts:
This is the set of tools and facilities that help you use MATLAB functions and files. Many of
these tools are graphical user interfaces. It includes the MATLAB desktop, command window, a
command history, an editor and debugger, and browsers for viewing help, the workspace, files,
and the search path. Figure (1.8) below shows snapshot of MATLAB development environment.
This is a vast collection of computational algorithms ranging from elementary functions like
sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse,
matrix eigen values, bessel functions, fast fourier transforms & lot more.
8
1.4.3 The MATLAB Language
This is a high-level matrix/array language with control flow statements, functions, data
structures, input/output, and object-oriented programming features. It allows both
"programming in the small" to rapidly create quick throw away programs, and "programming
in the large" to create large and complex application programs.
1.4.4 Graphics
MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as
annotating and printing these graphs. It includes high-level functions for two-dimensional and
three-dimensional data visualization, image processing, animation, and presentation graphics. It
also includes low-level graphics control functions for full customization of the appearance..
This is a library that allows you to write C and Fortran programs that interact with MATLAB. It
includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a
computational engine, and for reading & writing MAT-files.
FLS & T2: A Fuzzy controller can be specially suited to embed the human knowledge to
manually drive a vehicle without having a complete analytical model. Much of the research has
been carried out in implementing the type-1 fuzzy rule based controllers to handle the problem
of automatic navigation. Type-2 fuzzy sets is quite novice research area, being preferred than
type-1 fuzzy sets to better handle the uncertainties and noise in the inputs because of its two or
9
three dimensional expansion. Only recently some attempts have been made to use type-2 fuzzy
sets to handle this problem. For this research work, a special class of type-2 fuzzy sets i.e.
interval type-2 fuzzy sets have been chosen without any significant loss to the generality of the
solution.
10
involve artificial intelligence based reasoning to steer the vehicle to achieve its target. Stepwise
details of the tasks undertaken to accomplish this work has been given below:
Clearly defining the goal i.e. decided the area for which the system has to be designed. To
study this problem, the area 200 * 200 units i.e. 40000 square units on the screen had been
selected as Overall Navigational Area (ONA), in which simulation has been performed.
Decided the model of the vehicle to be simulated. To study this problem, dimensions of the car
ALTO : 2005 model, Make : Maruti were measured. All the measurements related to its
geometry e.g. length, width, tyre size, tyre radius, position of the front and rear axle, distance
between front and rear axle etc. were taken. The vehicle drawn in the simulation has geometry,
which is in proportion to this selected model. The geometrical variables have been scaled
accordingly for proper viewing on the simulation screen.
Design of the simulation module, to position the vehicle at a specified position and give it
motion in the required orientation by designing a suitable trajectory traversing algorithm, which
can accept various user preferences such as initial pose, trails selections, fuzzy parameters etc.
Initially Type-1 based system had been developed which could be converted into Type-2 based
system. The system was designed in the form of FIS (Fuzzy Inference System) file using type-
1 based fuzzy logic toolbar available in MATLAB.
Designing of graphical user interface (GUI) to interface & interlink simulation module i.e.
Trajectory Controller(TC) & the fuzzy logic based steering control system module, which
could enable passing the various positional, navigational and fuzzy preferences to the system to
visualize simulations in different modes.
Programmed the complete type-1 based control system without using inbuilt fuzzy logic toolbar
of MATLAB for further conversion into type-2 based system, as no toolbar is available in
11
MATLAB for type-2 based system development. All operations had to be programmed from
scratch.
Programmed the complete type-2 Based system from the type-1 based system software. It
incorporated the introduction of the parameter Delta , which is for the expansion of the T1
fuzzy sets so as to realize their interval T2 version.
Modified GUI to incorporate the parameters of Type-2 based system such as width of interval
Type-2 FS.
Developed the simulator to study the response of the system w.r.t the variations in the width of
the interval type-2 fuzzy sets. It generates the waveform of distance to travel (D) vs. FOU
width (W) for a selected set of observational parameters and initial position.
I. First part covers introduction and literature survey, which includes chapters 1 & 2.
II. Second part covers the overall work done to develop the complete model. This part
includes chapters 3 to 7.
III. Third part is the conclusive one containing two chapters which are results & discussion
and last one i.e. conclusions & future scope.
12
CHAPTER 2
2 LITERATURE REVIEW
This chapter includes literature review on trajectory traversing techniques, non-fuzzy & fuzzy
autonomous navigation techniques, type-1 fuzzy techniques, type-2 fuzzy logic systems and
navigational techniques using type-2 fuzzy logic systems, use of matlab/simulink to design
simulators and finally use of low cost sensors and camera for autonomous navigation.
Scheuer et al [2] in 1997 extended their earlier work [1] to remove the motion constraint at
discontinuities by designing a path comprising of pieces, each piece being a line segment, a
circular arc of maximum curvature or a clothoid arc, called as simple continuous curvature
paths(SCC). The earlier limitation was removed by adding the continuous curvature constraint
and a constraint on the curvature derivative to imply that car like vehicle could orient its front
13
wheels with a small finite velocity. Result was a first path planner for a car like vehicle to
generate collision free path with continuous curvature and maximum curvature derivative
which was experimentally verified.
Th. Fraichard et al [4] in 1998, presented the first path planner taking into account both non-
holonomic and uncertainty constraints. He proposed the algorithm to compute feasible and
robust path, assuming the existence of the landmarks to allow the robot to re-localize itself.
While navigating, control and sensing errors were supposed to remain within bounded sets. The
solution featured a robot independent global planner relying on robot specific local path
planner, adaptable to a wide variety of robots and uncertainty models.
Minguez et al [5], in 2002, addressed the problem of applying reactive navigation methods to
non-holonomic robots. Rather than embedding the motion constraints when designing a
navigation method, they introduced the robots kinematic constraints directly in the spatial
representation by applying a transform to the conventional workspace model or configuration-
space model. In this space - the Ego-Kinematic Space the robot moves as a free-flying
object, thus facilitating the application of majority of research of free-flying reactive
navigation algorithms to non-holonomic robots. This methodology can be used with a large
class of constrained mobile platforms e.g. differential-driven robots, car-like robots, tri-cycle
robots etc. They demonstrated experiments involving non-holonomic robots with two reactive
navigation methods whose original formulation did not take the robot kinematic constraints into
account ( Nearness Diagram Navigation and a Potential Field method).
14
Igor E. Paromtchik [6], in 2004, addressed planning control commands of the steering angle
and velocity for low-speed autonomous parking maneuvers in a constrained traffic
environment, by making use of conformity between the control commands and resulting shape
of the path. The path shape required for a parking maneuver was evaluated from the
environmental model. The corresponding control commands were selected and parameterized
to provide motion within the available space, to be executed by the car servo systems to drive
the vehicle into the parking place. The approach was tested on a CyCab automated vehicle. The
experimental results on a perpendicular parking maneuver were described; the obtained results
proved the effectiveness of autonomous perpendicular and parallel parking maneuvers.
A. Identifying the current location of the robot, and the current location of objects in its
environment.
B. Avoiding any immediate collisions facing the robot i.e. reactive behavior.
D. Resolving any conflicts between the previous two subtasks, taking into account the
kinematics of the robot.
15
from the obstacles, while pulling it towards the goal. The robot moves in the direction of
greatest negative gradient in the potential. Despite its simplicity this method can be effectively
used in many simple environments.
Ollero et al. [9] in 1997, proposed a fuzzy explicit path tracking method, applied to mobile
robots RAM-1 and AURORA. They used a fuzzy rule based system to track a pre-computed
path for a non-holonomic small size robot which was intended to handle complex and non-
linear kinematics and dynamics, and to model the interaction between wheels and ground. They
concluded that fuzzy controllers cope well with the incomplete and uncertain knowledge
inherent to the subsystem interactions and non-linearities & are specially suited to embed the
human intelligence in the form of fuzzy rule base.
Koay Kah Hoe [10], in 1998, developed a fuzzy expert system for the golf cart navigation
control problem, for golf cart to navigate to final destination avoiding the known obstacles.
FLC was simulated on PC as well as implemented in hardware. The problem of navigation has
been depicted in Fig. (2.2).
FIGURE 2.2: FLS VARIABLES FOR GOLF CART AUTONOMOUS NAVIGATION PROBLEM
16
Model had been tested and simulated in the block diagram based simulation environment using
Simulink. Simulated results were quite satisfactory as the cart could navigate to final
destination with any of the initial set position and orientation. Fuzzy input/output variables used
by the control system are as tabulated in table (2.1).
TABLE 2.1: A FUZZY STEERING CONTROL SYSTEMS INPUT & OUTPUT VARIABLES
Th. Fraichard & Ph. Garnier [12] in 2001, worked on the reactive component of motion
autonomy by designing a fuzzy controller named as Execution monitor, to generate
commands to servo systems of the vehicle so as to follow a nominal trajectory while reacting in
real time to unexpected events. The logic of EM was based on fuzzy logic, which incorporated
Fuzzy rules encoding the reactive behavior of the vehicle, aggregating the several basic
behaviors of motion of such vehicles. Each of the basic behavior was encoded into specific set
of the rules. Weighing coefficients could be added to different rules. Experiments results
carried were quite satisfactory to perform the trajectory following and obstacle avoidance in
real outdoor environment.
17
steering of an agricultural utilities-based robot ROJO, to reach a final position and orientation
from an initial one. The system was developed based upon the knowledge extraction from the
experts and presented in the form of fuzzy sets and rule-base to make the decisions for the
steering and velocity controls of the vehicle. The System was implemented in hardware as well
as simulated to check the navigational behaviors. Complete maneuvering process was divided
into three zones:
(1) Approximation zone Active if vehicle is quite far from goal, steering commands lead
vehicle just to approach the goal without minding the orientation.
(2) Preparation zone Steering commands drive the robot to opposite direction to that of goal
orientation to anticipate the goal orientation in shorter distance.
(3) Orientation zone Meant to achieve the final orientation, in which steering commands lead
to shortening of longitudinal as well as angular distance from the goal. Switching on the
behavior between three zones depends upon the absolute value of orientation angle of vehicle
with respect to goal orientation.
Dongming Wang and Levent Acar [15] in 1999, compared the type-2 fuzzy sets preliminaries
with the ordinary type-1 fuzzy sets, proved two theorems, one to generate the general form of
the type-2 operations, and second to transfer the type-1 fuzzy uncertainties to a type-2 fuzzy
uncertainties. They worked on fuzzy operations like union, intersection & complement, and on
fuzzy relations. Second theorem related the uncertainties of the noise in the variables as
collections of membership functions assigned to nominal values of the variables. They
concluded that a type-2 fuzzy system could handle the uncertainties in the rules, in the system
parameters and in the system inputs.
Mendel in [16]-[21], 2000-04, extended the same concept in various dimensions and raised the
use of interval type-2 fuzzy sets (IT2 FS) to a more general case, i.e., T2 FS to handle
uncertainties due to at least four sources in T1 FLS: (1) The words that are used in the
antecedents and consequents of rules can be uncertain (words mean different things to different
18
people), (2) Consequents may have a histogram of values associated with them, especially
when knowledge is extracted from a group of experts, who do not agree at all, (3)
Measurements that activate a T1 FLS may be noisy and, therefore, uncertain and (4) The data
that are used to tune the parameters of a T1 FLS may also be noisy. All of these uncertainties
translate into uncertainties about fuzzy set membership functions.
Hani Hagras [22], [23], in 2004 used T2 FLS to implement different robotic behaviors on
different robotic platforms for indoor and outdoor unstructured and challenging environments.
This resulted in a very good performance that outperformed the T1 FLS whilst using smaller
rule-base. Architecture was based on IT2 FS to implement the basic navigation behaviors and
the coordination between these behaviors produced a T2 HFLC (Hierarchal Fuzzy Logic
Controller), which further, simplified the design and reduced the rule-base size determined to
have the real time operation of the robot controller.
K. Rudzinska et al [25], in 2005, examined the validity & performance of the virtual
reality(VR) simulation/control system in an experimental environment. The corresponding
models of the space consisting of several rooms connected by a narrow space hallway and the
robot were created using three-dimensional VR graphics. The robot task was to navigate from a
given start to a selected target. For each trip, called a mission, a collision-free feasible
trajectory was generated by DRPP algorithm (Dijkstras algorithm adapted to robot path
planning) or determined by the human operator. However, the purpose of the system was not
only to simulate the robot motion in three-dimensional world of virtual reality, but also to
create a human interface system for tele-operation of a robot.
Vahid Rostami et al [26], in 2005, developed fuzzy control to correct three wheel omni-
directional robot motion to catch the target. Project was implemented for a middle sized robot
soccer team. Results of implementation of precise mathematical logic based controller (PID)
with fuzzy controller were compared. PID controller was found to have overshoot in the x
19
position & y position as well as settling time of 0.08 seconds. Concept of feedback was used to
remove these errors. Results also simulated in matlab/simulink fuzzy logic toolbox, showed
quite good improvement on overshoot as compared to conventional PID controller.
* Khepera is a differential drive robot, comes with the simulator(Linux version only), serial link capability, two
wheels and eight infra red sensors, particularly useful for rapid initial testing in real world environments.
**DS1104 is a general-purpose rapid prototyping control board fully programmable in matlab/simulink
environment using Real Time Workshop routine
20
CHAPTER 3
3 DESIGN OF TRAJECTORY
TRAVERSING ALGORITHMS
This chapter discusses design of two types of trajectory traversing techniques: Linear Paths
Approximation (LPA) & Continuous Curves Approximation (CCA), & their integration with
fuzzy logic based steering control system while LPA or CCA being the algorithm implemented
in trajectory controller (TC).
In trajectory traversing module, given the initial position, next position has to be calculated in
terms of the variables x, y and . Plotting of the vehicle is done w.r.t the mid point of the rear
axle which also defines the position of the vehicle as: ( x, y, ) .
21
3.1 Linear Paths Approximation
In this method, motion of the vehicle is divided into two parts: - main component at front axle
and its effect in turn at rear axle. For this two geometrical points are considered:
Both the points are subjected to a small linear motion. Let point ( xa, ya ) is subjected to a small
linear motion in the direction parallel to the direction of front wheels. As shown in the Fig.
(3.2), points ( x, y ) & ( xa, ya ) are subject to transformation ( x' , y ' ) & ( xa ' , ya ' ) respectively.
This transformation in T is taken as input to our trajectory calculation algorithm to get the
outcome transformations as shown in the block diagram representation in Fig. (3.2).
As per Fig.(3.3), following transformations have to be calculated to completely define the new
position of the vehicle:
v v _ rear
22
FIGURE 3.3: LINEAR PATHS APPROXIMATION METHOD FOR TRAJECTORY TRACING
gamma = = T + , where
: Angle of the front wheels w.r.t. horizontal axis. Therefore it is also subject to transformation
as:
'
Let us say a small linear motion d is applied at ( xa, ya ) . If we have to perform every iteration
after time interval t ,
d = v t ,
d = v
23
y ' = y + v _ rear. sin( ' ) ----------(3.4)
As per the geometry of the vehicle, points ( x, y ) & ( xa, ya ) can also be calculated as:
xa = x + d . cos( )
----------(3.5)
ya = y + d . sin( )
----------(3.6)
xa ' = xa + v. cos( ' ) i.e. x'+ d . cos( ' ) = [ x + d . cos( )] + v. cos( ' )
d .[sin( ' ). cos( ) cos( ' ). sin( )] = v.[sin( ' ). cos( ' ) cos( ' ). sin( ' )]
----------(3.11)
24
d [sin(Steer _ V )] = v[sin(T ' )]
v
=> Steer _ V = sin 1 . sin( T '
d
v
' = + sin 1 . sin( T '
d ----------(3.12)
25
3.2 Continuous Curves Approximation
In this algorithm, path is considered to be made up of the continuous curves each with the
radius decided by the angle of front tyres w.r.t vehicle. The total path is calculated step by step
with the every iteration based upon the current value of the tyre angle w.r.t vehicle axis. Angle
of the front tyres is being calculated by the underlying fuzzy logic based control system. Unlike
LPA, in CCA point (x, y) is subject to same velocity as that of (xa, ya) i.e. velocity v for both as
set by GUI control.
Observe the Fig.(3.5), where a curved section of the motion is shown with its start ( x, y, xa, ya )
Radius of the curvature, from Figs. (3.5 & 3.6) can be given as:
d
R=
Tan( T ) ----------(3.18)
As shown in Fig. (3.5 and 3.6) showing parameters transformation, equation of the curve can
be given as:
26
( X a ) 2 + (Y b) 2 = R 2
----------(3.19)
FIGURE 3.5: TRAJECTORY CALCULATION USING CONTINUOUS CURVES PATH TRACING ALGORITHM (CCA)
As ( x, y ) is start point of the curve and ( x' , y ' ) is the end point of the curve so both are
supposed to be present on the curve as per following equations :
( x a ) 2 + ( y b) 2 = R 2
----------(3.20)
( x' a ) 2 + ( y 'b) 2 = R 2
----------(3.21)
From the start position triangle CKS, Fig. (3.6), Center of the curvature (a, b) is given as:
a = x R.Sin( )
----------(3.22)
b = y + R.Cos ( )
----------(3.23)
27
Similarly from the new position triangle CKE, see Fig. (3.6), transformed point ( x' , y ' ) is
given as:
From Fig. (3.6), arc length moved by the vehicle is decided by the velocity of the vehicle. Let
28
t : Smallest time interval, taken as the step size for each Iteration.
d = v.t
arc _ length d
= =
radius R
d v.t v
= = =
R R R
v
= . tan( T )
d
v
' = + . tan( T ) ----------(3.28)
d
SPECIAL CASE ( T = 0)
d
As R=
Tan( T )
From equations (3.26) and (3.27), as ( x' , y ' ) are in terms of R , MATLAB will return as:
y' = NaN
29
There will be an error in trajectory algorithm. To avoid this it is appropriate to apply the linear
approximation algorithm in this special case.
' =
In the simulation, we are drawing the vehicle with respect to the rear axle mid point with the
given orientation . So the set of these three parameters i.e. ( x, y, ) completely defines the
position of the vehicle. So the complete trajectory calculation for CCA can be defined by
following set of equations:
30
CHAPTER 4
The FIS Editor handles the high-level issues for the system such as: How many inputs and
output variables?, What are their names? etc. The fuzzy logic toolbox doesn't limit the
number of inputs. However, the number of inputs may be limited by the available memory of
machine. If the number of inputs is too large, or the number of membership functions is too big,
then it may also be difficult to analyze the FIS using the other GUI tools.
The Membership Function Editor is used to define the shapes & range of values of all the
membership functions associated with each variable. The alteration can be done either by using
31
range setting text box or by graphically dragging the membership function arms using mouse
based control.
The Rule Editor is for editing the list of rules that defines the behavior of the system.
Antecedent (input) variables or their negated version can be connected by using and or or
operator for a particular consequent (output) variable or its negated version. Rule thus made
will be of the form such as:
X_Pos & Phi are antecedents and Steer is consequent, LE & RB are corresponding membership
functions, bracketed 1 signifies the weight of the corresponding rule. In this way we can add as
many rules as our system needs. However there is limitation of this rule-editor that it doesnt
check for error of duplication of any of the rules.
The Rule Viewer and the Surface Viewer are used for looking at, as opposed to editing, the
FIS. They are strictly read-only tools. The Rule Viewer is a MATLAB based display of the
fuzzy inference diagram shown at the end of the last section. Used as a diagnostic, it can show
for example which rules are active, or how individual membership function shapes are
influencing the results.
The Surface Viewer is used to display the dependency of one of the outputs on any one or two
of the inputs i.e. it generates and plots an output surface map for the system. The surface
generated by the rules can be viewed in 3D also for better visualization. Surface viewer can
give important information regarding stability and accuracy of the system. There should be
smooth variations in consecutive rules, which generate a smooth surface. Therefore smoother
the variations in the surface, better performance can be expected from the system. However if
the surface is not showing smooth variations i.e. there are sharp edges, system is expected to be
less stable & accurate and our rules need to be revised.
32
output. The steering is applied to the vehicle, which is obtained from output of FLS, as the
updated value of front wheels angle.
This step was tested and tried by taking different number & types of parameters. However
selection of the parameters is limited by some restrictions on number & properties of
input/output variables. Number of input variables has to be kept to minimum to achieve the
required objective, as there has to be smoothness of the variations in the input & output
variables from one rule to next rule. It is difficult to maintain the smoothness in case number of
variables is large. It means the output of one rule may interfere with the output of the other rule
in case there are too many input variables. Two of the cases have been studied as follows.
4.2.1 Case 1
Number of variables on input side is more in this case. It may give more accurate results as it
divides the Overall Navigational Field(ONF) into more number of blocks as shown in Fig.
(4.1). Therefore more number of rules and consequently more control over the vehicles motion
is expected. However it was observed that it was not feasible to maintain the smoothness in
variations in the output variables in consecutive rules. Because of this, unexpected behavior in
the motion of the vehicle was observed in simulation. It was found to stuck at number of places
because of interference between the rules of consecutive blocks. Hence it was found that in
CASE 1, it is not possible to obtain the desired objective of achieving the target parking
position.
33
FIGURE 4.1: DIVISION OF COMPLETE NAVIGATIONAL SPACE BY MFS OF INPUT VARIABLES ( X_POS, Y_POS )
4.2.2 Case 2
Following tabulates the fuzzy input/output variables in this case which are lesser than those in
case 1.
In case 2, the number of variables is less, therefore the overall navigational area is divided into
lesser number of blocks as shown in Fig. (4.2). So lesser number of rules will control the
vehicles motion, therefore looser control over the vehicles motion is expected. However it
was observed to be more practical solution with certain limitations. It was found as a more
feasible solution to maintain the smoothness of variations of the output variable, so as to reduce
the inferential effects. Smooth motion was observed in CASE 2.
FIGURE 4.2: DIVISION OF OVERALL NAVIGATIONAL SPACE IN BLOCKS BY MFS OF INPUT VARIABLE X POSITION
34
4.2.3 Comparison of Case 1 and Case 2
From above study, it is clear that CASE 2 is clear selection to go ahead to solve the problem
however there are certain limitations on the initial pose of the vehicle. It is not possible to
achieve the desired objective in all the initial poses because of requirement of more complex
maneuver such as negative velocity in such cases. e.g. for initial pose (40,180,135), Fig. (4.3)
shows the simulation results for an unsuccessful case of path tracing, in which the final target
position couldnt be achieved.
It is divided into five horizontal regions as given below in tabular & pictorial representations.
35
FIGURE 4.4: MEMBERSHIP FUNCTIONS OF X_POS
It is divided into seven angular regions as defined below in tabular & pictorial representations.
This steer value obtained from fuzzy system is set as front wheels angle. Vehicle steer is
derived from the front wheels angle. It is divided into seven angular regions as defined below
in fuzzy system.
36
TABLE 4.5: MEMBERSHIP FUNCTIONS OF STEER
37
4.6 Type-2 Fuzzy Sets
FLC has been designed on the basis of input type-1 fuzzy sets being transformed into type-2 by
adding the uncertainty through the variable delta to flatten T1 fuzzy sets. However output
variable Steer has been handled by T1 fuzzy sets only. (see Fig. 4.7).
I. Finding degree of membership of X_Pos & Phi inputs, which returns continuous range
of values between its points of intersection with its LMF (lower membership function)
& UMF (upper membership function).
38
II. Thereafter calculation of firing interval is done. Fuzzy rules are fired twice for each
single crisp input, firstly, for LMF and secondly, for UMF that leads to two level
clipping of consequent T1 FS, as shown by dark shaded regions in Fig. (4.8) for two
fired rules.
III. The mathematics of interval T2 fuzzy logic system reveal that instead of computing a
single Type-1 rule output FS, we have to compute two such fuzzy sets for each fired
rule: LMF & UMF. Each involves separate Type-1 FS calculations, one for the LMF
and one for the UMF of the fired rule-output fuzzy sets. The result is a fired-rule-output
interval T2 FS, or FOU, shown shaded in Fig. (4.8) for two rules separately i.e. rule #1
& rule#2.
IV. Composition i.e. aggregation of all of the output fuzzy sets from fired rules to get the
combined FOU (Footprint of Uncertainty) see Fig. (4.8). Aggregate resultant output FS
for all fired rules is achieved by using MAX operator (s-norm).
39
V. Each of aggregated LMF and UMF is then computed for the centroid as Steer_L and
B~ ( yi ) B~ ( yi )
Steer_H. If and are the aggregated output UMF and LMF
corresponding to ith fired rule from total N (=35) number of rules, then Steer_L &
Steer_H can be given as:
iN= 1 y ~ ( y )
i B i
Steer _ L =
iN= 1 B~ ( yi )
&
iN= 1 y ~ ( y )
Steer _ H = i B i
iN= 1 B~ ( yi )
40
Output steer is composed of two parts Steer_L & Steer_H (see fig. 4.9) which have been
obtained by type-1 operations on LMF & UMF respectively. The values are calculated by
finding COA (Center of Area) in each of the case as:
35
( Ri _ XL _ 1 + Ri _ XL _ 2) Ri _ YL
i =1
Steer _ L = 35
Ri _ YL
i =1
Where Ri_XL_1 & Ri_XL_2 (see Fig. 4.8) are points of intersection of lower bound of ith
rules firing interval with corresponding output fuzzy set of Steer.
35
( Ri _ XH _ 1 + Ri _ XH _ 2) Ri _ YH
i =1
Steer _ H = 35
Ri _ YH
i =1
Where Ri_XH_1 & Ri_XH_2 (see fig. 4.8) are points of intersection of upper bound of ith
rules firing interval with corresponding output fuzzy set of steer. Output de-fuzzified crisp
value is obtained as (see fig. 4.9):
Steer _ L + Steer _ H
Steer =
2 .0
41
CHAPTER 5
w.r.t. horizontal axis. The angle T is the angle of the front tyres w.r.t the vehicles axis that
can steer between [-40 +40]. The vehicle length (L=30 units) to width (W=12.8 units) ratio is
kept same as of majority car-like vehicles.
5.2.1 Point P0
w
x0 = x t _ ofsl * cos( Angle _ V ) + sin( Angle _ V )
2
w
y 0 = y t _ ofsl * sin( Angle _ V ) cos( Angle _ V )
2
43
5.2.2 Point P1
w
x1 = x t _ ofsl * cos( Angle _ V ) sin( Angle _ V )
2
w
y1 = y t _ ofsl * sin( Angle _ V ) + cos( Angle _ V )
2
5.2.3 Point P2
w
x 2 = x t _ ofsl * cos( Angle _ V ) + sin( Angle _ V ) + l cos( Angle _ V )
2
w
y 2 = y t _ ofsl * sin( Angle _ V ) cos( Angle _ V ) + l sin( Angle _ V )
2
5.2.4 Point P3
w
x3 = x t _ ofsl * cos( Angle _ V ) + l * cos( Angle _ V ) * sin( Angle _ V )
2
w
y3 = y t _ ofsl * sin( Angle _ V ) + l * sin( Angle _ V ) + * cos( Angle _ V )
2
&
44
t 2 _ sy = t 2 _ y t _ halflen * sin( Angle _ Fi )
&
&
&
&
&
There are some errors taken into account while parking named as: Distance Error(DE) &
Orientation Error(OE) which falls under the category of Positional Errors.
46
5.6.1 Orientation Error (OE)
Orientation error is taken as the deviation from required final orientation i.e. 90 degrees.
Therefore it is specified as:
OE = 90 Angle _ V
Because angle _ v specifies current vehicles orientation w.r.t horizontal. There is certain
maximum limit put on this error which accounts for the bearable uncertainty in final parking
position and orientation. This maximum permissible limit has been taken as:
So final permissible orientation range is from (90-16) to (90+16) i.e. Angle_V falling in range
from 74 to 106 degrees beyond which it can be declared as unsuccessful case (UC) which
means that system is not able to approach the final parking position with current set of
navigational and positional parameters.
Distance error is taken as the deviation from the central vertical axis aligning with the goal
location i.e. w.r.t x=100. Therefore it is specified as:
DE = (100 x)
The maximum permissible value of DE has been calculated to be a function of OE _ MAX &
length (l ) of the vehicle as:
l
DE _ MAX = [ cos(90 OE _ MAX )] + x _ m arg in
2
Where x _ m arg in is the permissible margin between vehicles boundary and parking place
boundary and its value has been fixed as 2.5. Therefore the maximum range of the x position at
final parking location can be given as:
Unsuccessful cases due to unbearable orientation or distance error are shown as dark -
symbols on the D_W plots in Fig. (8.10), which gives the visual effect of thick line along the
plot.
47
5.6.3 Non-Converging Case (NCC)
This error belongs to the category of navigational error, occurs when the vehicle has adopted a
completely non converging path and therefore not even has been able to approach the y
component of the goal position. Unsuccessful cases due to this error are shown as vertical lines
in the final D-W plots.
III. Initial position is passed to other MATLAB file auto_car.m which simulates the
motion.
V. Fuzzy control system is invoked to obtain the updated value of vehicles steering angle.
VI. Steering angle is taken as updated value of the front wheels angle i.e. T ' .
VII. Updated value of the vehicles axis angle i.e. Angle_V is calculated from the
mathematical equation as per the selected trajectory traversing algorithm.
VIII. The iterative process repeats itself till the time y co-ordinate of the position i.e. Y_Pos
value is less than (Y_Max-5) i.e. (200-5) = 195.
48
CHAPTER 6
6 DESIGN OF GRAPHICAL
USER INTERFACE
This chapter discusses use of GUIDE, a matlab based tool to design graphical user interfaces,
various GUI controls implemented which includes simulation parameters such as initial
position, wheels angle, configuration string, trails selections, Start/Pause/Resume simulation,
fuzzy system parameters such as t-norm selection, width of interval type-2 fuzzy sets and
finally manual steering controls.
6.1 GUIDE
GUIDE (Graphical User Interface Development Environment), provides a set of tools for
creating graphical user interfaces. These tools greatly simplify the process of designing and
building GUIs.
49
To start GUIDE, guide command is entered at the MATLAB prompt. This displays the
GUIDE quick start dialog box (See Fig. 6.1).From the quick start dialog we can create a new
GUI from one of the GUIDE templates pre built GUIs that we can modify for our own
purposes or open an existing GUI.
Using the GUIDE layout editor, we can lay out a GUI easily by clicking and dragging GUI
components such as panels, buttons, text fields, sliders, menus, and so on, into the layout area.
GUIDE automatically generates an M-file that controls how the GUI operates. The M-file
initializes the GUI and contains a framework for all the GUI callbacks, which are the
commands that are executed when a user clicks a GUI component. Using the M-file editor, we
can add code to the callbacks to perform the functions we want them to. Therefore GUI can be
executed by running this .m i.e. MATLAB file associated with GUI.
I. Simulation parameters
Simulation parameters includes positional parameters, velocity, configuration string, vehicle &
tyres angle & trails selections.
6.2.1.1 x
6.2.1.2 y
50
FIGURE 6.2: TRAILING MOTION SIMULATION & DETAILS OF GUI OPTIONS
6.2.1.3 Angle_V
Angle of the vehicles axis with respect to horizontal axis at initial position.
6.2.1.4 Angle_T
Angle of the front wheels with the vehicles axis at initial position.
6.2.1.5 Velocity
velocity component at front axle mid point in case of LPA, otherwise in general velocity of the
vehicle.
6.2.1.6 Conf
It signifies initial positional configuration of the vehicle. This information is stored in the log
file as title showing the initial configuration E.g. LE-LB means initially the vehicle is in the
region with X position in the region left and Phi in the region left below.
51
6.2.1.7 Show trails
This is the check box to show/hide the trails of moving vehicle. If selected than following of
the trails can be visualized
A. Trailing front tyres: Check box to show/hide the trailing front tyres.
B. Trailing rear tyres: Check box to show/hide the trailing rear tyres.
D. If none of the above three options is selected to be shown as trails, only the trailing dot
on the center of the rear axle is found to be visible.
Starts the simulation of vehicles autonomous navigation to achieve the target parking position.
This control pauses simulation when switched from de-selected to selected state while
simulation is running. & resumes the paused simulation if switched from selected to de-selected
state.
Clears the axis window & Clears all the variables including the persistent variables to restart
the simulation from starting position.
It discusses fuzzy parameters being used to control system which are FOU width & t-norm
selections.
It is the uncertainty content of Interval Type-2 fuzzy sets which can be set by the user through
this GUI option. If the width is equal to zero, system is equivalent to Type-1 fuzzy system. If
the width is non-zero, the fuzzy set is said to belong to Type-2.
It selects the t-norm for combining multiple antecedents to constitute fuzzy rules. MIN
corresponds to minimum t-norm, and PRO corresponds to product of two fuzzy sets during
implications.
52
6.2.3 Manual Controller Interface
Apart from the automatic motion simulation, manual controls for motion simulations have also
been provided in the GUI. Two types of manual controllers have been designed, first one is
mouse operated and second one is keyboard operated.
This button is used to start the mouse based manual controller. Four of the buttons controls the
operation as:
Starts the keyboard based manual controller. Keys assignment is done for various functions as:
53
CHAPTER 7
7 SOFTWARE ARCHITECTURE
This chapter discusses details of the matlab files & functions implemented for complete system
belonging to their function based category: steering control system, automatic motion
simulation programs, manual motion simulation programs & GUI. It discusses tasks being
performed by each file, its usage, arguments being passed, return types & its interlinking with
other files. This chapter also introduces some new terms such as tuning factor & turning ratio.
A convention has been adopted in this chapter that names of the files in headings have been
shown in italics.
7.1.1 dom_xpos.m
This function program handles the x position input, finds its degree of membership (dom) with
the activated membership function of x position.
Usage
54
delta: Width of Interval Type-2 fuzzy set, representing noise associated with the measurement
of the x position.
Membership function is of type interval type-2 fuzzy set. So it is composed of two boundaries
defined as LMF (lower member ship function) & UMF (upper membership function). So
degree of membership is obtained as a range of values bounded by interception with the LMF
and UMF. If delta = 0 , LMF and UMF will coincide, hence the variable will work as type-1
variable.
7.1.2 dom_phi.m
Phi is the variable name for the vehicles axis angle with the horizontal axis. This function
computes the degree of membership of input Phi with activated fuzzy set of the fuzzy
variable Phi.
Usage
match: (1*1) element vector, degree of membership with activated fuzzy set.
Arguments
7.1.3 steering.m
This function calculates the steering value outputs corresponding to a particular rule. The
function is called from another function fire_rule.m for a corresponding rule.
Usage
55
range: Membership function selected, a numeric value as:
1 = NB, 2 = NM, 3= NS, 4 = ZE, 5 = PS, 6 = PM, 7= PB .
Same file is used in type-1 and type-2 operations, in type-1, it is called only once by the
fire_rule for the given rule, however it is called twice in type-2 system, once for LMF and
secondly for the UMF.
7.1.4 fire_rule.m
56
7.1.5 inference.m
It performs the inference, performs the rule firing from rule #1 to rule #35 i.e. all rules.
Performs the defuzzification to calculate the final steering value. The defuzzification technique
being used is COG (center of gravity).
Usage
7.1.6 init_rule_matrix
This program creates the rule matrix from the rule base of the fuzzy system. It is (35*3) matrix
owing to following parameters of fuzzy system:
Number of rules : 35
Number of input variables : 2
Number of output variables : 1
Total Number of I/O variables : 3
=> rows of rule matrix : 35
columns of rule matrix : 3
Rules can be decoded from the rule matrix as rule #1 data from the rule matrix is:
57
which interacts with GUIs matlab file. All the parameters from the graphical user interface
(GUI) are passed to this main file for performing autonomous navigation. This program is
performing following tasks :
Plots the boundary of the target location which is (100, 200) point on the plot. The target
boundary is shown in the red color.
Traces the points of the vehicle w.r.t. the reference point using the given angle with horizontal.
Reference point is the mid point at the rear axle. Its initial position is passed from the GUI and
named as (x, y) point in the program. The reference point is highlighted with some specific
color. The color selected for showing the reference point depends upon
Traces the points of the four tyres from the given tyre angle named as Angle_T in the program,
and from the geometrical parameters of the vehicle specified. Front tyres are plotted as red and
rear tyres as green. As it is apparent that initial value of Angle_T passed from GUI is applied at
front tyres while rear tyres are parallel to the axis of the vehicle.
Calculates the new position based upon the selection of trajectory algorithm. Two of the
trajectory algorithms are available.
58
7.2.6 Normalizing of Vehicles Orientation Angle
Normalizing the Angle_V ( angle of vehicles axis w.r.t horizontal) .The range of this angle as
specified by the fuzzy system is 100 to +300. The normalizing of the angle is done as:
A log file is created to log the records corresponding to each iteration in trajectory
tracing. The name of the log file is generated from three parameters:
e.g. if the user sets the x=10, y=20, then x position corresponds to LE (left) fuzzy set.
Different parameters per record which are being logged in the log file are:
Tuning of steer angle means amplifying the steer angle to tune the steering to the geometrical
parameters of the Overall Navigational Field (ONF) and vehicle so that vehicle can
successfully approach the target. If the steer is too small or too large per iteration then vehicle
may not get steered to target location. So steering angle obtained from the fuzzy system is
multiplied by a factor called as Tuning Factor(TF). The selection of value of TF depends
upon ONF & vehicles geometry as:
59
i) ONF
TF depends on the length and width of the ONF. Larger the area of the ONF looser will
be the constraint on the steering. So larger the area of ONF, lesser the value of TF.
Length of the vehicle effects its steering. From the equations of the vehicle steer in both
of the algorithms, vehicle steer is related to length of the vehicle as:
1
vehicle _ steer
d
So more the length of the vehicle, lesser will be the vehicles steering obtained from same
amount of wheels steering angle. Therefore large tuning factor is required for vehicles with
large length . This factor can be highlighted by an another term called as Turning Ratio.
It can be defined for any vehicle as ratio of vehicular steering angle to required wheels steering
angle.
1
Turning Ratio
d
It is required to maintain suitable value of turning ratio to successfully approach the target
location. Therefore appropriate tuning of Turning Ratio is performed by selecting the
appropriate value of Tuning Factor by trials.
60
7.2.10 Trails
if ON , trails are shown as per selection of different trails, which are as:
A flag variable is passed from GUI to program as argument corresponding to each of the trails
selection tabulated as:
Color selection of trailing dot on mid point of rear axle is done on the basis of following
conditions:
b) if velocity v > 0, color is decided by the selection of and_method from the fuzzy
parameters.
61
Vehicle Rear : Magenta
e) Trails handling.
Apart from the controlling technique, there are some other major differences between two
which are:
a) There is no persistent data in auto_car.m while all the navigational variables like x, y,
Angle_T, Angle_V, steer, velocity and distance traveled are persistent in hum_cnt.m.
7.3.1 Steering
Vehicle is steered left or right based upon the values of the following parameters passed from
GUI
62
b) right: if right =1, steer right, Front wheels angle is modified as:
tyre_angle=tyre_angle-1
7.3.2 Acceleration
Vehicle is accelerated up or down based the values of the following parameters passed from
GUI
Persistent variables are initialized from the parameters passed from the GUI at the first call
from GUI. They are checked for their values, if empty, which is true for the first time call from
the GUI, they are initialized from the values passed from GUI, otherwise the previous values of
these variables are retained being the persistent storage class.
Four of the flag variables are used as return variables from the function to the GUI. These flags
are used to avoid the similar action to be repeated over and over again. Following four flag
variables are being used :
rf/lf : Right/Left steer setting flag : Indicates that right/left steering has been performed. This
variable is returned from the hum_cnt to start_system function to acknowledge status that
right/left steering has been performed as was commanded from GUI.
vpf/vmf : Velocity plus/minus setting flag : Indicates that velocity plus/minus has been
performed. This variable is returned from the hum_cnt to start_system function to
acknowledge status that plus/minus velocity has been performed as was commanded from GUI.
7.3.5 initialize_vehicle_parameters.m
a) Length (l)
b) Width (w)
c) Tyres length(t_len)
63
e) Vehicle boundary line width(l_wid)
7.3.6 check_boundary.m
Checks if the point (x, y) is outside the boundary of the ONF (overall navigational field). If
point lies outside the ONF, then error message is displayed in command window and no further
navigation is performed:
7.4.1 start_system.fig
start_system.fig file is the main figure file which has been created using GUIDE
(Graphical User Interface Development Environment). Different types of controls which have
been used in this file are:
a) Panels
b) Push button
c) Check box
d) List box
e) Edit box
f) Axes
g) Labels
64
Figure file can be edited in the GUIDE software. The creation of the figures format, placement
of different controls and setting of their properties is done in figure file.
7.4.2 start_system.m
The matlab file i.e. start_system.m file is generated automatically by the GUIDE, when its
figure file is saved. The matlab file holds different functions, which are created automatically
corresponding to different controls available on the GUI. These functions are further altered to
handle the actions being performed through corresponding controls. Programming of action
being performed through different controls, passing of data between different functions of GUI
controls, calling of required simulator & control system files with the appropriate parameters is
done through matlab file of the main figure file.
65
CHAPTER 8
66
Simulation I All trails on, initial position, (IP) taken as (10, 180, 270).
Simulation II Trailing Front tyres only, plotted in red in actual simulation, IP here is
(10, 40, 0).
Simulation III No trails.
Simulation IV Trailing Rear tyres, plotted in green in actual simulation, IP here is
(80, 10, 0).
Simulation V Trailing Vehicles boundary, rear boundary in magenta and rest of the sides
plotted in blue in actual simulation, IP here is (190, 190, 270).
To view the trails of the vehicles motion, we have to make the selections as per our
requirements in the simulation parameters. In each case, trailing dot on the mid point of rear
axle is always visible. Vehicles rear boundary has been shown as thick line. Instantaneous
values of the position & navigational parameters such as x & y co-ordinates, distance D,
steering angle & front tyres angle etc. are being displayed at the top of the graphical window. It
is very convenient to study the kinematics of the vehicle by having the clear & customized
view of trailing motion such as front wheels & rear wheels etc.
FIGURE 8.2: PATH TRACES FOR MIN & PRODUCT T-NORMS (A) & (B)
68
From Table (8.1) & Figs. (8.2 (A) & (B)), it can be observed that simulation outputs for both of
the t-norms i.e. min & product, are almost similar. Difference in distances (Dmin - Dpro), is
negligible, with maximum value of 4.9744 units in simulation IX in current set of observations.
As per observations from Table (8.2), CCA algorithm takes little more distance because of the
constraint of path being composed of circular arcs.
70
The response of the system has been observed to be smoother in T2. There is considerable
saving in the distance to travel to reach the goal by using interval type-2 fuzzy sets as shown in
the simulation above for the default initial position (10, 20, 30).
FIGURE 8.5: SIMULATION OUTPUT FOR DIFFERENT IT2-FS WIDTH VALUES (0-200)
MD & OFWV: Minimum value of D realized for particular values of FOU width
W called as Optimized FOU width values (OFWV).
Following observations have been taken from D-W plots of Fig. (8.6 A & B).
II. Closer the initial position of the vehicle to central vertical line corresponding to x=100,
lesser is the dependency of value of D on W. Value of DR (Distance Range) is
decreasing as x component of IP (Initial Position) is approaching 100 from each side,
DR finally approaching zero at x=100.
III. Plots I, II, III & IV are quite similar to plots VI, VII, VIII & IX respectively. It shows
that D Vs W is mainly the function of absolute value of x deviation of initial position
taken w.r.t final parking position (PP). x deviation can be given as:
IV. The variations in plots I & IX are more as compared to variations in plots II & VIII..
This observation leads to conclusion that number of variations vary proportionately to
the x deviation. That is why at zero x deviation number of variations in D are also zero
i.e. D is constant for whole range of W in plot (V) for x=100.
72
(A)
73
(B)
74
CHAPTER 9
9.1 Conclusions
Conclusions withdrawn on the basis of results of simulations performed & D-W plots (see Fig.
8.6 (A) & (B)) follow as:
I. Fuzzy t-norm selections i.e. minimum & product generate similar response except
minor difference in value of D. See Fig. (8.2) & Table (8.1).
II. CCA algorithm has been observed to take more distance (D) then LPA algorithm. This
observation acknowledges the fact that CCA decomposes path into circular arcs while
LPA does into linear segments. See Fig. (8.3) & Table (8.2).
III. For FOU width W beyond OFWV, rule-base cannot provide useful information to the
FLS because aliasing of variable values tend to invoke the rule-base such that even
non-desirable rules tend to fire, i.e. response of the system gets deformed. This
observation acknowledges the fact that only up to a certain level of uncertainty can be
tolerated in the measurement processes, which can be used for intelligent decisions of
interval type-2 based FLS. Beyond that, the output gets deviated from the desired one
i.e. either of the positional errors increases beyond its maximum limit or navigational
error leads it to a non-converging case.
75
IV. Response of the system depends upon absolute value of x deviation as: higher the value
of x-deviation more will be the variations in value of D and larger will be the value of
distance range (DR).
I. Further optimization of the fuzzy control system in regards such as: rules reduction,
shape of membership functions, fuzzy i/o variables, de-fuzzification techniques, using
general T2 FS or variation of any of the other fuzzy system parameters.
II. Presently, the vehicle is made to move in forward direction only. One can improve it by
integrating backward movement also. Incorporating the logic to generate the negative
velocity by FLC so as to exhibit more realistic autonomous navigation can do further
improvement in the steering control system and help reduce the number of unsuccessful
cases.
III. Increasing the resolution of the available navigational space by addition of another
input variable, y-position of the vehicle, to fuzzy steering control system. Y position
variable will help define the position more precisely, so rule-base can be modified to
have more precise control of the navigational parameters such as Steer & Velocity.
IV. Various other path-tracing options can be explored, such as autonomous navigation in
known or unknown environments consisting of obstacles.
V. To be integrated with virtual reality based interface and / or hardware control system.
VI. To optimize the FLS, by fusion of other intelligent techniques like Genetic Algorithms
(GA), Artificial Neural Networks (ANN), Particle Swarm Optimization (PSO) etc.
76
PUBLICATIONS
Mutneja, Vikram & Sidhu, Satvir Singh & Gill, Neeraj & Saini, J. S. (2008), Mobile Robot
Navigation using IT2 FLS, Proceedings of IEEE National Conference on Applications of
Intelligent Systems (AIS 2008), March 2008, HCE Sonepat, Haryana, India, pp 18-23.
77
REFERENCES
[1] Scheuer, A. and Fraichard, Th. (1996), Planning Continuous-Curvature Paths for Car Like
Robots, International Conference on Intelligent Robots and Systems, Osaka, Japan, vol. 3,
1996, pp 1304-1311.
[2] Scheuer, A. and Fraichard, Th. (1997), Continuous-Curvature Path Planning for Car-Like
Vehicles, Proceedings of International Conference on Intelligent Robots and Systems
(IEEE-RSJ), vol. 2, 1997, pp 997-1003.
[3] Paromtchik, I. and Garnier, Ph. and Laugier, C. (1997), Autonomous Maneuvers of a Non-
Holonomic Vehicle, International Symposium on Experimental Robotics, Barcelona,
Spain, June, 1997, pp 276-288.
[4] Fraichard, Th. and Mermond R., Path Planning with Uncertainty for Car-Like Robots,
Proceedings of IEEE International Conference on Robotics and Automation, May, 1998, pp
27-32.
[5] Minguez, Javier and Montano, Luis and Jose, Arid and Santos, Victor (2002), Reactive
Navigation for Non-Holonomic Robots using the Ego-Kinematic Space, Proceedings of the
IEEE International Conference on Robotics and Automation, vol. 3, 2002, pp 3074-3080.
[6] Igor E. Paromtchik (2004), Steering and Velocity Commands for Parking Assistance,
Proceedings of the 10th IASTED International Conference on Robotics and Applications,
2004.
[7] Yousef Ibrahim, M. and Fernmdes, Allwyn (2004), Study on Mobile Robot Navigation
Techniques, IEEE International Conference on Industrial Technology, vol. 1, 2004, pp
230-236.
[8] Freeman, James. A. (1994), Fuzzy Systems for Control Applications: The Truck Backer-
Upper, The Mathematica Journal, Miller Freeman Publications, 1994, pp 64-69.
[9] Ollero, A. and Garca-Cerezo A. and Martnez, J. L. and Mandow A. (1997), Fuzzy
Tracking Methods for Mobile Robots, Applications of Fuzzy Logic: Towards High
Machine Intelligence Quotient Systems, Prentice-Hall Publishers, New Jersey, 1997, pp
346-364.
78
[10] Hoe, Koay Kah (1998), Fuzzy Expert System for Navigation Control, Project Paper,
University of Technology, Malaysia, 1998.
[12] Fraichard, T. and Garnier, P. (2001), Fuzzy Control to Drive Car-Like Vehicles,
Robotics and Autonomous Systems, Vol. 34, 1, 2001, pp 1-22.
[13] Garca-Prez, L. and Garca-Alegre and M.C., Ribeiro and A. and Guinea, D. (2003),
Fuzzy Control for an Approaching_Orienting Maneuver with a Car-Like Vehicle in
Outdoor Environments, IV Workshop de Agentes Fsicos (WAF03), Alicante, 2003, pp
87-98.
[14] Zadeh, L. A. (1975), The Concept of a Linguistic Variable and its Application to
Approximate Reasoning-1, Journal of Information Science, vol. 8, 1975, pp 199-249.
[15] Wang, Dongming and Acar, Levent (1999), An Analysis of Type-1 and Type-2 Fuzzy
Logic Systems, Proceedings of IEEE International Symposium on Intelligent Control
Systems and Semiotics, 1999, pp 353-358.
[16] Karnik, N. N. and Mendel, J. M. and Liang, Q. (1999), "Type-2 Fuzzy Logic Systems",
IEEE Transactions on Fuzzy Systems, vol. 7, December 1999, pp 643-658.
[17] Liang, Q. and Mendel, J. M. (2000), "Interval Type-2 Fuzzy Logic Systems: Theory and
Design", IEEE Transactions on Fuzzy Systems, vol. 8, 2000, pp 535-550.
[18] Mendel, J. M. (2000), "Uncertainty, Fuzzy Logic, and Signal Processing", International
Journal of Signal Processing, vol. 80, 2000, pp 913-933.
[19] Mendel, J. M. and John, R. I. (2002), "Type-2 Fuzzy Sets Made Simple", IEEE
Transactions on Fuzzy Systems, vol. 10, April 2002, pp 117-127.
[20] Mendel, Jerry M. (2003), Type-2 Fuzzy Sets: Some Questions & Answers, Newsletter
of IEEE Neural Networks Society, August, 2003.
[21] Mendel, Jerry M. (2004), "Fuzzy Sets for Words: Why Type-2 Fuzzy Sets Should be
Used and How They Can be Used", IEEE-FUZZ, 2004.
79
[22] Hagras, Hani A. (2004), A Type-2 Fuzzy Logic Controller for Autonomous Mobile
Robots, IEEE-FUZZ, July, 2004, pp 965-970.
[23] Hagras, Hani A. (2004), A Hierarchical Type-2 Fuzzy Logic Control Architecture for
Autonomous Mobile Robots, IEEE Transactions on Fuzzy Systems, vol. 12, 4, August
2004, pp 524-539.
[24] Chaves, L.F. and Spiller, P.A and Scolari, A.G. and Conte, R.N. and Pereira, L.F.A.
(2001), A MATLAB/SIMULINK-Based Platform for Real-Time Planning and Execution of
Control Techniques Applied to Mobile Robots, Proceedings of 2001 IEEE International
Symposium on Computational Intelligence in Robotics and Automation, July 29-August 1,
2001, pp 530-535.
[25] Rudzinska, K. and Carlini, M. and Abenavoli, R.I. and Kormanski, H. (2005), An
Interactive System for Mobile Robot Navigation, Proceedings of Fifth International
Workshop on Robot Motion and Control, 2005, pp 343-348.
[26] Rostami, Vahid and Sojodishijani, Omid and Ebrahimijam, Saeed and
Mohsenizanjaninejad, Ali (2005), "Fuzzy Error Recovery in Feedback Control for Three
Wheel Omnidirectional Soccer Robot", Proceedings of World Academy of Science,
Engineering & Technology, vol. 9, November, 2005, pp 91-94.
[27] Cupertino, F. and Giordano, V. and Naso, D. and Delfine L. (2006), Fuzzy Control of a
Mobile Robot Using a Matlab-based Rapid Prototyping System, IEEE Robotics and
Automation Magazine, 2006, pp 74-81.
80
APPENDIX-I
LIST OF SYSTEMS SOFTWARE FILES
Interface start_system.fig This is figure file for the GUI. Holds the
placement and configuration of GUI controls.
This file opens in tool GUIDE of the matlab
for GUI file editing.
81
APPENDIX-II
MATLAB CODE
File : auto_car.m
% this is program which takes commands from gui for displaying the
% simulation of the vehicle's motion. Significance of the parameters is as
%{
x : x co-ordinate of the rear axle mid point of the vehicle's initial position.
y : y co-ordinate of the rear axle mid point of the vehicle's initial position.
v : Velocity of the front axle mid point.
v_rear : Velocity of the rear axle mid point, same as that of "v" in case of the CCA.
l : Length of the model vehicle.
w : Width of the model vehicle.
t_len : Tyre length.
t_halflen: Half of tyre length.
t_wid : Width of the tyre.
l_wid : Width of the vehicle boundary as being shown on simulation.
t_ofsl : Length between rear axle w.r.t vehicle rear boundary.
t_ofsu : Length between front axle w.r.t vehicle rear boundary.
d : Distance between rear and front axle.
angle_gamma: Angle of front wheels w.r.t horizontal = (angle_v+angle_t).
angle_t : Tyre angle w.r.t vehicle's axis.
angle_v : Angle of vehicle's axis w.r.t horizontal.
conf : Read as "configuration", Used as heading in the log file which stores the records of iterations.
status_cb: Flag passed by GUI, to show/hide the trails.
steer : Steer output provided by fuzzy inference system being taken as updated value of the angle_t
tft : Flag passed by gui to show/hide trailing front tyres, work only if status_cb is set.
trt : Flag passed by gui to show/hide trailing rear tyres, work only if status_cb is set.
tvb : Flag passed by gui to show/hide trailing vehicle boundary itself, work only if status_cb is set.
delta : This is the width of the type-2 fuzzy set which is sent by gui. Zero means type-1 fuzzy set.
and_method : This is the fuzzy t-norm, i.e. and_method which is being used by fuzzy inference system
1 => MIN ( select the minimum of two)
3 => PRO ( select the product of two values)
traj_algo : Trajectory calculation algorithm to be used, value being sent by GUI.
1 => Continuous curves approximation
2 => Linear Paths Approximation
dist : Holds the total distance travelled , value being returned by the function
tf : Tuning Factor for the steering for exact path tracing.
%}
83
t1_ey=t1_y+t_halflen*sind(angle_v);
t2_ex=t2_x+t_halflen*cosd(angle_gamma);
t2_ey=t2_y+t_halflen*sind(angle_gamma);
t3_ex=t3_x+t_halflen*cosd(angle_gamma);
t3_ey=t3_y+t_halflen*sind(angle_gamma);
if status_cb % if trailing on
if tft % if trailing front tyres on
t2=line([t2_sx t2_ex],[t2_sy t2_ey]);
t3=line([t3_sx t3_ex],[t3_sy t3_ey]);
set(t2,'linewidth',t_wid,'color','r');
set(t3,'linewidth',t_wid,'color','r');
end
else % if trailing off
t2=line([t2_sx t2_ex],[t2_sy t2_ey]);
t3=line([t3_sx t3_ex],[t3_sy t3_ey]);
set(t2,'linewidth',t_wid,'color','r');
set(t3,'linewidth',t_wid,'color','r');
end
if status_cb % if trailing on
if tvb % if trailing vehicle boundary on
l0=line([x0 x1],[y0 y1]);
l1=line([x1 x3],[y1 y3]);
l2=line([x2 x3],[y2 y3]);
l3=line([x0 x2],[y0 y2]);
set(l0,'linewidth',l_wid,'color','m');
set(l1,'linewidth',l_wid,'color','b');
set(l2,'linewidth',l_wid,'color','b');
set(l3,'linewidth',l_wid,'color','b');
end
else % if trailing off
l0=line([x0 x1],[y0 y1]);
l1=line([x1 x3],[y1 y3]);
l2=line([x2 x3],[y2 y3]);
l3=line([x0 x2],[y0 y2]);
set(l0,'linewidth',l_wid,'color','m');
set(l1,'linewidth',l_wid,'color','b');
set(l2,'linewidth',l_wid,'color','b');
set(l3,'linewidth',l_wid,'color','b');
end
l4=line([x-1 x+1],[y y]); %Trailing dot of vehicle rear axle mid point (RAMP)
l5=line([x x],[y-1 y+1]);
84
c=delta/100; %Color setting of RAMP based upon selection of width of T2-FS.
switch and_method
case 1
if c<=1
c1=0;
c2=0;
c3=c;
else
c1=c-1;
if c1>=0.9
c1=0;
end
c2=1;
c3=1;
end
case 2
c1=0;
c3=0;
if delta<=0
c2=1;
else
c2=1/delta;
end
case 3
c2=0;
c3=0;
if delta<=0
c1=1;
else
c1=1/delta;
end
end
85
steer=inference(x,angle_v,delta,and_method);
ori_steer=steer;
steer=tf*steer; % applying tuning factor
if abs(steer)>40 % limiting the absolute value of the steer to maximum value i.e. 40 in this case.
if steer>0
steer=40;
else
steer=-40;
end
end
angle_tn=steer; % steer being applied to vehicle by passing it to new value of tyre angle.
case 2 % LPA
steer_v=asind( (v/d)*sind(angle_tn) );
angle_vn=angle_v+steer_v;
angle_gamma=angle_tn+angle_vn;
var_B=d*cosd(angle_v)+v*cosd(angle_gamma)-d*cosd(angle_vn);
var_C=cosd(angle_vn);
if (var_C==0)
var_C=eps;
end
v_rear=var_B/var_C;
if v_rear==0
pause;
end
x_t=x;
y_t=y;
% new position of rear axle mid point
x=x+v_rear*cosd(angle_vn);
y=y+v_rear*sind(angle_vn);
D_delta=sqrt((x-x_t)*(x-x_t) + (y-y_t)*(y-y_t)); % distance traveled in this iteration
end
steer_t=angle_tn-angle_t;
angle_v=angle_vn;
angle_t=angle_tn;
dist=dist+D_delta; % updating the value of distance traveled so far
86
end
% recording the information regarding this iteration to file in append mode for successive writing.
a=sprintf('\n');
fwrite(fid,a);
qp=strcat('X_POS : ',num2str(x),' Y_POS : ',num2str(y),' ANGLE_V : ',num2str(angle_v),' ANGLE_T : ',
num2str(angle_t),' V_REAR : ',num2str(v_rear),' V_FRONT : ',num2str(v),' STEER_V : ',
num2str(steer_v),' STEER_T : ',num2str(steer_t),' ORI_STEER : ',num2str(ori_steer));
fwrite(fid,qp);
angle_gamma=angle_v+angle_t;
end
File : check_boundary.m
break_status=0;
if x<0 | x>200
disp('not a valid position in x');
break_status=1;
end
if y<0 | y>200
disp('not a valid position in y');
break_status=1;
end
File : fire_rule.m
%{
x_2 : two element vector returning matching with the steering.
mf : selects the type of the membership function.
1 : LMF
2 : UMF
delta : the width of the fuzzy set.
and_method : 1 => min, 2 => max, 3 => product.
rule_mat : contains the rule matrix (35 *3).
rule_number : rule number from rule matrix which has to be fired.
%}
if and_method==1
mach_rule=min(mach_xpos(mf),mach_phi(mf));
elseif and_method==2
mach_rule=max(mach_xpos(mf),mach_phi(mf));
else
mach_rule=(mach_xpos(mf))*(mach_phi(mf));
end
x_2=steering(mach_rule,rule_mat(rule_number,3));
87
File : hum_cnt.m
%{
lf : Flag that vehicle steered left.
rf : Flag that vehicle steered right.
vpf : Flag that Velocity plus => increased the velocity.
vmf : Flag that Velocity minus => decreased the velocity.
x_init : Initial value of x being passed by gui.
y_init : Initial value of y being passed by gui.
angle_v_init : Initial value of angle_v being passed by gui.
angle_t_init : Initial value of angle_t being passed by gui.
v_init : Initial value of velocity v being passed by gui.
status_trails : Flag sent by GUI, to show(if 1)/hide(if 0) the trails.
tft : Flag sent by gui to show/hide trailing front tyres, work only if status_trails is set.
trt : Flag sent by gui to show/hide trailing rear tyres, work only if status_trails is set.
tvb : Flag sent by gui to show/hide trailing vehicle boundary, work only if status_trails is set.
left : Command to steer left.
right : Command to steer right.
vplus : Command to increase the velocity.
left : Command to decrease the velocity.
%}
count=0;
initialize_vehicle_parameters;
angle_gamma=angle_t+angle_v;
tf=4;
v_rear=2;
dist=0;
88
if ~status_trails
cla;
end
if right==1
angle_t=angle_t-2;
steer=steer-2;
rf=1;
return;
elseif left==1
angle_t=angle_t+2;
steer=steer+2;
lf=1;
return;
else
angle_tn=angle_t;
steer=0;
end
if vplus==1
v=v+1;
vpf=1;
return;
elseif vminus==1
v=v-1;
vmf=1;
return;
end
if (abs(angle_tn)>35)
if angle_tn>0
angle_tn=35;
else
angle_tn=-35;
end
end
steer_v=asind( (v/d)*sind(angle_tn) );
angle_vn=angle_v+steer_v;
angle_gamma=angle_tn+angle_vn;
var_B=d*cosd(angle_v)+v*cosd(angle_gamma)-d*cosd(angle_vn);
var_C=cosd(angle_vn);
v_rear=var_B/var_C;
steer_t=steer;
angle_v=angle_vn;
angle_t=angle_tn;
disp(angle_t);
distance=distance+v;
dist=distance;
% normalizing the angle_v within range -100 to +300
if (angle_v>300)
angle_v=angle_v-360;
end
if (angle_v<-100)
angle_v=360+angle_v;
end
% LPA
x=x+v_rear*cosd(angle_v);
y=y+v_rear*sind(angle_v);
qp=strcat('X_POS : ',num2str(x),' Y_POS : ',num2str(y),' ANGLE_V : ',num2str(angle_v),
89
' ANGLE_T : ',num2str(angle_t),' V_REAR : ',num2str(v_rear),' V_FRONT : ',
num2str(v),' STEER_V : ',num2str(steer_v),' STEER_T : ',num2str(steer_t));
disp(qp);
angle_gamma=angle_t+angle_v;
% rest of code for parking boundaries, vehicle boundary, tyres displaying same as in auto_car.m
File : inference.m
if xpos < 100 & phi >= 270 % normalizing the vehicles angle range for proper results
phi=phi-360;
end
for i=1:35 % rules 1 to 35
[r y(i)]=fire_rule(i,xpos,phi,1,delta,and_method); %getting matching values for LMF
for j=1:2
stear_l(i,j)=r(j)*y(i); % output value * weight (for COG or COA de-fuzzification)
end
end
File : init_rule_matrix.m
rule_mat=[
1 7 5 % If (xpos is LE) and (phi is RB) then (Steer is PS) (1)
1 6 3 % If (xpos is LE) and (phi is RU) then (Steer is NS) (1)
1 5 2 % If (xpos is LE) and (phi is RV) then (Steer is NM) (1)
1 4 2 % If (xpos is LE) and (phi is VE) then (Steer is NM) (1)
1 3 1 % If (xpos is LE) and (phi is LV) then (Steer is NB) (1)
1 2 1 % If (xpos is LE) and (phi is LU) then (Steer is NB) (1)
1 1 1 % If (xpos is LE) and (phi is LB) then (Steer is NB) (1)
2 7 6 % If (xpos is LV) and (phi is RB) then (Steer is PM) (1)
90
2 6 5 % If (xpos is LV) and (phi is RU) then (Steer is PS) (1)
2 5 3 % If (xpos is LV) and (phi is RV) then (Steer is NS) (1)
2 4 2 % If (xpos is LV) and (phi is VE) then (Steer is NM) (1)
2 3 2 % If (xpos is LV) and (phi is LV) then (Steer is NM) (1)
2 2 1 % If (xpos is LV) and (phi is LU) then (Steer is NB) (1)
2 1 1 % If (xpos is LV) and (phi is LB) then (Steer is NB) (1)
3 7 6 % If (xpos is VE) and (phi is RU) then (Steer is PM) (1)
3 6 6 % If (xpos is VE) and (phi is RB) then (Steer is PM) (1)
3 5 5 % If (xpos is VE) and (phi is RV) then (Steer is PS) (1)
3 4 4 % If (xpos is VE) and (phi is VE) then (Steer is ZE) (1)
3 3 3 % If (xpos is VE) and (phi is LV) then (Steer is NS) (1)
3 2 2 % If (xpos is VE) and (phi is LU) then (Steer is NM) (1)
3 1 2 % If (xpos is VE) and (phi is LB) then (Steer is NM) (1)
4 7 7 % If (xpos is RV) and (phi is RB) then (Steer is PB) (1)
4 6 7 % If (xpos is RV) and (phi is RU) then (Steer is PB) (1)
4 5 6 % If (xpos is RV) and (phi is RV) then (Steer is PM) (1)
4 4 6 % If (xpos is RV) and (phi is VE) then (Steer is PM) (1)
4 3 5 % If (xpos is RV) and (phi is LV) then (Steer is PS) (1)
4 2 3 % If (xpos is RV) and (phi is LU) then (Steer is NS) (1)
4 1 2 % If (xpos is RV) and (phi is LB) then (Steer is NM) (1)
5 7 7 % If (xpos is RI) and (phi is RB) then (Steer is PB) (1)
5 6 7 % If (xpos is RI) and (phi is RU) then (Steer is PB) (1)
5 5 7 % If (xpos is RI) and (phi is RV) then (Steer is PB) (1)
5 4 6 % If (xpos is RI) and (phi is VE) then (Steer is PM) (1)
5 3 6 % If (xpos is RI) and (phi is LV) then (Steer is PM) (1)
5 2 5 % If (xpos is RI) and (phi is LU) then (Steer is PS) (1)
5 1 3 % If (xpos is RI) and (phi is LB) then (Steer is NS) (1)
];
File : initialize_vehicle_parameters.m
l=30;
w=l/(2.4444);
t_len=l/3.3;
t_ofsl=l/7.33;
d=l/1.435;
t_ofsu=t_ofsl+d;
t_halflen=t_len/2;
t_wid=6;
l_wid=2;
angle_fi=angle_t+angle_v;
File : dom_phi.m
function match=dom_phi(input,loc,delta)
switch loc
case 1
p=[170 225 280];
case 2
p=[120 155 190];
case 3
p=[90 112.5 135];
case 4
p=[80 90 100];
case 5
p=[45 67.5 90];
91
case 6
p=[-10 35 60];
case 7
p=[-100 -45 10];
end
% LMF
if (input<=p(1)) | (input>=p(3))
match1=0;
elseif (input>p(1)) & (input<p(2))
m=1.0/(p(2)-p(1));
c=-m*p(1);
match1=m*input+c;
elseif (input>p(2)) & (input<p(3))
m=-1.0/(p(3)-p(2));
c=-m*p(3);
match1=m*input+c;
else
match1=1;
end
% UMF
p(4)=p(3)+delta;
p(3)=p(2)+delta;
p(2)=p(2)-delta;
p(1)=p(1)-delta;
if (input<=p(1)) | (input>=p(4))
match2=0;
elseif (input>p(1)) & (input<p(2))
m=1.0/(p(2)-p(1));
c=-m*p(1);
match2=m*input+c;
elseif (input>=p(2)) & (input<=p(3))
match2=1.0;
else
m=1.0/(p(3)-p(4));
c=-m*p(4);
match2=m*input+c;
end
match(1)=match1;
match(2)=match2;
File : start_system.m
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @start_system_OpeningFcn, ...
'gui_OutputFcn', @start_system_OutputFcn, ...
'gui_LayoutFcn', [], ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
92
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% --- Executes just before start_system is made visible.
function start_system_OpeningFcn(hObject, eventdata, handles, varargin)
93
function StartSim_Callback(hObject, eventdata, handles)
x=handles.x;
y=handles.y;
angle_v=handles.angle_v;
angle_t=handles.angle_t;
v=handles.v;
conf=handles.conf;
status_cb=handles.status_cb;
tft=handles.tft;
trt=handles.trt;
tvb=handles.tvb;
delta=handles.delta;
and_method=get(handles.andmethod,'Value');
traj_algo=get(handles.trajalgo,'Value');
distance=auto_car(x,y,angle_v,angle_t,conf,v,status_cb,tft,trt,tvb,delta,and_method,traj_algo);
94
angle_v=handles.angle_v;
angle_t=handles.angle_t;
v=handles.v;
status_cb=handles.status_cb;
tft=handles.tft;
trt=handles.trt;
tvb=handles.tvb;
while(1)
handles=guidata(hObject);
left=handles.left;
right=handles.right;
vplus=handles.vplus;
vminus=handles.vminus;
[lf rf vpf vmf]=hum_cnt(x,y,angle_v,angle_t,v,status_cb,tft,trt,tvb,left,right,vplus,vminus);
if lf==1
handles.left=0;
guidata(hObject,handles);
end
if rf==1
handles.right=0;
guidata(hObject,handles);
end
if vpf==1
handles.vplus=0;
guidata(hObject,handles);
end
if vmf==1
handles.vminus=0;
guidata(hObject,handles);
end
end
95
handles.right=0;
handles.left=0;
handles.vplus=0;
handles.vminus=1;
guidata(hObject,handles);
while(1)
action_code=double(get(gcbf,'Currentcharacter')); % gets last key pressed code
left=0;
right=0;
vplus=0;
vminus=0;
if action_code==28
left=1;
right=0;
vplus=0;
vminus=0;
set(gcbf,'Currentcharacter','c');
elseif action_code==29
left=0;
right=1;
vplus=0;
vminus=0;
set(gcbf,'Currentcharacter','c');
elseif action_code==30
left=0;
right=0;
vplus=1;
vminus=0;
set(gcbf,'Currentcharacter','c');
elseif action_code==31
left=0;
right=0;
vplus=0;
vminus=1;
set(gcbf,'Currentcharacter','c');
elseif action_code==120
break;
end
hum_cnt(x,y,angle_v,angle_t,v,status_cb,tft,trt,tvb,left,right,vplus,vminus);
end
File : steering.m
96
if (range==1) | (range==7)
switch range
case 1
a=-35;b=-17;
x1=-35;
m=-1.0/(b-a);
c=-m*b;
x2=(z-c)/m;
case 7
a=17;b=35;
m=1.0/(b-a);
c=-m*a;
x1=(z-c)/m;
x2=35;
end
else
switch range
case 2
a=-30;b=-17;c=-7;
case 3
a=-14;b=-7;c=-0;
case 4
a=-7; b=0; c=7;
case 5
a=0;b=7;c=14;
case 6
a=7;b=17;c=30;
end
m1=1.0/(b-a);
c1=-m1*a;
m2=-1.0/(c-b);
c2=-m2*c;
x1=(z-c1)/m1;
x2=(z-c2)/m2;
end
x(1)=x1;
x(2)=x2;
File : dom_xpos.m
function match=dom_xpos(input,loc,delta)
LE=1;
LV=2;
VE=3;
RV=4;
RI=5;
if (loc==1) | (loc==5) % if loc is left or right
switch loc
case 1
%UMF
p=[0 20 70];
if (input<p(1))
match2=0;
elseif (input>=p(1)) & (input<=p(2))
match2=1;
elseif (input>p(2)) & (input<=p(3))
97
m=-1.0/(p(3)-p(2));
c=-m*p(3);
match2=m*input+c;
else
match2=0;
end
%LMF
m=-1.0/(p(3)-p(2));
p(3)=p(3)-delta;
c=-m*p(3);
y_level=m*p(2)+c;
if (input<p(1)) | (input>p(3))
match1=0;
elseif ((input>=p(1)) & (input<=p(2)))
match1=y_level;
else
match1=m*input+c;
end
case 5
%UMF
p=[130 180 200];
if (input>p(3))
% disp('not a valid input');
match2=0;
elseif (input>=p(2)) & (input<=p(3))
match2=1;
elseif (input>p(1)) & (input<p(2))
m=1.0/(p(2)-p(1));
c=-m*p(1);
match2=m*input+c;
else
match2=0;
end
%LMF
m=1.0/(p(2)-p(1));
p(1)=p(1)+delta;
c=-m*p(1);
y_level=m*p(2)+c;
if (input<p(1)) | (input>p(3))
match1=0;
elseif ((input>=p(1)) & (input<=p(2)))
match1=m*input+c;
else
match1=y_level;
end
end
else
switch loc
case 2
p=[60 80 100];
case 3
p=[90 100 110];
case 4
p=[100 120 140];
98
end
%LMF
if (input<p(1)) | (input>p(3))
match1=0;
elseif (input>=p(1)) & (input<p(2))
m=1.0/(p(2)-p(1));
c=-m*p(1);
match1=m*input+c;
elseif (input>p(2)) & (input<=p(3))
m=1.0/(p(2)-p(3));;
c=-m*p(3);;
match1=m*input+c;
else
match1=1;
end
%UMF
p(4)=p(3)+delta;
p(3)=p(2)+delta;
p(2)=p(2)-delta;
p(1)=p(1)-delta;
if (input<=p(1)) | (input>=p(4))
match2=0;
elseif (input>p(1)) & (input<p(2))
m=1.0/(p(2)-p(1));
c=-m*p(1);
match2=m*input+c;
elseif (input>=p(2)) & (input<=p(3))
match2=1;
else
m=1.0/(p(3)-p(4));;
c=-m*p(4);;
match2=m*input+c;
end
end
match(1)=match1;
match(2)=match2;
99