A Trip Planner Tool for Electric Vehicles in Long Distance Journeys

I n the era of the transition towards electric vehicles (EVs), new services and tools are needed in order to facilitate the use of such vehicles. In this paper, a new tool is designed to optimally plan the long distance trips with an EV. The trip planner tool is realized by using MATLAB software. It implements an algorithm that, based on the EV battery model and on the charging stations information available on the route from departure to destination, determines the best itinerary in term of travel time and cost, minimizing the charge stops. The prototype of the trip planner tool is demonstrated by a real case study.


I. INTRODUCTION
In recent years, electric vehicles (EVs) are gradually substituting conventional internal combustion engine vehicles.There are still some drawbacks that limit the use of the EVs, like the long recharge time, the limited driving range causing range anxiety, the high purchasing cost and the necessity of planning long distance trips [1], [2].
Differently from the route planning of conventional transport means [3] in which refueling is not a critical task, for EVs recharging stops need to be well taken into account and planned along the trip.Regarding the last issue, the need of planning long distance trips has been studied [4]- [14].A novel system for EV driving assistance is presented in [4] to extend the range and overcome other drawbacks by suggesting the driver an optimal driving strategy.This is possible by solving a multi-objective optimization problem and adopting multi-criteria decision making techniques.The driving assistance is carried out in real-time considering updated information and an EV model, aiming at minimizing the total travel time, energy consumption and jerk.Moreover, in [5] the authors propose an advanced route planning service to compute the optimal path towards a destination according to user-defined parameters and goals.The tool integrates the booking service in order to reserve the charging points (CPs) in specific time-slots.By applying a dedicated procedure they first model the problem by the graph theory and based on an energy-related analysis decide if a path can be feasible or not, looking at the shortest path.Both in [4] and [5] the influence of the charging cost on the path planning is not explicitly treated.The authors in [6] use internet of things (IoT) in combination with a handshake protocol that uses vehicle to infrastructure and vehicle to grid communications for satisfying charging requests of connected and automated EVs.The objective is to propose the shortest possible route to the destination dealing with both static and dynamic charging solutions.The work in [7] presents a strategy for multimodal trip planning for fully EV considering range issues and charging services along the trip.In a multi-layer architecture the authors formalize the problem as an energy resource constrained shortest path problem, and solve it through an ad-hoc decomposition approach.The proposed approach is validated through the simulation of realistic use cases.In addition, in [8] the goal is planning economic itineraries for EVs.In particular, the best routes are computed in term of electric power consumption, based on the collected information about road topology, weather conditions, vehicle characteristics, and so on.A web application is provided to EV fleet companies to book an EV and plan the trip.The provided application does not show details about the intermediate stops for charging along the trip.On the other hand, in [9] optimized planning of EV routing and charging is studied from the theoretical point of view.The authors deal with the decision problem of an EV owner who needs to plan the travel path including charging locations and associated charge amount under time-varying traffic conditions and dynamic electricity pricing.Then, they study the collective effects of a large number of EV owners solving the same type of path planning problem under different strategies.Furthermore, the authors in [10] propose a trip planning assisted energy management system implemented on a specific Plugin hybrid EV (PHEV) model and compared with model-inthe-loop simulations and hardware-in-the-loop experiments to evaluate the real-time workability and sensitivity to traffic prediction errors.The performed experiments demonstrate that the proposed system is sufficiently fast for real-time implementation and exhibits low sensitivity to traffic mispredictions.Neither [9] nor [10] provide a tool to implement the proposed trip planning models.In [11] a method that will help EV users planning long distance trips is presented.The proposed method takes into consideration the effects of temperature on charging and battery capacity as well as traffic and road conditions.Showing the final computed path to the user, this tool does not take into account charge costs and does not show details on intermediate charging stops.
From the performed analysis, it can be concluded that, even though different methods and solutions have been studied for planning trips of EVs, there is the scarcity of a user-friendly trip planning tool that can provide all the travel- The aim of this paper is to propose a new user-friendly tool to plan a trip for EVs, providing the necessary and useful information to end users.The aim is guaranteeing to reach the destination, by minimizing the trip cost and number of charging stops along the path based on EV constraints and user preferences.To this purpose, we use MATLAB tools in order to model the EV charging and discharging and a dashboard is created, through App Designer tool to realize the graphic user interface [15].In particular, we present a prototype of the trip planning tool, which implements an heuristic algorithm to plan the long distance trip of an EV based on the vehicle status, user preferences and charging stations information along the route.The use of the prototype tool is demonstrated by considering a real trip in Italy.
The paper is organized as follows: Section II presents the adopted EV consumption and travel model, including the algorithm designed for the trip planning.Section III presents the dashboard of the trip planner application prototype and Section IV describes a real case study to demonstrate the potentialities of the developed tool.Finally, section V provides the conclusions and some perspectives on future works.

A. The trip planning problem
The goal of the developed charge planning application is to be used especially to perform long trip with EVs in which charging stops must be planned accurately.In long distance trips, there is the necessity to stop for charging one or multiple times before to reach the final destination.In those cases it is important to manage the range anxiety issue, avoiding the risk of discharging completely the battery.Moreover, the user would prefer to stop as less as possible and at the cheaper and reachable charging station.An additional important information for a user who wants to optimize the trip planning is the total trip time which is necessary to complete the journey, the time spent for each charging stop and the presumable cost for every recharge.In order to calculate the best trip solution in term of travel time or costs, the proposed tool needs some specific input parameters that can be given by the user or the EV itself such as average speed, battery capacity, initial state of charge (SoC), as well as information from the charging stations like available plugs, charging power, charge tariff, etc.. Furthermore, the tool must take into account the EV battery charging/discharging model and the road and traffic condition.

B. Problem definition
The driver is asked to specify the origin and destination of the trip.We denote with N the number of the available charge points (CPs) along the route that starts from the departure point (DP), goes through each charging point (CP1, CP2, ..., CPN ) and ends to the arrival point (AP).Note that the DP and the AP are not considered CPs.Hence, the trip is divided into N+1 segments i with i = 1, .., N+1, connecting the CPs, starting from the DP and ending to the AP: i = 1 associated to the segment (DP -CP1), i = 2 to (CP1 -CP2), ..., i = N + 1 to (CPN -AP).Each segment i is characterized by the following data: the EV velocity v i , the road slope angle ϕ i and the segment length d i .The planner has to decide at what CP to stop for charging, how long the charging is needed, on the basis of the segment information, the EV power consumption and the CP charging power.

C. Vehicle Model
The vehicle model adopted refers to the work in [10].In this model, the power demand P D of the EV depends on the longitudinal velocity v as follows (for the sake of simplicity the time dependence is omitted): where A is the EV frontal area (m 2 ), M represents the vehicle mass (Kg), r is the rolling resistance coefficient, d is the drag coefficient and g is the gravity acceleration.In addition, the parameter δ is defined to take in account the use of the air conditioning (A/C) system that is estimated to increase the power demand of about 25% [16].Therefore, it holds δ = 1.25 if air conditioning system is activated, otherwise δ = 1.
The battery power P b is related to the power demand as follows: , where m is the electric motor efficiency coefficient.The coefficient β can assume two values: β = −1 means battery is charging while driving (e.g.regenerative braking); β = 1 means battery is discharging while driving.Now, we can define the SoC of the EV while driving and charging as follows: Em , traveling with E m maximum capacity of the battery (kWh); ρ b battery efficiency coefficient; P bn is the battery recharging power considered when the EV is charging at the CP.Hence, the battery ∆SoC i in the trip segment i is defined as follows: where SoC 0 is the initial state of charge in segment i and ∆t i is the time to travel segment i (in travelling mode) or is the charging time (in charging mode at the CPi).
In order to determine the charge cost (e) for each recharge operation, knowing the initial and final energy in the battery (kWh), the charged energy is determined and is multiplied by the applied charge tariff (e/kWh).
Furthermore, to determine the charging stops to satisfy the EV energy demand during the trip at lowest cost, the planner must know the charging stations that are available along the route.Therefore, it is important to define the available charging stations and their inter-distances in order -300- to optimally plan the charge stops of the trip and estimate the partial and total battery consumption and recharge needs.Indeed, in the proposed scenario, the user wants to reach a destination which is far a certain number of kilometers (e.g.greater than 300 km) from the departure point.Along the path there can be several charging stations, each one with specific plug types, charging power and energy tariff.
Then, we can model the point of interests (PoIs) of the trip including the departure point, destination point and charging stations points, as the nodes of a graph.On this basis, each arc connecting two nodes reports their distance in kilometers [17].Therefore, by knowing the PoIs inter-distances, the EV charging and discharging model and CPs information, we can determine the trip plan, suggesting the best charge stops for minimizing the travel time and/or cost.In the proposed scenario, every station has its own charging tariff (e/kWh) which can change during the day, especially in the rush hours, according to energy operator policies.To take into account the dynamic changes of energy prices, 24 different time slots within a day are considered.

D. Travel Planning Algorithm
The algorithm for planning the charging stops of an EV is described by the flow-chart in Fig. 1.
Once the departure point and the initial SoC are known, the algorithm determines the inter-distance matrix D of dimensions (NxN) where N is the number of charging stations and the charging tariff matrix T of dimensions (MxN) with M number of time slots.By constructing the two matrices the trip plan can be determined.In case the autonomy is not sufficient to reach the final destination from the departure point, the first most convenient charge stop for the given EV is considered.Once the CP has been selected, the EV is assumed to stop there for recharging.Now, two possible cases can occur: 1) in the first case, the destination is straight reachable from the chosen station, so a partial recharge is enough to complete the trip also by preferring a user defined residual SoC; 2) in the second case, the destination is too far from the suggested charging point, so the user prefers to fully recharge the battery minimizing the number of stops and trading on the cheapest price.
The recharge cost and time are computed through the algorithm at each performed charge stop and the total cost is updated accordingly.Afterwards, the final itinerary is determined and the related information are shown to the user including the estimated arrival time at each CP, partial and total charging time and costs.

III. THE TRIP PLANNER TOOL INTERFACE
The trip planner application is a prototype realized with the App Designer tool that is a graphic tool integrated in MATLAB allowing to set input parameters and show the results of the trip planner algorithm.It provides common dashboard elements such as buttons, check boxes, spinners, graphs, text boxes and so on.The designed dashboard is shown in Fig. 2.  The user is asked to provide the following information about the trip and the EV: • origin and destination point addresses; • EV capacity (at first access) [kWh]; • Foreseen trip average speed [km/h]; • departure SoC [%] and reserve in km; Alternatively, these data can be retrieved directly from the EV back-end system, if a connection can be established with the application provider.
The application communicates with the map provider to find the stations close to the travel path (connecting origin to destination by the fastest route).For the considered charging stations, it calculates the inter-station distances in order to be used as input of the trip planner algorithm.Matrices D and T are reshaped and shown respectively as in the boxes named Distances and Prices (see Fig. 2 and Fig. 4).
Once the start button is pushed, the algorithm is executed and in few seconds the Results text box displays the optimal trip planned which allows the user to arrive at destination minimizing number of stops, time and cost.The important and useful data about the journey such as total cost and time are shown.In addition, two graphs are used to display the battery reserve in km and the corresponding SoC trends.In particular, for each charge stop of the trip, the dashboard shows the charge tariff, the arrival date and estimated arrival time, the cost for charging, the estimated charging time and residual autonomy at the end of charging (see for instance Fig. 5).Moreover, the final cost of charging is provided as well as the total travel time, the expected arrival time and the residual autonomy at destination.

IV. A CASE STUDY
In this section, a case study is presented to demonstrate the effectiveness of the proposed trip planner.In the considered scenario, the user wants to drive from Bari (Italy) (departure point) to Rome (Italy) (destination point), by using an electric car with 45kWh battery capacity.The trip has a total distance of 485km on the fastest path obtained from Google maps as shown in Fig. 3. Afterwards, the application searches and finds the CPs along the selected route and shows it to the user.All the considered CPs provide the same charging rate but different tariffs.The distance between each PoIs couple is determined by the algorithm.Once this calculation is done, and the necessary EV inputs are retrieved, the algorithm determines the best itinerary including the charge stops.We define and analyze two cases to show the application of the trip planner: case 1) the battery is fully charged at the departure and the A/C is off; case 2) the battery is fully charged at the departure and the A/C is on.In both cases, three sub-cases are defined in order to evaluate the trip planner using three different cruise average speeds: case a) 80km/h; case b) 100km/h; case c) 120km/h.The input parameters of case 1a are set as shown in Fig. 4. By clicking on the start button, the planner runs and determines the results shown in Fig. 5, for case 1a.
In particular, the EV battery initial SoC is 100%.With the considered autonomy, the trip planner algorithm estimates one charging stop along the route.The charge stop will be at station 7, applying the cheapest charge tariff among the considered CPs.At station 7, only a partial recharge is needed to reach the final destination, respecting a minimum SoC threshold.
We consider now the case 1b, by changing the average speed of the trip from 80 to 100km/h.The results of the trip planner application are shown in Fig. 6.It can be noted that in case 1b there is an extra cost if compared with case 1a, because of the higher consumption due to the higher cruise average speed.In particular, one more charge stop, at station 4, is needed.On the contrary, there is a non relevant time saving since the travel time saved in case 1b is about 20 minutes with respect to case 1a.
In case 1c, by further increasing the average travel speed to 120km/h, we can observe relevant differences with respect to case 1a.The results of the trip planner application in case 1c are reported in Fig. 7.In particular, 4 charging stops are needed because of further increasing of the cruise velocity, resulting in higher charging needs and costs (around 24e) in front of a not significant travel time saving (around 20 minutes) with respect to case 1a.It holds that in case 1b and 1c the total travel time is almost the same but in case 1c the cost and number of stops are significantly higher.
From the analysis of the results of cases 1a, 1b, 1c, it can be concluded that the best trade-off between travel monetary cost and time is obtained in case 1a.
In the second case, the performed study is repeated by activating the A/C.The other inputs remain unchanged with respect to case 1. Considering case 2, the results of the trip planner for the three sub-cases 2a, 2b and 2c are reported respectively in Fig. 8, 9 and 10.In case 2a, the trip plan includes one charge stop at station 7 like in case 1a.Nevertheless, in case 2a the estimated charge time and cost are higher than case 1a.This is evidently due to the higher consumption of the EV when driving with A/C system activated.At the same time, as expected, the number of charging stops as well as the total cost increase also in case 2b and 2c if compared with case 1b and 1c.This is due to the higher energy consumption, despite the same velocity, for the use of the A/C system during the trip.In particular, in case 2b and 2c one more charge stop is needed with respect to case 1b and 1c, respectively, increasing travel time and charge cost.
Finally, from the performed tests we can draw the following conclusions: • the most cost saving solution is obtained driving with an average cruise speed of 80km/h; • the best trade-off between time and cost saving solution is obtained by driving with an average cruise speed of 80km/h;  Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
Fig. 10.The trip planner results in case 2c.
• in case of time saving needs it is preferable to drive at an average cruise speed of 100km/h; • it is not convenient to drive at 120km/h on average since, despite the total travel time is similar to the case of 100km/h, the number of charging stops increases significantly leading to a monetary cost increase.• the use of A/C system significantly impacts on the battery consumption, the travel time and charge costs.
In particular, from the performed tests using A/C, the charging cost increases of about 30% on average and the EV needs around 30 minutes more to reach the final destination.
V. CONCLUSIONS This paper presents the prototype of a tool developed for planning the recharging stops in long distance trips with electric vehicles (EVs).To overcome the charging and route planning problems, that still limit the user experience with EVs, it is necessary to provide new services and tools to facilitate the use of such vehicles.To this goal, the proposed trip planner prototype, based on input data gathered from the EV and available charging stations along the trip, is able to determine the necessary charge stops, minimizing travel time and cost.The trip planner is designed and realized by MATLAB App Designer toolbox.Users can interact with the application through a Graphical User Interface (GUI) which allows to input and visualize the necessary data and the output of the planner.The planner outputs the details of the charge stops, such as estimated arrival time, charging time and cost, residual SoC and the SoC trend.The use of the trip planner is demonstrated by considering a real trip from Bari to Rome (Italy), showing the results in term of traveling with different average cruise velocity, by using or not using the A/C system.Therefore, the presented trip planner application can be a powerful tool for EV drivers to optimally plan the trip, based on the knowledge of the energy needs during the trip, minimizing the number of charging stops, the travel time and costs.Future works will connect the planner with weather forecast, road and traffic service providers and the use of deep reinforcement learning will be investigated.

Fig. 4 .
Fig. 4. The input parameters for the trip planner.