Simulation-Based Approach for Studying the Balancing of Local Smart Grids with Electric Vehicle Batteries

Modern society is facing great challenges due to pollution and increased carbon dioxide (CO2) emissions. As part of solving these challenges, the use of renewable energy sources and electric vehicles (EVs) is rapidly increasing. However, increased dynamics have triggered problems in balancing energy supply and consumption demand in the power systems. The resulting uncertainty and unpredictability of energy production, consumption, and management of peak loads has caused an increase in costs for energy market actors. Therefore, the means for studying the balancing of local smart grids with EVs is a starting point for this paper. The main contribution is a simulation-based approach which was developed to enable the study of the balancing of local distribution grids with EV batteries in a cost-efficient manner. The simulation-based approach is applied to enable the execution of a distributed system with the simulation of a local distribution grid, including a number of charging stations and EVs. A simulation system has been constructed to support the simulation-based approach. The evaluation has been carried out by executing the scenario related to balancing local distribution grids with EV batteries in a step-by-step manner. The evaluation results indicate that the simulation-based approach is able to facilitate the evaluation of smart grid– and EV-related communication protocols, control algorithms for charging, and functionalities of local distribution grids as part of a complex, critical OPEN ACCESS


Introduction
Modern society is facing great challenges due to pollution and increased CO2 emissions.As part of the solution to these challenges, the use of renewable energy sources is rapidly increasing.However, energy resources such as solar panels and wind turbines increase dynamics in energy production.In addition, the growing number of electric vehicles (EVs) is also increasing dynamics on the consumption side.The dynamics here refer to the capability of energy resources to dynamically change the presence, status, and volume of energy production/consumption.As a result, balancing energy supply and consumption demand in the power system is now more challenging than before.The uncertainty and unpredictability of energy production, consumption, and the management of peak loads has caused increased costs for energy market actors.
The usual ways of balancing production and consumption have been the application of controllable loads, and storing produced energy during periods of low demand and using it when demand is higher.However, a lack of such controllable loads and suitable energy storage has lowered the usability of these approaches.EVs are expected to provide the potential means for both of these approaches-they could offer masses of controllable loads as well as distributed grid-connected energy storage.However, this requires the realization of advanced vehicle-to-grid (V2G) solutions with interoperable charging managers, charging stations, and EVs.V2G refers to the control of the charging of EVs and the possibility to inject power from the EV towards grid systems.Because of the inherent mobility of EVs, charging infrastructures, especially those in public places, face challenges such as charging station reservation, scheduling of charging, and increased energy and infrastructure costs due to peak loads caused by the need to shorten charging times, among other things.However, it is assumed here that EVs have the potential to be applied both as controllable loads and energy storage to help balance local distribution grids [1,2].Therefore, the scenario related to balancing local smart grids with EVs is the focus of this paper.
The concepts of balancing smart grids with electric vehicles have been studied in [3,4], for example.The results of these studies show clear technical potential from a power system point of view, but economic viability seems to be difficult to achieve [5].The aspects of communication, battery lifetime, and charging protocols attract less attention in these studies.Some other studies have focused purely on related protocols and interfaces, paying less attention to the power system application [6].There is a lack of studies providing a system-wide view of whether it is feasible and how to enable the balancing of local smart grids with EVs.Providing such a system-wide study on the balancing of local distribution grids with EV batteries is challenging because of the lack of support at charging stations for EVs, the charging infrastructures, and the unavailability of the required management means in the local electric grid.The realization of the required system for the purposes of this study proved to be too expensive, and thus we have taken a simulation-based approach.
Traditionally, simulation has been a safe and cost-effective tool for studying complex systems, power systems, and communication networks [7].In smart grid management and control, tight interaction between the communication network and the power system is essential.Communication network simulators have been used to study novel network architectures and protocols [8][9][10]; for example, power system simulation environments have been used for power system planning and operation optimization [11].Furthermore, process simulation systems have been used to study the behavior of complex process systems [12].When considering the systems needed for studying the balancing of local smart grids with EV batteries, either an integrated simulator that simulates both the networks in one simulator or a co-simulator that tightly integrates the required existing simulators together could be possible [7,13].Because the integration of simulators is estimated to require considerable effort, co-simulation is seen to be a more practical approach for the required purpose.However, the creation of systems enabling EV charging, a local distribution grid, EVs, and users requires one other essential element to make the simulation more realistic and useful: interaction between the real entities.These include the protocols and services involved as real software and hardware implementations.Therefore, hardware-in-the loop-and software-in-the-loop-type systems might be needed [14][15][16].They are able to make simulations more realistic and the simulation environments could also be used for testing purposes.In this phase of our research, having real hardware entities was not possible because of cost reasons, and thus we initially applied a software-in-the-loop-type simulation method.The same type of approach has also been applied to study a whole-system V2G modeling environment, including a bi-directional converter, a communications interface, control software, and a power system simulator [17].However, our approach is different in the sense that we focus more on the evaluation of the standards-based solutions for the balancing of the local distribution grid with EV batteries.It was estimated that, in our case, the quality details related to the flow of electricity are less important.However, the software entities such as the International Organization for Standardization/the International Electrotechnical Commission (ISO/IEC) 15118 [18] for the V2G interface require information on the EV battery voltage and capacity, and the charging current in the electric vehicle supply equipment (EVSE).Therefore, a simulation model of the local distribution grid was needed to be able to dynamically change the load in the network and for executing smart algorithm(s) for the adaptation of charging and discharging powers of the EVs according to the load situation in the local distribution grid.After analysis, it was seen that a sensible level of modeling local distribution grids can be achieved by the application of the Apros simulator, which has originally been implemented to simulate complex process systems [12].
To summarize, the main contribution of this paper is a simulation-based approach with an enabling simulation system for studying the balancing of local distribution grids with EV batteries.The simulation-based approach is applied to enable the execution of a distributed system with the simulation of a local distribution grid, including a number of charging stations and EVs.A simulation system has been constructed to support the simulation-based approach.The evaluation of the simulation-based approach has been carried out by executing the scenario related to balancing local distribution grids with EV batteries in a step-by-step manner.The results indicate that the simulation-based approach is able to facilitate the evaluation of smart grid-and EV-related communication protocols, control algorithms for charging, and functionalities of local distribution grids as part of a complex, critical cyber-physical system.In addition, the simulation system is able to incorporate advanced methods for monitoring, controlling, tracking, and modeling behavior.The simulation model of the local distribution grid can be executed through smart control of charging and discharging powers of the EVs according to the load situation in the local distribution grid.The resulting system can be applied to studying the balancing of local smart grids with EV batteries.
The rest of the paper is organized as follows: the simulation-based approach is described in Section 2. The proof-of-concept simulation system is introduced in Section 3, and the simulation steps are clarified in Section 4. Discussion of the results is provided in Section 5, and finally, concluding remarks are given in Section 6.

Smart Grid with Electric Vehicles
The targeted system contains one or more electric vehicles, charging stations providing EVSEs, renewable energy sources (e.g., solar panels and wind farms), and the local distribution grid, as shown in Figure 1.An electric vehicle becomes part of the grid when it is plugged into a charging station.Smart management system(s) are needed for taking care of the dynamics and uncertainty caused by EVs/EVSEs, solar panels, and wind turbines in the system.The main objective from the distribution grid perspective is managing peak loads, maintaining the service quality during them, and managing the power balances and system stability while operating according to energy market processes [19].First, the smart scheduling of charging can be applied to avoid peak loads affecting local power systems or to avoid imbalances in energy market operations.Scheduling is often performed beforehand, based on load predictions.It can also be based on distributing fixed charging slots, depending on timing.Second, the demand response can be used to make the charging scheduling somewhat smarter.In this case, charging can be scheduled but it can also be adjusted during the charging process.This means that charging can be stopped, started, or adjusted to a certain charging power, depending on the market or network situation.The use of demand response for market and/or network control purposes depends heavily on local legislation and regulatory frameworks.The third level is full integration of electric vehicle-to-grid.This is understood to include features such as charging, scheduling, and demand response, but also the possibility of discharging the vehicle battery into the network.This represents an interesting concept of widely distributed storage units, but currently its viability may be limited by battery performance issues.
From a realization point of view, connecting multiple car types with a single charging station requires applicable, standard-based solutions.ISO/IEC 15118 [18] is one possible standard specifying the vehicle-to-grid communication interface.Another necessary standard may be the open charge point protocol (OCPP) [20], which describes the interface from the charging stations towards the required back-office service system for managing the charging processes.Such standards-based charging infrastructures need to support smart scheduling of charging, demand responses, and the possibility to control the charging powers in real time in a manner that also enables discharging.Together with these systems, the balancing of the local distribution grids with electric vehicles could be enabled by the management system(s).

Balancing Scenario
The balancing scenario relates to the management of the local distribution network performed by a distribution network operator (DNO).In a local network, the DNO controls the voltage with the objectives of, firstly, fulfilling the general voltage requirements (typically +/− 10% of nominal voltage) but, moreover, by providing a stable voltage for its customers.Voltage is often controlled only at the substation level by adjusting the transformer that interconnects high voltage and medium voltage networks.The voltage received by each customer depends on local power consumption and also local generation.Therefore, small-scale generation such as photovoltaic (PV) units can be challenging for voltage level management.An example of voltage profiles in a distribution network with local generation are visualized in Figure 2. Local generation may raise the voltage level above the maximum permitted voltage level below the distribution transformer without proper voltage management.As the voltage level strongly depends on the power balance in the network, EVs with V2G functionalities represent a good opportunity to control the voltage properly.One benefit of V2G is that it can be accurately concentrated in the network area where the problem exists.For the customer, effective V2G is seen as a more stable voltage with better power quality.One example of voltage profile improvement by means of controlling EV charging is presented in Figure 3  Balancing a local distribution grid with EVs requires support for full V2G system services, including smart scheduling of charging, demand response, and control of discharging.Such services would likely be offered by charging the operator and/or aggregator management system(s), which would manage the charging stations beyond it and offer the service at a higher level, as shown in Figure 4.Such services could be offered for energy market players like retailers or to help balance responsible parties.The aggregator could also be present in balancing markets itself [19].In addition, services could be offered on a localized basis for distribution network operators in order to manage the local network in a specific area.The provisioning of such ancillary services depends on local regulation and energy market models.
The load balancing scenario focuses on the management of electric vehicle charging as part of local distribution grid or microgrid management.The purpose is to maintain proper voltage levels in a low voltage distribution grid.To achieve this, EVs are used as controllable loads and also as controllable storage units that provide power towards the local distribution grid.The scenario is in Figure 5 and is clarified briefly in the following: 1.An electric vehicle has been connected to the charging station.The charging process is initialized, and can be in an active or idle state.2. Problems with voltage levels in a local low voltage distribution grid are observed.3. The distribution network operator issues a service request, including, for instance, the specified network area, the necessary control actions, and the duration.4. The aggregator or charging operator confirms receipt of the request and the ability to fulfill it.5.The charging management system of the aggregator or the charging operator issues the required control signals to the selected group of charging stations.The charging of selected electric vehicles is adjusted according to the control signals.6.If there are low voltage problems, the charging of selected vehicles can be stopped.7. Vehicles may start discharging their batteries into the distribution network.8.As a result, the voltage profile starts to normalize.At the same time, the distribution network operator may also perform some slower voltage adjustments on higher distribution network levels.9.After improvements in the voltage levels, electric vehicles can be returned to charging mode in a controlled manner.

Simulation-Based Approach
The simulation-based approach applied for the balancing scenario in this paper is visualized in Figure 6.The targeted system consists of multiple electric vehicles and charging stations, where there may be temporary connections between an electric vehicle and a charging station.As shown in the figure, the state of the connection between an electric vehicle and a charging station can be charging (blue dashed arrow), discharging (red fixed arrow), plugged in but idle (green dotted arrow), or not plugged in (no arrow).The link between the electric vehicle and the charging station represents an ISO/IEC 15118 link.The charging manager of the management system needs to have the means for the monitoring and controlling of multiple instances of electric vehicles and charging stations.The charging manager can control the charging stations by using OCPP, for example.In addition, there is a need to link the charging manager into the operation of the local distribution grid.
The system requires the execution of multiple embedded distributed systems in a controlled manner.In addition, there is a need for a connection from the charging station to the local distribution grid, which requires expensive devices and management processes.The selected approach towards such expensive and missing elements is based on simulations.The local distribution grid is simulated in order to enable the study of the relationships between loads, voltage levels, and the charging state.The simulation model of the local distribution grid, including the battery model, is connected to the charging manager of the management system.The simulation of the local distribution grid in the system is provided with the aid of the Apros simulation model [12].Apros is a multifunctional tool created for the modeling and simulation of different processes, power plants, and power networks.It can be used to simulate different transients and states of the system in order to perform joint modeling of processes and automation systems, enabling studies on their interactions.It can also be executed as part of the real-time simulation, which enables connecting external components or models, which in this case is a charging manager.Studying the balancing scenario requires the availability of multiple electric vehicles and charging stations, which are too expensive, and closed systems to enable controlled execution.Therefore, these elements are also simulated, and support for multiple simulated instances is required.However, there is also a need to study the control mechanisms required in the management processes of scheduling of charging, demand response, and charging powers via standards-based solutions.Therefore, the software-in-theloop-type approach has been selected.In this way, the system is able to execute the implementations of the software (SW) solutions and protocols, such as ISO/IEC 15118 and OCPP as the key enablers of the system.
As a result, the simulation-based approach is assumed to enable the execution of the complete balancing scenario, and it is the means for simultaneously evaluating the system behavior, for example, in the functions related to the scheduling of charging, demand response, and charging and discharging powers.In addition, it is possible to validate the key enablers related to the required protocols and other SW solutions, as well as to study the optimization of the network and system parameters.

Architecture
The constructed simulation system realizes a proof-of-concept implementation of the simulation-based approach.The general architecture of the constructed simulation system is illustrated in Figure 7.The system consists of a simulation server and a number of simulation nodes.The server is a message broker or a communication bus, which intermediates messages between the nodes.The actual simulation is distributed to simulation nodes, each of which represents one simulated entity implemented as a separate simulation process.Each simulation process is connected to the server through a simulation layer, which hides the simulation-related communication from the simulated entity.Communication channels, such as Transmission Control Protocol (TCP) streams, between simulated entities are realized as virtual channels that allow the server to track communication between the entities.External simulators, e.g., Apros, are also exposed as a simulation node to the other nodes.These kinds of proxy nodes serve two purposes.First, they simplify the systems since all the components are represented as simulation nodes.Second, they function as adapters to the external simulator's own interface.As a result of this design, the simulator can be easily extended by adding new nodes to represent new smart grid components.In addition to message brokering, the simulation server offers a set of basic services to the simulation nodes and keeps track of the network topology, i.e., the simulation entities and their virtual channels.These services include the identification and addressing of nodes to support message routing, query, and subscription-based discovery services to allow dynamic entity discovery, and they also include logging facilities to support data gathering.Simulated entities communicate with the server using a small set of control messages that can be used to register new nodes to the system, discover other nodes, and to build and tear down virtual channels.In addition to simulation control, the interface also allows the exchange of arbitrary data between any registered nodes.
Virtual channels represent open communication channels, such as TCP streams, between simulation modules in the nodes.The process of building a virtual channel is used to negotiate parameters for creating the actual communication channel between the two modules.The server is used to intermediate these parameters.As a result, nodes can contact each other without knowing their real addresses beforehand.
In the current proof-of-concept implementation, virtual channels are purely a mechanism for tracking and negotiating communication channels: there is no real network virtualization involved, but the communication relies on the operating system's protocol stack and the real network.Thus, the payload data is exchanged out-of-band of the simulation layer and is currently beyond the simulator's control.Communication in these channels is monitored by capturing the data at the simulation module level and sending the data to the simulation server.In order to allow the data to be captured without the need to hook into the simulation modules themselves and to give full control of all the communication to the simulation server, all the communication channels should be virtualized and routed through the simulation server.This would also greatly simplify the configuration of the simulation environment, since the simulated network would not depend on the operating system or the physical configuration.Therefore, network virtualization is considered to be an important element in future work.
The simulation modules are expected to communicate with each other primarily by using the virtual channel mechanism and the same application-level protocols that would also be used by the real system.However, the server also allows arbitrary data to be exchanged between the nodes.This feature can be used to transfer application-level data as in-band data without using the virtual channels.This is useful for implementing an ad hoc simulation data exchange between simulated nodes when the communication protocols related to that connection do not exist yet, their implementations are not available, the protocol is not relevant to the current simulation, or to implement a data exchange that does not take place using a specific protocol.As an example, such a data exchange could be represented by a human using a radio-frequency identification (RFID) tag to authenticate charging with an EVSE.The same mechanism can also be used for other internode communication needed in the simulation system.This includes, as an example, communication between the simulation modules and Apros.
The power network model of the Apros simulator and the simulation modules connected to the simulation server provide two models or views to the simulated system: the power network model and the communication network model.The mapping between the entities of these two models is use case-specific.Since not all the entities are relevant for both models, this mapping is not necessarily one-to-one mapping: not all entities are present in the two system views.In fact, we expect the abstraction levels of the two models to often be different.For example, the power network model may represent an EV as a set of low-level electric components, e.g., as an electric battery or an inverter and a set of wires, while the corresponding simulation module in the communication network model represents the software component that manages charging-related communications and controls all of the corresponding electric components.
The Apros simulator is connected to the other simulation nodes through a proxy node that provides a simple interface to the power network model without exposing Apros' peculiarities to the node implementation.Apros provides support for external simulation components that communicate using the widely used open platform communications (OPC) Unified Architecture (UA) standard [21].The OPC UA data model consists of objects that contain variables and methods and can fire events.Apros exposes the simulation model's variables to direct manipulation via this data model.We use OPC UA communication stack implementations readily available for OPC Foundation members to connect the proxy node to the simulator.The proxy node allows other nodes to subscribe to specific Apros model variables in order to receive updates to values of these variables.Updates can be based on polling the variables from Apros at desired intervals or the subscription mechanism provided by OPC UA.In a similar fashion, other nodes can launch events in an Apros simulation by writing to simulation model variables via the proxy node.
The benefits of the selected approach are that it is very simple, computationally moderate, and relatively straightforward to extend to other OPC UA-compliant simulators and devices as a result of the use of the OPC UA standard.However, directly modifying simulation model variables could lead to problems, especially in complex simulations, if there is a danger of several entities changing the same variables in an uncontrolled manner.Although using a single Apros proxy node for the whole system allows more control over the changes, in such a case using OPC UA methods could be a better alternative, as ultimate control would remain in the power network simulator.
To reduce the implementation effort of the proof-of-concept system, there is currently no time synchronization implemented between the simulation nodes, but the simulation proceeds in real time as perceived by each node.This approach is reasonable for a small-scale proof-of-concept system, but is, of course, not sufficient for large-scale simulations.The synchronizing of a distributed simulator's simulation steps is a research area of its own [7].Our possible future directions considering this area are discussed in greater detail in Section 5.

User's View of the Simulation
The simulation system provides two views of the simulated process.Similarl to the simulator architecture, views are separated between the power network and communication network views.A detailed view of the power network simulation model and process is provided by Apros' user interface.The communication network topology, as well as the content of each application layer protocol message, is visualized in another user interface.This user interface (UI) also provides a simple means of control over the simulation in the form of specific events, e.g., connecting and disconnecting EVs and EVSEs using charging cables.
The communication network user interface is shown in Figure 8.It consists of four main parts:  The Graphical View Window shows a real-time visual presentation of the simulation process.Simulation entities and their connections are illustrated.In the view, the user can select various tools to manipulate the simulation or the visuals.Actions such as adding nodes and creating connections can be performed, as well as dragging and arranging the nodes according to user preferences. The Node and Tool Information Window shows relevant information about the node or the tool that is currently selected from the Graphical View.This information can, for example, contain a subset of the EV node's battery status information or a tooltip for a specific tool, such as the dragging tool. The Simulation Events Window shows time-stamped events describing the simulation flow.These include, for example, changes in the connection status between nodes and the speed of the simulation visualization. The Message Log Window lists the content of application protocol messages, such as ISO/IEC 15118, sent using the connection between two nodes that is currently selected in the Graphical View.Each of the listed messages can be expanded to show the message content.

Simulation Set-Up
The local smart grid load balancing study is realized on top of the simulation system.The Apros power network model used in the study includes a typical 20 kV distribution network, a 20/0.4kV distribution transformer, and 0.4 kV low voltage distribution lines, as shown in Figure 9.The low voltage network consists of three adjacent feeders which feed five customers, scaled to represent typical residential customers.The applied power network model represents a weak low voltage distribution system with rather long distances, which is typical in rural installations.Three EVs and EVSEs are connected to the grid, and they are used for load balancing.The electrical model for the EV is a lithium-ion battery, and a bi-directional charger device is used to model the EVSE.The entities and the communication channels modeled in the simulation system are illustrated in Figure 10.The applied control modules, their main tasks, and communication with the power network model are briefly clarified below:  EV nodes represent individual electric vehicles.They are mapped to electric batteries in the Apros power network model.The main task of an EV module is to initiate and terminate individual EV charging sessions. EVSE nodes represent electric vehicle supply equipment.They form the EV's interface with the smart grid, manage charging parameter negotiations of individual charging sessions, and adjust the charging process according to the evolving power quota.EVSEs are mapped to inverters between the battery and the network in the power network model. The Charging Manager (CM) node represents a charging management system that manages multiple EVSEs, e.g., a charging station or charging station network.It contains a decision algorithm that allocates and adjusts the maximum power quotas that the individual EVSEs are allowed to use for the charging sessions they are controlling, with the overall aim of balancing power generation and consumption in the local grid.The CM node does not contain a counterpart in the power network model, but it is a control system that operates on top of the traditional power grid according to feedback it receives from the grid.Charging session negotiation and management between EVs and EVSEs occur over the implementation of the ISO/IEC 15118 V2G protocol [18].In fact, the EVSE and EV nodes constitute a Supply Equipment Communication Controller (SECC) and Electric Vehicle Communication Controller (EVCC), respectively, as defined by the ISO/IEC 15118 specification.They base charging parameter negotiations on values read from the Apros simulation model and, on the other hand, generate charging-related events, e.g., the beginning and ending of power transfer, to Apros according to ISO/IEC 15118 protocol states.In order to allow negotiation of battery discharging, a simple extension to the ISO/IEC 15118 protocol was implemented since the used version of the protocol did not provide support for battery discharging.Communication between EVSEs and the CM is currently implemented with ad hoc messaging via the server, and it may be replaced by the OCPP [20] protocol in the future.
The information flow between the simulated nodes is briefly described as follows: when the simulation starts, all the nodes register with the system and subscribe Apros model variables related to their electrical components from the Apros proxy node.The CM node allocates each EVSE maximum power quota they can use for charging.Each EV connects to an EVSE using the ISO/IEC 15118 protocol and their control modules negotiate charging parameters within the EVSE's power quota.After this, the EVSEs adjust corresponding Apros variables to match real power usage during charging.Apros continues to simulate the situation in the power grid.If load balancing actions are required in either direction, it sends a signal to the CM node.The CM node reallocates each EVSE's power quota accordingly, possibly allocating a negative quota to request discharging.If the original charging parameters are not feasible within the new quota, the EVSE limits the maximum current the EV can draw and communicates the new threshold to the EV using the ISO/IEC 15118 protocol and adjusts the Apros variables accordingly.Similarly, the EVSE may increase the threshold back to the original value if the power quota increases.and the connections between the Apros simulation model and the charging manager are illustrated in Figure 13.As can be seen from the figure, the simulation model and the charging manager are connected via the reception of the control signal at the charging manager, and the provisioning of compensated charging powers to EVSEs, which in turn modify the corresponding parameters in the charger model.Electrical simulation pertaining to the EV battery, the charger, and the network, as well as evaluation of voltage quality and related droop-based voltage control, are performed in the simulation model.value for the control signal in order to activate power reallocation, and a minimum delta that needs to be exceeded in order to send a new power quota for each EVSE.The charging manager is also responsible for reverting the EVSE charging powers to their initial values after the need for compensation has ceased.The charging manager algorithm is illustrated in Figure 14.The algorithm uses EVSE charging powers and the power adjustment signal as inputs for determining the need and scale for power compensation, and it produces new EVSE charging powers as outputs.When compensation is not needed, the algorithm will adjust charging powers to the rates they were at before the compensation began.In general, the CM power allocation algorithm has been kept simple in order to reduce implementation effort, while still being able to run a reasonable power compensation scenario.Thus, the control sequence presented here only contains the absolute minimum amount of communication between the EVSEs and the charging manager to facilitate voltage drop-induced power compensation.

Initial State and Voltage Drop
The control sequence starts in a steady state, where all the EVs are connected to the EVSEs and are charging, as shown in Figure 10.The voltage in the local grid is above 390 V, which is the lower control threshold.The loads representing the five residential houses are set to 2 kW each.Thus, the initial load is 22.6 kW, consisting of 12.6 kW of controllable EVSE charging load, plus 10 kW of non-controllable load.
In order to demonstrate the control functions in action, two rapid 10 kW increases are inflicted on the grid load in the electrical simulator, which causes the voltage to sag below the lower threshold.This activates the control signal, indicating a need for the charging manager to decrease the charging load.The voltage drops and the resulting control signal behavior can be seen in Figure 15, at positions marked "A" and "B".As can be seen from the figure, the voltage starts to rise shortly after it drops.That is caused by the compensation in charging load by the charging manager.The charging manager renegotiates the EVSE charging powers, and the EVSEs reflect the change in the electrical model, as seen at positions "A" and "B" in Figure 16.At position "B", just before the second voltage drop, the EVSEs are charging at approximately 1600 W to 1800 W. What is notable in the charging powers is that as a result of the second voltage drop (position "B"), the charging manager decides to set the EVs into discharging mode, as shedding the charging load is not enough to compensate for the voltage sag.After the second voltage drop, the EVSEs finally stabilize at discharge rates of circa 1500 W to 1700 W. The duration of the compensation procedure from voltage sag to the 390 V thresholds is around 50 s in each case.The velocity of the compensation is greatly dependent on the control parameters in both the electrical simulation model and the charging manager-the effects of which on the overall system behavior can be studied in the simulation environment.

Disconnecting an EV and Autonomous Voltage Ramp-Up
An external stimulus to the simulation is depicted at position "C" in Figures 15 and 16.In that case, the EV is disconnected from the EVSE.As a result, the corresponding EVSE entity sets its discharging power to zero in the electrical model, causing another sag in voltage (Figure 15, position "C") as the EV no longer feeds power into the local grid and, as a consequence, the charging manager has to further increase the discharge rate of the remaining EVSEs.
The sequence starting at position "D" in Figures 15 and 16 is an example of autonomous charging manager behavior.The load in the electrical simulation is brought back to the starting level, which raises the voltage to well within the control limits, actually causing some overvoltage as depicted in Figure 15.The overvoltage is caused by the fact that instead of the starting point where three EVs were being charged, now there are two EVs that are discharging and one EV that is disconnected altogether.From the electrical simulation model point of view, there is no need for external power compensation as the voltage is below the high control limit of 410 V.However, as can be seen from Figure 16, the charging powers of the connected EVs begin to rise and, as depicted in Figure 3, the voltage diminishes correspondingly.This behavior is due to the charging manager, which notices the absence of the control signal and starts to ramp up the EV charging powers towards their original values.Finally, at position "E", the situation has normalized as the EVs are being charged at their original rate, and the grid voltage has stabilized.The voltage at the end of the sequence is slightly higher than at the beginning, due to the lower charging load as one EV is disconnected.

Approach
The provided simulation-based approach seems to work quite well in the scenario related to balancing a local distribution grid with electric vehicle batteries.However, several limitations have been discovered in the practical realization of the scenario.The realization of the ISO/IEC 15118 standard was limited to the basic features required between EVs and EVSEs in executing the scenario.Because the ISO/IEC 15118 standard did not enable the discharging process to be controlled, some minor modifications were also implemented to enable the negotiation of a basic discharging process between the EV and the EVSE.In addition, the protocol required in the interaction between the EVSE and the back-end system was only a skeleton of OCPP [20] used with the charging manager.The CM was built solely for the purpose of proving the concept of external load control as a means of voltage stabilization in a local grid, in tandem with the electrical simulation model.The role of the charging manager is reminiscent of OCPP 2.0 Smart Charging and especially the local power controller components.However, the current implementation does not adhere to the OCPP 2.0 specification.
The realized CM is a simplified version that supports a power allocation algorithm and the homogeneous treatment of all EVSEs in the simulation environment with limited modeling of EVSE-and charging-specific characteristics.For example, the ability to use discharging is currently a CM configuration parameter only.In addition, the algorithms in the charging manager and the electrical simulation model have no centralized control, so there are no means of dynamically preventing the CM load control from repeatedly activating and deactivating near the steady state.Currently, such oscillation is prevented by adjusting the static algorithm parameters.Furthermore, the CM power allocation algorithm controls all the EVSEs simultaneously, as shown in Figure 16, meaning that, on occasion, the effect of CM control may in itself cause fluctuations in grid voltage.A more appropriate approach would be to spread the individual EVSE power control commands over a longer period of time.However, despite the above simplifications, we find that the core functionality of the CM is enough to demonstrate the potential of our simulation system in testing the electrical behavior of the local grid in response to external EV charging power control.
The simulation model of the local distribution grid presented here was simple and the applied protocol realizations were limited.However, it is estimated that they were sufficient in order to prove that the simulation-based approach is feasible.The results are encouraging in the work towards more detailed simulations.The evaluation of the standards-based enablers for the balancing process worked quite well, which is indicated by the need for research and development into the novel discharging features for the related standards ISO/IEC 15118 and OCPP.

Simulation System
The provided simulation system was experimental and its evaluation was limited to the studied balancing scenario.The basic architecture of it seems to work quite well.However, there are still some shortcomings related to the time and state synchronization, the simulation interfaces, and the user interface, for example.Currently, there is no time synchronization realized between the simulation nodes, but the simulation proceeds in real time.This approach simplifies the implementation of the simulator, as there is no need for separate synchronization of the timing from the natural way it is done in the simulation processes.A simulation clock is used for the electrical simulator (Apros), and a real-time clock for the nodes in the communication network simulator, i.e., each simulator handles time individually [7].In addition, communication network delays are not modeled, and the network also works in real time in the simulation system.
A real-time approach is relatively common when validating controller designs in-the-loop, but it requires a sufficiently powerful simulation platform and the ignoring of potential overheads from the simulation platform [17].However, the clocks may go out of synchronization if the simulation is running faster or slower than real time.This may cause problems if one of the simulators starts to lag behind because of performance issues, for example.In the simulation of the balancing the use of real time worked quite well, but the lack of simulation time may cause problems if more complicated simulation models are applied in the next step.One option would be to implement clock correction in each node in the communication network simulator, based on the observed difference between local time and the simulation time reported by the electrical simulator.The accuracy of timing could then be controlled by the pace of timing messages from the simulation of the electric grid.Another approach would be to use the built-in timing synchronization mechanism provided by the electrical simulator.The mechanism facilitates fully accurate timing synchronization, down to the simulation time step.This approach would require more implementation effort in all the nodes than mere periodical clock adjustment, and it would cause significant signaling overheads in the network.In addition, the ability to change simulation speed could be used to reduce the wall-clock duration of the simulation, or to slow down fast events for more accurate analysis.On the other hand, the wall clock-based simulation time has some practical limit due to performance requirements of the simulation environment.It is also possible to use a simulation time that adapts to the performance changes; however, it requires a kind of response from every simulator after it has performed all the tasks related to the ongoing time slice [22].The application of this kind of solution in the simulation system is a topic for future research.
The state control of the simulation processes is distributed and no centralized control of specific states of the nodes is provided.However, the simulation server supports the establishment of virtual channels and tracking the traffic without having full control over the application-level payload data.For example, the simulated EV and EVSE entities read and modify the simulation data to trigger events such as connecting the EV to the EVSE, and starting charging.In addition, interactions between the simulated entities and their counterparts in Apros are performed via a special simulation node.This node provides an interface for the other nodes for subscribing and changing values of specific Apros variables that can be used to control the power network simulation.Instead of the Apros node, each simulation node could directly interface with Apros.However, this would dramatically increase the implementation complexity of each simulation node and could cause larger stress on Apros.On the other hand, the Apros node may also become a performance bottleneck in larger simulation setups.This kind of approach was feasible and sufficient in the required small-scale proof-of-concept simulation system.However, it is more challenging in more complicated cases, and therefore state synchronization is regarded as a topic of future research.
The applied protocol for realizing the simulation interfaces was realized specifically for the constructed simulation system and for the balancing scenario.The solution works quite well with the proof-of-concept simulation system, but there are still challenges related to the support of proper distribution, discovery of the simulation components, and security of the information exchange.The user interface was also specific for the balancing scenario, which means that the component needs to be developed specifically for the executed scenario.Therefore, the simulation interface and the user interface are seen as topics of future research.

Results of the Simulation Steps
The executed simulation scenario depicts the use of EV batteries to compensate for load-induced voltage sag over a period of approximately seven minutes.The period covers three compensation events and one charging manager-originated event for ramping up the EVSE charging powers after the need for compensation has ceased.The approximately 50 s between the perceived need for power control and the resultant steady state is, in our experience, fairly realistic.
As the charging manager component is only used for proof-of-concept, it is very simplistic.It uses a static and uniform model for all of the EVSEs, and only considers the instantaneous and maximum allowed charging power when reacting to the control signal from the electrical simulator model.Also, the ramp-up of charging power after voltage stabilization is suboptimal as it increases the charging power at fixed steps for all the EVs simultaneously.However, the core functionality of CM-induced power control in response to voltage sag was successfully demonstrated, and as such is expected to work well as a basis for more complex scenarios.Such scenarios could include, for example, more diverse EV models, and the use of charging profiles to indicate the desired state of charge for the EV battery at a given time, or to restrict the power available for load balancing per EV.
The network model used in the studies included some simplifications which need to be revised in any future work.First of all, frequency control was not implemented in the model.This will be essential for further microgrid studies, but it is not necessary for grid-connected studies.Typical problems in such grid-connected low voltage distribution systems relate to voltage levels, which were addressed in this paper.Additionally, residential loads were static models, which remained the same during the simulation apart from some load switching to provoke the control actions.A constantly changing load profile will make the system more dynamic.However, the approach of this paper is justified, as the focus was on technical implementation and the response to the voltage transients.
The network model was also relatively weak, although it was realistic for some rural area cases.In most areas, a low voltage distribution system is stronger and, hence, the impacts of EV charging management are less visible.The current model has been used to investigate the actual implementation of the control.As the work progresses towards techno-economic feasibility, etc., more grid cases must be developed.

Future Work
The basis for future smart grid realizations is the ability to enable interaction with multiple and diverse entities, such as sensors, actuators, smart meters, and service subsystems, even from different domains such as buildings and traffic.The resulting smart cyber-physical system is a very complex critical environment, possibly consisting of thousands of devices and services.Often, these entities must react to changes in the grid in real time without any human intervention being possible.However, failures in such a critical infrastructure could lead to black-out, financial consequences, or even severe safety-related problems in the physical world.Therefore, it is seen to be crucial that the solutions can be evaluated properly prior to deployment.However, evaluation with real smart grid systems may be very expensive and difficult to arrange.It is regarded that simulation is a safe and cost-efficient method of evaluation.Encouraged by the achieved results, the aim is to develop the introduced simulation system for this purpose, and the next step in this research is currently under way.
As for future research related to grid simulation, evaluation with more complicated configurations is needed.For example, preliminary studies with 10 EVs are currently under way.Longer simulation time periods with varying generation and load profiles constitute another short-term plan.This will also allow for techno-economic feasibility analysis when simulating over longer periods and assessing the support provided by EVSEs.For instance, PV production profiles should be included in such an approach.In longer period simulations, the aspects of EV presence and normal usage needs as a vehicle should also be taken into account.In addition, microgrid management on an islanded area could be included.The potential of smart charging control in areas where both frequency and voltage need to be maintained is a highly interesting topic.Such analysis requires good grid control performance.The studies should include both a momentary transient level and overall energy management over longer periods.
The simulation system needs to be enhanced to better support the hardware and software-in-the-loop means with real system entities.In addition, there is a need to enable usage of other simulators with the provided simulation server to develop the simulation interface to support more dynamic configurations and distributions of the system, and to enhance the capabilities of user interfaces to better support control and observation of the system behavior.More advanced simulation time and state synchronization means are also needed to enable the studying of more complicated and realistic scenarios.

Conclusion
The simulation model of the local distribution grid applied in the study included some simplifications, such as frequency control not being implemented, residential loads not being static models, and the number of charging stations and EVs being limited.However, the executed simulation scenario depicts the use of EV batteries to compensate for load-induced voltage sag by controlling the charging/discharging powers in a successful and realistic manner.Even if the applied model is relatively weak and it needs to be enhanced, the model worked quite well to show the interoperation with rest of the simulation system, including the charging manager controlling multiple charging stations and EVs.
The realization of the standards, such as ISO/IEC 15118 and OCPP, needed in the charging of EVs were limited to basic functions and skeleton-level behavior only.During the development and simulation step execution, it was seen that standards do not properly support the controlling of the discharging process, and therefore experimental research and development of the novel features was needed.Therefore, it is regarded that the simulation-based approach worked quite well in the incremental development and evaluation phases.The provided simulation system was experimental and its evaluation was limited to the studied balancing scenario.There are still some shortcomings related to the user interface, time and state synchronization, and simulation interfaces, for example.However, it is felt that its basic architecture worked quite well.
The meaning of the simulation-based approach used here is estimated to be essential in the evaluation of complex critical systems such as smart grids.Such systems may consist of thousands of devices and services even from different vendors and domains, may require real time interaction without human intervention and failures may lead to black-out, financial consequences, or even severe safety-related problems in the physical world.Therefore, it is regarded as crucial that the solutions can be evaluated properly before deployment.However, evaluation with real smart grid systems may be very expensive and difficult to arrange.The simulation-based approach is seen as a safe and cost-efficient method of evaluation.Encouraged by the achieved results, the aim is to continue this research by focusing on enhancing the grid simulation; the evaluation of more complicated configurations; increasing the scale of the experiments; applying longer simulation periods, dynamic generation, and load profiles; analyzing techno-economic feasibility; assessing novel features of the required standards, including photovoltaic production profiles; including realistic EV usage patterns and microgrid management aspects; smart charging control areas for maintaining frequency and voltage balances; assessing grid control performance; improving energy management in longer periods; enhancing support for the hardware and software-in-the-loop means with real system entities; and enabling the use of other simulators and advanced time and state synchronization means to allow the study of more complicated and realistic scenarios.
In summary, the main contribution of this work is the simulation-based approach and the simulation system developed to enable the study of the balancing of local distribution grids with EV batteries in a cost-efficient manner.The evaluation was carried out by executing the scenario related to balancing local distribution grids with EV batteries in a step-by-step manner.The evaluation results indicate that the simulation-based approach is able to facilitate the evaluation of smart grid-and EV-related communication protocols, control algorithms for charging, and functionalities of local distribution grids as a part of a complex, critical cyber-physical system.Based on the evaluation results, it is estimated that the simulation-based approach can provide an essential, safe, and cost-efficient method for the evaluation of complex, critical cyber-physical systems, such as smart grids.

Figure 1 .
Figure 1.Smart grid with electric vehicles.

Figure 2 .
Figure 2. Voltage profiles on a typical network affected by local generation.
. The light line indicates the original values of customer voltage, and the dark green line shows the voltage values when applying EV control.It can be seen that most of the under-voltage values can be avoided with EV control.

Figure 3 .
Figure 3. Customer-level voltage variation over a longer usage period.

Figure 4 .
Figure 4. Operational environment of an aggregator.

Figure 5 .
Figure 5. Management scenario for electric vehicle charging.

Figure 7 .
Figure 7. Architecture of the simulation system.

Figure 8 .
Figure 8. User's view of the communication network.

Figure 11 .
Figure 11.The voltage control procedure used in the model.

Figure 13 .
Figure 13.The control logic and connections between the Apros simulation model and the charging manager.

Figure 15 .
Figure 15.Voltage on the low voltage bus (dashed line), and the control signal (solid line).

Figure 16 .
Figure 16.EVSE charging powers for three EVSEs in the scenario.

Table 2 .
Technical component data.