+ All Categories
Home > Documents > Fuel Consumption Using OBD-II and Support Vector Machine …

Fuel Consumption Using OBD-II and Support Vector Machine …

Date post: 11-Nov-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
9
Research Article Fuel Consumption Using OBD-II and Support Vector Machine Model Tamer Abukhalil , Harbi AlMahafzah, Malek Alksasbeh, and Bassam A. Y. Alqaralleh Department of Computer Science, Alhussien Bin Talal University Ma’an, Ma’an, Jordan Correspondence should be addressed to Tamer Abukhalil; [email protected] Received 26 August 2019; Revised 10 December 2019; Accepted 19 December 2019; Published 25 January 2020 Academic Editor: Gordon R. Pennock Copyright © 2020 Tamer Abukhalil et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. is paper presents a method to estimate gasoline fuel consumption using the onboard vehicle information system OBD-II (Onboard Diagnoses-II). Multiple vehicles were used on a test route so that their consumption can be compared. e relationships between fuel consumption and both of the engine speed are measured in RPM (revolutions per minute), and the throttle position sensor (TPS). e relationships are expressed as polynomial equations. e method which is composed of an SVM (support vector machine) classifier combined with Lagrange interpolation, is used to define the relationship between the two engine parameters and the overall fuel consumption. e relationship model is plotted using a surface fitting tool. In the experimental section, the proposed method is tested using the vehicles on a major highway between two cities in Jordan. e proposed model gets its sample data from the engine’s RPM, TPS, and fuel consumption. e method successfully has given precise fuel consumption with square root mean difference of 2.43, and the figures are compared with the values calculated by the conventional method. 1. Introduction Over the past few years, automotive manufactures have been concerned about reducing emissions and the overall utili- zation of fuel resources that is associated with the trans- portation industry. is evolving problem has urged government agencies and decision-makers to set regulations and standards on efficiency and low emissions [1]. More- over, the high costs of oil, together with the rising worries about environmental and atmospheric pollution, has forced automotive manufacturers to the development and mar- keting of energy efficient vehicles, by adopting strategies such as (i) designing more efficient small displacement engines, (ii) reducing weight and coefficient of drag of the vehicle, (iii) usage of low profile tires to minimize rolling resistance, (iv) adding an electric powertrain along with the conventional fuel engine, etc. [2]. Worldwide, governments are imploring for more efficient vehicles; therefore, there have been outstanding advancements in the use of alter- native and low emission fuels such as hydrogen combustion cells. For the past decade, the Japanese government has been urging Japan’s automotive manufacturers to increase the development work spent on battery-powered electric vehi- cles (EVs) and hybrid electric vehicles (HEVs). Fuel cell electric vehicles (FCVs) such as hydrogen cells is one more types that is either used to generate power using hydrogen combustion engine which moves the vehicle or indirectly generating electricity to power up an electric motor [3]. Earlier, non-spark-ignition engines (diesel) were known for their weakness in terms of emissions and reliability. However, only very recently, modern technologies have significantly improved such engines. In general, diesel en- gines get better fuel mileage when compared with gasoline engines. Despite that, this work studies gasoline powered vehicles because they produce less harmful emissions and because the overall trend nowadays is moving towards gasoline and hybrid/electric vehicles. is paper brings to discussion fuel consumption in real-time using instanta- neous vehicle parameters and tries to estimate such con- sumption using an SVM. is work does not necessarily suggest the best driving style nor how to save fuel, but it attempts to model fuel consumption on a specific terrain for Hindawi Journal of Robotics Volume 2020, Article ID 9450178, 9 pages https://doi.org/10.1155/2020/9450178
Transcript
Page 1: Fuel Consumption Using OBD-II and Support Vector Machine …

Research ArticleFuel Consumption Using OBD-II and Support VectorMachine Model

Tamer Abukhalil Harbi AlMahafzah Malek Alksasbeh and Bassam A Y Alqaralleh

Department of Computer Science Alhussien Bin Talal University Marsquoan Marsquoan Jordan

Correspondence should be addressed to Tamer Abukhalil tamer405gmailcom

Received 26 August 2019 Revised 10 December 2019 Accepted 19 December 2019 Published 25 January 2020

Academic Editor Gordon R Pennock

Copyright copy 2020 Tamer Abukhalil et al )is is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work isproperly cited

)is paper presents a method to estimate gasoline fuel consumption using the onboard vehicle information system OBD-II(Onboard Diagnoses-II) Multiple vehicles were used on a test route so that their consumption can be compared)e relationshipsbetween fuel consumption and both of the engine speed are measured in RPM (revolutions per minute) and the throttle positionsensor (TPS))e relationships are expressed as polynomial equations)emethod which is composed of an SVM (support vectormachine) classifier combined with Lagrange interpolation is used to define the relationship between the two engine parametersand the overall fuel consumption )e relationship model is plotted using a surface fitting tool In the experimental section theproposedmethod is tested using the vehicles on a major highway between two cities in Jordan)e proposedmodel gets its sampledata from the enginersquos RPM TPS and fuel consumption)emethod successfully has given precise fuel consumption with squareroot mean difference of 243 and the figures are compared with the values calculated by the conventional method

1 Introduction

Over the past few years automotive manufactures have beenconcerned about reducing emissions and the overall utili-zation of fuel resources that is associated with the trans-portation industry )is evolving problem has urgedgovernment agencies and decision-makers to set regulationsand standards on efficiency and low emissions [1] More-over the high costs of oil together with the rising worriesabout environmental and atmospheric pollution has forcedautomotive manufacturers to the development and mar-keting of energy efficient vehicles by adopting strategiessuch as (i) designing more efficient small displacementengines (ii) reducing weight and coefficient of drag of thevehicle (iii) usage of low profile tires to minimize rollingresistance (iv) adding an electric powertrain along with theconventional fuel engine etc [2] Worldwide governmentsare imploring for more efficient vehicles therefore therehave been outstanding advancements in the use of alter-native and low emission fuels such as hydrogen combustioncells For the past decade the Japanese government has been

urging Japanrsquos automotive manufacturers to increase thedevelopment work spent on battery-powered electric vehi-cles (EVs) and hybrid electric vehicles (HEVs) Fuel cellelectric vehicles (FCVs) such as hydrogen cells is one moretypes that is either used to generate power using hydrogencombustion engine which moves the vehicle or indirectlygenerating electricity to power up an electric motor [3]

Earlier non-spark-ignition engines (diesel) were knownfor their weakness in terms of emissions and reliabilityHowever only very recently modern technologies havesignificantly improved such engines In general diesel en-gines get better fuel mileage when compared with gasolineengines Despite that this work studies gasoline poweredvehicles because they produce less harmful emissions andbecause the overall trend nowadays is moving towardsgasoline and hybridelectric vehicles )is paper brings todiscussion fuel consumption in real-time using instanta-neous vehicle parameters and tries to estimate such con-sumption using an SVM )is work does not necessarilysuggest the best driving style nor how to save fuel but itattempts to model fuel consumption on a specific terrain for

HindawiJournal of RoboticsVolume 2020 Article ID 9450178 9 pageshttpsdoiorg10115520209450178

three vehicles each of which has different engine dis-placements using machine learning prediction Whileevaluating the vehicles it is also worth comparing them interms of fuel efficiency as an attempt to answer the questionthat ldquowould the type of the vehicle help improving gasmileage over a specific terrainrdquo In other words ldquowould avehicle with a bigger displacement engine be more efficientthan vehicles with relatively smaller engines when driven inthe same conditionsrdquo

)is paper presents an overview of the related work andcontribution in Section 2 A discussion of the OBD-II systemis presented in Section 3 followed by a brief description ofthe PIDs found in the OBD-II connector Section 4 showsthe experiment details and discusses fuel economy for thetest vehicles Section 51 gives an overview of the proposedmethod Section 52 presents the results of predictionequations and fuel consumption validation for the vehiclesfollowed by the conclusion in Section 6

2 Literature Review and Contribution

Meanwhile until alternate power vehicles are mass-pro-duced efficient utilization of fuel is the current concern [4]Taking this into consideration economical driving (or eco-drive) is one of the effective methods that can be very usefulAs it is mentioned earlier economical driving can be definedas a driving style that does not put unnecessary load on theengine Although most modern vehicles are equipped withonboard economy-mode feature many driving manners canbe of great influence to minimize fuel consumption whiledriving Researchers who expertise in vehicular engineeringhave had special interest in developing methods for fuelemissions over a driving cycle Alessandrini et al [5] forexample were interested in creating a newmethod that givesmore precise description of the relationship between fuelconsumption and the road network or specific usersEricsson [6] explains that fuel can be saved by avoidingsudden changes in acceleration and high-speed drivingdefinitely consumes more fuel Instead driving styles shouldinclude upshifting to a higher speed at the right timeavoiding speeds that exceed 100 kmh anticipating trafficflow accelerating and decelerating smoothly with minimalusage of brakes and keeping the vehicle in good mechanicalcondition Meseguer et al [7] suggest maintaining less-frequent tendency for deceleration followed by accelerationminimizing the use of low gears and trying to get to highestavailable gears as soon as possible while avoiding contin-uous gear changes Differentmobile eco-driving applicationshave been introduced to help improve fuel economy [8ndash10]Alternatively fuel consumption is greatly affected by thenature of the route on which the vehicle is commuting on thedaily basis

From computer science perspective this work tries todevelop a new method to calculate real-time fuel con-sumption based on two OBD parameters and to validate theresults against the conventional method which is restrictedtoMAF (mass air flow) and vehicle speeds readings only)eprevious paragraph summarizes research topics on fuelconsumption in general however it is also important to

include what actual parameters and methods that have beenintroduced by different authors who investigated fuelconsumption in vehicles

)ere have been several state-of-the-art papers thatpropose a set of parameters that can be used to calculate fuelconsumption One of the main categories is identifying suchvariables Xaio et al [11] presented a formula to computefuel consumption rate (FCR) function by analyzing datafigures of various factors and then provided examples toshow the different results without considering TPS as afactor affecting fuel consumption Other authors likeSyahputra [12] and Langari and Won [13] increased thenumber of parameters and introduced neuro-fuzzy methodsin order to improve the obtained results Beside these re-searches that deal with variables to estimate fuel con-sumption the current state-of-the-art models offer anestimation of fuel consumption based on typical urbandriving behavior Moreover Most of these models presentsimplified mathematical equations [12 14] Others intro-duced approaches to compute fuel and emission rates arebased on average link speeds [15 16]

)e second category is the approaches that use machinelearning Chen et al [17] were interested in analyzing thedriving behavior using machine learning classifier )eyused the classical AdaBoost algorithm along with infor-mation from the ECU to determine whether or not thedriving behavior is a fuel-saver Wong et al [18] also used amachine learning classifier but only to predict air-fuelmixture optimum for best fuel economy Different tools aredesigned to collect data in real-time from the OBD-II Inconjunction with an exhaust analyzer Ortenzi and Cos-tagliola [19] have created consumption and emission modelsdeveloped for vehicles with gasoline engines It is also worthmentioning that several mobile applications combined withdedicated devices are available that can read and monitormultiple values such as fuel consumption and engine pa-rameters using OBD-II Apart from such devices someprograms work by measuring the instantaneous consump-tion using different approaches such as neural networks [20]while the others focuses on the setting standards foremissions such as Copert III [21]

)e consensus point in most of the previous proposals isthat they involve MAF readings in their techniques Justrelying on such values have the disadvantage in cases whengas pedal movement has an influence on the air-fuel ratiobut it remains stable around the fixed value when the ac-celerator is being slightly depressed but it changes withharsh accelerating behavior In some circumstances MAFremains unchanged when throttle position rotates in smallangles and sometimes stays still despite that engine load ischanging in bigger amounts that do necessarily match thechanges in throttle position One more difference is thatmost of the researches towards vehicular technology focuson analyzing variable data from ECU to creating softwareprogramsmobile applications that informs the driverwhether his driving style is economical )is work howeverdoes not create a program but it tries to propose newmethodto fuel consumption based on a combination of training dataset

2 Journal of Robotics

3 OBD-II Standard

)e onboard diagnostic (OBD) standard was developed inthe United States basically to help detecting engine mal-functions )e primary objective of having such system is todetect any increase of the harmful gas emissions that exceedsome acceptable limits )e system works by continuouslymonitoring various sensors dedicated to send electricalsignals as a feedback to the vehiclersquos main ECU Such sensorsmonitor the engine management functions more specifi-cally these sensors are responsible to detect airfuel volumeso the ECU can precisely determine the accurate mixture inreal-time Other sensors also contribute to airfuel mixturesuch as oxygen sensor and MAF sensor An OBD scanner isused to communicate with the vehiclesrsquo ECU )e OBDscanner is a tool to diagnose problems on the vehiclesrsquoelectrical and emission systems When a failure is detectedthe ECU stores faulty code in memory so that it can be readby the scanner

)e first OBD standard known as OBD-I was designedto monitor relatively fewer parameters when compared withOBD-II When fuel-injection systems have emerged in theautomotive industry OBD-I was mainly focused ondetecting faulty errors in the enginesrsquo ignition emission andinjection systems )e diagnosing technique then was basicand OBD-I did not set a standard for acceptable emissionlevel for vehicles)erefore the situation of running too richor too lean which increases fuel consumption would not bedetected Ignition systems back then were not as sophisti-cated and advanced as we have today Many other nonengineelectrical error codes were not included in the standardFailures were just expressed as a visual warning to the driverand the error is stored in the ECUrsquos memory )e secondgeneration of OBD known as OBD-II has set standards formore components such as the plug and the connector usedfor diagnostic the diagnostic trouble codes (DTCs) and thesignaling protocols on the controller area network (CAN)bus Additionally the detailed list of DTCs (diagnostictrouble codes) is also defined in the standard OBD-IIstandard also defined parameters that can be monitored andassigned a code (Identification ID) to each parameter (PID)Several subsystem interaction modes are also set by theOBD-II standard to offer a straight-forward interaction withthe vehiclersquos systems such as the heating and ventilationsystems transmission system and enginechassis systemthus allowing for more accurate diagnosis depending onfunctionality Well-known automobile manufacturers suchas Daimler Mercedes and BMW have introduced additionalinteraction modes that are specific to their vehicles thusoffering a full control of the vehiclersquos functionality )eEuropean regulations equivalent to the OBD-II standardknown as EOBD set a standard for fault codes whichconsists of five characters a letter followed by four numbersEOBD and OBD-II have the same connectors and interfacesFigure 1 shows an example of both male and female OBD-IIconnectors In this particular scan device the female con-nector is a part of a CDP AutoCom OBD-II [22] device thatoffers a connection between the vehiclersquos internal bus and apersonal computer using a Bluetooth connection

A Schematic description of OBD-II female connectorPINS is shown in Table 1 [23]

Table 2 shows a list of some OBD-II PIDs defined by SAEJ1979 standard that can be used in the experiment )edescription for each PID is given along with information onthe number of bytes and the units of each PID [24]

4 The Experiment

Many commercial OBD-II scanners are available in themarket Some are equipped with Bluetooth connectionwhich allows the scanner to communicate wirelessly withcorresponding software installed on a PC or a mobile ap-plication As mentioned in Section 3 CDP Autocom scantool is one of the available OBD-II scanners CDP Autocomis manufactured by Delphi a Swedish automotive tech-nologies and solutions )e Autocom scanner supports allOBD-II compliant vehicles however it is not compatiblewith the diagnostic software written for the ELM327-basedinterfaces )e ELM327 is an interface installed on anadapter designed to act as a bridge between OBD-II port andthe standard RS-232 interface

)ree test vehicles are put into test 2017 Ford Fusion2016 Toyota Camry LX and 2006 Mercedes-Benz e280 Allof these vehicles are midsized sedans and their engines arenaturally aspirated which means that they are not turbo-boosted In this experiment we tried to avoid turbo enginesTurbo engines tend to consume more fuel because of theconsequent result of turbo lag It is also interesting tomention that almost all passenger cars used in Jordan run ongasoline Table 3 shows some of their characteristics whichdirectly affect the overall gas consumption such as weightoverall size and their enginersquos displacements Each enginersquoshorsepower is also a key factor in this context All threevehicles have automatic transmission and run on gasoline

)e driving route connects Sweileh-Amman and Ram-tha and it is about 66 kilometers long One of the maincharacteristics of this road is its steep nature thereforevehicles would struggle to go uphill on such freeway Fig-ure 2 shows the intended route

Typically modern gasoline injection systems use twooxygen (lambda) sensors one mounted right after the en-ginersquos manifold and the other one is fitted on the exhaustpipe just before the catalytic convertor Both sensors sendfeedback data to the vehiclersquos ECU in order to estimate theair to fuel ratio )is ratio is predetermined chemically atideal value of 147 grams of air to every gram of gasoline [25])eMAF is the amount of air sucked by the engine in gramsper second)erefore if MAF value is known the amount offuel can be calculated by converting the MAF value togallons per hour and then calculate miles per gallon )e-oretically fuel consumption f can be calculated using thefollowing equation

f vs times αMAF

times β (1)

where vs is the vehicle speed in kmhour MAF is the massair flow in gs α 7718 is a constant to convert the value off to US MPG (miles per gallons) and β is a constant to

Journal of Robotics 3

convert MPG to liters per 100 km However vehicle speedand MAF readings cannot be sufficient for precise estima-tion fuel consumption is also affected by the throttle angleRotation of the throttle is responsible for determining theamount of fuel flow to the combustion chamber For thatreason this work tries to estimate fuel consumption basedon additional variables such as TPS

)e three vehicles are put to test on the route shownabove Discussion below brings up the real-time figures ofengine and vehicle speed in a 40-minute duration

Using equation (1) the instantaneous fuel consumption iscalculated using the vehicle speed andMAF readings Figure 3shows the vehicle speed andMAF taken for the Ford Fusion inreal amount of fuel parameters and vehicle speed as calculated

in equation (1) Fuel consumption figure has been used as areference to be compared with the estimation models of TPS(throttle position sensor) and RPM figures as being discussedlater in this work Table 4 shows the overall fuel consumptionof the three vehicles as opposed to fuel consumption ratesprovided with the manufacturerrsquos datasheet

)emanufacturer claimed consumption values are takenin relatively optimal conditions such as the vehicle should bedriven on flat roads rather than curvy steep hills the vehiclerides using reasonably thinner tires as opposed to the lessefficient but sporty wider tires and finally only premiumgasoline grade must be used By looking at Table 4 the actualfuel consumption numbers suggest that in some commuteconditions it is feasible to use vehicles with big displacement

Table 1 OBD-II standard pins description

PIN Description PIN Description1 Vendor option 9 Vendor option2 J1850 bus+ 10 J1850 bus3 Vendor option 11 Vendor option4 Chassis ground 12 Vendor option5 Signal ground 13 Vendor option6 CAN (J-2234) high 14 CAN (J-2234) low7 ISO 9141-2 K-Line 15 ISO 9141-2 low8 Vendor option 16 Battery power

Table 2 Some PID codes and their meaning

PID Description Number of bytes Scale Units05 Engine coolant temperature 1 byte 1 degC0A Fuel pressure 1 byte 3 Kilopascal (kPa)0B Intake manifold pressure 1 byte 1 kPa0C Engine RPM 2 bytes 025 rpm0D Vehicle speed 1 byte 1 kmh0E Timing advance 1 byte 05 degrees0F Intake air temperature 1 byte 1 degC10 MAF air flow rate 2 bytes 001 gs11 )rottle position 1 byte 03922 1F Run time since engine start 2 bytes 1 Seconds

P1

P2

OBD-II

Figure 1 OBD-II male and female connectors

Table 3 Test vehicles

Make Weight (Kg) Sizetype Engine displacement (liters) Horsepower2017 Ford Fusion 1650 Midsizesedan 4-Cylinder 20 1762006 Mercedes-Benz E280 1885 Midsizesedan 6-Cylinder 30 2312016 Toyota Camry 1620 Midsizesedan 4-Cylinder 24 180

4 Journal of Robotics

engines )e 3-liter engine in the case of the Mercedes isslightly more feasible than the 20-liter one in the FordFusion

5 Modeling Fuel Consumption

Besides showing a comparison of fuel consumption for thetested vehicles another objective is to model fuel con-sumption in terms of TPS and RPM readings One of thetypical methods is to use machine learning techniquesSometimes when sketching relationships between two var-iables the relations between variables can be visually ob-served however such relations may not be easy to modelneither easy to find the given equation SVM is one classifierthat is used to generate either a linear on a nonlinearmapping function for a given dataset called training setGiven a set of training each set is assigned to one categorycalled class of data SVM tries to separate these categoryclasses evenly using equal and maximum margin calledhyperplane)e initial form of SVM is a binary classificationwhich classifies data into two categories To implementmulticlass classification multiple binary classifiers can beused to integrate one or more categories Figure 4 illustratesthe SVM learning process for this particular system

)e set of data that has to be modeled in order to let thesystem learn the driving behavior are throttle position andvehicle speed A total of 160 samples (x and y values) werecollected from the vehicles Table 5 shows a sample of thecollected data from OBD-II

)e SVM algorithm should be given a training dataset ofpoints In this case the X-axis is TPS and RPM)e Y-axis isfuel consumption )e algorithm generates a line that in-dicates the class (group) to which the point belongs Let ussuppose x

rarri is a real vector of size n )e SVM finds the

maximum margin line called ldquohyperplanerdquo that divides thegroup of points almost evenly Hyperplane is defined so thatthe distance between the hyperplane and the nearest pointfrom either group is maximized [27]

51 Lagrange Interpolation Lagrange interpolation poly-nomial is used to generate polynomial functions for nu-merical analysis and curve fitting )e interpolatingpolynomial of the least degree is preferred as long as thetradeoff between the oscillation and accuracy is minimizedas the fitting curve is exhibited between the data pointsLagrange polynomial is applied separately for TPS andRPM (X-coordinates) with respect to time thus Y-valueswill be predicted when the training data follows a particularpattern For Y-coordinate Px(t) the following expression(2) is used

Px(t) Ln0(t)fx t0( 1113857 + Ln1(t)fx t1( 1113857 + + Lnn(t)fx tn( 1113857

1113944n

k0Lnk(t)fx tk( 1113857

(2)

where

Lnk(t) 1113945n

i0

t minus ti

tk minus ti

Lnk ti( 1113857 0

Lnk tk( 1113857 1

(3)

In the above formula fx(tk) represents x-coordinateof the location at time tk So the interpolation is per-formed for x-coordinate against the independent variablet )e sample dataset shown in Table 5 is fed to the aboveequation )e training set has n points represented as(x1 y1) (xn yn) let us suppose that y are the fuelconsumption values Multiple vectors x

rarri specify the best

fitting by determining different classes of data Lagrangefinds the best points which form a line that divides thecollection of x

rarri vectors based on values of yi

primes out of thecollection)e resulted model shows a fitted curve that liesevenly between the hyperplane and the nearest x

rarri vectors

Hence the hyperplane is expressed as a set of points xrarr

which satisfy the following equation

wrarr

middot xrarr

minus b 0 (4)

where wrarr is the hyperplane and b is a constant In our case

the data are gathered using observations rather thanmathematically described relationships and hence they areconsidered to be empirical models Based on these obser-vations the following section brings up the evaluation of thepredicted models

Ramtha

Sweileh

66km

Figure 2 Driving route

Journal of Robotics 5

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 2: Fuel Consumption Using OBD-II and Support Vector Machine …

three vehicles each of which has different engine dis-placements using machine learning prediction Whileevaluating the vehicles it is also worth comparing them interms of fuel efficiency as an attempt to answer the questionthat ldquowould the type of the vehicle help improving gasmileage over a specific terrainrdquo In other words ldquowould avehicle with a bigger displacement engine be more efficientthan vehicles with relatively smaller engines when driven inthe same conditionsrdquo

)is paper presents an overview of the related work andcontribution in Section 2 A discussion of the OBD-II systemis presented in Section 3 followed by a brief description ofthe PIDs found in the OBD-II connector Section 4 showsthe experiment details and discusses fuel economy for thetest vehicles Section 51 gives an overview of the proposedmethod Section 52 presents the results of predictionequations and fuel consumption validation for the vehiclesfollowed by the conclusion in Section 6

2 Literature Review and Contribution

Meanwhile until alternate power vehicles are mass-pro-duced efficient utilization of fuel is the current concern [4]Taking this into consideration economical driving (or eco-drive) is one of the effective methods that can be very usefulAs it is mentioned earlier economical driving can be definedas a driving style that does not put unnecessary load on theengine Although most modern vehicles are equipped withonboard economy-mode feature many driving manners canbe of great influence to minimize fuel consumption whiledriving Researchers who expertise in vehicular engineeringhave had special interest in developing methods for fuelemissions over a driving cycle Alessandrini et al [5] forexample were interested in creating a newmethod that givesmore precise description of the relationship between fuelconsumption and the road network or specific usersEricsson [6] explains that fuel can be saved by avoidingsudden changes in acceleration and high-speed drivingdefinitely consumes more fuel Instead driving styles shouldinclude upshifting to a higher speed at the right timeavoiding speeds that exceed 100 kmh anticipating trafficflow accelerating and decelerating smoothly with minimalusage of brakes and keeping the vehicle in good mechanicalcondition Meseguer et al [7] suggest maintaining less-frequent tendency for deceleration followed by accelerationminimizing the use of low gears and trying to get to highestavailable gears as soon as possible while avoiding contin-uous gear changes Differentmobile eco-driving applicationshave been introduced to help improve fuel economy [8ndash10]Alternatively fuel consumption is greatly affected by thenature of the route on which the vehicle is commuting on thedaily basis

From computer science perspective this work tries todevelop a new method to calculate real-time fuel con-sumption based on two OBD parameters and to validate theresults against the conventional method which is restrictedtoMAF (mass air flow) and vehicle speeds readings only)eprevious paragraph summarizes research topics on fuelconsumption in general however it is also important to

include what actual parameters and methods that have beenintroduced by different authors who investigated fuelconsumption in vehicles

)ere have been several state-of-the-art papers thatpropose a set of parameters that can be used to calculate fuelconsumption One of the main categories is identifying suchvariables Xaio et al [11] presented a formula to computefuel consumption rate (FCR) function by analyzing datafigures of various factors and then provided examples toshow the different results without considering TPS as afactor affecting fuel consumption Other authors likeSyahputra [12] and Langari and Won [13] increased thenumber of parameters and introduced neuro-fuzzy methodsin order to improve the obtained results Beside these re-searches that deal with variables to estimate fuel con-sumption the current state-of-the-art models offer anestimation of fuel consumption based on typical urbandriving behavior Moreover Most of these models presentsimplified mathematical equations [12 14] Others intro-duced approaches to compute fuel and emission rates arebased on average link speeds [15 16]

)e second category is the approaches that use machinelearning Chen et al [17] were interested in analyzing thedriving behavior using machine learning classifier )eyused the classical AdaBoost algorithm along with infor-mation from the ECU to determine whether or not thedriving behavior is a fuel-saver Wong et al [18] also used amachine learning classifier but only to predict air-fuelmixture optimum for best fuel economy Different tools aredesigned to collect data in real-time from the OBD-II Inconjunction with an exhaust analyzer Ortenzi and Cos-tagliola [19] have created consumption and emission modelsdeveloped for vehicles with gasoline engines It is also worthmentioning that several mobile applications combined withdedicated devices are available that can read and monitormultiple values such as fuel consumption and engine pa-rameters using OBD-II Apart from such devices someprograms work by measuring the instantaneous consump-tion using different approaches such as neural networks [20]while the others focuses on the setting standards foremissions such as Copert III [21]

)e consensus point in most of the previous proposals isthat they involve MAF readings in their techniques Justrelying on such values have the disadvantage in cases whengas pedal movement has an influence on the air-fuel ratiobut it remains stable around the fixed value when the ac-celerator is being slightly depressed but it changes withharsh accelerating behavior In some circumstances MAFremains unchanged when throttle position rotates in smallangles and sometimes stays still despite that engine load ischanging in bigger amounts that do necessarily match thechanges in throttle position One more difference is thatmost of the researches towards vehicular technology focuson analyzing variable data from ECU to creating softwareprogramsmobile applications that informs the driverwhether his driving style is economical )is work howeverdoes not create a program but it tries to propose newmethodto fuel consumption based on a combination of training dataset

2 Journal of Robotics

3 OBD-II Standard

)e onboard diagnostic (OBD) standard was developed inthe United States basically to help detecting engine mal-functions )e primary objective of having such system is todetect any increase of the harmful gas emissions that exceedsome acceptable limits )e system works by continuouslymonitoring various sensors dedicated to send electricalsignals as a feedback to the vehiclersquos main ECU Such sensorsmonitor the engine management functions more specifi-cally these sensors are responsible to detect airfuel volumeso the ECU can precisely determine the accurate mixture inreal-time Other sensors also contribute to airfuel mixturesuch as oxygen sensor and MAF sensor An OBD scanner isused to communicate with the vehiclesrsquo ECU )e OBDscanner is a tool to diagnose problems on the vehiclesrsquoelectrical and emission systems When a failure is detectedthe ECU stores faulty code in memory so that it can be readby the scanner

)e first OBD standard known as OBD-I was designedto monitor relatively fewer parameters when compared withOBD-II When fuel-injection systems have emerged in theautomotive industry OBD-I was mainly focused ondetecting faulty errors in the enginesrsquo ignition emission andinjection systems )e diagnosing technique then was basicand OBD-I did not set a standard for acceptable emissionlevel for vehicles)erefore the situation of running too richor too lean which increases fuel consumption would not bedetected Ignition systems back then were not as sophisti-cated and advanced as we have today Many other nonengineelectrical error codes were not included in the standardFailures were just expressed as a visual warning to the driverand the error is stored in the ECUrsquos memory )e secondgeneration of OBD known as OBD-II has set standards formore components such as the plug and the connector usedfor diagnostic the diagnostic trouble codes (DTCs) and thesignaling protocols on the controller area network (CAN)bus Additionally the detailed list of DTCs (diagnostictrouble codes) is also defined in the standard OBD-IIstandard also defined parameters that can be monitored andassigned a code (Identification ID) to each parameter (PID)Several subsystem interaction modes are also set by theOBD-II standard to offer a straight-forward interaction withthe vehiclersquos systems such as the heating and ventilationsystems transmission system and enginechassis systemthus allowing for more accurate diagnosis depending onfunctionality Well-known automobile manufacturers suchas Daimler Mercedes and BMW have introduced additionalinteraction modes that are specific to their vehicles thusoffering a full control of the vehiclersquos functionality )eEuropean regulations equivalent to the OBD-II standardknown as EOBD set a standard for fault codes whichconsists of five characters a letter followed by four numbersEOBD and OBD-II have the same connectors and interfacesFigure 1 shows an example of both male and female OBD-IIconnectors In this particular scan device the female con-nector is a part of a CDP AutoCom OBD-II [22] device thatoffers a connection between the vehiclersquos internal bus and apersonal computer using a Bluetooth connection

A Schematic description of OBD-II female connectorPINS is shown in Table 1 [23]

Table 2 shows a list of some OBD-II PIDs defined by SAEJ1979 standard that can be used in the experiment )edescription for each PID is given along with information onthe number of bytes and the units of each PID [24]

4 The Experiment

Many commercial OBD-II scanners are available in themarket Some are equipped with Bluetooth connectionwhich allows the scanner to communicate wirelessly withcorresponding software installed on a PC or a mobile ap-plication As mentioned in Section 3 CDP Autocom scantool is one of the available OBD-II scanners CDP Autocomis manufactured by Delphi a Swedish automotive tech-nologies and solutions )e Autocom scanner supports allOBD-II compliant vehicles however it is not compatiblewith the diagnostic software written for the ELM327-basedinterfaces )e ELM327 is an interface installed on anadapter designed to act as a bridge between OBD-II port andthe standard RS-232 interface

)ree test vehicles are put into test 2017 Ford Fusion2016 Toyota Camry LX and 2006 Mercedes-Benz e280 Allof these vehicles are midsized sedans and their engines arenaturally aspirated which means that they are not turbo-boosted In this experiment we tried to avoid turbo enginesTurbo engines tend to consume more fuel because of theconsequent result of turbo lag It is also interesting tomention that almost all passenger cars used in Jordan run ongasoline Table 3 shows some of their characteristics whichdirectly affect the overall gas consumption such as weightoverall size and their enginersquos displacements Each enginersquoshorsepower is also a key factor in this context All threevehicles have automatic transmission and run on gasoline

)e driving route connects Sweileh-Amman and Ram-tha and it is about 66 kilometers long One of the maincharacteristics of this road is its steep nature thereforevehicles would struggle to go uphill on such freeway Fig-ure 2 shows the intended route

Typically modern gasoline injection systems use twooxygen (lambda) sensors one mounted right after the en-ginersquos manifold and the other one is fitted on the exhaustpipe just before the catalytic convertor Both sensors sendfeedback data to the vehiclersquos ECU in order to estimate theair to fuel ratio )is ratio is predetermined chemically atideal value of 147 grams of air to every gram of gasoline [25])eMAF is the amount of air sucked by the engine in gramsper second)erefore if MAF value is known the amount offuel can be calculated by converting the MAF value togallons per hour and then calculate miles per gallon )e-oretically fuel consumption f can be calculated using thefollowing equation

f vs times αMAF

times β (1)

where vs is the vehicle speed in kmhour MAF is the massair flow in gs α 7718 is a constant to convert the value off to US MPG (miles per gallons) and β is a constant to

Journal of Robotics 3

convert MPG to liters per 100 km However vehicle speedand MAF readings cannot be sufficient for precise estima-tion fuel consumption is also affected by the throttle angleRotation of the throttle is responsible for determining theamount of fuel flow to the combustion chamber For thatreason this work tries to estimate fuel consumption basedon additional variables such as TPS

)e three vehicles are put to test on the route shownabove Discussion below brings up the real-time figures ofengine and vehicle speed in a 40-minute duration

Using equation (1) the instantaneous fuel consumption iscalculated using the vehicle speed andMAF readings Figure 3shows the vehicle speed andMAF taken for the Ford Fusion inreal amount of fuel parameters and vehicle speed as calculated

in equation (1) Fuel consumption figure has been used as areference to be compared with the estimation models of TPS(throttle position sensor) and RPM figures as being discussedlater in this work Table 4 shows the overall fuel consumptionof the three vehicles as opposed to fuel consumption ratesprovided with the manufacturerrsquos datasheet

)emanufacturer claimed consumption values are takenin relatively optimal conditions such as the vehicle should bedriven on flat roads rather than curvy steep hills the vehiclerides using reasonably thinner tires as opposed to the lessefficient but sporty wider tires and finally only premiumgasoline grade must be used By looking at Table 4 the actualfuel consumption numbers suggest that in some commuteconditions it is feasible to use vehicles with big displacement

Table 1 OBD-II standard pins description

PIN Description PIN Description1 Vendor option 9 Vendor option2 J1850 bus+ 10 J1850 bus3 Vendor option 11 Vendor option4 Chassis ground 12 Vendor option5 Signal ground 13 Vendor option6 CAN (J-2234) high 14 CAN (J-2234) low7 ISO 9141-2 K-Line 15 ISO 9141-2 low8 Vendor option 16 Battery power

Table 2 Some PID codes and their meaning

PID Description Number of bytes Scale Units05 Engine coolant temperature 1 byte 1 degC0A Fuel pressure 1 byte 3 Kilopascal (kPa)0B Intake manifold pressure 1 byte 1 kPa0C Engine RPM 2 bytes 025 rpm0D Vehicle speed 1 byte 1 kmh0E Timing advance 1 byte 05 degrees0F Intake air temperature 1 byte 1 degC10 MAF air flow rate 2 bytes 001 gs11 )rottle position 1 byte 03922 1F Run time since engine start 2 bytes 1 Seconds

P1

P2

OBD-II

Figure 1 OBD-II male and female connectors

Table 3 Test vehicles

Make Weight (Kg) Sizetype Engine displacement (liters) Horsepower2017 Ford Fusion 1650 Midsizesedan 4-Cylinder 20 1762006 Mercedes-Benz E280 1885 Midsizesedan 6-Cylinder 30 2312016 Toyota Camry 1620 Midsizesedan 4-Cylinder 24 180

4 Journal of Robotics

engines )e 3-liter engine in the case of the Mercedes isslightly more feasible than the 20-liter one in the FordFusion

5 Modeling Fuel Consumption

Besides showing a comparison of fuel consumption for thetested vehicles another objective is to model fuel con-sumption in terms of TPS and RPM readings One of thetypical methods is to use machine learning techniquesSometimes when sketching relationships between two var-iables the relations between variables can be visually ob-served however such relations may not be easy to modelneither easy to find the given equation SVM is one classifierthat is used to generate either a linear on a nonlinearmapping function for a given dataset called training setGiven a set of training each set is assigned to one categorycalled class of data SVM tries to separate these categoryclasses evenly using equal and maximum margin calledhyperplane)e initial form of SVM is a binary classificationwhich classifies data into two categories To implementmulticlass classification multiple binary classifiers can beused to integrate one or more categories Figure 4 illustratesthe SVM learning process for this particular system

)e set of data that has to be modeled in order to let thesystem learn the driving behavior are throttle position andvehicle speed A total of 160 samples (x and y values) werecollected from the vehicles Table 5 shows a sample of thecollected data from OBD-II

)e SVM algorithm should be given a training dataset ofpoints In this case the X-axis is TPS and RPM)e Y-axis isfuel consumption )e algorithm generates a line that in-dicates the class (group) to which the point belongs Let ussuppose x

rarri is a real vector of size n )e SVM finds the

maximum margin line called ldquohyperplanerdquo that divides thegroup of points almost evenly Hyperplane is defined so thatthe distance between the hyperplane and the nearest pointfrom either group is maximized [27]

51 Lagrange Interpolation Lagrange interpolation poly-nomial is used to generate polynomial functions for nu-merical analysis and curve fitting )e interpolatingpolynomial of the least degree is preferred as long as thetradeoff between the oscillation and accuracy is minimizedas the fitting curve is exhibited between the data pointsLagrange polynomial is applied separately for TPS andRPM (X-coordinates) with respect to time thus Y-valueswill be predicted when the training data follows a particularpattern For Y-coordinate Px(t) the following expression(2) is used

Px(t) Ln0(t)fx t0( 1113857 + Ln1(t)fx t1( 1113857 + + Lnn(t)fx tn( 1113857

1113944n

k0Lnk(t)fx tk( 1113857

(2)

where

Lnk(t) 1113945n

i0

t minus ti

tk minus ti

Lnk ti( 1113857 0

Lnk tk( 1113857 1

(3)

In the above formula fx(tk) represents x-coordinateof the location at time tk So the interpolation is per-formed for x-coordinate against the independent variablet )e sample dataset shown in Table 5 is fed to the aboveequation )e training set has n points represented as(x1 y1) (xn yn) let us suppose that y are the fuelconsumption values Multiple vectors x

rarri specify the best

fitting by determining different classes of data Lagrangefinds the best points which form a line that divides thecollection of x

rarri vectors based on values of yi

primes out of thecollection)e resulted model shows a fitted curve that liesevenly between the hyperplane and the nearest x

rarri vectors

Hence the hyperplane is expressed as a set of points xrarr

which satisfy the following equation

wrarr

middot xrarr

minus b 0 (4)

where wrarr is the hyperplane and b is a constant In our case

the data are gathered using observations rather thanmathematically described relationships and hence they areconsidered to be empirical models Based on these obser-vations the following section brings up the evaluation of thepredicted models

Ramtha

Sweileh

66km

Figure 2 Driving route

Journal of Robotics 5

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 3: Fuel Consumption Using OBD-II and Support Vector Machine …

3 OBD-II Standard

)e onboard diagnostic (OBD) standard was developed inthe United States basically to help detecting engine mal-functions )e primary objective of having such system is todetect any increase of the harmful gas emissions that exceedsome acceptable limits )e system works by continuouslymonitoring various sensors dedicated to send electricalsignals as a feedback to the vehiclersquos main ECU Such sensorsmonitor the engine management functions more specifi-cally these sensors are responsible to detect airfuel volumeso the ECU can precisely determine the accurate mixture inreal-time Other sensors also contribute to airfuel mixturesuch as oxygen sensor and MAF sensor An OBD scanner isused to communicate with the vehiclesrsquo ECU )e OBDscanner is a tool to diagnose problems on the vehiclesrsquoelectrical and emission systems When a failure is detectedthe ECU stores faulty code in memory so that it can be readby the scanner

)e first OBD standard known as OBD-I was designedto monitor relatively fewer parameters when compared withOBD-II When fuel-injection systems have emerged in theautomotive industry OBD-I was mainly focused ondetecting faulty errors in the enginesrsquo ignition emission andinjection systems )e diagnosing technique then was basicand OBD-I did not set a standard for acceptable emissionlevel for vehicles)erefore the situation of running too richor too lean which increases fuel consumption would not bedetected Ignition systems back then were not as sophisti-cated and advanced as we have today Many other nonengineelectrical error codes were not included in the standardFailures were just expressed as a visual warning to the driverand the error is stored in the ECUrsquos memory )e secondgeneration of OBD known as OBD-II has set standards formore components such as the plug and the connector usedfor diagnostic the diagnostic trouble codes (DTCs) and thesignaling protocols on the controller area network (CAN)bus Additionally the detailed list of DTCs (diagnostictrouble codes) is also defined in the standard OBD-IIstandard also defined parameters that can be monitored andassigned a code (Identification ID) to each parameter (PID)Several subsystem interaction modes are also set by theOBD-II standard to offer a straight-forward interaction withthe vehiclersquos systems such as the heating and ventilationsystems transmission system and enginechassis systemthus allowing for more accurate diagnosis depending onfunctionality Well-known automobile manufacturers suchas Daimler Mercedes and BMW have introduced additionalinteraction modes that are specific to their vehicles thusoffering a full control of the vehiclersquos functionality )eEuropean regulations equivalent to the OBD-II standardknown as EOBD set a standard for fault codes whichconsists of five characters a letter followed by four numbersEOBD and OBD-II have the same connectors and interfacesFigure 1 shows an example of both male and female OBD-IIconnectors In this particular scan device the female con-nector is a part of a CDP AutoCom OBD-II [22] device thatoffers a connection between the vehiclersquos internal bus and apersonal computer using a Bluetooth connection

A Schematic description of OBD-II female connectorPINS is shown in Table 1 [23]

Table 2 shows a list of some OBD-II PIDs defined by SAEJ1979 standard that can be used in the experiment )edescription for each PID is given along with information onthe number of bytes and the units of each PID [24]

4 The Experiment

Many commercial OBD-II scanners are available in themarket Some are equipped with Bluetooth connectionwhich allows the scanner to communicate wirelessly withcorresponding software installed on a PC or a mobile ap-plication As mentioned in Section 3 CDP Autocom scantool is one of the available OBD-II scanners CDP Autocomis manufactured by Delphi a Swedish automotive tech-nologies and solutions )e Autocom scanner supports allOBD-II compliant vehicles however it is not compatiblewith the diagnostic software written for the ELM327-basedinterfaces )e ELM327 is an interface installed on anadapter designed to act as a bridge between OBD-II port andthe standard RS-232 interface

)ree test vehicles are put into test 2017 Ford Fusion2016 Toyota Camry LX and 2006 Mercedes-Benz e280 Allof these vehicles are midsized sedans and their engines arenaturally aspirated which means that they are not turbo-boosted In this experiment we tried to avoid turbo enginesTurbo engines tend to consume more fuel because of theconsequent result of turbo lag It is also interesting tomention that almost all passenger cars used in Jordan run ongasoline Table 3 shows some of their characteristics whichdirectly affect the overall gas consumption such as weightoverall size and their enginersquos displacements Each enginersquoshorsepower is also a key factor in this context All threevehicles have automatic transmission and run on gasoline

)e driving route connects Sweileh-Amman and Ram-tha and it is about 66 kilometers long One of the maincharacteristics of this road is its steep nature thereforevehicles would struggle to go uphill on such freeway Fig-ure 2 shows the intended route

Typically modern gasoline injection systems use twooxygen (lambda) sensors one mounted right after the en-ginersquos manifold and the other one is fitted on the exhaustpipe just before the catalytic convertor Both sensors sendfeedback data to the vehiclersquos ECU in order to estimate theair to fuel ratio )is ratio is predetermined chemically atideal value of 147 grams of air to every gram of gasoline [25])eMAF is the amount of air sucked by the engine in gramsper second)erefore if MAF value is known the amount offuel can be calculated by converting the MAF value togallons per hour and then calculate miles per gallon )e-oretically fuel consumption f can be calculated using thefollowing equation

f vs times αMAF

times β (1)

where vs is the vehicle speed in kmhour MAF is the massair flow in gs α 7718 is a constant to convert the value off to US MPG (miles per gallons) and β is a constant to

Journal of Robotics 3

convert MPG to liters per 100 km However vehicle speedand MAF readings cannot be sufficient for precise estima-tion fuel consumption is also affected by the throttle angleRotation of the throttle is responsible for determining theamount of fuel flow to the combustion chamber For thatreason this work tries to estimate fuel consumption basedon additional variables such as TPS

)e three vehicles are put to test on the route shownabove Discussion below brings up the real-time figures ofengine and vehicle speed in a 40-minute duration

Using equation (1) the instantaneous fuel consumption iscalculated using the vehicle speed andMAF readings Figure 3shows the vehicle speed andMAF taken for the Ford Fusion inreal amount of fuel parameters and vehicle speed as calculated

in equation (1) Fuel consumption figure has been used as areference to be compared with the estimation models of TPS(throttle position sensor) and RPM figures as being discussedlater in this work Table 4 shows the overall fuel consumptionof the three vehicles as opposed to fuel consumption ratesprovided with the manufacturerrsquos datasheet

)emanufacturer claimed consumption values are takenin relatively optimal conditions such as the vehicle should bedriven on flat roads rather than curvy steep hills the vehiclerides using reasonably thinner tires as opposed to the lessefficient but sporty wider tires and finally only premiumgasoline grade must be used By looking at Table 4 the actualfuel consumption numbers suggest that in some commuteconditions it is feasible to use vehicles with big displacement

Table 1 OBD-II standard pins description

PIN Description PIN Description1 Vendor option 9 Vendor option2 J1850 bus+ 10 J1850 bus3 Vendor option 11 Vendor option4 Chassis ground 12 Vendor option5 Signal ground 13 Vendor option6 CAN (J-2234) high 14 CAN (J-2234) low7 ISO 9141-2 K-Line 15 ISO 9141-2 low8 Vendor option 16 Battery power

Table 2 Some PID codes and their meaning

PID Description Number of bytes Scale Units05 Engine coolant temperature 1 byte 1 degC0A Fuel pressure 1 byte 3 Kilopascal (kPa)0B Intake manifold pressure 1 byte 1 kPa0C Engine RPM 2 bytes 025 rpm0D Vehicle speed 1 byte 1 kmh0E Timing advance 1 byte 05 degrees0F Intake air temperature 1 byte 1 degC10 MAF air flow rate 2 bytes 001 gs11 )rottle position 1 byte 03922 1F Run time since engine start 2 bytes 1 Seconds

P1

P2

OBD-II

Figure 1 OBD-II male and female connectors

Table 3 Test vehicles

Make Weight (Kg) Sizetype Engine displacement (liters) Horsepower2017 Ford Fusion 1650 Midsizesedan 4-Cylinder 20 1762006 Mercedes-Benz E280 1885 Midsizesedan 6-Cylinder 30 2312016 Toyota Camry 1620 Midsizesedan 4-Cylinder 24 180

4 Journal of Robotics

engines )e 3-liter engine in the case of the Mercedes isslightly more feasible than the 20-liter one in the FordFusion

5 Modeling Fuel Consumption

Besides showing a comparison of fuel consumption for thetested vehicles another objective is to model fuel con-sumption in terms of TPS and RPM readings One of thetypical methods is to use machine learning techniquesSometimes when sketching relationships between two var-iables the relations between variables can be visually ob-served however such relations may not be easy to modelneither easy to find the given equation SVM is one classifierthat is used to generate either a linear on a nonlinearmapping function for a given dataset called training setGiven a set of training each set is assigned to one categorycalled class of data SVM tries to separate these categoryclasses evenly using equal and maximum margin calledhyperplane)e initial form of SVM is a binary classificationwhich classifies data into two categories To implementmulticlass classification multiple binary classifiers can beused to integrate one or more categories Figure 4 illustratesthe SVM learning process for this particular system

)e set of data that has to be modeled in order to let thesystem learn the driving behavior are throttle position andvehicle speed A total of 160 samples (x and y values) werecollected from the vehicles Table 5 shows a sample of thecollected data from OBD-II

)e SVM algorithm should be given a training dataset ofpoints In this case the X-axis is TPS and RPM)e Y-axis isfuel consumption )e algorithm generates a line that in-dicates the class (group) to which the point belongs Let ussuppose x

rarri is a real vector of size n )e SVM finds the

maximum margin line called ldquohyperplanerdquo that divides thegroup of points almost evenly Hyperplane is defined so thatthe distance between the hyperplane and the nearest pointfrom either group is maximized [27]

51 Lagrange Interpolation Lagrange interpolation poly-nomial is used to generate polynomial functions for nu-merical analysis and curve fitting )e interpolatingpolynomial of the least degree is preferred as long as thetradeoff between the oscillation and accuracy is minimizedas the fitting curve is exhibited between the data pointsLagrange polynomial is applied separately for TPS andRPM (X-coordinates) with respect to time thus Y-valueswill be predicted when the training data follows a particularpattern For Y-coordinate Px(t) the following expression(2) is used

Px(t) Ln0(t)fx t0( 1113857 + Ln1(t)fx t1( 1113857 + + Lnn(t)fx tn( 1113857

1113944n

k0Lnk(t)fx tk( 1113857

(2)

where

Lnk(t) 1113945n

i0

t minus ti

tk minus ti

Lnk ti( 1113857 0

Lnk tk( 1113857 1

(3)

In the above formula fx(tk) represents x-coordinateof the location at time tk So the interpolation is per-formed for x-coordinate against the independent variablet )e sample dataset shown in Table 5 is fed to the aboveequation )e training set has n points represented as(x1 y1) (xn yn) let us suppose that y are the fuelconsumption values Multiple vectors x

rarri specify the best

fitting by determining different classes of data Lagrangefinds the best points which form a line that divides thecollection of x

rarri vectors based on values of yi

primes out of thecollection)e resulted model shows a fitted curve that liesevenly between the hyperplane and the nearest x

rarri vectors

Hence the hyperplane is expressed as a set of points xrarr

which satisfy the following equation

wrarr

middot xrarr

minus b 0 (4)

where wrarr is the hyperplane and b is a constant In our case

the data are gathered using observations rather thanmathematically described relationships and hence they areconsidered to be empirical models Based on these obser-vations the following section brings up the evaluation of thepredicted models

Ramtha

Sweileh

66km

Figure 2 Driving route

Journal of Robotics 5

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 4: Fuel Consumption Using OBD-II and Support Vector Machine …

convert MPG to liters per 100 km However vehicle speedand MAF readings cannot be sufficient for precise estima-tion fuel consumption is also affected by the throttle angleRotation of the throttle is responsible for determining theamount of fuel flow to the combustion chamber For thatreason this work tries to estimate fuel consumption basedon additional variables such as TPS

)e three vehicles are put to test on the route shownabove Discussion below brings up the real-time figures ofengine and vehicle speed in a 40-minute duration

Using equation (1) the instantaneous fuel consumption iscalculated using the vehicle speed andMAF readings Figure 3shows the vehicle speed andMAF taken for the Ford Fusion inreal amount of fuel parameters and vehicle speed as calculated

in equation (1) Fuel consumption figure has been used as areference to be compared with the estimation models of TPS(throttle position sensor) and RPM figures as being discussedlater in this work Table 4 shows the overall fuel consumptionof the three vehicles as opposed to fuel consumption ratesprovided with the manufacturerrsquos datasheet

)emanufacturer claimed consumption values are takenin relatively optimal conditions such as the vehicle should bedriven on flat roads rather than curvy steep hills the vehiclerides using reasonably thinner tires as opposed to the lessefficient but sporty wider tires and finally only premiumgasoline grade must be used By looking at Table 4 the actualfuel consumption numbers suggest that in some commuteconditions it is feasible to use vehicles with big displacement

Table 1 OBD-II standard pins description

PIN Description PIN Description1 Vendor option 9 Vendor option2 J1850 bus+ 10 J1850 bus3 Vendor option 11 Vendor option4 Chassis ground 12 Vendor option5 Signal ground 13 Vendor option6 CAN (J-2234) high 14 CAN (J-2234) low7 ISO 9141-2 K-Line 15 ISO 9141-2 low8 Vendor option 16 Battery power

Table 2 Some PID codes and their meaning

PID Description Number of bytes Scale Units05 Engine coolant temperature 1 byte 1 degC0A Fuel pressure 1 byte 3 Kilopascal (kPa)0B Intake manifold pressure 1 byte 1 kPa0C Engine RPM 2 bytes 025 rpm0D Vehicle speed 1 byte 1 kmh0E Timing advance 1 byte 05 degrees0F Intake air temperature 1 byte 1 degC10 MAF air flow rate 2 bytes 001 gs11 )rottle position 1 byte 03922 1F Run time since engine start 2 bytes 1 Seconds

P1

P2

OBD-II

Figure 1 OBD-II male and female connectors

Table 3 Test vehicles

Make Weight (Kg) Sizetype Engine displacement (liters) Horsepower2017 Ford Fusion 1650 Midsizesedan 4-Cylinder 20 1762006 Mercedes-Benz E280 1885 Midsizesedan 6-Cylinder 30 2312016 Toyota Camry 1620 Midsizesedan 4-Cylinder 24 180

4 Journal of Robotics

engines )e 3-liter engine in the case of the Mercedes isslightly more feasible than the 20-liter one in the FordFusion

5 Modeling Fuel Consumption

Besides showing a comparison of fuel consumption for thetested vehicles another objective is to model fuel con-sumption in terms of TPS and RPM readings One of thetypical methods is to use machine learning techniquesSometimes when sketching relationships between two var-iables the relations between variables can be visually ob-served however such relations may not be easy to modelneither easy to find the given equation SVM is one classifierthat is used to generate either a linear on a nonlinearmapping function for a given dataset called training setGiven a set of training each set is assigned to one categorycalled class of data SVM tries to separate these categoryclasses evenly using equal and maximum margin calledhyperplane)e initial form of SVM is a binary classificationwhich classifies data into two categories To implementmulticlass classification multiple binary classifiers can beused to integrate one or more categories Figure 4 illustratesthe SVM learning process for this particular system

)e set of data that has to be modeled in order to let thesystem learn the driving behavior are throttle position andvehicle speed A total of 160 samples (x and y values) werecollected from the vehicles Table 5 shows a sample of thecollected data from OBD-II

)e SVM algorithm should be given a training dataset ofpoints In this case the X-axis is TPS and RPM)e Y-axis isfuel consumption )e algorithm generates a line that in-dicates the class (group) to which the point belongs Let ussuppose x

rarri is a real vector of size n )e SVM finds the

maximum margin line called ldquohyperplanerdquo that divides thegroup of points almost evenly Hyperplane is defined so thatthe distance between the hyperplane and the nearest pointfrom either group is maximized [27]

51 Lagrange Interpolation Lagrange interpolation poly-nomial is used to generate polynomial functions for nu-merical analysis and curve fitting )e interpolatingpolynomial of the least degree is preferred as long as thetradeoff between the oscillation and accuracy is minimizedas the fitting curve is exhibited between the data pointsLagrange polynomial is applied separately for TPS andRPM (X-coordinates) with respect to time thus Y-valueswill be predicted when the training data follows a particularpattern For Y-coordinate Px(t) the following expression(2) is used

Px(t) Ln0(t)fx t0( 1113857 + Ln1(t)fx t1( 1113857 + + Lnn(t)fx tn( 1113857

1113944n

k0Lnk(t)fx tk( 1113857

(2)

where

Lnk(t) 1113945n

i0

t minus ti

tk minus ti

Lnk ti( 1113857 0

Lnk tk( 1113857 1

(3)

In the above formula fx(tk) represents x-coordinateof the location at time tk So the interpolation is per-formed for x-coordinate against the independent variablet )e sample dataset shown in Table 5 is fed to the aboveequation )e training set has n points represented as(x1 y1) (xn yn) let us suppose that y are the fuelconsumption values Multiple vectors x

rarri specify the best

fitting by determining different classes of data Lagrangefinds the best points which form a line that divides thecollection of x

rarri vectors based on values of yi

primes out of thecollection)e resulted model shows a fitted curve that liesevenly between the hyperplane and the nearest x

rarri vectors

Hence the hyperplane is expressed as a set of points xrarr

which satisfy the following equation

wrarr

middot xrarr

minus b 0 (4)

where wrarr is the hyperplane and b is a constant In our case

the data are gathered using observations rather thanmathematically described relationships and hence they areconsidered to be empirical models Based on these obser-vations the following section brings up the evaluation of thepredicted models

Ramtha

Sweileh

66km

Figure 2 Driving route

Journal of Robotics 5

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 5: Fuel Consumption Using OBD-II and Support Vector Machine …

engines )e 3-liter engine in the case of the Mercedes isslightly more feasible than the 20-liter one in the FordFusion

5 Modeling Fuel Consumption

Besides showing a comparison of fuel consumption for thetested vehicles another objective is to model fuel con-sumption in terms of TPS and RPM readings One of thetypical methods is to use machine learning techniquesSometimes when sketching relationships between two var-iables the relations between variables can be visually ob-served however such relations may not be easy to modelneither easy to find the given equation SVM is one classifierthat is used to generate either a linear on a nonlinearmapping function for a given dataset called training setGiven a set of training each set is assigned to one categorycalled class of data SVM tries to separate these categoryclasses evenly using equal and maximum margin calledhyperplane)e initial form of SVM is a binary classificationwhich classifies data into two categories To implementmulticlass classification multiple binary classifiers can beused to integrate one or more categories Figure 4 illustratesthe SVM learning process for this particular system

)e set of data that has to be modeled in order to let thesystem learn the driving behavior are throttle position andvehicle speed A total of 160 samples (x and y values) werecollected from the vehicles Table 5 shows a sample of thecollected data from OBD-II

)e SVM algorithm should be given a training dataset ofpoints In this case the X-axis is TPS and RPM)e Y-axis isfuel consumption )e algorithm generates a line that in-dicates the class (group) to which the point belongs Let ussuppose x

rarri is a real vector of size n )e SVM finds the

maximum margin line called ldquohyperplanerdquo that divides thegroup of points almost evenly Hyperplane is defined so thatthe distance between the hyperplane and the nearest pointfrom either group is maximized [27]

51 Lagrange Interpolation Lagrange interpolation poly-nomial is used to generate polynomial functions for nu-merical analysis and curve fitting )e interpolatingpolynomial of the least degree is preferred as long as thetradeoff between the oscillation and accuracy is minimizedas the fitting curve is exhibited between the data pointsLagrange polynomial is applied separately for TPS andRPM (X-coordinates) with respect to time thus Y-valueswill be predicted when the training data follows a particularpattern For Y-coordinate Px(t) the following expression(2) is used

Px(t) Ln0(t)fx t0( 1113857 + Ln1(t)fx t1( 1113857 + + Lnn(t)fx tn( 1113857

1113944n

k0Lnk(t)fx tk( 1113857

(2)

where

Lnk(t) 1113945n

i0

t minus ti

tk minus ti

Lnk ti( 1113857 0

Lnk tk( 1113857 1

(3)

In the above formula fx(tk) represents x-coordinateof the location at time tk So the interpolation is per-formed for x-coordinate against the independent variablet )e sample dataset shown in Table 5 is fed to the aboveequation )e training set has n points represented as(x1 y1) (xn yn) let us suppose that y are the fuelconsumption values Multiple vectors x

rarri specify the best

fitting by determining different classes of data Lagrangefinds the best points which form a line that divides thecollection of x

rarri vectors based on values of yi

primes out of thecollection)e resulted model shows a fitted curve that liesevenly between the hyperplane and the nearest x

rarri vectors

Hence the hyperplane is expressed as a set of points xrarr

which satisfy the following equation

wrarr

middot xrarr

minus b 0 (4)

where wrarr is the hyperplane and b is a constant In our case

the data are gathered using observations rather thanmathematically described relationships and hence they areconsidered to be empirical models Based on these obser-vations the following section brings up the evaluation of thepredicted models

Ramtha

Sweileh

66km

Figure 2 Driving route

Journal of Robotics 5

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 6: Fuel Consumption Using OBD-II and Support Vector Machine …

52 Evaluating Resulted Polynomials )e above SVMlearning algorithm is performed to fit the sample data into amathematical expression First in order to compare thevalues predicted by the Lagrange polynomial it is importantto obtain the estimated RPM TPS and fuel consumptionvalues Figure 5 demonstrates the fitting curve that reflectsthe relationship between the estimated fuel consumption

and RPM gathered during a particular duration in the testroute

Fuel consumption is measured in liters in multiples of10minus 4second )e RPM and fuel consumption regressionfunctions can be expressed by a quadratic model as shown inthe following equation

Fuelrpm ax2

+ bx + c (5)

where a 116885lowast eminus 7 b minus 705648lowast eminus 5 and c 0558One of the major factors that also affect fuel con-

sumption is how much the gas pedal is being depressed)e gas pedal is electronically connected the throttle lidwhich is responsible for the air massflow (MAF) MAFvalue is linearly correlated with TPS )e fuel con-sumption relationship with the TPS model is expressedby a linear polynomial as shown in the followingequation

(km

h)

0 500 1000 1500 2000 2500 3000Time (s)

Vehicle speed

140

120

100

80

60

40

20

0

(a)

(kg

h)

0 500 1000 1500 2000 2500 3000Time (s)

400

300

200

100

0

Air mass

(b)

Figure 3 (a) Vehicle speed (b) MAF Readings

Table 4 Obtained fuel consumption vs claimed fuel consumption

Vehicle Average fuel consumption (L100 km) Fuel consumption by the manufacturer (L100 km)[26]

2006 Mercedes e280 94 792017 Ford Fusion 97 712016 Toyota Camry 97 67

Driving parameterstraining data

Training datapreprocessing

Training datafusionmapping

Generating a model forfused data

Figure 4 SVM learning process

6 Journal of Robotics

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 7: Fuel Consumption Using OBD-II and Support Vector Machine …

FuelTPS ax + b (6)

where a 02425 and b 00692Combining the three parameters gives the opportunity

to develop a surface fitting model that can be expressed as

Fuelrpmtps p00x2

+ p10x + p01xy (7)

where the coefficients (with 95 confidence bounds) arep00 2685 (2307 3063) p10 minus 01246(minus 02398 minus 0009341) and p01 1243 (01095 2377)

)e Goodness of fit is as follows SSE 3266 R-square0004624 and root-mean-square error (RMSE) 181

Using surface fitting function in Matlab Figure 6 showsthe relationship between fuel consumption with TPS andRPM

Equation (2) is used to calculate fuel consumption valuesfor the training set using the same test route It is worthmentioning that maintaining a fixed ratio between vehiclespeed and engine speed is the key factor that minimizes fuelconsumption Figure 7 shows the predicted values and acomparison between the proposed SVM prediction modelusing RPM and the estimated fuel consumption valuescalculated using equation (1) In the figure it is seen that theproposed SVM successfully predicted fuel consumption withminor errors

TPS

3025201510

64

20

Fuel consumption L lowast10ndash41000 2000

RPM3000 4000 5000

x vs xxx yyy

Figure 6 Estimated fuel consumption vs RPM vs TPS

Table 5 Training data vehicle RPM and TPS

Time (seconds) Engine speed (RPM)(x-coordinate)

Vehiclespeed (kmh)

Engine TPS ()(x-coordinate)

Fuel consumption(10minus 4 litersecond)

10 630 12 15 0520 860 28 20 0630 1250 45 34 0940 1260 50 19 260 825 29 23 4570 420 30 23 19

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 55000

05

1

15

2

25

3

35

4

45

RPM

Fuel

cons

umpt

ion

(L times

10ndash4

)

DataFitted curve

Figure 5 Fuel consumption vs RPM

Journal of Robotics 7

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 8: Fuel Consumption Using OBD-II and Support Vector Machine …

RMSE is used to measure the differences in our methodand the conventional data model )ese differences can becalculated for each element or for the whole model As thefigure shows it is obvious that there are some errors that canbe numerically analyzed using RMSE as shown in the fol-lowing equation

RMSE

1113944

n

i1

SVMi minus conventionali( 11138572

n

11139741113972

(8)

After applying this method the final RMSE value is24364

6 Conclusion

A computer-based analysis of the onboard vehiclersquos pa-rameters has been exploited to demonstrate an estimation offuel consumption based on readings from the enginersquos RPMand TPS rather than relying on the conventional MAFreadings )e conventional method is based on measuringair volume regardless of the throttle position An SVMmodeling technique has been applied to derive values thatreflect the behavior of vehiclersquos consumption with respect toTPS and RPM )e SVM modeling is combined with aLagrange interpolation polynomial and linear functions topredict fuel consumption values )e predicted model iscompared with the data taken from the onboard OBD-II

Practically fuel consumption is affected by the enginersquosdisplacement RPM and TPS)e experiment has shown theextension by which the enginersquos displacement actually in-fluences fuel consumption )e results have shown that onspecific roads it is more feasible to use automobilesequipped with bigger engines than that of smaller dis-placements We plan to take advantage of the OBD-II pa-rameter monitoring interface to provide a morecomprehensive analysis of the ECU data and consequently

give a better perception of driving behavior and fueleconomy A more sophisticated scan tool that is specific to aparticular car make would give a set of new parameters to beelaborated )is would determine the nongeneric parame-ters which can be used in the future work other than TPS andengine RPM Having this in mind modeling a combinationof new PIDrsquos against the fuel being consumed is one in-spiration that can be accomplished in the future Anotherfuture work is to design a software that can be connected tothe ECU which can analyze all the malfunctions or errorsDTCrsquos that affect fuel consumption

Data Availability

)e data used to support the findings of this study are in-cluded within the article

Conflicts of Interest

)e authors declare no conflicts of interest

References

[1] D Wallace Environmental Policy and Industrial InnovationStrategies in Europe the USA and Japan Routledge Abing-don UK 2017

[2] C C Chan ldquo)e state of the art of electric hybrid and fuelcell vehiclesrdquo Proceedings of the IEEE vol 95 no 4pp 704ndash718 2007

[3] M Ahman ldquoGovernment policy and the development ofelectric vehicles in Japanrdquo Energy Policy vol 34 no 4pp 433ndash443 2006

[4] R Araujo A Igreja R de Castro and R E Araujo ldquoDrivingcoach a smartphone application to evaluate driving efficientpatternsrdquo in Proceedings of the Intelligent Vehicles Symposium(IV) pp 1005ndash1010 IEEE Alcala de Henares Spain June2012

[5] A Alessandrini F Filippi F Orecchini and F Ortenzi ldquoAnew method for collecting vehicle behaviour in daily use forenergy and environmental analysisrdquo Proceedings of the In-stitution of Mechanical Engineers Part D Journal of Auto-mobile Engineering vol 220 no 11 pp 1527ndash1537 2006

[6] E Ericsson ldquoIndependent driving pattern factors and theirinfluence on fuel-use and exhaust emission factorsrdquo Trans-portation Research Part D Transport and Environment vol 6no 5 pp 325ndash345 2001

[7] J E Meseguer C T Calafate J C Cano and P ManzonildquoDrivingstyles a smartphone application to assess driverbehaviorrdquo in Proceedings of the IEEE Symposium on Com-puters and Communications (ISCC) pp 000535ndash000540Split Croatia July 2013

[8] Y Saboohi and H Farzaneh ldquoModel for developing an eco-driving strategy of a passenger vehicle based on the least fuelconsumptionrdquo Applied Energy vol 86 no 10 pp 1925ndash19322009

[9] E Ericsson H Larsson and K Brundell-Freij ldquoOptimizingroute choice for lowest fuel consumptionmdashpotential effects ofa new driver support toolrdquo Transportation Research Part CEmerging Technologies vol 14 no 6 pp 369ndash383 2006

[10] R Ando and Y Nishihori ldquoHow does driving behaviorchange when following an eco-driving carrdquo Procedia - Socialand Behavioral Sciences vol 20 pp 577ndash587 2011

0 500 1000 1500 2000 2500Time (s)

0

5

10

15

20

25

30

Fuel

cons

umpt

ion

(L1

00km

)

SVM predictionConventional

Figure 7 Proposed SVM prediction model vs conventionalreadings

8 Journal of Robotics

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9

Page 9: Fuel Consumption Using OBD-II and Support Vector Machine …

[11] Y Xiao Q Zhao I Kaku and Y Xu ldquoDevelopment of a fuelconsumption optimization model for the capacitated vehiclerouting problemrdquo Computers amp Operations Research vol 39no 7 pp 1419ndash1431 2012

[12] R Syahputra ldquoApplication of neuro-fuzzy method for pre-diction of vehicle fuel consumptionrdquo Journal of 5eoretical ampApplied Information Technology vol 86 no 1 pp 138ndash1502016

[13] R Langari and J-S Won ldquoIntelligent energy managementagent for a parallel hybrid vehicle-part I system architectureand design of the driving situation identification processrdquoIEEE Transactions on Vehicular Technology vol 54 no 3pp 925ndash934 2005

[14] K I Wong P K Wong C S Cheung and C M VongldquoModeling and optimization of biodiesel engine performanceusing advanced machine learning methodsrdquo Energy vol 55pp 519ndash528 2013

[15] M G Lee Y K Park K K Jung and J J Yoo ldquoEstimation offuel consumption using in-vehicle parametersrdquo InternationalJournal of U-And E-Service Science and Technology vol 4pp 37ndash46 2011

[16] E Husni ldquoDriving and fuel consumption monitoring withinternet of thingsrdquo International Journal of Interactive MobileTechnologies (iJIM) vol 11 no 3 pp 78ndash97 2017

[17] S-H Chen J-S Pan and K Lu ldquoDriving behavior analysisbased on vehicle OBD information and adaboost algorithmsrdquoin Proceedings of the International MultiConference of Engi-neers and Computer Scientists pp 18ndash20 Hong Kong ChinaMarch 2015

[18] P K Wong H C Wong C M Vong Z Xie and S HuangldquoModel predictive engine air-ratio control using online se-quential extreme learning machinerdquo Neural Computing andApplications vol 27 no 1 pp 79ndash92 2016

[19] F Ortenzi and M A Costagliola ldquoA new method to calculateinstantaneous vehicle emissions using OBD datardquo SAETechnical paper 0148-7191 SAE International WarrendalePA USA 2010

[20] J E Meseguer C K Toh C T Calafate J C Cano andP Manzoni ldquoDrivingstyles a mobile platform for drivingstyles and fuel consumption characterizationrdquo Journal ofCommunications and Networks vol 19 no 2 pp 162ndash1682017

[21] L Ntziachristos Z Samaras S Eggleston N GorissenD Hassel and A Hickman ldquoCopert Iiirdquo in Computer Pro-gramme to Calculate Emissions from Road Transport Meth-odology and Emission Factors (Version 21) European EnergyAgency (EEA) Copenhagen Denmark 2000

[22] A se Autocom vehicle diagnostics and service solutionshttpsautocomseenproductscars

[23] Wikipedia On-board diagnostics httpsenwikipediaorgwikiOn-board_diagnosticsEOBD_fault_codes

[24] httpwwwwindmillcoukobdhtml[25] Y A Cengel and M A Boles ldquo)ermodynamics an engi-

neering approachrdquo Sea vol 1000 p 8862 2002[26] U Specs httpswwwultimatespecscom[27] C Cortes and V Vapnik ldquoSupport-vector networksrdquo Ma-

chine Learning vol 20 no 3 pp 273ndash297 1995

Journal of Robotics 9


Recommended