• No results found

Data-Driven Analysis of the Fuel Saving Potentialof Road Vehicle Platooning: A data-driven approach for quantifying the fuel saving effects of platooning based ondata collected in real traffic conditions.

N/A
N/A
Protected

Academic year: 2022

Share "Data-Driven Analysis of the Fuel Saving Potentialof Road Vehicle Platooning: A data-driven approach for quantifying the fuel saving effects of platooning based ondata collected in real traffic conditions."

Copied!
66
0
0

Loading.... (view fulltext now)

Full text

(1)

 

Degree project in Computer Science Second cycle

Stockholm, Sweden 2013

Data-Driven Analysis of the Fuel Saving Potential of Road Vehicle Platooning

KARL HANSSON

(2)

Data-Driven Analysis of the Fuel Saving Potential of Road Vehicle Platooning

A data-driven approach for quantifying the fuel saving effects of platooning based on data collected in real traffic conditions.

KARL HANSSON

Master’s Thesis at NADA Supervisor: John Folkesson

Examiner: Danica Kragic

TRITA xxx yyyy-nn

(3)
(4)

Abstract

Platooning with trucks is showing promising theoretical results in its ability to lower fuel consumption due to reduction in air drag. Cur- rently, Scania is test driving their trucks in convoys in order to evaluate the concept, in terms of driving behavior and actual fuel saving, under realistic conditions. However, due to traffic conditions it is hard to keep the convoys intact for longer routes and therefore the actual fuel sav- ing effect is hard to evaluate. In this thesis, data collected from a fleet of long haulage trucks is analyzed with four different machine learning predictors in order quantify the fuel saving potential of platooning. The analyzed machine learning methods are Support Vector regression, Mul- tilayer Perceptrons, Random Forests and Decision Trees. The models obtained from the methods coherently suggest that platooning reduces the average fuel consumption by several percent.

(5)

Referat

Datadriven analys av den bränslebesparande förmågan hos fordonståg

Fordonståg med lastbilar visar goda teoretiska resultat för att mins- ka bränsleförbrukningen, då fordonståg minskar det totala luftmotstån- det. För att utvärdera konceptet med fordonståg har Scania ombett sina förare att köra i formation. Vad man är intresserad av är att utvärdera hur förarbeteenden samt bränslebesparingar under naturliga trafikför- hållanden påverkas. På grund av trafikförhållanden är det mycket svårt att hålla fordonståg intakta längre sträckor. Det har därför varit svårt att dra konkreta slutsatser för hur mycket bränsle som faktiskt sparats på grund av reducerat luftmotstånd. Data, som samlats av en flotta last- bilar, har under detta examensarbete analyserats med hjälp av fyra olika maskininlärningsmetoder i ett försök att kvantifiera hur mycket bränsle som kan sparas genom att åka i fordonståg. De maskininlärningsmeto- der som använts i detta arbete är Support Vector regression, Multilayer Perceptron, Random Forest och Decision Trees. De resulterande model- lerna visar entydigt att den genomsnittliga bränsleförbrukningen kan minskas med flera procentenheter genom att köra i fordonståg.

(6)

Contents

1 Introduction 1

1.1 Problem Formulation . . . 2

1.2 Objectives With the Thesis . . . 2

1.3 Report Outline . . . 3

2 Background 5 2.1 The Promise of Platooning . . . 5

2.2 Equation of Motion . . . 6

3 Data 9 3.1 Logged Data . . . 9

3.2 Forming Data Segments . . . 10

3.3 Weather Data . . . 11

3.4 Elevation Data . . . 12

3.5 Vehicle Specific Parameters . . . 12

3.6 Data Not Included . . . 13

4 Platooning Criterion 15 4.1 Heading Similarity Condition . . . 16

4.2 Trajectory Condition . . . 17

4.2.1 A Small Example . . . 19

4.3 Distance Condition . . . 19

4.4 Bringing All Data Together . . . 20

5 Machine Learning 23 5.1 Definition and Introduction to Machine Learning . . . 23

5.2 Support Vector Regression . . . 24

5.2.1 -SV Regression . . . 24

5.2.2 Kernel Trick . . . 27

5.3 Regression Trees . . . 27

5.3.1 Tree Structure . . . 27

5.3.2 A Cherry Tree Regression Tree Example . . . 27

5.3.3 Building a Regression Tree . . . 28

5.4 Random Forest . . . 29

(7)

5.4.1 Forest Structure . . . 30

5.4.2 The Trees In the Forest . . . 30

5.5 Artificial Neural Network . . . 30

5.5.1 MLP Structure . . . 31

5.5.2 Training an MLP . . . 32

5.6 Removal of Outliers Using a Support Vector Machine . . . 32

5.7 Generalization versus Over Fitting . . . 34

6 Results 37 6.1 Framework . . . 37

6.2 Constraints . . . 37

6.2.1 Time Constraint . . . 37

6.2.2 Spatial Constraint . . . 37

6.2.3 Speed Constraint . . . 38

6.3 Dataset Division . . . 38

6.4 Tuning The Algorithms . . . 39

6.4.1 Tuning SVr . . . 39

6.4.2 Tuning MLP . . . 41

6.4.3 Tuning Decision Tree . . . 41

6.4.4 Tuning Random Forest . . . 43

6.5 Model Performance . . . 43

6.6 Effects of Platooning . . . 44

6.6.1 Platooning Distances . . . 45

6.6.2 Relative Time Difference . . . 46

7 Discussion 51 7.1 Comments On the Result . . . 51

7.2 Possible Improvements and Future Work . . . 52

8 Conclusion 55

Bibliography 57

(8)

Chapter 1

Introduction

Transportation of people and goods play a central role in our society. With ever increasing demands for faster and more efficient deliveries a number of problems arises, economical, logistical, environmental, among others. A vast majority of all goods are at some point in the delivery chain transported with trucks, substantial savings could thus be made if transportation with haulage trucks were made more efficient.

Haulage companies are large consumers of fossil fuel. According to a study made by the European commission in 2006 road transportation accounted for 83 % of the total energy consumed by the transportation sector, see [1]. It is estimated that around 35 % of all costs involved in transportation with trucks are fuel costs, see [2]. Thus reducing the fuel spendings, even by fractions of a percent, would lead to major savings for companies and costumers as well a reduced stress on the environment.

Scania, which is a major manufacturer of heavy road vehicles, is continuously researching techniques for making their vehicles more fuel efficient, platooning is one of these techniques. It is widely known from bicycling that a group of cyclists travels faster together in a group than if they were riding alone. This is due to a lowering of the total air drag for the group as a whole. The same technique can be employed for transportation with haulage trucks. By aiding drivers with tools to keep a short distance between vehicles Scania wishes to reduce the fuel consumption for vehicles driving in a platoon. However, as platooning distances decrease the control system for keeping distance between trucks needs to be faster and more reliable. It is therefore important to get a measure of how much fuel that can be saved by platooning, in order to make informed decisions for how close the drivers should platoon in order to drive safely by weighing the risks versus the benefits. In this thesis an attempt to quantify the fuel saving effects of platooning will thus be made.

(9)

CHAPTER 1. INTRODUCTION

1.1 Problem Formulation

For the past three years Scania has been collecting data from drives with long haulage trucks. Drivers have been encouraged to drive both in groups of vehicles and alone. When trucks travel as a group, i.e, platoon, it has been observed that the average fuel consumption is lower compared to driving alone. In a supervised experiment by Alam, see [3], trucks were driven in platoon. In this experiment it is shown that depending on the relative time window between the trucks fuel consumption is lowered by 4.7-7.7 % for trailing vehicles. However, due to traffic conditions it is not feasible to keep the platoon intact for longer routes, moreover, keeping a constant distance between vehicles is even harder. It is thus unanswered how much fuel is saved in real traffic scenarios where the platoon breaks up or when the relative distances between trucks fluctuate.

Data is periodically collected by the trucks on-board communicator. The com- municator saves various sensory information, such as GPS-position, fuel level just to mention a few. This data can be processed, refined and used to build a fuel consumption model. For us to be able to build an as reliable model as possible the trucks should log every physical parameter that influences the fuel consumption.

This is, however, not feasible to do in a non-laboratory environment with commer- cial haulage trucks, where both communication and computational resources are limited. In practice the logged information is not directly connected to the fuel consumption, and analysing it is non-trivial due to the high dimensionality of the data as well as its weak correlation to the fuel consumption.

In modern computer science the field of machine learning has gained large sup- port in the past decade. Since machine learning techniques aims to learn patterns from high dimensional data with weak correlations, it therefore seems promising to employs machine learning for this modelling problem as well. Using machine learning in fuel prediction problems is nothing new, various other researchers have successfully done this, see [4]. However, when others have employed machine learn- ing in order to estimate power or fuel consumption, of an engine for example, the tests have often been performed in a laboratory environment where detailed data is available, such as air intake, injected amount of fuel, see, e.g, [5]. Since this study uses data collected from commercial long haulage trucks data of that type is not available and thus have to rely on other parameters which are not directly connected to the fuel consumption, such as GPS-position, timestamps, odometer readings, etc.

Moreover, it is not the actual fuel consumption that is of highest interest but rather to capture the potential fuel saving effects of platooning.

1.2 Objectives With the Thesis

The overall goal for this thesis is to analyse and quantify the fuel saving potential of heavy vehicles platooning by employing machine learning techniques trained with data from real traffic situations. By analysing models produces by the machine

2

(10)

1.3. REPORT OUTLINE

learning we wish to get a measure of how the platooning distance between trucks affects the fuel consumption. These models will be evaluated with regards to their prediction accuracy. As with most machine learning problems the quality and re- liability of the input data limits the performance of the predictors, this is also the case in this study. A large part of the work will thus been cleaning and refining the available data. Tasks as collecting data from external sources and performing calculations on the logged data will be performed in order to transform the data into a format which is suitable for the different machine learning algorithms. This is an aspect that will be further explained in this thesis.

In order to achieve the overall goal a set of subtasks needs to be resolved, and these are:

• Define a method for classifying a data sample as platooning or non-platooning.

• Create a dataset containing information from the long haulage trucks that is suitable for machine learning, by cleaning up the data and refine it with information from other data sources.

• Employ different machine learning algorithms for estimation of fuel consump- tion.

• Analyse the accuracy of the models.

• Analyse how platooning distances between trucks relates to the fuel consump- tion.

1.3 Report Outline

Chapter 2 The thesis begins with a background chapter describing the basic idea of platooning and some previous research performed on the subject. This chapter aims to give the reader a deeper understanding of how platooning affects the air drag reduction. A physical model of a truck will also be in- troduced in this chapter. This model will serve as reality check when later analysing the data.

Chapter 3 This chapter describes the available data used for modelling of the fuel consumption. In this chapter we will get familiar with the data that is accessible as well as how the data is formatted. This knowledge will be used in order to reformat the data in a suitable format for machine learning. In this chapter we also describe how the data can be refined by adding information from other sources.

Chapter 4 Since the main objective of this thesis is to analyse the effects of platooning it is important to have a clear definition of what platooning actually constitutes. In this chapter we will see how platooning can be defined using our available data and algebra.

(11)

CHAPTER 1. INTRODUCTION

Chapter 5 In this chapter the different machine learning algorithms are explained.

Here we will have a brief overview of what machine learning is and how it is used. The algorithms used within this thesis will here be mathematically and algorithmically explained in a context which helps reader to get a feeling how the different methods handles data. This is important in order to later understand and interpret the results from the models.

Chapter 6 This chapter explains how the different machine learners where tuned in order to achieve maximum predictive capabilities. Here we will also get measures of the models’ performance. In the end of Chapter 6 it is explained how the effects of platooning is measured as well as the predictions made by the models.

Chapter 7 In the discussion the results are commented and interpreted. We will also discuss improvements which can be made to the dataset. The chapter is concluded with some examples of what the models could be used for more than to quantify the effects of platooning.

Chapter 8 We end this report with conclusions regarding this thesis project and the results achieved.

4

(12)

Chapter 2

Background

2.1 The Promise of Platooning

With ever increasing capabilities of sensors, communication and computation it is evident that autonomous vehicles are no longer a dream which lies in a future far away. Research in autonomous vehicles have become an interesting topic for sci- entists all over the globe in the last decade, the capabilities of such vehicles are becoming increasingly close of being realized and used on our roads in peoples’ ev- eryday life. Many leading car manufacturers have predicted the rise of autonomous vehicle in a near future, one among them are Audi CEO, Rupert Stadler, that said the following[6]:

”We are assuming that a series-built vehicle with a piloted driving function will be technically feasible this decade,”

One natural step in the direction of fully automated cars and trucks are to make them semi-autonomous by aiding the drivers with tools that allow the vehicle to autonomous follow another vehicle, thus creating road trains, where only the foremost vehicle is controlled by a human.

Several benefits can be seen in letting vehicles semi-autonomously platoon. By letting computers perform longitudinal control, increased road safety could possibly be achieved. This is due to reduction of the human factor, where drivers get fatigue and lose focus on the driving in dense traffic conditions. Another benefit that can be achieved by automating the driving is increased traffic flow due to smaller spacing between cars, thus increasing the efficiency of the road network. For a further discussion regarding, e.g, safety and traffic flow, see [7].

The last and maybe foremost promise of automated platooning is reduced fuel consumption due to a lowering in air drag. The most famous example of this effect can be observed in the sport of cycling, where it can be observed that groups of cyclists travel faster than they would do by going individually, due to a lowered energy consumption.

(13)

CHAPTER 2. BACKGROUND

One tool that aids the driver in platooning is the adaptive cruise control (ACC) which enables the truck to automatically keep a constant time windows to another truck in front of itself. With the adaptive cruise control, drivers can already drive in platoon without much effort. As technology develops, even more sophisticated tools will emerge and it is interesting to investigate the fuel saving potential of platooning.

In a paper by Tsugawa, see [8], platooning with long haulage trucks is inves- tigated and analysed. In this study trucks were driven on an empty highway at 80 km/h with 10 meter spacing between the trucks. The author concluded that about 14 % fuel reduction was achieved in these tests, compared to driving the trucks alone. Driving with a 10 meter spacing in real traffic condition is, however, not feasible today, since safety cannot be guaranteed at such small distances. A more realistic study made with Scania trucks, see [3], showed that platooning has a fuel reducing effect of 4.7-7.7 % depending on the time window between the trucks.

2.2 Equation of Motion

In order to get a basic understanding of what parameters affect the fuel consump- tion, we start by looking at a simplified equation of motion for a truck. Note that the equation presented in this section is general and holds true for any vehicle. The equation also holds true for all vehicles within the platoon, however, coefficients are obviously individual for each vehicle. The reason that this is done is to guide the search for relevant parameters that later can be used by the machine learn- ing algorithms, keeping in mind that the machine learning algorithms will try to approximate the underlying physical reality from the various logged parameters.

A simplified equation of motion is presented in [3] and reads:

Fengine = mt

dv

dt + Fbrake

+Fairdrag(v) + Froll(α) + Fgravity(α) itifηtηf

rw T (ωe, δ) = mtdv

dt + Fbrake+cDAaρav2 2

+crmgcos(α) + mgsin(α) (2.1)

The term on the left hand side in (2.1) is the propulsive force exerted by the engine and power train on the truck. The coefficients it, if, ηt and ηf are gear and transmission specific constants. The wheel radius is denoted by rw and the angular velocity of the engine is ωe. We can note that this propulsive term is the one consuming fuel and by minimizing the air drag term on the right hand side we can lower to fuel consumption of the engine.

On the right hand side of (2.1) we have the rest of the forces. The first term is simply the accelerated mass, mt, of the truck multiplied with the acceleration in accordance with Newton’s second law of motion. There is also a term describing the breaking force, which is not interesting in the scope of this thesis.

6

(14)

2.2. EQUATION OF MOTION

The term describing the force generated by air drag depends on various param- eters such as the air density, ρa, the vehicles front area, Aa, the squared speed, v2 and lastly the drag coefficient cD. By driving in platoon this term is reduced, due to a lower air pressure at the front of the vehicle and a reduction relative air speed compared to the truck.

Finally the in the two remaining terms we can see the variable α. α describes the slope of the road. Which affects the force required to overcome the gravitational pull and the rolling resistance, via the normal force exerted on the road surface. We can also observe that the vehicle mass, m, affects these two terms as well.

We will use this equation of motion later in Chapter 3 in order to have a guideline for finding the parameters that should have a physical connection with the fuel consumption and potentially useful for the machine learning.

(15)
(16)

Chapter 3

Data

In this chapter the data that will be used in this thesis is presented. Since the data is collected by regular long haulage trucks it is not intended for machine learning but rather as a log used for service. Therefore is its format not particularly well suited for machine learning and needs some reformatting and refinement. This chapter aims to help the reader getting insight how this process is conducted.

3.1 Logged Data

As a foundation of this master thesis, logged data from long haulage trucks has been used. Data has been collected for the past three years by Scania’s subsidiary company Scania Transportlaboratorium AB. Transportlaboratorium consists of a fleet of about twenty long haulage trucks which are used for transportation of parts and other materials between different Scania facilities throughout Europe. The most common route that these trucks travel goes between Södertälje, Sweden, and Zwolle, Netherlands.

In these trucks, there is a so called communicator which collects vehicle data when the trucks are running. Due to the limitations in memory and computational capacity, data is generally collected every 10 minutes. However, this differs quite a lot, as different vehicles have different collect rates. Several types of data is collected by the communicator, which is sent via the GSM-network to be stored in an SQL- database. In Figure 3.1 we can see how the truck transfers vehicle data via the GSM-network to an SQL-database. A subset of the data is displayed in Table 3.1.

These are the parameters which serves as a foundation for the dataset that will be used for the machine learning. In Figure 3.2 the spatial location of the data is shown.

It can be observed that none of the parameters is the current fuel consumption, the parameters which are most closely related to the fuel consumption are the Odometer, FuelLevel and TotalFuel. Both the Odometer and TotalFuel readings are accumulated since the communicator was last reset. It is therefore desirable to form differences between samples instead of looking at absolute values, since it

(17)

CHAPTER 3. DATA

Figure 3.1. The truck periodically sends the logged data via the GSM-network to a remote SQL-database where the data is stored.

Variable Name Type

PositionMessageId Integer

FuelLevel Integer

Heading Integer

Latitude Float

Longitude Float

GeographyPosition Geography Object

Odometer Integer

Speed Integer

TimeSave Date Object

Time Message Date Object

Total Fuel Integer

VehicleId Integer

VehicleStopped Bit

DriverId Integer

Table 3.1. In the left column the variable names are viewed. The right column shows the data type of each variable, the date and geography objects are specific objects to SQL-Server.

enables us to normalize the parameters with regards to distance travelled or time between samples.

3.2 Forming Data Segments

As explained in Section 3.1, it is desirable to form differences between samples.

By forming differences in data segments can be created. The segments can thus 10

(18)

3.3. WEATHER DATA

describe what happens in between two samples. Data segments serve as a more general form for the data, since we migrate from accumulated values to differences in values. This is good since we can normalize various variable with respect to either the distance between the samples or the time between samples. One good example of this is fuel consumption, that can be calculated as the difference in TotalFuel divided by the Odometer difference.

If two samples comes from the same vehicle and are consecutive in time, a data segment can be formed. The time between samples also needs to be below a certain threshold in order to be considered sequential. The threshold that is used in this work is 1000 seconds. It can be observed in Table 3.1 that there are two different date objects, TimeSave and TimeMessage. TimeSave is the time stamp for when the data were saved in the memory in the coordinator and TimeMessage is the time stamp for when the GPS-unit logged the position. Since the main objective of this thesis is to analyse the platooning effects it is important to have as high accuracy as possible for the position of the truck. Therefore TimeMessage is the time variable that is considered within this thesis work.

By creating segments, various interesting properties can be calculated. In Ta- ble 3.2, these newly calculated parameters are shown.

3.3 Weather Data

Scania has observed that the average fuel consumption varies over the course of a year, with lower consumption during summer and higher consumption during winter. It is suspected that this is due to different weather conditions, and using just the time of year as an estimation of the weather seems too blunt of an approximation.

Therefore additional weather data has been added to the dataset. Using an online API (www.wunderground.com) it is possible to enrich the original dataset with weather information.

Due to limitations in requests to the weather service, only seven weather stations in northern Europe are considered. By using a nearest neighbour search for each data point in the dataset weather data from the nearest weather station can be found. It is here worth noting that this approach is not perfect since it implies that there only are seven weather conditions in northern Europe for each day. This is of course not the case in real life, however, it is a far more precise approximation rather than just looking at the time of year.

The weather data itself contains lots of information, such as temperature, air pressure, wind speed, wind direction, humidity, etc. According to the equation of motion-model, described in section 2.2, several of these parameters should be correlated with the fuel consumption.

(19)

CHAPTER 3. DATA

Type First PositionMessageId Integer Second PositionMessageId Integer

First Heading Integer

Second Heading Integer

Heading Difference Integer

First Latitude Float

First Longitude Float

Second Latitude Float

Second Longitude Float

First GeographyPosition Geography Object Second GeographyPosition Geography Object Odometer Difference Integer

First Speed Integer

Second Speed Integer

Speed Difference Integer

TimeMessage Difference Integer First Time Message Date Object Second Time Message Date Object Total Fuel Difference Integer

VehicleId Integer

VehicleStopped Bit

DriverId Integer

Table 3.2. In the left column the variable name is viewed. The right column shows the data type of the variable, instead of having accumulated values differences in values are now present.

3.4 Elevation Data

It is also known from the physical model that the slope of the road influences the energy required to accelerate the vehicle, via the rolling friction and the gravitational pull. Unfortunately elevation data is not recorded by the trucks, however, using the same technique as with the weather data, i.e, use an online service to extract elevation data. Since we know the longitude and latitude, elevation information could be collected for each data point in the dataset. In this project the elevation API is provided by Google.

3.5 Vehicle Specific Parameters

Scania builds its trucks based on a modular system. Which means that each truck is built from many assembled modules. These modules allows each truck to be configured in accordance to costumers’ requirements. Moreover, Scania keeps a

12

(20)

3.6. DATA NOT INCLUDED

Figure 3.2. Geographic location for all data points in the dataset.

record on which modules are included in their manufactured trucks, it is therefore relatively easy to map the VehicleID in Table 3.2 to the modules on which the truck is built. The fleet owned by Transportlaboratorium is relatively homogeneous in its vehicle specifications. By including the vehicle specific parameters in the dataset we hope to capture further details that might help in the fuel estimation process.

Observe that only parameters that differs within the truck population are added to the dataset since a constant variable in the training set would not help the machine learning algorithms in doing better predictions.

3.6 Data Not Included

As mentioned earlier, in an ideal situation we would have access to all variables which are physically related to the fuel consumption. We have seen in the equation of motion, see Section 2.2, that the mass of the vehicle greatly influences the fuel consumption. Unfortunately this data is not logged, the closest we can get is to look at the vehicle specific parameters where the total weight of the truck without trailer is saved. The problem is that the trailer often weighs several times more than the truck itself, thus making the trucks’ weights relatively uninteresting. All hope is, however, not lost since we can assume that Transportlaboratorium does its best to always drive the trucks with as much cargo as possible, why should they run empty trucks? Thus keeping a relatively constant weight of the trucks.

(21)
(22)

Chapter 4

Platooning Criterion

Since September 2012 the drivers have been encouraged to use adaptive cruse con- trol, ACC. Adaptive cruse control keeps a constant time window between vehicles rather than keeping a constant speed. With the adaptive cruse control the drivers can easier keep a platoon for a longer period of time without getting fatigue. There- fore the majority of the data samples which are considered as platooning are created after September 2012.

The Data segments do not contain any information of whether trucks were driv- ing in a platoon or not, and more specifically lacking distance to the closest vehicle in front and back of it. This is an issue which needs to be resolved. In this section we will answer how to mathematically derive whether two vehicles are platooning.

This problem boils down to three sub-problems which needs to be solved. The first one is the direction, that is, are the two vehicle driving in a somewhat similar direction. The second problem is if a vehicle is following/platooning another vehi- cle. The third is distance, a vehicle can only be considered to be platooning if the distance between vehicles is less than a given threshold distance.

From the original data we have the following parameters that are useful to determine whether the three conditions holds true:

• TimeMessage, it is required that the samples to be compared are in sync, otherwise the distances between the points would not make sense. Only sam- ples that are collected within a 300 ms time window are possible platooning candidates.

• VehicleId must differ between the samples since a truck can not platoon with itself.

• Heading. The heading describes how many degrees from the north direction a vehicle is pointing. The orientation for this angle is clockwise, and spans 0 to 360 degrees.

• Longitude. Is the east-west angle in geographic coordinates, goes from −180 to 180 degrees, with center at Greenwich, the positive direction is defined as

(23)

CHAPTER 4. PLATOONING CRITERION

Figure 4.1. The red and blue trucks are close to each other both in space and time, however, since their headings differs too much they can not be considered as going in a platoon.

east.

• Latitude. Defines the north-south angle in geographic coordinates, goes from

−90 to 90 degrees, center at the equator, the positive direction is defined as north.

4.1 Heading Similarity Condition

Situations where the longitude, latitude and timestamps for two different data points are close to each other, but the headings are too different, should not be considered as platooning. One such case is displayed in Figure 4.1, where the red truck and the blue truck move in completely different direction. Other examples could be at crossings where the headings are perpendicular to each other or at roundabouts where the drag is not reduces by the vehicle in front.

The way to determine whether two data points are travelling in the same di- rection is to take the dot product of the headings of corresponding vehicles. For simplicity the heading vector is considered to have unit length, then the dot product can be expressed as a simple cosine containing the difference in heading. If the dot product is greater than a threshold, the different trucks are considered to move in the same direction. This condition is formulated in (4.1).

cos(αh1− αh2) > cos(αthresh) (4.1) Where αh1 and αh2 are the headings in degrees for each corresponding vehicle, and αthresh is the threshold angle. In this project the threshold angle was chosen as αthresh = 23.

If the condition in equation (4.1) holds the vehicles are considered to move in the same direction.

16

(24)

4.2. TRAJECTORY CONDITION

Figure 4.2. The blue truck is overtaking the red truck, by comparing the differ- ence vector between the trucks and the heading of the red truck platooning can be determined.

4.2 Trajectory Condition

There are situations when the trucks are moving in the same direction and are close to each other but still not platooning, thus not reducing the air drag. For example when the vehicles are moving in parallel, during takeovers, on parallel streets in a city or at parking lots. In Figure 4.2 a take over is depicted, this situation should not be considered as platooning since the drag is not reduced by the "leading"

blue truck. In two dimensions it is trivial to construct a test for determining this.

However, since our coordinate system is on a sphere, it is a bit more complicated, and the procedure for this platooning criteria is further explained in this section.

One observation worth noting is that longitude and latitude are closely connected to θ and ϕ in spherical coordinates. This fact is something that will be exploited in order to perform the algebra in a more formal way. The connection between latitude and θ is the following:

θ = −latitude + 90 (4.2)

And the longitude correlates to ϕ in the following way:

ϕ = longitude + 180 (4.3)

It is desirable to construct an algebraic expression that can tell if a truck at point P1 is following an other truck at point P2. That is, if P1 keeps going in its current direction will it encounter P2? To do this we will consider a spherical coordinate system where two points are located on the surface of a sphere with unit radius.

Fortunately latitude and longitude can easily be expressed in spherical coordinates θ and ϕ, see (4.2) and (4.3). The two points can be expressed in spherical coordinates as shown in (4.4).

(25)

CHAPTER 4. PLATOONING CRITERION

P1,spherical = {1, θ1, ϕ1}

P2,spherical = {1, θ2, ϕ2} (4.4)

We can easily convert P1 and P2 to Cartesian coordinates, giving us new ex- pressions for the points as shown in (4.5)

P1 = {sin(θ1) sin(ϕ1), sin(θ1) cos(ϕ1), cos(θ1)}

P2 = {sin(θ2) sin(ϕ2), sin(θ2) cos(ϕ2), cos(θ2)} (4.5) Let us begin by forming a vector which lies in the tangent plane on the surface of the sphere at P1 which points towards the extended (north) polar-axis. The tangent plane is easily expressed by an orthonormal vector (P1 points from origin to the spheres’ surface and is also thus a orthonormal vector to the tangent plane) and the planes distance from origin. The following expression defines the plane S1:

S1 : 1 = sin(θ1) cos(ϕ1)x + sin(θ1) sin(ϕ1)y + cos(θ1)z

Finding out where the plane intersects the z-axis is crucial for forming a north pointing vector. The vector from origin which intersection the tangent plane at the z-axis has the following expression:

Pz = 1

cos(θ1)ˆz (4.6)

By subtracting P1 from Pz a vector pointing from P1 to the z-axis (polar-axis) is formed, more explicitly:

VN = − sin(θ1) cos(ϕ1x − sin(θ1) sin(ϕ1)ˆy + ( 1

cos(θ1) − cos(θ1))ˆz (4.7) Now we have an expression for a vector which points towards north. However, our desire is to rotate this vector in the plane S1 so it points in the same direction as the heading of the truck. Putting it in other words. this means that we will have to rotate a vector around an arbitrary axis (in this case the vector between origin and P1). This can be executed with a rotation matrix. In (4.8) the heading vector is formed by multiplying the rotation matrix T with the north pointing vector VN. Where the rotation matrix is defined in accordance with(4.9).

VH = T · VN (4.8)

T =

tP12(x) + C tP1(x)P1(y) − SP1(z) tP1(x)P1(x) + SP1(y) tP1(x)P1(y) + SP1(z) tP12(y) + C tP1(y)P1(z) − SP1(x) tP1(x)P1(z) − SP1(y) tP1(y)P1(z) + SP1(x) tP12(z) + C

(4.9) 18

(26)

4.3. DISTANCE CONDITION

where C = cos(ωheading), S = sin(ωheading), t = 1 − cos(ωheading), and, ωheading is the heading of the sample located in P1. With the vector VH it is relatively straight forward to determine if one vehicle in point P1 is following another vehicle located in P2, by using (4.10). Observe that we need to normalize the vectors in the dot product in order to get a useful result.

dVH· \P2− P1> cos(αthresh) (4.10) Since the calculation of VH needs to be performed many times it needs some op- timization. By using the Symbolic Math Toolbox for Matlab a simplified expression for VH can be formed, see (4.11).

VH(x) = sin(θ1) sin(ϕ1) sin(ωheading)

cos(θ1) − cos(ϕ1) cos(ωheading) sin(θ1) VH(y) = − cos(ωheading) sin(θ1) sin(ϕ1) − cos(ϕ1) sin(θ1) sin(ωheading)

cos(θ1) VH(z) = − cos(ωheading)(cos21) − 1)

cos(θ1) (4.11)

4.2.1 A Small Example

In order to get a better feeling for how these equations work, a small example will here be presented. In Figure 4.3, the points P1 and P2 are visualized as the blue and red line respectively. From the blue line a tangent plane is formed, on this plane the north pointing vector VN is formed, in the figure this vector is the black line. Then with the help of the rotation matrix T , the magenta vector VH can be found, which is pointing in the same direction as the truck in P1. Then by forming the difference between P2 and P1 the cyan colored line is created, in the figure this vector is extended so that it is better visualized. By taking the dot product between the magenta colored vector and the cyan colored vector we can determine if P1 is following P2.

4.3 Distance Condition

The physical drag reduction effects of platooning are at some point too small to be interesting to consider. We therefore define a third platooning condition stating that the distances between points should be less than a threshold distance in order for two trucks to be considered as platooning. Finding the exact distance between two points on the earth surface can be done in many ways. The reason that there are many methods for doing this is that the earth is not a perfect sphere, but rather an ellipsoid, which means that the radius is not constant. Since we, in the platooning problem, are only interested in finding exact measurements of distance where points lie a few hundred meters apart the earth’s curvature have negligible influence in this

(27)

CHAPTER 4. PLATOONING CRITERION

Figure 4.3. The blue and red lines are P1 and P2 respectively, the black line is VN

pointing to the polar axis, the magenta colored line is VH and the cyan colored line is the vector extended between P2 and P1

domain. The most naïve method is just to use Pythagoras’ Theorem, this method is cheap and exact for short distances. However, we ended up using the built in function STDistance available in SQL-Server 2008, since it was easy to implement.

4.4 Bringing All Data Together

All the data we have gathered thus far are now brought together into the dataset which is to be used in the training of the fuel consumption models. The list of variables that will be used for training looks as follows:

• Fuel Per Odometer, (Float, l/100km), this is the target variable that we are going to estimate with the models.

• Platooning Vehicle, (Binary, no unit), binary variable with value of 1 if the platooning criterion consider this vehicle to platoon behind another vehicle.

20

(28)

4.4. BRINGING ALL DATA TOGETHER

• Leading Vehicle, (Binary, no unit), binary variable with value of 1 if the vehicle is leading a platoon.

• Mean Distance Forward, (Float, meter), if the Platooning Vehicle is equal to 1, this variable shows the distance between the two vehicles, otherwise it is set to show the maximum platooning distance, in this experiment 300 meters.

• Mean Distance Backward, (Float, meter), if the Leading Vehicle is equal to 1, this variable shows the distance between the two vehicles, otherwise it is set to show the maximum platooning distance, in this experiment 300 meters.

• Initial Heading, (Float, degrees), heading of the first sample of the data segment.

• Final Heading, (Float, degrees), heading of the second sample of the data segment.

• North-East, (Binary, no unit), since almost all trucks go in either a North- East or South-West direction a binary variable is set in order to capture these direction, calculated from a mean of Initial Heading and Final Heading.

The reason for including this variable is that it has been observed that trucks going in from the continent to Södertälje tends to consume less fuel compared to the ones going in opposite direction.

• Heading Similarity, (Float, no unit), dot product between Initial Head- ing and Final Heading describing how similar the headings are. Since we know that energy is required in order to change direction we want a measure to capture how much the heading has changed within the data segment.

• Initial Speed, (Float, km/h).

• Final Speed, (Float, km/h).

• Odometer Mean Speed, (Float, km/h), mean speed for the data segment calculated from odometer.

• Road Curvyness, (Float, no unit), odometer distance divided by linear distance between the samples, measure of how curvy the segment is. That is, how much longer the truck has travelled compared to the linear distance.

• Initial Height, (Float, meter), elevation above sea-level for the first sample, extracted from Google Maps.

• Final Height, (Float, meter), elevation above sea-level for the second sam- ple, extracted from Google Maps.

(29)

CHAPTER 4. PLATOONING CRITERION

• Road Grade, (Float, degrees), slope of the road calculated by divide the difference in Final Height and Initial Height with length of data segment, giving us tan(α). It is then trivial to find the slope of the road.

• Mean Temperature, (Float, Celsius), mean temperature at the nearest weather station.

• Mean Air Pressure, (Float, kPa), mean air pressure at the nearest weather station.

• Mean Wind Speed, (Float, m/s), mean wind speed at the nearest weather station.

• Mean Wind Direction, (Float, degrees) mean wind direction at nearest weather station.

• Tail Wind Factor, (Float, no unit) dot product between Mean Wind Direction and Mean Heading. This variable explains how well the mean wind direction aligns with the direction of the truck.

• Air Humidity, (Float, no unit).

• Month, (Integer, no unit), month of the year, variable spans from 1 to 12.

• GTW Technical, (Integer, kg), weight of truck without trailer.

• Tyre Rolling Circumference, (Integer, mm).

• Distance Sensor, (Binary, no unit), with or without.

• Chassis Front End Width, (Integer, mm), width of chassis.

• Ecocruise, (Binary, no unit), with or without.

22

(30)

Chapter 5

Machine Learning

5.1 Definition and Introduction to Machine Learning

Entering the digital era, analysing big amounts of data has become a big issue in computer science. In the late fifties, the term machine learning was introduced to the scientific community by Arthur Samuels, the somewhat loose definition states that machine learning is the ability for a computer program to learn without being explicitly programmed. Further in 1997 Mitchell[9] stated the definition which is widely accepted nowadays:

”A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E”

In our case the experience E is the gathered data from the trucks. T is the target value of the variable which we wish to estimate, in this case the fuel consumption.

In regression problems the measure for the performance, P, is often measured by the Mean Square Error (MSE), which is the mean value of the squared error of output from the regression algorithm. Our final goal with the machine learning is to create a function ˆf (x) that approximates a real physical function f (x) with an as small error as possible for unseen data. We thus have to make sure that the model functions we create have good generalization capabilities, more on that subject in Section 5.7.

We will begin this chapter by explaining the different regression algorithms that are used for fuel consumption modelling. In this master thesis work four differ- ent techniques have been employed, each of them has been given its own section dedicated to help the reader get an intuition of how these methods work. The four methods are, in order of appearance, Support Vector Regression, Regression Trees, Random Forests and Feedforward Neural Networks. The explanations pro- vided in these sections are not entirely self-sustaining, however, good articles are recommended in each section if the reader seeks deeper insights.

Since the data is noisy, it is important to remove outliers from the dataset since outliers makes it harder for the machine learners to find general underlying patterns

(31)

CHAPTER 5. MACHINE LEARNING

in the data. The outliers are removed with the help of a One-class SVM, how this SVM works is discussed in Section 5.6.

5.2 Support Vector Regression

Since the late nineties the machine learning family of Support Vector methods have gained large support in real world applications, both for classification and regression.

The most commonly used regression method within this family is the so called -SV regression, this is the one used in this project as well. In the following section a brief explanation of the method will be presented, this explanation is not self-contained and if the reader seeks deeper insight in the method the excellent article by Smola and Schölkopf [10] is highly recommended. Smola and Schölkopfs’ article is used as a foundation of what is written in this section.

5.2.1 -SV Regression

Suppose that we have a dataset D consisting of features xi and target values yi, where the dataset consists of n points, see (5.1).

D = {(xi, yi) | xi ∈ Rp, yi ∈ R}ni=1 (5.1) Our goal in -SV regression is to find the function f (xi) so that all yi deviates at most  from f (xi) while keeping the function as general as possible, e.g, flat. In the linear case the function f (xi) have the following form:

f (x) = wTx + b (5.2)

Where w ∈ Rp and b is the bias. The trick for keeping the function as flat as possible is to minimize the norm of w or for that matter the square of the norm.

The optimization problem that needs to be solved is formulated in (5.3).

minw

wTw 2

s.t. yi− wxi− b ≤ 

wxi+ b − yi≤  (5.3)

However, since that there are no guarantee that f (x) can actually approximate all yi within the error marginal , this methods needs some refinement. The way of solving this issue is to introduce non-negative, real valued slack variables ξi and ξi?. The optimization problem now looks like this:

minw

wTw 2 + C

n

X

i=1

i+ ξ?i) s.t. yi− wxi− b ≤  + ξi

wxi+ b − yi≤  + ξi? (5.4) 24

(32)

5.2. SUPPORT VECTOR REGRESSION

Figure 5.1. Linear -SV regression.

The strict positive constant C makes a trade-off between how much effort should be kept to keep the target values, yi, within the -margin and how flat f (x) should be. The slack variables ξi and ξi? are the cost of not including a target within the

-margin. The cost is linear and equal to the absolute distance between the margin and the target value. If the data point is within the margin the cost ξ is zero. In Figure 5.1 the linear -SV regression is shown. Here we can see that -SV constructs a hyperplane such that (5.4) is fulfilled. What has been described thus far is the primal form of the -SV regression method. The primal form is good since it is relatively easy to grasp, however, in order to efficiently perform non-linear regres- sion we wish to transform the problem into a higher dimension and solve it linearly there. One problematic issue is that the primal form require us to perform a high dimensional dot product if we were to transform x (and w), see (5.4). Handling high dimension vector multiplications quickly becomes infeasible due to the com- putational reasons. Instead we wish to express our problem in primal form with a dual set of variable which enable us to avoid these high dimensional dot products.

In an article by Fletcher[11], it is shown that by introducing the Lagrangian mul- tipliers, α and η, we can avoid explicitly to calculate the high dimensional w. By introducing a Lagrangian we can move the constraints into the optimization via the

(33)

CHAPTER 5. MACHINE LEARNING

non-negative Lagrangian multipliers α as seen in (5.5).

L := wTw 2 + C

n

X

i=1

i+ ξi?)

n

X

i=1

αi( + ξi− yi+ wxi+ b)

n

X

i=1

α?i( + ξi?+ yi− wxi− b)

(5.5) For optimality, the partial derivatives of the primal variables of the Lagrangian L need to be zero, that is the partial derivatives of L should be zero as depicted in (5.6).

bL = Pni=i?i − αi) ≡ 0

wL = w −Pni=ii− α?i)xi ≡ 0

ξiL = C − αi− ηi ≡ 0

ξ?

iL = C − α?i − η?i ≡ 0 (5.6)

Given these constraints for the Lagrangian L, the optimization can be rewritten into the so called dual formulation, see (5.7)

maxα

−1 2

n

X

i,j=1

i− α?i)(αj− α?j)xiTxj

−

n

X

i=1

i+ α?i) +

n

X

i=1

yii− α?i)

s.t.

n

X

i=1

i− α?i) = 0

αi, α?i ∈ [0, C] (5.7)

By looking at (5.6) we can express w with the help of α. (5.2) can thus be refor- mulated without explicitly knowing w, as in (5.8).

f (x) =

n

X

i=1

i+ α?i)xiTx + b (5.8)

This means that we now can perform -SV regression without ever knowing w which is good when we later solve non-linear problems. By using the dual formulation and the so called kernel trick, see Section 5.2.2, we can now transform our problem into a high dimension without increasing the complexity of the problem.

26

(34)

5.3. REGRESSION TREES

5.2.2 Kernel Trick

As of now the -SVr can only solve problems linearly. In order to perform non-linear regression we are going to transform the problem into a higher dimension using a kernel function, i.e, xi ∈ Rp → Φ(xi) ∈ Rq, where q > p. When transforming vectors into a higher vector space they tend to become more sparse and more likely to be linearly separable. However, we wish to avoid handling high dimensional data since it is computationally expensive. This is where the beauty of the dual formulation of the -SVr shines, see (5.7) and (5.8). The dual formulation is constructed in such a way that we only need find the dot product xiTxi, and if we transform the problem to a higher dimension we would be interested in finding Φ(xi)TΦ(xi) instead. Aizerman, see [12], realized that dot products only return a scalar value and found that Φ(xi)TΦ(xi) can be implicitly calculated using a kernel function K, where K(xi, xi) = Φ(xi)TΦ(xi), if Φ(xi) is chosen wisely. The most common kernel is the radial basis function, RBF. The RBF is defined as K(x1, x2) = e||x1−x2||2σ2 , this is also the kernel used in this work, for more information about the RBF see [13].

5.3 Regression Trees

One of the most naïve and surprisingly effective machine learning regression method is the regression tree, or decision tree (DT). There are many flavours and extensions of how regression trees could be implemented, however, in this work the original method as described by Breiman, see [14], is used. In this section the underlying technique for how a simple regression tree is built is described, and in the next section an extension, random forest (RF), is be presented.

5.3.1 Tree Structure

The basic idea of a regression tree is really simple. A regression tree is binary tree, at each internal nodes in the regression tree a test is applied to one of the inputs in x. Depending on the outcome of the logical test we continue traversing down the tree. If another node is encountered its logical test is executed and we continue down the tree until we reach a leaf. When the leaf is reached the prediction is made by extracting the value of the leaf.

5.3.2 A Cherry Tree Regression Tree Example

For a more intuitive feeling of how a tree works, a small example will here be presented. In the dataset "Trees" the girth, height and volume has been recorded for 31 felled black cherry trees [15]. This data is then used in order to construct a regression tree which estimates a tree’s height, given its girth and volume.

In Figure 5.2 and 5.3, two different representations of the same the regression tree are displayed. Figure 5.2 clearly shows the logical tests performed on the

(35)

CHAPTER 5. MACHINE LEARNING

Figure 5.2. The basic structure of a regression tree is here shown, at each node logical tests are made and the final regression value is taken from the leaves.

volume and girth parameters in order to determine the height. While Figure 5.3 better shows how the tree splits the room into hyperrectangles. The leaf values are derived by taking the mean of the training datas’ height for each hyperrectangle.

5.3.3 Building a Regression Tree

The problem that needs to be solved when constructing a regression tree is to find a good set of rules that partition the training data in such a way that maximum information is gained at each split. There are many ways of doing this and none is perfect since it is not clear what "maximum information" means. In this project, ANOVA (analysis of variance) is the measure is used. This is done in the following manner, again assume that we have the training set D as defined in (5.1). ANOVA searches for the splitting rule that divides D into two disjoint subsets U1 and U2 such that the quantity S is maximized, see (5.9).

maxU1,U2

S =X

D

(yi− ¯yD)2X

U1

(yi− ¯yU1)2X

U2

(yi− ¯yU2)2 (5.9)

A regression tree is built by iteratively splitting the training data, at each node, into two subsets until a stopping criteria is met. If a subsets contains less or equal to 5 training examples no more splits occur and the leafs’ value is set to the average of the remaining training examples. Otherwise the subset continues with its segregation until the stopping criteria is met and no more node splits occur. What we are left with is a tree that is over fitted to the training data. In order to avoid over fitting

28

(36)

5.4. RANDOM FOREST

Figure 5.3. A representation of a regression tree, by making logical tests with regards to girth and volume one can determine the expected height of a black cherry tree

the splitting process is followed by a pruning process. In the pruning, we remove branches in the tree that contributes little to the prediction accuracy with regards to some validation dataset.

5.4 Random Forest

By combining the predictive capabilities of many regression trees a so called ran- dom forest can be created. The random forest is an ensemble machine learning algorithm. The underlying idea of ensemble techniques is to combine many weak learners in order to produce a strong learner. Ensemble algorithms often outperform the individual predictors which it is built upon, i.e, wisdom of crowds.

The random forest framework was first introduced by Breiman[16]. The method described in Breimans paper is the foundation of the implementation used in this project. Breiman defines a random forest as follows:

"A random forest is a classifier consisting of a collection of tree-structured classifiers {h(x, Θk), k = 1, . . . } where the {Θk} are independent identi- cally distributed random vectors and each tree casts a unit vote for the most popular class at input x."

(37)

CHAPTER 5. MACHINE LEARNING

Figure 5.4. Random forest is an ensemble method where each tree in the forest casts a vote on the outcome, the average of the votes is the final prediction of the random forest, in this case 7.25.

Analogous can this definition be extended to tend regression instead. Where the output of the forest is the mean of all weak regression trees.

5.4.1 Forest Structure

The method that is used to ensemble the trees in the forest is a so called bootstrap aggregation technique. Given the standard training set, see (5.1). The training set is divided into k smaller training sets by sampling the original training set, D, with replacements. These sampled subsets {Di, i = 1, . . . , k} are all equal in size, ni < n.

Then a decision tree is trained for each training set Di, how this training is done will be explained in Section 5.4.2. Finally prediction is performed by letting the k regression trees vote, that is, the final output from the forest is the mean output of each individual tree, see Figure 5.4.

5.4.2 The Trees In the Forest

Given Di, randomly select p of variables at each node in the tree. With regards to some splitting criterion (ANOVA in this case) let the tree grow until there are less than five training examples left in the branch, this is the number Breiman used in his article. The value in the leaf is set to the average of the five (or less) target values. The training is performed exactly like the regular regression trees as described earlier, with the modification that only a subset of the parameters are considered at each node, also no pruning is used.

5.5 Artificial Neural Network

Artificial neural networks comes in many flavours, and the thing they got in common is that they are all basically directed graphs in their structure and the nodes in the

30

References

Related documents

municipality groups have a higher expenditure increase in expenditure on gasoline compared to diesel, as the direct effect of increasing the fuel prices for both fuel types have

By investigating the company and by, with help of the price model equalizer, identifying the company’s current price model, I was able to see how Miraculum Fire tried to

If a specific arrival time, merging position and final speed is imposed on a set, there is no room for a real compound optimization to take place, there is just a solution that

För att kuratorerna skulle kunna göra rätt anmälningar, samt kunna veta när de skulle ta hjälp av andra myndigheter, menade de att det var av stor vikt att känna

The SRAM cell that is being used to generate memories is not efficiently layed out. Hence, the cells a lot of area. Some of the fundamental rules, which can be followed while

Stöden omfattar statliga lån och kreditgarantier; anstånd med skatter och avgifter; tillfälligt sänkta arbetsgivaravgifter under pandemins första fas; ökat statligt ansvar

PACE makes outlier detection, estimation of the function outside the observation du- ration and the gathering of common statistical properties, like mean and variance in

The following city buses are analysed: The conventional two-axle city bus Volvo B290R Urban, the conventional biarticulated city bus Volvo B340M Biarticulated and the