Download PDF
ads:
Sergio Santiago Ribeiro
Optimal Trajectory Definition and
Control
for a Terrestrial Vehicle in a Closed Track
DISSERTAÇÃO DE MESTRADO
DEPARTAMENTO DE ENGENHARIA ELÉTRICA
Postgraduate Program in Electric Engineering
Rio de Janeiro
March 2009
ads:
Livros Grátis
http://www.livrosgratis.com.br
Milhares de livros grátis para download.
Sergio Santiago Ribeiro
Optimal
Trajectory Definition and Control for a
Terrestrial Vehicle in a Closed Track
Dissertação
de
Dissertation presented to the Postgraduate Program
in Electric Engineering of the Departamento de
Engenharia Elétrica, PUC-Rio as partial fulfillment of
the requirements for the degree of Mestre em
Engenharia Elétrica.
Advisor: Ricardo Tanscheit
Co-Advisor: Mauro Speranza Neto
Rio de Janeiro, March 2009
ads:
Sergio Santiago Ribeiro
Determinação e Controle da Trajetória Ótim
a de um
Veículo Terrestre em Traçado Fechado Pré-definido
Dissertação Apresentada como requisito parcial para obtenção
do grau de Mestre pelo Programa de Pós-Graduação em
Engenharia Elétrica do Departamento de Engenharia Elétrica do
Centro Técnico e Científico da PUC-Rio. Aprovada pela
Comissão Examinadora abaixo assinada.
Prof. Ricardo Tanscheit
Orientador
Departamento de Engenharia Elétrica - PUC-Rio
Prof. Mauro Speranza Neto
Co-Orientador
Departamento de Engenharia Mecânica - PUC-Rio
Prof. Fernando Ribeiro da Silva
IME
Prof. José Franco Machado do Amaral
Departamento de Engenharia Eletrônica e de Telecomunicações - UERJ
Prof. José Eugênio Leal
Coordenador Setorial do Centro
Técnico e Científico
Rio de Janeiro, 25 de março de 2009
All reserved rights. Forbidden partial or complete
reproduction without previous authorization of the university,
the author and advisors.
Sergio Santiago Ribeiro
Undergraduate in Control and Automation Engineering by
Pontifical Catholic University - PUC-Rio (Rio de Janeiro
Brazil) in 2006.
Ficha Catalográfica
Ribeiro, Sergio
Determinação e Controle da Trajetória Ótima de um
Veículo Terrestre em um Traçado Fechado Pré-Definido /
Sergio Santiago Ribeiro; orientadores: Ricardo Tanscheit e
Mauro Speranza Neto. – Rio de Janeiro: PUC, Departamento
de Engenharia Elétrica. – 2009.
98 f.: il.(col.); 30 cm
Dissertação (Mestrado em Engenharia Elétrica)
Pontifícia Universidade Católica do Rio de Janeiro,
Departamento de Engenharia Elétrica, 2009.
Inclui referências bibliográficas.
1. Engenharia elétrica Dissertações. 2. Trajetória
ótima. 3. Controle de trajetória. 4. Lógica Nebulosa. 5.
Algoritmos Genéticos. I. Tanscheit, Ricardo. II.Speranza
Neto, Mauro. III. Pontifícia Universidade Católica.
Departamento de Engenharia Elétrica.
CDD: 621.3
Dedicated to my parents, Stélio and Solange.
Acknowledgements
I would like to thank all the people that directly or not helped me to get
here, specially:
My parents, brother and sister, for understanding my absence in parties
and other family meetings.
My future wife Priscilla, for her organization, brilliant ideas and
tenderness on tough moments.
My advisors Mauro Speranza Neto and Ricardo Tanscheit, for the
support and involvement.
All my colleagues of the Vehicle Systems Simulation Group, for sharing
the same passion.
CNPq and CAPES, for the financial support and belief.
Resumo
Ribeiro, Sergio; Tanscheit, Ricardo; Speranza Neto, Mauro. Determinação
e Controle da Trajetória Ótima de um Veículo Terrestre em um
Traçado Fechado Pré-Definido. Rio de Janeiro, 2009. 98p. Dissertação de
Mestrado Departamento de Engenharia Elétrica, Pontifícia Universidade
Católica do Rio de Janeiro.
A determinação de uma trajetória ótima não é uma tarefa simples, uma vez
que ela é diretamente dependente dos limites de aceleração suportada por cada
veículo. Essa pesquisa aborda um método de otimização baseado em algoritmos
genéticos que identifica a trajetória que um carro deve percorrer para completar
uma pista pré-definida no menor tempo. Considerando um modelo veicular de
Partícula Orientada, o método otimiza os perfis de aceleração que levam o veículo
a percorrer a trajetória de menor tempo. Adicionalmente, projeta-se um
controlador fuzzy para emular o comportamento de um ser humano na direção do
veículo ao longo da trajetória ótima. Para alimentar o controlador, foram testados
dois métodos de geração de erro: o Erro Presente da Trajetória e o Erro Futuro da
Trajetória (FBTE), que é a medida de posição do carro quanto a sua tendência de
movimento. Resultados obtidos com controladores clássicos, como o PDD, são
confrontados com os fornecidos pelo controlador fuzzy alimentado pelo
procedimento de geração de Erro Futuro de Trajetória (FBTE).
Palavras-chave
Dinâmica Veicular. Modelos de Veículos Terrestres. Otimização. Trajetória
Ótima. Controle Fuzzy. Algoritmos Genéticos.
Abstract
Ribeiro, Sergio; Tanscheit, Ricardo (Advisor); Speranza Neto, Mauro
Optimal Trajectory Definition and Control for a Terrestrial Vehicle in a
Closed Track. Rio de Janeiro, 2009. 98p. MSc. Dissertation – Departamento
de Engenharia Elétrica, Pontifícia Universidade Católica do Rio de Janeiro.
The definition of the minimum time trajectory in a track is not obvious, since
it is directly dependent on the acceleration limits that the vehicle can withstand.
This paper presents an optimization method based on Genetic Algorithms that
identifies the path that a car must follow in order to complete a given circuit in
minimum time. By considering an Oriented Particle model, the method optimizes
the acceleration profiles that drive the vehicle along the trajectory in minimum
time. In addition, a fuzzy controller is designed to emulate the behavior of a
human driver controlling a high speed car along the optimized trajectory. Two
different error generation procedures were tested as controller inputs: the Present
Trajectory Error and the Future-based Trajectory Error (FBTE), which gives
information on the car’s tendency of movement. Results obtained with other
controllers in the same application, such as the PDD, are compared to those
provided by the fuzzy controller fed by the FBTE procedure.
Key Words
Vehicular Kinematics. Models of Terrestrial Vehicles. Optimization.
Optimal Trajectory. Fuzzy Control. Genetic Algorithms.
Summary
1. Introduction 1
1.1. Objectives and Motivations 17
1.2. Literature Review 17
1.3. Methodology 19
2. Vehicular Models 20
2.1. Oriented Particle Vehicle Model 20
2.2. Stationary Kinematical Vehicle Model 36
3. Error Generation Procedures 45
3.1. Track Construction Model 45
3.2. Traveled Track Distance Correction 48
3.3. Present-based Trajectory Error Definition 53
3.4. Future-based Trajectory Error Definition 59
4. Trajectory Determination: Evolutionary Optimization 66
4.1. Presentation and Description 66
4.2. Validation Tests 73
5. Vehicle Control: Fuzzy Driver 75
5.1. Presentation and Description 75
5.2. Validation Tests 82
6. Applications 85
6.1. Trajectory Optimization Methods Comparison 85
6.2. Trajectory Error Calculation Comparison 88
6.3. Vehicle Controllers Comparison 90
6.4. Fuzzy Driver Applied To Genetic Optimized Trajectory 92
7. Conclusions 95
7.1. Final Considerations 95
7.2. Future Works Propositions 95
8. References 96
List of Symbols
a
BMaz
Maximum Braking Acceleration
a
LMax
Maximum Lateral Acceleration
a
Max
Maximum Accelerations' array
a
N
Normal Acceleration
a
N0
Peak Turn Acceleration
ā
N0
(i)
Average Peak Lateral Acceleration for ith track strecth
a
reg
Array of points indexes
a
T
Tangent Acceleration
a
T0
Peak Traction Acceleration
a
T1
Peak Braking Acceleration
a
TMax
Maximum Traction Acceleration
a
y
Normal Acceleration
b
d
Front axel size
b
t
Rear axel size
d
Dinamic traveled track distance
d
Acc
Accomplished distance before the car leaves the track limits
d
f
Loose gape of the Steering Wheel
d
FB
Minimum braking distance
d
FT
Distance where the maximum speed is achieved
d
N0,1,2
Characteristic distances of the Normal Acceleration Profile
d
T
Entire track distance
d
T0,1,2
Characteristic distances of the Tangent Acceleration Profile
E
a
Orientation Error
E
p
Position Error
i
CP
Closest point index
i
last
Previous iteration index
K
d
Gain between Steering Wheel angle and acctual Wheel angle
l
Distance between the axles
L(i)
Straight Line Lenght for the ith track stretch
l
d
Distance between front shaft and the vehicle's Center of Mass
l
t
Distance between rear shaft and the vehicle's Center of Mass
l
w
Lane width
n
FS
Number of forward steps considered
n
gap
Number of points that compose the search gap
P
FE
Friction Ellipse penalty
R(i)
Curve Radius for the ith track stretch
R
t
Curve radius of rear shaft
t
i
Time at the instant i
V
Linear Velocity
v
x
Hiruzibtal Conponents of the velocity
v
y
Vertical Conponents of the velocity
w
FS
Forward steps weights array
x
Horizontal position coordinate in a Local Reference System
x
C
(i)
Horizontal coordinate of the car on the Center Line reference system
x
T
(i)
Horizontal coordinate of starting point for the ith track stretch
y
Vertical position coodinates in a Local Reference System
y
C
(i)
Vertical coordinate of the car on the Center Line reference system
y
T
(i)
Vertical coordinate of starting point for the ith track stretch
α(i)
Curve Angle for the ith track stretch
α
V
Angle of Attack
β(i)
Orientarion of starting point for the ith track stretch
δ
d
Right transformation of the steering wheel angle
δ
e
Left transformation of the steering wheel angle
δ i
Step size
θ
Angle between the vehicle
x
-axis and the
ρ
Curve radius of the Center of Mass
τ
Decay constant of exponencial in Acceleration Profiles
ω
Angular Velocity
List of Figures
Figure 2.1 – Oriented Particle Model Representation. ...................................................... 21
Figure 2.2 – Simulink Block Diagram: Oriented Particle Vehicle Model.
Compact Form (a) and Extended Form (b). ...................................................................... 22
Figure 2.3 – MatLab Function Form Examples. ................................................................ 22
Figure 2.4 – Tangent Acceleration Profiles. ...................................................................... 23
Figure 2.5 – Normal Acceleration Profiles. ........................................................................ 24
Figure 2.6 – Friction Ellipse. .............................................................................................. 25
Figure 2.7 – Oriented Particle Model 1
st
Validation Test: Simulink Block Diagram. ......... 25
Figure 2.8 – Oriented Particle Model 1
st
Validation Test: Inputs. ...................................... 26
Figure 2.9 – Oriented Particle Model 1
st
Validation Test: Vehicle Speed. ........................ 26
Figure 2.10 – Oriented Particle Model 1
st
Validation Test: Performed Trajectory. ............ 27
Figure 2.11 – Oriented Particle Model 1
st
Validation Test: Orientation Output. ................ 27
Figure 2.12 – Oriented Particle Model 1
st
Validation Test: Friction Ellipse. ...................... 28
Figure 2.13 – Acceleration Profiles Validation Tests: Simulink Block Diagram. ............... 29
Figure 2.14 – Oriented Particle Model 2
nd
Validation Test: Inputs. ................................... 29
Figure 2.15 – Oriented Particle Model 2
nd
Validation Test: Trajectory. ............................. 30
Figure 2.16 – Oriented Particle Model 2
nd
Validation Test: Vehicle Orientation. .............. 30
Figure 2.17 – Oriented Particle Model 2
nd
Validation Test: Fiction Ellipse. ...................... 31
Figure 2.18 – Oriented Particle Model 3
rd
Validation Test: Inputs..................................... 32
Figure 2.19 – Oriented Particle Model 3
rd
Validation Test: Realized Trajectory. .............. 32
Figure 2.20 – Oriented Particle Model 3rd Validation Test: Vehicle Speed. ..................... 33
Figure 2.21 – Oriented Particle Model 3rd Validation Test: Friction Ellipse. ..................... 33
Figure 2.22 – Oriented Particle Model 4th Validation Test: Inputs. ................................... 34
Figure 2.23 – Oriented Particle Model 4th Validation Test: Vehicle Speed. ..................... 34
Figure 2.24 – Oriented Particle Model 4th Validation Test: Realized Trajectory. ............. 35
Figure 2.25 – Oriented Particle Model 4th Validation Test: Orientation. ........................... 35
Figure 2.26 – Oriented Particle Model 4th Validation Test: Friction Ellipse. ..................... 36
Figure 2.27 – Kinematical Model Representation. ............................................................ 37
Figure 2.28 – Ackerman Geometry Definitions. ................................................................ 38
Figure 2.29 – Simulink Block Diagram: Kinematical Vehicle Model.
Compact Form (a) and Extended Form (b). ...................................................................... 40
Figure 2.30 – Kinematical Model Validation Tests: Simulink Block Diagram. ................... 40
Figure 2.31 – Kinematical Model 1st Validation Test: Input. ............................................. 41
Figure 2.32 – Kinematical Model 1
st
Validation Test: Trajectory Comparison. ................. 42
Figure 2.33 – Kinematical Model 1
st
Validation Test: Orientation Comparison. ................ 42
Figure 2.34 – Kinematical Model 2
nd
Validation Test: Input. ............................................. 43
Figure 2.35 – Kinematical Model 2
nd
Validation Test:
Realized Trajectories Comparison. ................................................................................... 43
Figure 2.36 – Kinematical Model 2
nd
Validation Test: Orientation Comparison. ............... 43
Figure 3.1 - Track stretch Coordinate Calculus. ................................................................ 46
Figure 3.2 – Track Model Validation Test: Oval Circuit. .................................................... 47
Figure 3.3 – Graphic Representation of the Traveled Track Distance Correction. ........... 48
Figure 3.4 – Straight Line’s Projection Procedure. ............................................................ 49
Figure 3.5 – Curve’s Projection Procedure. ...................................................................... 52
Figure 3.6 – Traveled Distance Correction Validation Test: Projection Procedure. .......... 52
Figure 3.7 – Present-based Trajectory Error: Graphic Representation. ........................... 53
Figure 3.8 – Present-based Trajectory Error Validation 1
st
Test:
Simulink Block Diagram. ................................................................................................... 56
Figure 3.9 – Present-based Trajectory Error Validation 1
st
Test: Inputs. .......................... 57
Figure 3.10 – Present-based Trajectory Error Validation 1
st
Test: Outputs. ..................... 57
Figure 3.11 – Present-based Trajectory Error Validation 2
nd
Test: Inputs. ....................... 58
Figure 3.12 – Present-based Trajectory Error Validation Second Test: Outputs. ............. 59
Figure 3.13 – Future-based Trajectory Error: Graphic Representation. ........................... 60
Figure 3.14 – Future-based Trajectory Error Validation Tests:
Simulink Block Diagram. ................................................................................................... 62
Figure 3.15 – Future-based Trajectory Error Validation 1
st
Test: Inputs. .......................... 62
Figure 3.16 – Future-based Trajectory Error Validation 1
st
Test: Outputs. ....................... 63
Figure 3.17 – Future-based Trajectory Error Validation 2
nd
Test: Inputs. ......................... 64
Figure 3.18 – Future-based Trajectory Error Validation 2
nd
Test: Outputs. ...................... 65
Figure 4.1 – Classic Optimization Block Diagram. ............................................................ 66
Figure 4.2 – Genetic Algorithm Optimization Block Diagram. ........................................... 67
Figure 4.3 – Center Line Trajectory. ................................................................................. 68
Figure 4.4 – Correspondent Acceleration Profiles. ........................................................... 68
Figure 4.5 – Acceleration Profiles. .................................................................................... 69
Figure 4.6 – Chromosome Codification. ............................................................................ 69
Figure 4.7 – Chromosome Sectors’ domains. ................................................................... 70
Figure 4.8 – Fitness Roulette Wheel. ................................................................................ 70
Figure 4.9 – Scattered Crossover Algorithm. .................................................................... 71
Figure 4.10 – Center Line Seed Trajectory. ...................................................................... 73
Figure 4.11 – GA Optimization 1
st
Validation Test: Optimized Trajectory. ........................ 74
Figure 4.12 – GA Optimization 1
st
Validation Test: Acceleration profiles ......................... 74
Figure 5.1 – Simulink Block Diagram: Detailed Fuzzy Driver. .......................................... 75
Figure 5.2 – Designed FIS Structure. ................................................................................ 76
Figure 5.3 – Membership Functions: Position Error. ......................................................... 77
Figure 5.4 – Membership Functions: Angle Error. ............................................................ 77
Figure 5.5 – Membership Functions: Desired Steering Wheel Angle. .............................. 78
Figure 5.6 – FIS Example: Analysis of Position and Orientation of the Vehicle ............... 79
Figure 5.7 - FIS Procedure Example: 1
st
and 2
nd
Activated Rules. ................................... 80
Figure 5.8 - FIS Procedure Example: 3
rd
and 4
th
Activated Rules. ................................... 81
Figure 5.9 - FIS Example: Crisp Output Determination. ................................................... 81
Figure 5.10 - FIS Example: Desired Steering Wheel Angle .............................................. 82
Figure 5.11 - Simulink Block Diagram Used in the FIS Tests. .......................................... 82
Figure 5.12 – FIS 1
st
Validation Test: Inputs and Output. ................................................. 83
Figure 5.13 - FIS 2
nd
Validation Test: Driver Comparison. ................................................ 84
Figure 6.1 – “S” Chicane: Center Line Trajectory. ............................................................ 85
Figure 6.2 – Classical Optimization 1
st
Test: Obtained Trajectory. ................................... 86
Figure 6.3 – Classical Optimization 1
st
Test: Acceleration Profiles. .................................. 86
Figure 6.4 – Genetic Optimization 1
st
Test: Obtained Trajectory. ..................................... 87
Figure 6.5 – Genetic Optimization 1
st
Test: Acceleration Profiles. .................................... 87
Figure 6.6 – Genetic Optimization 1
st
Test: Longitudinal Speed. ...................................... 88
Figure 6.7 – Present-based Trajectory Error and Fuzzy Controller: Block Diagram. ........ 88
Figure 6.8 – Present-based Trajectory Error and Fuzzy Controller:
Obtained Trajectory. .......................................................................................................... 89
Figure 6.9 – Future-based Trajectory Error and Fuzzy Controller: Block Diagram. .......... 89
Figure 6.10 – Future-based Trajectory Error and Fuzzy Controller:
Obtained Trajectory. .......................................................................................................... 90
Figure 6.11 – PDD Controller High Speed Test: Trajectory. ............................................. 91
Figure 6.12 – Fuzzy Driver High Speed Test: Trajectory. ................................................. 92
Figure 6.13 – Intelligent Applications Test: Center Line Trajectory. ................................. 92
Figure 6.14 – Intelligent Applications Test: Evolved Trajectory. ....................................... 93
Figure 6.15 – Fuzzy Driver High Speed Test: Trajectory. ................................................. 93
Figure 6.16 – Intelligent Applications Test: Evolved Acceleration Profiles. ...................... 94
List of Tables
Table 2.1 – Kinematical Model 1st Validation Test: Vehicle Parameters ......................... 41
Table 3.1 - Detailed Track Information. ............................................................................. 47
Table 4.1 – Genetic Optimization Initial Parameters. ........................................................ 73
Table 5.1 - Matrix Structure with the Fuzzy Rules. ........................................................... 78
Table 5.2 - Relation of Methods Used in FIS .................................................................... 79
1.
Introduction
The automobile as it is known was neither invented in a single day nor an
idea of a single inventor. The history of cars reflects an evolution that took place
worldwide and it is estimated that over a hundred thousand patents gave origin to
modern automobiles.
In 1771, the French engineer and mechanic Nicolas Joseph Cugnot drove
one of his road vehicles into a stone wall, becoming the first person involved in a
motor vehicle accident. Although Cugnot’s vehicles were steam-powered, many
historians accept they could be considered automobiles and also that Nicolas
Cugnot was the inventor of the car.
A hundred years later, just after the invention of petrol-fuel autos in 1876
by Nicolaus Otto, a contest was organized by Paris Magazine in 1884. It turned to
be the first official record of a car race in history, anticipating the tendency of
migration to the streets of racing technology developments.
Far from those days, only forty years ago, artificial intelligence techniques
were developed as a relevant alternative solution to control and optimize
engineering problems. Some computational methods inspired in nature had been
researched and also published in the early decades of the nineteenth century.
However, most real-life applications appeared only in the 70s and 80s.
Bremermann [1] to [3] published a series of papers in the 1950s and
1960s, in which a set of solutions was adopted as an approach to solve
optimization problems, evolving them by using algorithms inspired on natural
selection, gene recombination and mutation. In addition, in 1965, Zadeh [4]
proposed a logical system that supported an infinite value mapping, and, in
opposition to the binary logic used in computational systems until then, inspired
on human’s imprecise linguistic statements.
Artificial evolution became a widely recognized optimization method as a
result of the works of Rechenberg [5] and Schwefel [6] in the early 70s, using
genetic algorithms to solve complex engineering problems. Not until 1987, a
fuzzy-logic-based control system for train operation was built in a Japanese
subway line.
17
1.1. Objectives and Motivations
The main objectives of this work are to analyze and simulate the human
driving behavior through computational intelligence techniques. An evolutionary
optimization algorithm was used to determine the minimum time trajectory of a
racing car in a pre-defined track. In addition, to control the vehicle through the
obtained path, a fuzzy logic controller was designed.
The initial purpose of applying those techniques is to analyze and mime
the responses of a human driver when submitted to the extreme driving
conditions of a car race, such as high speeds and critical accelerations. Analytical
methods have never provided better results than those of an experienced human
driver. The non-linear characteristic of the steering system and the
multidisciplinary aspect of trajectory determination are the main complexities
found in the design of high performance driving systems.
Some applications to an intelligent driving system go beyond the design of
unmanned land vehicles. Automatic drive assistance mechanisms, such as
traction control, parking sensors, and anti-breaking system were developed on
racing tracks and are safety equipments commonly found in mini-vans now.
1.2. Literature Review
The search for the minimum time trajectory involves some parallel
optimization problems.
The lateral accelerations minimization intends to keep the friction limits of
the inner tires, without reducing the car's speed. On the other hand, maximization
of longitudinal speeds and minimization of the driven distance are directly
responsible for the lap time reduction. It is not easy to achieve all those goals at
the same time and some strategies can be found in the literature.
Velenis et al [7] propose the trajectory optimization during corner paths.
The multi-objective of minimizing time and maximizing the exit velocity is
analyzed. Due to this duality, some problems are pointed out, such as the
possibility of obtaining an optimal path by drifting. Although this condition is not
contemplated by the models developed here, the boundary conditions treatment
used by the authors, apply perfectly to the track model used as a restriction to
optimization. Another interesting and inspiring strategy adopted by Velenis [7] is
the use of a simplified vehicle model, which makes implementation and response
analysis easier.
18
In a research of Velenis and Tsiostras [8], acceleration limits are used to
generate an optimal velocity profile. This approach is also adopted here and
supported by the concept of the Friction Ellipse; it is stated in the Vehicle Models
chapter and detailed [9].
Trajectory optimization is also treated by Cossalter et al [10], evaluating
handling and maneuver of land vehicles. Similarly to the optimization method
developed here, Cossalter [10] uses the track lateral limits as a restriction, and
presents a penalty-based method to optimize the path, minimizing the travelled
distance. In spite of simply evaluating the travelled distance, the optimization
algorithm developed here uses a multi-objective function that focuses on the lap
time minimization. Then, it allows this methodology to identify non-intuitive longer
trajectory parts in which the car can achieve higher speed due to lower lateral
accelerations.
The Group of Modeling and Simulation of Vehicle Systems of PUC-Rio
has also developed some studies on trajectory determination. Hernan et al [11]
have applied Classic Optimization Methods in order to minimize a car’s lap time
in a pre-defined track through optimizing of its acceleration inputs. This paper
also uses the acceleration profiles to obtain the trajectory.
Concerning trajectory control, several methods have been applied to the
complex vehicle kinematics. In [12] a Proportional Double Derivative (PDD)
controller was proposed, that receives as reference a closed-circuit trajectory.
The higher the speeds considered, the harder it is to reduce the reference offsets
and oscillations. The fuzzy logic based controller allied to the analysis and
emulation of humans' perceptions minimized those problems.
Fuzzy Inference Systems are quite widespread when it comes to
intelligent control systems. Bastian et al [13] present a Fuzzy Automatic
Transmission Expert System (FATE). A shift scheduling method for transmission
systems using Fuzzy Logic is detailed in Sakaguchi [14]. Both references analyse
the fuzzy sets and rules definitions, an especially difficult task when the steering
system is considered
Many of the subjects and techniques shown here have been previously
explored. However, comparative analysis and developed computational models’
assemblies are very important in order to understand and reproduce human
behavior. Moreover, the concepts of modularity and simplicity prepare the path
for future works.
19
1.3. Methodology
In order to improve simulation analysis, modularity and systematic
validations were essential. Those are the main characteristics of the adopted
methodology. The following chapters detail all the stages of problem modeling,
simulation development and analysis of results.
A modular structure based on the theory of Bond Graphs and Block
Diagrams was applied to all implemented models. Hence, the first chapters
describe the vehicle models, the path determination evolutive algorithm and the
trajectory control inference system.
In those chapters the model or algorithm is presented first, detailing the
assumed hypotheses and constraints. Afterwards, the computational
implementation is briefly overviewed in order to provide a complete
documentation of operational procedures and configurable parameters. Finally,
each model is submitted to a set of tests to evaluate its viability; parameters are
adjusted in order to guarantee a representative description of the physical
behavior.
The methodology not only minimizes the debugging process of the
complete assembly, but also enables the easy replacement of any part of
algorithm for performance comparison. For example, it allows a direct confront
between the Fuzzy Controller and a PDD linear controller, developed by Hey et al
[12].
Some possible applications are simulated by assembling the models in
different configurations. Moreover, results are plotted and discussed, focusing on
the miming of a human driver perception and responses. Final considerations are
presented in the last chapter, where future works are suggested, so as to
increase the database built by the Group of Modeling and Simulation of Vehicle
Systems of PUC-Rio.
20
2.
Vehicular Models
Computational vehicle modeling provides a simulation environment and
enables the analysis of the effect of different models on the controller’s design.
For example, some classical controllers work very well with a linear vehicle model
that can be quite useless when applied to the control of a racing car. The
linearization does not consider high speeds and aggressive attitude that an
extremely nonlinear dynamic system like this is submitted to.
However, the best model is always the simplest one. Therefore, many
models - with different complexities - were used in the vehicle kinematics
analysis. Furthermore, the track information must also be stored, and the model
used was the same as in [11]. In this section, the models used in this work are
detailed and validated through individual tests.
2.1. Oriented Particle Vehicle Model
2.1.1. Presentation and Description
The oriented particle vehicle model adopted in the optimization of a path
in a predefined track is rather simple. It consists of a particle moving on the
Cartesian Plane, where (
x
,
y
) symbolizes the position of the vehicle‘s center of
mass. . The car’s orientation is given by
θ
and defined as the angle between the
car front direction and the global
X
-axis. This angle lies between
-π
and
π
, which
conventionally characterizes the vehicle’s left side as positive and its right side as
negative.
The model is graphically represented in Figure 2.1 and detailed in
Equation (2.1). Its input variables are
a
N
and
a
T
, the normal and tangential
accelerations respectively. The car’s linear velocity is given by
V
, and
ω
is its
angular velocity. The sign of
ω
defines whether the car is turning left or right. As
the modeled racing car does not move backwards, the speed
V
assumes values
equal or higher than zero.
21
Figure 2.1 – Oriented Particle Model Representation.
=
=
=
=
=
>
=
θ
θ
ωθ
ω
sin
cos
0;0
0;
1
Vy
Vx
aV
V
Va
V
T
N
&
&
&
&
(2.1)
Following the modularity approach used in this work, the oriented particle
vehicle model is implemented in the Simulink
®
environment and formatted in a
single block. Figure 2.2 shows this block in its encapsulated or compact form (a)
and in its extended form (b).
It should be noted that the blocks named 0 Division Treatment” and
“Speed Components” are respectively the conditional and the trigonometric parts
of the equations. Those calculations are better defined as .m files called in
Simulink
®
by the MatLab
®
function blocks. Those blocks are then put inside a
subsystem together with a MUX and a DEMUX ports that respectively
concatenate and separate the MatLab
®
function’s input and output variables.
Following the modularity methodology, this programming strategy is commonly
used throughout the modeling; Figure 2.3 shows examples of two MatLab
®
functions used in the oriented particle vehicle model.
22
V
omega
(a)
(b)
3
theta
2
y
1
x
aT
aN
x
y
theta
Vehicle Model: Oriented Particle
theta
v
vx
vy
Speed Components
Vx and Vy
1
s
x
o
1
s
x
o
1
s
x
o
1
s
x
o
v0
x0
y0
theta0
num
den
res
0 Division
Treatment
2
aN
1
aT
Figure 2.2 – Simulink Block Diagram: Oriented Particle Vehicle Model.
Compact Form (a) and Extended Form (b).
MUX DEMUX
2
vy
1
vx
MATLAB
Function
Speed Components
VX and Vy
2
v
1
theta
MUX
1
res
MATLAB
Function
O Division Treatment
2
den
1
num
Figure 2.3 – MatLab Function Form Examples.
Some of the simplifying hypothesis, such as the absence of mass and
inertia representation, may cause the impression that the model is insufficient.
However, much of the inertial behavior is implicitly considered in the acceleration
profiles given as inputs. Figure 2.4 shows the profiles of the acceleration
component tangent to the trajectory – vehicle’s longitudinal acceleration.
23
d
2
T
d
1
T
d
0
T
d
0
T
a
1
T
a
Traction
Breaking
Figure 2.4 – Tangent Acceleration Profiles.
This representation can be modeled as two conditional exponential
functions [11]. In Equation (2.2) this acceleration profile is detailed, where:
a
T0
and
a
T1
are the possible peak tractions and breaking accelerations;
d
FT
is the distance where the maximum speed is achieved;
d
FB
is the minimum breaking distance possible;
d
T0,1,2
are the characteristic distances of the tangent acceleration profile;
d
is the dynamic traveled track distance which it is the profiles’ dependent
variable;
τ
is a decay constant of the exponential.
<
<
=
;
;
211
100
1
0
0
0
TT
dd
dd
T
TT
dd
dd
T
T
dddea
dddea
a
TFB
T
TFT
T
τ
τ
(2.2)
Figure 2.5 shows the profiles of the acceleration component normal to the
trajectory in this model the lateral acceleration of the vehicle. The direction
convention is again left as positive and right as negative.
24
d
2
N
d
3
N
d
1
N
d
0
N
d
0
N
a
d
2
N
d
3
N
d
1
N
d
0
N
d
0
N
a
Left Turn
Right Turn
Figure 2.5 – Normal Acceleration Profiles.
Equation (2.3) details the conditional equations that define
a
N
. The
desired turn acceleration is
a
N0
, and
d
N0,1,2
is the characteristic distance of the
normal acceleration profile.
<
<
<
=
;
;
;
320
210
1000
23
2
01
0
NN
dd
dd
N
NNN
NN
dd
dd
NN
N
dddea
ddda
dddeaa
a
NN
N
NN
N
τ
τ
(2.3)
The Friction Ellipse introduces the vehicles’ responses to those
accelerations into the model. This graph, as detailed in [9], points out the
acceleration limits a specific vehicle can support before it slides or spins. Those
limits vary according to some features, such as tires’ composition, engine power
and the center of mass position. Each car presents a different Friction Ellipse and
only three acceleration values are necessary to define it. These values are the
maximum traction, lateral and braking accelerations, respectively named
a
TMax
,
a
LMax
and
a
BMax
. Figure 2.6 shows an example of Fiction Ellipse and the dynamic
acceleration values in two time instants (
t
1
and
t
2
) that are analyzed to attend the
restriction imposed by the three components of Maximum Acceleration.
25
Traction
Breaking
Left
Turn
Right
Turn
LMax
a
a
a
a
Car
Under Control
TMax
LMax
BMax
Figure 2.6 – Friction Ellipse.
2.1.2. Validation Tests
The tests for this model consist of applying some acceleration inputs and
observe how the particle moves through the Cartesian Plan. The first test has the
simple purpose of evaluating if the oriented particle vehicle model responds
correctly to the given accelerations. As shown in Figure 2.7, the inputs to the
model are pulses (see Figure 2.8) representing an initial speed increase followed
by two left turns.
theta
y
x
aT
aN
x
y
theta
Oriented Particle Vehicle Model
Figure 2.7 – Oriented Particle Model 1
st
Validation Test: Simulink Block Diagram.
26
0 5 10 15 20 25 30
-4
-2
0
Longitudinal Acceleration [G's]
Time [s]
0 5 10 15 20 25 30
-5
0
5
Lateral Acceleration [G's]
Time [s]
Figure 2.8 – Oriented Particle Model 1
st
Validation Test: Inputs.
It should be emphasized that the accelerations do not necessarily
correspond to the ones actually experimented by a vehicle. However, this kind of
test intends to verify the coherence of the model’s responses. Moreover,
submitting the model to simple inputs makes it easier to recognize expected
outputs and validate the model.
By analyzing the first input signal, it can be seen that about the third
simulation second the vehicle receives a positive longitudinal acceleration, which
is maintained constant until the fifth second. This acceleration should naturally
increase the car speed to a certain level and the become constant, as no other
longitudinal input is given afterwards. Figure 2.9 shows the dynamic speed
variable and how the expected behavior is attained.
0 5 10 15 20 25 30
0
10
20
30
Time [s]
V [m/s]
Figure 2.9 – Oriented Particle Model 1
st
Validation Test: Vehicle Speed.
In addition to the longitudinal acceleration, the second input represents
the lateral acceleration. This input signal corresponds to a couple of two-second
27
positive steps in the fifth and twentieth simulation seconds. The expected model
response to design of two curves to the left, as in Figure 2.10. To generate this
trajectory image, both output variables (
x
,
y
) are plotted together. The small gray
arrow indicates the beginning of the displacement.
-300 -250 -200 -150 -100 -50 0 50
0
50
100
150
200
250
X [m]
Y [m]
Figure 2.10 – Oriented Particle Model 1
st
Validation Test: Performed Trajectory.
An important observation is that the obtained curves have the same
radius due to the fact that the car was moving with constant speed andthat the
lateral acceleration had the same amplitude in both pulses. The orientation output
can also be visualized in Figure 2.11. Comparing the trajectory with
θ
, it is
possible to validate the orientation calculation. Both turns shown in Figure 2.10
have about a hundred and fifty degrees, easily identified by the two different
levels of
θ
in Figure 2.11.
0 5 10 15 20 25 30
0
100
200
300
Time [s]
θ
]
Figure 2.11 – Oriented Particle Model 1
st
Validation Test: Orientation Output.
28
This type of test establishes constant levels of accelerations. As shown in
Figure 2.12, the acceleration levels plots some points together in the Friction
Ellipse.
-5 -4 -3 -2 -1 0 1 2 3 4 5
-5
-4
-3
-2
-1
0
1
2
Longitudinal Acceleration [G's]
Lateral Acceleration [G's]
Figure 2.12 – Oriented Particle Model 1
st
Validation Test: Friction Ellipse.
The dots in the center of the ellipse are the acceleration representation at
the moment the car was stopped or on a straight line with constant speed.
Moreover, the dots on the right represent the acceleration experimented by the
vehicle when turning. Finally, the higher dots represent the initial traction
acceleration that takes the car out of rest.
The next tests introduce the acceleration profiles as the oriented particle
model inputs. Those profiles, defined in Equations (2.2) and (2.3), were
assembled in a MatLab
®
function, which is called by a Simulink
®
Block. The
Simulink
®
Block Diagram shown in Figure 2.13 is used in the next three following
tests. The traveled track distance, detailed in Chapter 3, becomes the test input.
Although a ramp is used as the time varying input distance, in future simulations
that value is taken as a feedback of the global position concerning a determined
track.
29
Traveled
Track Distance
theta
y
x
aT
aN
x
y
theta
Oriented Particle Vehicle Model
d
aT
aN
Acceleration Profiles
Figure 2.13 – Acceleration Profiles Validation Tests: Simulink Block Diagram.
Considering that the acceleration inputs of the model are now written as
distance functions, it is natural that they are plotted against travelled track
distance instead of time. For a better comparison, all the other variables are also
plotted against distance. As the travelled track distance is completely dependent
on the track, these tests will show the trajectory within the track limits.
The acceleration profiles defined for this second test intent to submit the
model to a set of accelerations equivalent to those experienced by a car while on
“S” turn with constant speed. As shown in Figure 2.14, the longitudinal
acceleration remains zero along the track travelled distance; the lateral one
represents the driving commands on the steering wheel in order to complete the
desired path.
0 50 100 150 200 250
-4
-2
0
Longitudinal Acceleration [G's]
Track Traveled Distance [m]
0 50 100 150 200 250
-5
0
5
Lateral Acceleration [G's]
Track Traveled Distance [m]
Figure 2.14 – Oriented Particle Model 2
nd
Validation Test: Inputs.
30
Both axes of this figure are limited by the acceleration limits established
as the Friction Ellipse characteristic values for the tests. Those values
correspond to the average values for racing cars and are shown in Equation
(2.4). The resulting trajectory of those inputs is shown in Figure 2.15 , where the
gray arrow indicates the direction of movement.
=
=
5
5
5.1
BMax
LMax
TMax
Max
a
a
a
a
r
(2.4)
0 50 100 150 200 250
-20
0
20
40
60
X [m]
Y [m]
Figure 2.15 – Oriented Particle Model 2
nd
Validation Test: Trajectory.
The orientation output,
θ
, is shown in Figure 2.16. By comparing it to the
trajectory, it is possible to identify their coherence. Finally, the Friction Ellipse with
all the dots along the trajectory is represented in Figure 2.17.
0 50 100 150 200 250
0
20
40
60
Track Traveled Distance [m]
θ
]
Figure 2.16 – Oriented Particle Model 2
nd
Validation Test: Vehicle Orientation.
31
-5 -4 -3 -2 -1 0 1 2 3 4 5
-5
-4
-3
-2
-1
0
1
2
Longitudinal Acceleration [G's]
Lateral Acceleration [G's]
Figure 2.17 – Oriented Particle Model 2
nd
Validation Test: Fiction Ellipse.
The results of this test enable the acceleration model validation; and
especially the hypothesis that lateral acceleration profiles can represent the
immediate consequence of the steering command. Hence, the performed
trajectory reproduces the expected displacement. Furthermore, the Friction
Ellipse does not show any variation regarding longitudinal acceleration and
shows the same lateral accelerations amplitude as the inputs. This perfectly
illustrates the constant speed with an “S” turn test.
The lateral accelerations input remains as zero throughout the travelled
distance. As shown in Figure 2.18, the longitudinal acceleration profile
establishes that the car accelerates during the first hundred meters, remains with
the same speed for thirty meters, and then stops.
32
0 50 100 150
-4
-2
0
Longitudinal Acceleration [G's]
Traveled Track Distance [m]
0 50 100 150
-5
0
5
Lateral Acceleration [G's]
Traveled Track Distance [m]
Figure 2.18 – Oriented Particle Model 3
rd
Validation Test: Inputs.
The trajectory could not be different from the straight line, since there is
no lateral acceleration. Figure 2.19 shows this trajectory, also with a small gray
arrow indicating the displacement origin and direction. It can be seen that the car
stops before the end of the track.
0 20 40 60 80 100 120 140 160 180 200
-20
0
20
X [m]
Y [m]
Figure 2.19 – Oriented Particle Model 3
rd
Validation Test: Realized Trajectory.
The displacement behavior mentioned before can be clearly observed by
analyzing the vehicle speed graph. Moreover, Figure 2.20 shows how the
acceleration profiles attribute to the particle model an asymptotic speed
response, usually characteristic of inertial models.
33
0 20 40 60 80 100 120 140 160
0
10
20
30
40
Traveled Track Distance [m]
V [m/s]
Figure 2.20 – Oriented Particle Model 3rd Validation Test: Vehicle Speed.
The Friction Ellipse plot, shown in Figure 2.21, completes the longitudinal
validation analysis. The orientation output is not plotted in this test, as the
trajectory is a straight line where
θ
remains zero throughout the travelled track
distance.
-5 -4 -3 -2 -1 0 1 2 3 4 5
-5
-4
-3
-2
-1
0
1
2
Longitudinal Acceleration [G's]
Lateral Acceleration [G's]
Restriction Satisfied
Figure 2.21 – Oriented Particle Model 3rd Validation Test: Friction Ellipse.
The final validation test has the purpose of analyzing both acceleration
profiles together. When submitted to a constant lateral acceleration, the trajectory
should be a curve whose radius is a quadratic function of the car’s speed.
The test inputs are defined as illustrated in Figure 2.22. The longitudinal
acceleration input represents a soft breaking command that culminates in a
decreasing speed, as seen in Figure 2.23.
34
0 10 20 30 40 50 60
-4
-2
0
Longitudinal Acceleration [G's]
Traveled Track Distance [m]
0 10 20 30 40 50 60
-5
0
5
Lateral Acceleration [G's]
Traveled Track Distance [m]
Figure 2.22 – Oriented Particle Model 4th Validation Test: Inputs.
0 10 20 30 40 50 60
0
10
20
30
Traveled Track Distance [m]
V [m/s]
Figure 2.23 – Oriented Particle Model 4th Validation Test: Vehicle Speed.
Despite some initial and final transients, the lateral acceleration describes
a constant wheel’s angle. The trajectory response is also as expected: starting at
the small gray arrow, it is curve with a decreasing radius. The spiral trajectory is
shown in Figure 2.24.
35
-5 0 5 10 15 20
0
5
10
15
20
X [m]
Y [m]
Figure 2.24 – Oriented Particle Model 4th Validation Test: Realized Trajectory.
Figure 2.23 shows the decreasing speed that causes the spiral behavior,
and Figure 2.25 shows the vehicle orientation
θ
. Since the car completes a full
turn, the orientation increases about three hundred and sixty degrees.
0 10 20 30 40 50 60
0
100
200
300
Traveled Track Distance [m]
θ
]
Figure 2.25 – Oriented Particle Model 4th Validation Test: Orientation.
Finally, to complete the model validation analysis, the Friction Ellipse
associated to the spiral trajectory is shown in Figure 2.26. A relevant observation
is that no acceleration was too close to the limits given by
Max
a
r
. However, due to
the elliptical shape of the graph’s boundaries, the car almost reaches a critical
condition.
36
-5 -4 -3 -2 -1 0 1 2 3 4 5
-5
-4
-3
-2
-1
0
1
2
Longitudinal Acceleration [G's]
Lateral Acceleration [G's]
Figure 2.26 – Oriented Particle Model 4th Validation Test: Friction Ellipse.
2.2. Stationary Kinematical Vehicle Model
2.2.1. Presentation and Description
In addition to the optimization trajectory, this paper proposes the design of
a mimetic human controller capable of tracking and maneuvering a car through
that trajectory. As this controller uses the error in position and orientation of the
vehicle to determine its steering wheel angle, any model that does not consider
the Ackerman Geometry or any other element of the steering system is
inadequate. Due to it, the stationary kinematical model, also used in [12],
replaces the previous one. This model and the car’s complete direction system
are detailed below.
First, the vehicle’s body kinematics is modeled again as a planar moving
particle. However, a local Cartesian reference system is fixed in the car’s center
of mass. Due to it, the speed
V
is free to make an angle with the
x
vehicle axis.
The car’s angular velocity is given by
ω
, and the attack angle between the
local
X
-axis of the car and its speed is
α
v
, . Figure 2.27 illustrates the first part of
this modeling.
37
x
v
y
v
ω
Figure 2.27 – Kinematical Model Representation.
As mentioned before, this model assumes the stationary condition, that is,
the car’s speed is constant. Another simplifying hypothesis is that the normal
acceleration can be approximated by the
y
component of the acceleration
referred to the vehicle’s local reference system.
Instead of receiving accelerations as inputs, this model obtains them from
the curve radius of the rear shaft,
R
t
, the speed
V
and the vehicle geometric
configuration given by the distances between the rear and front axles and the
center of mass,
l
t
and
l
d
. respectively The second part of the kinematical model is
the Ackerman geometry consideration. This geometry [9] states that, to avoid
sliding in any wheel, the center of curvature must be in the interception of the
extensions of all the axles of the vehicle. This configuration is easily understood
through the graphical representation shown in Figure 2.28. The variables
b
t
and
b
d
are respectively the rear and front axles size. The angles
δ
e
and
δ
d
are
changes of the steering wheel angle,
δ
, for the left and right wheels respectively.
38
R
e
δ
d
δ
l
d
t
l
b
d
b
t
t
ρ
Figure 2.28 – Ackerman Geometry Definitions.
The simplifying hypotheses of the constant car speed (stationary
condition) and the approximation of the normal acceleration by the y acceleration
component should be recalled. Considering all the geometry shown on Figure
2.27 and Figure 2.28, the complete mathematical description of the considered
model is given by Equations (2.5).
39
==
<
>
=
+=
=
=
<
>
=
ω
ρ
ρ
ω
ρ
α
α
α
xyN
t
t
tt
vxy
v
x
t
t
t
t
t
t
v
vaa
R
V
R
V
lR
vv
v
V
R
R
l
R
R
l
CurveRight
CurveLeft
CurveRight
CurveLeft
0;
0;
tan
;
cos
0;arctan
0;arctan
22
(2.5)
It can be seen that the condition of infinite radius which corresponds to
no curve – is modeled on
R
t
=0. This strategy is not only simpler to implement, but
also computationally cheaper. The same procedure is repeated for the direction
system modeling.
Some of the steering system parameters also influence on how the
steering angle is translated on accelerations. The gain between the steering
wheel angle and the present wheel angle is given by the variable
K
d
. Moreover,
the gap that occurs when the steering wheel turns slightly but the wheels do not
move is given by
d
f
. Those considerations on the steering system and the final
R
t
definition are mathematically detailed in Equation (2.6).
<
+
=
=
>
+
+
+=
=
CurveRight
CurveLeft
f
d
d
dt
t
dd
f
d
e
dt
t
de
d
bll
R
K
d
bll
R
K
δ
δ
δδ
δ
δ
δδ
;
2tan
;
2tan
(2.6)
40
Once implemented, the model’s block receives the steering wheel angle
command from the driver and responds with the curvature radius. The Simulink
®
Block Diagram of the model is shown in Figure 2.29.
(a)
(b)
1
Global
Positon
180/pi
rad => °
Steering Angle Global Positon
Vehicle Model: Kinematical
wz
vy
vx
ay
Xcg
Ycg
theta
Rigid
Transformation
MATLAB
Function
Kinematics
Demux
MATLAB
Function
Ackermann
1
Steering
Angle
Figure 2.29 – Simulink Block Diagram: Kinematical Vehicle Model.
Compact Form (a) and Extended Form (b).
A relevant observation is that this model has a non-inertial reference
system; thus, a coordinate transformation is necessary. Usually, due to the
modularity strategy, the Rigid Transformation Block that rewrites the state
variables on the global reference system could be set outside the model block.
However, as the controller to be developed should not use any information
besides the global position and orientation, this structure works properly.
2.2.2. Validation Tests
As in the previous section, it is necessary to design a test scenario on the
Simulink
®
environment. Figure 2.30 shows the Simulink
®
Block Diagram used in
several tests, including the one below:
Steering Wheel Angle Global Positon
Vehicle Model: Kinematical
steering
Steering Test
Global Position
Figure 2.30 – Kinematical Model Validation Tests: Simulink Block Diagram.
The structure of the test scenarios is rather simple: an input block, the
model to be tested and a visualization block. The Steering Test block is
composed of a signal generator and connected to the input of the model block.
41
The Global Position block is no more than a scope probe to collect the model
output data.
Differently from the previous model presented, the stationary kinematical
model does not need any correlation to the track or the travelled distance.
Separating the kinematical part from the Ackerman geometry does not make
sense here. Therefore, all the variables are plotted against time, and only two
validation tests are necessary to analyze the model responses.
To study the influence of the vehicle speed
V
on the output variables,
three different values were tested. The car’s geometry and the steering system
parameters are detailed in Table 2.1.
Table 2.1 – Kinematical Model 1st Validation Test: Vehicle Parameters
Parameter Variable Value
Steering Loose Gap d
f
[°]
0.1
Rear Axle Length b
t [m]
1.2
Front Axle Length
b
d
[m]
1.2
Distance between the Axles
l
[m]
2
Distance from the Center of
Mass to the Rear Axles
l
t
[m]
1.2
Distance from the Center of
Mass to the Front Axles
l
d
[m]
0.8
Steering Gain K
d
0.015
The first test consists of applying a pulse to the steering wheel angle
input. That input should imply a constant lateral acceleration, causing the car to
go through a “U” turn. The test input is shown in Figure 2.31.
0 5 10 15 20
-100
-50
0
50
100
Steering Wheel Angle ]
Time [s]
Figure 2.31 – Kinematical Model 1st Validation Test: Input.
The three trajectories with different speeds are plotted together in Figure
2.32. The expected characteristics of the trajectories are observed for all the
tested values of
V
, although only for
V
=15m/s the “U” turn is perfectly obtained.
42
The higher the speed, the later the car enters the curve. Moreover, for a constant
simulation time, the lower the testing speeds, the smaller the car displacement.
-50 0 50 100
0
20
40
60
80
100
120
140
160
X [m]
Y [m]
V= 10 [m/s]
V= 15 [m/s]
V= 20 [m/s]
Figure 2.32 – Kinematical Model 1
st
Validation Test: Trajectory Comparison.
The orientation output,
θ
, is also plotted for the three tested speeds in
Figure 2.33. By analyzing it together with the trajectories, it is possible to observe
that the difference in inclinations means that the three trajectories are not only
delayed in phase, but also have different curve’s radius.
0 5 10 15 20
0
50
100
150
200
Time [s]
θ
]
V= 10 [m/s]
V= 15 [m/s]
V= 20 [m/s]
Figure 2.33 – Kinematical Model 1
st
Validation Test: Orientation Comparison.
The second test has the purpose of evaluating the model behavior when
submitted to an oscillatory input. The steering wheel is initially turned 90° to the
left and, with a sinusoidal movement, moves to 90° to the right and back in a
period of about eight seconds. As seen in Figure 2.34, a driver executes the
same control in an “S” turn.
43
0 1 2 3 4 5 6 7 8 9
-100
-50
0
50
100
Steering Wheel Angle ]
Time [s]
Figure 2.34 – Kinematical Model 2
nd
Validation Test: Input.
This input is tested again with three different speeds:
V
=10m/s,
V
=15m/s
and
V
=20m/s. Figure 2.35 shows the corresponding trajectories. It can be seen
that the highest speeds not only cause the car to go further along the X-axis, but
also increase the Y coordinate reached.
0 20 40 60 80 100 120 140 160 180 200
0
10
20
30
X [m]
Y [m]
V= 10 [m/s]
V= 15 [m/s]
V= 20 [m/s]
Figure 2.35 – Kinematical Model 2
nd
Validation Test: Realized Trajectories Comparison.
As in the previous test, the next step is to analyze the car orientation
output. Figure 2.36 shows a comparison of the
θ
graphs for the different speeds
tested. The response corresponds to the model’s expectation and to the
previously observed trajectories. At higher speeds, the car attains larger angular
variations.
0 1 2 3 4 5 6 7 8 9
-10
0
10
20
Time [s]
θ
]
V= 10 [m/s]
V= 15 [m/s]
V= 20 [m/s]
Figure 2.36 – Kinematical Model 2
nd
Validation Test: Orientation Comparison.
44
As all the presented vehicular models were tested and validated, they can
now be used to study the vehicle behavior, to design controllers or specific car
components, or even for training the driver. In the next sections these models
are used as objective functions in the optimization of the vehicle trajectory and as
benchmarks for the controller design.
45
3.
Error Generation Procedures
Most controllers are designed to follow a reference signal or to minimize
the error between the desired value of a variable and the one obtained by some
measuring method. Considering that this research is entirely based on simulation
results, it is necessary to define how to model the sensor system perception of
the current position related to the reference trajectory.
The chosen control reference is the vehicle’s desired path, which is stored
as detailed in [15]. Two different error definitions are introduced in this section:
the present-based trajectory error and the future-based trajectory error. Both are
detailed and tested.
3.1. Track Construction Model
3.1.1. Presentation and Description
The defined track model [15] is stored as a matrix, represented in
Equation (3.1) and describing the track as a combination of straight lines and
circle arcs. The columns store information about corresponding road parts. Null
values in the second line of column
i
means that the current stretch is a straight
line. The first line of that column is the stretch’s length, given by the variable
L(i)
.
On the other hand, for a curve stretch represented in column
j
, the first line
shows the curve’s radius and the second line defines its angle,
R(j)
and
α
(j)
respectively.
(
)
(
)
(
)
(
)
( ) ( )
=
0120
1 21
n
nLnRRL
Track
αα
L
L
(3.1)
Each column information of the track matrix can be used to obtain the
positions and orientations of the starting point for each track stretch
i
, named
46
(
x
T
(i)
,
y
T
(i)
) and
β
(i)
respectively. Therefore, (
x
T
(1)
,
y
T
(1)
) are the coordinates of
the first track stretch and
β
(1)
is its angle with the horizontal.
In order to obtain the coordinates of the subsequent track stretches, the
track construction algorithm developed uses simple geometric relations, as
shown in Figure 3.1. Equations (3.2) and (3.3) detail these calculations, for
straight lines and curves respectively.
(
)
i-
1
()
i
(
)
(
)
(
)
1
,
1
+
+
i
y
i
x
T
T
R i
( )
() ()( )
iyix
TT
,
R i
( )
(
)
i
L i
( -1)
B
Figure 3.1 - Track stretch Coordinate Calculus.
(
)
(
)
(
)
(
)
(
)
( ) ( ) ( ) ( )( )
( ) ( )
{ }
32 ;
1
1sin11
1cos11
,...,n,ifor
ii
iiLiyiy
iiLixix
TT
TT
=
=
+=
+
=
ββ
β
β
(3.2)
( ) ( ) ( )
( )
( ) ( ) ( )
( )
( ) ( ) ( )
( )
( ) ( ) ( )
{ }
32 ;
11
2
1
1sin1
2
1
1cos1
1cos1212
2
,...,n,ifor
iii
i
iBiyiy
i
iBixix
iiRiRB
TT
TT
=
+=
++=
++=
=
αββ
α
β
α
β
α
(3.3)
47
For all vehicle models, the defined track is completely planar, allowing a
2–dimentional representation from center line trajectory. However, is assumed a
simplification hypothesis that the whole track has a single lane width:
l
w
.
3.1.2. Validation Tests
The validation test for the track model is simple and should enable the
construction of a graphical representation of any track directly from its data
matrix. For example, in Table 3.1 all the information of a sample track is detailed.
The curve lengths,
L(2)
and
L(4)
, are calculated by multiplying the curve angle in
radians and the curve radius in meters.
Table 3.1 – Detailed Track Information.
Track Part
Type
R
[m]
α
[˚]
L
[m]
l
w
[m]
1
Straigth Line
-
-
100
8
2
Right Curve
20
180
62.8
8
3
Straigth Line
-
-
100
8
4
Right Curve
20
180
62.8
8
The respective data matrix is defined in Equation (3.4). Note that the signs
in
R(2)
,
R(4)
,
α(2)
and
α(4)
indicate the side of the curve. According to the
alignment of the positive
X
axis with the car front, a left curve is positive and a
right curve is negative. Figure 3.2 shows the representation for that matrix and
the gray arrow indicates the track starting point and orientation.
=
ππ
00
20100 02100
Track
(3.4)
-20 0 20 40 60 80 100 120
-50
-40
-30
-20
-10
0
10
X (m)
Y (m)
Figure 3.2 – Track Model Validation Test: Oval Circuit.
Although the center line information can be written as a combination of
straight lines and arcs of circle, the trajectory itself is treated as a sequence of
48
points where the car center of mass should move along. The car’s path is
obtained by iterations of the vehicle model directly commanded or as a result of
the optimization process.
In the error generation procedure the reference signal is the global
coordinate of a desired path along time. This implies in keeping much
information, but allows the direct connection between the optimization and
controller simulation blocks, increasing modularity.
3.2. Traveled Track Distance Correction
3.2.1. Presentation and Description
An important calculation is the travelled track distance correction. This
distance represents the center line projection of any point on the track. It can be
better visualized in Figure 3.3.
Figure 3.3 – Graphic Representation of the Traveled Track Distance Correction.
In order to adopt a pattern in the track representation, all figures respect
the same color scheme shown in the legend of Figure 3.3. Human drivers do not
use the elapsed time to locate themselves on the path. Instead, they use visual
information to identify, for example, that they are at the end of a curve or getting
close to a straight line.
Initially, the current car position must be related to a specific track stretch
to enable its center line recognition. Therefore, to identify on which track stretch
the car position should be projected, the track side limits must be calculated.
Maintaining the same discretization of the coordinates of the track stretch
position, (
x
T
(i)
,
y
T
(i)
), and orientation,
β(i)
, the track limits for the left and right
sides of the road are shown in Equations (3.5) and (3.6), respectively.
49
( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
+
++
+
+
++
+
=
1sin
2
1sin
2
1cos
2
1cos
2
lim
i
l
iyi
l
iy
i
l
ixi
l
ix
i
w
T
w
T
w
T
w
T
Left
ββ
ββ
(3.5)
( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
+
+
+
+
=
1sin
2
1sin
2
1cos
2
1cos
2
lim
i
l
iyi
l
iy
i
l
ixi
l
ix
i
w
T
w
T
w
T
w
T
Right
ββ
ββ
(3.6)
Once the (
x
,
y
) point is located inside the track it can be projected,
generating the center line corresponding position of the car, (
x
C
,
y
C
). This
projection, which consists, for the straight parts of the track, of finding the
interception point between lines
r
and
p
, is graphically represented in Figure 3.4.
Notice that
r
is the track stretch center line and
p
is a line perpendicular to
r
that
contains the point (
x
,
y
).
r
p
(
)
C
C
y
x
,
()
i
β
() ()( )
iyix
TT
,
(
)
(
)
(
)
1
,
1
+
+
iyix
TT
Figure 3.4 – Straight Line’s Projection Procedure.
The implemented algorithm begins by identifying on which track stretch
the car (
x
,
y
) is located. Since the car always starts from the first stretch, this
search consists of analyzing the current vehicle position; if it is outside the limits
of stretch
i
, the stretch counter is incremented.
If the identified track stretch is a straight line, the angular and linear
coefficients of the center line equation are calculated. The variables
r
1
and
r
2
, are
given below, where the line
r
equation is defined by
y
r
=
r
1
.
x
r
+
r
2
:
50
(
)
(
)
( ) ( )
xryr
iyiy
ixix
r
TT
TT
=
+
+
+
=
12
1
21
1
arctantan
π
The same calculation is repeated for the line
p
equation, shown in gray in
Figure 3.4. This line must be perpendicular to the
r
line and the car position (
x
,
y
)
must be a point of
p
. The line
p
equation is
y
p
=
p
1
.x
p
+
p
2
,
and the coefficients
p
1
and
p
2
are determined by:
( )
xpyp
rp
=
+=
12
11
2
arctantan
π
The projected point that corresponds to the vehicle position is (
x
C
,
y
C
),
calculated from the interception between lines
r
and
p
. The length of each track
stretch
j
,
L(j)
has already been calculated analytically. The corrected Travelled
Track Distance of (
x
,
y
),
d(x,y)
is then obtained through Equation (3.7).
21
11
22
pxpy
pr
rp
x
CC
C
+=
=
( ) ( )( ) ( )( ) ( )
=
++=
1
1
22
,
i
j
TCTC
jLiyyixxyxd
(3.7)
If the track stretch is a curve, the center line perpendicular projection must
be calculated in another way. Instead, the radius line that crosses the car position
(
x
,
y
) should be used, maintaining the orthogonal characteristic of this operation.
Considering that all curves are arcs of circle, polar coordinates are used
in the projection calculation. Some auxiliary variables, especially angles, are
necessary and defined below.
The angle between the global
X
-axis and the first point radial line is .
That angle is easily obtained from the orientation of the track stretch first point,
β(i)
, and the sign of the curve angle,
α(i)
:
51
( ) ( )( )
2
sign
π
αβ
= ii
The point (
Cx
,
Cy
) is the center of curvature of the track stretch
i
and is
defined by using the inverse polar transform. Hence, using the curve radius,
R(i)
,
the arc angle , and the coordinates of the previous stretch starting point’s (
x
T
(i–
1)
,
y
T
(i–1)
), the transform can be written as:
(
)
( )
(
)
( )
+
=
1
1
sin
cos
iy
ix
iR
iR
C
C
T
T
y
x
The orientation of the desired radius line that crosses the car position,
γ
, is
obtained from the vertical and horizontal variation between the center of
curvature and the vehicle position,
x
and
y
. Finally, the corrected traveled track
distance,
d(x,y)
, is obtained as shown in Equation (3.8). The graphical
representation of the curve path algorithm can be seen in Figure 3.5.
( )( )
+=
=
=
x
y
yy
xx
i
Cy
Cx
arctansign
απγ
( ) ( ) ( )
=
+=
1
1
,
i
j
jLiRyxd
γ
(3.8)
52
γ
()
i
α
() ()( )
iyix
TT
,
(
)
C
C
y
x
,
( )
yx
CC
,
(
)
(
)
(
)
1
,
1
+
+
i
y
i
x
T
T
R i
( )
Figure 3.5 – Curve’s Projection Procedure.
3.2.2. Validation Tests
To validate the procedure, the track defined in Table 3.1 was implemented
in the Simulink
®
environment. A test trajectory, tangent to the second curve of
this track, is defined manually. This trajectory does not coincide with the lane
center line and, in order to generate the acceleration profile input, the correct
travelled track distance should be calculated.
In Figure 3.6, the lane center line, the trajectory performed by the vehicle
and the corrected center line projection are plotted together. The track travelled
distance of the last point indicated by a black x” in the same figure is 196.20 m.
Comparing it to the analytical distances showed in Table 3.1 and considering
that the car is approximately in the first third of the second straight line, the
corrected distance should be:
d
= 100 + 20
π
+ 100/3 196.16.
-20 0 20 40 60 80 100 120
-70
-60
-50
-40
-30
-20
-10
0
10
X (m)
Y (m)
Lane Center Line
Realized Trajectory
Corrected Traveled Distance Projection
Figure 3.6 – Traveled Distance Correction Validation Test: Projection Procedure.
53
3.3. Present-based Trajectory Error Definition
3.3.1. Presentation and Description
As mentioned before, two different error generation methods were
developed with the purpose of understanding and modeling how humans identify
a deviation from a desired path. The first one, detailed in this section, consists of
comparing the instant car position and orientation to desired values of those
variables on the closest point in the reference trajectory.
Human are able to perform this task automatically. However, in the case
of a computational search for the trajectory’s closest point, much information
must be stored and computed. As the car initial position is always the first point,
this is surely the closest point to the reference, therefore creating the base for the
recursive calculation.
The index of the closest point is
i
cp
, which is represented in Figure 3.7. A
region around this point is also stored in order to minimize the search domain in
the next iteration. The vehicle’s reference system (
X
C
,
Y
C
) appears in gray and it
is placed on the vehicle center of mass. The track reference system is placed on
the closest point and is represented by the axes in black (
X
P
,
Y
P
). The car’s yaw
angle is
θ
, and the angle between the trajectory tangents at the
i
cp
point and the
global
X
-axis is
λ
.
λ
Figure 3.7 – Present-based Trajectory Error: Graphic Representation.
54
The closest point index calculation is repeated throughout the iterations;
before updating
i
cp
, the previous iteration index value is stored in the variable
i
last
.
The region is stored as the array of the points indexes,
a
reg
, which generally
contains the closest point index itself and some points after and before.
The ideal gaps are symmetrical around the closest point and may be
changed manually by the variable
n
gap
. Its determination must consider the
vehicle speed and simulation time. The algorithm must treat some situations
where the number of points after and before the closest point is not the same.
The first contour condition is when
i
last
is equal or smaller than
n
gap
, and the
region is defined as in Equation (3.9).
{
}
gaplastgaplastlastreg
niniia ++= , 1- , , , , 2 , 1 KK
(3.9)
Another special situation is when the vehicle approaches the end of the
trajectory. If
i
last
plus
n
gap
are equal or higher than the trajectory array length
l
traj
,
the region array is written as in Equation (3.10).
{
}
trajtrajlastgaplastgaplastreg
llininia , 1 , , , , 1 , += KK
(3.10)
It is generally possible to map a complete search region with the number
of elements, determined by 2.
n
gap
+1. The region of possible closest points is then
updated recursively as shown in Equation (2.3).
{
}
, , , ,
gaplastlastgaplastreg
niinia += KK
(3.11)
The closest point is the point in the region array with minimum Euclidean
distance to the car’s center of mass, (
x
,
y
). Equations (3.12) show the
implementation of this calculation and also the
i
cp
determination.
( ) ( )
(
)
( )
(
)
( )
=
+=
regcp
regtrajtrajreg
di
aiyiyxixid
min
22
(3.12)
55
Calculating the car’s position and orientation regarding the trajectory is the
last step for obtaining the error components. The strict changes from global
coordinates (
X
,
Y
) to local reference coordinates, (
X
P
,
Y
P
) and (
X
C
,
Y
C
), are shown
in Equations (3.13) and
(
3.14).
=
λλ
λλ
cossin
sincos
PG
R
(3.13)
=
θθ
θθ
cossin
sincos
CG
R
(3.14)
By multiplying (
x
,
y
) by the rotation matrix
G
R
P
the car position can be
referred to the local system. Hence, as shown in Equations (3.15), the position
error,
E
P
, is equal to the
y
P
component with the opposite sign. This sign change
intends to automatically indicate if the car is too much to the left or to the right
side.
(
)
( )
=
+
=
PP
cptraj
cptraj
PG
P
P
yE
iy
ix
y
x
R
y
x
(3.15)
Considering that the treated tracks can be closed circuits,
λ
and
θ
may
assume values in other quadrants as well. The matrices described in Equations
(3.13) and (3.14) can be used to express the rotation between the track’s and
vehicle’s local reference systems. The matrix manipulation is:
( ) ( )
Orthogonal is
11
111
T
PGPGCGCGPGCP
CPCGPGCPPGPGCGPG
CPPGCG
RRRRRR
RIRRRRRRR
RRR
==
==
=
Therefore, the orientation error,
E
a
, can be obtained from the rotational
matrix
P
R
C
. As seen in Equation (3.16), all the matrix positions are known
trigonometric functions of
E
a
.
56
==
aa
aa
CG
T
PGCP
EE
EE
RRR
cossin
sincos
(3.16)
Both error components calculated here were used by the controller
developed in Chapter 5. They are sufficient to guarantee that any controller has
the information not only to follow the track center, but also to perform it with the
correct orientation.
3.3.2. Validation Tests
The error generation procedure is directly applied to a predefined
trajectory and to the car’s condition. Tests shown here intend to confirm the
expected error behavior in specific conditions, and are not related to any real
application or vehicle model.
The primary and most important test consists of evaluating the model
response. The algorithm is submitted to known inputs and then it is checked
whether the error calculated components represent those inputs properly. The
Simulink
®
Block Diagram used in this test is shown in Figure 2.13. The car global
displacement is represented by
x
,
y
and
θ
.
Car Global
Displacement
x
y
theta
AngError1
AngError
PosError
x
y
theta
Test Values
Global Position
Position Error
Angle Error
Present Basis Trajectory Error
DesiredTrajectory
Figure 3.8 – Present-based Trajectory Error Validation 1
st
Test: Simulink Block Diagram.
The car displacement for this test is defined as a straight line with
constant speed. In the block diagram,
x
is a ramp function, and
y
and
θ
are
constants defined here as 0. This and the desired trajectorycan be seen in Figure
3.9. The output error components are shown in Figure 3.10.
57
0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
1.5
X [m]
Y [m]
Realized Trajectory
Desired Trajectory
Figure 3.9 – Present-based Trajectory Error Validation 1
st
Test: Inputs.
0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
E
p
[m]
Distance [m]
0 1 2 3 4 5 6
-50
0
50
E
a
[º]
Distance [m]
Figure 3.10 – Present-based Trajectory Error Validation 1
st
Test: Outputs.
It can be seen in Figure 3.10 that the test response is coherent with the
given inputs. Notice that the position error,
E
p
, does not repeat a sinusoidal
profile. The orientation error,
E
a
, varies from –45º to 45º in accordance with the
same sinusoidal inclination angles.
An important point is to analyze the responses when the trajectory is a
closed circuit. As the error reference system follows the trajectory, it is interesting
58
to see how a full turn affects the error values. Another relevant matter is whether
the error keeps close to zero when the car manages to chase the trajectory.
This final experiment will test both situations simultaneously. The
Simulink
®
Block Diagram is modified so that it submits the error algorithm to a
circular trajectory and a similar car displacement.
The defined inputs can be seen in Figure 3.11. Visually, they are exactly
the same. However, the circle equation is graphically represented in a numeric
environment by a polygon with a finite number of faces. Therefore, as these two
data sets were created separately, the polygons are not identical.
-3 -2 -1 0 1 2 3
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
X [m]
Y [m]
Realized Trajectory
Desired Trajectory
Figure 3.11 – Present-based Trajectory Error Validation 2
nd
Test: Inputs.
As shown in Figure 3.12, the position error,
E
p
, does not present
significant values throughout the trajectory. Nevertheless, the orientation error
E
a
, is more susceptible to it.
59
0 2 4 6 8 10 12
-1
-0.5
0
0.5
1
E
p
[m]
Distance [m]
0 2 4 6 8 10 12
-50
0
50
E
a
[º]
Distance [m]
Figure 3.12 – Present-based Trajectory Error Validation Second Test: Outputs.
Despite the small numeric disturbance, this test confirms the expectations.
It shows that when the car follows a trajectory, the error signal remains close to
zero. In addition, it can be observed that the error generation procedure is suited
to closed circuits.
3.4. Future-based Trajectory Error Definition
3.4.1. Presentation and Description
The error analysis presented above represents the perception of a driver
in a car “without windows and with a small hole on the floor”. That driver is able to
notice deviations just after they occur, and only then react to them.
Differently from the present-based trajectory error, the future-based
trajectory error considers road information ahead, which is more representative of
the way human beings drive.
As the previous method, the car initial position is always the first point of
the trajectory. A region of possible closest points is also kept stored to minimize
the search domain, and two local reference systems are again placed on the
car’s center of mass and on the closest point.
Instead of getting error information only from
i
cp
, a number of forward
steps,
n
FS
, are also analyzed. Those forward positions may be collected
sequentially or by ignoring some intermediate data. The step size is defined by
variable
δ
i
. A schematic procedure is illustrated in Figure 3.13.
60
λ
Figure 3.13 – Future-based Trajectory Error: Graphic Representation.
Once more, the closest point index calculations are repeated throughout
the iterations and the previous iteration index value is stored in
i
last
. The
a
reg
array
is determined by the algorithm described in Equations (3.9), (3.10) and (2.3); the
closest point,
i
cp
, is the same as shown in Equation (3.12).
The new algorithm begins by looking at the present trajectory information
regarding the vehicle. In the present-based trajectory error, the car position, (
x
,
y
),
considered the track’s reference system. Here the rotation matrix
G
R
C
, detailed in
Equation (3.14), is used for expressing the track points with respect to the car’s
local reference system. From
i
cp
and for all the desired forward steps, that
calculation is detailed in Equation (3.17).
( )
( )
( )
( )
{
}
+=
+=
=
+
=
1
, ... , 2 , 1 , 0
kj
kii
nk
y
x
iy
ix
R
jy
jx
icp
FS
traj
traj
CG
C
C
δ
(3.17)
The main idea is to consider the influence of all points in the
errorcalculation. A natural method is to compute the mean value among the
y
C
components of all track information obtained above. However, in order to add
more flexibility to the model, the array
w
FS
is defined to calculate the position
error as a weighted average, as shown in (3.18).
61
( )
+
=
+
=
1
1
)()(
1
1
FS
n
j
FSC
FS
p
jwjy
n
E
(3.18)
It is very important to keep the convention that the positive error is related
to the car’s left. Therefore,
y
C
is written negatively, because in this case the error
reference system is placed in the car.
The orientation error generation procedure implemented here also
considers the future information. It starts with the calculation of the
C
R
P,
C
R
P
matrix for each point
j
ahead. To calculate the contributions of each future point
to the orientation error,
E
a
(j)
, it is necessary to invert the trigonometric functions
in each rotation matrix. Those operations are detailed below and the error
definition appears in Equation (3.19).
( ) ( )
( ) ( )
( ) ( )
==
==
=
=
jEjE
jEjE
RRR
RRRRIRR
RRRRR
RRR
aa
aa
j
PG
T
CG
j
PC
T
PGPGCGCP
j
PGCG
j
PCCGCG
j
PCCG
j
PCCG
j
PG
cossin
sincos
orthogonal is
11
11
Erro! Não é possível criar objetos a
partir de códigos de campo de
edição.
(3.19)
3.4.2. Validation Tests
Tests shown here have the same structure as those in 3.3.2. One
evaluates if the responses are conceptually correct, and the other checks its
behavior in critical situations.
The Simulink
®
Block Diagram used in this validation analysis and in all
following tests is shown in Figure 3.14. Here the future-based trajectory error is
the tested block.
62
x
y
theta
AngError1
AngError
PosError
x
y
theta
Test Values
Car Global Position
Position Error
Angle Error
Future Basis Trajectory Error
DesiredTrajectory
Figure 3.14 – Future-based Trajectory Error Validation Tests: Simulink Block Diagram.
Again the car displacement is established as a straight line with constant
speed,
x
is a ramp function,
y
and
θ
are constants set to 0. The desired trajectory
is plotted together with the car displacement in Figure 3.15.
As seen in the previous section, the future-based trajectory error algorithm
allows variations in the number of considered forward steps,
n
FS
, and also in the
sample interval,
δ
i
. Different values for
n
FS
and
δ
i
were tested for the same inputs
used above; results can be seen in Figure 3.16.
0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
1.5
X [m]
Y [m]
Realized Trajectory
Desired Trajectory
Figure 3.15 – Future-based Trajectory Error Validation 1
st
Test: Inputs.
63
0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
Outputs
E
p
[m]
Distance [m]
0 1 2 3 4 5 6
-50
0
50
E
a
]
Distance [m]
n
FS
=5 ;
δ
i
=1
n
FS
=15 ;
δ
i
=1
n
FS
=15 ;
δ
i
=2
n
FS
=20 ;
δ
i
=5
n
FS
=5 ;
δ
i
=1
n
FS
=15 ;
δ
i
=1
n
FS
=15 ;
δ
i
=2
n
FS
=20 ;
δ
i
=5
Figure 3.16 – Future-based Trajectory Error Validation 1
st
Test: Outputs.
The first case responses were very similar to those obtained through the
present-based trajectory error procedure. Knowing that, in simulation, the
intervals are of 0.001s,
n
FS
= 5 and
δ
i
= 1, the error procedure considers
information from few centimeters ahead only.
In the next case, with
n
FS
= 15 and
δ
i
= 1, the future information caused
some changes to
E
p
and
E
a
graphic shapes. However, as the step size between
the evaluated points was still one, the future information does not compensate
the computational effort in increasing the number of forward steps.
Relevant results were obtained in the next two cases. With the same
n
FS
but with a step size equal to two, fifteen points were evaluated; the thirtieth step
ahead was considered in error calculations. The graphs presented in Figure 3.16
clearly show how the error signals were influenced by future information.
E
p
now grows faster while the trajectory is diverging from the car; when
the future distance is decreasing, the position error follows that path
asymptotically.
E
a
also presents this behavior of anticipating and smoothing the
sinusoidal transitions. It is important to remember that this response could
64
change drastically with the array’s weight
w
FS
(defined uniformly here in order to
give the same importance to all points evaluated by error procedure).
The second test consists of applying a coincident trajectory and car
displacement inputs that should represent a closed contour. Therefore, a circular
trajectory was used and the car displacement was defined as a cosine in
x
, a sine
in
y
and a ramp in
θ
. In Figure 3.17, the test inputs can be seen. Those are the
same inputs given in the second test of the present-based trajectory error
procedure.
-4 -3 -2 -1 0 1 2 3 4 5 6
0
1
2
3
4
X [m]
Y [m]
Realized Trajectory
Desired Trajectory
Figure 3.17 – Future-based Trajectory Error Validation 2
nd
Test: Inputs.
Calculated error outputs for different values of
n
FS
and
δ
i
appear in Figure
3.18.
65
0 2 4 6 8 10 12
-1
-0.5
0
0.5
1
E
p
[m]
Distance [m]
0 2 4 6 8 10 12
-50
0
50
E
a
[º]
Distance [m]
n
FS
=5 ;
δ
i
=1
n
FS
=15 ;
δ
i
=1
n
FS
=15 ;
δ
i
=2
n
FS
=20 ;
δ
i
=5
n
FS
=5 ;
δ
i
=1
n
FS
=15 ;
δ
i
=1
n
FS
=15 ;
δ
i
=2
n
FS
=20 ;
δ
i
=5
Figure 3.18 – Future-based Trajectory Error Validation 2
nd
Test: Outputs.
Despite some small disturbance due to numerical difference between the
circular trajectory and the car displacement, this test confirms the expectations.
Although the car follows the trajectory, the position error increases with
n
FS
and
δ
i
.
This occurs because a larger part of the circle ahead from the car’s position is
evaluated by the error procedure.
The orientation error repeats the same behavior. This was also expected,
once the trajectory is ending and the error procedure does not have more future
points to evaluate.
66
4.
Trajectory Determination: Evolutionary Optimization
Determining the minimal time trajectory is not a simple task, especially
when considering all the variables involved. The growing demand on autonomous
driving systems stimulates research towards new technologies.
Iterative optimization methods have been applied to solve the path
determination problem. As a first attempt a classical method based on the
gradient descent was used by Carrera in [11], also implemented with the Matlab
®
Optimization Toolbox [16]. This optimization procedure is organized in a block
diagram as shown in Figure 4.1.
Parameters
and
Variables
Initialization
OPTIMIZATOR
Matlab Optimization Toolbox
fminimax.m function
Nonlinear minimization function w/ constrains
SIMULATOR
Simulink/Matlab
Oriented Particle Vehicle
Constraints Determination
Penalized Objective Function
Testing
Convergence
Minimum Time?
Maximum Iterations?
No
Yes
Optimal
Trajectory
Trajectory, Attitude
& Time
Acceleration
Parameters
Figure 4.1 – Classic Optimization Block Diagram.
This chapter proposes, analyzes and describes the implementation of an
optimization technique based on genetic algorithms, also known as evolutionary
computation. In a few words, its approach consists of evolving a set of
acceleration profiles which takes the car through the minimum time trajectory of a
previously specified track.
4.1. Presentation and Description
Similarly to other computational intelligence techniques, genetic
algorithms are inspired on nature. The problem’s solution is treated as an
67
individual among a population of other possible solutions. Inspired on natural
selection, the technique consists of analyzing each individual’s capacity of
attending the natural requisites to reproduce and pass its genetic characteristics
to the next generations.
In nature, the better the physical conditions one has, the better the
chances of survival. Moreover, the more one reproduces, the higher the
probability of passing on the genetic material. This fitness of the natural individual
is translated to the solution population as the value of a function to be optimized.
This genetic material is a codification of the possible solution relevant
characteristics, and those should be changed by reproduction and recombination
in order to find a better solution in the generation changes, Figure 4.2 shows the
conceptual block diagram.
Parameters
and
Variables
Initialization
SIMULATOR
Simulink/Matlab
Oriented Particle Vehicle
Individual Evaluation
&
Constraints Determination
Penalized Fitness Function
Testing
Convergence
Minimum Time?
Maximum Iterations?
No
Yes
Optimal
Trajectory
Trajectory, Attitude
& Time
Acceleration
Parameters
Decodification
OPTIMIZATOR
Matlab Genetic Algorithm Toolbox
Nonlinear minimization function w/ constrains
Codification
ElitismCrossover
Mutation
Reproduction
Roulete
Recombination Selecion
Next Generation
Composition
Best Individuals
Figure 4.2 – Genetic Algorithm Optimization Block Diagram.
4.1.1. Initial Estimative Determination: Center Line Trajectory
As any heuristic optimization method, genetic algorithms can achieve
better results if an initial estimation is given. A good initial estimation, called
seeding, is important for convergence, especially in problems with a vast domain.
Considering the car trajectory, a natural seed is the center line trajectory,
since the random acceleration profiles would hardly take the vehicle to the track
end correctly. Acceleration profiles that result in the center line trajectory can be
easily obtained by analytical calculations of the car’s speed (
V
Max
) on a curve
stretch
i
, the curve radius (
R
) and maximum lateral acceleration (
a
LMax
). The
68
profile parameter
NO
a
for this track stretch
i
is shown in Equation (4.1). Figure
4.3 shows an example of a center line trajectory and Figure 4.4 shows the
acceleration profiles for this trajectory.
( ) ( )
( )
( )
( )
giR
iV
ia
aiRiV
Max
N
LMaxMax
=
=
2
0
(4.1)
0 20 40 60 80 100 120 140 160
-10
0
10
20
30
40
50
X [m]
Y [m]
Lap Lime:4.125 s
Accomplished Distance:183.6 m
Track
Limits
Trajetory
Figure 4.3 – Center Line Trajectory.
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aT [G's]
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aN [G's]
Figure 4.4 – Correspondent Acceleration Profiles.
4.1.2. Chromosome Codification
As mentioned before, although an optimal trajectory is the main goal here,
optimization variables are actually the acceleration profiles. Consequently,
69
chromosomes should contain any relevant information on the parameterization of
those profiles, as seen in Figure 4.5 and detailed in Chapter 2.
d
2
T
d
1
T
d
0
T
d
0
T
a
1
T
a
Traction
Breaking
d
2
N
d
3
N
d
1
N
d
0
N
d
0
N
a
d
2
N
d
3
N
d
1
N
d
0
N
d
0
N
a
Left Turn
Right Turn
Figure 4.5 – Acceleration Profiles.
Codification of the acceleration profiles into a chromosome can be seen in
Figure 4.6, where the 2-D array is lined up as a 1-D vector for an easier
implementation of genetic operators.
a
T0
(1) a
T1
(1) d
T0
(1) d
T1
(1) d
T2
(1) a
N0
(1) d
N0
(1) d
N1
(1) d
N2
(1) d
N3
(1)
a
T0
(n)a
T1
(n) d
T0
(n) d
T1
(n) d
T2
(n) a
N0
(n) d
N0
(n)d
N1
(n) d
N2
(n) d
N3
(n)
Track
part
1
codification
Track part n codification
...
Figure 4.6 – Chromosome Codification.
4.1.3. Genetic Operators Definition
Considering the chromosome as an array with different parameters values
for each track stretch, each operator must preserve the domain aspects within
the array sectors. Figure 4.7 shows those sectors for a single track stretch with its
respective features. The parameter
l
TP
(i)
is the length of the
i
th
track stretch.
70
a
T0
(i) a
T1
(i) d
T0
(i) d
T1
(i) d
T2
(i) a
N0
(i) d
N0
(i) d
N1
(i) d
N2
(i) d
N3
(i)
Track part i codification
Maximum
Value
Minimum
Value
0000-1000-10
Normalized
1111111101
Normalized
l
TP
(i)l
TP
(i)l
TP
(i)l
TP
(i)5l
TP
(i)l
TP
(i)l
TP
(i)01.5
Actual
0000-5000-50
Actual
Maximum
Value
Minimum
Value
0000-1000-10
Normalized
1111111101
Normalized
l
TP
(i)l
TP
(i)l
TP
(i)l
TP
(i)5l
TP
(i)l
TP
(i)l
TP
(i)01.5
Actual
0000-5000-50
Actual
Figure 4.7 – Chromosome Sectors’ domains.
4.1.3.1. Reproduction Selection
The reproduction selection operator considered here is the fitness roulette
wheel. It introduces some random factor also existing in the natural process, but,
instead of having equal probabilities, the roulette slices are proportional to the
fitness function value of each individual in a generation. Therefore, the fittest
solution has more chance to reproduce and consequently pass on its genetic
material. Figure 4.8 illustrates the concept of fitness roulette wheel, where
percentages represent the chances of each individual to be selected for
reproduction.
50%18%
17%
6% 9%
Figure 4.8 – Fitness Roulette Wheel.
71
4.1.3.2. Crossover
The natural process consists of joining half of the genetic material from
each parent randomly divided to generate the descendant’s DNA. This
composition is like a mix of genetic code parts. In the computational
recombination, several methods are used to mime the same effect, concerning
chromosome structure and data format.
1 0 1 0 0 1 1 0
...
Mask:
Parent 1:
Parent 2:
Descendent 1:
Descendent 2:
X
...
...
......
Figure 4.9 – Scattered Crossover Algorithm.
4.1.3.3. Mutation
The natural mutations happen randomly and introduce unexpected
changes to one or more genetic characteristics of an individual. Mutation is
important for recovering genetic variability in a saturated population. Likewise, the
computational mutation method has the same purpose. Its algorithm randomly
chooses some of the generated individuals to change some part of their
chromosome also randomly chosen. The mutation rate
m
R
controls the
percentage of the population submitted to mutation.
4.1.4. Restrictions and Multi-Objective Fitness Function
In the presented problem, the variable to be minimized is the vehicle lap
time from the start to the end of the defined path. Each individual should follow
some accelerations constraints in order to be faithful to the vehicle kinematics
and to guarantee that the obtained trajectory can be followed. Track limits are
clear constraints that must also be respected.
In addition, each car has a set of acceleration limits above which it slides.
Those critical lateral and longitudinal accelerations are defined by the car’s
Friction Ellipse, presented in [9] and detailed in Chapter 2.
Classical optimization methods usually define existing restrictions as
inequalities. Methods based on Genetic Algorithms usually present faster
convergence by modeling restrictions as penalties in the final value of the fitness
72
functions. This approach can also be considered as a multi-objective fitness
function problem.
In the proposed representation, the first part of the fitness function is a
dynamic simulation of the vehicle digital model. Since a great number of
repetitive dynamic simulations are calculated throughout the evolution process,
the oriented particle vehicle model detailed in Chapter 2 is used..
The trajectory and speed information compose the fitness function
calculation. The distance achieved before the car leaves the track limits is called
d
Acc
and the entire track distance is
d
T
. The percentage of the track distance
travelled along a specific trajectory is called
d
%
.
Another relevant constraint also obtained through simulation is the
achieved acceleration in relation to the Friction Ellipse. Once the car model
exceeds the Ellipse’s acceleration limits,
P
FE
assumes a true boolean value,
which lessens the fitness of that individual.
The weights used in the fitness function had to be tuned through several
tests. The fitness function to be minimized is defined in Equation (4.2), where
V
is
the vehicle’s longitudinal speed,
a
N
is the lateral acceleration array and
n
is its
length.
( )( )
( )
( )
10
max
100020
Violated EllipseFriction ; 0
Respected EllipseFriction ; 1
1
1;0max
%
%
V
n
ia
Ptf
P
d
d
d
n
i
N
FE
d
Lap
FE
T
Acc
+=
=
=
=
(4.2)
The determination of the best values for each genetic algorithm
parameters depends especially on the chromosome model chosen. However, it is
also affected by the characteristics of the system being optimized. All parameters
used in the genetic optimization are shown in Table 4.1.
73
Table 4.1 – Genetic Optimization Initial Parameters.
1000
-
Generations
300
-
Selection
Normalized
Roulette
-
Reproduction
Scattered
Crossover
Uniform Rate: 80%
Mutation
Random
Number
Uniform Rate: 50%
Steady-State
Elitism
GAP: 10%
Initial
Population
Seed + Random Variation
joined with Intact Seed
4.2. Validation Tests
The validation tests for the developed genetic algorithm consist of running
the optimization method for a small track stretch. In order to create a
representative and yet simple track for the test, an “S” curve preceded and
followed by straight lines was defined. This small route creates both right and left
acceleration profiles, allowing a detailed analysis of the optimization output
trajectory regarding the center line seed trajectory.
Therefore, with the aim of correctly evaluating the output gain, the seed
trajectory is shown in Figure 4.10.
-60 -40 -20 0 20 40 60
-10
0
10
20
30
40
50
60
70
X [m]
Y [m]
Lap Lime:4.905 s
Accomplished Distance:153.7 m
Track
Limits
Trajetory
Figure 4.10 – Center Line Seed Trajectory.
A randomly created population is created from this seed much of it with
higher lap times or smaller accomplished distances. The complete optimization
process is as computationally expensive as any other iterative method. In a non-
74
parallel processing unit, a track of a hundred meters and four track stretches
implies about two hours of computational processing. After some tests, it is
possible to tune the crossover and mutation rates for a faster convergence.
Some results can be seen in Figure 4.11. Besides a lap time reduction of
about 20%, the resulting trajectory indicates atendency of chasing the curve’s
tangents. Resulting acceleration profiles are shown in Figure 4.12
-60 -40 -20 0 20 40 60
-10
0
10
20
30
40
50
60
70
X [m]
Y [m]
Lap Lime:4.685 s
Accomplished Distance:153.7 m
Track
Limits
Trajetory
Figure 4.11 – GA Optimization 1
st
Validation Test: Optimized Trajectory.
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aT [G's]
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aN [G's]
Figure 4.12 – GA Optimization 1
st
Validation Test: Acceleration profiles
In the applications’ chapter, other analyses on the optimized trajectories
will be detailed.
75
5.
Vehicle Control: Fuzzy Driver
Fuzzy Logic is a computational intelligence technique that aims to
reproduce human actions that can be expressed in linguistic form.
In this paper, a Fuzzy Controller is designed to emulate a human driver
controlling a car through a known trajectory. The implementation of such
controller makes use of the Fuzzy Toolbox of MatLab
®
. It is tested in Simulink
®
,
applied to the vehicle model previously described in section 2.2.
5.1. Presentation and Description
The first challenge when designing a fuzzy controller is to understand the
several phases involved in a human control of a vehicle: path recognition,
decision and muscular response. A model of the procedure is shown in Figure
5.1 and detailed below.
M u scula r
a n d S kele to n
Re sp o n se
B ra in
De cisio n
M a kin g
S te e rin g
Wh e e l
1
S te e rin g
W h e e l A n g le
T ra n sp o rt
De la y
M e ch a n ica l
S a tu ra tio n
Fu zzy
Co n tro lle r
1
ta o .s+1
First O rd e r
S yste m
2
A n g le E rro r
1
P o sitio n E rror
Figure 5.1 – Simulink Block Diagram: Detailed Fuzzy Driver.
Initially, the human body collects relevant information from the
environment, which in this case is simplified by the car position and orientation
errors related to the desired path. These errors, as explained in Chapter 3,
represent the driver’s eyes. Actually, a driver collects information not only through
his eyes, but also by feeling the car’s accelerations or by hearing the engine
response to his actions. These perceptions go beyond the task of controlling the
car and are not in the scope of this paper.
Second, the human brain decides what action to take, regarding the
information collected and the driver’s previous knowledge of the car behavior.
The more experienced the driver , the quicker his decision. It is very relevant to
the model to enable the calibration of the driver’s proficiency. The variable that
76
controls this “speed of thought” is
γ
, which is the gain of a Transport Delay block
in Figure 5.1.
The decision itself is modeled here by the Fuzzy Inference System, which,
from the mentioned inputs and a set of rules, defines the desired Steering Wheel
Angle,
δ
. The brain tells the muscles what the desired Steering Wheel Angle
should be. The action taken makes the steering wheel suddenly assume the
chosen angle. As seen in Figure 5.1, a First Order System is used to model the
muscular movement, and its time constant
τ
defines how fast the driver´s
reactions are.
To complete the modeling, a saturation block is placed just before the
output to represent the steering wheel mechanical limitation. This block could
also be placed inside the vehicle model together with the entire Steering System
model.
Some of the mechanical limitations are intrinsic to the driver, since it is
impossible for human arms to turn the steering wheel freely. In the case of a
racing car especially considering the speeds achieved it is never safe to let
the steering wheel turn more than once. Thus, the limits are symmetrical and
defined by the variable
α
Max
(Mechanical Saturation block in Figure 5.1).
As mentioned before, the Fuzzy Inference System (FIS) mimes the
human strategy and maps a given input to an output. The FIS is used here for
modeling the driver’s decision ability, based on the inputs and on a predefined
set of rules.
All the properties and methods that define the designed Mamdani-type
FIS are explained in this section. The structure of the developed FIS, called
FIStraj, can be seen in Figure 5.2. The number of fuzzy sets is shown in Figure
5.2.
Position Error (5)
Angle Error (5)
Desired Steering Wheel Angle (7)
FIStraj
(mamdani)
25 rules
Figure 5.2 – Designed FIS Structure.
77
Each fuzzy set is defined by a Membership Function (MF). Figure 5.3
shows the Position Error MFs. Note that the Position Error is parameterized by
l
w
which represents the lane width of any track and that the closest MFs to the
target point have shorter supports in order to achieve better convergence.
-lw/4 -lw/10 0 lw/10 lw/4
0
0.2
0.4
0.6
0.8
1
Position Error
Degree of membership
PELPLLPNPLRPER
Position Extreme Left
Position Low Left
Position Null
Position Low Right
Position Extreme Right
Figure 5.3 – Membership Functions: Position Error.
Figure 5.4 and Figure 5.5 show the MFs for Angle Error and Steering
Wheel Angle respectively.
-pi/2 -pi/3 -pi/6 0 pi/6 pi/3 pi/2
0
0.2
0.4
0.6
0.8
1
Angle Error
Degree of membership
AELALLANALRAER
Angle Extreme Left
Angle Low Left
Angle Null
Angle Low Right
Angle Extreme Right
Figure 5.4 – Membership Functions: Angle Error.
78
-pi -3.pi/4 -pi/2 -pi/4 0 pi/4 pi/2 3.pi/4 pi
0
0.2
0.4
0.6
0.8
1
Desired Steering Wheel Angle
Degree of membership
SELSMLSLLSNSLRSMRSER
Steering Extreme Left
Steering Medium Left
Steering Low Left
Steering Null
Steering Low Right
Steering Medium Right
Steering Extreme Right
Figure 5.5 – Membership Functions: Desired Steering Wheel Angle.
The next step in the implementation is the definition of the Fuzzy Rules.
They can be set by an expert or generated from numerical data.
The rules obtained from experienced drivers are represented in a matrix
form as shown in Table 1. The colors correspond to each fuzzy set defined in
Figure 5.3, Figure 5.4 and Figure 5.5.
Table 5.1 – Matrix Structure with the Fuzzy Rules.
Position
Error
Angle
Error
Steering
Extreme
Right
Steering
Extreme
Right
Steering
Medium
Right
Steering
Low
Right
Steering
Null
Steering
Extreme
Right
Steering
Medium
Right
Steering
Low
Right
Steering
Null
Steering
Low
Left
Steering
Medium
Right
Steering
Low
Right
Steering
Null
Steering
Low
Left
Steering
Medium
Left
Steering
Low
Right
Steering
Null
Steering
Low
Left
Steering
Medium
Left
Steering
Extreme
Left
Steering
Null
Steering
Low
Left
Steering
Medium
Left
Steering
Extreme
Left
Steering
Extreme
Left
Extreme
Right
Low
Right
Extreme
Left
Low
Left
Null
Low
Left
Extreme
Right
Extreme
Left
Null
Low
Right
Finally, to complete the FIS definition, Table 5.2 shows the operators used
for conjunction, disjunction, aggregation and implication, as well as the
defuzzification method.
79
Table 5.2 – Relation of Methods Used in FIS
Operation
CONJUNCTION DISJUNCTION IMPLICATION AGGREGATION DEFFUZIFICATION
Method min max min max centroid
For a better understanding of the implemented Fuzzy Inference System, a
simple example is solved step by step. First the position and orientation of the car
on the defined track are analyzed. In Chapter 3, two different methods for error
analysis have been detailed. Figure 5.6 illustrates the car condition for this
example. It also shows how the error values, in red, can be determined by the
Present-based Error method.
/5
π
2 /5
π
/2
π
π
- /2
π
0
- /5
π
2 /5
π
/5
π
l
w
/6
Figure 5.6 – FIS Example: Analysis of Position and Orientation of the Vehicle
The fuzzy inputs are the Position and Angle Error values,
l
w
/6 and -
π
/5
respectively. Figure 5.7 shows the Membership Functions for two of the activated
rules.
80
Figure 5.7 - FIS Procedure Example: 1
st
and 2
nd
Activated Rules.
The output MF is determined by the Fuzzy Rules shown in Table 5.1. The
conjunction (AND) operator, in this case the minimum, defines a cutoff level. The
output set final shape is generated by the application of the implication operator –
also the minimum. Figure 5.8 shows the same procedure for another two
activated rules.
81
Figure 5.8 - FIS Procedure Example: 3
rd
and 4
th
Activated Rules.
The output fuzzy set is obtained by the aggregation (maximum operator)
of all the output fuzzy sets. Figure 5.9 shows this operation and also the
defuzzification centroid which finally determines the desired Steering Wheel
Angle of -
π
/8 radians. This is illustrated by the steering wheel position shown in
Figure 5.10.
Figure 5.9 - FIS Example: Crisp Output Determination.
82
/2
π
-
π
π
- /2
π
0
Figure 5.10 - FIS Example: Desired Steering Wheel Angle
5.2. Validation Tests
Testing separately the small parts of a developed model is very important
for minimizing debugging in a complete and much more complex model. It is a
worthwhile effort not only to assure the proper functionality of the model, but also
to evaluate and treat some singularity conditions that the model may present.
Following the presented methodology, the FIS tests were implemented
modularly in the Simulink
®
environment. Figure 5.11 shows the Fuzzy Driver
block inserted in the testing scenario.
angError
posError
steering
posError
Position Error Test
Position Error
Angle Error
Steering Wheel Angle
Fuzzy Driver
angError
Angle Error Test
Figure 5.11 - Simulink Block Diagram Used in the FIS Tests.
In order to validate the developed FIS, a sinusoidal function is applied to
the two inputs, as shown in Figure 5.12. The result is also shown in the same
figure.
83
0 2 4 6 8 10
-10
0
10
Position Error [ m ]
Time [ s ]
0 2 4 6 8 10
-100
0
100
Angle Error [ º ]
Time [ s ]
0 2 4 6 8 10
-100
-50
0
50
100
Desired Steering Wheel Angle [ º ]
Time [ s ]
Figure 5.12 – FIS 1
st
Validation Test: Inputs and Output.
In the first two seconds of the simulation, and also on the last four, the
vehicle is far from the desired path and facing the opposite direction. Such
situation is corrected by an aggressive turn on the steering wheel. Another
relevant aspect is how the saturation limits affect the obtained Steering Wheel
Angle.
From the third second of the simulation and during the next three, the
output displays a small variation around zero. That behavior is also expected,
because if the car is away from the desired trajectory but already moving towards
it, the Position Error will automatically decay with time.
To assess the effect of the transport delay and the first order transfer
function, which should model the driver’s efficiency,
γ
and
τ
are changed for the
same inputs. Figure 5.13 shows the Drivers Comparison performed in the second
test.
84
0 2 4 6 8 10
-10
0
10
Position Error [ m ]
Time [ s ]
0 2 4 6 8 10
-100
0
100
Angle Error [ º ]
Time [ s ]
0 2 4 6 8 10
-100
-50
0
50
100
Time [ s ]
Steering Wheel Angle [ º ]
γ
= 0.1s ;
τ
= 0.2s
γ
= 0.5s ;
τ
= 1s
γ
= 1s ;
τ
= 2s
Figure 5.13 - FIS 2
nd
Validation Test: Driver Comparison.
As the legend shows, the blue line represents the Steering Wheel Angle
for the faster driver and the pink line shows the direction controls for the slower
one. The later starting point of the pink driver is due to the higher transport delay.
As for lower amplitude, when the control manages to achieve that amplitude, it
has already been affected by other input values that can pull the steering wheel
in an opposite direction.
With a perfect calibration, this controller is able to represent several kinds
of human driving styles thus enabling different studies.
85
6.
Applications
Once all the models are implemented, they can finally be compared,
evaluated and joined together to reproduce human driving experience. In this
chapter the developed computational procedures are compared to other
methods. Finally, a trajectory optimized with Genetic Algorithms is used as a
reference to the Fuzzy Controller.
A trajectory determination method based on classic optimization and
developed by [11] is compared to the Evolutionary Optimization presented in
Chapter 4..
A comparison between a linear PDD Directional Controller and the Fuzzy
Driver is also presented. The Stationary Kinematic Model is tested with both
controllers for the same reference trajectories.
6.1. Trajectory Optimization Methods Comparison
In order to analyze how classical and GA optimization work with adjacent
opposite curves, the circuit defined is an “S” chicane. Figure 6.1 shows the
Center Line trajectory for this track and also its lap time and accomplished
distance.
0 20 40 60 80 100 120 140 160
-10
0
10
20
30
40
50
X [m]
Y [m]
Lap Time:4.125 s
Accomplished Distance:183.6 m
Track
Limits
Trajetory
Figure 6.1 – “S” Chicane: Center Line Trajectory.
For all the simulations ahead, initial conditions for position, linear and
angular velocities and accelerations are set to zero.
86
6.1.1. Classical Optimization
Classical optimization methods are based on the objective function’s
gradient. Initial tests with the traditional optimization method were presented by
Hernan [11]; Figure 6.2 shows result for the same “S” chicane track shown in
Figure 6.1. The trajectory is clearly better than the Center Line trajectory given as
the initial step. However, from the acceleration profiles shown in Figure 6.3, it can
be noticed that there was almost no effect on the Tangent Acceleration (
a
T
)
profile.
0 20 40 60 80 100 120 140 160
-20
0
20
40
60
X [m]
Y [m]
Lap Time:3.98 s
Accomplished Distance:183.7 m
Track
Limits
Trajetory
Figure 6.2 – Classical Optimization 1
st
Test: Obtained Trajectory.
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aT [G's]
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aN [G's]
Figure 6.3 – Classical Optimization 1
st
Test: Acceleration Profiles.
87
6.1.2. Genetic Optimization
Optimization by Genetic Algorithms gave origin to the results shown in
Figure 6.4.
0 20 40 60 80 100 120 140 160
-20
0
20
40
60
X [m]
Y [m]
Lap Time:3.98 s
Accomplished Distance:183.7 m
Track
Limits
Trajetory
Figure 6.4 – Genetic Optimization 1
st
Test: Obtained Trajectory.
As shown Figure 6.5, acceleration profiles present a sensible change in
the longitudinal acceleration. Therefore, as shown in Figure 6.6, the speed
increases and the lap time is 3.98s.
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aT [G's]
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aN [G's]
Figure 6.5 – Genetic Optimization 1
st
Test: Acceleration Profiles.
88
0 20 40 60 80 100 120 140 160 180
0
10
20
30
40
50
Distance [m]
v [m/s]
Figure 6.6 – Genetic Optimization 1
st
Test: Longitudinal Speed.
6.2. Trajectory Error Calculation Comparison
A procedure for the calculation of the trajectory error was developed in
Chapter 3, with the purpose of modeling human perception of the car’s position
related to the desired trajectory. Two different models were implemented and
tested and both are compared here.
6.2.1. Present-based Trajectory Error
The first simulation covers the Fuzzy Controller block with the Present-
based Trajectory Error, as shown in Figure 6.7. The driver, emulated by the
Fuzzy Controller, only notices a change in the trajectory when this actually
happens. The test was made at 25 m/s in a track model of the Catalunya circuit in
Barcelona, as seen in Figure 6.8.
Figure 6.7 – Present-based Trajectory Error and Fuzzy Controller: Block Diagram.
89
-200 0 200 400 600 800
-400
-300
-200
-100
0
100
X (m)
Y (m)
Track Limts
Reference Trajectory
Real Trajectory
Figure 6.8 – Present-based Trajectory Error and Fuzzy Controller: Obtained Trajectory.
The bad performance is due to the absence of future information. At lower
speeds, the controller receives the trajectory information from the error procedure
with a higher frequency, presenting a minor oscillatory behavior. However, at
higher speeds, if a track change is not expected by the controller, it is unable to
take a proper action.
6.2.2. Future-based Trajectory Error
The second test considers the Future-based Trajectory Error block and
the Fuzzy Controller block, shown in Figure 6.9. The resulting trajectory is
plotted in Figure 6.10.
Figure 6.9 – Future-based Trajectory Error and Fuzzy Controller: Block Diagram.
90
-200 0 200 400 600 800
-400
-300
-200
-100
0
100
X (m)
Y (m)
Track Limts
Reference Trajectory
Real Trajectory
Figure 6.10 – Future-based Trajectory Error and Fuzzy Controller: Obtained Trajectory.
This model is capable of analyzing future points of a trajectory and takes
into account their deviation from the car’s tendency of movement. The result is a
smoother trajectory, with less deviations and a shorter lap time.
After parameters calibration – such as the step size,
δ
i
, and the number of
forward steps considered,
n
FS
the following experiments consider the Fuzzy
Controller and the Future-based Trajectory Error.
6.3. Vehicle Controllers Comparison
Considering the vehicle control problem, several different approaches
were previously adopted in the Vehicle’s System Group. Hey [12] proposed and
simulated a Classical Controller applied to a Kinematic Vehicle Model; those
results are used here for comparison.
6.3.1. PDD Controller
Figure 6.11 shows the reference and the trajectory obtained from a
simulation that assembles the stationary kinematic vehicle model and a PDD
controller presented [12]. As this model operates with constant speed and this
study is aimed at evaluating racing cars, the chosen velocity for analysis is
50m/s, (180km/h).
91
-200 0 200 400 600 800
100
-400
-300
-200
-100
0
X (m)
Y (m)
Track Limts
Reference Trajectory
Real Trajectory
Figure 6.11 – PDD Controller High Speed Test: Trajectory.
The system becomes unstable at high speeds, and the more it tries to
correct the trajectory, the larger the oscillations are. As shown in Figure 6.11, the
vehicle diverges from the reference trajectory at a curve, and starts to execute an
8-shaped trajectory.
6.3.2. Fuzzy Driver
Figure 6.12 shows the Fuzzy Driver’s trajectory at the same speed and
applied to the same vehicle model. The fuzzy controller manages to follow
adequately the whole reference trajectory and, despite some oscillatory behavior
due to high speed, it leaves the track limits only a few times.
92
-200 0 200 400 600 800
100
-400
-300
-200
-100
0
X (m)
Y (m)
Track Limts
Reference Trajectory
Real Trajectory
Figure 6.12 – Fuzzy Driver High Speed Test: Trajectory.
6.4. Fuzzy Driver Applied To Genetic Optimized Trajectory
The abovementioned solutions were tested and evaluated in comparison
to previously used techniques. Genetic optimization and the Fuzzy Controller can
easily be assembled with the purpose of defining the optimal trajectory and also
control the vehicle.
The array of position coordinates obtained from the optimization algorithm
is the reference trajectory for the controller. Figure 6.13 shows the center line
initial trajectory to be optimized by the genetic algorithm.
0 20 40 60 80 100 120 140
-50
-40
-30
-20
-10
0
10
20
X [m]
Y [m]
Lap Time:6.24 s
Accomplished Distance:195.1 m
Track
Limits
Trajetory
Figure 6.13 – Intelligent Applications Test: Center Line Trajectory.
93
0 20 40 60 80 100 120 140
-50
-40
-30
-20
-10
0
10
X (m)
Y (m)
Track
Limits
Trajetory
Figure 6.14 – Intelligent Applications Test: Evolved Trajectory.
Figure 6.14 shows the evolved trajectory that optimizes the lap time. The
tangent profile appears on the transition between the second and third curves
and, in order to maintain high speed, the final curve is performed with larger
radius.
Finally, this trajectory is the reference signal for the Fuzzy Driver. The
result is shown in Figure 6.15.
0 20 40 60 80 100 120 140
-50
-40
-30
-20
-10
0
10
20
X (m)
Y (m)
Track Limits
Reference Trajectory
Real Trajectory
Figure 6.15 – Fuzzy Driver High Speed Test: Trajectory.
This controller only acts on lateral kinematics and the vehicle model used
does not consider variation in speed. Therefore, the presented deviations from
the reference trajectory were expected. The evolved trajectory demands variation
in the longitudinal velocity, as shown in the acceleration profiles on Figure 6.16.
Accomplished Distance:195.1 m
Lap Time:4.8 s
94
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aT [G's]
0 20 40 60 80 100 120 140 160 180
-5
0
5
Distance [m]
aN [G's]
Figure 6.16 – Intelligent Applications Test: Evolved Acceleration Profiles.
Another fuzzy controller developed by Hey[12] that acts on longitudinal
accelerations, inferring when to throttle, brake and change gear, shifts the vehicle
in order to control the vehicle’s speed profile. The next step would be to link both
fuzzy controllers, creating some rules to correlate positions errors and
longitudinal velocity, enabling a more accurate trajectory control.
95
7.
Conclusions
7.1. Final Considerations
The proposed applications of computational intelligence techniques to
vehicle dynamic problems achieved promising results. The computational effort is
similar to that of analytical algebraic methods and performance indicators such as
lap time and sum of squared errors improved significantly. This performance is
surely limited by human’s response time, modeled here as the inference system
constants.
In addition, the proposed implementation successfully emulated the
actions of a human driver.
This paper was meant to propose an innovative, modular and simple
approach.
7.2. Future Works Propositions
With respect to the optimization method, some propositions can be made.
The chromosome model, for instance, treats all track stretches as a single
individual, which creates critically long chromosomes. As a result, the genetic
algorithms’ operators become slower and make convergence harder. An
alternative to reduce the chromosome size is to model a single track stretch, so
that several optimization procedures could be assembled sequentially. Another
option to enhance convergence is to create two parallel genetic optimization
algorithms, treating separately lateral and longitudinal accelerations. This
strategy would use the relationship among the variables on individual systems to
evolve them together. In genetic algorithms literature, this approach is called co-
evolution.
Concerning the fuzzy controller, the main ideas for future works are
focused on improving the emulation of a human driver's behavior. Fuzzy sets
shapes reflect human driving experience and other intelligent technique, such as
neural networks, can be used to automatically determine those shapes.
96
8.
References
[1] BREMERMANN, H. J. Optimization through evolution and
recombination. In: Self-Organizing systems. Washington D.C.: Spartan
Books, pp. 93-106, 1962.
[2] BREMERMANN, H. J. Quantum noise and information. In: 5
TH
BERKELEY SYMPOSIUM ON MATHEMATICAL STATISTICS AND
PROBABILITY. Berkeley: Univ. of California Press, 1965.
[3] BREMERMANN, H. J. The evolution of intelligence. The nervous
system as a model of its environment. In: ONR Report, n. 1. Seattle:
University of Washington, 1958.
[4] ZADEH L. A., Fuzzy sets and systems. In: System Theory. Brooklyn:
Polytechnic Press, pp. 29-39, 1965.
[5] RECHENBERG I., Evolutionsstrategie - Optimierung technischer
Systeme nach Prinzipien der biologischen Evolution, PhD Thesis,
Fromman-Holzboog, 1973.
[6] SCHWEFEL H. P., Numerische Optimierung von Computer-Modellen,
PhD Thesis, Birkhäuser, Basle,1977
[7] VELENIS E., TSIOTRAS P., Minimum Time vs Maximum Exit Velocity
Path Optimization During Cornering. In: IEEE INTERNATIONAL
SYMPOSIUM ON INDUSTRIAL ELECTRONICS. Atlanta: Georgia Institute
of Technology, pp. 355–360, 2005.
[8] VELENIS, E.; TSIOTRAS, P. Optimal Velocity Profile Generation for
Given Acceleration Limits. In: The Half-Car Model Case Scholl of
Aerospace Engineering. Atlanta: Georgia Institute of Technology, 2006.
[9] MILLIKEN W. F.; MILLIKEN, D. L. Race car vehicle dynamics. SAE
International, 1995.
97
[10] COSSALTER, V. et al. General Method for the Evaluation of Vehicle
Maneuverability with Special Emphasis on Motorcycles. In: Vehicle
System Dynamics, Padova:, v. 31, pp 113–135, 1999.
[11] SPERANZA NETO, M.; CARRERA, D. H. Z. Trajectory of High Speed
Ground Vehicles in Predefined Tracks Using Optimization Techniques.
In:
19
TH
INTERNATIONAL CONGRESS OF MECHANICAL
ENGINEERING
, 2007.
[12] SPERANZA NETO, M.; HEY, F. Behavior of Ground Vehicles in
Closed Paths Using Linear and Nonlinear Dynamic Models in a Control
Loop In:
19
TH
INTERNATIONAL CONGRESS OF MECHANICAL
ENGINEERING
, Brasília, 2007.
[13] BASTIAN, A. et al. System overview and special features of FATE:
Fuzzy Logic Automatic Transmission Expert System. In: INTERNATIONAL
JOINT CONFERENCE OF THE 4
TH
INTERNATIONAL IEEE
CONFERENCE ON FUZZY SYSTEMS AND THE 2
ND
INTERNATIONAL
FUZZY ENGINEERING SYMPOSIUM. Yokohama:, pp. 1063-1070, 1995.
[14] SAKAGUCHI, S.; SAKAI, S; HAGA, T. Application of Fuzzy Logic to
shift scheduling method for Automatic Transmission. In: THE 2
ND
IEEE
INTERNATIONAL CONFERENCE ON FUZZY SYSTEMS. San Francisco:
Honda R&D Co Ltd,1993.
[15] SPERANZA NETO, M.; RIBEIRO, S. SVDV-Collision: A Land Vehicle
Collision Analysis and Accident Reconstruction Software with
Friendly Interface. In: SAE BRASIL INTERNATIONAL CONGRESS, 2006.
[16] THE MATHWORKS INC..
Optimization Toolbox for Use with
MATLAB
User’s Guide. Natick:, pp. 5–53, 1990.
[17] CALDAS, A. C. I. L.. Validação Metrológica de um Sistema de
Aquisição de Dados para Aplicação em Testes Veiculares. Master
Dissertation (Metrology), Rio de Janeiro: PUC-Rio, 2008.
[18] MACADAM, C. C. Application of an Optimal Preview Control for
Simulation of Closed Loop Automobile Driving. In:
IEEE Transactions
on Systems, Man, and Cybernetics
, v.11, n. 6, 1981.
98
[19] HATWAL, H.; MIKULCIK, E. C. Some Inverse Solutions to an
Automobile Path-Tracking Problem with Input Control of Steering and
Brakes. In: Vehicle System Dynamics, pp. 61–71, 1986.
[20] HENDRIKX, J. P. M.; MEIJLINK, T. J. J.; KRIENS, R. F. C. Application
of Optimal Control Theory to Inverse Simulation of Car Handling, In:
Vehicle System Dynamics, pp. 449–461, 1986.
[21] BERNARD, J.; PICKELMANN, M. An Inverse Linear Model of a
Vehicle, In: Vehicle System Dynamics, pp. 179–186, 1986.
[22] Trom, J. D.; Vanderploeg, M. J.; Bernard, J. E. Application of Inverse
Models to Vehicle Optimization Problems. In: Vehicle System Dynamics,
pp. 97–110, 1986.
[23] Freund, E.; Mayr, R. Nonlinear Path Control in Automated Vehicle
Guidance. In:
IEEE Transactions on Robotics and Automation
, v. 13,
n. 1, 1997.
Livros Grátis
( http://www.livrosgratis.com.br )
Milhares de Livros para Download:
Baixar livros de Administração
Baixar livros de Agronomia
Baixar livros de Arquitetura
Baixar livros de Artes
Baixar livros de Astronomia
Baixar livros de Biologia Geral
Baixar livros de Ciência da Computação
Baixar livros de Ciência da Informação
Baixar livros de Ciência Política
Baixar livros de Ciências da Saúde
Baixar livros de Comunicação
Baixar livros do Conselho Nacional de Educação - CNE
Baixar livros de Defesa civil
Baixar livros de Direito
Baixar livros de Direitos humanos
Baixar livros de Economia
Baixar livros de Economia Doméstica
Baixar livros de Educação
Baixar livros de Educação - Trânsito
Baixar livros de Educação Física
Baixar livros de Engenharia Aeroespacial
Baixar livros de Farmácia
Baixar livros de Filosofia
Baixar livros de Física
Baixar livros de Geociências
Baixar livros de Geografia
Baixar livros de História
Baixar livros de Línguas
Baixar livros de Literatura
Baixar livros de Literatura de Cordel
Baixar livros de Literatura Infantil
Baixar livros de Matemática
Baixar livros de Medicina
Baixar livros de Medicina Veterinária
Baixar livros de Meio Ambiente
Baixar livros de Meteorologia
Baixar Monografias e TCC
Baixar livros Multidisciplinar
Baixar livros de Música
Baixar livros de Psicologia
Baixar livros de Química
Baixar livros de Saúde Coletiva
Baixar livros de Serviço Social
Baixar livros de Sociologia
Baixar livros de Teologia
Baixar livros de Trabalho
Baixar livros de Turismo