Tesi
Tesi
Supervisors Candidate
Prof. Marcello CHIABERGE
Alessandro GRASSO
Ph.D. Massimo REINERI
October 2022
Abstract
The protection of the planet and particularly the control of climatic alterations
is a theme that is becoming more and more neuralgic in today’s society and is
the reason that pushes for new developments and changes in everyday activities.
Since vehicles emit CO2 and many other greenhouse gases, being one of the major
pollution causes all around the world, electric vehicles are becoming more and
more crucial to partially solve the climatic change problem. The electric vehicles
and all the e-mobility panorama are in their first years, therefore it is all evolving
fast, trying to accomplish user and energy needs. The objective of this thesis is
to integrate ISO15118 to create a Proof of Concept (PoC) focused on the V1G
and the unlocking of energy flexibility in the automotive. The ISO15118 standard
main benefits are the improvement of the quality of the user journey during the
charging process with the new feature called "Plug & Charge", which allows the
user to start the electric vehicle charging just by plugging the cable in, without
the use of any easy-to-lose cards; the scheduling of the charging process based
on the e-mobility needs and the renewable energy availability, integrating "smart
charging" and "energy flexibility"; stronger data security with TLS 1.2 protocol,
ensuring confidentiality, data integrity, and authenticity. The PoC implements the
communication between the electric vehicle and the charging station, following
the ISO15118 requirements, with the implementation of the open-source protocol
stack "RiseV2G". The graphical user interfaces are implemented with the use of
two tablets (one for the electric vehicle and one for the charge point), in order to
allow the user to express his/her preferences about the payment option and the
charging profile. The electric vehicle and the electric vehicle supply equipment
operations regarding the charging communication are implemented with the use
of two micro-computers and two tablets. An accurate testing procedure has been
made to validate the PoC behavior in all the possible use cases.
i
Acknowledgements
I would like to thanks my supervisors Ph.D. Massimo Reineri and prof. Marcello
Chiaberge for the opportunity to collaborate with Accenture and for their support
during the thesis months.
This project would not have been possible without the support of the "Team
Max", I am very fortunate to have been a part of this group.
I am grateful for my family’s unconditional and loving support, which kept me al-
ways motivated and excited during these five years. Without them, this graduation
would have remained a dream.
Thank you to my partner, Greta, for always listening to me, even after long
days at work and during difficult times, for cracking jokes when things became too
serious, and for giving me the best advice everyday and the love to be strong in
front of any difficulties encountered during the journey.
Lastly, I would like to thank my friends and every single person that I met
during the journey who helped me reaching this goal.
ii
Table of Contents
List of Figures vi
Acronyms viii
1 Introduction 1
1.1 The electric vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Smart Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Vehicle-To-Everything technologies . . . . . . . . . . . . . . . . . . 12
1.4 State of the art of the charging infrastructure . . . . . . . . . . . . 17
3 RiseV2G 52
3.1 Protocol stack solutions . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2 The structure of RiseV2G . . . . . . . . . . . . . . . . . . . . . . . 53
3.2.1 RISE-V2G-SECC . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.2 RISE-V2G-EVCC . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.3 RISE-V2G-Shared . . . . . . . . . . . . . . . . . . . . . . . 70
5 Testing 97
5.1 AC/DC charging mode simulation with Plug and Charge . . . . . . 97
5.2 AC/DC charging mode simulation with QR code . . . . . . . . . . 99
6 Conclusions 102
6.1 Achieved results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.2 Future developments . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Bibliography 105
v
List of Figures
vii
Acronyms
EV
Electric Vehicle
BEV
Battery Electric Vehicle
HEV
Hybrid Electric Vehicle
PHEV
Plug-in Hybrid-Electric Vehicle
FCEV
Fuel-Cell Electric Vehicle
ICE
Internal Combustion Engine
AC
Alternate Current
DC
Direct Current
viii
V2G
Vehicle to Grid
PFC
Power Factor Converter
BMS
Battery Management System
AMI
Advanced Metering Infrastructure
RTU
Remote Terminal Unit
IoT
Internet of Things
G2V
Grid To Vehicle
V2X
Vehicle To Everything
V4G
Vehicle For Grid
V2V
Vehicle To Vehicle
V2L
Vehicle To Load
V2H
Vehicle To Home
ix
SoC
State Of Charge
EMS
Energy Management System
CP
Charging Point
WPT
Wireless Power Transfer
DWPT
Dynamic Wireless Power Transfer
BSS
Battery Swapping Station
EVSE
Electric Vehicle Supply Equipment
CCS
Combined Charging System
LLC
Low Level Communication
PWM
Pulse WIdth Modulation
PnC
Plug and Charg
x
BPT
Bidirectional Power Transfer
PKI
Public Key Infrastructure
ACD
Automated Connection Device
OEM
Original Equipment Manufacturer
HLC
High Level Communication
RPT
Reverse Power Transfer
EVCC
Electric Vehicle Communication Controller
SECC
Supply Equipment Communication Controller
EMSP
E-Mobility Service Provider
EIM
External Identification Mode
EXI
Efficient XML Interchange
xi
V2GTP
Vehicle-to-Grid Transfer Protocol
UDP
User Datagram Protocol
TCP
Transmission Control Protocol
TLS
Transport Layer Security
ECC
Elliptic Curve Cryptography
CA
Certificate Authority
CPO
Charge Point Operator
CSO
Charging Station Operator
CPS
Certificate Provisioning Service
GUI
Graphical User Interface
BL
Buisness Logic
xii
Chapter 1
Introduction
The protection of the planet and particularly the control of climatic alterations
is a theme that is becoming more and more neuralgic in today’s society and is
the reason that pushes for new developments and changes in everyday activities.
Since the industrial revolution, the human behaviour is dramatically speeding up
global warming, causing the increasing of the global average temperature, extreme
weather, rising sea levels, disappearing glaciers, and disruption of habitats that
could cause many plant and animal species to extinction. Global warming is caused
by a high concentration of greenhouse gases in the atmosphere, and one of the
primary ways these gases are released is by burning fossil fuels. As stated by the
World Health Organization (WHO), 91 % of the people in the world live in a place
that has a pollution level that far exceeds the threshold set by the WHO[1].
Vehicles emit CO2 and many other greenhouse gases, being one of the major
pollution causes all around the world. This is why electric vehicles are becoming
more and more crucial to partially solve the climatic change problem. In the last
years, vehicle manufacturers are making a very significant effort moving toward the
electric world, but the change can not be immediate: many years are required to
let the infrastructure be ready to support a large number of users with electric cars.
The electric vehicles and all the e-mobility panorama are in their first years, so it
is all evolving fast, trying to accomplish user and energy needs. The objective of
this thesis is to create a PoC focused on the ISO 15118 standard, which the main
benefits are the improvement of the quality of the user journey during the charging
process and the scheduling of the recharge based on the e-mobility needs and the
1
Introduction
• Electric Motor: it can act as motor, drawing energy from the battery to
drive the vehicle, or as a generator recovering energy from the car to refuel
the batteries;
• Inverter: it connects the electric motor with the battery. Its scope is to
2
Introduction
convert the DC voltage coming from the battery into the AC voltage needed
for power generation in electric motor;
• Electronic control device: hybrid vehicles are very complex, so the presence
of a controller to automatically switch the energy source from electric to ICE
and vice-versa, in order to guarantees that the vehicle runs efficiently.
Battery Electric Vehicles (BEVs) have only one energy source, namely an
electric battery. BEVs need to be frequently connected to an electric power source
to recharge the battery pack. The typical range of a full charged BEV is estimated
to be around 100-150 km, but high-end models of the BEV can cover about 300-
350 km. The simplest form of a BEV comprises a motor, clutch, a multi-speed
gearbox, and a differential. The latest models of BEVs consist of the electric motor
being directly placed in the wheel, thereby reducing the overall size and weight
of the entire vehicle [1]. A simple design of the electric vehicle can be composed
by a battery charger, a battery, a controller and obviously the electric motor.
3
Introduction
As described in [1], there are different motors that can be used in electric vehicles
word. The most suitable ones are DC motors, permanent magnet synchronous
motors (PMSMs), induction motors, switched reluctance motors (SRMs), and
brushless DC motors. DC motors were used heavily in HEVs and EVs thanks to
their simple construction, lower cost, and better speed regulation, but the presence
of commutators and brushes boosts the maintenance costs and decreases the number
of applications in high-speed scenarios. DC motors also have low efficiency, low
reliability, and bulky construction which guided the car manufacturers to look for
better alternatives for electric vehicles. Induction motors have been considered
as traction motors due to their robustness, reliability, and low maintenance. The
problem is the reduction in efficiency when used in high-speed applications, the
lower efficiency compared to permanent magnet synchronous motors, and the low
power factor. PMSMs have a simple structure, high efficiency, and high power
density. The main disadvantage is that this type of motor can also be demagnetized
due to the armature reaction. Anyway, PMSMs are being used commercially by
some car manufacturers. SRMs are robust and have exceptional speed-torque
characteristics. Unfortunately, the high noise, the torque ripple, and the tendency
of electromagnetic interference make this motor category less employed than the
4
Introduction
others. BLDC motors are a variation of permanent magnet DC motors in the regard
that the stator and rotor of the motors are interchanged. The lack of brushes,
their high performance, low weight, durability, and excellent controllability make
BLDCs the best option for electric vehicles. In fact, PMSMs and Brushless DC
motors, compared to the other type of motors, consume less fuel and, consequently,
contribute less to pollution thanks to a less percentage of greenhouse gas released.
The battery is one of the most important components of the electric vehicle,
since it affects the performance, the maximum range, and the time spent at the
charging point. The cost of the battery is high, and their lifespan is not so long, so
the researchers are looking for new technologies to make a more efficient battery
pack. Nowadays, the most implemented batteries are the nickel-metal hydride
(NiMH), the lithium-ion (Li-ion) and the lead-acid batteries.
Even if they are not the most used, the nickel-metal hybrid batteries have up
to double the specific energy and a greater energy density than the lead-acid ones.
Unfortunately, according to figure 1.2, they are expensive and have lower charging
efficiencies than other batteries. For this reason, they are not so used by the car
manufacturer.
Even if the nickel-metal hybrid batteries are safer than the Li-ion batteries,
these are the most used in the EV world. Thanks to their higher energy density
and efficiency, their long cycle life, and their compactness, they dominate the
market and are used by the most important car manufacturer, such as BMW, Tesla,
and Nissan. As described in [1], studies show that these batteries had the least
wheel-to-wheel energy consumption as well as the lowest greenhouse gas emissions.
Unfortunately, Li-ion batteries are quite expensive due to the scarcity of lithium,
so extensive research is being conducted, in order to find an alternate energy source
such as supercapacitors or graphene batteries.
As defined in [2] and in [3] , the charging system play a key role in the
vehicle and in the battery functionalities. Charging time, battery life and maximum
range of kilometers achievable strictly depend on the quality of the battery system.
Modern charging systems are composed of a boost converter, that is capable of
realizing a power factor correction (PFC) and then adapting the current value to
the desired one.
6
Introduction
• Monitoring of both the single cells and the voltage and current across the
battery. These measurings, adequately reprocessed by the microcontroller, are
used to determine the battery state of charge and the maximum charge/dis-
charge current that the battery can withstand in those operating conditions.
In fact, an incorrect charge or a deep discharge could damage the battery;
• Communicate to the vehicle controller how to use the energy available from
the battery pack, limiting the maximum power provided by the battery pack
The actual electrical grid is aging and outmoded, becoming impractical for the
coming future. Energy shortage, climate change, and environmental pollution
have become global issues affecting people’s quality of life and world economic
sustainability. Therefore, there is an absolute need to change the current energy
development and utilization patterns and find a green development path.
A smart grid can be defined as an electricity network that, supported by
innovative technologies such as mobile applications, Internet of Things (IoT), big
data analytics (BDA), and cloud computing, can integrate the behavior and actions
of all users connected to it, monitoring and controlling the power system in both
ways from power stations to end-users or vice-versa [4]. Unlike traditional grid,
the smart grid provides several aspects that are becoming fundamental in the e-
mobility word, such as availability, effectiveness, accuracy, controllability, flexibility,
interoperability, maintainability, measurability, reliability, sustainability, stability,
and security, as defined in [4]. These requirements of the smart grid allow the
power network to be more stable, robust and reactive to any failure that can occur
in the grid, detecting in advance vulnerabilities, power outages and blackouts.
8
Introduction
As depicted in figure 1.4, from a power point of view, the smart grid can be
divided in four main parts:
• Power consumption: with power consumption, all the elements that con-
sume energy are represented, such as electric vehicles, houses, and factories.
In the future, the number of consumers will significantly increase, especially
electric vehicles, so a robust grid is necessary to prevent possible frequent
problems.
In the smart grid, the power organization is integrated with the advanced
Information Technology (IT) and communication networks to deliver electricity
with improved efficiency and reliability, while reducing costs and environmental
impacts [6], as shown in figure 1.5. In addition to the power grid, the smart
grid is composed of sensing devices, information gateways, and the Advanced
Metering Infrastructure (AMI). The smart meters and the sensor continuously
communicate with each other and with the smart grid, providing measurements
about the energy consumption, energy losses, systems performances, and glitches
[7]. These information are also send to the central controller through gateways
10
Introduction
which function is to collect the data coming from the AMI, accomplishing the
conversion of protocol and communication among two heterogeneous networks
(wide area network (WAN) - home area network (HAN)), and propagate it to the
controller. One of the main advantage of the smart grid is energy flexibility: the
smart grid has to adapt the energy in order to manage variations in demand and
load handling, so a crucial design is required for the communication system, as
shown in figure 1.6.
The smart grid is organized in different regional control centers, which will
11
Introduction
communicate with the smart metering system and will supervise different substa-
tions and power plants. Meanwhile, all the crucial information are sent to power
system and power market operators to handle the energy process, and to Operation
Data management which analyzes the data through cloud computing and big data
processing. One of the major challenges related to the smart grid is the processing
and analyzing of big data coming from all the elements present in the grid. As
very well described in [6], all the data captured by the sensing elements and smart
meter must be processed in real-time, in order to improve efficiency and reliability.
Traditional data-sets are not powerful enough o manage all these heterogeneous
data-sets, usually named big data: advanced management approaches are needed,
such as big data analytics (BDA).
It’s fundamental to organize and identify the features of each stakeholder who
contribute to the development of smart grid. As already stated, every component
must communicate with the other, so every organization must apply to the rules and
make their part. Therefore, complex relations with all economic and social parties
such as government, power generation enterprises and users (such as residential,
commercial, small and large industrial consumers).
In the smart grid there is a special category of consumers: prosumers. They are
those consumers who can produce electricity using small-scale energy generators
installed at their houses or vehicles and then feed forward the electricity to the
grid. In particularly, vehicle-to-grid, vehicle-to-home and other technologies are
analyzed in the next paragraph.
to their rapidly increasing number, can help with this problem, working as "power
banks" of the smart grid, storing energy coming from renewable sources and then
giving it back through V2X (Vehicle-To-Everything) technologies.
Before describing the V2X technologies, it is necessary to understand what
is defined with V1G. V1G is the simplest form of electric vehicle unidirectional
smart charging: it allows energy flexibility, adjusting the power demand/response
according to the energy availability. With V1G, several data are exchanged between
the electric vehicle and the charging station, in order to prefer a charging profile
that meets the user needs but also the renewable energy availability. The EV is still
not capable of returning its energy back to the smart grid. If the EV state of charge
(SoC) is above the value requested by the user (e.g. the user wants to charge its
vehicle at 80% rate, if the SoC is 81% or above, the vehicle enters the V2G mode)
the electric vehicle enters the Vehicle-To-Grid (V2G) mode operation, being
able to return back its energy to the grid, using the battery pack as an energy
source for the grid. The control of the EV operation mode is visualized in figure
1.7, where G2V means Grid-To-Vehicle, so the normal charging of EV. With V2G,
there are benefits for every element of the Smart Grid: in fact, the EV owner will
be economically rewarded to offer this service.
As very well described in [8], V2G technology allows the vehicle to provide
13
Introduction
• Reactive power support: During the peak load period, the EV injects
reactive power into the grid in order to back up renewable energy sources and
minimize the difference between reactive power requested by the load, and
reactive power that the grid can provide at that moment. During the light
load period, instead, the EV is charged. It is very important to highlight that
enabling V2G technology doesn’t impact the EV SoC and the battery lifetime.
Anyway, to ensure reactive power support, sophisticated controllers, AC-DC
and DC-DC converters are required and researchers are trying to find the
most suitable ones: the unified controller can provide an excellent dynamic
response and steady-state performance; the sliding mode controller (SMC)
is able to accommodate unknown disturbances during operation; hysteresis
current controller resolves the SMC issues, is simple to implement and ensures
fast dynamic response. Even if its implementation may be expensive due
to the digital platforms required, Energy Management System (EMS) based
energy box controller is able to optimize the output of distributed energy
sources and ensure smooth control of active and reactive powers in V2G or
G2V operation mode. In fact, this technology ensures optimal battery modules
charging/discharging profiles, enhancing the reliability of the system.
The Vehicle for grid (V4G) technology allows the EV to act as an active
power filter, compensating the harmonics in line current and providing reactive
power when needed. A vehicle can also work as V4G and V2G simultaneously,
since V4G is a special case of V2G, as defined in [8].
Another very important technology is the Vechicle to home (V2H) which is
formed when the EV owner charges his/her vehicle at home. This network is then
formed by a single EV and a smart home and it is very easy to recreate in real life,
as described in [9]. V2H is one of the operation modes with the highest efficiency
and improves the utilization of renewable sources of energy. The vehicle, connected
to the home, can act as an energy source, contributing to reducing the household
daily load profile. As discussed for the V2G, the vehicle can inject reactive power
into the home grid or even into the community grid. Anyway, every application in
15
Introduction
V2H can interact with V2G, V2V and V2L, in order to synchronize every operation
and create a more reliable smart grid. If the home is equipped with renewable
energy systems, V2H comes in help by acting as a power bank to store the energy
produced by the solar panel. The EV battery degradation must be taken into
account since a significant reduction in its lifetime is inevitable.
By using Vehicle-to-Vehicle (V2V) technology, the vehicles can redistribute
their energy between EVs parked at charging points or connected to smart homes.
To allow this technology, an aggregator is required: as defined in [9], it is a controller
whose objective is to collect information about the EVs and the smart grid and
then synchronize the energy transmission between all the elements involved. The
aggregator group a specific number of EVs and allow the possibility to take the
energy from a fully charged EV and give it back to an electric vehicle that still
needs to be charged. When all the EVs under the management of the aggregator
have reached their desired SoC, the controller starts the interaction between the
smart grid, offering the EVs as energy sources. V2V has simple infrastructure
requirements and small transmission losses.
Last but not least, also the Vehicle-To-Load (V2L) technology can be im-
plemented by the EV, as described in [8]. It is a special case of V2H and V2V
operation modes: the EV is used to supply power to critical users, such as hospitals
or data centers, in case of malfunction of the grid.
The potential of V2X technologies is substantial, but there are still a lot of
challenges to be solved. First of all, economic terms must be defined: every stake-
holder must have a positive income out of the implementation of V2X technology.
Another crucial aspect is the battery pack degradation: a lot of services provided
by the EVs in V2X operation modes require the charge/discharge of the battery,
causing the reduction of the battery lifetime, degradation of the battery, and the
reduction of the maximum range of kilometers that the EVs can achieve without
charging again. As explained before, the BMS is responsible for controlling the
charging/discharging of the battery, protecting it from aging and degradation.
Everything in the smart grid is connected to everything, therefore, the whole
system is exposed to cyber-attacks. The attacker injects high-frequency signals
into the smart grid communication lines, taking control of the system. Now, the
controller has no longer access to the smart grid, and the attacker can take all the
sensitive data available (e.g passwords, data related to user privacy, ...). Still, the
16
Introduction
According to figure 1.8, there are three ways of charging the battery: conductive
charging, inductive charging, and battery swapping.
– Inductive Power Transfer (IPT): can be used for high power applica-
tions, with large air gaps.
– Capacitive Power Transfer (CPT): can provide low power, with tiny
air gaps.
• IEC 62196: this standard is divided in three parts, and its scope is to uniform
"plugs, socket-outlets, vehicle connectors, vehicle inlets and cable assemblies"
for electric vehicles, as defined in [10]. This standard is strictly correlated
to IEC 61851 standard that will be discussed later in this list. It is divided
in three parts: IEC 62196-1, which is defined for CP with operating voltage
not exceeding 690V in AC or 600 V in DC, describes the requirements of
the interface between an electric vehicle and a charging station, as well as
mechanical and electrical requirements and tests for plugs, sockets, vehicle
connectors and sockets of the vehicle to be used for charging EVs. Specific
designs are not described, since they can be found in other parts of the
standard. The focus is for accessories and cable assemblies that are meant to
be used in an ambient temperature of -30 to +50 °C. IEC 62196-2 apply to
EVs with operating charging voltage not exceeding 480 V AC. This part define
the plug types depending on the application (Type 1- single phase vehicle
couplers; Type 2- single and three phase vehicle couplers; Type 3- single and
three phase vehicle couplers with shutters). IEC 62196-3 describes specific
designs for vehicle connectors and sockets for vehicles to be used for DC
20
Introduction
• SAE J1772: This standard cover the general requirements of the physical,
electrical, and communication parts of the charging system in North America
and Japan. Different charging solutions are categorized in levels, as described
in [10]:
– Mode 2: Also this mode refers to AC slow charging mode, but the
22
Introduction
– Mode 4: This mode refers to the fast charging of the EV with an external
charger. The current can be up to 400 A, being an expensive but fast
charging process.
• Plug type 1: It is used in the USA and in Japan, 1-phase connector with
120 V / 240 V.
• Plug type 2: It is used in Europe and in China. Connector with 1-phase 230
V and 3-phase 400 V grid access.
• Combined Charging System (CCS): With this plug, two more pins are
added to the previously explained plugs, so that with a single connector, both
AC and DC charging are available. CCS1 adds the DC pins to the type 1 plug,
so it is used in the USA and in Japan. CCS2 is used in Europe and in China,
since it is a combination of type 2 plug and DC pins.
23
Introduction
As can be shown in figure 4.4, the pinout of the connector is the following:
• N: Neutral pin
Last but not least, the ISO 15118 standard series defines the requirements for
the communication between the EVSE and the EV. Since the thesis is focused on
this standard, the next chapter gives an in-depth explanation of the documents
and their requirements.
25
Chapter 2
• Plug & Charge (PnC): This feature allows the user to simply plug in
his/her electric vehicle to the CP, and the charging process start automatically,
with no need of other actions. The charging experience becomes user friendly
thanks to the EV-EVSE communication based on the exchange of digital
certificates. The presence of the certificates is required for security reasons
and it will be analyzed after in this list. This contract certificates is installed
in the EV and it enables the vehicle to automatically authenticate itself to
the charging infrastructure, without the need to find the easy-to-lose RFID
card to pay for the charge.
strategy is provided to the user. Therefore, the energy needs of the user are
accomplished, together with an increasing use of renewable energy, thanks
to the intelligent load management. Plus, pricing information are also taken
into account, allowing the user to spend less but still satisfying his/her energy
needs.
• Strong data security: The smart grid is a critical infrastructure with a lot
of information. For this reason, hacker attacks can happen. The ISO 15118 is
based on the OSI model, therefore, strong security on both transport layer and
application layer is required. The three pillars of data security are achieved:
confidentiality, integrity and authenticity. A Public Key Infrastructure (PKI)
enables a secure exchange of information based on asymmetric cryptography
(refer to paragraph 2.4 for in-depth explanation).
In the ISO 15118 standard, the communication between the EV and the charging
infrastructure is defined. More precisely, the involved parts are the Electric
Vehicle Communication Controller (EVCC) and the Supply Equipment
Communication Controller (SECC). But, to ensure a secure and automatic
authentication with related billing process, all the smart grid stakeholders are
involved. For this reason, the PKI, which enable a secure exchange of information
and certificates, is crucial and is analyzed in the paragraph 2.4 of this document.
The standard is divided into two main parts: a list of requirements to enable
all the features allowed by ISO 15118, and a general definition of the use cases.
– Energy transfer schedule: One of the first things the user does when
connecting his/her vehicle to the charging infrastructure is to negotiate a
charging schedule that must end before a specified amount of time (user
departure time). If for any reason, the smart grid is no longer able to
28
The ISO 15118 standard
respect the schedule, an error message must be shown to the user. At this
point, the user can activate the renegotiation of the charging schedule.
– Private data protection: User data shall not be accessible from non-
necessary parts. The user must always be informed about who is accessing
his/her data.
– Smart Grid energy limits: The SECC must inform the EVCC about
all the smart grid power limitations. Maximum voltage, maximum current,
and maximum power limitations, based on the smart grid or the EVSE,
are sent to the electric vehicle controller.
– Authorization of charging services: The EVSE checks if the EV
is allowed to charge and asks for payment methods (cash, EMAID, or
contract certificates). In the case of the contract certificates payment
method, the PnC feature is enabled, and the user certificate chain is
checked: this is due to privacy manner and it will be explained more in
deep in paragraph 2.4 (PKI).
– Wireless communication requirements: To enable WPT, additional
general requirements shall be specified. The SECCs may broadcast their
information to identify themselves, and the EV may associate with the
EVSE without the driver’s actions.
– Reverse Power Transfer (RPT) description: To let the vehicle act
as a power supply and feed back energy to the grid (or home), different
requirements are specified. First of all, the EVCC must comply with
local electrical safety requirements. The communication shall occur with
basic signaling plus HLC. The system can be "single channel" if the same
channel is used for both charging and discharging, or "dual channel" if two
different power channels are used for charging and discharging the EV.
– Traceability requirements: During the charging loop, both the EVSE
and the EV shall measure the active charging energy, reactive charging
energy, active discharging energy and reactive discharging energy. At
the ened of the charging process, the EVSE must be able to produce a
detailed document with all the energy information related to the charging
process just finished (e.g. AC/DC type of charge, total active and reactive
energy transmitted, control mode used).
29
The ISO 15118 standard
All possible use cases are defined in the ISO 15118-1, in order to enable the
communication between the electric vehicle and the EV supply equipment.
by the SECC. The electric vehicle and the EVSE inform each other about
their positioning status during the process until they are correctly aligned.
– Target setting and energy transfer scheduling: This use case covers
the charging process scheduling, the reverse power transfer, and bidirec-
tional power transfer. The charging schedule can be made according to
different factors that can be chosen by the user and the SECC: maximum
power that can be drawn from the charging point, local needs, grid needs
(e.g. drawn more power when produced with renewable sources), user
e-mobility needs (e.g. the user must leave by the 5 P.M. and needs the
car fully charged).
As shown in the figure 2.3 and described in [12], the charging process can be
divided in into four different elements:
tariff table contains the information related to the energy production and
the price.
– Scheduling It is the charging schedule based on the "Demand and
Prognosis" that respect the user e-mobility needs. It can be changed
during the transfer loop if requested by the SECC or the EVCC.
– Charging Control It covers the control of the charging process according
to the "scheduling". Renegotiation is executed if environmental conditions
are changed during the charging loop.
– Dynamic Mode: With the ISO 15118-2 standard, the user can choose
between different charging schedules. With ISO 15118-20, the dynamic
mode is added: no negotiation between the EV owner and the charging
point, but a dynamic mode that change the energy provided with respect
to the grid needs is accomplished. The EV yields control to the charging
station.
– Stronger data security: Longer keys for the certificates creation and a
new version of TLS is used.
– Easier multi-contract handling: The EV can now identificate itself
with more than just a contract. This can be useful, for example, to
have different certificates for different use cases: free charging, workplace
charging, home charging and so on. Obviously, all of this is transparent
to the user, and the OEM (Original Equipment Manufacturer) can decide
how many certificates to install on the EV.
ISO 15118-20 is a very recent standard: it has been published in May 2022,
so EVs do not implement this standard. Some of the actual electric vehicles
do implement the ISO 15118-2 standard. Therefore, a retro-compatibility
problem raises: if both the EV and the EVSE support ISO 15118-2 and ISO
15118-20, the latest one will be used. If one of the parts doesn’t implement
ISO 15118-20 but both the EV and the EVSE support ISO 15118-2, this
standard will be chosen. If there is no common standard supported by the
parts (e.g. EVSE only supports ISO 15118-20, and EV only support ISO
15118-2), the only way to complete the charging process is to use analogue
communication, based on PWM.
As already said, the ISO 15118-20 standard has been published in May, but
the thesis work started in march. Plus, open protocol stack solutions have
been released a month after, and, being a new technology, I preferred to relate
to the ISO 15118-2 standard and its long-year tested protocol stack solutions.
This ensures a more reliable PoC, but for the future, the ISO 15118-20 features
will be integrated into the demo.
layers: data link layer and physical layer. The basic signalling and HLC
general requirements are defined in standard ISO 15118-3. The EV-EVSE
communication is composed of basic signalling plus HLC: HLC is used in
addition to basic signalling in order to enable a bidirectional communication.
The standard also specifies all the control pilot requirements both from EVSE
side and EV side. The overall Plus, the interaction with standard IEC 61851
is covered. All the timings and constants of the EV-EVSE communication are
illustrated in this document, together with all requirements for the HomePlug
Green PHY Technology on control pilot line. The protocol SLAC (Signal
Level Attenuation Characterisation) is specified in ISO 15118-3.
• ISO 15118-5 "Physical layer and data link layer conformance test": As
for the ISO 15118-4, the scope of this document is to provide the requirements
to test the ISO 15118-3 standard. Therefore, all the messages related to layer
2 and layer 1 of the OSI model are checked.
• ISO 15118-8 ”Physical layer and data link layer requirements for
wireless communication”: This part of the ISO 15118 series specifies the
technical requirements for wireless charging communication on the physical
and data link layers, while for all the above OSI layers, the communication is
already described in ISO 15118-2. It covers the overall information exchange
between all actors involved in the electrical energy exchange, and only the
EVSEs compliant with the standard IEC 61851 is covered by this document.
36
The ISO 15118 standard
• ISO 15118-9 ”Physical and data link layer conformance test for
wireless communication”: This document provides the requirements to
test the part 8 of this standard series. This part of of the ISO 15118 family is
the only one still under development.
• Application layer: At this level, two different messages exist: SECC Dis-
covery Protocol (SDP) messages and V2G messages. SDP messages are used
at the beginning of the communication between the EV and the EVSE to
communicate their IP address, in order to set up the communication. The
V2G messages are used to exchange all the information related to the charging
process. The V2G message is divided into a body (the information of the
message), a header that contains the ID of the session, and eventually, the
signing if the message information is reserved.
• Transport layer: At this level, all SDP messages are transmitted using the
User Datagram Protocol (UDP), which focuses on the velocity of the message
more than its security. For the V2G messages, instead, Transmission Control
37
The ISO 15118 standard
Protocol (TCP) or Transport Layer Security (TLS) protocols are used. TLS
must be used when the messages need to be secured by encryption, therefore
every time Plug and Charge is selected.
• Network layer: On layer three, unique Internet Protocol (IP) addresses are
given to both the EVCC and the SECC. In addition, Stateless Address Auto-
configuration (SLAAC) and Dynamic Host Configuration Protocol (DHCP)
protocols are applied in this layer.
• Data link layer and Physical layer: This two layers are better defined in
ISO 15118-3 and it is where are defined the specifics about the electric signals
used to transmit the messages.
The focus of this document is about the application layer messages used by the
EVCC and SECC to communicate. The communication is based on a client/server
structure where the EVCC always acts as a client and the SECC acts as a server
during the whole charging process. Indeed, it is always the EVCC to ask for
a service through a request message, and the SECC responds with a response
message.
One of the first steps of the thesis project has been to understand every message
that the EVCC and the SECC send to each other, therefore a detailed explanation
of the messages is provided. The charging session can be divided in AC or DC and,
in turn, in EIM or PnC, resulting in four different message sessions: AC-EIM, AC-
PnC, DC-EIM, DC-PnC. Some messages are common for all the communications,
others are just for some of them.
The four main cases are represented by the following sequence diagrams.
38
The ISO 15118 standard
39
The ISO 15118 standard
40
The ISO 15118 standard
41
The ISO 15118 standard
42
The ISO 15118 standard
If the Plug & Charge method is chosen, three pair of messages can be ex-
changed between the parts: CertificateInstallationReq/Res, CertificateUp-
dateReq/Res and PaymentDetailsReq/Res.
• AuthorizationReq/Res: After the three above messages pair, all the com-
munication sequences continue with the AuthorizationReq/Res message pair.
If the payment method chosen is PnC, the EVCC responds to the challenge
previously sent by the SECC. Otherwise, the AuthorizationReq message is
empty. With the AuthorizationRes message, the SECC checks if the challenge
has been signed correctly. After this message, the EVCC is allowed to charge
at that specific charging point.
44
The ISO 15118 standard
Then, both AC and DC charging modes continue the communication with the
PowerDeliveryReq/Res message pair.
pair, both for AC and DC charging modes. The EVCC simply sends a Session-
StopReq message requesting the SECC to terminate the charging process. The
SECC responds with a SessionStopRes message, indicating if the termination was
successful.
• Confidentiality: This means that the content of the message will be read
only by the intended receivers.
• Authentication: This means that the parties involved are able to identify
themselves.
by the CA itself). The PKI structure defined in the standard ISO 15118-2 is based
on a hierarchical structure, where the CA lies at the top realizing the so-called
root certificates. Below the CA, the subordinated Certificate Authority (SubCA)
can be found, realizing intermediate certificates. They can be useful to group the
certificates, and sign them with their public key to issue them to the layer below.
In fact, after the intermediate certificates, there are the leaf certificates, that
belong to a private entity that only uses certificates provided by the layers above,
therefore the private key of leaf certificates is not used to sign other certificates.
When the certificate validity needs to be checked (e.g. to start the charging
process with PnC), three steps must be followed:
• Control that the certificate is valid at that precise moment therefore checks if
the current time is between the certificate released time and the certificate
expiring time.
• Verify that the certificate has been issued by a trusted party, checking the
chain of the certificates, i.e. all the signatures from the roof (CA’s and subCA’s
signature).
As shown in 2.8, four different chains are possible in the ISO 15118 ecosystem.
Here it follows a list of the parties that need to coexist in the ISO 15118 PKI:
• V2G root operator: is the highest trusted anchor in the ISO 15118 hierar-
chical structure and it issues certificates to all the ISO 15118 stakeholders.
When the EV is connected for the first time to a charging point, the only
EV available certificate is the one provided by the car manufacturer: the OEM
provisioning certificate. Therefore, the OEM chain shall be known by the charging
station in order to be able to authenticate the validity of the OEM provisioning
certificate.
A contract certificate is needed by the user to access the EMSP services, therefore
to communicate with it. The EV can not communicate directly with the MO, but
it has to pass through the charging station and the Charging Station Operator
(CSO). The Plug&Charge feature requires the presence and the validity of the
contract certificate in the EV. This certificate is created and issued by the EMSP,
for this purpose a different certificate chain is created. When the EV wants to
install or update the contract certificate, it can do it before the starting of the
charging process, by requesting it to the charging station. The CS forward this
request to the CSO that forwards it to the EMSP. To install the certificate issued
by the EMSP, the EV needs to use the OEM provisioning certificate public key
already installed.
Plus, the charging stations need a charging station leaf’s certificate in order to
establish the TLS connection with the EV.
In the PKI there are several actors and customers that need to coexist, and
since certificate handling is a critical and difficult task, the PKI can result very
complex. As described in [15], ISO 15118 defines different proposals to reduce the
complexity:
• Derive certificates from the same root CA: If every CS has a certificate
derived from a different CA, the EV shall store all these certificate chains.
Therefore, all the CS certificates must be derived from the same root CA.
• Limit the number of V2G root CAs in an electric vehicle: Since the
50
The ISO 15118 standard
51
Chapter 3
RiseV2G
– Project name
– Project version
– Information about the project creator
– Other build files explaining how to create a runnable project
RiseV2G makes use of a Maven project. Maven is used to build the project,
automating the process and creating, for example, a JAR file for the EV and
another one for the charging point. Other than automating and simplifying
the build process, Maven provides other useful features, such as: taking care
of all the project dependencies, perfectly integrating with the IDE Eclipse,
providing quality information about the project, and some useful guidelines
to follow for best practice development. In the RiseV2G case, the Maven
project generates four different projects, one for each folders (except for the
certificates one): RISE-V2G-SECC, RISE-V2G-EVCC, RISE-V2G-Shared,
RISE-V2G-PARENT. Maven also allows us to see the dependencies of each
project, e.g. the RISE-V2G-SECC and the RISE-V2G-EVCC depend on
RISE-V2G-Shared. The source code for each project is located at the directory
src/main/java, while in the target folder the created executable file (JAR file)
is kept.
of the java project. In RiseV2G, two property files exist, one for the SECC
(SECCConfig.properties) and one for the EVCC (EVCCConfig.priorities). These
two files are very important for our application since most of the important
parameters related to the charging communication are set here.
First of all, in both the priorities files is set the network interface on which the
EVCC-SECC communication can be established. It can be a wifi port, the ethernet
cable or it is even possible to create a communication loop, running both the
EVCC and the SECC on the same computer. For RiseV2G to run, network
interfaces have to provide an IP version 6 address. Another priority set in the
SECCConfig.priorities file is the one about the transfer mode supported by the
charging stations, picked from the following list defined in [14]:
• DC core
• DC extended
• DC combo core
These properties files are crucial since many fundamental parameters are set
here. They are frequently opened by the main to take the parameters values. For
this reason, I decided to insert here all the configurable parameters of the charging
session, in order to modify it from my own program. This is better explained in the
next chapter, where an in-depth explanation of the structure of the demo is given.
3.2.1 RISE-V2G-SECC
The RISE-V2G-SECC project is mainly composed by the following parts:
• Main: In the Main folder of the RISE-V2G-SECC project, just the SartSECC
java project is present. This file allows us to start the SECC. As already
said many times, ISO 15118 is a client/server communication where the
SECC acts as the server. For this reason, the SECC must already be active
when the EVCC program is launched. First of all, the values stored in the
SECCConfig.priorities file are loaded into the program, so that they can be
accessed at any time during the process.
Then, a UDP, a TCP, and a TLS servers will be launched, waiting for the EVCC
to connect. The UDP server is used at the beginning of the communication
setup, where the EVCC sends messages requests to the SECC asking for
the network interface address and the port of the SECC. Plus, the UDP
server is used by the EVCC to communicate if a TLS or TCP server-based
communication will be used. All these messages are exchanged according to
the SECC Discovery Protocol (SDP) specified by the ISO 15118-2 standard.
Before to launch the transport layer threads, the SECC session handler is
initialized. This is to avoid possible race problems, where the EVCC asks to
start a communication setup through the UDP server, but the communication
session is still not initialized.
and the EV simply wants to restore it, the connection handler is resumed
because it was been kept alive, but the TCP/TLS communication channel
needs to be opened again. In this file, if the EV requests a charging
pause, the communication channel is closed but the charging session data
is memorized.
– V2GCommunicationSessionSECC: This is the java project that han-
dles and manages the communication. Its scope is to define which con-
troller implementation to use (if the AC or the DC) and to create the
back-end interface. It has to handle the notifications arriving from the
communication and act correspondingly. The payment option defined in
the properties file is stored here so that the EV wants to know which
payment option is supported. This java file is crucial because it processes
the incoming message from the EV, and it sends the V2G message from
the SECC to the EVCC. The functions defined in this file are used by all
the states and controllers that will be explained later. Indeed, it is used
by the states as a shared file where important settings defined during the
charging process can be found, such as the energy transfer mode selected,
the status of the EVSE, the contract certificate chain, the status of the
charging process, and so on. In conclusion, this communication handler is
where the session is initialized and its crucial properties are stored.
• Backend interface: This file is crucial for the certificate’s use. Normally, an
OCPP communication would be used between the EVSE and the EMSP. In
RiseV2G, this is simulated by the BackendInterface.java project. Given the
OEM provisioning certificate, this project simulates the certificate chain that
the SECC has to check to authenticate the EV. This file interacts with the
certificates and keys generated with the shell files contained in the RISE-V2G-
Certificates folder. Simulating the interaction of the charging station with
the PKI, also the communication with the secondary actor (SA) is simulated
here. A list of the schedules provided by the SA is created and provided to the
EV. Based on the departure time provided by the EVSE during the charging
communication, this java project creates a sales tariff, indicating the energy
price against the time. Three different schedules are provided to the EV that
needs to choose the preferred one. This Sale tariff needs to be signed by the
SA if Plug&Charge has been selected. During the charging time, the sale tariff
57
RiseV2G
All the parameters set in these two controller files are then called and processed
by the corresponding states and sent to the EVCC in the correct response
messages, as defined in ISO 15118-2.
• States: During the communication with the EVCC, the SECC constantly
waits for a request message and then responds with a response message. For
this purpose, for every request message exists a WaitForMessageReq SECC
state. The ServerState java project contained in this folder manage the state
transmission of the SECC, analyzing the header and the body of the V2G
messages and deciding which state has to come next. Also, error messages are
handled for debug purposes.
The SECC’s states are the following:
For each service, the name and the category are specified, together with
the serviceID: this is a crucial element regarding the services and strict
rules are applied, as defined by ISO 15118-2. Indeed, ServiceID must be
a unsignedshort variable type: the 0 ID, together with the IDs from 5 to
60000 are reserved by ISO/IEC. Service ID 1 is for the charging services,
Service ID 2 is for the services related to the installation or update of the
certificates, Service ID 3 is for internet access and Service ID 4 is for the
exchange of EVSE-specific information. The Service IDs from 60001 to
65535 can be used for implementation-specific use.
SECC encrypts the private key and set the new certificate chain signature,
defining the ID, the encrypted private key, and the EMAID. Also, the
XML reference elements are set in this state.
– WaitForCertificateUpdateReq: If the EV’s certificate is about to
expire and if the remaining time is lower than the threshold chosen,
a CertificateUpdateReq is sent by the EVCC. The SECC, in this java
project, generates the new certificate and updates it. Also, a check of the
contract certificate chain is executed and eventual errors are handled.
– WaitForPaymentDetailsReq: If the certificate payment method has
been chosen, the EVCC sends a PaymentDetailsReq message. The SECC
processes it in this state and prepares to send the PaymentDetailsRes
message. The EV contract certificate chain is validated and saved. The
validity period of the certificate is checked again, and if it is lower than
the threshold, in my case twenty-one days, the certificate update must be
executed.
– WaitForAuthorizationReq: In this state, the SECC decides if the
authorization has been concluded with a positive result by reading the
signature inserted in the header of the AuthorizationReq message sent
by the EVCC. If the TLS connection has been chosen together with the
contract payment method, the signature is verified.
– WaitForChargeParameterDiscoveryReq: When the ChargeParame-
terDiscoveryReq is sent by the EVCC, the SECC creates a new schedule
if the charging process is not already started. Based on the tariff table
defined in the backend java file, the schedules are created. The sales
tariff is signed here, to simulate the real backend functionality, using the
security utils class contained in the security folder. The energy transfer
mode is checked again in this java file. At this stage, the parameters given
by the EV regarding the charging process are checked: if a mandatory
parameter has not been sent, an error must be shown to the user; also if
one of the parameters exceed the EVSE limits, an error must be prompted.
This is done for both the DC and the AC charging process.
– WaitForCableCheckReq: The SECC enters this state only if the DC
charging mode has been selected. A CableCheckRes message is sent
61
RiseV2G
indicating the EVSE controller status taken from the DCEVSE controller.
– WaitForPreChargeReq: It responds to the EVCC indicating the target
voltage and target current from the DCEVSE controller. Also the EVSE
status and the present voltage are taken from the DCEVSE class type
and sent to the EVCC.
– WaitForPowerDeliveryReq: In this state the SECC reacts to the
PowerDeliveryReq incoming message: if a start of the charge process has
been requested the SECC start the charging process, instead, if a stop
of the charge process is requested, the SECC stop the charging process.
If the EVCC asks for a renegotiation, the SECC checks if there is a
charging process ongoing; if this is the case, the SECC responds with a
PowerDeliveryRes message indicating the possibility to renegotiate the
charging schedule. In this state, the charging profile is checked, and
the response message is prepared in order to send the EVSE status for
the AC or DC controller, depending on te charging mode selected. The
PowerDeliveryReq message coming from the EVCC is crucial to start,
stop or renegotiate the charging process.
– WaitForCurrentDemandReq: In DC charging, during the charging
loop, the EVCC continuosly sends a CurrentDemandReq message request-
ing the SECC to send the charging parameters status. Indeed, in this
state all the requested parameters are set and send to the EVCC through
a CurrentDemandRes message. Plus, the SECC indicates the EVCC to
send a MeteringReceiptReq message if Plug&Charge feature has been
selected. In case of EIM, the metering receipt is not involved in the
charging communication.
– WaitForChargingStatusReq: In AC charging, during the charging
loop, the EVCC continuously requests the charging status to the SECC.
In this state, the EVSE state is set and sent to the EVCC.
– WaitForWeldingDetectionReq: A WeldingDetectionRes is created
and sent containing the EVSE status and the present voltage.
– WaitForMeteringReceiptReq: In the case of PnC, the EVCC must
send a MeteringReceiptReq message, sending the metering values. If these
values match the ones sent by the SECC, the charging process can end, if
62
RiseV2G
• Transport layer: Inside this folder are defined the servers used during the
communication: TLS, TCP and UDP. For each server a java file is created.
These java files are called by the SECC’s main to initialize the communication
sockets. The local address of the servers is taken from the properties file, and
the port number is generated randomly.
3.2.2 RISE-V2G-EVCC
The RISE-V2G-EVCC project is mainly composed of the following parts:
• Main: This Java class is simpler than the main class for the charging station.
Only two actions are taken here: setting of the correct properties file and
initiation of a ”session handler” for the EV communication controller. A
session handler is a program that takes care of the message flow between
the EVCC and the SECC. It makes sure that the EVCC is sending request
messages in the right order and processes the incoming responses accordingly.
• EV controller: This java project is crucial for the EV operations: all the
actions taken by the EVCC are defined here and called from the states files
during the charging process.
One of these functions allows the EVCC to get the payment methods supported
by the SECC in any state, so that can be shown to the user through a human-
machine interface.
The Energy transfer mode of the EV is defined here.
Plus, the following parameters for the AC charging mode are defined:
– Departure time: The number of seconds the user expects to leave the
car at the charging station.
– Energy amount: Energy amount needed for the charging of the battery
pack, expressed in Wh.
– EV maximum voltage: Maximum voltage the EV can accept from the
EVSE.
– EV maximum current: Maximum current the EV can accept from the
EVSE.
– EV minimum current: Minimum current the EV can accept from the
EVSE.
64
RiseV2G
Also for the DC charging mode, the parameters are defined as follows:
– Departure time;
– Energy amount;
– EV maximum voltage;
– EV maximum current.
The charging profile is defined in this java file. From the secondary actor
services provided by the SECC, the wanted schedule is selected. Initially,
always the same schedule was selected. As explained in the next chapter, in
the demo I let the user decide which schedule to choose.
The EV controller project also defines the EV status: if it is ready to charge
and the state of charge.
Other fundamental parameters such as the target voltage and the target
current are defined here and then taken by the different states and sent to the
SECC, according to ISO 15118-2 requirements.
Plus, if the charging is complete has to be defined here, together with the
remaining time to fully charge the battery, or to charge 80% of the battery.
The last crucial parameters defined in this file are the following: the maximum
power, the maximum voltage, and the maximum current limits for the EV.
Lastly, a very important function called isCharginLoopActive is defined here.
With this function, a static charging flow is created: the charging process
just lasts one hundred cycles, with a renegotiation at the fiftieth cycle. It is
obviously set in this way just for testing purposes. I changed it, transforming
the test into a simulated communication where the charging process is stopped
only when the user asks to terminate the charging or when the EV battery is
fully charged. All my changes applied to RiseV2G are explained in the next
chapter, paragraph 4.6.
• States: During the communication with the SECC, the EVCC constantly
sends a request message and then waits for a response message. For this
purpose, for every response message coming from the SECC, exists a Wait-
ForMessageRes EVCC state. The ClientState java project contained in this
folder manage the state transmission of the EVCC, analyzing the header and
65
RiseV2G
the body of the V2G messages and deciding which state has to come next.
Also, error messages are handled for debug purposes. Through this file, the
states projects can access the properties defined in the controller project.
The EVCC’s states are the following:
• Transport layer: Inside this folder are defined the servers used during the
69
RiseV2G
communication: TLS, TCP, and UDP. For each server, a java file is created.
The header of the V2G message coming from the SECC is analyzed here. If
the payload of the header is too high, an error is prompted. Also if the SECC
message arrives after the timeout, an error is shown. If an error occurred in
the run method, the TCP client will be stopped by closing all streams and the
socket and interrupting the thread. The local address of the servers is taken
from the properties file, and the port number is generated randomly.
3.2.3 RISE-V2G-Shared
The shared project is where global values used by every project are defined. The
RISE-V2G-Shared is mainly composed of the following parts:
• Shared EXI codec: This folder is used to encode and decode the V2G
messages using the EXI codec to reduce the size of the messages and speed up
the process.
• Message handling: In this project, the status change is handled for both the
EVCC and the SECC. Based on the information received from the states, the
following state is launched. Also, the message is created, adding the header
and the body to send. All these functions handling the received message or
the to-be-sent message are called by the states or the controllers, to perform
precise actions. The pause and termination of the charging session functions
are also defined here.
– Security utils: In this project, all the functions related to security for
both the EVCC and the SECC are defined and then called by other
programs. The contract certificate status object is defined. A method
70
RiseV2G
returning the certificate chain and the password is created and can be
called by EVCC or SECC. These data are taken from a truststore file
that is kept outside the JAR file: this is because the JAR file is read-only,
while the certificates and the keys need to be modified.
A verifyValidityPeriod method is defined where the certificate validity is
check with regards to date and time.
The verifyDomainComponent method is called to verify the PKI compo-
nents defined in the certificate chain (OEM, CPS, CPO).
The getValidityPeriod returns how many days the certificate is still valid.
If the certificate is not valid any more, a negative number will be returned
according to the number of days the certificate is already expired.
The verifyCertificateChain method verifies the signature for each certifi-
cate present in the given certificate chain (leaf, SubCA2, SubCA1, root).
The verifySignature verifies if the certificate has been signed with the
correct private key associated to the given public key.
Several methods handling the PKI structure are defined (e.g. getting the
leaf certificate, getting the SubCA certificate, returning the public key of
every certificate, etc.)
The saveContractCertificateChain is called by the WaitForCertificateIn-
stallationRes and the WaitForCertificateInstallationRes states to store
the new certificates provided by the SECC. Also the functions defining if
the installation or the update of the certificate is needed are defined in
this file.
One of the most important methods defined here is the getCertificateChain
which is called by several states and is able to return the whole certificate
chain, starting form the leaf certificates until the root certificate.
All the algorithms encrypting and decrypting the keys are defined here
and can be called by every program present in RiseV2G.
The getEMAID returns the e-mobility account identifier from the contract
certificate as part of the contract certificate chain.
The verifySignature verifies the signature given in the received header of
an EVCC or SECC message.
– Misc utils: In this file, a method that determines the link-local IPv6
address, which is configured on the network interface provided in the
71
RiseV2G
72
Chapter 4
• Plug&Charge: The user can simply plug the cable into the EV and the
charging process starts automatically. If the user still want to use an RFID
card, is possible by scanning the QR code at the charging station.
• Strong data security: TLS protocol is used to exchange data between the
73
Proof of concept focused on ISO15118
The scope of the PoC is to demonstrate the future electric vehicle charging
experience, with the main objective to improve the quality of the user journey
during charging operations.
The JDK is platform-specific and it is used to create Java programs: it converts the
source code into a form that the JVM and the JRE can execute. It comprehends
different tools required to compile, debug and run the source code. Since these parts
are necessary to implement a Java program and make it platform-independent,
the selected boards will have to support it as well. Implementing a JVM for
a micro-controller is very difficult, due to its low memory capacity and limited
computing capacity. Another factor that has been taken into account is the need of
a display and a camera. For this reason, it is necessary to use two micro-computers
that run a proper operating system with the JVM already integrated.
76
Proof of concept focused on ISO15118
times: this is just to test that the messages are exchanged correctly. Since the
proof of concept objective is to simulate a real charging session, the communication
ends when the battery is fully charged (battery state of charge is simulated by the
PFS program of the EVCC).
For these reasons, RiseV2G has to be managed by the BL, that pause the EV-EVSE
communication to wait for the user interaction. Moreover, it is the BL that stops
the charging session when it receives the information from the PFS that the battery
is fully charged, or when the user selects it on the EV tablet. For this purpose, a
socket communication between RiseV2G and the BL is created for both the EVCC
and SECC parts. Any time RiseV2G changes its state, it has to communicate it
to the BL that can stop RiseV2G, in order to wait for the user interaction or just
to check the parameters coming from the EVCC-PFS or the EV-PFS. Since the
socket has to be called by both the EVCC and the SECC, it has been implemented
in the RISE-V2G-Shared folder, in the MiscUtils file.
The socket handle the RiseV2G-BL communication in both ways: the RiseV2G
starts the socket communication in order to communicate to the BL its current state
and all the parameters coming from the other part (i.e. at the EVCC-RiseV2G,
the parameters coming from the SECC can only be transmitted through ISO15118,
therefore, these parameters must be passed to the BL that will handle and pass
them to the EVCC-PFS and to the EVCC-GUI). The BL starts the socket anytime
it wants to communicate something to the other part (e.g. the EV user has selected
the departure time that has to be sent to the SECC through RiseV2G) using
ISO15118 communication standard.
How the BL synchronize and handle the EV and the EVSE processes is better
explained in the dedicated paragraph of this chapter.
It follows a list containing all the parameters modified at the EV part, by the
PFS, or by the user via the GUI:
• Departure time: It is selected by the user via the EV graphical user interface.
The user can communicate the departure time in hours and minutes, but the
ISO15118 requires it in seconds, therefore conversion is necessary. It is sent
within the ChargeParameterDiscoveryReq message in all four possible charging
modes.
• Chosen SA schedule ID: The user can choose between three different
charging profiles proposed by the EVSE. Every charging profile is defined in
the "Sales Tariff" property, defined later, with a different ID. It is sent within
the PowerDeliveryReq message in all the charging modes (AC-EIM, AC-PnC,
DC-EIM, DC-PnC).
79
Proof of concept focused on ISO15118
• Remaining time to bulk SoC: Calculated in the EV-PFS and sent within
the CurrentDemandReq message.
• Remaining time to full SoC: Calculated in the EV-PFS and sent within
the CurrentDemandReq message.
The SECC parameters modified by the PFS or by the user via the GUI are the
following:
• EVSE maximum voltage limit: It is the maximum voltage the EVSE can
deliver. It is defined in the EVSE-PFS and sent within the ChargeParameter-
DiscoveryRes message in DC charging modes.
• EVSE minimum voltage limit: It is the minimum voltage the EVSE can
deliver with the expected accuracy. It is defined in the EVSE-PFS and sent
within the ChargeParameterDiscoveryRes message in DC charging modes.
• EVSE maximum current limit: It is the maximum current the EVSE can
deliver. It is defined in the EVSE-PFS and sent within the ChargeParameter-
DiscoveryRes message in DC charging modes.
• EVSE minimum current limit: It is the minimum current the EVSE can
deliver with the expected accuracy. It is defined in the EVSE-PFS and sent
within the ChargeParameterDiscoveryRes message in DC charging modes.
• EVSE maximum power limit: It is the maximum power the EVSE can
deliver. It is defined in the EVSE-PFS and sent within the ChargeParameter-
DiscoveryRes message in DC charging modes.
• Meter reading: It includes the meter-Info record containing the latest meter
reading and other meter relevant data. It is defined in the EVSE-PFS and
sent within the ChargingStatusRes message in DC charging modes.
81
Proof of concept focused on ISO15118
• Sales Tariff: This is the most important and complex parameter modified.
In the ChargeParameterDiscoveryRes, the SAScheduleList containing up to
three SAScheduleTuples is sent. Every SAScheduleTuple is a different charging
profile that the user can choose: there are up to three different charging
profiles, each of them with several information about the maximum power
delivered from the EVSE, the price against the time, the percentage of energy
coming from renewable sources and the emission of carbon dioxide.
For this reason, every SAScheduleTuple is composed of:
It follows an example of the Sales Tariff graph of the charging profile. In addi-
tion to this graph, a parallel graph describing the maximum power delivered
by the EVSE is provided in the demo.
To define the above-described graphs, for each charging profile the following
parameters are sent to RiseV2G from the EVSE-PFS:
– Times vector: Vector defining the time division, from 0 until the depar-
ture time selected by the user.
– Eprice levels vector: Vector defining the EPrice level for each time
segment.
– Percentages prices vector: Vector defining the percentage of the total
price for each time segment.
– Renewable percentages vector: Vector defining the percentage of
energy obtained from renewable sources for each time segment.
– Carbon emission vector: Vector defining the carbon Dioxide emissions
for each time segment.
• Startup screen: The first page shown to the user indicates the starting of
the charging station, together with the Accenture logo.
• Standby screen: This page is displayed every time no electric vehicles are
connected to the charging station. The available charging modes supported
by the charge point are indicated (AC/DC). Also, the different charging
payment options are shown to the user (RFID simulated by a QR code and/or
Plug&Charge).
84
Proof of concept focused on ISO15118
• Waiting screen: Meanwhile the user chooses the departure time and the
charging profile, and the charge point display a page requesting the user to
make his choices.
• Charging preparation screen: When all the charging properties have been
defined, the EVSE proceeds to prepare the charging session. At this moment,
a page indicating the charging preparation is displayed.
– Pause: The user can indicate to pause the charging session, for example,
if the battery charging level is almost reached but the departure time is
still distant.
– Terminate: The user can terminate the charging session at any moment,
via the EVSE or the EV tablet.
– Renegotiation: If the user wants to change the charging profile previously
agreed, he can activate the charging renegotiation through this button.
If any of the previous buttons are selected by the user, the information is sent
to the EVSE business logic that will handle the user request.
The objective of the EV-GUI is to communicate with the user and allow him
to express his preferences about the vehicle charging.
The following pages are realized and displayed to the user:
• Startup screen: The first page shown to the user indicates the starting of
the electric vehicle, together with the Accenture logo.
86
Proof of concept focused on ISO15118
• Identification screen: In this page, the user can select the payment option
between the ones supported by the EVSE. Depending on the choice, a new
page is displayed.
• EIM screen: If the user has chosen the EIM method, the user is requested
to scan the QR code at the charging station. The validity of the QR code is
then shown to the user, informing him about the correct authentication.
• Departure time screen: The user is asked to insert the expected departure
time. This information is needed by the EVSE to calculate the possible
charging profiles.
• Charging preparation screen: When all the charging properties have been
defined, the EVSE proceeds to prepare the charging session. At this moment,
a page indicating the charging preparation is displayed.
– Pause: The user can indicate to pause the charging session, for example,
if the battery charging level is almost reached but the departure time is
still distant.
– Terminate: The user can terminate the charging session at any moment,
via the EVSE or the EV tablet.
– Renegotiation: If the user wants to change the charging profile previously
agreed, he can activate the charging renegotiation through this button.
If any of the previous buttons are selected by the user, the information is sent
to the EV business logic that will handle the user request.
• EV maximum voltage
• EV maximum current
• EV minimum current
• EV maximum voltage
• EV maximum current
• EV maximum power
• EV target voltage
• EV target current
All these properties are defined before the testing phase and they can not be
changed during the charging simulation.
The following values, instead, change during the charging process:
• Remaining time to bulk SoC: Based on the power that the EVSE is
delivering, the PFS calculates the needed time to reach the 80% battery
charge goal.
• Remaining time to full SoC: Based on the power that the EVSE is
delivering, the PFS calculates the needed time to reach the 100% battery
charge goal.
The main objective of the EVSE-PFS is to define the EVSE properties regarding
the power, the current, and the voltage that can be delivered. As per the EV-PFS,
all the EVSE properties can be chosen before the test phase, or they can be
generated randomly, with different weights or with a gaussian distribution, in order
to recreate the most possible situation.
The following properties are defined in this project file:
• Meter reading: This parameter is sent by the EVSE during the charging
session loop, and it is defined as the current energy delivered by the EVSE
during the EV charging, therefore expressed in Watt-hour.
• Sales Tariff: Three different charging profiles are created. Each of them has
different values of power deliverable, different percentages of renewable energy,
carbon emission, and price per time.
90
Proof of concept focused on ISO15118
• __init__ method: This method is called when the only class of the EV-BL
program is called. At the raspberry simulating the EV, the first program
launched is the EV-BL, therefore its main is called. The only code line of
the main is the recall of the BL class, which the __init__ method starts
the different threads. The main thread recall the BL_loop method, which
continuously check for the RiseV2G state to understand the next step to be
completed. Another crucial thread launched in the initial method is the socket
one: it is called every time the BL needs to communicate with the RiseV2G
implementation. The last thread launched is the one about the GUI: the first
page showing the startup screen is displayed for about six seconds. After the
startup screen, the others page are managed by the BL_loop method.
• BL_loop: This loop follows the message sequence defined in the ISO15118-2
standard, managing RiseV2G to send/receive the correct messages and to stop
91
Proof of concept focused on ISO15118
92
Proof of concept focused on ISO15118
Also, the user can request a renegotiation: if EVCC plans to perform a rene-
gotiation, it shall start by sending a PowerDeliveryReq with the parameter
ChargeProgress set to Renegotiate, followed by an exchange of ChargeParam-
eterDiscoveryReq/Res and PowerDeviveryReq/Res message-pairs and then
re-enter the charging loop.
The user can also ask to terminate the charging session. The charging can
be stopped also automatically by the EVCC when the EV battery, simulated
in the EV-PFS, is fully charged. At this point, the final Charging com-
pleted screen is displayed, sharing some information about the just-concluded
charging session.
The EVSE-BL is similar to the EV_BL concerning the structure and methods,
but the BL_loop is quite different. The methods are the following:
• __init__ method: This method is called when the only class of the EVSE-
BL program is called. Also at the raspberry simulating the EVSE, the first
program to be launched is the EVSE-BL, therefore its main is called. The
only code line of the main is the recall of the BL class, in which the __init__
method starts the different threads. The main thread recalls the BL_loop
method, which continuously checks for the EVSE-RiseV2G state to understand
93
Proof of concept focused on ISO15118
the next step to be completed. Another crucial thread launched in the initial
method is the socket one: it is called every time the BL needs to communicate
with the RiseV2G implementation. The last thread launched is the one about
the GUI: the first page showing the startup screen is displayed for about
six seconds. After the startup screen, the others page are managed by the
BL_loop method.
• BL_loop: This loop follows the message sequence defined in the ISO15118-2
standard, managing RiseV2G to send/receive the correct messages and to stop
it, allowing eventual calculations or user interactions. Instead of a RiseV2G
free-running, the BL needs to frequently stop it, request the current RiseV2G
state via the socket method, and, based on the RiseV2G state, a specific action
is executed.
After the startup screen, the Standby screen is displayed, waiting for the user
to connect the EV to the charge point. When the EV is plugged in, the
EVSE-PFS is launched to generate the charging parameters to be sent to
SECC-RiseV2G via the socket method.
The EVSE has to wait for the user to choose the payment method, therefore
the Identification screen is shown. The payment option is received by the
SECC-RiseV2G through the PaymentServiceSelectionReq message sent by the
EVCC-RiseV2G.
If the payment method chosen is EIM, the EIM screen is displayed indicating
the user to bring the QR code closer to the camera. The QR code method is
called in order to scan the QR code exposed by the user’s smartphone.
If the PnC method has been chosen, the certificate checking messages need to
be exchanged, therefore the Certificates screen informing the user about the
EV certificate status is shown.
At this point, the user has to choose the departure time and the charging
profile previously computed by the EVSE-PFS: therefore, during this time,
a Waiting screen is displayed on the charge point tablet. If the charging
mode requested by the EV is DC, to start the charging process the EVSE
must provide the exact voltage and current requested by the EV. Therefore, a
charging preparation procedure has to be accomplished. During this time the
Charging preparation screen is displayed.
Now the charging process can start: the EV Charging in progress screen is
94
Proof of concept focused on ISO15118
shown during the message sequence loop. All the properties handled by the
EVSE-PFS are continuously updated and sent to the EVSE-BL to simulate
the power values. As per the EV-GUI, the user can choose to stop, pause or
renegotiate the charging session.
If the pause is requested, the EVSE-BL communicates this intention to SECC-
RiseV2G which will send this information to the EVCC-RiseV2G. The user,
then, can restart the charging session with the same charging profile previously
established.
If the renegotiation is requested, the EVSE-BL tells the SECC-RiseV2G to send
a ChargingStatusRes message with EVSENotification set to ReNegotiation
to ask EVCC to proceed to a renegotiation. Then, the EVCC shall start
another round of negotiation by sending PowerDeliveryReq followed by an
exchange of ChargeParameterDiscoveryReq/Res and PowerDeviveryReq/Res
message-pairs.
If the termination of the charging session has been requested by the user, or
by the EV-BL because the charging is completed, the final Charging completed
screen is displayed, sharing some information about the just-concluded charging
session.
• Open_page method: As per the EV-BL, this method is called anytime the
BL wants to open a new page on the tablet. It recalls a different EVSE-GUI
class method, which will open the selected page.
96
Chapter 5
Testing
In this chapter, different charging sessions are simulated, in order to test the demo
functioning in all the possible cases. The use cases analyzed are the following: DC
charging mode with PnC or QR code (simulation of RFID card), AC charging
mode with PnC or QR code. In both simulations, a renegotiation and a pause of
the charging session are requested, in order to verify the correct operation of the
proof of concept. For all the use cases, the user point of view is analyzed, together
with the actual functioning of the demo programs and of the implementation of
RiseV2G.
telling him to wait for the certificate process handling. This operation usually
doesn’t take longer than a few seconds because the certificates are all stored locally:
in a real use case, the certificate can be downloaded by a secondary actor, leading
to a longer waiting time.
At the beginning of the demo, all the EV and EVSE power-related values are
generated by the EV-PFS and EVSE-PFS programs. These values are generated
randomly, but according to real values implemented in the market. All these
properties are then used during the charging process to simulate, for example, the
battery state of charge during the charging process, or the energy delivered by
the charging point during the connection. Some of these values will be uploaded
during the EV charging, and some of them will be sent to the other part within
the correct message, as defined in the ISO15518-2 document standard.
To start the EV-EVSE communication, the two raspberry need to be connected with
the Ethernet cable, simulating the connection of the electric vehicle at the charging
point. In this PoC, the power part of the charging process is not considered, since
the focus is on the communication between the two sides, based on the requirements
of the ISO15118 standard.
After that, the user is requested to insert the departure time: based on this value,
the EVSE-PFS generates the three different charging profiles with values close to
the real ones. These charging profiles are then passed to the electric vehicle and
shown on its screen: now, the user can choose the charging profile that he prefers,
having information related to the price, the energy coming from renewable sources,
and the emission of carbon dioxide.
Now, the charging process is ready to start: during this time, a page showing
information about EV charging is displayed on the EV display. Meanwhile, the
battery state of charge, simulated in the EV-PFS program, increases according
to the power delivered by the charging point (also this value is simulated, in the
EVSE-PFS program). Since the EV battery would take hours to completely charge,
the battery charging is sped up, in order to complete the test within a few minutes.
If no action is executed during the charging process, this is completed correctly
and a final screen showing the main charging information is displayed: here, the
user can see how much time the charging has lasted, the energy delivered, and the
carbon dioxide emissions.
Otherwise, the user can ask for a pause of the charging session: in this way the
98
Testing
charging is just paused, meaning that the battery state of charge no longer increases,
and the energy delivered is null. The user can restart the charging process whenever
he wants, leading to the battery state of charge increasing.
The user can also ask for the renegotiation of the charging profile: the state is
changed from ChargingStatusReq/Res to ChargeParamterDiscoveryReq/Res, in
order to ask again the user for the departure time. Three new charging profiles are
proposed to the user which can select the most suitable one and let the charging
process start again. This operation can be made an infinite number of times during
the charging process.
If the DC charging mode is tested to carry out the charging process for an EV
with no onboard charger, the functioning of the demo is basically the same, adding
some messages regarding the alignment of the voltage requested by the EVCC and
the one present at the charging point. From the user’s point of view, the charging
process gets completed in the same way.
One of the problems that occurred during this testing phase, is the communication
within the BL and the RiseV2G implementation. This is because the SECC can not
stop the communication, otherwise, an error coming from the timeout expiration
occurs. For this reason, the communication between the EVSE-BL and EVSE-
RiseV2G with the socket must occur fast, leading to no waiting time. On the
EVCC side, instead, since the user has to have time to think about his choices, no
timeout limit is present. Therefore, the EVCC is free to pause the communication
on how long he needs, but a timeout has been inserted to reset the communication
in case a problem occurs and it’s not detected (for example the user is not able to
insert his choices on the display).
message must be sent by the EVCC. Within this message the SelectedPaymentOp-
tion parameter is sent and the identification method chosen: Pluig&Charge or EIM
(QR code).
The EIM method is selected in the following cases:
• The EV certificate is expired but the user doesn’t want to install a new one;
When the EIM payment method is chosen, the user is asked to show the QR
code at the charging point camera. The QR code is intended to be provided to the
user in the following two ways:
• Given by the car manufacturer when the EV is bought. If the car owner
chooses to sell the vehicle, the QR code would not be valid anymore: the new
owner would need to contact the OEM to request a new personalized QR
code;
• Details about the payment method: in this demo, the fake credit card infor-
mation is contained in the QR code (16 numbers code, CVV number, and
card expiration date).
100
Testing
The SECC checks if the details provided match the one contained in a stored
document: in this demo, these data are contained in the SECC-PFS file, but in a
real charging station this procedure would need to be verified with several secondary
actors, such as the EMSP and the bank.
If the identification is verified, the user is asked to insert the departure time and
the demo goes on as usual. Instead, if the identification fails, the communication
is interrupted and a message informing the user is displayed. Now, the user can
choose the Plug&Charge payment method if it is supported, or retry to scan the
QR code.
101
Chapter 6
Conclusions
process.
The open-source protocol stack implementing the ISO15118-2 messages and re-
quirements, called RiseV2G, has been thoroughly studied and then modified, in
order to be integrated into the PoC, both on the electric vehicle and the charging
station sides. Then, the python programs to handle the behavior of the EV and of
the charging point have been realized and integrated with the implementations of
RiseV2G.
An accurate phase of testing has been carried out to verify the expected results.
At the end of the project, the obtained results are:
• The user is able to let the charging process start by just plugging in the electric
vehicle (Plug&Charge feature);
• The EV owner can insert the departure time and choose the preferred charging
profile between the ones proposed by the charging point, enabling energy flex-
ibility and being able to choose the most sustainable and/or most economical
one;
• Adding the possibility to enable the V2G technology, also known as bidirec-
tional power transfer, which gives the user the possibility to make his electric
vehicle available as a power bank of the smart grid, receiving a discount on
the charging process;
• Adding the communication messages defining the wireless power transfer and
the automated connection device;
103
Conclusions
• Adding the dynamic charging mode: the user can select this charging mode to
allow the charging point to automatically change the energy provided during
the charging process in order to react to the grid needs.
104
Bibliography
[1] Sesha Gopal Selvakumar. «Electric and Hybrid Vehicles – A Comprehensive
Overview». In: 2021 IEEE 2nd International Conference On Electrical Power
and Energy Systems (ICEPES). 2021, pp. 1–6 (cit. on pp. 1, 3, 4, 6).
[2] Xiaoli Sun, Zhengguo Li, Xiaolin Wang, and Chengjiang Li. «Technology
development of electric vehicles: A review». In: Energies 13.1 (2019), p. 90
(cit. on pp. 5–7, 17, 19, 20).
[3] Murat Yilmaz and Philip T. Krein. «Review of Battery Charger Topologies,
Charging Power Levels, and Infrastructure for Plug-In Electric and Hybrid
Vehicles». In: IEEE Transactions on Power Electronics 28.5 (2013), pp. 2151–
2169. doi: 10.1109/TPEL.2012.2212917 (cit. on p. 6).
[4] Ilhami COLAK, Ramazan BAYINDIR, and Seref SAGIROGLU. «The Effects
of the Smart Grid System on the National Grids». In: 2020 8th International
Conference on Smart Grid (icSmartGrid). 2020, pp. 122–126. doi: 10.1109/
icSmartGrid49881.2020.9144891 (cit. on pp. 8, 9).
[5] Zahra Alavikia and Maryam Shabro. «A comprehensive layered approach for
implementing internet of things-enabled smart grid: A survey». In: Digital
Communications and Networks 8.3 (2022), pp. 388–410. issn: 2352-8648.
doi: https : / / doi . org / 10 . 1016 / j . dcan . 2022 . 01 . 002. url: https :
//www.sciencedirect.com/science/article/pii/S2352864822000025
(cit. on p. 10).
[6] Noha Mostafa, Haitham Saad Mohamed Ramadan, and Omar Elfarouk.
«Renewable energy management in smart grids by using big data analytics
and machine learning». In: Machine Learning with Applications 9 (2022),
p. 100363. issn: 2666-8270. doi: https://doi.org/10.1016/j.mlwa.2022.
105
BIBLIOGRAPHY
106
BIBLIOGRAPHY
[15] «Exploring the public key infrastructure for ISO 15118 in the EV charging
ecosystem». In: ElaadNL, Arnhem, The Netherlands, Nov. 2018 (cit. on pp. 47,
50).
107