• No results found

Optimizing manoeuvres for long collision avoidance active system of a car

N/A
N/A
Protected

Academic year: 2022

Share "Optimizing manoeuvres for long collision avoidance active system of a car"

Copied!
93
0
0

Loading.... (view fulltext now)

Full text

(1)

Optimizing manoeuvres for long collision avoidance active system

of a car

Bachelor Degree Project in Mechanical Engineering C-Level 22.5 ECTS

Spring term 2013

Author: Ricardo Gonz´alez-Carrascosa Partida Supervisor: Daniel Svensson

Examiner: Thomas Carlberger

(2)
(3)

avoidance active system of a car

Abstract

This project presents the development of a collision avoidance active system for cars.

There is a large interest in developing avoidance system in the automotive industry since the accidents are of such nature that can be avoided if the system works as desirable e.g., in animal crossing or having the car in front stopping without the driver noticing.

A control system is designed to avoid collisions by acting on the steer and brakes of a car. An algorithm is developed to optimize a fuzzy logic controller which actuates on the steer and brakes of the car. The algorithm optimizes the inputs of the car, i.e. steer and brake, to avoid the collision with the object. The optimization of the trajectory implies that the car returns to the original lane and it is the minimum time possible in the other lane. The object is situated at different distances and the initial speed of the car also varies depending on the situations. The results are obtained by using a five degree of freedom car model that is developed in this project in conjunction with the

’magic formula’ tyre model, [1]. Simulations show that it performs collision avoidance manoeuvres in different conditions. Furthermore, improvements of the presents work are suggested that are believed to further enhance the presented algorithm.

I

(4)

Bachelor Degree in Mechanical Engineering to the University of Sk¨ovde, in the School of Technology and Society.

Date of submission: Friday 10

th

May, 2013

I hereby certify that all material in this dissertation which is not my own work has been identified and that no work is included for which a degree has already been conferred on me.

Ricardo Gonzalez-Carrascosa Partida

(5)

avoidance active system of a car

Acknowledgements

This diploma work would not been possible without the support and collaboration of some people:

ˆ To my supervisor Daniel Svensson by helping me with this diploma work, even he had no previous knowledge of the task I was doing.

ˆ A Aitor Carretero Broc, que empezo a realizar este proyecto, pero no pudo ter- minarlo. Gracias por todo lo que hiciste al principio.

ˆ A Carlos Urban Anta por dedicar su tiempo y por haberme ayudado en todo lo que ha estado en sus manos, sin tener conocimiento previo del proyecto que estaba realizando.

ˆ A todos los compa˜neros de residencia (Xenia) por darme apoyo durante la real- izaci´on de este proyecto y por hacer de este a˜no un a˜no inolvidable.

(6)

avoidance active system of a car CONTENTS

Contents

Abstract I

Acknowledgements III

List of figures VI

1 Introduction 1

1.1 Background . . . 1

1.2 Problem . . . 4

1.3 Goals . . . 4

1.4 Purpose . . . 5

1.5 Method . . . 5

1.5.1 Algorithm . . . 7

1.5.2 Model . . . 9

1.6 Limitations . . . 15

2 Modelling the vehicle 16 2.1 Point model . . . 16

2.1.1 Definition . . . 16

2.1.2 Validation . . . 18

2.2 Simple track model . . . 24

2.2.1 Longitudinal forces . . . 25

2.2.2 Lateral forces . . . 27

2.2.3 Aerodynamic forces . . . 28

2.2.4 Equation of motions for the simple track model . . . 28

2.2.5 Parameters used for the simple track model . . . 29

2.2.6 Validation . . . 31

3 Genetic Algorithm 40 3.1 Genetic operators used . . . 42

3.1.1 Genetic operator of selection . . . 42

3.1.2 Genetic operator of reproduction . . . 43

3.1.3 Genetic operator of mutation . . . 45

3.2 Objective function . . . 46

3.3 Other functions used . . . 50

(7)

avoidance active system of a car CONTENTS

3.4 Tuning the algorithm . . . 55

4 Results 57 4.1 Point model . . . 57

4.2 Simple track model . . . 60

4.2.1 Static object . . . 60

4.2.2 Moving object . . . 67

5 Conclusions 69 5.1 Conclusions of the project . . . 69

5.2 Analysis of the results . . . 70

5.2.1 Point model . . . 70

5.2.2 Simple track model . . . 71

5.3 Improvements to do in the project . . . 76

6 Future work 79 References 80 A Brainstorming 82 A.1 Objective Function . . . 82

B Moving object 83

(8)

avoidance active system of a car LIST OF FIGURES

List of Figures

1.1 Typical stopping distances [2] . . . 2

1.2 Classification of the safety systems. [3] . . . 2

1.3 Possibilities of the types of sensors in a car. [3] . . . 3

1.4 Fuzzy logic controller . . . 6

1.5 Fuzzy logic controller control surface. [4] . . . 6

1.6 Description of the algorithm . . . 7

1.7 Example inputs: Steer and brake vector . . . 8

1.8 Single track model (5DOF). [5] . . . 10

1.9 Double track model(8DOF).[6] . . . 10

1.10 Complex model of a car . . . 11

1.11 Full vehicle model, showing the integration of all subsystems. [7] . . . . 11

1.12 Brake system of a car. [8] . . . 13

1.13 Curve produced by Pacejka Formula.[1] . . . 14

1.14 TreadSim model with deflected carcass.[1] . . . 15

2.1 No inputs validation inputs . . . 18

2.2 Outputs . . . 19

2.3 Inputs: Constant braking for 5 seconds . . . 19

2.4 Outputs: Constant braking for 5 seconds . . . 19

2.5 Inputs: Constant steering . . . 20

2.6 Outputs: Constant steering . . . 20

2.7 Inputs: Steering for 5 seconds . . . 21

2.8 Outputs: Steering for 5 seconds . . . 21

2.9 Inputs: Steering for 5 seconds in both directions . . . 22

2.10 Outputs: Steering for 5 seconds in both directions . . . 22

2.11 Inputs: Steering example from the algorithm . . . 23

2.12 Outputs: Steering example from the algorithm . . . 23

2.13 Single track model (5DOF).[5] . . . 24

2.14 Inputs: No inputs . . . 31

2.15 Inputs: Constant braking for 5 seconds . . . 31

2.16 Inputs: Constant steering . . . 32

2.17 Outputs: Constant steering . . . 32

2.18 Slip angles outputs: Constant steering . . . 33

2.19 Inputs: Constant steering and return to origin . . . 34

2.20 Outputs: Constant steering and return to origin . . . 34

(9)

avoidance active system of a car LIST OF FIGURES

2.21 Slip angles outputs: Constant steering and return to origin . . . 35

2.22 Inputs: Steering to both sides . . . 36

2.23 Outputs: Steering to both sides . . . 36

2.24 Slip angles outputs: Steering to both sides . . . 37

2.25 Inputs: Algorithm example . . . 38

2.26 Outputs: Algorithm example . . . 38

2.27 Slip angles outputs: Algorithm example . . . 39

3.1 Genetic algorithm flow chart . . . 41

3.2 Example of roulette for the selection . . . 42

3.3 Single point crossover . . . 44

3.4 Double point crossover . . . 44

3.5 Uniform crossover with mask . . . 45

3.6 Mutation of a gene . . . 45

3.7 Plausible road situation . . . 46

3.8 Objective function flow chart . . . 47

3.9 Objective function: Lateral acceleration . . . 49

3.10 Objective function: Time in the other lane . . . 49

3.11 Objective function: End position . . . 50

3.12 Function: Generate population . . . 51

3.13 Function: Generate a member . . . 51

3.14 Steer vector explained . . . 52

3.15 Brake vector explained . . . 53

3.16 Trajectory example of a non returning member . . . 55

4.1 Simulation 1: Trajectory example of a non returning member . . . 57

4.2 Simulation 1: Outputs for a non returning member . . . 58

4.3 Simulation 2: Trajectory of a f lag = 2 member . . . 58

4.4 Simulation 2: Outputs of a f lag = 2 member . . . 59

4.5 Simulation 3: Trajectory f lag = 1 member . . . 59

4.6 Simulation 3: Outputs of a f lag = 1 member . . . 60

4.7 Simulation 1: Trajectory of the car . . . 61

4.8 Simulation 1: Outputs . . . 61

4.9 Simulation 2: Trajectory of the car . . . 62

4.10 Simulation 2: Outputs . . . 62

4.11 Simulation 3: Trajectory of the car . . . 63

4.12 Simulation 3: Outputs . . . 63

4.13 Simulation 1: Trajectory of the car . . . 64

4.14 Simulation 1: Outputs . . . 64

4.15 Simulation 2: Trajectory of the car . . . 65

4.16 Simulation 2: Outputs . . . 65

4.17 Simulation 1: Trajectory of the car . . . 66

4.18 Simulation 1: Outputs . . . 66

4.19 Simulation 2: Trajectory of the car . . . 67

4.20 Simulation 2: Outputs . . . 67

(10)

avoidance active system of a car LIST OF FIGURES

4.21 Trajectory of the car with moving object . . . 68

4.22 Outputs obtained from the moving obstacle situation . . . 68

5.1 Example trajectory . . . 70

5.2 Trajectory for the point model . . . 71

5.3 Trajectory of the car . . . 72

5.4 Examples where the time is the cause of failure of the algorithm . . . . 72

5.5 Example of not sine function trajectory . . . 73

5.6 Pattern observed for obstacle avoidance . . . 73

5.7 Peaks in the velocity . . . 74

5.8 Inputs for the two simulation . . . 74

5.9 Convergence plot of different simulations . . . 75

5.10 Car with moving object . . . 76

5.11 Differences between the lateral acceleration and the slip angle . . . 77

5.12 Proposed penalisation method . . . 78

B.1 Trajectory of the moving object at 10km/h . . . 83

(11)

avoidance active system of a car INTRODUCTION

Chapter 1 Introduction

1.1 Background

The vehicle safety has historically been one of the major objectives of the automotive industry. Over the years, the security systems have undergone a major evolution, in part, thanks to technological advances in this area. In recent years, advances in security systems have been more important because of the high competition among companies to have the best security systems, since this is an issue that matters to the population.

Car accidents happen every day. There are various causes for them to happen.

They can be separated into three main blocks.

ˆ Human factor

ˆ Road/environment factor

ˆ Mechanical factors

The first group is about how badly humans behave while driving. There are a lot of examples in where humans are the cause of car accidents. For examples because of distractions, speeding, fatigue, drunk or under the influence of drugs when driving, unsafe lane changes and improper turns. The second group involve the quality of the road, and also environmental problems, e.g. poor quality roads, rain, fog, ice, snow, night driving or animal crossings The last group takes into consideration the possible mechanicals failures of the car, e.g. tyre blow-outs and design defects.

In most of the accidents, the driver is the cause, even though, in some situations the environment is the cause of the crash, e.g animal crossing. So when they see the danger they do not know how to behave in order to avoid the collision. If the driver just brakes, it depends on the distance to the object in front, if it will collide or not.

This depends on the type of road, tyres and response time of the driver. The cars stopping distances increase as the speed increases, the higher the speed is the faster the response from the active system has to be. The next figure shows typical values for stopping distances.

(12)

avoidance active system of a car INTRODUCTION

Figure 1.1: Typical stopping distances [2]

If the object appears at a distance shorter than the stopping distance, the control system is be able to brake in less time than the human and, therefore, stop the car before the collision. For example, looking at the values for 30 mph if the driver sees the object when it is at 20 m away from the car. The driver will not be able to avoid the collision, but an active system could achieve it, since the thinking distance is much lower than the human. If the object appears in the braking distance, then even if the car brakes, it would not be able to stop before the collision, for example: Taking the same value of speed. If the driver and/or the sensors detect an object 12 m away from the car. They could reduce the speed but never avoid the collision. To avoid the collision, the safety system will have to steer away from it to avoid the collision.

Safety systems in cars are the contributor of the reduction of road accidents in the last 20 years. Some of these systems are nowadays obligatory, or most of the vehicles have them, such as ABS. In the future, it is likely to have other safety systems obligatory in cars.

There are various types of safety systems. The next figure explains how they are classified.

Figure 1.2: Classification of the safety systems. [3]

The figure above classifies the different safety systems. They are divided in two groups,

(13)

avoidance active system of a car INTRODUCTION

active and passive safety systems. The active safety systems are such that try to prevent the collision. The passive safety systems are such that once the collision has taken place it will reduce the consequences to the passengers.

To be able to detect the obstacle in front, the car needs to be equipped with many sensors. The next figure shows the different possibilities of sensors in a car.

Figure 1.3: Possibilities of the types of sensors in a car. [3]

In the case of long avoidance collision, the sensors needed will be frontal sensors. Due to the possible velocity of the car when approaching an object. A long range sensor is needed. From the figure, it can be seen that one possible sensor is the long-range radar.

Once the car is able to detect an object and the distance, it has to be able to do the manoeuvre by itself with the aid of actuators. So, for instance, the car will have to have installed a servo for the steering and some kind of system for the braking. The braking can have different possibilities. They are using a servo to act on the hydraulic system or using electric brake callipers.

Nowadays, car companies are working in the development of a safety system like this and in the paper, [3], it predicts that in more than ten years, there will be such as an active system that will avoid long collisions. The definition of Longitudinal Collision Avoidance is as following:

A sensor installed at the front or back end of a vehicle constantly scans the road for vehicles and obstacles. When one is found, the system determines whether the vehicle is in imminent danger of crashing, and if so, a warning is issued, or a collision avoidance manoeuvre is undertaken, depending on the system. If a car in front suddenly brakes or is stationary, it automatically pre-charges the brakes to help the driver avoid an accident by slowing down in time, or steering away from a potential collision. However if a collision is imminent, the system activates the car’s brakes automatically.

There has been some investigation about the same task, [9], Longitudinal Collision Avoidance. However, there are significant differences with the aim in this project.

These differences are based on the optimizing method and the control of the car they do. They have control of the torque of each wheel independently. In this project the

(14)

avoidance active system of a car INTRODUCTION

torque control is done to all the wheels at the same time, without the aid of a control system, e.g. ESP, AFS and ABS.

This diploma work is intended directly for car companies, because they are respon- sible for incorporating this system into their vehicles and the safety of the users, since it affects their own safety. Therefore, this diploma work is intended to prevent collisions and thereby, reduce the number of accidents.

1.2 Problem

There are many deaths due to car accidents in the world nowadays. The reason for these accidents is manly due to misbehaving of the drivers and environmental problems, such as animal crossing. The safety systems nowadays are focused in reducing the damage to the passengers once the crash has taken place. The active systems that are starting to be introduced are focused on just braking to stop the car or reduce the speed before the collision and therefore reduce the damage. This sometime is not enough because in some situations, the collision can be avoided by steering away. Designing this type of safety system will help to reduce the number of accidents and, therefore, the number of death. The task is to optimize the trajectories by obtaining optimal manoeuvres to prevent a frontal vehicle collision with a static/moving obstacle.

1.3 Goals

To satisfied the problem stated above, the following goals are desired to be satisfied.

ˆ Define a realistic model of the car using Matlab. A realistic model is a model that behaves in the best possible manner as a car. To compare the behaviour some test will be done to the model to verify that it behaves as a real car.

ˆ Design an algorithm that optimizes the inputs for the car, steering and braking.

The algorithm as to be able to show improvements in the best solution after some iterations.

ˆ Design the parameters that will determine how good the solution is. Since there are many outputs from the model, some parameters will be picked and interpreted to determine how good is the solution.

ˆ Obtain different optimal trajectories for different situations. Showing the inputs and outputs. To show the consistency of the algorithm various results of the same situation will be analysed and compared to see the convergence of the method.

ˆ Obtain trajectories for moving obstacle at slow speeds. The object could be moving at a slow speed, various results will be presented for this task to show the convergence of the method.

(15)

avoidance active system of a car INTRODUCTION

1.4 Purpose

The purpose of this project is to design a manoeuvre protocol to avoid frontal collisions.

The outputs can be then used in another algorithm to teach a fuzzy control, and then implemented in passenger/autonomous car to avoid accidents.

The goals set above that have to be fulfilled are. The definition of the model, the algorithm and the parameters that determine the quality of the situation, in other words the objective function. These are necessary in order to see the behaviour of the system while it is manoeuvring to avoid the collision.

The remaining goals are necessary to show a variety of situations where the accident can happen and the solutions obtained from the algorithm.

The purpose is to avoid accidents, with the benefits that it has, less people are harmed, or their lives could be saved. If the collision is avoided, less parts will need to be manufactured for the car company and less broken parts will be left in the road, with the environmental benefits.

1.5 Method

The development of this project will be used in a control system that is able to un- derstand the information given from the sensors and manipulate the actuators in the best possible manner. The control to be used is named Fuzzy control. These types of controllers work using diffuse logic. The reasons for using this type of control system is chosen are:

ˆ They work good in complex processes, if there is no simple model

ˆ In non linear processes. The behaviour of a car and all the environmental pa- rameters are not linear.

ˆ When the ”experience” of an operator is needed. The designer can determine by experience of simulations of by driving, that is some situations some manoeuvres are not recommended.

ˆ When some part of the system are unknown, depending on the model used some parts of the system are not considered, so when it applies to the real car it will not affect in much its solution

ˆ When adjusting a variable, it can produce an alteration on other variables The next figure shows the structure of a Fuzzy logic controller:

(16)

avoidance active system of a car INTRODUCTION

Figure 1.4: Fuzzy logic controller

The inputs to the figure could be the speed and the distance from the object, obtained from the sensors. These real inputs variables have to be transformed into variables that the controller can understand, this is done by a fuzzyficator block, using the appropriate transformation, that must be defined by the designer of the controller. The outputs are obtained by the interference mechanism block, which is explained below. The rules that the fuzzy controller uses are logical operators such as AND, OR and NOT. Then in the de-fuzzyficator block, the answers obtained from the controller are transformed to a signal to the actuators, brake and steer (outputs).

The interference mechanism simply gives an output depending on the inputs, the next figure shows the surface of the control:

Figure 1.5: Fuzzy logic controller control surface. [4]

The graph above has two inputs ( In figure Slip angle and Friction coefficient ) and one output (In figure Type). The inputs come from the fuzzification block, and the output will leave to the de-fuzzyfication block and then to the sensors. How this surface is created is not part of this project, and therefore not explained. The fuzzy controller is mentioned so the reader can see how this diploma work is solving the task. This project will be the ”knowledge” for the fuzzy logic controller, helping to develop the surface for the control.

(17)

avoidance active system of a car INTRODUCTION

The way the Fuzzy Logic controllers are made is by the experience of the operator.

This is why this project is simulating the manoeuvres because once it has the solutions, they are used to teach the fuzzy logic controller what it needs to do, in order to avoid the collision.

The method can then be divided in two sections, one section is for the optimization algorithm and the other for the model of the vehicle. The next figure shows how these are connected and the purpose of them.

Figure 1.6: Description of the algorithm

The purpose of the algorithm is to optimize the outputs so that it satisfies the objective function. The objective function is a list of requirements that the outputs must fulfil, i.e. to not collide with the object in front. The model is the element that simulates the behaviour of a car. Once the trajectory, obtained from the model, satisfies the objective function, inputs and outputs are obtained and saved to generate the surface of control for the fuzzy logic controller.

1.5.1 Algorithm

To obtain the trajectories, there are some possibilities in the optimization of the task, these are:

ˆ Genetic algorithms, neural networks

ˆ Heuristic searching algorithm

The advantages of these methods are that they can solve non-linear problems, and also they are multi-task solving. The heuristic searching algorithm has the advantage that if there is an optimal trajectory it is guaranteed that it can be found. The genetic algorithm and neural network algorithms have the disadvantages that the convergence can take more time than desired, and also there is no guarantee that convergence to the optimum results is achieved.

Due to the various inputs to the vehicle, brake and steer, the genetic algorithm or in a neural network is used. They are exceptionally robust methods, and although the optimal is not guaranteed, the results obtained can be in an acceptable range, in a competitive time with the other types of combination algorithms [10].

(18)

avoidance active system of a car INTRODUCTION

The inputs, brake and steering, are introduced to the model as a vector. This vector has the steer angle or the brake force, depending on what vector, for each interval of time. The following figure shows plausible brake and steer vectors:

Figure 1.7: Example inputs: Steer and brake vector

Genetics algorithm (GA) are optimization algorithms that attempt to obtain the best solution out of a group of plausible solutions. The mechanisms that make the GA able to optimize are like a metaphor of the biological evolution.

The GA are adaptive methods that can be used to solve matters of finding and optimization. They are based on the genetic progress of the living organism. During generations, the population has evolved in the nature accordingly with the principle of natural selection where only the strongest will survive, told by Darwin (1859).

By imitating the process, the GA are able of creating solutions that each time are better for the ”real world”. In nature, the members compete between each other to find resources, like food, water and shelter. They do that even between the members of a family.

Those members that are more successful in surviving have more probabilities of generating a greater number of descendent. The members less able would generate less descendent. This means that the genetic of the most successful member will continue for the next population.

The main advantages of the genetic algorithms are:

ˆ It is easy to execute them in the modern parallel architectures.

ˆ When used for optimization, they are less affected by local maximum and mini- mum points than using traditional techniques.

(19)

avoidance active system of a car INTRODUCTION

ˆ In a linear task, the aptitude of each component is independent, so each small improvement in a parameter will turn to an improvement in the system. In non- linear problems, the parameters can produce changes in all the system, and where multiple changes which, individually are damaging, in combination with others can drive to a better individual. Non-linear problems make the searching space increases exponentially, and that is where the genetic algorithms are capable of reducing the time to find an optimum result against investigation methods that search trough the whole domain.

The genetic algorithms have the disadvantages:

ˆ The representation of the task has to be done in a language that allows robust solutions. This means that they are able to tolerate random changes in order to do not produce fatal errors constantly or results without physical sense.

ˆ The objective function has to be well defined for a given problem. If it is done wrongly, then the algorithm might not be able to find a valid solution or it will be solving a different problem.

ˆ A well known problem about the genetic algorithms is premature convergence. If an individual is better than the rest of his competitors then, it can reproduce so spread out making the algorithm converge to itself. Instead of searching through the whole domain looking for the global optimum solution.

1.5.2 Model

For the algorithm to be able to ”drive” the car thought the road, the car needs to be in a language that the computer can understand. A simple model of the car will be created. There are more possibilities that are more precise, for example, to use a commercial software.

Basically, what is needed it to introduce the equations of the car into the computer and then use them in an appropriate way. The model can be complex or simple. They level of complexity is defined by the number of degree of freedom, (D.O.F.). This model will be a point with all the mass of the car concentrated in the center of mass of the car, without any geometry.

Then the model is increased in complexity, now the car has length, and the lateral forces are now related to the longitudinal forces by the slip angle, the next figure shows that type of model.

(20)

avoidance active system of a car INTRODUCTION

Figure 1.8: Single track model (5DOF). [5]

As it can be seen, this model combines the two front and rear tyres into one. These models described above are implemented in this project, but there are other models with higher precision.

The next model in complexity will include the four wheels.

Figure 1.9: Double track model(8DOF).[6]

In the previous two models, the frame/chassis of the car was rigid, if the spring and dampers are added to the model it will also increase the number of degree of freedom and it will add more differential equations. The model from the figure below, is an example of a double track model with spring and dampers, and including the flexibility of the wheel.

(21)

avoidance active system of a car INTRODUCTION

Figure 1.10: Complex model of a car

Then finally, the highest complexity model will contain information of most of the parts of the vehicle. This in what is called a ”full vehicle system”, this involves all the subsystems in the car, such as suspension linkage, engine, wheel, brakes. In the next figure, there is an example of a ”full vehicle model”.

Figure 1.11: Full vehicle model, showing the integration of all subsystems. [7]

There are some forces that are considered, these are:

ˆ Aerodynamic forces

(22)

avoidance active system of a car INTRODUCTION

ˆ Driving force

ˆ Brake forces

ˆ Rolling resistance

ˆ Lateral forces

The aerodynamic forces are the forces due to the air resistance. This is produced when an object moves through a fluid. The expression for the aerodynamic force is:

Faero= 1

2ρSCxV2 (1.1)

Where ρ is the density of the fluid, in case of cars it will be air. S is the frontal area of the car. Cx is the drag coefficient, and V is the speed of the car.

Depending on the type of car the value of Cx varies. The next table shows some typical values of Cx and frontal area of different cars.:

Vehicle S Cx

BMW series 1 (2004) 2.09 0.31 Opel Astra (2004) 2.11 0.32 Peugeot 807 (2002) 2.85 0.33 Citr¨oen CX (1974) 1.93 0.36

Bus 9 0.49

F1 (monaco) - 1.084

F1 (monza) - 0.7

Table 1.1: Aerodynamic constants for different types of vehicles. [11]

For the vehicle to move there must be something that applies a force to the wheels, for cars, that element is the engine. This force is called the driving force. There most common types of engines are: gas/petrol and diesel, they are based on the Otto cycle and in the Diesel cycle respectively.

The force generated by the engine has to be then transmitted to the wheels. So the torque is transmitted through the gear box, the transmission, differential and finally to the wheels. In this project the driving force is applied directly on the wheels.

The brake forces are the forces that slow the car down. They are applied trough callipers at the brake disk. These disks are connected to the wheel directly. There are different types of brake callipers, but the most common are the hydraulic ones. The next figure shows a braking system of a car:

(23)

avoidance active system of a car INTRODUCTION

Figure 1.12: Brake system of a car. [8]

In this project, the brake force is directly applied on the wheel.

The rolling resistance is the term of force that opposes the movement of the wheel.

If the model used is a constant model then the resistance is directly proportional to the resistance coefficient.

F = µN (1.2)

Where N is the normal load at the wheel and µ is the rolling resistance coefficient.

There are other models that are more precise. The pressure and velocity dependent model is the model that is used. [12]

F = (P P0

)α(N N0

)β(A + BV + CV4); (1.3)

Where P is the tyre pressure, P0 is the atmospheric pressure, N is the normal load, N0 is 1 Newton, V is the velocity of the hub and α, β, A, B, C are approximating coefficients.

Lateral forces appear when the vehicle turns. They are produced by the slip angle.

The slip angle is the angle that forms between the wheel and the actual direction of travel.

There are several ways of defining lateral forces, they are based on the tyre model, e.g. [1]. In this work the tyre formula that is used is the Pacejka formula

ˆ ”Magic formula of Pacejka”

ˆ TreadSim model

ˆ AT model

”The Magic formula of Pacejka”, is the following:

y = Dsin(C arctan((1 − E)Bα + E arctan(Bα))) (1.4) with

Y (X) = y(x) + SV

x = α + SH (1.5)

(24)

avoidance active system of a car INTRODUCTION

Where Y is the output value, lateral force, and α is the slip angle. The remaining variable are coefficient, and their meaning is:

ˆ B - Stiffness factor (-).

ˆ C - Shape factor (-). Controls the ”stretching” in the x direction.

ˆ D - Peak value (N). Is the maximum value.

ˆ E - Curvature factor (-), effects the transition in the curve and the position xm

at which the peak value occurs.

ˆ SH - Horizontal shift ().

ˆ SV - Vertical shift (N).

Most of the variables can be seen in the next figure, also the value of the slope at the origin is BCD. The shape of the function is schematically shown in the next figure.

Figure 1.13: Curve produced by Pacejka Formula.[1]

In the TreadSim model, the tyre is assumed to be fitted on a rigid rim and rolling on a flat road with no disturbances. The contact zone is assumed to have a rectangular shape and positioned symmetrical with respect to the wheel center.

(25)

avoidance active system of a car INTRODUCTION

Figure 1.14: TreadSim model with deflected carcass.[1]

The AT-model is a simplification of f Pacejka formula is:

y = C1arctan(C2α) (1.6)

The tyre model that will be used is the Pacejka formula. The reason for using this model is because is the most common model used nowadays. It also gives sufficient information while testing the model about how the car is behaving.

1.6 Limitations

Under some situations, the driver does not know the best action or sometimes it is impossible for the driver to do anything to the steer and/or brakes in order to avoid the collision with an object. This project will develop optimal manoeuvres acting on the steering and the brake, so that the vehicle does not collide with another object.

The type of safety system being developed in this project is an active safety. To achieve this, the model has to be described.

The model is reduced to a simpler model, there will be two approaches to the task, the first one to model the car as a point, and then to model it as a car with load transfer only like it was shown in figure 1.5.2. For future studies, it is suggested to test it using a model of higher complexity. The inputs to the models will be the force on the tires due to the braking and the force produced when steering for the point model and the angle of steer of the wheel on the load transfer car. This are included in the above simplifications, since the more complex model will allow to introduce the angle at the steering wheel, which is what the driver should do, and act in the brake pedal.

Also at first, the obstacle is static, to simplify the task of optimization. Furthermore, objects that moves in the same direction as the car are introduced and analysed in the same manner. For future investigation, the object will be moving at higher speed.

(26)

avoidance active system of a car MODELLING

Chapter 2

Modelling the vehicle

In this section, the model of the car will be described. As previously described, the models that are used are a point model and the simple track model. The point model was used because it is easy to define, and helps to tune up the genetic algorithm. The algorithm needs to be tuned up since some errors can appear as the method is random.

So the point model is used to test that all the variables in the algorithm do not go out of range. It also helps to observe if the objective function works as it should and if the answer obtained are what was desired. Once it is tuned, the simple track model will be used to get the results. The simple track model includes more variables, so it has to be tested before introducing it in to the genetic algorithm.

2.1 Point model

In the point model, all the mass of the car is concentrated at its center of mass. This model does not represent the reality exceptionally good, since most of the forces are not included. It is a model that works reasonable fast, to tune the genetic algorithm.

2.1.1 Definition

The equations of motion in 2-D for a point in a plane are:

d−→x

dt = −→v (2.1)

d−→v

dt = −→a (2.2)

→a (t) =

→F (t)

M (2.3)

Where −→x , −→v , −→a are the position, velocity and acceleration of the center of mass, M is the mass of the car and F is the applied force. There are two possible direction of motion, so the variables −→x , −→v , −→a , are:

(27)

avoidance active system of a car MODELLING

→x = x y



(2.4)

→v = vx vy



(2.5)

→a =  ax ay



(2.6)

→F = Fx Fy



(2.7) The forces applied to the model can be any of the described in the introduction:

ˆ Aerodynamic forces

ˆ Driving force

ˆ Brake forces

ˆ Rolling resistance

ˆ Lateral forces

To simplify, since the inputs are the braking force and the steering angle, the longitu- dinal forces are related with the braking force, and the lateral forces with the steering angle.

For the longitudinal force, it will be assumed that none of these forces are dependent on the velocity (this statement does not approximate reality, but it is done to simplify).

The general equation is:

XFx = Fdrive− Foppose− Fbrake (2.8)

The driving forces, Fdrive, are the forces that go along the direction of movement, the opposing forces, Foppose, oppose the movement. The braking force, Fbrake, is also an opposing force, because is an input it has been separated.

At the start, since there is an initial velocity, and driving is at constant speed, the sum of these forces will be zero. Then, if the brakes are applied the value of the resultant force decreases, but when the brakes are not applied the driving force is bigger than the opposing force and it will accelerate the car up to the initial velocity.

The lateral forces can be interpreted as a proportional function of the steering angle.

Fy = Aδ(t) (2.9)

(28)

avoidance active system of a car MODELLING

Where A is the constant of proportionality and δ is the steer angle.

This leaves the force acting on the point as following:

→F = Fx Fy



= Fdrive− Foppose(vx) − Fbrake(t) Aδ(t)



(2.10)

2.1.2 Validation

To check that the behaviour of the model is as expected, a validation stage was per- formed.

For the validation, some tests are subjected to the model. These tests are applied in the longitudinal and in the lateral direction independently. The longitudinal direction is the direction of movement of the point, and the lateral direction is the perpendicular direction to the movement.

The longitudinal tests, and expected results are:

ˆ No inputs → No variation in velocity or direction.

ˆ Braking for 5 seconds → the speed should start to decrease once the brake is applied, and the speed will remain constant afterwards.

No inputs The inputs are, no steering and no braking:

Figure 2.1: No inputs validation inputs

The outputs are the trajectory and the speed in the longitudinal and lateral directions.

(29)

avoidance active system of a car MODELLING

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.2: Outputs

With no inputs applied, the velocity and the direction were constant.

Braking for 5 seconds The inputs are no steering and braking for 5 seconds with a value of 1000 N:

Figure 2.3: Inputs: Constant braking for 5 seconds

The outputs are the trajectory and the speeds in the longitudinal and lateral direction.

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.4: Outputs: Constant braking for 5 seconds

(30)

avoidance active system of a car MODELLING

From the longitudinal test, there are no errors observed and the model proceeded as expected.

These are the test for the lateral tests and the expected results.

ˆ Constant steering → Once the steering is applied, the direction of the car must change until the end of the simulation

ˆ Steering for 5 seconds → The direction of the car has to change when the input is applied, and it should remain constant afterwards. Also, the speed must decrease.

ˆ Steering for 5 second to the left and then 5 seconds to the right → The direction of the car has to change each time the steer is altered. The speed should decrease.

ˆ Steering example from the algorithm → Depending on the steering applied.

Constant steering The inputs are steering from t=10s with a steer angle of 10 with no braking.

Figure 2.5: Inputs: Constant steering

The outputs are the trajectory and the speeds in both directions, longitudinal and lateral.

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.6: Outputs: Constant steering

From the figure it can be seen that as the trajectory of the car is circular. As it can be seen, the overall velocity increases as the steering is applied. This is due to the

(31)

avoidance active system of a car MODELLING

fact that when the steering is applied in this model the force is applied in the lateral direction of the car. While in reality a force in the longitudinal direction will also appear. It is complicated to be able to estimate the constants of proportionality to be able to introduce it in the longitudinal direction, but because the increase of speed is small it can be neglected.

Steering for 5 seconds The inputs are, from second 10 till 15, the steer is at 10 with no braking.

Figure 2.7: Inputs: Steering for 5 seconds

The outputs are the trajectory and the speeds in both directions, longitudinal and lateral.

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.8: Outputs: Steering for 5 seconds

The same problem as in the above section. From this, it can be observed that the tra- jectory agrees with the desired results. Once the steering is back to zero, the direction of the car remains constant.

(32)

avoidance active system of a car MODELLING

Steering for 5 seconds in both directions The inputs are steering in both direc- tions to a maximum steer of 10 with no braking.

Figure 2.9: Inputs: Steering for 5 seconds in both directions

The outputs are the trajectory and the speeds in both directions, longitudinal and lateral:

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.10: Outputs: Steering for 5 seconds in both directions

The same problem as above happens. It can be also seen that the vertical velocity, Vy, has a shape similar to the steering vector, which was the behaviour desired.

Steering example from the algorithm The next input is extracted from the al- gorithm randomly to see how the model reacted with this type of steering vector. This is performed because the method has to be robust in order to the algorithm not to fail.

The problem of the increasing speed continues to appear.

(33)

avoidance active system of a car MODELLING

Figure 2.11: Inputs: Steering example from the algorithm

The outputs are the trajectory and the speeds in both directions, longitudinal and lateral:

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.12: Outputs: Steering example from the algorithm

As it has been mentioned, when the steering is applied, the speed increases in a small amount. This model is only created to test the algorithm, and to check if it was solving the problem correctly, so the increase of speed can be assumed because it can be neglected if compared with the overall speed.

(34)

avoidance active system of a car MODELLING

2.2 Simple track model

This is the model that is implemented once the genetic algorithm is tuned. The fol- lowing figure shows the model definition.

Figure 2.13: Single track model (5DOF).[5]

The two rear and two front wheels are joined into one rear and front wheel. This model has the limitations, that it can not handle lateral load transfer and also can not determine if the car does under-steering or over-steering. Excluding these limitations the dynamics of the car it is very similar to the double track model, but it is faster and easier to implement.

ˆ v → Velocity of the center of mass

ˆ vf, vr → Velocity of the front and rear wheel

ˆ δ → Wheel angle

ˆ ψ → Yaw angle

ˆ β → Side slip angle

ˆ Ff y, Fry → Lateral tyre forces

ˆ Ff x,Frx → Longitudinal tyre forces

ˆ a,b → Distance from the center of gravity to the front/rear wheel

ˆ xb,yb → Coordinates respect the center of mass and the direction of the vehicle

ˆ x,y → Coordinate respect to the road

(35)

avoidance active system of a car MODELLING

There are some forces that have not been included in this diagram. These are the aerodynamic forces and the position they act. As it can be noticed, the angle δ is the angle of the wheel. Since the steering system is not modelled, the value of the steer will be transformed into the wheel angle. If in the future this has to be translated into the actual steer the transformation to do so is: δw = isδ. Where is is the transformation factor.

For the development of the model, the procedure is similar to the point model. This is to separate the forces by their direction, longitudinal and lateral.

2.2.1 Longitudinal forces

The notation that it is used to formulate the forces equation is, having for example FAB where A is the type of force (”r” for rolling, ”b” for brake, ”d” for drive, ”l” for lateral and ”z” for normal forces) and B is in the wheel it is acting (”r” for rear and

”f” for front).

Driving forces The car has rear wheel drive, i.e. the force generated by the engine will be only transmitted to the rear wheel. The modelling of the engine and of the gas pedal is not necessary in this project. The value of the driving force will be calculated from the initial conditions as it can be seen later in the text.

Braking forces The braking forces is the force applied in order to reduce the car velocity. This force is normally distributed between the rear and the front tyre.

Fbf = 2

3FB (2.11)

Fbr = 1

3FB (2.12)

So at the end Fbr+ Fbf = FB. Where FB is the total force applied, given by the brake vector.

Rolling resistance As it was said in the introduction, there are some possibilities in this equation. The first one is to use a directly proportional equation, or to use an equation that depends on the velocity and the pressure of the tyre [12].

F = (P P0

)α(N N0

)β(A + BV + CV4); (2.13)

This expression is transformed so it can be used for the rear and front wheel indepen- dently. Since the velocity of the wheels will be similar and in order to simplify, they are treated as if it is the wheels have the same speed.

The equation, 2.13, turns into two equations for the rear and front wheel:

(36)

avoidance active system of a car MODELLING

Frf = fR(V )Fzf (2.14)

Frr = fR(V )Fzb (2.15)

The expression above includes the weight of the car, Fz and the term fR is the term related to the velocity.

fR(V ) = fr0 + fr1( V

100) + fr2( V

100)4 (2.16)

where V is the speed of the car, expressed in km/h. The constants are found in the table 2.2.5.

The load in each set of wheels is calculated by applying equilibrium equation on the vertical plane, of the car:

Fzf = m · a · g

a + b (2.17)

Fzr = m · b · g

a + b (2.18)

If load transfer is important to be added, it will sum to these equations. It will include the longitudinal acceleration and the height of the center of mass, but for the first test it is not included.

Once all the forces are defined, the forces that are acting on each wheel can be defined.

Longitudinal force on the front wheel

Flf = −Fbf− Frf (2.19)

Longitudinal force on the rear wheel

Flr = Fdrive− Fbr− Frr (2.20)

The value of Fdrive is calculated by the next equation.

Fdrive = m · g · fR(V0) + Faero(V0) (2.21) The aerodynamic forces are not included in this part because they act on the center of pressure of the car, not on the front or rear wheel. However, they have to be included in the calculation of the driving force, since they are resistive forces. The equation for the aerodynamic forces is found in equation 2.31

(37)

avoidance active system of a car MODELLING

2.2.2 Lateral forces

The lateral forces are functions of the respective slip angles, as it was seen in the introduction. First, these slip angles are calculated.

Since the car is not able to expand or contract, so the velocity components of the wheels and of the car must be equal.

v cos(β) = vrcos(αr) = vfcos(δ − αf) (2.22) In the lateral direction, the same principle applies, but in this case the variation of the yaw angle must be included.

vfsin(αf) = a ˙ψ + v sin(β) (2.23) vrsin(αr) = b ˙ψ − v sin(β) (2.24) By combining this set of equations we arrive at.

αf = δ − arctan(a ˙ψ + V sin(β)

V cos(β) ) (2.25)

αr = arctan(b ˙ψ − V sin(β)

V cos(β) ) (2.26)

Once the slip angles are defined it is possible to proceed with the calculation of the lateral forces. In this case the formula of Pacejka is used as it gives realistic results of the lateral forces.

The Pacejka formula, is:

y = D sin(C arctan((1 − E)Bx + E arctan(Bx))) (2.27) with

Y (X) = y(x) + SV

x = α + SH (2.28)

In this case the term of SH ( longitudinal shift) and SV (lateral shift) are neglected.

Finally the lateral equations are:

Flf = Df · Fzf· sin(Cfarctan((1 − Ef)Bfαf + Efarctan(Bfαf))) (2.29) Flr = Dr· Fzr· sin(Crarctan((1 − Er)Brαr+ Erarctan(Brαr))) (2.30) The front and rear tyre are equal, so, the constants will have the same value.

(38)

avoidance active system of a car MODELLING

2.2.3 Aerodynamic forces

The aerodynamic are governed by the following equation: [13]

FaeroX = 1

2ρSCxV2 (2.31)

These forces act in the center of pressure of the car frame. This point is normally in between the center of gravity and the front wheels. The lateral aerodynamic force is neglected.

2.2.4 Equation of motions for the simple track model

Once all the forces have been defined, they can be introduced into the equation of motion that were showed before in equation 2.1.1. However, it will lead to a problem since that equation does not take the centripetal force into consideration. The Newton- Euler dynamic equations are used:

Fx = m ˙Vx− ˙ψ · Vy (2.32)

Fy = m ˙Vy+ ˙ψ · Vx (2.33)

Mz = ¨ψ · Izz (2.34)

Where m is the mass of the car, ˙Vx, ˙Vy is the acceleration in the x and y direction respectively, Vx, Vy are the velocities in the x and y direction respectively, ¨ψ is the angular acceleration and Izz is the moment of inertia of the car.

Substituting here the equations for the forces in x, y and the moment, it is obtained the followings equations.

¨

x − ˙ψ ¨y =1

m[(Flr+ FaeroX + Flfcos(δ) − Fsfsin(δ)) cos(ψ) −

− (Fsr− FaeroY + Flfsin(δ) + Fsfcos(δ) sin(ψ)]

(2.35)

¨

y + ˙ψ ¨x =1

m[(Flr+ FaeroX + Flfcos(δ) − Fsfsin(δ)) sin(ψ) + + (Fsr− FaeroY + Flfsin(δ) + Fsfcos(δ) cos(ψ)]

(2.36)

ψ =¨ 1

Izz [Fsf · a · cos(δ) − Fsrb − FaeroyEP C+ Flf · a · sin(δ)] (2.37) The side slip angle is :

β = arctan(y˙

˙x) (2.38)

and the absolute velocity is :

v =p

˙x2+ ˙y2 (2.39)

(39)

avoidance active system of a car MODELLING

2.2.5 Parameters used for the simple track model

This data was obtained from the paper [14] and it can be found on the appendix B of the paper. The parameters of the car are from an Audi TT.

The geometry of the car is:

m 1648kg Mass of the car

g 9.8[m/s2] Acceleration of gravity Izz 2452[kgm2] Yaw moment of inertia Lc 2.46[m] Wheel base of the car

a 1.04[m] Distance from the center of gravity to the front wheel b 1.42[m] Distance from the center of gravity to the rear wheel h 0.75[m] Height of the center of mass

EP C 0.75[m] Distance from the center of gravity to the center of pressure w 1.55[m] Track wheel

Rw 0.33[m] Effective wheel radius

Table 2.1: Geometry data of the car

The aerodynamic constants for an Audi TT and the data is obtained from the data sheet of the car.:

Cw 0.3 Air drag coefficient ρ 1.24[Kg/m3] Air density

A 2.09[m2] Effective frontal area Cy 0.3 Lateral air drag coefficient

Table 2.2: Aerodynamic constants of the car The values from the Pacejka tyre model are:

Surface B C D E

Dry tarmac 10 1.9 1 0.97 Wet tarmac 12 1.3 0.82 1

Snow 5 2 0.3 1

Ice 4 2 0.1 1

Table 2.3: Pacejka formula coefficients

The values that are used for the simulation are for dry tarmac. These values were obtained from the MatLab toolbox of Pacejka.

The values for the rolling resistance are taken from the book [12], and these coeffi- cient depends on the tyre, but they are an approximation of a typical raided passenger car tire.

(40)

avoidance active system of a car MODELLING

fr0 9.91 · 10−3 fr1 1.95 · 10−5 fr4 1.76 · 10−9

Table 2.4: Rolling resistance coefficients for a passenger car

(41)

avoidance active system of a car MODELLING

2.2.6 Validation

As for the point model this has to be validated before using it in the algorithm. To do so, the same tests were done to this model.

The trajectory graphs now include the geometry of the car. The position of the car is plotted every 5 seconds and the geometry is included.

No inputs The inputs are zero steering and brake:

Figure 2.14: Inputs: No inputs The outputs were as expected.

Braking for 5 seconds The inputs are zero steering and braking with 1000 N for 5 second:

Figure 2.15: Inputs: Constant braking for 5 seconds

(42)

avoidance active system of a car MODELLING

The outputs were as expected.

Now on the validation will have more outputs that are good to comment as the behaviour of the car can be better understood. This outputs are the slip angles of the car and of the wheels. The lateral forces are also plotted to see when the wheel is sliding.

For this model, the steering can not have a large slope, since it has problems when integrating a step function.

Constant steering The inputs for steering with 15 angle and no braking is:

Figure 2.16: Inputs: Constant steering

The outputs are the trajectory and the speed, velocity in the longitudinal and lateral directions, and angle of the car.

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.17: Outputs: Constant steering

From the trajectory figure it can be observed that the direction stabilizes after a while, the reason for this can be seen in the vertical velocity graph. In the graph, the velocity

(43)

avoidance active system of a car MODELLING

increases and then after a peak it decreases until it stabilizes. This is because the car starts to slip as it can be seen in the next figures.

(a) Slip angle of the car (b) Lateral slip angle of each wheel

(c) Lateral forces at each wheel

Figure 2.18: Slip angles outputs: Constant steering

When the front slip angle has a high value, also the rear wheel slips. This contributes to the car in the way that once it starts to slip is not able of continue turning.

Constant steering and return to origin The inputs are for the steering to steer up to 15 and then return to zero, with no braking:

(44)

avoidance active system of a car MODELLING

Figure 2.19: Inputs: Constant steering and return to origin

The outputs are the trajectory and the speed, velocity in the longitudinal and lateral directions and angle of the car:

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.20: Outputs: Constant steering and return to origin

The trajectory in this case does not behaves exactly as desired. Once the steer is zero, the car keeps the direction. It tries to return because, as it can be seen in the figure below, the lateral forces are non zero.

(45)

avoidance active system of a car MODELLING

(a) Slip angle of the car (b) Lateral slip angle of each wheel

(c) Lateral forces at each wheel

Figure 2.21: Slip angles outputs: Constant steering and return to origin

The lateral forces once the steer value is zero approach zero. This behaviour is what pushes the car to the left, that is in the direction it had at the start of the simulation.

From the trajectory, figure 2.20(a), it appears that the car turns to the left after the steer is zero. It can be seen in the figure for the angle of the car, figure 2.21(a), that the angle of the car is bigger. This effect is due to the slip angles, the car is slipping so the response is not exactly as expected.

Steering to both sides The inputs are for the steering to steer firs to 15, then to

−15 and returning to zero, with no braking.

(46)

avoidance active system of a car MODELLING

Figure 2.22: Inputs: Steering to both sides

The outputs are the trajectory and the speed, velocity in the longitudinal and lateral directions, and angle of the car.

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.23: Outputs: Steering to both sides

The angle of the car has the same shape a the steer inputs. This is what it is desired for this situation. Also, it can be seen that the car has some slipping because the vertical velocity starts to decrease once it has reached the maximum.

(47)

avoidance active system of a car MODELLING

(a) Slip angle of the car (b) Lateral slip angle of each wheel

(c) Lateral forces at each wheel

Figure 2.24: Slip angles outputs: Steering to both sides As it was mentioned above some slipping occurs in this simulation.

Steering from the algorithm The inputs are taken from a sample of the genetic algorithm.

(48)

avoidance active system of a car MODELLING

Figure 2.25: Inputs: Algorithm example

The outputs are the trajectory and the speed, velocity in the longitudinal and lateral directions, and angle of the car:

(a) Trajectory of the vehicle (b) Velocities of the model

Figure 2.26: Outputs: Algorithm example

The trajectory and the angle of the car have a shape similar to the steer.

(49)

avoidance active system of a car MODELLING

(a) Slip angle of the car (b) Lateral slip angle of each wheel

(c) Lateral forces at each wheel

Figure 2.27: Slip angles outputs: Algorithm example

As in the point model a randomly selected member from the genetic algorithm was taken to test how robust the model is. In this situation, the steering is not constant at any time, apart from the initial and final time, due to this the lateral forces do not reach the limit. Therefore, the slip angles are small in comparison with the previous cases.

After this validation, it can be concluded that the simple track model behaves as it should be. So it can be implemented in the algorithm without major problems. The only thing that could be problematic while implementing this model is that it slides when the angle is large. In the results this will be taken into consideration.

(50)

avoidance active system of a car ALGORITHM

Chapter 3

Genetic Algorithm

Adapting Darwin principle to the present problem, it is needed to have a population made of members, that have a random behaviour in the media. They drive in a random way in a track in order avoid the collision.

A member is made of parameters that are able to vary in order to improve the solution. Translating this concept to this optimization problem, a member is made of a number of variables that are the parameters of the inputs to the model. These parameters will be explained later in detail.

The shape of a member will be as the next figure shows.

steeringtime

z }| {

a · · · b

steeringpoints

z }| {

c · · · d

braketime

z }| {

e · · · f

brakepoints

z }| {

g · · · h

M emberinf o

z }| {

f lag value

 (3.1)

To make the member as robust as possible, all the parameters are normalised. This also simplifies the task of finding if any of the parameters have gone out of range. To do so, all the parameters are normalised so their value is between [0,1] with a precision of three decimals.

This type of configuration simplifies the calculus when mixing the parameters, in the reproduction and mutation, since the physical unit do not need to be considered.

Once the elements in a new member have been checked after reproduction or muta- tion, these parameters have to go back to their physical magnitude. The optimization is done as follows:

There are two types of parameters, one is dependent on the time and the other is dependent on the magnitude. The magnitude is angle and force in this project. When the parameter has the units of time, to normalise it,the following is done.

T1dimless = T1/Tstandard (3.2)

The points are dimensionless, and it is only when creating the brake/steering vector them they gain their value by multiplying the whole vector by the maximum braking/s- teering value.

The structure of the algorithm used is shown in figure 3.1.

(51)

avoidance active system of a car ALGORITHM

Figure 3.1: Genetic algorithm flow chart

(52)

avoidance active system of a car ALGORITHM

The boxes defined in this flow chart are defined in the next sections. They can be differentiated in two blocks. The genetic operators and the algorithm blocks. The model described in the previous section is used in the simulation block where the inputs are introduced in to the model obtaining the desired trajectory and velocity.

With the outputs obtained from the simulations the algorithm is able of comparing which solution is better, this is achieved by the use of the objective function.

3.1 Genetic operators used

There are three types of genetic operator used:

ˆ Genetic operator of selection

ˆ Genetic operator of reproduction

ˆ Genetic operator of mutation

By using these three operators, a code can be generated in order to improve the pop- ulation.

3.1.1 Genetic operator of selection

In reality, the member of a population, has to select who is going to be their partner for the reproduction. This is done by ”likes” of the member because the partner is the strongest, healthiest and/or prettiest. In a GA, the member also has to choose the reproduction partner, this is the reason the genetic operator of selection is needed.

There are various techniques to do so, but finally the technique that is used in this project is the differential evolution.

ˆ Proportional selection: roulette

ˆ Tournament Selection

ˆ Fitness Selection

ˆ Differential evolution

Proportional selection: Roulette Gives a member a probabilistic value depending on the value of the objective function, with this value a pie chart can be made, and by choosing a random number, the selection is done.

Figure 3.2: Example of roulette for the selection

References

Related documents

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

På många små orter i gles- och landsbygder, där varken några nya apotek eller försälj- ningsställen för receptfria läkemedel har tillkommit, är nätet av

Det har inte varit möjligt att skapa en tydlig överblick över hur FoI-verksamheten på Energimyndigheten bidrar till målet, det vill säga hur målen påverkar resursprioriteringar

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa