Top Banner
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
93

Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Oct 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for longcollision avoidance active system

of a car

Bachelor Degree Project in Mechanical EngineeringC-Level 22.5 ECTSSpring term 2013

Author: Ricardo Gonzalez-Carrascosa Partida

Supervisor: Daniel SvenssonExaminer: Thomas Carlberger

Page 2: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object
Page 3: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 sincethe accidents are of such nature that can be avoided if the system works as desirablee.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 acar. An algorithm is developed to optimize a fuzzy logic controller which actuates onthe steer and brakes of the car. The algorithm optimizes the inputs of the car, i.e. steerand brake, to avoid the collision with the object. The optimization of the trajectoryimplies that the car returns to the original lane and it is the minimum time possible inthe other lane. The object is situated at different distances and the initial speed of thecar also varies depending on the situations. The results are obtained by using a fivedegree 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 avoidancemanoeuvres in different conditions. Furthermore, improvements of the presents workare suggested that are believed to further enhance the presented algorithm.

I

Page 4: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

This project has been submitted by Ricardo Gonzalez-Carrascosa Partida for theBachelor Degree in Mechanical Engineering to the University of Skovde, in the Schoolof Technology and Society.

Date of submission: Friday 10th May, 2013

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

Ricardo Gonzalez-Carrascosa Partida

Page 5: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

Acknowledgements

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

� To my supervisor Daniel Svensson by helping me with this diploma work, evenhe 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 todolo que ha estado en sus manos, sin tener conocimiento previo del proyecto queestaba realizando.

� A todos los companeros de residencia (Xenia) por darme apoyo durante la real-izacion de este proyecto y por hacer de este ano un ano inolvidable.

III

Page 6: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONTENTS

Contents

Abstract I

Acknowledgements III

List of figures VI

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.5 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.5.1 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.5.2 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.6 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

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

2.1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.1.2 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2 Simple track model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.2.1 Longitudinal forces . . . . . . . . . . . . . . . . . . . . . . . . . 252.2.2 Lateral forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.2.3 Aerodynamic forces . . . . . . . . . . . . . . . . . . . . . . . . . 282.2.4 Equation of motions for the simple track model . . . . . . . . . 282.2.5 Parameters used for the simple track model . . . . . . . . . . . 292.2.6 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3 Genetic Algorithm 403.1 Genetic operators used . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3.1.1 Genetic operator of selection . . . . . . . . . . . . . . . . . . . . 423.1.2 Genetic operator of reproduction . . . . . . . . . . . . . . . . . 433.1.3 Genetic operator of mutation . . . . . . . . . . . . . . . . . . . 45

3.2 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.3 Other functions used . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

IV

Page 7: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONTENTS

3.4 Tuning the algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

4 Results 574.1 Point model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574.2 Simple track model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

4.2.1 Static object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604.2.2 Moving object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

5 Conclusions 695.1 Conclusions of the project . . . . . . . . . . . . . . . . . . . . . . . . . 695.2 Analysis of the results . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

5.2.1 Point model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705.2.2 Simple track model . . . . . . . . . . . . . . . . . . . . . . . . . 71

5.3 Improvements to do in the project . . . . . . . . . . . . . . . . . . . . . 76

6 Future work 79

References 80

A Brainstorming 82A.1 Objective Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

B Moving object 83

V

Page 8: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car LIST OF FIGURES

List of Figures

1.1 Typical stopping distances [2] . . . . . . . . . . . . . . . . . . . . . . . 21.2 Classification of the safety systems. [3] . . . . . . . . . . . . . . . . . . 21.3 Possibilities of the types of sensors in a car. [3] . . . . . . . . . . . . . . 31.4 Fuzzy logic controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.5 Fuzzy logic controller control surface. [4] . . . . . . . . . . . . . . . . . 61.6 Description of the algorithm . . . . . . . . . . . . . . . . . . . . . . . . 71.7 Example inputs: Steer and brake vector . . . . . . . . . . . . . . . . . 81.8 Single track model (5DOF). [5] . . . . . . . . . . . . . . . . . . . . . . 101.9 Double track model(8DOF).[6] . . . . . . . . . . . . . . . . . . . . . . . 101.10 Complex model of a car . . . . . . . . . . . . . . . . . . . . . . . . . . 111.11 Full vehicle model, showing the integration of all subsystems. [7] . . . . 111.12 Brake system of a car. [8] . . . . . . . . . . . . . . . . . . . . . . . . . 131.13 Curve produced by Pacejka Formula.[1] . . . . . . . . . . . . . . . . . . 141.14 TreadSim model with deflected carcass.[1] . . . . . . . . . . . . . . . . 15

2.1 No inputs validation inputs . . . . . . . . . . . . . . . . . . . . . . . . 182.2 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.3 Inputs: Constant braking for 5 seconds . . . . . . . . . . . . . . . . . . 192.4 Outputs: Constant braking for 5 seconds . . . . . . . . . . . . . . . . . 192.5 Inputs: Constant steering . . . . . . . . . . . . . . . . . . . . . . . . . 202.6 Outputs: Constant steering . . . . . . . . . . . . . . . . . . . . . . . . 202.7 Inputs: Steering for 5 seconds . . . . . . . . . . . . . . . . . . . . . . . 212.8 Outputs: Steering for 5 seconds . . . . . . . . . . . . . . . . . . . . . . 212.9 Inputs: Steering for 5 seconds in both directions . . . . . . . . . . . . . 222.10 Outputs: Steering for 5 seconds in both directions . . . . . . . . . . . . 222.11 Inputs: Steering example from the algorithm . . . . . . . . . . . . . . . 232.12 Outputs: Steering example from the algorithm . . . . . . . . . . . . . . 232.13 Single track model (5DOF).[5] . . . . . . . . . . . . . . . . . . . . . . . 242.14 Inputs: No inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.15 Inputs: Constant braking for 5 seconds . . . . . . . . . . . . . . . . . . 312.16 Inputs: Constant steering . . . . . . . . . . . . . . . . . . . . . . . . . 322.17 Outputs: Constant steering . . . . . . . . . . . . . . . . . . . . . . . . 322.18 Slip angles outputs: Constant steering . . . . . . . . . . . . . . . . . . 332.19 Inputs: Constant steering and return to origin . . . . . . . . . . . . . . 342.20 Outputs: Constant steering and return to origin . . . . . . . . . . . . . 34

VI

Page 9: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car LIST OF FIGURES

2.21 Slip angles outputs: Constant steering and return to origin . . . . . . . 352.22 Inputs: Steering to both sides . . . . . . . . . . . . . . . . . . . . . . . 362.23 Outputs: Steering to both sides . . . . . . . . . . . . . . . . . . . . . . 362.24 Slip angles outputs: Steering to both sides . . . . . . . . . . . . . . . . 372.25 Inputs: Algorithm example . . . . . . . . . . . . . . . . . . . . . . . . . 382.26 Outputs: Algorithm example . . . . . . . . . . . . . . . . . . . . . . . . 382.27 Slip angles outputs: Algorithm example . . . . . . . . . . . . . . . . . . 39

3.1 Genetic algorithm flow chart . . . . . . . . . . . . . . . . . . . . . . . . 413.2 Example of roulette for the selection . . . . . . . . . . . . . . . . . . . 423.3 Single point crossover . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.4 Double point crossover . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.5 Uniform crossover with mask . . . . . . . . . . . . . . . . . . . . . . . . 453.6 Mutation of a gene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.7 Plausible road situation . . . . . . . . . . . . . . . . . . . . . . . . . . 463.8 Objective function flow chart . . . . . . . . . . . . . . . . . . . . . . . 473.9 Objective function: Lateral acceleration . . . . . . . . . . . . . . . . . 493.10 Objective function: Time in the other lane . . . . . . . . . . . . . . . . 493.11 Objective function: End position . . . . . . . . . . . . . . . . . . . . . 503.12 Function: Generate population . . . . . . . . . . . . . . . . . . . . . . 513.13 Function: Generate a member . . . . . . . . . . . . . . . . . . . . . . . 513.14 Steer vector explained . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.15 Brake vector explained . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.16 Trajectory example of a non returning member . . . . . . . . . . . . . . 55

4.1 Simulation 1: Trajectory example of a non returning member . . . . . . 574.2 Simulation 1: Outputs for a non returning member . . . . . . . . . . . 584.3 Simulation 2: Trajectory of a flag = 2 member . . . . . . . . . . . . . 584.4 Simulation 2: Outputs of a flag = 2 member . . . . . . . . . . . . . . . 594.5 Simulation 3: Trajectory flag = 1 member . . . . . . . . . . . . . . . . 594.6 Simulation 3: Outputs of a flag = 1 member . . . . . . . . . . . . . . 604.7 Simulation 1: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 614.8 Simulation 1: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.9 Simulation 2: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 624.10 Simulation 2: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.11 Simulation 3: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 634.12 Simulation 3: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.13 Simulation 1: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 644.14 Simulation 1: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.15 Simulation 2: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 654.16 Simulation 2: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.17 Simulation 1: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 664.18 Simulation 1: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.19 Simulation 2: Trajectory of the car . . . . . . . . . . . . . . . . . . . . 674.20 Simulation 2: Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

VII

Page 10: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car LIST OF FIGURES

4.21 Trajectory of the car with moving object . . . . . . . . . . . . . . . . . 684.22 Outputs obtained from the moving obstacle situation . . . . . . . . . . 68

5.1 Example trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705.2 Trajectory for the point model . . . . . . . . . . . . . . . . . . . . . . . 715.3 Trajectory of the car . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725.4 Examples where the time is the cause of failure of the algorithm . . . . 725.5 Example of not sine function trajectory . . . . . . . . . . . . . . . . . . 735.6 Pattern observed for obstacle avoidance . . . . . . . . . . . . . . . . . . 735.7 Peaks in the velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745.8 Inputs for the two simulation . . . . . . . . . . . . . . . . . . . . . . . 745.9 Convergence plot of different simulations . . . . . . . . . . . . . . . . . 755.10 Car with moving object . . . . . . . . . . . . . . . . . . . . . . . . . . 765.11 Differences between the lateral acceleration and the slip angle . . . . . 775.12 Proposed penalisation method . . . . . . . . . . . . . . . . . . . . . . . 78

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

VIII

Page 11: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 automotiveindustry. Over the years, the security systems have undergone a major evolution, inpart, thanks to technological advances in this area. In recent years, advances in securitysystems have been more important because of the high competition among companiesto 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 ofexamples in where humans are the cause of car accidents. For examples because ofdistractions, speeding, fatigue, drunk or under the influence of drugs when driving,unsafe lane changes and improper turns. The second group involve the quality of theroad, 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 possiblemechanicals 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 situationsthe environment is the cause of the crash, e.g animal crossing. So when they see thedanger they do not know how to behave in order to avoid the collision. If the driverjust 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 carsstopping distances increase as the speed increases, the higher the speed is the fasterthe response from the active system has to be. The next figure shows typical valuesfor stopping distances.

1

Page 12: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 controlsystem is be able to brake in less time than the human and, therefore, stop the carbefore the collision. For example, looking at the values for 30 mph if the driver seesthe object when it is at 20 m away from the car. The driver will not be able to avoidthe collision, but an active system could achieve it, since the thinking distance is muchlower than the human. If the object appears in the braking distance, then even ifthe car brakes, it would not be able to stop before the collision, for example: Takingthe same value of speed. If the driver and/or the sensors detect an object 12 m awayfrom the car. They could reduce the speed but never avoid the collision. To avoid thecollision, 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 inthe last 20 years. Some of these systems are nowadays obligatory, or most of thevehicles have them, such as ABS. In the future, it is likely to have other safety systemsobligatory in cars.

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

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

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

2

Page 13: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car INTRODUCTION

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

To be able to detect the obstacle in front, the car needs to be equipped with manysensors. 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. Dueto the possible velocity of the car when approaching an object. A long range sensoris needed. From the figure, it can be seen that one possible sensor is the long-rangeradar.

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

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

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

There has been some investigation about the same task, [9], Longitudinal CollisionAvoidance. 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 theydo. They have control of the torque of each wheel independently. In this project the

3

Page 14: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car INTRODUCTION

torque control is done to all the wheels at the same time, without the aid of a controlsystem, 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 itaffects their own safety. Therefore, this diploma work is intended to prevent collisionsand thereby, reduce the number of accidents.

1.2 Problem

There are many deaths due to car accidents in the world nowadays. The reason for theseaccidents is manly due to misbehaving of the drivers and environmental problems, suchas animal crossing. The safety systems nowadays are focused in reducing the damageto the passengers once the crash has taken place. The active systems that are startingto be introduced are focused on just braking to stop the car or reduce the speed beforethe collision and therefore reduce the damage. This sometime is not enough because insome situations, the collision can be avoided by steering away. Designing this type ofsafety system will help to reduce the number of accidents and, therefore, the numberof death. The task is to optimize the trajectories by obtaining optimal manoeuvres toprevent 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 thatbehaves in the best possible manner as a car. To compare the behaviour sometest 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 someiterations.

� Design the parameters that will determine how good the solution is. Since thereare many outputs from the model, some parameters will be picked and interpretedto determine how good is the solution.

� Obtain different optimal trajectories for different situations. Showing the inputsand outputs. To show the consistency of the algorithm various results of the samesituation will be analysed and compared to see the convergence of the method.

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

4

Page 15: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 thenimplemented in passenger/autonomous car to avoid accidents.

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

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

The purpose is to avoid accidents, with the benefits that it has, less people areharmed, or their lives could be saved. If the collision is avoided, less parts will needto 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 thebest possible manner. The control to be used is named Fuzzy control. These types ofcontrollers work using diffuse logic. The reasons for using this type of control systemis 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 byexperience of simulations of by driving, that is some situations some manoeuvresare not recommended.

� When some part of the system are unknown, depending on the model used someparts of the system are not considered, so when it applies to the real car it willnot 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:

5

Page 16: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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, obtainedfrom the sensors. These real inputs variables have to be transformed into variables thatthe controller can understand, this is done by a fuzzyficator block, using the appropriatetransformation, that must be defined by the designer of the controller. The outputsare obtained by the interference mechanism block, which is explained below. The rulesthat the fuzzy controller uses are logical operators such as AND, OR and NOT. Thenin the de-fuzzyficator block, the answers obtained from the controller are transformedto a signal to the actuators, brake and steer (outputs).

The interference mechanism simply gives an output depending on the inputs, thenext 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 oneoutput (In figure Type). The inputs come from the fuzzification block, and the outputwill leave to the de-fuzzyfication block and then to the sensors. How this surface iscreated is not part of this project, and therefore not explained. The fuzzy controlleris mentioned so the reader can see how this diploma work is solving the task. Thisproject will be the ”knowledge” for the fuzzy logic controller, helping to develop thesurface for the control.

6

Page 17: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 avoidthe collision.

The method can then be divided in two sections, one section is for the optimizationalgorithm and the other for the model of the vehicle. The next figure shows how theseare 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 objectivefunction. 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 simulatesthe behaviour of a car. Once the trajectory, obtained from the model, satisfies theobjective function, inputs and outputs are obtained and saved to generate the surfaceof 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 alsothey are multi-task solving. The heuristic searching algorithm has the advantage thatif there is an optimal trajectory it is guaranteed that it can be found. The geneticalgorithm and neural network algorithms have the disadvantages that the convergencecan take more time than desired, and also there is no guarantee that convergence tothe optimum results is achieved.

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

7

Page 18: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car INTRODUCTION

The inputs, brake and steering, are introduced to the model as a vector. This vectorhas the steer angle or the brake force, depending on what vector, for each interval oftime. 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 bestsolution out of a group of plausible solutions. The mechanisms that make the GA ableto optimize are like a metaphor of the biological evolution.

The GA are adaptive methods that can be used to solve matters of finding andoptimization. They are based on the genetic progress of the living organism. Duringgenerations, the population has evolved in the nature accordingly with the principle ofnatural 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 arebetter for the ”real world”. In nature, the members compete between each other tofind resources, like food, water and shelter. They do that even between the membersof a family.

Those members that are more successful in surviving have more probabilities ofgenerating a greater number of descendent. The members less able would generate lessdescendent. This means that the genetic of the most successful member will continuefor 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.

8

Page 19: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car INTRODUCTION

� In a linear task, the aptitude of each component is independent, so each smallimprovement 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 wheremultiple changes which, individually are damaging, in combination with otherscan drive to a better individual. Non-linear problems make the searching spaceincreases exponentially, and that is where the genetic algorithms are capable ofreducing the time to find an optimum result against investigation methods thatsearch trough the whole domain.

The genetic algorithms have the disadvantages:

� The representation of the task has to be done in a language that allows robustsolutions. This means that they are able to tolerate random changes in order todo 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 donewrongly, then the algorithm might not be able to find a valid solution or it willbe solving a different problem.

� A well known problem about the genetic algorithms is premature convergence. Ifan individual is better than the rest of his competitors then, it can reproduce sospread out making the algorithm converge to itself. Instead of searching throughthe 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 tobe in a language that the computer can understand. A simple model of the car willbe created. There are more possibilities that are more precise, for example, to use acommercial software.

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

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

9

Page 20: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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. Thesemodels described above are implemented in this project, but there are other modelswith 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 anddampers are added to the model it will also increase the number of degree of freedomand it will add more differential equations. The model from the figure below, is anexample of a double track model with spring and dampers, and including the flexibilityof the wheel.

10

Page 21: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 theparts of the vehicle. This in what is called a ”full vehicle system”, this involves all thesubsystems in the car, such as suspension linkage, engine, wheel, brakes. In the nextfigure, 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

11

Page 22: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 whenan object moves through a fluid. The expression for the aerodynamic force is:

Faero =1

2ρSCxV

2 (1.1)

Where ρ is the density of the fluid, in case of cars it will be air. S is the frontal areaof 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 sometypical values of Cx and frontal area of different cars.:

Vehicle S Cx

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

Bus 9 0.49F1 (monaco) - 1.084F1 (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 mostcommon types of engines are: gas/petrol and diesel, they are based on the Otto cycleand in the Diesel cycle respectively.

The force generated by the engine has to be then transmitted to the wheels. So thetorque is transmitted through the gear box, the transmission, differential and finallyto 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 troughcallipers at the brake disk. These disks are connected to the wheel directly. There aredifferent types of brake callipers, but the most common are the hydraulic ones. Thenext figure shows a braking system of a car:

12

Page 23: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 tothe 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 + CV 4); (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 approximatingcoefficients.

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 oftravel.

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)

withY (X) = y(x) + SV

x = α + SH(1.5)

13

Page 24: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car INTRODUCTION

Where Y is the output value, lateral force, and α is the slip angle. The remainingvariable 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 xmat 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 theorigin 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 ona flat road with no disturbances. The contact zone is assumed to have a rectangularshape and positioned symmetrical with respect to the wheel center.

14

Page 25: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 = C1 arctan(C2α) (1.6)

The tyre model that will be used is the Pacejka formula. The reason for using thismodel is because is the most common model used nowadays. It also gives sufficientinformation 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 isimpossible for the driver to do anything to the steer and/or brakes in order to avoidthe collision with an object. This project will develop optimal manoeuvres acting onthe 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 achievethis, 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 loadtransfer only like it was shown in figure 1.5.2. For future studies, it is suggested to testit using a model of higher complexity. The inputs to the models will be the force onthe tires due to the braking and the force produced when steering for the point modeland the angle of steer of the wheel on the load transfer car. This are included in theabove simplifications, since the more complex model will allow to introduce the angleat 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 thesame manner. For future investigation, the object will be moving at higher speed.

15

Page 26: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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, themodels that are used are a point model and the simple track model. The point modelwas used because it is easy to define, and helps to tune up the genetic algorithm. Thealgorithm 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 outof range. It also helps to observe if the objective function works as it should and if theanswer obtained are what was desired. Once it is tuned, the simple track model willbe used to get the results. The simple track model includes more variables, so it hasto 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. Thismodel does not represent the reality exceptionally good, since most of the forces arenot 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−→xdt

= −→v (2.1)

d−→vdt

= −→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, Mis the mass of the car and F is the applied force. There are two possible direction ofmotion, so the variables −→x , −→v , −→a , are:

16

Page 27: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

−→x =

(xy

)(2.4)

−→v =

(vxvy

)(2.5)

−→a =

(axay

)(2.6)

−→F =

(FxFy

)(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 steeringangle.

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

∑Fx = Fdrive − Foppose − Fbrake (2.8)

The driving forces, Fdrive, are the forces that go along the direction of movement, theopposing forces, Foppose, oppose the movement. The braking force, Fbrake, is also anopposing 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 theresultant force decreases, but when the brakes are not applied the driving force is biggerthan 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)

17

Page 28: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 =

(FxFy

)=

(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 inthe longitudinal and in the lateral direction independently. The longitudinal directionis the direction of movement of the point, and the lateral direction is the perpendiculardirection 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 isapplied, 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.

18

Page 29: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 witha 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

19

Page 30: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

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

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

� Constant steering → Once the steering is applied, the direction of the car mustchange until the end of the simulation

� Steering for 5 seconds→ The direction of the car has to change when the input isapplied, 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 directionof 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 andlateral.

(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 canbe seen, the overall velocity increases as the steering is applied. This is due to the

20

Page 31: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

fact that when the steering is applied in this model the force is applied in the lateraldirection of the car. While in reality a force in the longitudinal direction will alsoappear. It is complicated to be able to estimate the constants of proportionality to beable to introduce it in the longitudinal direction, but because the increase of speed issmall 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 andlateral.

(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 directionof the car remains constant.

21

Page 32: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 andlateral:

(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. Thisis 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.

22

Page 33: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 andlateral:

(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 asmall amount. This model is only created to test the algorithm, and to check if it wassolving the problem correctly, so the increase of speed can be assumed because it canbe neglected if compared with the overall speed.

23

Page 34: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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. Thismodel has the limitations, that it can not handle lateral load transfer and also can notdetermine if the car does under-steering or over-steering. Excluding these limitationsthe dynamics of the car it is very similar to the double track model, but it is fasterand 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

� Ffy, Fry → Lateral tyre forces

� Ffx,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

24

Page 35: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

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

For the development of the model, the procedure is similar to the point model. Thisis 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 exampleFAB where A is the type of force (”r” for rolling, ”b” for brake, ”d” for drive, ”l” forlateral 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 enginewill be only transmitted to the rear wheel. The modelling of the engine and of the gaspedal is not necessary in this project. The value of the driving force will be calculatedfrom 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 carvelocity. 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 brakevector.

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

F = (P

P0

)α(N

N0

)β(A+BV + CV 4); (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, theyare 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:

25

Page 36: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 termrelated 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 thetable 2.2.5.

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

Fzf =m · a · ga+ b

(2.17)

Fzr =m · b · ga+ b

(2.18)

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

Once all the forces are defined, the forces that are acting on each wheel can bedefined.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 ofpressure of the car, not on the front or rear wheel. However, they have to be includedin the calculation of the driving force, since they are resistive forces. The equation forthe aerodynamic forces is found in equation 2.31

26

Page 37: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 theintroduction. First, these slip angles are calculated.

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

v cos(β) = vr cos(αr) = vf cos(δ − αf ) (2.22)

In the lateral direction, the same principle applies, but in this case the variation of theyaw angle must be included.

vf sin(αf ) = aψ + v sin(β) (2.23)

vr sin(α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 thelateral forces. In this case the formula of Pacejka is used as it gives realistic results ofthe lateral forces.

The Pacejka formula, is:

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

withY (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(Cf arctan((1− Ef )Bfαf + Ef arctan(Bfαf ))) (2.29)

Flr = Dr · Fzr · sin(Cr arctan((1− Er)Brαr + Er arctan(Brαr))) (2.30)

The front and rear tyre are equal, so, the constants will have the same value.

27

Page 38: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

2.2.3 Aerodynamic forces

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

FaeroX =1

2ρSCxV

2 (2.31)

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

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 ofmotion that were showed before in equation 2.1.1. However, it will lead to a problemsince that equation does not take the centripetal force into consideration. The Newton-Euler dynamic equations are used:

Fx = mVx − ψ · Vy (2.32)

Fy = mVy + ψ · 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 directionrespectively, Vx, Vy are the velocities in the x and y direction respectively, ψ is theangular 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 obtainedthe followings equations.

x− ψy =1

m[(Flr + FaeroX + Flf cos(δ)− Fsf sin(δ)) cos(ψ) −

− (Fsr − FaeroY + Flf sin(δ) + Fsf cos(δ) sin(ψ)](2.35)

y + ψx =1

m[(Flr + FaeroX + Flf cos(δ)− Fsf sin(δ)) sin(ψ) +

+ (Fsr − FaeroY + Flf sin(δ) + Fsf cos(δ) cos(ψ)](2.36)

ψ =1

Izz[Fsf · a · cos(δ)− Fsrb− FaeroyEPC + Flf · a · sin(δ)] (2.37)

The side slip angle is :

β = arctan(y

x) (2.38)

and the absolute velocity is :

v =√x2 + y2 (2.39)

28

Page 39: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 ofthe paper. The parameters of the car are from an Audi TT.

The geometry of the car is:

m 1648kg Mass of the carg 9.8[m/s2] Acceleration of gravityIzz 2452[kgm2] Yaw moment of inertiaLc 2.46[m] Wheel base of the cara 1.04[m] Distance from the center of gravity to the front wheelb 1.42[m] Distance from the center of gravity to the rear wheelh 0.75[m] Height of the center of massEPC 0.75[m] Distance from the center of gravity to the center of pressurew 1.55[m] Track wheelRw 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 datasheet of the car.:

Cw 0.3 Air drag coefficientρ 1.24[Kg/m3] Air densityA 2.09[m2] Effective frontal areaCy 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 EDry tarmac 10 1.9 1 0.97Wet tarmac 12 1.3 0.82 1

Snow 5 2 0.3 1Ice 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 wereobtained 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 passengercar tire.

29

Page 40: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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

30

Page 41: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 doso, the same tests were done to this model.

The trajectory graphs now include the geometry of the car. The position of the caris 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 5second:

Figure 2.15: Inputs: Constant braking for 5 seconds

31

Page 42: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 ofthe car and of the wheels. The lateral forces are also plotted to see when the wheel issliding.

For this model, the steering can not have a large slope, since it has problems whenintegrating 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 lateraldirections, 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

32

Page 43: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MODELLING

increases and then after a peak it decreases until it stabilizes. This is because the carstarts 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 contributesto 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 steerup to 15◦ and then return to zero, with no braking:

33

Page 44: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 lateraldirections 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 figurebelow, the lateral forces are non zero.

34

Page 45: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 whatpushes 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 thesteer is zero. It can be seen in the figure for the angle of the car, figure 2.21(a), thatthe angle of the car is bigger. This effect is due to the slip angles, the car is slippingso 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.

35

Page 46: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 lateraldirections, 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 forthis situation. Also, it can be seen that the car has some slipping because the verticalvelocity starts to decrease once it has reached the maximum.

36

Page 47: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 geneticalgorithm.

37

Page 48: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 lateraldirections, 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.

38

Page 49: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance 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 wastaken to test how robust the model is. In this situation, the steering is not constantat any time, apart from the initial and final time, due to this the lateral forces do notreach the limit. Therefore, the slip angles are small in comparison with the previouscases.

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

39

Page 50: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Chapter 3

Genetic Algorithm

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

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

The shape of a member will be as the next figure shows. steeringtime︷ ︸︸ ︷a · · · b

steeringpoints︷ ︸︸ ︷c · · · d

braketime︷ ︸︸ ︷e · · · f

brakepoints︷ ︸︸ ︷g · · · h

Memberinfo︷ ︸︸ ︷flag value

(3.1)

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

This type of configuration simplifies the calculus when mixing the parameters, inthe 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 optimizationis done as follows:

There are two types of parameters, one is dependent on the time and the other isdependent on the magnitude. The magnitude is angle and force in this project. Whenthe 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 vectorthem 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.

40

Page 51: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.1: Genetic algorithm flow chart

41

Page 52: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

The boxes defined in this flow chart are defined in the next sections. They can bedifferentiated in two blocks. The genetic operators and the algorithm blocks. Themodel described in the previous section is used in the simulation block where theinputs are introduced in to the model obtaining the desired trajectory and velocity.With the outputs obtained from the simulations the algorithm is able of comparingwhich 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 partnerfor the reproduction. This is done by ”likes” of the member because the partner isthe strongest, healthiest and/or prettiest. In a GA, the member also has to choosethe 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 thisproject is the differential evolution.

� Proportional selection: roulette

� Tournament Selection

� Fitness Selection

� Differential evolution

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

Figure 3.2: Example of roulette for the selection

42

Page 53: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

For the example above the member f is the member with the higher possibility of beingpiked for the reproduction. So the member with a bigger portion on the pie chart hasmore possibilities of being picked.

Tournament selection Two members are picked randomly out of the population.They ”compete” against each other to determine who is best, in this case it will be theone with the lowest value of the objective function.

Fitness selection The member picks the most fit member out of the population, inour case that means that the function picks the member with the lowest value of theobjective function. This selection method has the disadvantage that local convergenceis approached, not letting the algorithm explore the whole domain of solutions. Thishappens because if local convergence occurs the algorithm will tend to make the othermember as similar has the best member is. So after some iterations, the solution willtend to local convergence leaving a space of the domain of solution not explored

Differential evolution There is no comparison with reality, but is similar to thefitness selection, with the difference that two members are picked randomly, and theirgenetic information is combined with the best member. The advantage of this methodis that improves the fitness selection by altering the ”father”, so local convergence doesnot happens.

The selection method is differential evolution,[15], because this type of selectionoperator converges faster than most of the others. For the selection, two members arepicked randomly from the population. These two members make one couple for thereproduction. The selection is based in probabilistic distributions, like the uniformdistribution, or they can be picked randomly, so each member of the population is ableof being picked.

In this work, one of the fathers that make the couple of reproduction is the memberi of the actual population. The other couple for the reproduction is obtained by thebest member of the actual population and other two members, picked randomly. Thesegenerate a father V, this way of selection is called ”differential evolution”.

The algorithm that use this method converge faster to the optimal faster in thetask with only one objective function without restrictions,

Xi = iε[1, NP ]V = Xbest + F (Xr1 −Xr2)

(3.3)

Where Xbest is the best member of the population out of NP members, Xr1 and Xr2 arethe two random members, and F is a real value that controls the perturbation alongthe best member.

3.1.2 Genetic operator of reproduction

For the reproduction, the vector V is mixed with the member i of the actual population,and it will generate the i member of the next population.

43

Page 54: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

There is a limitation in the algorithm used, and it is that the number of membersof a population has to be constant, so that means that if the new member is betterthan the old member, the old member is erased and the new one takes its place. Thecrossover is the way that the chromosomes are divided from one generation to the nextone. The probability of crossover has to be higher than 0.5 and lower than 0.95. Forthe algorithm, a value of crossover, CP = 0.7 was chosen.

There are several ways of mixing the members, the next list shows the most common.

� Single point crossover

� Double point crossover

� Uniform crossover

Single point crossover Is the easiest technique of mixing. Once the two membersfor the mixing are selected, they ”cut” their chromosomes in an arbitrary selected pointto create a different member. The next figure shows how it works.

Figure 3.3: Single point crossover

Double point crossover It is a more general way of the single point crossover. Inthis case, two arbitrary points of cut are selected. The algorithm must check that noneof the points are at the limit of a chromosome. To generate the descendent one of thefather gives the central part to the son while the other gives the lateral part.

Figure 3.4: Double point crossover

44

Page 55: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Uniform crossover It is a totally different technique as the ones shown previously.In this case, each gene can come from either of the fathers. There are several ways ofimplementing this method. One for example, is to create a ”mask” each time the func-tion is called. The mask will determine which father gives what gene to the descendent.This is the type of reproducing/mixing method that is used in the genetic algorithmbut with some modifications. The next figure shows how it works in the theoreticalway, and afterwards the method that is used in the algorithm will be explained.

Figure 3.5: Uniform crossover with mask

3.1.3 Genetic operator of mutation

A mutation is an alteration of a gene. In therms of a genetic algorithm, it means thatthe gene provided to the new member does not come from either of the fathers. Theprobability of mutation has to be much smaller than the probability of mixing. In thegenetic algorithm is going to be CM = 0.1.

The next figure shows how a mutation works.

Figure 3.6: Mutation of a gene

The mutation is needed for two causes, the first one is because it happens in nature,and the second one is to keep the variety of the population.

45

Page 56: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

3.2 Objective function

The task to solve here is to avoid the collision of a car and an object that can bemoving. At the beginning of this project, the object will be static. The problem hereis to determine what variables shows which member is better than others.

The next figure shows a plausible situation.

Figure 3.7: Plausible road situation

There is the possibility that the car collides or leaves the road. Obviously those mem-bers must be discarded for reproduction, or at least for being the best member. Thistype of statements are called restrictions. The restrictions in a GA have the problemthat since they are a heuristic method, the members are chosen randomly, they cankeep landing on a solution that is not plausible. This reduces the speed and efficiencyof the algorithm. So instead of including restriction to the algorithm it works betterto penalize those members.

The next figure shows a flow diagram of how the objective function for this problemis formulated in figure 3.2.

To be able to follow the figure before it is explained thoroughly the next variablesare introduced. The Flag is a parameter that shows how good is the member. The flagshows if the member has collided with the obstacle, it has left the road or it does notreturn to the lane. The flag also determines the level of penalisation that is used.

46

Page 57: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.8: Objective function flow chart

There are different types of penalization:

� Death penalty

� Static penalization

� Dynamic penalization

47

Page 58: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

� Adaptive penalization

In this project, the penalization that are used are death penalty and static penalization.The death penalty is applied to the members that collide with the object with a

large collision area and/or leave the road. The collision area is the surface that is incontact in the collision. The population has to be kept constant, if a member is killed,then a new member is created, this will also keep the variety of the population.

The static penalization will be applied to the members that just touches the obstaclebecause those members are nearly to perfection. Also, the penalisation is applied to themembers that have vertical velocity, Vy, non equal to zero at the end of the simulation,because after over riding the obstacle the car has to continue the path of the track.

There are several function to minimize in order to obtain the optimal solution. Thiswere disused throughout a brain storming, Section: A.1. The conclusions obtained werethat it was necessary to reduce the lateral acceleration, to measure the offset once thecar has passed over the object, and to minimize the time that the car is in the otherlane.

So basically there are three objective functions. Traditional genetic algorithm donot work to their maximum efficiency with more than two objective functions. So fornow, the task is of using a GA with multi objective, [16]. The problem with this is thatit increases the difficulty of the programming and also of the algorithm. The reasondifferential evolution was chosen,[17], because it work better on multi objective tasks.

There has been done some research in the field, to make a multi objective algorithminto a single objective algorithm. The way to achieve this is to combine all the functionsinto one.

f = w1 ∗ f1 + w2 ∗ f2 + w3 ∗ f3 (3.4)

Where f1, f2, f3 are the objective functions, but dimensionless, to keep the valuebetween zero and one, so the penalisation works better, and w is the load value, whichis also between zero and one. So the over all function, f is between zero and one.

The problem now is to determine the value of the loads, the sum of all the loadshould be one and determine the importance of each function in the over all.

One possibility is to apply the load by importance, but at the start there is noprevious information of which is more important. In the paper [18] the idea is tochoose randomly the value of the loads and after some iterations the value of the loadsare changed again. When the loads have been changed several times, the GA will haveexplored the domain of solution and keeping the genetic of the best member after eachchange of load. This will give the overall best member.

To explain each objective function the next flow chart show how they work, andwhat the inputs are.The lateral acceleration is made dimensionless by dividing by the acceleration of gravity.If the values of le lateral acceleration are bigger than 1g then the values will be biggerthan one. The algorithm minimises the function so after some iterations the value willbe between zero and one.

48

Page 59: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.9: Objective function: Lateral acceleration

The time in the other lane function was done using the Y position because when thenumber of points above that value is calculated, it is easy to determine the time usingthe interval of time between two points.

Figure 3.10: Objective function: Time in the other lane

For the end position, since it is the only one that forces the car back to the originallane, had to have two variants. When the velocity at the ends is close to zero then theend position is enough. When this does not happen the number of crossing the X axisshows that at least it comes back to the lane. The last situation is not desirable, butit has to be taken into account to calculate the fpos, so when this happens there is apenalisation done, so the flag = 2 in this case.

49

Page 60: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.11: Objective function: End position

3.3 Other functions used

The functions explained before are the most significant functions in the algorithm, butthere are more functions to be described:

� Generate population

� Define the vectors

� Test parameters

� Obtain parameters

Generate population

When the simulation is run, the first thing it does, c.f. figure 3.1, is to generate thefirst population. The next figure is a representation of how this block works.

50

Page 61: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.12: Function: Generate population

The generate population calls the generate member function until the population num-ber.

The generate member function flow diagram is:

Figure 3.13: Function: Generate a member

This function generates a member. The dimension for the member is set dependingon the number of steer points and times, in the number of brake points and times andadding two spaces for the info, c.f. figure 3.1.

To be able to explain how the generate steer and brake work, first is needed toexplain how the steer and brake vector are defined.

51

Page 62: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.14: Steer vector explained

From the figure, it can be seen that there are two times defined, st1, st2, and fourpoints, sp1, sp2, sp3, sp4. The number of points is going to be dependent on a variable,this variable is called steer order. To position the points at the correct time what wasdone is to place them in a linear distribution in between the two times defined in thevector.

The values of the points are randomly generated, so the car can steer in any direc-tion. For the times, there was a limitation, and that is that the first time has to besmaller than the ”predicted collision time” and the second time has to be bigger. The”predicted collision time” was calculated using the next formula:

Ptime =Initial distance to object

Initial velocity of car(3.5)

This is an estimated value, but it helps the algorithm to go in the right direction fromthe start.

52

Page 63: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Figure 3.15: Brake vector explained

The way the brake vector is defined is similar to the steer vector. This vector has threetimes, bt1, bt2, bt3, and only one point, bp1. There was only chosen one point becauseif an object comes in the direction of the car, the idea is to stop the car, so, there is nopoint in having the brake vector as a sine function or as the steer function. The pointrepresents the value of braking, since in the member, the values have to be in betweenzero and one. It is generated as a percentage of the maximum value. The first timerepresents the start of the braking, the second, when the maximum braking value isachieved and the third when the brake is released.

Define vectors

The values of the steering and braking vector need to be transformed into somethingthat the model can understand, because in the member, they only represent times andpoints, without any sense.

For the steering vector, the points are equally distributed in between the two timesgiven. Once this is done a polynomial is created to fit the points, there are also moreproperties that the polynomial needs to satisfy, that is that the first derivative shouldbe zero at the initial and final times. With this information, the coefficients of thepolynomial are found.

fs(x) = an · xn + · · ·+ a2 · x2 + a1 · x1 + a0 (3.6)

With the coefficient, the time interval is substituted in x, to obtain the steer vector.

53

Page 64: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

The next equation shows a description of how it does it:

for time = 1 until time = tstandard doif time < ts1

steer = 0if time > ts1 & time < ts2

steer = fs(time) ·maxsteerif time > ts2

steer = 0end for

(3.7)

For the brake vector, a similar procedure is used. In this case, there is no needto calculate the polynomial coefficient, only to calculate the straight line between thetimes bt1 and tb2.

fb(x) = a1x+ a0 (3.8)

Once the straight line is calculated, the vector can be filled.

for time = 1 until time = tstandard doif time < tb1

brake = 0if time > tb1 & time < tb2

brake = fb(time) ·maxbrakeif time > ts2 & time < tb3

brake = pb1 ·maxbrakeif time > tb3

brake = 0end for

(3.9)

Test parameters

The parameters of the members need to be checked when it has been selected, repro-duced or mutated. This is done because it may lead to a value that is not within therange. This is one of the reasons all the values, except for the information values, ofa member are intentionally defined between zero and one. What this function does, isthat it checks that all values are in the appropriate range.

Obtain parameters

For the algorithm, it is simpler that it always has information about the member. Todo this, this function measures the length of the parameters for the steer and brakevector. In this case, it will be the number of elements in each part of the vector, thetimes and the points. This function comes extremely important when the parametersare tested because it gives the points where to stop searching for some behaviour inthe member. For example to check that the total time in the steering is less than one,the test parameter function must know that in position of the member it has to stop.

54

Page 65: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

3.4 Tuning the algorithm

Once the algorithm and the model are written in Matlab, the test period was started.In this period the main objective was to find errors in the functions described aboveand in the genetic operators. This is done to test the objective function, because it iscritical in the behaviour of the optimization.

At the start, the loads were applied randomly, because there was no idea on howimportant these were in the optimization. By running the simulation a few times itwas seen that the car did not return to the original lane, y position, as it can be seenin the picture following picture.

Figure 3.16: Trajectory example of a non returning member

To solve this the loads were assigned manually, and they are kept constant trough thehole simulation. The load value for the position function must be much bigger thanthe others so at the end the car returns to his original lane. The next table shows thefinal values of the loads for the weight function.

Function Function LoadTime in other lane 0.2Lateral acceleration 0.2

Final offset 0.6

Table 3.1: Loads applied in the weight function

With this configuration the best results were obtained, as after 500 iterations, theoptimum was getting closer to the initial y position. The other two loads were setequal since there is not sufficient data to determine which one is more important.

The next table shows how the flag values are distributed and their cause.

55

Page 66: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car

GENETICALGORITHM

Flag Descriptionflag = 0 Nothing, the trajectory is correct.flag = 1 The vehicle leaves the road or it collides with

the object but the area of collision is ”small”.flag = 2 The velocity at the end of the simulation is not

close to zero.flag = 3 When the two above happens.flag = 4 The vehicle leaves the road by much or it col-

lides with a bug area of collision.

Table 3.2: Description of the flag values

This distribution was used in order to make the penalisation as linear as possible. Thiswill help to organise the values of the objective function from the best to the worst,including if the behaviour is not appropriate.

In the penalisation method, there were also some changes done because the flag =1, since is penalised by 2, it may have values smaller than those from flag = 0. Tosolve this the values of the penalisation were increased to avoid this behaviour.

The next table shows the values for the penalisation depending on the flag that wasused finally in the algorithm.

Flag Penalisation4 ∞3 202 101 5

Table 3.3: Penalisation used depending on the flag

In flag = 4 when the penalisation is ∞ it means that value is not analysed in theobjective function. When this happens, in order to keep the variety of the population,some of the members with flag = 4 are replaced by new ones. The replacing method isdone randomly, using a uniform distribution, if the value is higher than, CV = 0.95, theold member is replaced. This value is high because if more members were changed, thenthe algorithm will not have the ability of improve the less able members by reproducingthem with the best.

56

Page 67: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Chapter 4

Results

In the following sections, the results are presented. Section 4.1 shows the results forthe point model and Section 4.2 the results for the simple track model.

4.1 Point model

The next simulation are preformed using the point model:

Initial speed [km/h] Distance to object [m]50 70

Table 4.1: Simulations done for the point model

Only one type of simulation was performed because the model is not precise, but ithad to be used for the tuning of the algorithm. In this progress, some reasonable goodsolutions were obtained.

With the point model, no simulation with a moving object was done, since themodel is not very precise.

Three simulation are achieved with this simulation, results for the first simulationare shown in figure 4.1

Figure 4.1: Simulation 1: Trajectory example of a non returning member

57

Page 68: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

The value of the flag and of the objective function are 1 and 0.4061 respectivelyThe car collides with the object, in red, and that is the reason the flag = 1. Apart

from that it can be seen that the car is no able to return to the initial Y position.

(a) Inputs (b) Velocities

Figure 4.2: Simulation 1: Outputs for a non returning member

In this test, the brake vector was considered for the model, as it can be seen in thelongitudinal velocity, Vx, graph. The lateral velocity has a sine function shape, becauseof this behaviour the car drives parallel to the x axis once the value of the steer is zero.

The results second simulation are shown in the next figure.

Figure 4.3: Simulation 2: Trajectory of a flag = 2 member

The values of the flag and of the objective function are 2 and 7.0795 respectively.It can be seen from the figure of the trajectory that there is a non zero vertical

velocity at the end of the simulation, so that is the reason of the flag = 2, withoutconsidering this solution is reasonably good.

58

Page 69: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

(a) Inputs (b) Velocities

Figure 4.4: Simulation 2: Outputs of a flag = 2 member

When applying these simulations the brake vector was disabled, because it was im-portant to see the behaviour, of just the steering. This can be appreciated on the xvelocity, since is constant during the whole simulation. The vertical velocity is nonzero.

The next solution shows a solution that returns to the original lane but it collideswith the object.

The result for the last simulation using the point model are shown in the nextfigure.

Figure 4.5: Simulation 3: Trajectory flag = 1 member

The value of the flag and of the objective function are 1 and 0.4061 respectively.As it was said before this solution collides with the object, that is the reason for

the flag = 1.

59

Page 70: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

(a) Inputs (b) Velocities

Figure 4.6: Simulation 3: Outputs of a flag = 1 member

The steering vector is not smooth, but the trajectory is smooth. This means that thenumber of points of the steer vector must be high in order to have smooth trajectories.This can not be taken as a rule. The higher the degree of the polynomial the morefreedom the steer has to solve the task in the algorithm. The vertical velocity at theend is zero. The shape of the curve is also a sine function.

These simulations using the point model, were used to verify that the algorithmoptimizes properly. The first simulation was used using the multi load method for theobjective function. After that simulation, it was seen that the position of the car isimportant. So the loads were set manually, as it was said in section 3.4.

4.2 Simple track model

For the simple track model, there are going to be two different situations, static andmoving object. For the moving object, it was only considered one situation. Since itis of more importance, for the moment, to analyse the static object.

4.2.1 Static object

The following simulations were done for the static object using the simple track model:

Initial speed [km/h] Distance to object [m]30 5050 7080 100

Table 4.2: Simulations done for the simple track model

For all the situations, only two simulations will be done, in order to show the potentialof the algorithm and also because it will give a bigger idea on how the algorithmbehaves.

60

Page 71: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Initial speed 30 km/h distance to object 50 m

Three simulations are done, the results for the first simulation are:

Figure 4.7: Simulation 1: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 0and 0.0353 respectively.

From the figure above it can be seen from this solution the car brakes in order notto collide with the object. In the introduction, it was explained that it is a plausiblesituation to brake hard enough to avoid the collision. Since it is not the cause of thisproject, the maximum brake value will be lowered, so the car has to overtake the object.

(a) Inputs obtained (b) Velocity and angle of car

Figure 4.8: Simulation 1: Outputs

For this simulation, it can be seen that the brake value is at is near it maximum of1000 N, during approximately 9 seconds. It can be seen that the velocity decreases tonearly zero, the value of the vertical velocity is very low, so as it could be seen in thetrajectory it did not have a significant lateral displacement. The car did not collidebecause the time of simulation was not long enough, but since this is not the type ofsolution it is been looking for in this project it was not extended. To not make the carbe able to stop before the object the maximum braking value was reduced to 100N .

61

Page 72: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

The results for the next simulation are shown in the figure below.

Figure 4.9: Simulation 2: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 1and 1.2241 respectively.

With this new braking maximum value, the algorithm sets the brake force to zeroas it can be seen in the figure below. From the trajectory, it can be seen that time ofsimulation was not long enough to let the car go back to the original lane.

(a) Inputs obtained (b) Velocity and angle of the car

Figure 4.10: Simulation 2: Outputs

From the inputs, it can be seen that the simulation time was not long enough becausethe steer was nearly all the time next to the maximum and also the the steer returnedto zero at the end a few instant before the time of simulation. With this, it can beconcluded that the simulation was short of time.

For the last simulation, the time was increased 5 seconds. Now the car will be ableto return to the lane.

62

Page 73: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Figure 4.11: Simulation 3: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 1and 0.3837 respectively.

Now the car has enough time to return to the lane, and it does it correctly. Thevehicle is colliding still, that is the reason for the flag = 1.

(a) Inputs obtained (b) Velocity and angle of the car

Figure 4.12: Simulation 3: Outputs

The inputs shows that the steering is asymmetrical with respect to the time axis. Thevertical velocity figure shows an asymmetrical response as the steering. This might leada relation between the steer and the velocity. In the next simulations and situationsthis behaviour will be observed with care.

Initial speed 50km/h distance to object 70m

Two simulations are done with this situation. The results for the first simulation areshown in the next figure.

63

Page 74: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Figure 4.13: Simulation 1: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 1and 0.6286 respectively.

The flag = 1 is due to a collision of the car against the object. From the trajectoryit seems that the simulation was not long enough. This can be observed because, thetrajectory is too close to the object, forcing the collision, and also because it does notcontinue for much distance after overtaking the object.

(a) Inputs obtained (b) Velocity and angle of the car

Figure 4.14: Simulation 1: Outputs

The car brakes at the start of the simulation, since the braking value was restricted, itcannot be appreciated in the velocity graph. As it was mentioned before the brakingcan not be appreciated in the longitudinal velocity graph.

For the second simulation, the total time of the simulation was increased from 10sto 15s, the results obtained are shown in the next figure.

64

Page 75: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Figure 4.15: Simulation 2: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 1and 0.3089 respectively.

(a) Inputs obtained (b) Velocity and angle of the car

Figure 4.16: Simulation 2: Outputs

Even thought the simulation time was increased, the algorithm optimized the functionto have the steer back to zero around 9 seconds. This value is approximately the sameas the simulation 1 of this situation. This shows that the problem is not the time in thesimulation, if it is long enough. This will be discussed thoroughly in the conclusions.From the velocities, it can be observed that the shape of the velocity is similar to thesituation one. This might lead to a pattern that can be used to solve the problem withfewer difficulties. This will be discussed in the conclusions, comparing the solution ofthis situation with the others done.

Initial speed 80km/h distance to object 100m

Two simulations are obtained from this situation. The results for the first simulationare shown in the next figure.

65

Page 76: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Figure 4.17: Simulation 1: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 1and 0.5353 respectively.

The flag = 1 is due to a collision with the object, as it can be seen in the figureabove.

(a) Inputs obtained (b) Velocity and angle obtained

Figure 4.18: Simulation 1: Outputs

For this simulation, the brake vector was zero, also the steer was at maximum during2 or 3 seconds. The vertical velocity, Vy, is approximately zero. Also, it can beappreciated that the same shape that was seen in figures 4.2.1 and 4.16(b), except forthe peaks.

The results for the second simulation are shown in the next figure.

66

Page 77: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Figure 4.19: Simulation 2: Trajectory of the car

The values obtained after the simulation of flag and the objective function value are 0and 0.08832 respectively.

This simulation achieved to avoid the object.

(a) Inputs obtained (b) Velocity and angle obtained

Figure 4.20: Simulation 2: Outputs

The steer was at the maximum for around 3 seconds. The brake had a low value. Thevertical velocity, Vy, is approximately zero. Again the same behaviour as the previousexamples.

4.2.2 Moving object

The next simulation was done for the moving object:

Car velocity Obstacle velocity Initial distance50 10 50

To be able to get this result the objective and the stop function were changed, to makethe position of the object to change. The changes are explained and described in the

67

Page 78: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car RESULTS

Appendix B. Only one simulation was done, since the focus of this project are staticobjects. However it is interesting so see if there are any correlations between the staticand dynamic situation.

Figure 4.21: Trajectory of the car with moving object

This figure shows the position of the car and of the obstacle every 5 seconds. Thevalues obtained after the simulation are of flag and the objective function value are 1and 0.3041 respectively.

The flag = 1 is due to a collision. This collision happens around 5 seconds. Thefigure shows the position of the car and the object in the collision.

(a) Inputs obtained (b) Velocities and angle of the car

Figure 4.22: Outputs obtained from the moving obstacle situation

The vertical velocity keeps shown the pattern described in the static analysis.

68

Page 79: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

Chapter 5

Conclusions

The goals of this diploma work were satisfied, but there are some points in the resultsthat must be considered. In this section, the success of full fulling the goals will bediscussed. Then an analysis for the results obtained will be done.

5.1 Conclusions of the project

The goals were:

� Define a realistic model of the car using Matlab.

� Design an algorithm that optimizes the inputs for the car.

� Design the parameters that will determine how good the solution is.

� Obtain different trajectories for different situations. Showing the inputs andoutputs.

� Obtain trajectories for moving obstacle at low speeds.

The first task was to create a realistic model of the car, this was achieved in Section2.2. The behaviour were tested in the validation part. The point model was notprecisely achieved, but as it was said the the corresponding section, the point modelwas only done to tune up the algorithm. The simple track model was achieved withmore precision, because is the model that was used to obtain the results.

The second task was to define al algorithm to solve the problem. This was clearlysatisfied as it can be seen in figure 5.1

69

Page 80: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

Figure 5.1: Example trajectory

The car is able to avoid the collision with the object.The third task was solved using brainstorming. The problem was presented to stu-

dents from the University of Skovde. Some of the solutions presented are in AppendixA.1, and the implementation of them are considered in the objective function, c.f. Sec-tion 3.2. Even thought it appears to work fine, there are some parts that could bechanged. This is discussed later in the text.

After solving this three task, the objectives of this project was satisfied since theywere the mains goals of this project.

The fourth task was to obtain different parameters, the algorithm was testes underdifferent situations of speed and distance. There were some problems that are goingto be described in the following section.

The fifth goal was to test the algorithm having a moving obstacle. A simulationwas achieved with success. More simulations should be done, but due to the lack oftime only one simulation was achieved.

5.2 Analysis of the results

This section is divided in two parts, Section 5.2.1 is for the point model and Section5.2.2 is for the simple track model.

5.2.1 Point model

From the results, it can be seen what it was predicted in the introduction, and it is thatthe genetic algorithm is a good method for searching the optimal solution. However,the different runs it may give different results. The solutions obtained are reasonablegood, the car goes back to the initial y position but it collides with the object as itcan be seen in the figure 5.2.

70

Page 81: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

Figure 5.2: Trajectory for the point model

The figure above shows the trajectory of a member that collides with the object. Inthe figure the area of the car was not included because this model was only used fortuning the algorithm and it was no need to plot the area of the car since the MatLabprogram shows the collision by the flag value. If the maximum number of iterationswas increased probably it will lead to a solution that does not collides with the object.The problem is how to determine the maximum number of iterations. For the simpletrack model, this will be discussed in more depth, because this model is not preciseenough.

5.2.2 Simple track model

For this model, three static and one with the moving object were done. For a betterunderstanding, these will be discussed separately and then a general conclusion for thisanalysis is given.

Static object

Three different situations were tested for the static object. The main thing that wasobserved is that the response of the model to the steer is not fast enough to avoid theobject at small distances. The task was to avoid collisions when the car is not able tostop by just braking. This effect of slow turning is because the model is not preciseenough for fast turning. It is probable that a double track model will solve this taskmuch more efficient. To avoid the car braking like in the figure, the maximum brakingforce allowed was reduced.

71

Page 82: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

Figure 5.3: Trajectory of the car

The other problem that kept arriving was that time of simulation was not correctlydefined. When changing form one situation to other the time must be changed. Theproblem is to find the appropriate value for this time. In this project, it was done bytrial and error. In the future, it could be done by some analytical analysis before theoptimization algorithm starts. This problem can be seen following figures:

(a) Example of short time simulation (b) Braking before object trajectory

Figure 5.4: Examples where the time is the cause of failure of the algorithm

Some of the trajectories obtained do not have sine function trajectory, which is theoptimal trajectory. The next figure is an example of this behaviour.

72

Page 83: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

Figure 5.5: Example of not sine function trajectory

To improve this, the objective function could have another type of penalisation toimprove the optimization. The time function was designed for this purpose, maybe bygiving it a higher load value this problem would be solved. To achieve this, weeks ofsimulations are needed to find appropriate values for the less significant loads. Othersolution is to use a multi-objective genetic algorithm.

The penalisation table, that was tuned using the point model, is valid for the simpletrack model, but there are some points where it fails. This is when flag = 1 and thevalue of the objective function is low. Sometimes this value when is multiplied by thepenalisation function is still lower than the flag = 0 results. This is not a mayorproblem, because the best member will contain the best genetic information and it willpass it on to the flag = 0 members until they are better.

All the situations gave a recognisable pattern with the vertical velocity. The shapeof the velocity graph is shown below.

(a) Trajectory (b) Velocity

Figure 5.6: Pattern observed for obstacle avoidance

The vertical velocity, Vy, appears to have continuously, this shape for the sine func-tion trajectory. This could help to improve the objective function by adding another

73

Page 84: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

function to reward the member with the desired shape of vertical velocity. Also, it willhelp to discard the member with peaks on the velocity like:

(a) Simulation 1 for situation 3 (b) Simulation 2 for situation 3

Figure 5.7: Peaks in the velocity

From the vertical velocity, it can be assumed that the steering would have a similarshape, but form the simulations done there is not a recognisable pattern. For examplefor the figures 4.2.1 and 4.16(b) the steering is:

(a) Simulation 1 for situation 3 (b) Simulation 2 for situation 3

Figure 5.8: Inputs for the two simulation

The two steers do not appear to have a patterns, so it does not give clues for thegeneration of the steer.

In the section 4.2.1, the first simulation appeared to be short of time, so for thesecond simulation the time was extended 5 seconds. With this change, the algorithmshould have used more time so the car did not collide with the object, making thetrajectory with a bigger amplitude. Instead of that, the algorithm optimized to havethe steering end at the same time, around 9 seconds, keeping the a similar trajectory.This shows that the algorithm continues optimizing to the same value, or around

74

Page 85: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

the same value, which shows the convergence of the method approaching the optimalsolution. After this situation, it can be confirmed that the objective function is notdefined with the sufficient precision. This could be solved by changing some of theobjective functions or adding more, and doing an analysis to find the appropriate loadsfor each function.

One of the discussion, is that for how long must the simulation. The next figureshows the number of iteration against the result of the objective function.

(a) Situation 1 (b) Situation 2

(c) Situation 3

Figure 5.9: Convergence plot of different simulations

The figures show the convergence plot for three different simulations. In one of thesimulations, it does not improve the member from the iteration 1000, while the seconddoes it around the iteration 2200, but the third simulation converges fast at the startand then the value stays constant during most of the iteration until the iteration 2100where it starts to decrease again. With such a different results, the designer can arriveto the conclusion that the more iteration the best, because maybe the situation 2 willdecrease using more iterations as it happened in the situation 3. The problem now is

75

Page 86: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

there is to find equilibrium between precision and time of simulation. For example tosolve this simulation the computer took 13 hours, using the 8 core of the computer. Tohave more iterations in a short time, then the computer could be connected to severalcomputers so it can use their cores reducing the calculation time. This is one of theadvantages of genetics algorithm, the ability to use them in parallel architectures.

Moving object

In the moving object situation, the problems described for the static object persist.

(a) Trajectory (b) Velocity and angle of car

Figure 5.10: Car with moving object

The pattern in the vertical velocity is also appearing in this situation, because thetrajectory as a sine function shape. The total time of simulation in this case was muchgreater than using a static object. One possible reason is, the static object objectivefunction compares the position vector of the car with the position of the obstacle. Thiscan be done because the object is not moving, so its position is not depending on thetime. While, in the dynamic object the comparison has to be done each time interval.

5.3 Improvements to do in the project

Throughout this section, the inconvenient that the algorithm, model and objectivefunction were exposed and disused. This section will give tips to improve the model,the algorithm and the objective function.

Improving this model will not add much precision, and will give similar results,but if the model is not going to be changed, then the parameters of the model to usemust be picked carefully. This was one of the problems that the model had and it iswhy the model was not able to turn as fast as expected. Another solution is to use acomplex model which is easier to find appropriate data for it, for example, the doubletrack model, or use a commercial software to focus just on the algorithm and in theobjective function.

76

Page 87: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

The algorithm itself does not need many improvements. One thing that gave prob-lems was estimation of the total time of simulation. A function could be created inorder to estimate the best time for that situation. This will avoid the trial and errormethod to obtain the time, with the positive consequences that it haves. For example,time consuming because to see the result the simulation has to finished. Also, thereshould be a stopping value from which the solution is good enough, and there is not asignificant margin of improvement.

The part that needs more improvements is the objective function. As was seenduring this conclusion. The following list of the new requirements is develop:

� Change the lateral acceleration function to minimize the slip angle of the car.This might lead to faster turning response while keeping the car stability. At thestart, the lateral acceleration method was developed for this reason.

(a) Lateral acceleration (b) Slip angle

Figure 5.11: Differences between the lateral acceleration and the slip angle

As it can be seen in the figure above, the lateral acceleration has noise whichis not appropriate. The slip angle does not have as much noise as the lateralacceleration. To make the slip angle dimensionless it should be divided by anappropriate value of slip angle. The angle should be around 1 or 5 degrees.

� Optimize the loads for the objective functions. There are various techniques.One possibility is trial and error method with the known inconvenient. There isa specific method to solve this task, some can be found in [19] .

� The objective function should reward the members that overtake the object, asit was seen in figure 5.4(a) the vehicle did not manage to the object becausethe braking was to severe. This should be controlled by the objective functionbecause the brake should not be limited, to leave freedom to the genetic algorithmto search for the optimal solution.

� The penalisation method should be change in to a linear penalisation. With this,the overlap in the final objective function value will not continue. This can be

77

Page 88: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car CONCLUSIONS

achieved because the value of the objective functions are between zero and one,therefore, the outputs before the penalisation are limited. Manipulating theseoutputs, the following example graph can be obtained:

Figure 5.12: Proposed penalisation method

This configuration clearly solves the overlap that the actual algorithm has.

78

Page 89: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car FUTURE WORK

Chapter 6

Future work

The main goals of the report were achieved. To be able to continue this diploma workmore situations need to be simulated. The model must be more precise as it was saidin the discussion because the simple track model had a slow response to the steering.Once this is achieved then it will be time to start to develop the fuzzy control. Thesuggested steps to follow are:

� Improve all the details that were mentioned in the conclusions.

� Use a more realistic model

� Make more simulations in more possible situations

� Design the fuzzy control and how it will work, with what variables

� Design an algorithm to teach the fuzzy control

� Test the fuzzy control using computer simulations

� Build the actual fuzzy control to test in a test car

These task will complete the project that has been just started in this project. When itis complete then it can be implemented in cars by the companies. Once this is achievedthe project that was started with this diploma work would be finished. There are moreideas that can be implemented such as:

� Improve the control to be able to do autonomous overtaking

� Improve the control to be able to avoid collision in turns

By applying these ideas in the future, the accidents in the roads will be reduced. Itwill be also an aid for the autonomous vehicles that are under investigation at the timein the safety.

79

Page 90: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car REFERENCES

References

[1] R. Uil, “Tyre models for steady-state vehicle handling analysis,” Master’s thesis,Eindoven University of Technology, 2007.

[2] D. test success, “Aerodinamic drag constant,” 2013. Retrieved March 2013 fromhttp://www.drivingtestsuccess.com/tests/separation-distances/.

[3] Various authors, “Testing and evaluation methods for ict-based safety systems,”tech. rep., Institut fur Kraftfahrwesen Aachen, 2007.

[4] C. Urban Anta, “Desarrollo de un sistema de control de traccion para una moto-cicleta,” Final Project Degree, Universidad de Malaga, October 2010.

[5] G. Alessandro Rucco and John Hauser, “Optimal control based dynamics explo-ration of a rigid car with load transfer,” in Proceedings of the 49th IEEE Confer-ence on Decision and Control, 2010.

[6] Nakov, Ognian and Petrova, Dessislava, “Optimization techniques for vehicle dy-namics modeling,” 2007.

[7] Blundell, M. and Harty, D., The Multibody Systems Approach to Vehicle Dynamics.Elsevier Science & Technology, 2004.

[8] How stuff works, “How disc brakes work,” 2013. Retrieved March 30,2013 fromhttp://auto.howstuffworks.com/auto-parts/brakes/brake-types/disc-brake1.htm.

[9] Taehyun Shim, Ganesh Adireddy, and Hongliang Yuan, “Autonomous vehiclecollision avoidance system using path planning and model-predictive-control-basedactive front steering and wheel torque control,” Journal of Mechanical Engineers,,January 2012.

[10] D. A. Coley, An introduction to genetic algorithms for scientists and engineers.Singapore: World Scientific, 1999.

[11] Wikipedia, “Aerodinamic drag constant,” 2013. Retrieved March 2013 fromhttp://es.wikipedia.org/wiki/Resistencia aerodin%C3%A1mica.

[12] R. N. Jazar, Vehicle dynamics : theory and application. New York: Springer,2008.

80

Page 91: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car REFERENCES

[13] K. Popp and W. Schiehlen, Ground Vehicle Dynamics [Elektronisk resurs]. Berlin,Heidelberg: Springer Berlin Heidelberg, 2010.

[14] K. Kritayakirana, Autonomous vehicle controll at rhe limits of handling. PhDthesis, Stanford University, June 2012.

[15] Rainer Storn and Kenneth Price, “Differential evolution - a simple and efficientadaptive scheme for global optimization over continuous spaces,” Internationalcomputer science institute, 1996.

[16] D. Abdullah Konak and Alice E.Smith, “Multi-objective optimization using ge-netic algorithms: A tutorial,” in Reliability engenierring and system safety, vol. 91,pp. 992–1007, 2006.

[17] Tea Robic and Bodgdan Filipie, “Demo: Differential evolution for multiobjectiveoptimization,” tech. rep., Jozel Stefan Institute, 2005.

[18] M. S.M Gaber, “Traditional genetic algorithm and random weighted genetic algo-rithm with gis to plan radio network,” tech. rep., Cario University, 2012.

[19] K. Deb, Multi-objective optimization using evolutionary algorithms. Chichester:Wiley, 2001.

81

Page 92: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car BRAINSTORMING

Appendix A

Brainstorming

A.1 Objective Function

A brainstorming was done in order to obtain information and ideas about how thetrajectory can be analysed and evaluated. There were 23 ideas obtained, and the mostuseful ideas form the designer point of view were:

� Minimize lateral acceleration.

� Make sure the car returns to the starting lane.

� Minimize the time in the opposite lane.

� Maximize the number of times the car returns to the x axis, Y = 0.

� Make sure the car has a lateral velocity once it returns to the lane as nearly aszero as possible to avoid it going back to the lane or outside of the road.

� Once the velocity is zero measure the distance form the x axis to where it stabi-lizes.

� Make sure the car first turns to the towards the opposite road.

82

Page 93: Optimizing manoeuvres for long collision avoidance active ...his.diva-portal.org/smash/get/diva2:647688/FULLTEXT01.pdf · Figure 1.1: Typical stopping distances [2] If the object

Optimizing manoeuvres for long collisionavoidance active system of a car MOVING OBJECT

Appendix B

Moving object

To make the objective function and the stop function be able to have a moving objectthe following changes were done to them.

The main change to do is to have the center of the object moving at the describedspeed. This can be done with the following equation.

Xobj = X0 + Vobj · time (B.1)

The next figure shows how the trajectory of the obstacle is during the simulation.It is needed to say that the time for the simulation must be increased, because it maynot have time to over take the object.

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

The position of the object was frozen every 5 seconds. For this simulation the dimen-sions of the car will also be shown in the plots.

To check if the car and the obstacle collide. The position of each should be checkin each interval of time. If at the same time they share the same space, then there isa collision. The code will differentiate the area of collision to stop the simulation anddiscard that member or if it ”reasonable” to be improved during time.

83