Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered...

33
TVE-STS; 19009 Examensarbete 15 hp Juni 2019 Development of a Smart Charging Algorithm for Electric Vehicles at Home Johanna Lundblad Rebecca Segelsjö Duvernoy

Transcript of Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered...

Page 1: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

TVE-STS; 19009

Examensarbete 15 hpJuni 2019

Development of a Smart Charging Algorithm for Electric Vehicles at Home

Johanna LundbladRebecca Segelsjö Duvernoy

Page 2: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

Teknisk- naturvetenskaplig fakultet UTH-enheten Besöksadress: Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0 Postadress: Box 536 751 21 Uppsala Telefon: 018 – 471 30 03 Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student

Abstract

Development of a Smart Charging Algorithm forElectric Vehicles at Home

Johanna Lundblad and Rebecca Segelsjö Duvernoy

The purpose of this bachelor thesis is to develop a smart charging algorithm for electric vehicles (EVs) and examine the potential of the smart charging scheme, compared to the uncontrolled charging scheme at residential houses with an installed photovoltaic (PV) system. The thesis examines if the smart charging can increase the photovoltaic self-consumption and self-sufficiency of houses. Also, the thesis will evaluate if the smart charging scheme can reduce the household peak loads compared to the uncontrolled charging scheme. The presented results show that the implementation of the proposed algorithm will reduce the household peak load on average by 38.64 percent at a house with an installed PV system. The self-consumption and self-sufficiency increased by 4.69 percent and 4.97 percent when the smart charging algorithm was applied. To increase the credibility of the developed model a sensitivity analysis considering number of houses and vehicles was done. From the results, it can be concluded that the proposed smart charging algorithm could be an option to reduce the household peak load and increase the usage of renewable energy sources.

ISSN: 1650-8319, TVE-STS; 19009Examinator: Joakim WidénÄmnesgranskare: Reza FachrizalHandledare: Joakim Munkhammar

Page 3: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

1

Table of content

Table of content _____________________________________________________________ 1

1. Introduction ___________________________________________________________ 4

1.1 Aim _______________________________________________________________ 4

1.2 Resarch Questions ___________________________________________________ 5

1.3 Limitations and delimitations ____________________________________________ 5

1.4 Disposition __________________________________________________________ 5

2. Background ___________________________________________________________ 6

2.1 Paris Agreement on Climate change _____________________________________ 6

2.1.1 Transport industry and Paris Agreement ______________________________ 6

2.2 Electric Vehicles _____________________________________________________ 6

2.2.1 History of EVs ___________________________________________________ 7

2.2.2 The future of EVs ________________________________________________ 7

2.3 The Power Grid ______________________________________________________ 8

2.3.1 Challenges _____________________________________________________ 8

2.4 PV system __________________________________________________________ 8

2.4.1 PV power today and future predictions _______________________________ 9

2.5 PV self-consumption __________________________________________________ 9

2.6 Smart Charging _____________________________________________________ 10

3. Methodology and data __________________________________________________ 11

3.1 Overview __________________________________________________________ 11

3.2 Data ______________________________________________________________ 11

3.2.1 Departure time and Arrival time ____________________________________ 11

3.2.2 Driving distance ________________________________________________ 11

3.2.3 House load ____________________________________________________ 11

3.2.4 Solar irradiance ________________________________________________ 12

3.3 Calculations ________________________________________________________ 12

3.3.1 Net-zero Engergy Building and PV power ____________________________ 12

3.3.2 Charging capacity and time _______________________________________ 13

3.3.3 Net resultant energy _____________________________________________ 13

3.3.4 Self-consumption and coverage of PV-power _________________________ 14

3.4 The Model Principle _________________________________________________ 15

4. Results ______________________________________________________________ 17

Page 4: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

2

4.1 Simulations of charging scenarios for 1 EV _______________________________ 17

4.1.1 Self-consumption and Self-sufficiency _______________________________ 18

4.2 Sensitivity analysis on number of cars ___________________________________ 18

5. Discussion ___________________________________________________________ 21

6. Conclusions __________________________________________________________ 23

7. Reference list _________________________________________________________ 24

8. Appendix _____________________________________________________________ 27

Page 5: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

3

List of terms

EV Electric Vehicle, a vehicle which is partly or fully driven by

electricity. In this thesis EV corresponds to Battery Electric

Vehicle (BEV) and Plug in Hybrid Electric Vehicle (PHEV).

PV system

Photovoltaic system, a power system that uses irradiation of the

sun to generate electricity

Self-consumption

The use of locally produced power without using the power grid

Self-sufficiency

The household load coverage from self-produced energy

Dumb charging

Uncontrolled charging

Smart charging

Controlled charging

Page 6: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

4

1. Introduction

The transport industry accounts for almost 24 percent of the world's greenhouse gas

(GHG) emissions, and it is also the primary cause of air pollution in the cities

(International Energy Association (IAE), 2018a). In comparison to other sectors, the

transport sector has not seen the same gradual decline of emissions (European

Commission, n.d). To achieve the Paris agreements 2 degrees Celsius-target (2DS), the

sectoral emissions must decline in the coming decade (United Nation Climate Change

(UNCC), 2019). Calculations suggest the transport industry must achieve a reduction of

welll to wheel GHG emission by a minimum of 20 percent for OECD economies until

2025 and 18 percent in non-OECD countries (IEA, 2017a). To reach the 2DS, one

highlighted approach is electrification of the transport industry. The United Nation of

Climate Change suggested a minimum of 20 percent of all global road transport

vehicles to be electrically driven by 2030 (UNCC, 2015). To target the presented goal,

The International Energy Agency set a new Policy Scenario, the EV30@30, to speed up

the development of electric vehicles (EV). A collective goal has been established that 30

percent of all global sales of cars must be EVs by 2030 (IEA, 2018b). During 2017, the

worlds EV fleet reached over 3 million, a notable increase of 54 percent compared to

2016 (IEA. 2018). However, the EV30@30 scenario suggests 225 million EVs on the

roads by 2030, a significant increase compared to today's number.

The penetration of EV to the car fleet has and is still encountering challenges. In

comprehension to internal combustion engine vehicles (ICEVs), EVs has a limited

driving range and requires a developed charging infrastructure. However, an expansion

of the charging infrastructure will challenge the power infrastructure, especially the

grid, (Turker et al. 2013) something that must be taken into consideration (IEA, 2017).

Most people have the same daily routines; they go to work in the morning and come

home around the same time. After the time of arrival at the home, there is a major use of

electricity, resulting in a high electricity demand needed from the grid. The electrical

grid has a limited capacity of transported power, if the grid experiences maximum load,

overloading of transformers and power lines can occur (Nordling, 2016, p.15). To

minimize EVs impact on the grid, especially with the predicted future increase of EVs

in the car fleet, research suggests increased use of renewable energy sources (Freire,

2010). Recently, a notable change has been seen in the increasing use of renewable

energy sources, especially photovoltaic (PV) generation systems. Combining the

technologies of EV and PV could not only reduce the carbon emissions but also reduce

the EV load from the grid by smart charging. In order to meet the predicted future

increase of an EV car fleet, smart charging is an option to reduce the household peak

loads and to increase self-consumption from renewable energy sources.

1.1 Aim

This project aims to examine the potential of smart charging to reduce the household

peak loads, increase the PV power self-consumption and self-sufficiency by developing

a smart charging algorithm and conducting simulations of smart charging schemes.

Page 7: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

5

1.2 Resarch Questions

Can the implementation of smart charging algorithm based on collected data for

household electricity consumption and PV production reduce the peak load and

increase PV self-consumption and self-sufficiency?

How does the load curve in smart charging scenario differ from the one in the

uncontrolled charging scenario?

1.3 Limitations and delimitations

The report examines simulations of smart charging and dumb charging of EVs. The

simulations are delimited to EVs at houses with a PV system. During the simulations,

up to10 EVs are simulated and all EVs are assumed to be Teslas model S. Therefore,

the power consumption characteristics is assumed to be equal for all cars.

The data of driving distance and time of arrival and departure used in the report is

limited to the driving patterns provided in the Swedish travel survey (SIKA, 2007). The

mobility pattern and parking period of each car is generated from those data using

Monto Carlo simulation to estimate the charging demand. The collected data is only

valid for Swedish conditions and does not represent a particular domain, such as urban,

suburban, or agricultural. Therefore, the results are only valid for Sweden and may

appear different in another country or a specific domain.

The data used regarding solar irradiation is obtained from SMHI 2018 for Stockholm

region. When using the model in other regions, other results may occur. The size of the

installed PV-system is limited to the assumption that the houses are Net-zero Energy

Buildings where the buildings produce the same amount of energy as they consume.

For this project, the charging of the EV is delimited to the household level. The study

assumes the EV charging only occur at homes. The schemes which includes workplaces

or other places of charging are left for further studies.

1.4 Disposition

The report consist of six chapters, the following chapter (2) presents essential

background information of the study. In chapter 3 Methodology and Data are presented.

Furthermore, chapter 4, presents the result of the study, where a sensitivity analysis is

included to investigate the reliability of the method. Chapter 5 discuss the results

obtained, the following chapter (6) presents conclusions drawn from the study.

Page 8: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

6

2. Background

This section presents essential background information of the study. This part is divided

into six main sections; The Paris Agreement on Climate change, Electric Vehicles, The

Power Grid, PV system, PV self-consumption, and Smart charging.

2.1 Paris Agreement on Climate change

The Paris agreement is an agreement dealing with the threat of climate change and the

actions and investments needed for a sustainable low carbon future. The Paris

Agreements aim to act against the threat of climate change by keeping the rising global

temperature below 2 degrees Celsius above pre-industrial levels. The agreement brings

all nations together to lower the emissions and achieve the 2 degrees Celsius target

(2DS) (UNCC, 2018b).

2.1.1 Transport industry and Paris Agreement

The transport industry accounts for almost a quarter of Europe's greenhouse gas (GHG)

emissions (European Commission, n.d) and 24 percent in the world 2017 (IAE, 2018b).

The emissions are also the primary cause of air pollutions in the cities. Between 2010

and 2015, the transport industries GHG emissions increased by 2.5 percent annually.

However, to reach the Paris Agreements 2DS and reduce the impact of air pollutions,

this trend must be reversed (IAE, 2017). To target the 2DS, the transport emissions must

peak around 2020 and then decline by at least 9 percent by 2030 (IEA, 2018a). OECD

countries must reduce well to wheel GHG emissions by 25 percent and non-OECD

countries by 18 percent until 2025 (IAE, 2017). However, there are some positive

trends. In 2017, the emissions increased by 0.6 percent, compared to 1.7 percent

annually the past decade, due to electrifications, biofuels, and efficiency improvements.

One of the strategies to decrease the emissions of GHG and air pollutions is

electrification of the transport industry (UNCC, 2015).

2.2 Electric Vehicles

An Electric Vehicle (EV), is defined by the U.S. Energy Information Administration

(U.S. EIA), as a motor vehicle partly or fully driven by electricity. Unlike fossil fuel-

powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS,

2018). There are different types of EVs, usually categorized into three main categories;

Battery Electric Vehicles (BEV), Plug-in Hybrid Electric Vehicles(PHEV) and Hybrid

Electric Vehicle (HEV). The BEV is a purely electric vehicle powered by internal

batteries. It must be connected to the electrical grid to charge the batteries, which in turn

provides the vehicle´s propulsion. The PHEV and HEV both have internal batteries and

internal combustion engines for propulsion. Their main power source for longer

distance driving is the combustion engine, with the electric engine kicking in at certain

Page 9: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

7

phases, reducing fuel consumption mainly during start-stop, acceleration and when

driving at lower speeds. Hence the means of operation is very similar between the

PHEV and HEV. What differs them is the way the batteries are charged. The PHEV can

be connected to an external electrical grid to charge the batteries, while the batteries of

the HEV are charged solely by its internal combustion engine (Wi, 2013).

2.2.1 History of EVs

Electric vehicles were introduced more than 100 years ago, and at one point a third of

the total car fleet consisted of electric vehicles. The electric vehicles were appreciated

by users since it was silent and did not consume fuel. However, in 1935, the EVs

disappeared from the market partly due to improved infrastructure, an increased number

of gas stations, and fuel price reduction. These improvements made it possible to travel

longer distances, and at this point, EVs could no longer compete with the fuel driven

vehicles. At 1970, when the fuel price increased, the EVs appeared on the market again.

Although, it was not until the beginning of 2000 when the EVs reached a turning point,

and the development of EVs proceed. Until this point, the driving range for EVs was

still limited. In 2006, the Silicon Valley startup, Tesla Motors, announced the

development of an EV with a driving range of 200 miles This, along with various other

motives such as the environmental advantages contributed to the development of EVs in

already established vehicle manufacturing companies (Matulka, 2014).

2.2.2 The future of EVs

To reach the Paris agreements 2 degrees Celsius target, electrification of the transport

sector is needed. The EV30@30 initiative presents the opportunity to simplify the

transition to a fully renewable energy system through transport electrification.

Furthermore, a collective goal has been established that 30 percent of all global sales of

cars must be electric vehicles by 2030 (IEA, 2018). In Sweden, a member of the

EV30@30 initiative, the Cross-Party Committee on Environmental Objectives proposed

a goal for reduction of emissions in the domestic transport sector by at least 70 percent

by 2030 compared to the levels of 2010 (Government Office of Sweden, 2016). To

target the presented goal, Fortum Charge & Drive together with Swedenergy, compiled

The Almedalen Manifesto 2016. The Manifesto states how electric vehicles and

charging infrastructure should be promoted to reach the Cross-Party Committee on

Environmental Objects proposed goal. The Manifesto states that electric vehicles and

the charging infrastructures technical development have reached a point where an

introduction to the broader market is possible. Therefore, the Manifesto proposes a goal

of two million EVs in Sweden until 2030 to achieve the proposed reduction. At the first

quarter of 2019, 20447 EV were registered and together with Plug-in Hybrid Electric

Vehicles (PHEV), the number was roughly 74000, an increase of 50 percent from the

year before (Elbilstatistik, 2019).

Page 10: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

8

2.3 The Power Grid

The Swedish national power grid is one of the oldest electrical grids in the world and

consists of 15000 km of power lines. The Swedish electricity market has been

dominated by nuclear and hydropower, contributing to around 80 percent of the national

generated electricity. The power grid transports and distributes the generated electricity

from where it is produced to where it is needed (Svenska Kraftnät, 2017a). The grid is

divided into three levels; the national grid, regional grid, and local grid. In Sweden, the

authority responsible for the national grid is Svenska kraftnät, and around 170

companies are operating the local- and regional grid (Nordling, 2016, p.7). Svenska

Kraftnät is responsible for ensuring the balance of energy production in Sweden,

making sure that the energy produced is the same as the energy consumed. If there is an

imbalance between these two in the electrical system, there is a risk of disruptions on

the grid and power failure (Svenska Kraftnät, 2017b).

2.3.1 Challenges

The society is dependent on reliable energy production to maintain the functions of

industries, households, infrastructures, and other vital services. One of the challenges

today is the limited capacity of transported power from the power grid, something that

could contribute to power distributions. Sweden is already experiencing problems with

the capacity of the grid, especially during peak hours when there is major use of

electricity in the households, resulting in a high electricity demand needed from the

grid. The electrical grid has a limited capacity of transported power. If the maximum

load is withdrawal from the grid, overloading of transformers and power lines can occur

(Nordling, 2016, p.15). Future prognosis predicts further electrification of society and

an increasing EV fleet, something that will increase the load on the grid even more. If

charging of the EVs will occur during peak hours, the peak load will increase and the

risk of disruptions on the grid and power failure will emerge. Therefore, if the charging

demand is regulated, the charging load of the EVs could be limited during peak hours.

Regulated charging could also increase the use of intermittent renewable energy sources

(Nordling, 2016, p.17). However, the electrical grid in Sweden must be developed to

meet future demand (Svenska kraftnät, 2019).

2.4 PV system

Photovoltaics are electrical power generating systems converting light into electricity by

the use of semiconductor materials. The sun rays consist of packets of energy (photons).

When the photons hit the PV cell, the electrons in the cell excite due to charge

separation in the absorbing material. The movement of the electrons generates a small

voltage, and if the circuit is closed, a direct electrical current (DC) is generated. The DC

electricity is converted into an altering current (AC) by a solar inverter (Schavemaker

Page 11: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

9

and van der Sluies 2008:62). Since the produced electrical current from one cell is

relatively small, more PV cells are usually linked together into a PV panel to produce a

higher amount of energy.

PV systems are usually categorized as off-grid- or grid-connected systems. Where off-

grid systems are initially set up to generate power for individual systems and devices

similar to boats, cabins, and farm appliances. On-grid connected PV systems are

dominating the market of installed PV power. The grid-connected PV power is mainly

roof-mounted systems installed by companies and private persons (Swedish Energy

Agency, 2016a). The most common types of PV panels are Polycrystalline solar cells,

monocrystalline solar cells, and thin-film solar cells, whereas the first two dominates

the market. The type of PV panels differs in price, material, efficiency, and flexibility

(Swedish Energy Agency, 2016a).

2.4.1 PV power today and future predictions

One of the advantages of PV systems is the modular technology. The systems can be

small, such as calculators and off-grid applications, and scaled up to extensive power

generations facilities connected to the grid (IEA, n.d solar energy). The disadvantages

of PV power is the reliability of its intermittent power generation. Therefore, to

maximize the benefits of PV power, an energy storage system is required, and the

development of smart charging systems.

During the last decade, the installed global PV power capacity has increased. At the

beginning of 2000, the number of globally installed PV power capacity was around

1GW (Swedish Energy Agency, 2018). Since then, the number has increased, and at the

beginning of 2017, the installed PV power capacity was around 398GW. Solar PV is

dominating the growth of renewable energy, and a future prediction expects growth of

575GW to become operational until 2023 (IEA, 2018). In Sweden, the installed capacity

of grid-connected PV power increased by 65 percent in 2017 compared to 2016

(Swedish Energy Agency, 2018).

2.5 PV self-consumption

PV self-consumption refers to the share of energy produced from an installed PV

system which is directly used in the building of the installed PV system. There are

several advantages with self-consumption, both technical and economic. When the PV

power is used directly in the building, the amount of power needed from the grid

decreases. Consequently, the load on the grid is reduced. Another benefit of increased

self-consumption is the economic advantage when less energy is bought from the grid.

One technical advantage is the reduction of cable losses due to transportation. In the

year of 2014, 6.7 percent of the produced energy in Sweden was lost as a result of cable

loses whereas the losses from an installed PV system connected to the building of

consumption was no more than 1 percent (Swedish Energy Agency, 2016b, p.14).

However, to reach the full potential of self-consumption further technological

development is needed. Development of regulatory smart battery-charging algorithms is

Page 12: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

10

highlighted as a solution to reach the full potential of self-consumption (Dehler et al.,

2017).

2.6 Smart Charging

During 2017, the global EV fleet reached over 3 million, a significant increase of 54

percent compared to 2016. The International Energy Agency predicts the number of

EVs to reach 125 million by 2030, a number that might increase further (IEA, 2018b).

The penetration of EVs to the car fleet encounter challenges. EVs have a limited driving

range and requires developed charging infrastructure, which will challenge the grid,

especially during peak hours (Nordling, 2016). The ability to control the batteries

charging allows for smart charging to maximize self-consumption of renewable energy

sources and to reduce the load on the grid (Pecas Lopes et al, 2009). By charging when

the power production from renewable sources is high, and by avoiding charging during

peak hours, the negative impacts on the electric grid will be reduced. Other benefits are

the increased use of self-consumption from renewable energy sources, reduced GHG

emissions, and cost reductions. In the future, the power system requires not only

flexible power generation but flexible power usage as well. In this way, excessive

current loads on the local grid can be prevented (IEA, 2018b).

Page 13: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

11

3. Methodology and data

In this section, the methodology, calculations, and the use of collected data to conduct

the study are presented.

3.1 Overview

In this report, a rule based algorithm for smart charging is developed for simulations in

MATLAB. The smart charging algorithm uses input parameters of driving distance,

park period, solar power production and household energy consumption. With this

information the model calculates and allocates the charging load for each hour,

depending on if smart charging and self-consumption from the installed PV-system are

possible to see Figure 1, Flowchart. However, if charging from the PV system is not

possible, the energy is supplied to the EV from the electrical grid. The algorithm

allocated the charging load for each hour during the parking time. The smart charging

scenario will be compared to dumb charging scenario to evaluate the potential of smart

charging.

3.2 Data

3.2.1 Departure time and Arrival time

The arrival time represents the specific time when the EV arrives at the home, whereas

the departure time is the time when the EV leaves the home. The data consist of driving

sessions collected from the Swedish travel data survey during the year of 2005-2006

(SIKA, 2007). In each simulation of the model, for each day during the year, a departure

and arrival time is generated from the data through the Monte Carlo method, then the

parking period duration is determined from that.

3.2.2 Driving distance

The driving distance is generated from the Swedish travel data survey conducted the

year of 2005-2006. It represents the driving distance for several cars every day for one

year. A randomized driving distance is assigned to each EV in the simulation, each day

of the year through the Monte Carlo method.

3.2.3 House load

The household load data is generated from the Widén-Markov model for typical

Swedish detached houses.The Widen-Markov model is a stochastic generation for

household electricity load patterns with probabilistic approach (Widén and Wäcklegård,

2009).

Page 14: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

12

3.2.4 Solar irradiance

For the solar irradiance, data from the Swedish Meteorological and Hydrological

Institute is used. The data is conducted from Bromma Airport and consists of hourly

resolutional horizontal solar irradiance, [W/m2], throughout the year of 2018. The solar

irradiance for each month during 2018 is illustrated in Figure 1.

Figure 1. Monthly solar irradiance for each month during 2018.

3.3 Calculations

3.3.1 Net-zero Engergy Building and PV power

To estimate the produced PV power, 𝑃𝑝𝑣, scaling of a Net-zero Energy buildings is

used. A Net-zero Building produces the same amount of renewable energy to meet the

buildings annual energy consumption (U.S Department of Energy, n.d). The Net-Zero

Energy building, 𝐸𝑝𝑣, is calculated using equation 1.

𝐸𝑝𝑣 = 𝐸ℎ𝑜𝑢𝑠𝑒 + 𝐸𝐸𝑉

(1)

Where Epv is the Net-Zero Energy Buildings consumption annually [W], Ehouse the

household load [W], and EEV the load from the EV [W].

Equation 1 is used to calculate the amount of energy needed to cover the consumption

of a Net-zero Energy Building. To estimate the size of the PV power system, equation 2

is used where Ppv=EPV.

𝑃𝑝𝑣 (𝑡) = 𝑆 × 𝐼(𝑡)

(2)

Where Ppv is the produced PV power for every hour, I the solar irradiance from SMHI

[W/ m2], and S the size of the PV system.

Page 15: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

13

3.3.2 Charging capacity and time

All EVs are assumed to be Tesla Model S with the battery capacity (𝐵𝐶) of 75 kwh. The

average energy consumption, 𝐸𝑐𝑜𝑛, is set to 0.2 kWh/ km. The battery's state of charge

(𝐵. 𝑆𝑂𝐶) at time of arrival is calculated using equation 3;

𝐵. 𝑆𝑂𝐶 = 𝐵𝐶 − 2 × 𝐷𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 × 𝐸𝑐𝑜𝑛 (3)

Where 𝐵. 𝑆𝑂𝐶 is the battery state of charge when arriving at the home [kWh], 𝐵𝐶 the

maximum battery capacity [kWh], 𝐷𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 the driving distance [km] and 𝐸𝑐𝑜𝑛 the

energy consumption for the EV [kWh/km].

The energy required until fully charge is calculated using equations 4;

𝐸𝑟𝑒𝑞 = 𝐵𝐶 − 𝐵. 𝑆𝑂𝐶 (4)

Where 𝐸𝑟𝑒𝑞 is the energy required [kWh], 𝐵𝐶 the maximum battery capacity [kWh] and

𝐵. 𝑆𝑂𝐶 the battery state of charge when arriving at home[kWh].

To estimate the charging capacity, 𝐶𝑥(𝑡), needed for each hour during the charging

time, 𝑡𝑥, equations 5 is used:

𝐶𝑥(𝑡) =

𝐸𝑟𝑒𝑞

𝑡𝑥

(5)

Where 𝐶𝑥(𝑡) is the charging capacity [ kW] and 𝑡𝑥 the charging time during the parking

period [h]. 𝐶𝑥(𝑡) and 𝑡𝑥 varies depending on parameters illustrated in figure 3. An

explanation of the parameters for x is presented in table 1.

3.3.3 Net resultant energy

To increase the PV self-consumption, the variable net resultant energy (𝑁𝑟𝑒𝑞) is

introduced. The net resultant energy is the produced PV power minus the household

load, calculated using equation 6;

𝑁𝑟𝑒𝑞 = 𝑃𝑝𝑣 − 𝑃ℎ𝑜𝑢𝑠𝑒𝑙𝑜𝑎𝑑 (6)

Where 𝑁𝑟𝑒𝑞 is the net resultant energy [kWh], 𝑃𝑝𝑣 the produced PV power calculated in

equation 2 and 𝑃ℎ𝑜𝑢𝑠𝑒𝑙𝑜𝑎𝑑 the load from the household [kW].

Page 16: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

14

When the net resultant energy is greater than the charging demand for the specific hour,

charging from the produced PV should occur to improve self-consumption from the PV

system. Therefore, the charging during these hour/hours, 𝐶𝑝𝑣 are equal to the net

resultant energy. Using equation (5) and (6):

𝐶𝑝𝑣 = 𝑁𝑟𝑒𝑞 (7)

Where 𝐶𝑝𝑣 is the charging capacity when 𝐶𝑥 < 𝑁𝑟𝑒𝑞

3.3.4 Self-consumption and coverage of PV-power

PV Self- consumption (𝜑𝑠𝑐) is the share of energy produced from an installed PV

system which is directly used in the building of the installed PV system. In this report,

the energy is consumed by household and the EV, illustrated as the black line in figure

2.

Figure 2. The yellow line represents the produced PV power and the black line

represents the electricity load from the household.

The level of self-consumption illustrated in figure 2, can be expressed as:

𝜑𝑠𝑐 =

𝐶

𝐵 + 𝐶

(8)

The self-sufficiency (𝜑𝑠𝑠) is how much of the total household load that is consumed

from the produced PV power. The level of 𝜑𝑠𝑠 illustrated in figure 2, can be expressed

as:

𝜑𝑠𝑠 =

𝐵

𝐴 + 𝐵

(9)

Page 17: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

15

3.4 The Model Principle

The flowchart describes the model of the smart charging algorithm simulated in

MATLAB. It presents the charging capacity of the EV each hour during the parking

period. When the EV arrives at home, the charging demand is calculated using

equations 2. In the smart charging scenario, the charging capacity for every hour is

regulated after specified scenarios, illustrated in figure 2. During the dumb charging

scenario, the charging capacity is not regulated. When the EV arrives, the charging

starts with maximum charging capacity until the battery is full or when the EV

departures.

Since the driving distance, time of arrival and departure is randomly generated each

day, the EVs charging demand and parking time is different for each day of the

simulation throughout the year. The idea of the smart charging algorithm is to reduce

the peak load and increase the PV self-consumption. The peak hours are set to 17.00,

18.00 and 19.00, during these hours the EV should not charge if possible or be limited,

illustrated in figure 3. To increase the PV self-consumption and self-sufficiency,

charging from the produced PV power should occur when possible, calculated by

equation 7.

Page 18: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

16

[RF1]

Figure 3. The Flowchart describing the smart charging algorithm. Equation 2 is used

to estimate the energy required for each hour, 𝐸𝑟𝑒𝑞. The parameters used for the

charging time, 𝑡𝑥, and charging capacity, 𝐶𝑥, are presented in table 1.

Table 1. Explanation of 𝑡𝑥 and 𝐶𝑥

tpp Hours during parking period

top Hours during off-peak

tp Hours during peak

tpv Parking hours when Nre> Cop

Cop Charging capacity during time off-peak using equation 3

Cp Charging capacity during peak time using equation 3

Cmax Maximum charging capacity

Cpv Charging capacity equals Nre

Crest Charging during off-peak, when charging of PV have occurred

Page 19: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

17

4. Results

In this section the result of the simulations are presented. Section 4.1 presents the

simulations of 1 EV during for dumb charging and smart charging. Section 4.2 presents

a sensitivity analysis.

4.1 Simulations of charging scenarios for 1 EV

The result of the simulations with and without the smart charging algorithm is presented

as a mean daily net-load profile. Two simulations are presented, the first is the dumb

charging simulation, the second simulation is for when the smart charging algorithm is

used. During both simulations, the maximum charging capacity was 3.7kW.

For the dumb charging simulation, 1 EV is simulated during all hours of the year and

the mean value for the daily generated net-load profile is illustrated in figure 4. For the

dumb charging simulation, charging of the EV increased the peak load, and most of the

charging occurred during peak hours, illustrated in figure 4.

For the simulation of the smart charging algorithm presented in figure 3, 1 EV is

simulated during all hours of the year and the mean value for the daily generated net-

load profile is illustrated in figure 4. For the smart charging simulation, the peak load is

reduced by 38.64 percent on average during peak hours compared to the dumb charging

simulation. Table 2 presents the results of self-consumption and self-sufficiency for the

smart charging and dumb charging scenario.

(a) (b)

Page 20: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

18

Figure 4. Graph of the mean daily net-load profile of dumb charging (a) and smart

charging (b). The simulations are for 1 EV.

4.1.1 Self-consumption and Self-sufficiency

The PV self-consumption, the share of energy produced from the installed PV system

directly used by the household, is presented in table 2 and was calculated using equation

8. From the result of the mean household load, the self-sufficiency is calculated using

equation 9. Three different scenarios were simulated for the self-consumption and self-

sufficiency, all using the mean daily net profile for a simulated year and 1 EV. The

simulated scenarios were the household load without the EV and the household load

with smart charging and dumb charging illustrated in figure 4. The results are presented

in table 2.

Table 2. Self-consumption and self-sufficiency for the household with dumb charging

and smart charging of 1 EV and without the EV.

Self-consumption [%] Self-sufficiency [%]

without EV 24.95 39.02

With EV using dumb

charging

29.49 29.49

With EV using smart

charging

34.18 34.46

Difference using smart

charging versus dumb

charging

4.69 4.97

4.2 Sensitivity analysis on number of cars

In the sensitivity analyses, all simulations are made using the same variables as in the

result section, apart from the number of cars. Simulations of 5 EVs and 10 EVs are

made to see how the result of self-consumption, self-sufficiency and peak load

reduction is affected, presented in table 3.

For the simulation illustrated in figure 5, the number of EVs are set to 5.

Page 21: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

19

(a) (b)

Figure 5. Graph of the mean daily net-load profile of (a) dumb charging and (b) smart

charging. The simulations are for 5 EVs.

For the smart charging simulation 5 EVs, the peak load was reduced by 31.91 percent

compared to the dumb charging simulation. Table 3 presents the self-consumption and

self-sufficiency calculations for the house load without the EVs, and with smart

charging and dumb charging.

For the simulation illustrated in figure 6, 10 EV are used.

(a) (b)

Figure 6. Graph of the mean daily net-load profile of (a) dumb charging and (b) smart

charging. The simulations are for 10 EVs.

For the smart charging simulation with 10 EVs, the peak load was reduced by 28.35

percent compared to the dumb charging simulation. Table 4 presents the self-

Page 22: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

20

consumption and self-sufficiency calculations for the house load without the EVs, and

with smart charging and dumb charging.

Table 4. Self-consumption (SC) and self-sufficiency (SS) for houses with dumb charging

and smart charging for 1 EV and aggregation of 5 EVs and 10 EVs and peak load

reduction using smart charging for the three scenarios.

Number of

EV-house

couplings

smart charging

SC SS

dumb charging

SC SS

without EV

SC SS

Peak load reduction

with smart charging

compared to dumb

charging

1 34.18 34.46 29.49 29.49 24.95 39.02 38.64

5 35.53 35.05 33.30 33.34 25.36 39.82 31.96

10 35.94 35.30 34.12 34.15 25.49 39.95 28.35

Page 23: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

21

5. Discussion

In this section, the assumptions and results are analyzed and discussed.

For the result of 1 simulated EV the peak load was reduced by 38.64 percent compared

to dumb charging. Today, the Swedish electrical grid is already experiencing a shortage

of capacity since the grid has a limited capacity of transported power. A challenge not

only seen in Sweden but also globally. If the predicted EV fleet in Sweden will reach

the prognosis of 2 million cars before 2030, the charging infrastructure, if all EVs

charge directly when arriving at the house, the peak load will increase significantly,

illustrated in figure 4. The necessary charging infrastructure for the predicted EV fleet

would most likely not be possible with today's grid capacity. The proposed smart

charging algorithm could, therefore, be one solution since the peak load reduction was

reduced by an average of 38.64 percent and all EVs reach their required battery

capacity. Although, the electrification of the society and the transport sector will most

likely require and combination of smart charging systems and development of the grid.

The PV self-consumption increased by 4.69 percent with the smart charging scenario

compared to dumb charging scenario, when 1 EV was simulated. For a household

without an EV, the PV self-consumption was an average of 24.95 percent. With dumb

charging, the number increased to 29.49 percent, and for smart charging, the result was

34.18. Since the PV power is produced mostly during day time, a large share of the

produced power cannot be used directly. To increase the PV self-consumption, an ideal

future scenario is if the PV power could be stored and used later when the electric

consumption is high. By using the smart charging algorithm, the PV self-consumption is

increased, resulting in increased use of renewable energy for the studied houses. When

the PV power is directly consumed, the cable losses are limited compared to if

withdrawn from the grid. Therefore, the smart charging algorithm is beneficial since it

reduces power losses and increases the use of renewable energy sources. This aspect

should be considered further in future studies.

The self-sufficiency increased when the smart charging algorithm is implemented

compared to the self-sufficiency for the household without an EV. When dumb charging

scheme is implemented, the self-sufficiency decreased compared to the household

without the EV. All houses with an EV should, therefore, use smart charging since the

self-sufficiency level would decrease otherwise. Furthermore, smart charging is one

option to increase the houses self-sufficiency, resulting in more sustainable living, both

economically and environmentally.

For the simulation of 5 and 10 EVs, the peak load reduction was 31.96 percent and

28.35 percent. The self-consumption and self-sufficiency were an average of 35.53

percent and 35.05 for 5 EVs. The level of self-consumption and self-sufficiency

Page 24: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

22

increased to 35.94 percent and 35.30 percent for 10 EVs while implementing the smart

charging scheme. The average of peak load reduction by smart charging decrease by

10.29 percent for 10 EV-house couplings compared to single EV-house coupling. This

is most likely due to the aggregation effect that already reduce the system peak loads.

An improvement of the reliability and the results would be to increase the numbers of

simulated cars. In further studies, the house load, type of EV, driving distance, parking

time, and solar irradiance should be simulated over an expanded time period. Since the

data obtained might vary over different years.

The smart charging algorithm is beneficial since it can reduce the peak loads and

increase both self-sufficiency and self-consumption. A future predicted penetration of

EVs into the car fleet would, therefore, require controlled charging to meet the

increased electricity demand from electrification of the transport sector. Smart charging

would not only smoothen the transition for the future EV fleet but also accelerate the

transition of renewable energy. This is crucial to achieve the United Nations climate

change GHG emissions goal of reduction.

This study could be elaborated with more simulations of different scenarios for the

smart charging algorithm and compared with dumb charging. An idea for future studies

is a simulation of different car models with different battery capacity and consumption

where the storage of the produced PV power is considered. Some of the houses may not

only have one car. Therefore, the smart charging algorithm should be further developed

to include a different number of cars. Importantly, the results from the smart charging

scenarios highlight the benefit of smart charging. Therefore, this should be studied

further.

Page 25: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

23

6. Conclusions

The implementation of the developed smart charging algorithm can increase the houses

PV self-consumption compared to the scenario without smart charging by 4.69 percent

on average. Therefore, the smart charging scheme would increase the users share of

renewable energy only by controlling the charging of the EV. Also, the self-sufficiency

increased by 4.97 percent on average compared to dumb charging scenario. The

scenarios of 5 EV-house couplings and 10 EV-house coupling increased self-

consumption and self-sufficiency further. Therefore, the effect of aggregation by using

smart charging could have a positive impact to increase the use of renewable energy

sources.

The predicted future increase of EVs requires a developed charging system since it will

increase the load on the grid. If only dumb charging schemes are used, the peak of the

load curve would be significantly higher compared to the smart charging scenario. The

smart charging scheme reduces the peak load by an average of 38.64 percent. A smart

charging algorithm is therefore crucial to reduce the peak load.

Page 26: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

24

7. Reference list

Dehler J. 2017 et al, Self-Consumption of Electricity from Renewable Sources.

Available online:

https://www.sciencedirect.com/topics/engineering/self-consumption (2019-05-02)

Elibilstatistik, 2019, Elbilsstatistik. Available online:

https://www.elbilsstatistik.se/elbilsstatistik (2019-04-17).

Energiforetagen, 2017. Almedalsmanifestet för fler elfordon - Energiföretagen Sverige.

Available online: https://www.energiforetagen.se/sa-tycker-vi/almedalsmanifestet/

(2019-04-19).

European Commission, n.d, A European Strategy for low-emission mobility. Available

online: https://ec.europa.eu/clima/policies/transport_en (2019-04-14)

Freire, R. Delgado, J. Santos, J. Almeida, A. “Integration of Renewable Energy

Generation with EV Charging Strategies to Optimize Grid Load Balancing” IEEE,

2010

Goverment Office of Sweden, 2016. Broad consensus in Riksdag on proposal for

Sweden’s future. Available online: https://www.government.se/press-

releases/2016/06/broad-consensus-in-riksdag-on-proposal-for-swedens-future/

(2019-04-14)

H. Turker, A. Hably, S. Bacha, “Smart Charging of Plug-in Hybrid Electric Vehicles

(PHEVs) on the Residental Electric grid regarding the Voltage Plan.” IEEE, 2013

International Energy Association (IAE), 2007, Strong policy and falling battery costs

drive another record year for electric cars. Available online:

https://www.iea.org/newsroom/news/2018/may/strong-policy-and-falling-battery-

costs-drive-another-record-year-for-electric-ca.html (2019-04-10)

International Energy Association (IAE), 2017a, Tracking Progress: Transport.

Available online: https://www.iea.org/etp/tracking2017/transport/ (2019-04-14)

International Energy Association, (IAE), 2018a, Transport, Tracking Clean Energy

Progress. Available online: https://www.iea.org/tcep/transport/ (2019-05-09)

International Energy Association, (IAE), 2018b, Global EV outlook 2018. Available

online: https://www.iea.org/gevo2018/ (2019-04-14)

Nordling, A. (2016). Sveriges framtida elnnät, IVA. Available online:

https://www.iva.se/globalassets/rapporter/vagval-energi/vagvalel-sveriges-framtida-

elnat.pdf (2019-05-07)

Pecas Lopes, A. Soares, F. J. Almeida, P. M. Moreira da Silva, M. (2009), ”Smart

Charging Strategies for Electric Vehicles: Enhancing Grid Performance and

Page 27: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

25

Maximizing the Use of Variable Renewable Energy Resources” Instituto de

Engenharia de Sistemas e Computadores do Porto (INESC Porto) and Faculdade de

Engenharia da Universidade do Porto (FEUP), Porto, Portugal

Schavemaker, P. Van der Sluis, L (2008). Electrical power system essentials, Wiley,

Chichester 2008.

Svenska Kraftnät, 2017a, Drift av stamnätet. Available online: https://www.svk.se/drift-

av-stamnatet/ (2019-05-07)

Svenska Kraftnät, 2017b, Trygg elförsörjning. Available online:

https://www.svk.se/drift-av-stamnatet/trygg-elforsorjning/ (2019-05-07)

Svenska Kraftnät, 2019, Drift och Marknad. Available online:

https://www.svk.se/drift-av-stamnatet/drift-och-marknad/ (2019-05-07)

Swedish Energy Agency, 2016a, National Survey Report of PV Power Applications in

Sweden. Available online:

http://www.energimyndigheten.se/globalassets/fornybart/solenergi/national_survey_r

eport_of_pv_power_applications_in_sweden_-_2016.pdf (2018-05-07)

Swedish Energy Agency, 2016b, Solceller i omvärlden. Available online:

http://www.energimyndigheten.se/globalassets/fornybart/solenergi/solen-i-

samhallet/solceller-i-omvarlden.pdf (2019-07-08)

Swedish Energy Agency, 2018a, Kraftig ökning av nätanslutna solcellsanläggningar.

Available online:

http://www.energimyndigheten.se/nyhetsarkiv/2018/kraftig-okning-i-natanslutna-

solcellsanlaggningar/ (2019-05-09)

Swedish Energy Agency, 2018b Systemperspektiv i Världen. Available online:

http://www.energimyndigheten.se/fornybart/solelportalen/lar-dig-mer-om-

solceller/systemperspektiv-i-varlden/ (2019-05-07)

United nation Climate Change (UNCC), 2019, Nationally Determined Contributions

(NDCs). Available online: https://unfccc.int/process/the-paris-agreement/nationally-

determined-contributions/ndc-registry

Unit Nations Climate Change, 2018, The Paris Agreement. Available online:

https://unfccc.int/process-and-meetings/the-paris-agreement/the-paris-agreement

(2019-05-09)

United nation Climate Change (UNCC), 2015, Paris Declaration on Electro-Mobility

and Climate Change and Call to Action, United nation Climate Change, Paris.

Page 28: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

26

U.S. Department of Energy, n.d, A Common Definition for a Zero Energy Building.

Available online: https://www.energy.gov/eere/buildings/downloads/common-

definition-zero-energy-buildings (2019-05-12)

Y-M. Wi, J-U. Lee, S-K. Joo, (2013). “Electric Charging Method for Smart

Homes/Buildings with a Photovoltaic System” IEEE,

Widén, J. Wäckelgård, E. (2009) “A high-resolution stochastic model of domestic

activity patterns and electricity demand”, Applied energy 2010:87:1880-1882.

Uppsala

Page 29: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

27

8. Appendix

clear close all rng(1) %% Loading data and declare cases load('household_load') load('solar_irr_dat') load('distance_arrival_departure_sample_hour') numcar = 10; %number of cars days = 365; %number of the day in a year eff = 1; %charging efficiency %% monte carlo distance and time arrival and departure s = RandStream('mlfg6331_64'); dist = zeros(days,numcar); t_arr_day = zeros(days,numcar); t_dep_day = zeros(days,numcar); for rs = 1:numcar dist(:,rs) = randsample(s,dist_sample,days); t_arr_day(:,rs) = randsample(s,t_arr_sample_hour,days); t_dep_day(:,rs) = randsample(s,t_dep_sample_hour,days); end %convert hour of the day into hour of the year slot in a year day_to_year_reso = (0:24:24*365-1)'; t_arr = t_arr_day + day_to_year_reso; t_dep = t_dep_day + day_to_year_reso + 24; %% EV type, and solar, ev, load calculation %battery capacity of EV soc_max = 75e3; %wh? charge_max = 3.7e3; %charging capacity %km -> kwh %Tesla 20 kWh/100 km soc_arr = soc_max-2*dist*20000/100; %hyundai IONIQ 15 kWh/100 km %soc_arr = soc_max-2*dist*15000/100; soc_arr(find(soc_arr<1000))=1000; %Energy EV and household needed soc_target = soc_max; energy_req_ev_day = (soc_target - soc_arr)/eff; %already in kWh, divided by charging efficiency energy_req_ev_year = sum(energy_req_ev_day); %already in kWh energy_house_year = sum(load_60(:,1:numcar)); %kW15m -> kWh %PV power production energy_solar_irr_year = sum(solar_irr); %kW15m -> kWh %solar-ev-load NZEB solar_NZEB_plant = (energy_req_ev_year+energy_house_year)/energy_solar_irr_year; %area solar_plant = 1*solar_NZEB_plant; solar_prod = solar_irr*solar_plant; %+1gmt %solar_prod(89*24:299*24)= solar_prod(89*24-1:299*24-1);% with daylight saving %solar_prod(2:8760)= solar_prod(1:8759);%gmt+2 h_load = load_60(:,1:numcar);%(idx_mod,:);

Page 30: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

28

%solar_prod = solar_prod%(idx_mod,:); h_load_net = h_load - solar_prod; %copying the house load as a initial condition for dumb/smart charging h_load_net_ev_dumb = h_load_net; h_load_net_ev_smart = h_load_net; h_load_PV=solar_prod-h_load; %charging load smart_charge = zeros(8760,numcar); dumb_charge = zeros(8760,numcar); %% Charging scheduling for i = 1:365 for id=1:numcar if i<days %swithchin the last date of the year park_period = t_arr(i,id):t_dep(i,id); else end_day_time = days*24; idt1 = t_arr(i,id):days*24; idt2 = 1:(t_dep(i,id)-1)-days*24; park_period = [idt1,idt2]; end %% dumb charging b_soc = soc_arr(i,id); j = t_arr(i,id); while b_soc < soc_target && j < max(park_period) if soc_target - b_soc >= eff*charge_max dumb_charge(j,id) = charge_max; b_soc = b_soc + eff*dumb_charge(j,id); else dumb_charge(j,id) = (soc_target - b_soc)/eff; %divided by effi to make the battery full b_soc = soc_target; end h_load_net_ev_dumb(j,id) = h_load_net_ev_dumb(j,id) + dumb_charge(j,id); j = j+1; end %% smart charging ip = 0; %index_peak inp = 0; %index_offpeak %peak and off peak parking park_peak = []; park_offpeak =[]; for m = 1:length(park_period) if park_period(m) == 17 || park_period(m) == 18 || park_period(m) == 19 %or statement, peak time 17, 18, 19- ip = ip+1; park_peak(ip) = park_period(m); %parking time during peakpeak else inp = inp +1; park_offpeak(inp) = park_period(m); %parking time during offpeak end end t = length(park_period); %number of hours of parking period t_p = length(park_peak); %number of hours of parking period during peak load t_op = length(park_offpeak); %number of hours of parking period during offpeak load %algorithm implementation b_soc = soc_arr(i,id); j = t_arr(i,id); energy_req=soc_max-b_soc; %kwh that the cars has consumed if energy_req/t_op>=3.7e+03*eff

Page 31: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

29

Enp=soc_max-(t_op*eff*charge_max)-b_soc; %+(eff*charge_max*t_op); %batterys state of charge with maximum charging power during no peak charge_nopeak=charge_max*eff; charge_peak=(soc_max-Enp)/t_p; if t_p<=0 t_p=1; end if (soc_max-Enp/t_p)>=(charge_max*eff) smart_charge(park_period,id)=charge_max*eff; %charge with charge_max*eff during all hours % b_soc = b_soc +smart_charge(j,id); else smart_charge(park_nopeak,id)=charge_nopeak; smart_charge(park_peak,id)=charge_peak; %charge with charge_peak end else %if the EV must not charge during peak hours charge=energy_req/t_op; %charging amount for each hour ipv_x = 0; %index_solar_excess ipv_s = 0; %index_s park_PVexcess = []; park_PVshortage =[]; for n = 1:length(park_offpeak) %for all hours during parking period if h_load_PV(park_offpeak(n))>charge %om houseload is greater than zero %pv_charge(n)=h_load_PV(pv_hour,id); ipv_x = ipv_x+1; park_PVexcess(ipv_x) = park_offpeak(n); else ipv_s = ipv_s+1; park_PVshortage(ipv_s) = park_offpeak(n); end end t_pv_x=length(park_PVexcess); %numbers of hours when PV produced-houseload>0; t_pv_s=length(park_PVshortage); %numbers of hours when PV produced-houseload<0; if t_pv_x>0 %if there is more produced PV than the housload during the parking period if sum(h_load_PV(park_PVexcess)) < energy_req smart_charge(park_PVexcess,id) = min(3.7e3,h_load_PV(park_PVexcess)); smart_charge(park_PVshortage,id) = (energy_req-sum(smart_charge(park_PVexcess)))/t_pv_s; elseif sum(h_load_PV(park_PVexcess)) > energy_req smart_charge(park_PVexcess,id) = energy_req/t_pv_x; smart_charge(park_PVshortage,id) = 0; end else %if there is no hour where PV is higher than load smart_charge(park_period,id)=charge; end end h_load_net_ev_smart(park_period,id) = h_load_net_ev_smart(park_period,id) + smart_charge(park_period,id); end end %% %system net-load sys_load = sum(h_load,2); sys_load_net = sum(h_load_net,2); sys_dumb_charge = sum(dumb_charge,2); sys_smart_charge = sum(smart_charge,2); sys_load_net_ev_dumb = sum(h_load_net_ev_dumb,2);

Page 32: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

30

sys_solar_prod = sum(solar_prod,2); sys_load_net_ev_smart=sum(h_load_net_ev_smart,2); %performance comparison in statistics mean_load_net_no_ev = mean(mean(h_load_net)); mean_load_net_ev_dumb = mean(mean(h_load_net_ev_dumb)); std_load_net = std(sum(h_load_net,2)); std_load_net_ev_dumb = std(sum(h_load_net_ev_dumb,2)); std_sysload = std(sys_load); std_sysload_net = std(sys_load_net); std_sysload_net_ev_dumb = std(sys_load_net_ev_dumb); %daily average, declaring variable to optimize the code h_load_davg = zeros(24,numcar); h_load_net_davg = zeros(24,numcar); solar_prod_davg = zeros(24,numcar); h_load_net_ev_dumb_davg = zeros(24,numcar); dumb_charge_davg = zeros(24,numcar); smart_charge_davg = zeros(24,numcar); sys_load_davg = zeros(24,1); sys_load_net_davg = zeros(24,1); sys_solar_prod_davg = zeros(24,1); sys_load_net_ev_dumb_davg = zeros(24,1); sys_dumb_charge_davg = zeros(24,1); sys_smart_charge_davg = zeros(24,1); for k = 1:24 idx_day = k:24:8760; h_load_davg(k,1:numcar) = mean(h_load(idx_day,1:numcar)); h_load_net_davg(k,1:numcar) = mean(h_load_net(idx_day,1:numcar)); solar_prod_davg(k,1:numcar) = mean(solar_prod(idx_day,1:numcar)); h_load_net_ev_dumb_davg(k,1:numcar) = mean(h_load_net_ev_dumb(idx_day,1:numcar)); dumb_charge_davg(k,1:numcar) = mean(dumb_charge(idx_day,1:numcar)); smart_charge_davg(k,1:numcar) = mean(smart_charge(idx_day,1:numcar)); %system level sys_load_davg(k,1) = mean(sys_load(idx_day,1)); sys_load_net_davg(k,1) = mean(sys_load_net(idx_day,1)); sys_solar_prod_davg(k,1) = mean(sys_solar_prod(idx_day,1)); sys_load_net_ev_dumb_davg(k,1) = mean(sys_load_net_ev_dumb(idx_day,1)); sys_dumb_charge_davg(k,1) = mean(sys_dumb_charge(idx_day,1)); %sys_load_net_ev_smart_davg(k,1) = mean(sys_load_net_ev_smart(idx_day,1)); sys_smart_charge_davg(k,1) = mean(sys_smart_charge(idx_day,1)); end %self consumption self_cons_no_ev = zeros(8760,1); self_cons_ev_dumb = zeros(8760,1); self_cons_ev_smart = zeros(8760,1); for id = 1:8760 self_cons_no_ev(id) = min([sum(solar_prod(id,1:numcar)),sum(h_load(id,1:numcar))]); self_cons_ev_dumb(id) = min([sum(solar_prod(id,1:numcar)),sum(h_load(id,1:numcar)+dumb_charge(id,1:numcar))]); self_cons_ev_smart(id) = min([sum(solar_prod(id,1:numcar)),sum(h_load(id,1:numcar)+smart_charge(id,1:numcar))]); end self_cons_no_ev_rate = sum(self_cons_no_ev)/sum(sum(solar_prod(:,1:numcar))); self_cons_ev_dumb_rate = sum(self_cons_ev_dumb)/sum(sum(solar_prod(:,1:numcar))); self_cons_ev_smart_rate = sum(self_cons_ev_smart)/sum(sum(solar_prod(:,1:numcar))); self_suf_no_ev= sum(self_cons_no_ev)/sum(sum(h_load(:,1:numcar))); self_suf_ev_dumb= sum(self_cons_ev_dumb)/(sum(sum(h_load(:,1:numcar)))+ sum(sum(dumb_charge(:,1:numcar)))); self_suf_ev_smart= sum(self_cons_ev_smart)/(sum(sum(h_load(:,1:numcar)))+sum(sum(smart_charge(:,1:numcar)))); %% Peak load reduction

Page 33: Development of a Smart Charging Algorithm for Electric ...1321347/FULLTEXT01.pdf · powered vehicles, the EVs are powered by electricity from a rechargeable battery (UCS, 2018). There

31

peak_load_red=zeros(days,1); for m=1:days n = (m-1)*24; peak_load_red(m) = (max(sys_load_net_ev_dumb(n+(1:24)))-max(sys_load_net_ev_smart(n+(1:24))))/max(sys_load_net_ev_dumb(n+(1:24))); end peak_load_red_rate=mean(peak_load_red); %% hour = [0.5:1:23.5]'; figure % you can use plot function instead of area function plot_dumb=area([hour,hour],[sys_load_davg/1000,sys_dumb_charge_davg/1000]); plot_dumb(1).FaceColor = 0.7*[1 1 1]; plot_dumb(2).FaceColor = [0 0.75 0.75]; hold on plot_solar=area(hour,sum(solar_prod_davg,2)/1000); plot_solar(1).FaceAlpha = 0.6; plot_solar(1).FaceColor = [1 1 0.25]; plot_solar(1).EdgeColor = 'none'; legend('Household load','EV charging load','Solar power production'); xlabel('hour of the day') xlim([0.5 23.5]) ylabel('kW') %title('mean daily net-load profile with dumb charging, daylight savings 5 EVs ') disp('done') %% figure %smart charging % you can use plot function instead of area function plot_dumb=area([hour,hour],[sys_load_davg/1000,sys_smart_charge_davg/1000]); plot_dumb(1).FaceColor = 0.7*[1 1 1]; plot_dumb(2).FaceColor = [0 0.75 0.75]; hold on plot_solar=area(hour,sum(solar_prod_davg,2)/1000); plot_solar(1).FaceAlpha = 0.6; plot_solar(1).FaceColor = [1 1 0.25]; plot_solar(1).EdgeColor = 'none'; legend('Household load','EV charging load','Solar power production'); xlabel('hour of the day') xlim([0.5 23.5]) ylabel('kW') %title('mean daily net-load profile with smart charging, daylight savings 5 EVs') disp('done')