3.2. Architecture
The charging emulation system is divided into two main blocks represented in
Figure 4, the EVpi on the vehicle side and the EVSEpi on the supply equipment side. Each of these blocks is divided into four sub-blocks, which use the same communication principle, namely the communication controller, the parameters file, the management code, and the HMI. Both blocks were implemented on a dedicated Raspberry Pi 3 – Model B.
Communication Controllers. The communication controllers of both blocks aim to establish the communication session, through IP, to enable the dynamic exchange of charging parameters on the system. However, the RISE V2G library only allows to exchange static charge parameters. To overtake this feature of the RISE V2G library, firstly the most relevant parameters used were selected, during a communication session running on DC power transfer mode. These parameters, on library code, have been changed from static to a value that is taken from a specific line in the parameters file of the respective block. In other words, each time the communication controllers get access to a parameter, instead of directly accessing the static value of a variable in library source code, they obtain the value from a prerecorded line in the parameters file. This prerecorded line contains the value of the parameter that the communication controller wants to access, which is updated every five seconds by the management code of the respective block. These communication controllers are handled by the management code of their respective block and have an associated log file, which stores their communication records individually.
Parameters Files. The main purpose of the parameters files is to serve as an intermediary between the communication controller and the management code of the respective block. Each file has its respective parameters register list, where each parameter occupies a predefined position. Each parameter saved in this register list has its respective unit and type. This labelling is important because the communication controllers, implemented through the RISE V2G library, only allow the exchange of parameters if they are in accordance with a specific unit, and more importantly, with their specific type of variable. Thus, these parameters must keep the same name, unit, and type, on the management code side as well on the communication controller side.
In addition to the ISO 15118 communication protocol parameters, the parameters register list file also contains local interaction indicators (flags) so that the communication controller and the management code of the same block can be synchronised (more on this later). All flags are defined as boolean type, with initial value set to “False”.
Management Codes. The management codes were developed in the JAVA programming language and their main objectives are to control the charging process, the communication controller and the information processed on the HMI of the respective block. Each management code is implemented according to its respective finite state machine, where each state is responsible for a certain set of tasks of the respective code.
One of the main objectives of the EVpi management code is to control the charging process of the EV battery. This approach allows to define batteries with different characteristics in the EVpi management code. In this paper, a virtual Li-ion battery was implemented which only helps emulate the typical functioning of an EV charging process, generating the corresponding curves, and bringing the developed system closer to a real charging process. Nonetheless, some influencing behaviours such as temperature and cell balance were set aside.
The charging process of the EV lithium-ion virtual battery, applies both the Constant Current (CC) and Constant Voltage (CV) charging techniques, known as the CC-CV strategy. The CC-CV strategy consists of dividing the charging process into the former two charging techniques [
14,
15].
The EVpi management code implements a finite state machine, consisting of eight states, as shown in the diagram represented in
Figure 5. Next, the states will be described.
EVpi State 1. Named Initial Parameters Definition, this initial state is when the vehicle user starts by defining, through the EV HMI, the limits of the current and voltage as supported by the vehicle. The user can also define with which state of charge the EV starts the charging emulation. The EVpi management code, in this state, is only responsible for accepting these parameters values. To obtain a more realistic charge emulation these values should be introduced according to the values of the virtual battery implemented in the management code. After having the initial parameters defined, the user promotes the EVpi management code to change its status through interaction with the EV HMI. If the vehicle battery is fully charged, the EVpi management code changes to state 6. If the vehicle battery needs charging, the EVpi management code changes to state 2.
EVpi State 2. Named Energy Request Calculation, the EVpi management code calculates the amount of energy required to charge the vehicle to 100% SoC, and then gives the order to the EVCC to start the communication session. Through the EVCC start flag, the management code checks whether the EVCC has been able to establish the communication session with the SECC. In case of success, the EVpi management code changes to state 3. After 25 seconds, if the EVpi management code does not establish communication, it goes back to state 1.
EVpi State 3. Named Charging Start, in this state the charging parameters are changed before the charge of EV takes place. In other words, the EVpi management code sends the EV parameters to its own communication controller and receives the EVSE parameters from it. The parameters sent by the EVCC are: (1) The EVCC identifier, (2) the maximum current and voltage limits supported by the EV and (3) the EV SoC. The parameters received by the EVCC are: (1) The communication session identifier, (2) the EVSE identifier, (3) the maximum current, voltage and power limits supported by the EVSE, and (4) the minimum current and voltage limits supported by the EVSE. After this exchange, current, voltage and power limits are established for charging, to not compromise the EV or the supply equipment. Once these limits are established, charging emulation is started by sending the ‘Start’ value through the charge progress parameter. Thus, there is a change from state 3 to state 4 if the SoC of the vehicle is below 80%, or to state 5 if the SoC is above or equal to 80%. This change of state depending on the SoC is due different charging techniques are used in each of the next states.
EVpi States 4 and 5. Named CC Charging Loop and CV Charging Loop, respectively, these states represent the charging loops according to the charging techniques. In these states, the EVpi management code sets the target current and voltage values to charge the EV battery according to the respective charging technique. The target current and voltage values are sent to the SECC, via the EVCC, so that the supply equipment can meet the vehicle's needs. In these states, the values of the remaining time to full charge and the EV SoC are also established, considering the values of the EVSE present current and voltage. While the EVpi management code remains in one of these two states, the parameters mentioned above are constantly changing and updating, with a periodicity of 5 seconds. The transition of these states can be performed in two different ways, which are through the EV user's action using the vehicle's HMI or by checking the EV SoC. When using user action, both states change to state 7. This user action results from pressing the stop button on the EV HMI. On the other hand, when checking the EV SoC, there are different situations for each of these two states. In state 4 when the vehicle SoC reaches 80%, the value of the bulk (or fast) charge complete indicator is changed to ‘true’ and the EVpi management code goes to state 5. This is due the charging technique is changed from constant current to constant voltage. In state 5 when the vehicle SoC reaches 100%, the full charge complete indicator value is changed to ‘true’ and the EVpi management code goes to state 6.
EVpi States 6 and 7. Named Charging Complete and Charging Interrupt, respectively, these states represent the last 5 second charging loop and consequently the stop of charging. In state 6 the stop is performed due to the fully charged status of the EV, while in state 7 the stop is due to the interruption of charging process by the vehicle user. In these states, the EVpi management code is responsible for setting the EV target current and voltage values to zero, as well as the parameter charge progress value to 'Stop'. Through the charge progress parameter, the EVCC informs the SECC that a charging stop has been requested, thus ending the exchange of the V2G message related to the charging loop and starting the exchange of V2G messages responsible for the end of communication session. Once the communication session is ended, the EVpi management code sets the EVCC end flag with the value ‘true’ and goes to state 8.
EVpi State 8. Named Communication Session End, the main task of the EVpi management code here is to update all its variables to their initial values and terminate processes that were started during the previous communication session, so that a new communication session can be started. After this update, the management code waits 10 seconds and go to state 1 (i.e., transits to its initial state), where a new charge emulation can be started.
Moving on to the EVSEpi management code, its main objective is to manage the EVSE charging process. To do this, it is necessary to have access to the voltage and current limit values. Under real circumstances, these values are limited by the electrical grid, or by the battery system (in case there is no connection to the electrical grid). In this charge emulator system, these limits are established by the CPO, through the EVSE HMI. The EVSEpi management code is also responsible for calculating the energy transferred during each charge and applying the appropriate energy tariff, as well as sending the information about the charges for an IoT data server.
The IoT data server used in this system is Emoncms [
16], where it is possible to generate graphs of the charging parameters over time. These temporal graphs are extremely important for the CPO, as they can monitor all the information that was and is being processed during charges.
The EVSEpi management code implements an finite state machine consisting of 5 states and as shown in the diagram in
Figure 6. These states are described next.
EVSEpi State 1. Named Initial Parameters Definition, in this initial state the CPO starts by defining, through the supply equipment HMI, the values of the maximum and minimum current and voltage limits supported by the EVSE. Once the initial parameters have been defined, and after the operator gives an indication through the human-machine interface, the EVSEpi management code checks the values entered before changing his status. Whenever the values of the defined minimum limits are greater than the values of the defined maximum limits, EVSEpi remains in the first state and requests a new initial definition of parameters to the CPO. Otherwise, the EVSEpi management code goes to state 2.
EVSEpi State 2. Named Waiting Communication, in this state the EVSEpi management code activates the SECC so that it waits for a connection with the EVCC. If a new communication session is detected, the SECC informs the EVSEpi management code through the “true” value of SECC start flag and goes to state 3. The EVSEpi management code can be in this second state for an indefinite period of time if a new communication session is not established. Then the CPO has the ability of making the management code return to its initial state (state 1), through a stop button present in EVSE HMI.
EVSEpi State 3. Named Charging Start, this state uses the same principle as EVpi state 3 where the charging parameters are exchanged before the charging takes place. So, in this state, the EVSEpi management code sends the supply equipment parameters to its communication controller and receives the vehicle parameters from it. The parameters sent by the SECC are: (1) The communication session identifier, (2) the EVSE identifier, (3) the maximum current, voltage and power limits supported by the EVSE and (4) the minimum current and voltage limits supported by the EVSE. The parameters received by the SECC are: (1) The EVCC, (2) the maximum current and voltage limits supported by the EV and (3) the EV SoC. Then, the current, voltage and power limits for charging are established, as well as the hourly period of the tariff and its associated cost. After that, the EVSEpi management code sends the processed information to the IoT data server. After accomplishing this set of tasks, the EVSEpi management code checks the charge progress parameter value. If the value is 'start', the charge emulation begins and, consequently, the exchange of the V2G message related to the charging loop, which leads to the transition to state 4.
EVSEpi State 4. Named Charging loop, in this state the EVSEpi management code gets the values of the remaining time to reach full charge, the target current and voltage for charging the EV and the EV SoC from the vehicle. The code then establishes the current values of the EVSE electrical current and voltage considering the availability of the electrical grid or renewable generation system plus batteries. In this state, the EVSEpi management code also sets up parameters values that are not part of the ISO 15118 communication protocol, such as the EVSE present power, the charge energy, and the charge energy cost. These parameters are set and updated considering the duration of the charging loop (5 seconds). In state 4, the EVSEpi management code is still responsible for sending the charge information to the IoT data server. This information is sent with a periodicity of 1 minute (i.e., every 12 charging loops). The EVSEpi management code goes to the next state (state 5) only when charging ends, that is, when the charge progress parameter shows the value 'Stop'.
EVSEpi State 5. In this state, named Charging End, the EVSEpi management code ensures that the EVSE present current, voltage and power values are zero. Thereafter, the connection between the communication controllers is finished and the final information about the charge is sent for the last time to the IoT data server. Finally, the EVSEpi management code checks the value of the SECC's end flag to know if the communication session has ceased. Once the communication session is finished, it resets the local variables, waits for 10 seconds, and returns to its initial state (state 1).
Figure 7 illustrates how the states of each block (EVpi and EVSEpi) are combined to make the implemented system works. During system operation, each EVSEpi state is related to one or more EVpi states, however, it can only be conjugated to one of these related states at one time instant. For example, state 4 of EVSEpi is related to states 4, 5, 6 and 7, but for the system to operate it can only be combined with one of these four states. So, in the case where the EV charges according to the CC charging loop technique, while EVpi must be set to state 4 EVSEpi will be set on state 4.
It should be noted that for the system to operate correctly, the EVSEpi management code must be in state 2 before the EVpi management code goes from state 1 to state 2, as shown in the diagram in
Figure 7. This rule applies for every state transition.
Human-Machine Interfaces. The HMI are intended to allow defining limit values of voltage and current supported by each machine (EV and EVSE) before the communication session is started. This way, the system allows different charging scenarios to be emulated. These interfaces also provide the information about the EV charging that is updated every 5 seconds. Its respective source codes were developed in JAVA programming language, with the aid of the graphical user interface tool Swing of Netbeans IDE and are controlled by the respective management codes. Next, these interfaces are described according to their block (EVpi and EVSEpi).
Electric Vehicle Human-Machine Interface. In its initial appearance, the EV HMI presents the initial parameterisation screen (Figure 8) which corresponds to the behavior of state 1 of the EVpi management code.
When button (7) is pressed (Figure 8), the EV HMI goes to a new screen, the EV charging screen (Figure 9). This screen is used to follow all the behaviours of the EVpi management code states except the first one. From there it is possible to observe information related to the charging status, as well as information related to the communication session status.
Charging Point Human-Machine Interface. The supply equipment HMI uses the same principle as the EV’s but dedicated to the charging station. Thus, in its initial appearance, this interface presents the EVSE initial parameterisation screen (Figure 10).
After this information is sent, the EVSE's HMI goes to its charging screen. The charging screen is used to monitor all behaviours of the EVSEpi management code states, except for the first one. Alternatively, it is possible to observe information about the charging, as well as the communication session (Figure 11). But unlike the EV HMI charging screen, the EVSE HMI charging screen in this first phase is made available before the communication session starts.