Florent Cadoux

Cédric Christine Collet

Chauvenet, and Christophe Bobineau for their invaluable advice, continuous support, and patience during my PhD study. Their immense knowledge and plentiful experience have encouraged me in all the time of my academic research and daily life. I would also like to thank Benoît Vinot, Denis Stremplewski, and Antoine Labonne for their technical support on my study. I would like to thank all the members of my teams at G2Elab and at LIG. It is their kind support that have made my study and life in France a wonderful time. My

Dedication

I dedicate my work to my family and many friends. A special gratitude to my parents who always supported me. I also appreciate all my friends who always stood by my side, especially my best friend Mohammad Ghousein who has been a constant source of encouragement. Finally, I extend the dedication to the memory of Christine Collet, my supervisor who unfortunately was unable to see my graduation. This is for her.

iii Declaration 1. I declare that this thesis has been composed solely by myself and that it has not been submitted, in whole or in part, in any previous application for a degree. Except where states otherwise by reference or acknowledgment, the work presented is entirely my own.

2. I confirm that this thesis presented for the degree of Doctorate, has (a) been composed entirely by myself (b) been solely the result of my own work (c) not been submitted for any other degree or professional qualification 3. I declare that this thesis was composed by myself, that the work contained herein is my own except where explicitly stated otherwise in the text, and that this work has not been submitted for any other degree or professional qualification except as specified.

4. The data presented in this thesis was obtained in an experiment carried out by me in G2Elab. I am the sole responsible for the preparation and execution of the experiments, and the data analysis and interpretation are entirely by own work.

v vi

List of Figures

Introduction

An electric power system is a collection of electrical components set-up to supply, transmit and use electricity. In 1882, Thomas Edison achieved his vision of a full-scale central generating station with a system of conductors to distribute electricity to end-users in the high-profile business district in New York City [START_REF] Harvey | History of Power: The Evolution of the Electric Generation Industry[END_REF]. The electric power system has been developing ever since. In the second half of the 19th century, the operation of the power systems reached a stable paradigm and its structure was well defined and it is still used to our time.

The structure of electric power systems

The approach adopted for structuring electric power systems is to unbundle its functions. There are four main functions on the supply-side:

• Generation

• Transmission

• Distribution

• Supply and one function on the demand-side:

• Consumption

The traditional power system is arranged as a hierarchy (Figure 1.1a). Generators feed into a high voltage transmission system that facilitates bulk transfers of power over large distances. Connected to the transmission system are medium voltage distribution grids that take power from grid supply points and deliver it to the customers who are supplied at a lower voltage. The electric energy in the traditional power system is generated,

Generation

Electricity is produced by converting several types of energy into electrical energy. Conventional power systems were dependent on the bulk generation by converting mechanical energy into electrical energy (electromechanical conversion systems) for decades. In the majority of cases, the mechanical energy is either obtained from thermal energy conver-

THE STRUCTURE OF ELECTRIC POWER SYSTEMS

3 sion or provided by turbines driven by flowing water. The main sources of thermal energy are coal, natural gas, nuclear fuel and oil. The use of non-fossil fuels such as wind, solar, tidal, and geothermal and biogas in electricity generation is also increasing. Hydro-power is the main non-thermal source of mechanical energy used in electricity generation. The conversion of mechanical to electrical energy is done using synchronous generators in the majority of power plants. Few wind generation systems use induction generators. The power is usually generated at low-medium voltage levels, between 11 and 35 kV, and then fed into the transmission system using a step-up transformer.

Transmission

The transmission system forms the backbone of the power system. It interconnects all the generating stations and major load centers in the system. The electricity being generated in bulk in the generating stations needs to be efficiently transmitted over long distances to the load or demand points. Applying Ohm's Law to a transmission line connecting a generation station and a load shows that the power loss in the line is proportional to the square of line current (P loss = R T L |I| 2 ). Applying the same law on the generation station, we see that the current is inversely proportional to the voltage. This means that the transmission power losses can be reduced by increasing the voltage level. Therefore, the transmission lines operate at the highest voltage levels, usually 120 kV and upwards.

Usually, the transmission grid has a meshed structure in order to provide many alternate routes for the power to flow from the generators to the load points. This improves the reliability of the system. High Voltage (HV) transmission lines are terminated at substations. Very large industrial customers may be provided power directly from these substations. At these substations, the voltage is stepped down to a lower level and fed into the sub-transmission system. This part of the transmission system connects the high voltage substation through the step-down transformers to distribution substation. Typically, the sub-transmission voltage levels are from 69 kV to about 115 kV.

Distribution

The distribution represents the final stage of power transfer to the individual consumer. It comprises shorter lines and lower voltage levels than the transmission system. The distribution system is usually seen as two subsystems. The primary distribution subsystem is operated at Medium Voltage (MV) typically between about 11kV and 69kV. Small industrial customers are supplied by primary feeders at this voltage level. The secondary distribution subsystem has feeders that supply residential and commercial consumers at Low Voltage (LV), typically 220-240 V or 100-120 V. Small generating plants located near the load centers are usually connected to sub-transmission or distribution system directly. The distribution grid is generally connected in a weakly meshed structure in its primary part and a radial structure in its secondary part.

Supply and Consumption

The supply of the electric energy is either carried out by governmental entities or by the private sector. The actors in the energy supply are dependent on the energy policy of each country. They can be national wide, regional, or even within neighboring countries. The energy policy techniques may include legislation, treaties, incentives, guidelines, etc, to manage the energy supply and its actors. The role of the latter varies between purchasing the energy on the wholesale market, reselling, and billing.

Energy consumption is the last brick in an electrical power system. It is the usage of the electrical energy to serve some "electric loads" like motors, heaters, lighting, refrigeration, etc. This process is mainly a form of energy conversion this time from electrical to other forms of energy. For example, motors transform electrical energy to mechanical energy while heaters transform it to heat energy. Electricity providers sell electricity to consumers that are connected to the distribution system while Distribution System Operator (DSO) maintain, operate and upgrade the grid. These consumers range between industrial, commercial, and domestic entities.

Transition towards smart-grids 1.2.1 Power system operation

The existing electric power system is a strictly hierarchical system in which power plants at the top of the chain ensure power delivery to the customers' loads at the bottom of the chain. The system is essentially a one-way pipeline where the source (generating stations) has no real-time information about the service parameters of the termination points (end customers). Despite this restrictive nature, the power system must always operate in the normal state, meaning essentially that the bus voltages, the line currents and the system frequency shall remain within the prescribed limits. Operators strive to maintain the balance between supply and the restrictive and fairly opaque demand while meeting these limits at any time.

Frequency control and power balancing is usually made in bulk, at the levels of generating stations and transmission system. Traditionally, electricity, unlike gas and water, could not be stored economically on a large scale and system operators had limited control over the loads. The power balance between generation and demand must be carefully enforced by the generation stations. In response to load changes, frequent adjustments to the output of generators are necessary to ensure the balance. This adjustment is judged by measuring the system's frequency shift from the standard value [START_REF] Vaahedi | Power System Posturing[END_REF].

Bus voltages control on the other hand is applied on a wider part of the system. Voltage balance affected by load fluctuation has to be monitored and controlled in real-time. Many approaches exist for the bus voltage control which are mainly applied on the generating stations and the substations. Voltage-VAr control in the electric power transmission system, generators equipped with automatic voltage regulators, other VAr compensating devices like capacitors and inductors, transformers with On-Load Tab Changers (OLTC) are installed on the grid to cope with sudden and random voltage changes caused by natural load fluctuations or failures [START_REF] Vu | An improved voltage control on large-scale power system[END_REF] [START_REF] Nagata | A multi-agent based distributed reactive power control method[END_REF].

Shortcomings of the traditional power system

The existing electricity grid is a product of rapid urbanization and infrastructure developments in various parts of the world in the past century. Though they exist in many differing geographies, the utility companies have generally adopted similar technologies. Although functional for decades, these technologies still have some limitations and inefficiencies.

The limited control of the system operator over the loads has led to the installation of a significant amount of generation capacity for the sole role of meeting peak demand. This additional capacity, known as the Peaking Power Plants, is in use for a very small proportion of the total annual duration (less than 1% in some countries [START_REF] Fan | Statistical analysis of drivers of residential peak electricity demand[END_REF]). Moreover, generating stations are often located far away from the loads resulting in transmission CHAPTER 1. INTRODUCTION over considerable distances in which transmission losses become more important. [START_REF]Energy Quality of Supply Work Stream: 2nd CEER[END_REF] shows that transmission losses in France are in the range 2-3% of the injected energy. In 2017, France had 11,133 GWh in transmission losses which accounts for 2.36% of the injected energy. In addition to that, due to the hierarchical topology of its assets, the existing electricity grid suffers from domino-effect failures. This resulted in several major blackouts during the years [START_REF]List of major power outages -Wikipedia, The Free Encyclopedia[END_REF].

Throughout the years, the electricity was mostly produced in thermal power stations that rely on resources like coal, fuel, and nuclear power. These resources, despite providing steady power generation, have a negative impact on the environment. Several indicators can be used to measure the environmental impact of an energy source one of which is their carbon footprint. Table 1.1 provides a comparison showing the median lifecycle emissions of selected currently available electricity supply technologies according to [START_REF]Technology-specific Cost and Performance Parameters[END_REF]. With the increasing concerns about the environment, electricity utilities and suppliers have been trying to minimize their dependence on resources with high emissions and to integrate more renewables into the electric power system. Due to the opaque nature of the traditional power system and the intermittent nature of most of the renewable energy resources, the growing integration of such resources in the system poses serious challenges on the operation of the system and puts the future of adequacy of supply at risk.

In parallel to the changes in the supply, the energy consumption is following a similar paradigm. Electricity consumption is continuously growing where the global demand increased by 2.3% in 2019 and is expected to increase by 25% by 2040 according to the World Energy Market Observatory [START_REF] Vié | World Energy Markets Observatory report[END_REF]. In addition to the increasing energy demand, the global Electric Vehicle (EV) adoption shows steady growth where the sales have increased by ~80% in China and the US, and ~35% in Europe (cf. Figure 1.2) between 2013 and 2018. This growth has a significant impact on the operation of the electric power system that needs to account for more capacity and higher peak demand.

The evolution of the electricity grid

The next-generation electricity grid, known as the "smart grid" or "intelligent grid", is emerging to address the major shortcomings of the existing system. In essence, the smart grid needs to provide the utility companies with full visibility and pervasive control over their assets and services. The smart grid is required to be self-healing and resilient to system anomalies. And last but not least, the smart grid needs to empower its stakeholders to define and realize new ways of engaging with each other and performing energy transactions across the system. The main enabler of the smart grids is the convergence of communication technology and information technology with power system engineering, assisted by a set of new CHAPTER 1. INTRODUCTION approaches, technologies and applications. The integration of ICT in this context, allows the existing grid to traverse the complex yet staged trajectory of architecture, protocols, and standards towards the smart grid.

The path of the smart grid is firmly explained in [START_REF] Farhangi | The path of the smart grid[END_REF]. The author discusses the basic ingredients, the drivers, the evolution and the topology of a smart grid. As stated in the article and depicted in Figure 1.3, the first step in the evolution of the electricity grid starts at the distribution side. This is due to the fact that the roots of the power system issues are typically found in the electrical distribution system. To set this idea out, the distribution system is considered the grid overhaul because it has the highest potential for enhancement at all levels, connectivity, supervision, and control.

Smart distribution grid

The first step in the automation of the distribution grid was the Automatic Meter Reading (AMR). AMR is the technology of automatically collecting consumption, diagnostic, and status data from energy metering devices and transferring that data to a central database for billing, troubleshooting, and analyzing. This technology mainly saves utility providers the expense of periodic trips to each physical location to read a meter. Another advantage is that billing can be based on near real-time consumption rather than on estimates based on past or predicted consumption. An example of a basic application of the AMR is a simple cost-effective Time-of-Use (TOU) application that has been historically used in France by the french electricity utility, Electricité de France (EDF). They use the power line carrier technology since the 1960's mainly as part of a current service to about 11 million households, to send a signal for peak or flat-rate hours in order to switch the electric water heater. This technology allowed their customers to benefit of lower electricity rates, mainly at night, where the demand and the price are lower. The switching is executed remotely by the DSO at predefined hours thanks to the communication link provided by this technology.

As technology has advanced, additional data could then be captured, stored, and transmitted to the main computer, and often the metering devices could be controlled remotely. This can include events alarms such as tamper detection, reverse power flow, constraint violations, etc. Many AMR devices can also capture interval data, and log meter events. The logged data can be used to collect or control time of use or rate of use data that can be used for energy usage profiling, time of use billing, demand forecasting, demand response, conservation enforcement, remote shutoff, etc. AMI is the new term coined to represent the networking technology of fixed network meter systems that go beyond AMR into remote utility management. The meters in an AMI system are often referred to as smart meters, since they often can use collected data based on programmed logic.

Advanced Metering Infrastructure (AMI)

AMI became the trend in the energy transition plans and utilities all over the world are investing in this step. In Europe, many countries started their smart meters rollout programs in the early 2000s according to [19]. France followed the path with a nationwide smart meter rollout program has been in action since 2015. This rollout is part of the Linky project where 35 million Linky smart meters are to be deployed by the end of the year 2021 (cf. Figure 1.4) with a total cost of €4.5 billion. Enedis, the DSO responsible for the electricity distribution activities of 95% of French municipalities, is responsible for the implementation and ownership of the rollout as well as for third-party access to metering data. and the resulting benefits to consumers. Utilities identified the value of AMI in achieving significant operational cost savings in the areas of outage management, revenue protection and asset management. Advanced metering systems can provide benefits for utilities, retail providers and customers. Benefits will be recognized by the utilities with increased efficiencies, outage detection, tamper notification and reduced labor cost as a result of automating reads, connections and disconnects. Retail providers will be able to offer new innovative products in addition to customizing packages for their customers. In addition, with the meter data being readily available, more flexible billing cycles would be available to their customers instead of following the standard utility read cycles. With timely usage information available to the customer, benefits will be seen through opportunities to manage their energy consumption and change from one supplier to another with actual meter data. Because of these benefits, many utilities are moving towards implementing some types of AMI solutions. An example AMI-based application that promotes consumption management provided by the Linky metering system is the use of the customer interface and the built-in switch (known in French as the "contact sec") of the meter to drive some flexible loads as shown in Figure 1.5.

AMI structure

The components of AMI systems are usually located in various networks and different realms such as public (power grid, substations, data centers, etc.) and private (customer premises). This diversity of the media where the AMI is integrated has driven utilities to further divide the communication network and to use different communication technologies based on the characteristics of the medium of operation. The network architecture of the advanced metering system can be seen as an interconnection of 3 sub networks.

• Home Area Network (HAN): private networks owned and managed by end customers.

• Neighborhood Area Network (NAN) (also Field Access Network (FAN) or "Access Networks"): public networks managed by the DSO.

• Wide Area Network (WAN) (also "Backhaul Networks"): public networks managed by the DSO.

HAN provides the connections between home appliances other integrated systems such as rooftop photovoltaic system, distributed sensors, plug-in electric vehicle/plug-in hybrid electric vehicle, in-home display (IHD) Employing one-segment AMI access networks by transmitting the smart meters data directly to the head-end system using a wireless communication technology is not the preferable option. An issue encountered with this option is related to the installation points of the smart meters. Conventional electricity meters are sometimes installed at locations that may not be adequately covered by the local cellular networks (basements for example). Hence, if the utilities choose to simply replace the conventional electricity meters with smart meters avoiding to make any other changes, as it is common practice so far, two-segment access networks must be formed employing PLC concentrators.

PLC is a viable option that gained wide use in the smart meter access network across the world and especially in Europe. Moreover, it was the technology of choice for the French LV grid operators. The next section sheds the light more about this technology.

Power-line Communication (PLC) technology

One of the widely used communication technologies for smart metering is the Power-line Communication (PLC), the technology that carries data on the same conductors used for AC electric power distribution. PLC systems operate by adding a modulated carrier higher-frequency signal to the typical 50 or 60 Hz wiring system thus sometimes it is referred to as Power-Line Carrier. There are two major technologies of PLC used for different applications: Narrowband Power-line Communication (NB-PLC) [START_REF]IEEE Standard for Low-Frequency (less than 500 kHz) Narrowband Power Line Communications for Smart Grid Applications[END_REF] and Broadband Power-line Communication (BB-PLC) [START_REF]IEEE Standard for Medium Frequency (less than 12 MHz) Power Line Communications for Smart Grid Applications[END_REF]. These applications vary from indoor home control to (outdoor) smart grids command and control services. The concept of BB-PLC was initiated with the scope of providing Internet access applications. Although it has a few outdoor applications such as serving as a communication link between home controllers and utility control center in [START_REF] Hashiesh | A Proposed Broadband Power Line Communication System for Smart Grid Applications in a Typical Egyptian Network[END_REF], the broadband scenario is mainly used for indoor home networking.

NB-PLC technology on the other hand, where data is transmitted through a narrow frequency band at a low bit rate, is usually applied for the telecommunication link between the smart meter and data concentrator. Due to the wide adoption of this concept by the electricity utilities, standardization committees such as European Committee for Electrotechnical Standardization (CENELEC) in Europe, Association of Radio Indus-

POWER-LINE COMMUNICATION (PLC) TECHNOLOGY

tries and Businesses (ARIB) in Japan and Federal Communication Commission (FCC) in North America have created standards to govern the use of the PLC technologies. In Europe the NB-PLC band goes roughly from 3 kHz to 150 kHz and is further divided into four sub-bands. More specifically, the CENELEC A band (3-95 kHz) is mostly used by power utilities for applications like meter reading, monitoring or control in the distribution grid. CENELEC B band (95-125 kHz) can be used for any kind of applications, the CENELEC C band (125-140 kHz) for home networking systems while the CENELEC D band (140-148.5 kHz) is specified for alarm-and security systems. In Japan, ARIB has specified the (10-450 kHz) frequency band for PLC applications, whereas in USA (FCC) has defined the 10-490 kHz frequency band for this purpose. Figure 1.7 shows, informatively, the current regional regulatory bands.

PLC variants

PLC refers to the mode of communication that is able to carry data over the power lines, it does not specify the technology used for data modulation. Several PLC standards and protocols have been developed with different modulation schemes and transmission speeds, they can be classified into two categories: single-carrier and multi-carrier. Protocols that use single carrier technology like G1-PLC have low transmission rates of a few kilobits CHAPTER 1. INTRODUCTION per second (kbps) while protocols that use multi-carrier technology can deliver up to 800 kbps. PoweRline Intelligent Metering Evolution (PRIME) [START_REF]Narrowband orthogonal frequency division multiplexing power line communication transceivers for PRIME networks[END_REF] and G3 [START_REF]Narrowband orthogonal frequency division multiplexing power line communication transceivers for G3-PLC networks[END_REF] are the first industry-developed multi-carrier NB-PLC standards.

Enedis currently employs two PLC technologies: G1 and G3. Even though the two technologies carry the same kind of data, the technologies don't exactly speak the same "telecommunications" language. Both of them perform digital modulations but while G1 works on Frequency-Shift Keying (FSK) and spread-FSK as specified in the IEC 61334 standard, G3 is based on Orthogonal Frequency-Division Multiplexing (OFDM) technology. G3-PLC is an evolution on G1-PLC with G3 being more robust, less sensitive to noise, allowing for a better data collection rates. Its data flow is also higher thus increasing the speed of data collection. Finally and most importantly, unlike the G1 which only transmits metering information, the G3 protocol is a pure communication protocol independent of the application rendering it more versatile regarding possible usages. Thus with the Linky program, each new G3 meter allows to extend a communication infrastructure that the distributor will be able to leverage for a multitude of usages.

G3-PLC

G3-PLC, although it performs poorly compared to modern communication technologies like 4G, facilitates higher-speed, more-reliable, and longer-range communication over the existing power grid compared to older technologies like G1-PLC. The features and capabilities of G3-PLC have been developed to address the difficult challenges of power-line communications. While earlier approaches were a step in the right direction, they fall short of meeting the technical and reliability requirements necessary in the hostile environment of PLC. G3-PLC meets these requirements because of its unique features such as a mesh routing protocol to determine the best path between remote network nodes, a "robust" mode to improve communication under noisy channel conditions and channel estimation to select the optimal modulation scheme between neighboring nodes. Furthermore, its support of IPv6, enabling easy integration of various application profiles, adds high versatility and carries G3-PLC well into the future. G3-PLC was developed by Maxim to meet the requirements of Enedis. It has now gained world-wide interest and is under consideration by the ITU, IEEE, IEC and ISO standards committees. The G3-PLC specification has been posted for all interested par-ties by Enedis and Maxim to promote interoperability and open-endedness among smart grid implementations. With the increasing interests in the technology, the creation of a consortium of key stakeholders in the smart grid ecosystem, from electricity utilities, equipment manufacturers, system integrators, IT vendors, automotive, and semiconductor companies, was required to promote rapid availability, adaptation, implementation, and deployment of G3-PLC compliant devices. Eventually, the G3-PLC Alliance consortium was created with the objective of supporting G3-PLC in internationally recognized standards bodies to achieve the rapid adoption of the G3-PLC specification in industry applications worldwide, develop a framework for equipment testing to facilitate interoperability among G3-PLC adopters, and educate the market and promote the value, benefits and applications of G3-PLC power-line networking products through public statements, publications, trade show demonstrations, seminar sponsorships and other programs established by the consortium.

G3-PLC communication protocol stack

The G3-PLC communication stack consists of a specific OFDM physical layer, an IEEE 802.15.4 based MAC layer and an IETF 6LoWPAN-based adaptation layer allowing native support of IPv6. The ITU-T G.9903 standard is describing the G3-PLC lower layers (physical and data link layers). The G3-PLC communication stack (see Figure 1.8) is maintained, promoted and certified by the G3-PLC Alliance. The modular design of the stack allows the selection of different options at different layers (especially frequency band plan and routing). In addition, support of the IPv6 protocol grants end-user flexibility to fulfill business requirements when choosing the appropriate higher layers (transport and application layers). This key feature also secures G3-PLC infrastructures in the long term, thanks to the scalability and future application compatibility provided by IPv6.

The application layer is the interface between the G3-PLC devices (smart meters and data concentrators) and the user (meters operator). Since this layer is managed by the DLMS/COSEM communication framework, it is important to show a description of this framework.

Device Language Message Specification (DLMS), is an application layer specification designed to support messaging to and from (energy) distribution devices. Applications like remote meter reading, remote control and value added services for metering any kind Companion Specification for Energy Metering (COSEM) is an interface model of communicating energy metering equipment that provides a view of the functionality available through the communication interface. It provides semantics for metering application. COSEM model uses an object-oriented approach. An instance of a COSEM interface class is called COSEM interface object. The set of objects instantiated in the logical devices of a physical device model the functionality of the metering equipment as it is seen through its communicating interfaces. The COSEM model represents the meter as a server used by client applications that retrieve data from, provide control information to, and instigate known actions within the meter via controlled access to the attributes and specific methods of objects making up the server interface. The client may be supporting the business processes of utilities, customers, meter operators, or meter manufacturers.

DEVELOPING SMART GRID TECHNOLOGIES

Developing smart grid technologies

The AMI carves the way to remove the opaqueness from the distribution grid. Its two-way communication networks provide electricity grid operators with intelligent monitoring and control capabilities. Operators will be able to monitor electricity consumption throughout the grid in real time, implement variable tariff schedules, and set limits on electricity consumption to better manage peak loads. In turn, consumers will have real-time visibility into their electricity consumption, thus promoting demand-side conservation. With the addition of variable tariff schedules, users will be encouraged to reduce electricity consumption during peak usage times.

Ultimately, intelligent grid management techniques provide a smarter solution for the environment. Rather than build more power plants to support worst-case scenarios, grid operators will be able to optimally utilize existing resources. At the same time, demandside management will function as a form of indirect generation by better balancing the distribution of loads. Flexible customers will become more popular with the electric cars dominating the market, the solar power getting cheaper, and the advances in technology leading to smart solar inverters.

The newly developed solutions came with the new capabilities of the smart grid. They were not familiar with the traditional power system so they have to be especially extensively tested and validated before any actual usage. For the design and validation of a certain application of the smart grid or one of its sub-systems, people use different methodologies ranging from software simulations, hardware-in-the-loop simulations, combined simulations (Co-simulation), hardware test benches, etc. In the next chapter we will discover some of the design and validation techniques used in the domains of smart grids and illustrate the necessity for a new approach that is more coherent with the cyber-physical nature of the smart grid.

Chapter 2

An Overview of Smart Grid Simulation Development and Validation Tools

Introduction

In recent years, there have been increasing demands for cleaner energy generation and more efficient use of energy due to environmental concerns, limited availability of conventional energy resources such as oil, gas, and coal, as well as growing global energy demand. Energy efficiency therefore and the integration of Renewable Energy Resources (RER) is critical to relieve the pressure on traditional energy supply while accommodating the increasing demands in a more environmentally friendly energy supply chain. Governments all over the world have set / are setting renewable energy integration targets in a couple of decades that require a revolutionary rethinking of supplying and using electric energy in a more efficient, economical, environmental, and sustainable way. The key to achieve that is smart grids that is, in its core, an integration of the traditional power system infrastructure as the physical system with information sensing, processing intelligence, and control as the cyber system. Such a system is described as a Cyber-Physical Systems (CPS). The CPS framework describes essentially a broad range of complex, multidisciplinary, physically aware next-generation engineered systems that integrate embedded computing technologies (cyber part) into the physical world.

CPS are known to suffer from integration and interaction challenges in both research and applications. Compared to the planning and operation of traditional power systems, smart grids tend to have higher complexity due to their cyber physical nature. The added intelligence on various levels and the adaptation of the different phases of design and development processes of smart grids raise needs for new validation techniques. Major requirements for the perception of new technologies such as ICT, automation, smart components, etc. are flexibility, adaptability, scalability, connectivity, and autonomy. Moreover, interoperability is also necessary to enable these functions on the various levels. Power system simulators have been in use for years by researchers and grid operators in order to study, operate, and maintain the system. Starting with the simplest powerflow simulations then advancing to real-time simulations, dynamic simulations, and power dispatch optimization, these technologies have gone a long path. In addition, several research institutions and grid operators built physical power system models in controlled environments for testing and validation of devices or algorithms. Information and communication technologies researchers have gone a similar path as their power system counterparts having realized sophisticated telecommunication networks simulators and benchmarks. The main challenge arise in the combination of both worlds in a physical environment emulating the smart grid.

In this chapter, we will see how smart grid applications are designed, developed, tested, and validated and list some of the software and hardware tools that are used in the framework of smart grids analyses. At the end we will address a missing tool for the validation of smart low voltage grids control and monitoring applications based on the advanced metering infrastructure.

Design and development of smart grid applications 2.2.1 Managing a complex / innovative project

Before diving into the the design and development process of smart grid applications, it useful to have a broader overview of the current trends in managing complex and innovative projects in general.

Several project management approaches exist to define and guide the development process of an engineering project. Old approaches such as the V-model shown in Figure 2.2 [START_REF] Forsberg | The Relationship of System Engineering to the Project Cycle[END_REF], a sequential path of execution processes, tend to have longer development cycles. Each cycle (phase) must be completed before the next one begins. This kind of development is simple and easy to use. V-model works well for small projects where requirements are easily understood. However, being very rigid and least flexible, it is not very suitable for more complex projects. In the past couple decades, iterative and incremental development method such as the Agile principle (Figure 2.3) have been very popular and, for complex/innovative projects, they tend to replace older project management methods such as the V-model method.

Verification and Validation Project Definition

Concept of Operations

Requirements and Architecture

Detailed Design

Integration, Test, and Verification

System

Verification and Validation

Operation and Maintenance

Project

Test and Integration

Implementation Implementation

CHAPTER 2. SMART GRID TOOLS

Agile methods work in very short (e.g. 3 weeks) development cycles and thus require quick investigation/analysis tools that will provide useful results in a short time frame. Agile methods also promote flexibility and regular changes in the project's objectives and development strategy, which calls for flexible/adaptable tools. These considerations support the type of generic and relatively easy-to-use software and hardware tools needed in complex projects such as smart grids.

Envision and Prepare

Adjust and Predict Iteration Develop Iteration

Demo and Retrospect

Deploy and Support

System sliced vertically, evolved iteratively. Another very popular conceptual tool is the Technology Readiness Levels (TRL) system [START_REF] Mankins | Technology Readiness Levels -A White Paper[END_REF] originally defined by the US National Aeronautics and Space Administration (NASA). TRL is a systematic metric/measurement system that supports assessments of the maturity of a particular technology and the consistent comparison of maturity between different types of technology. Each technology project is evaluated against the parameters for each technology level and is then assigned a TRL rating based on the projects progress. There are nine technology readiness levels. TRL 1 is the lowest and TRL 9 is the highest as shown in As we saw, there are several approaches for advancing a project from basic principles and ideas to an actual working system. Whether the followed approach is sequential or incremental, flexible or not, the development of new system capabilities typically depends upon the prior success of advanced technology research and development efforts. Furthermore, tools like the TRL scale provide a systematic way to measure a project's maturity. Developing a smart grid application is no exception, it requires many development tools and has to pass through several stages before these new technologies can be used in the field.

Management/ Government 2-4 week iterations

G. TRL

Stages of developing a smart grid application

There are many consecutive stages and corresponding validation methods that can be used during the different processes of the development of a power system application. For smart grids, the general stages followed by the power system application development can be followed but with more complex and more advanced tools. The research community have come up with new methods to represent smart grids so that the design and validation of applications in a cyber-physical environment can be achieved. In general, the whole development process can adhere to the following main stages:

• System requirements and design: Any new mechanism starts with an idea then gets translated into a systematic concept. During the early design stage, the method gets drawn up and elaborated until it takes a more specific form. After that, it is important to prove its functionality and feasibility. In other terms, a proof of concept of the method is needed which, typically, is practically achieved using software simulations.

Software simulations have been an important tool for studying and analyzing power systems. They provide an environment to test new ideas and study old ones in a scalable easy-to-build manner. For smart grids however, old simulation techniques are not sufficient to represent their cyber-physical nature. An alternative to these simulation techniques is the combined simulation also known as "co-simulation". Co-simulation is a multi-layer simulation framework of multidisciplinary complex systems where the underlying subsystems are able to exchange heterogeneous information resembling their real world interaction. Although highly promising, the co-simulation of smart grids is highly difficult, it is thus still the topic of active research, and has not reached the maturity level needed to be used as an easy-to-use and fully reliable off-the-shelf validation tool.

• Prototyping: After the conceptual design is mature enough for a proof-of-concept, the second phase of development begins where the first prototype is developed. In the process of transforming the concept into a prototype, issues that were not considered during the design stage are included. Boundary problems often neglected during the early design stage need to be addressed in the prototyping process through iterative refinements of the solutions and algorithms. In later prototyping phases, further validation may be required depending on the system requirements and regulations. This can be done mainly either by including parts of the real system in the simulation commonly known as Hardware-in-the-Loop (HIL), or by emulating the whole system under study in a laboratory environment with real physical elements. The goal at this stage is to eliminate some of the limitations of software simulations such as abstraction, over simplification, or misrepresentation of the real system understudy. Some applications where reliability is critical for operability and safety go a further step in the validation process by performing field trials in dedicated pilot projects.

Although Co-simulations provided an alternative for traditional simulation techniques in the design stage of cyber-physical systems in general and smart grids in particular, later validation stages are still not that common in their research community. Extensive testing and validation of smart grid applications should follow a similar yet more complex path to that followed by traditional power system applications. For instance, early design of power system mechanisms start with simple means such as static offline simulations. These simulations get replaced by more complex dynamic simulations that provide further validation to the application under development. Laboratory test benches are also common in power system development as a tool for validation and for educational purposes. This approach CHAPTER 2. SMART GRID TOOLS proved to be very effective and has become the conventional approach of design, testing, and validation in power systems. This topic will be further discussed in the coming sections of this chapter.

• Realization and deployment: This stage is the final step before normal operation and mainly covers the realization of the solutions or products as well as their roll out and installation in the field. Depending on the complexity of the process and the technical requirements, this stage may be realized gradually with agile methods or in bulk following a high-level design.

The main stages of the design and development of smart grid solutions are similar to other domains, with challenges identified at the fulfillment of high-reliability requirements, and the observance of strict real-time requirements and the interaction with several actors while in compliance with national or regional regulations. Therefore, proper design and validation tools are required in the different stages due to the higher complexity of smart grid systems and their cyber-physical nature. The overall development process of smart grid technologies requires a holistic view on the system where the entire domain spectrum of smart grid solutions has to be taken into consideration. Besides technical components such as grid infrastructure, storage systems, DERs, etc., the development process has to cover ICT, customers, markets, governance, to name a few, all while sustaining the stability, safety, and efficiency of the smart grid system.

In order to guarantee sustainability and supply security in future smart grids, a cost effective holistic procedure in smart grid system validation is required where the following issues are identified according to [START_REF] Strasser | An Integrated Research Infrastructure for Validating Cyber-Physical Energy Systems[END_REF]:

• A cyber-physical, multi-domain approach for analyzing and validating CPS on the system level is missing today; existing methods are mainly focusing on the component level -system integration topics including analysis and evaluation are not yet addressed in a holistic manner.

• A holistic validation framework (incl. analysis and evaluation/benchmark criteria) and the corresponding Research Infrastructure (RI) with proper methods and tools needs to be developed.

• Harmonized and standardized evaluation procedures need to be developed.

CO-SIMULATION IN SMART GRIDS: LITERATURE OVERVIEW

29

• Well-educated professionals, engineers and researchers that understand smart grid systems in a cyber-physical manner need to be trained on a broad scale.

In what follows, we will look at some of the modern tools that are employed in the testing and validation of smart grid technologies and that help to realize solutions to the issues mentioned above. Note that it is worth mentioning that the European project, European Research Infrastructure supporting Smart Grid Systems Technology Development, Validation and Roll Out (ERIGrid) 2 , was created to address the lack of system validation approaches for smart grids. Although not related to our project, it has supported, partially or fully, most of the tools that will be mentioned below so it is worth checking out for a survey on the state of this topic.

Co-simulation in smart grids: literature overview

The simulation approaches proposed for combining the power system, communication networks, and the consumers in the context of smart grids can be categorized into two fundamental concepts: comprehensive simulation and combined (co-) simulation. The first concept is the creation of a new simulation for modeling both power system and communication network in one development environment. The major challenge here is the combination of both models in a single environment that requires an implementation of power system simulation techniques in a communication network environment or vice versa. This approach has been presented in [START_REF] Mets | Integrated simulation of power and communication networks for smart grid applications[END_REF] introducing an integrated smart grid simulation framework using OMNeT++ as development platform. The focus is set on simulating the electrical distribution system, which has been simulated in MATLAB using the iterative forward/backward sweep method normally used in the radial distribution system and linked into the OMNeT++ simulation. Note that although it may appear that two separate simulation environments are used, a MATLAB environment for power grids and OMNET++ for ICT, which makes it look like more like a co-simulation rather than an integrated tool, this is not the case here. The simulation environment here is that provided by OMNET++ that define the topology of both the power grid and the ICT infrastructure. All the operation steps including the design of topologies, configuration of simulation parameters, execution environments, and result processing are managed by CHAPTER 2. SMART GRID TOOLS the OMNET++ framework.

Another example is [START_REF] Vinot | Conception of a distributed information system to manage flexibilities in electrical distribution networks: model, simulation and implementation[END_REF] where a comprehensive simulation environment is developed where in addition to the power grid and communication network, the following notions in a smart distribution grid are considered:

• the notion of consumers (and their loads, including a relatively detailed individual model of the flexible ones, eg the state of charge of the battery of a flexible electric vehicle).

• the notion of sensors (most importantly the smart meters).

• the notion of a controller with its connection to sensors and actuators through the simulated communication networks, and of course its internal control logic.

While this approach is suitable for static power system analyses such as powerflow calculations, it is not easily transferable to dynamic power system simulations, which are on a higher level of complexity.

Combined simulation of both networks (power and communication), possibly with other domains such as information processing, market operations, etc, in their specialized simulators is the second approach for smart grids simulations. Using a co-simulation, the main challenge is to connect, handle and synchronize data and interactions between all simulators. The remaining part of this section will focus on this approach as it is the prominent in the smart grids research where we will have an overview of several co-simulation platforms.

The Electric Power and Communication Synchronizing Simulator

The main challenge in co-simulations is to connect, handle and synchronize data and interactions among the different simulators. The implementation of time advance and synchronization strategies pursued by the discrete event and time based simulators needs particular care. As an advantage of this approach, there is no need for re-implementing given simulation models in a "non-suitable" environment. Addressing this type of work is not new where, to the best of our knowledge, the Electric Power and Communication Synchronizing Simulator (EPOCHS) [START_REF] Hopkinson | EPOCHS: a platform for agent-based electric power and communication simulation built from commercial off-the-shelf components[END_REF] that dates back to the year 2006 has been the first to combine simulators for both power system and telecommunication networks. The goal of this platform is to provide a simulation environment for analyzing the mutual impact on both networks.

In this platform, two commercial simulators PSLF (for electromechanical transient simulations) and PSCAD/EMTDC (for electromagnetic transient simulations) are connected to with the open source Network Simulator 2 (NS2) based on the High Level Architecture (HLA) (IEEE standard 1516-2000). The "glue" holding HLA combinations together is a central component known as a Run-Time Infrastructure (RTI). The RTI routes all messages between simulation components and ensures that the simulation time is synchronized across all components. EPOCHS has been designed for investigating the impacts of Multi-Agent Systems (MAS) in power systems. Agents are recognized as a natural way to introduce extensibility into the grid without drastically changing the usual power system architecture and are therefore gaining acceptance in the electric power community. Their autonomous nature, ability to share information and coordinate actions, and the potential to be easily upgraded or controlled from a remote location are appealing to grid operators and protocol designers. Agents in EPOCHS are intended to minimize the differences between simulated systems and their real-world counterparts, as well as to ease implementation for the users. EPOCHS utility has then been demonstrated experimentally in a variety of electric power scenarios involving communication, including backup protection, special protection systems, and voltage collapse.

Integrated co-Simulation of Power and ICT systems for

Real-time Evaluation

Another platform based on HLA has been proposed in [START_REF] Georg | A HLA based simulator architecture for co-simulating ICT based power system control and protection systems[END_REF][START_REF] Georg | INSPIRE: Integrated co-simulation of power and ICT systems for real-time evaluation[END_REF][START_REF] Georg | Analyzing Cyber-Physical Energy Systems:The INSPIRE Cosimulation of Power and ICT Systems Using HLA[END_REF]. It is a hybrid simulator for Integrated co-Simulation of Power and ICT Systems for Real-time Evaluation known as INSPIRE. This platform is mainly motivated by the ICT-based monitoring and protection applications such as Wide Area Monitoring And Control applications (WAMPAC) in the transmission grid. INSPIRE aims at a fundamental simulation architecture for integrating a variety of software modules (e.g. Phasor Data Concentrators, centralized and decentralized control algorithms, etc.) observing industrial standards such as IEC 61850 and the interoperability standard OPC, e.g. for facilitating the integration of substation hardware. Because of the detailed modeling of both power and communication networks, CHAPTER 2. SMART GRID TOOLS INSPIRE is a convenient tool for evaluating their mutual effect. For example studying scenarios such as cascading outages and overlapping communication flows.

The hybrid simulator architecture implemented in INSPIRE is a modular architecture with 3 major modules. These modules are the simulation core, the networking layer, and the management layer as shown in figure The simulation core provides the master event and time control for the synchronization of the sub-simulators in addition to the generic network description providing the overall network and scenario topology. The HLA is used for the master event and time control by synchronizing the logical time of all simulators. Keeping synchronicity is guaranteed using a conservative synchronization algorithm. The generic network description of the power system is used to drive the hybrid architecture and a converter for mapping the CIM model of the power system into a topology for the ICT simulator ensures that both simulators are coherent. The networking layer provides the connectivity to the sub-simulators, taking into account various network protocols to enable a generic interaction with third party software tools and simulators. Considering the HLA based simulation core, proprietary sockets as well as standardized web services connections are available for realizing the connectivity to the sub-simulators. The management layer provides comprehensive functionalities for the combined simulation environment. It manages and operates the hybrid simulator via the following modules: the main configuration, scenario configuration, database, statistical analysis, event logging, and incident generation.

The communication architecture model in INSPIRE consists of three layers:

• Centralized Monitoring and Control Layer: contains centralized components that can be mapped to specialized simulators such as protection components, control center, power plants, etc. Components at this layer can not communicate directly but through the wide area communication.

• Local Process Layer: handles traffic arising within substation and field level (e.g. local monitoring, measurements, process control, . . . ). Components at this layer can communicate directly. Communication to other layers has to be transmitted using the wide area communication layer.

• Wide Area Communication Layer: interconnects the other layers by providing a heterogeneous communication infrastructure. Wired or wireless communication technologies can be used.

Although this architecture is based on the power transmission network topology, it can be also adopted for medium voltage networks in the distribution grid. Furthermore, similar architectures can be used in AMI supported low-voltage networks as we will see in a later chapter.

Smart grid as multi-layer interacting system for complex decision makings

A novel and complicated approach to the analysis of smart grids based on a multi-layer representation of their several aspects, as well as the related environmental constraints is proposed in [START_REF] Bompard | Smart Grid as Multi-layer Interacting System for Complex Decision Makings[END_REF]. The multi-layer platform model shown in Figure 2.6 includes the power, cyber, social and environment layers, along with threats and factors that may affect the system and lead to unwanted situations. Figure 2.6: Multi-layer platform of complex power system [START_REF] Bompard | Smart Grid as Multi-layer Interacting System for Complex Decision Makings[END_REF] The major goal of this platform is to evaluate the impact of the autonomous prosumer behavior onto the physical grid. The authors mainly describe the multi-agent simulation they employed for prototyping, implementing, and simulating the several actors with a focus on the modeling of the social layer and the behavior of the individual agents (prosumers) and coordination agents (DSO and marketers) and their interactions with other layers. A simulation intended to capture the interactions between the prosumers, and the MV/LV distribution system operator and the regulator, taking into account the social characteristics of prosumers, the physical properties of the network, and the regulation methods of the operator is given in an explicative example. The goal of this simulation is to link the social behavior and decision making to the impacts on the modern power distribution network. Note that this goal is not mainly relevant to our research, however it was included to show an example of the challenges of simulating complex cyber-physical system such as smart grids.

MOSAIK: a flexible smart grid co-simulation framework

MOSAIK developed at the Oldenburg Institute for Information Technology, OFFIS [START_REF] Steffen Schütte | Mosaik -Smart grid simulation API: Toward a semantic based standard for interchanging smart grid simulations[END_REF][START_REF] Rohjans | mosaik -A modular platform for the evaluation of agent-based Smart Grid control[END_REF][START_REF] Schütte | OPC UA compliant coupling of multi-agent systems and Smart Grid simulations[END_REF] is one of the first co-simulation tools to offer a modular and integrative approach to smart grid simulation as a highly interdisciplinary field of application. It is an open source modular simulation suite for the evaluation of smart grid control mechanisms. It offers a flexible smart grid co-simulation framework that leverages the combination of existing simulation models and simulators via well-defined interfaces to create large-scale smart grid scenarios. MOSAIK defines large-scale as "thousands of simulated entities distributed over multiple simulator processes". These scenarios can then serve as testbed for various types of control strategies [START_REF] Schütte | Simulation Model Composition for the Large-Scale Analysis of Smart Grid Control Mechanisms[END_REF] (e.g., multi-agent systems or centralized control).

The architecture of MOSAIK consists of a simulator management module sim-manager and a scheduler. The scheduler coordinates the exchange of data between all connected simulators based on a common simulation clock. In its current state, it provides discretelytimed, explicit simulator coupling. The sim-manager, on the other hand, enables data exchange with simulators by establishing TCP connections with them. Mosaik also offers APIs for simplified user interaction. A Component-API has to be implemented for each simulator that is connected to MOSAIK. It sets up a TCP socket and organizes the data exchange with MOSAIK in the JavaScript Object Notation (JSON) format. In order for the model developers to implement the interface in the language that is most suitable for their simulator, implementations of this API are available in different programming languages like Java, Python, or MATLAB. Additionally, a Scenario-API provides a set of commands that allows users to instantiate model entities from the integrated simulators and establish connections between them. The MOSAIK user is to employ these functions in a scenario script that may then be executed to run the co-simulation process.

A comparison study between MOSAIK as a light-weight tool and other prominent cosimulation frameworks that are based on various implementations of the HLA standard published in 2017 [START_REF] Steinbrink | Smart grid co-simulation with MOSAIK and HLA: a comparison study[END_REF] shows that in contrast to HLA-based systems, MOSAIK features a more concise set of functionalities, and is aimed at being easy to apply for users from different domains. MOSAIK allows for an easier entry into co-simulation while HLA is more versatile and powerful on the long run. The study concludes that researchers may want to employ MOSAIK in early stages of a co-simulation study when large numbers of different simulators and topologies need to be tested. HLA, on the other hand, may be applied for more mature studies that require extensive control over simulator coupling for the sake of output accuracy. Moreover, the study suggests that in a future work, a modular approach for simulator interfacing may be developed that supports the transition between the two styles of co-simulation by allowing gradual extension of the same interface.

Smart grids in a laboratory environment: an overview

Similar to software simulation tools, hardware tools have been used in the design and validation of power systems and smart grids mechanisms as well as in education. As we saw in the previous section, the core design principle of these software simulation tools had to go a new path in order to be compliant with the cyber-physical nature of smart grids. This path has led to the adaptation of the co-simulation concept to the domain of smart grids and consequently to the realization of the aforementioned many co-simulation tools and frameworks. This same path has to be followed in the design and implementation of hardware tools represented by laboratory test-beds and simulators.

Existing laboratory setups are usually either educational setups or test benches that only represent a part of the smart grid framework. For example, most power system laboratory setups implement the electric system from the power perspective only and ignore the effects of the communication layer as in [START_REF] Alvarez-Herault | An Original Smart-Grids Test Bed to Teach Feeder Automation Functions in a Distribution Grid[END_REF]. On the other hand, other setups that study the telecommunication perspective of a smart grid do not include actual power flow in their systems as in [START_REF] Chauvenet | G3-PLC based IoT sensor networks for SmartGrid[END_REF]. These tools are important for either educational uses or for some unit tests and a few validation processes. They are not sufficient however to be used as fully fledged validation platforms for most of the smart grid control or monitoring mechanisms. In the remaining part of this section we will have an overview of some of the existing laboratory platforms related to smart grids.

LinkyLab: Smart metering infrastructure testing

In 2015, Enedis 3 set up one of the first European smart meter test centers, the LinkyLab. In this laboratory, a few dozen engineers and technicians put Linky smart meters and concentrators to the test with the aim of testing their reliability and robustness. Enedis continued to develop the LinkyLab by putting its skills acquired in electronics and embedded systems at the service of innovation in the various businesses. Throughout the production of Linky meters, the mechanical robustness of the product, communications and meter operation are tested. At the LinkyLab, several sections of the laboratory are designed to test different aspects of the meters and the metering infrastructure. The "hardware qualification" section performs what is known as "stress tests" on the meters. This is done by testing the ergonomics of the meters. In other terms, the meters are "stressed" to check their resistance to various mechanical and climatic stresses (extreme temperature, vibrations, humidity, . . . ). Additionally, several electromagnetic tests are performed to ensure the meters operation while they interact with other elements from the real environment (household appliances, mobiles, . . . ). The meters' reaction to possible electrical network events (over-voltage events for example) are also performed. Further tests include validating that the meter interfaces are functioning as expected.

In another section, Clusters of meters that communicate with each other are set up to test a "dense environment" scenario. The laboratory makes it possible to verify that the PLC communications are functioning well, in different configurations. In this section, a few hundreds of meters are tested together, in particular their "cluster operation". Thanks to G3-PLC smart meters form a kind of social network, where each meter contributes to the communication of its neighbors. If there is a defective meter or a noise problem, communication can go through a neighboring meter. Safety protocols are verified, load curves, correct operation with all types of concentrators, etc. The good compatibility of the meters, that are manufactured independently by 5 different manufacturers, is also tested.

This laboratory is big step in an experimental approach for the Linky project that shows a great potential in the field of metering tests and validation. It covers a wide range of tests related to the meters operation and to their communication network, in this case G3-PLC. Until very recently, the laboratory was a pure telecom environment where the absence of power system components rendered such a platform not sufficient as a complete smart grid test and validation tool. Recently, Enedis renamed the lab to Enedis Lab and added a power system part turning the lab into a hybrid environment for both telecommunication testing and smart grid studies.

Laboratory Education of Modern Power Systems Using

PHIL Simulation

The laboratory setup developed in [START_REF] Panos | Laboratory Education of Modern Power Systems Using PHIL Simulation[END_REF] is a smart grid platform that is designed purely for educational purposes. Its main design is based on Power Hardware-in-the-Loop (PHIL). PHIL is a section of HIL simulations that allows the connection of a physical power component (e.g., photovoltaic inverter) to a real-time simulated network; it may be seen as an extension of the Controller Hardware-in-the-Loop (CHIL) technique that is used to test hardware controllers (e.g. controller of an inverter, relay, with real low-power signals being exchanged but no high power electricity flows). The setup comprises three microgrids connected to a Supervisory Control And Data Acquisition (SCADA) system as shown in the schematic of Figure 2.9. The laboratory is equipped with three PV simulator units, two AC grid simulators and three industrial protection relays. A flexible power electronic platform comprising three DC/DC converters and a DC/AC converter is programmable in Matlab/Simulink software. Moreover, ten intelligent load controllers (embedded systems equipped with analog and digital inputs/outputs, TCP/IP connectivity and load switches) enable the implementation of multi-agent systems.

HIL simulations such as this laboratory environment have multiple advantages. They are one of the best ways for unit testing of new equipment and a first step towards the Legend Intelligent Load controllers This laboratory setup however suffers from some drawbacks. This setup in its current state, although it represents an advanced non-conventional power grid, does not truly represent the cyber-physical nature of a smart grid: for example, it ignores the effect of ICT on its applications. Another disadvantage is that such a setup is not very extensible both in terms of cost and space.

SEPS: Smart Electric Power System Laboratory

The author in [START_REF] Deese | Development of Smart Electric Power System (SEPS) Laboratory for Advanced Research and Undergraduate Education[END_REF] discusses the development of the Smart Electric Power System (SEPS) for Advanced Research and Undergraduate Education. Their work has two main objectives the first of which is to outline the techniques that researchers at small undergraduate institutions employ to develop a practical yet effective power engineering laboratory.

The second objective is to demonstrate how they reemployed those techniques to develop SEPS. SEPS is described as a hardware setup to facilitate the study of emerging technologies like renewable generation, grid-connected energy storage, DC transmission, and digital power system measurement, communication, and control. Special emphasis is placed on integration of undergraduate education and research.

The work highlights the characteristics to a power engineering laboratory that facilitates both teaching and advanced research at an undergraduate institution. Although the author does not claim any of these characteristics are crucial for the test and validation phase of smart grid development, we see that most of them apply to the latter as well. These characteristics include:

• Robustness: The setup should be robust in the sense that first it may be used to study introductory as well as advanced topics, and second may be operated by novice as well as experienced engineers.

• Cost-/Space-Efficiency: Because smaller institutions are often most sensitive to funding and space limitations, it is important their faculty develop laboratories that provide significant research and teaching benefit with conservative funding and space requirements. For power applications, this may be achieved via utilization of components with lower kilowatt ratings. We find this point very compelling as it is one of the major limitations imposed by the current development strategy in the domain of power systems in general and smart grids in particular. The sizing of any laboratory setup is one of the most important design decisions the designer should take. We, as well as the author of SEPS, adopt the approach that exploits smaller platforms that are both cost and space efficient with a lower consumption footprint to achieve our goals.

• Commercially Available Hardware: It is important that institutions rely on commercially available hardware for laboratory development when possible because the construction and testing of custom hardware may require more time and effort than a faculty researcher (or small group of faculty researchers) may provide. This however does not mean that researchers at undergraduate institutions cannot develop unique and innovative facilities; it means they should focus their efforts on system-level design and the generation of funding proposals that justify assistance from external vendors. While we totally agree on this point, we would like to add that it is sometimes difficult to opt out of all "custom-developed" equipment if the platform being designed targets for example emerging applications that require state-of-the-art technologies, or employs a paradigm that is not mainstream in the domain such as smaller down-scaled setups that aim at cost/space-efficiency for example.

In addition to these characteristics, the author answers the question of how would the laboratory setup address emerging technologies to ensure its relevance in the modern engineering world. This is a crucial question in the transition towards smart grids and it relates inherently to the idea of developing a smart grid test and validation platforms. The proposed answer is that the setup should use some, if not all, of the following technologies:

• Remote Measurement and Control: One primary characteristic of a smart grid is the presence of digital technology to facilitate remote measurement, communication, and control of power system components. As such, this technology is essential to any modern power engineering laboratory. It allows a user to study, via physical experimentation, topics like: 1) performance of phasor measurement units or smart meters; 2) design and testing of closed-loop power system control algorithms; 3) effect of noise and latency on state estimation and optimization. In addition to these topics, the existence of this characteristics is essential for the system to represent a smart grid.

• Power Electronic Converters: The presence of power electronics in power systems has grown drastically, primarily due to reduced cost. As such, it is important that a modern power engineering laboratory incorporate this technology.

• Renewable Power Generation: Studying electricity generation from renewable and distributed energy sources is one of the most relevant topics in smart grids.

As such, hardware associated with this technology is essential to any smart grid

ADVANTAGES AND DRAWBACKS OF THE DEVELOPMENT AND VALIDATION TOOLS

laboratory setup. It allows a user to study, via experimentation, topics like: 1) efficiency and capacity factor of renewable energy sources; 2) the effect of devices with stochastic output on power system stability; 3) their role in economic dispatch and demand response.

• Grid-Connected Energy Storage: The utilization of bulk energy storage in electric power systems is limited, predominantly because of high cost. However, this technology has a great potential to revolutionize how electricity is generated, transmitted, and consumed. The presence of an energy storage in a smart grid laboratory allows user to study, via experimentation, topics like: 1) performance of new battery and hydrogen fuel cell technologies; 2) design and testing of large-scale charge controllers; 3) operation of power systems without spinning reserve etc.

Both the design strategies of SEPS and our setup agree that these technologies are important. Although neither SEPS nor our setup (as we will see later) currently generate electricity from renewable sources, both systems employ some kind of a renewable energy source emulator module through a custom DC power supply controlled by software. However, unlike SEPS that employs lead-acid batteries with associated power electronics for storage, our platform currently does not support this technology.

Advantages and drawbacks of the development and validation tools

As we have seen so far, the development and validation stages for any complex project such as a smart grid are numerous and require different tools for each stage. The utilization of software tools for early design stages, then moving to hardware tools in laboratory setups and after to dedicated research field sites, before the realization and deployment in the field, is the current trend -especially in power systems and smart grids. In this section, we will provide a brief comparison to demonstrate the advantages and drawbacks of software tools as opposed to hardware based tools and testbeds. Here is a list of systematic differences between software and hardware tools:

• Cost and development time: Developing tools for complex systems, whether software or hardware is both time consuming and costly and there is no clear winner between the two approaches. Using existing software simulation tools is in general both time and cost effective compared to creating a hardware setup for instance.

Developing a new simulation software on the contrary may be extremely costly, especially when the simulator is supposed to capture fine details of the system understudy, and when it is supposed to capture a wide range of phenomena -such as power and ICT phenomena in our context.

• Flexibility: Software is more flexible than hardware; it is usually easier to change with a much lower cost and effort. Software tools evolve through multiple releases by adding new features and re-writing existing logic to support the new features.

Hardware products on the other hand consist of physical components that cannot be "refactored" after manufacturing, and cannot add new capabilities that require hardware changes.

• Scalability: Software easily wins when it comes to scalability. Increasing several times the system size would require only a few changes in the software source or in the configuration. Even if this leads to the required computational power being more than what the existing machines can handle, this can be easily handled nowadays with modern machines and cloud computing. Hardware tools on the other hand are restricted physically by the cost, size and power consumption of their components.

• Reproducing and Sharing: Software is replicable and can be easily shared. In contrast, reproducing a hardware setup requires rebuilding the whole system and sharing an existing setup is limited to people in the same physical location.

• Runtime: In certain cases such as demonstrating a long-time scenario, it is useful to be able to accelerate the operation to gain time. This is often not feasible with hardware tools due to restrictions imposed by the physical phenomena of the system while software simulations could allow to accelerate the runtime thus providing this feature. Dynamic system simulations that are very computation-intensive on the contrary can be very slow (much slower than real time, hence much slower than a physical experiment).

• Accessibility: When modeling a component in software, the model in some cases provides access to certain physical values that are otherwise difficult or even im-

ADVANTAGES AND DRAWBACKS OF THE DEVELOPMENT AND VALIDATION TOOLS

possible to access in hardware. For instance, the level of electromagnetic noise in a PLC-enabled network of smart meters is not so easy to measure, and its impact is thus difficult to assess (not to mention the problem of reproducibility).

• Abstraction: Software tools may eventually fail to capture important features of the physical system under consideration. Indeed, abstraction in software simulation is mostly unavoidable when it comes to simulating physical phenomena. The need for abstraction may also come from the phenomenon understudy being too complex, or not so well-captured by models, or simply unknown. For instance, suppose that you have a device that you want to model in software but you do not have access to the internals, such as the firmware or the internal composition of this device; the device in this case constitutes a "black box" and reproducing it by simulation is often non-realistic. Another example is the noise that affects the PLC communication.

Noise is a complex phenomenon that is difficult to understand and then properly reproduce in simulation. Software simulation can only ignore or poorly reproduce such poorly-understood physical phenomena, whereas physical experimentation on a hardware test bench will capture them "effortlessly": they will just exist and be there. Abstraction and over-simplification in software tools, intentionally or not, is a drawback that hardware tools inherently overpass.

• Misinterpretation: Software contains no physical elements thus it requires the modeling of every behavior of a physical phenomenon. When doing so, it is easy to misinterpret the model and requires a lot of expertise to correctly model the system. This is less of a problem in hardware where most of the phenomena are represented physically in the system.

• Tool Abuse: Hardware tools usually require some expertise and training for their operators and users. In the power system domain, it is also required to have a sort of a license before working with tools with live voltage. These requirements decrease the chances of misusing the tool. Software tools on the other hand are accessible to a wider range of users with lower entry level experience requirement. This could lead to the exploitation of the tool where it is easier to silently get falsified outcome.

• Development vs. Deployment: Software simulation frameworks rarely provide software containers that emulate the field hardware on which smart grid software will run. For instance, if a particular piece of software is meant to run on a smart meter, the simulation framework will likely not provide an emulator of the microprocessor and operating system that are embedded inside an actual smart meter. This means that the software simulation will not actually test the final binaries that will eventually run on the smart meter: it will test a software abstraction designed to mimic the actual field software. In other words, software simulation platforms are almost always inadequate to validate the final binaries of a specific software component. This point coupled with the abstractions induced by software modeling makes software tools less capable of capturing the industrial behavior of the system compared to hardware tools.

• TRL Score: Software tools cannot score high on the TRL scale compared to hardware tools. For beginners, starting from level four, both the NASA and the European variants of the TRL scale indicate a necessity for the technology or the component to be "validated in a laboratory environment". Therefore hardware tools naturally score higher levels on the TRL scale than what software tools could possibly achieve. Without such tools, new smart grid technologies would have to jump from a TRL 1-2 to a TRL 6+. In other terms, a technology would be tested in field trials without having been sufficiently tested/improved/optimized/validated in the lab.

Conclusion

Many tools are being developed to address the lack of system validation approaches for smart grids. Co-simulations replaced conventional simulations for the cyber-physical systems based approaches. A prominent approach for co-simulation tools is the multi-agent simulation concept that facilitates the integration of different entities in a coordinated framework. Co-simulation approach has been proven to be very useful for the design and test of smart grid applications. Additionally, research laboratory are developing hardware test beds to tackle later validation steps of smart grids applications and to provide educational tools for the students' interaction with the physical world. Combining the two procedures is necessary for a holistic research approach that fosters future innovation in the modern cyber-physical power system. These tools however are still in an early state 2.6. CONCLUSION 47 and do not cover all the areas of the large smart grid framework. In this chapter we provided a literature study of the engineering process of smart grid applications and the various existing smart grid applications development and validation tools. Additionally, we listed the strength and weaknesses of the available approaches to develop these tools.

In conclusion, we can summarize the current state of the research in this domain as shown in Figure 2.10.

Real system components (final binaries):

1 We can see that the research community is missing a holistic laboratory setup that integrates both power system components and ICT technology. In particular, a low-voltage testbed based on the smart metering infrastructure is missing. Such a setup will allow to study more advanced futuristic smart low-voltage distribution network applications that exploit the already widely deployed smart meters beyond billing customers. In the next chapter, we will discuss the design and implementation of such a platform realized at G2Elab4 and LIG 5 and funded by ENEDIS.

Chapter 3

The technical aspect of the proposed platform: hardware design & implementation and software interface

Introduction

As we saw in the previous chapters, the complexity and interoperability of modern power systems create new challenges in the development, testing, and validation of their applications. These challenges require new test and validation tools that can be either pure software simulation tools, a combination of software and hardware tools as in HIL environments, or fully-fledged hardware platforms designed in laboratory to mimic a smart grid. In addition, the complexity of a smart grid system makes the development of such tools as a monolithic entity infeasible. In fact, even most traditional power system tools were designed to deal with parts of the system and not the whole power system at once, although it is worth mentioning that the interoperability between traditional power system components is not as evident as that of modern systems. Example tools are distribution or transmission grid simulators for static or dynamic studies, fault analysis and protection design, harmonic calculation and so forth; laboratory setups representing a microgrid at MV level, LV level or both; etc.

We also saw that co-simulation tools and frameworks managed to replace old simulation tools and to satisfy the needs of design and earlier testing of smart grid applications. Additionally, some hardware tools and laboratory setups addressed subsequent testing phases and final validation of some parts of the system in addition to serving as interactive educational platforms. These tools however are incomplete and do not cover the whole smart grid system. A particular missing piece is a laboratory setup that is based on the advanced metering infrastructure that is so widely used in almost every country that started to get on the smart grid track. For all these reasons, we propose a laboratory platform, entirely based on smart meters and their metering infrastructure, that emulates a smart low-voltage grid modeled after European LV grids with the purpose of exploiting this metering infrastructure for testing, validating and demonstrating monitoring and control applications. In the rest of this chapter we will discuss the design decisions and engineering aspects of this platform.

Hardware design

The platform design is focused on capturing the several axes of a smart low-voltage grid as shown in Figure 3.1 below.

Electrical Grid:

-Lines -Transformer

Loads and generators, (potentially flexible):

-Electrical installations, -Electric Vehicles (EV), -Rooftop solar panels (PV)

Sensors:

-Smart meters -SCADA systems -In-home sensors

Communication:

-Data concentrator -Power Line Communication -LAN, WAN, ...

Automation (software/intelligence):

-Central control -Smart devices (PV inverters, EV chargers, ...), -Home automation Smart (LV) grid

System under study

The system under study is a "smart low-voltage grid" which represents the secondary distribution subsystem per the power system structure described in Section 1.1. In particular, it represents a French LV network that operates at 230 V level and a frequency Representing a low voltage network, the platform has to model all power system components that exist in a real LV grid namely:

• Secondary substation: The facility for medium voltage to low voltage transformation that happens at the MV/LV transformer. Having the ability to control the voltage at the substation in the platform is important for testing reproducible scenarios and having reproducible results by eliminating the external grid factor. It also has the advantage in adding the ability to represent the upstream voltage fluctuations in a controllable manner.

• Electric power lines: The LV lines are responsible for power transfer in the network. In the platform, having configurable lines lengths and connections allow representing different network topologies.

• End customers: This includes consumption (customer appliances) and distributed 52 CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM generation (rooftop solar systems). In the platform, chosen consumption and generation/solar irradiation profiles can be used to model the end customers' behavior.

Being a "smart" grid on the other hand, the platform has to account for other requirements like:

• Connectivity: An inherent property of any distributed smart system is the existence of a communication network. In the smart LV grid this is made possible by communication media such as PLC and wireless, and end devices such as the data concentrator and smart meters.

• Observability: Unlike traditional low-voltage distribution systems that lacked any type of online sensors, modern systems can now be monitored by the DSO thanks to smart meters. Local observability, at a domestic level, is also a property of smart LV grid thanks to home automation systems powering smart homes.

• Controllability: The shift from conventional loads that passively absorb power according to their needs and centralized generation centers to "smarter" cooperative loads and distributed generation requires the LV grid to be controllable. Controllability requires these factors: a control logic (voltage control, time-of-use, demand response), actuators (controllable/smart loads and generators like EV chargers, air conditioners, water heaters, solar inverters, etc.), computation units (central, residential, embedded, etc.).

• Flexibility: The implementation of dynamic price contracts in the electricity market of a connected and controllable system and the introduction of renewable energy resources and electric vehicles promoted flexibility in the system. All components of the LV grid may now participate in determining its overall state since flexibility can be identified in energy sources, loads and storage systems. Flexibility helps in meeting technical, environmental and economical constraints thanks to the two-way power flow and two-way communication in modern distribution systems.

In addition to the points above and since this is an experimental platform, it must be generic enough to allow the testing and validation of a variety of scenarios. This can be translated technically to mean a platform with as much as possible flexibility and configurability for all of its components.

Platform sizing: scaling of electric quantities

One of the most important design choices that have to be made when designing such project is the power rating of the used electric components. Depending on this choice, the size of the platform and its cost and sometimes its operational power and resources may change drastically. This choice also affects how the implementation is carried on and the final product's usability in certain scenarios. In the domain of power system educational platform and laboratory test-beds, most of the design decisions are dictated by the availability of the needed equipment in the market. In order for these equipment to replace the real system in a laboratory environment, they need to be programmable, configurable, and able to operate in the operation range of their real world counterparts.

For instance, a modern microgrid testbed requires a variety of devices starting with a grid simulator, controllable loads/generators, storage devices, measuring devices, and a configurable network topology, etc. For example, a device that could typically be used in smart and micro grid laboratory platforms to emulate real world loads and generators is a four-quadrant power electronic based load such as the Cinergia EL+vAC 4Q Current Source or NH Research 9430-Series Regenerative 4-Quadrant AC-Load. These devices are usually manufactured at a power rating ranging from a few kilowatts to a few hundreds of kilowatts. Thus, for any project that requires off-the-shelf devices such as these, it has to be designed based on their size, rated power and cost.

In our platform, we chose to follow another approach with custom made power electronic equipment at a reduced power scale. The reasons for this approach are mostly for cost and space efficiency (See also the reasoning on cost and space efficiency of experimental platforms and on utilizing commercially available hardware in Section 2.4.3). The scaling of the power consumption of the setup can be achieved by either reducing the scale of the voltage, the current or both. Depending on the expected type of scenarios and applications that will be tested one approach or another could be preferred. In [START_REF] Le-Thanh | Test bench for self-healing functionalities applied on distribution network with distributed generators[END_REF] for instance, a microgrid of 30 MVA rated power at 20 kV was adapted in a test bench as a and generators has to be accounted for when modeling the LV lines so that they have the "proper" impedance that is valid at both 50 Hz and the narrow band PLC frequency range 35-91 kHz (CENELEC A) as specified by European standard [START_REF] Fsp_Lang_Id | [END_REF]. The concept of "proper impedance" is different in the two cases. At 50 Hz, the proper (lab) impedance has 100 times the real (field) value, so that the correct voltage drops happen at reduced currents.

On the contrary, in the 35-91 kHz band, the goal is to have a realistic attenuation of the PLC signal, that is to say: the proper (lab) impedance should be equal to the real (field) impedance. Table 3.2 summarizes the scaling used for various electrical quantities; a scale is the ratio of the lab value to the real world value:

Implementation

In this section we will see the implementation process of the different components of the smart LV grid platform. The hardware platform can be divided into three major sections depending on their physical location in the field:

• Secondary substation

• LV lines

• LV customers (houses)

Secondary substation

In the secondary substation, we are interested in the low-voltage part. This includes all the components downstream the MV/LV transformer, namely:

MV/LV transformer

Since the whole platform is a low-voltage platform rated at 230V (line to ground), there is no place for the MV/LV transformer in it. Also in reality, the LV metering communication channel ends at the MV/LV transformer with a data concentrator connected on the LV side. All upstream communication is then managed by another technology which is most often a cellular communication technology (see Appendix A for examples). This part of the metering infrastructure, as well as the power system operations that occur on the medium voltage level and above, are out of the scope of this platform. Despite the fact that the MV/LV transformer and upstream system are out of the scope of the platform, we found it useful to represent the MV/LV transformer with a variable LV auto-transformer. The inclusion of a transformer would have benefits on both the power system behavior and the communication in the platform. Our reasoning about its advantages is as follows:

• The variable auto-transformer allows us to set the voltage level on the entry point of our setup independently of the voltage of the connection point where the experimental platform is plugged. An obvious advantage of having the ability to adjust the voltage is to be able to carry out reproducible scenarios on the platform where the outside voltage may change abruptly. Another advantage is the ability to simulate scenarios with extreme voltage conditions. For example, consider the scenario where the voltage is already very high at the substation (say 230V + 8%) and the downstream grid has excessive penetration of solar power generation where a certain voltage control could be applied to the solar generators.

• When the auto-transformer is not set in the 1:1 position, a part of its winding becomes a series inductor. As a side effect, the series inductor acts as a sort of an EMI filter between the experimental setup and the outside world. This helps to mitigate noise from outside sources that could pollute the communication channel in the platform especially with PLC communication that shares the same physical medium with electric power. In addition to reducing outside noise, the inductor attenuates the signals generated by the experimental communication and that would pollute the utility grid. Note that in order to meet the electromagnetic levels specified by Electromagnetic Compatibility (EMC) standards such as [START_REF]Electrical equipment for measurement, control and laboratory use -EMC requirements -Part 1: General requirements[END_REF], a more reliable solution may be needed (for example an isolation transformer and/or PLC filter); in our case we went for the simple and low-cost solution of just using the auto-transformer.

Data concentrator unit

A data concentrator unit is a PLC endpoint used to interrogate meters, process and store the information it receives, and to send this data to a centralized Information System (IS). Installed on the LV side of the MV/LV substations, the concentrator is a powerful computerized unit, which primarily:

IMPLEMENTATION

57

• Centralizes and processes meter data from a cluster of electric meters communicating via PLC.

• Sends data collected to an IS, usually via a cellular channel (GPRS).

• Sends remote handling requests from the IS to the smart meters.

• Tracks LV distribution grid voltages and other electrical quantities.

• Provides an interface to other devices (e.g. Fault Detectors).

So in a nutshell, a data concentrator is the device responsible for managing the communication network, AMR, and storing and sending the data to the IS. Depending on the PLC technology used, the terminology used to describe the managing role of the concentrator may differ. In a PRIME PLC network, a concentrator is the Base Node that manages the network resources and connections. In a G3-PLC network, a concentrator is the Network Coordinator.

In addition to industrial concentrators used by DSOs in MV/LV substations, other more generic and configurable devices can take their role especially in an experimental platform. For instance, the Substation Gateway1 from Neuron Gmbh is one generic tool that provides a multi-protocol support for both G3-PLC Coordinator and PRIME Base Node and offers a variety of options such as out-of-the-box RFC 6775 compliant borderrouting to route IPv6 traffic between wired/wireless interface and PLC, transparent port forwarding for non-IPv6 applications, an integrated DLMS client and several Internet of Things (IoT) options and connection interfaces that help construct and manage the PLC network with ease. In our platform, the predecessor of the Substation Gateway (nBox-SG), the nBox-Gateway shown in Figure 3.3a is used. The gateway exposes its PLC network management and messaging services via a human-friendly web interface in addition to two Representational State Transfer (REST) Application Programming Interfaces (API) for programmable access; more details about this will be provided in the software section of this chapter. Since the gateway does not contain any metering device to track the electric quantities in the grid such as voltage, the energy meter device with RS-485 Modbus interface shown in Figure 3.3b is installed at the substation for this purpose.

LV lines

In addition to their major role in the transportation of electric energy from power sources to the loads, power lines in a low-voltage smart grid with metering over power-line communication also transport information to and from smart meters. Therefore, any replacement model of a LV line must be "valid" for both types of signals it carries. As we have seen in Section 3.2.2, the line models in the platform must be properly constructed to keep both power system and communication required properties valid. Thus the simple line model design becomes a filter design problem. We distinguish two main requirements of a low-voltage line model:

LV lines at 50Hz

Modeling power lines by passive elements is a topic that has long been studied. The full model depends on four electrical parameters: The series resistance relies basically on the physical composition of the conductor namely the type of its material and its cross section area. The series inductance and shunt capacitance are produced by the presence of magnetic and electric fields around the conductors, and depend on their geometrical arrangement. The shunt conductance is due to leakage currents flowing across insulators and air. As leakage current is considerably small compared to nominal current, it is usually neglected, and therefore, shunt conductance is normally not considered in the model. In the transmission grid, and in the MV part of the distribution grid, lines have long lengths in which the full model including the shunt capacitance is used for their modeling. The equivalent circuit of a long transmission line is shown in Figure 3.4b. In the LV distribution grid, lines are considered short-length. In this case, the shunt capacitance effect is negligible and only the resistance and inductive reactance are considered. The line can then be represented by the equivalent circuit of a resistance R, and inductive reactance X L in series (series impedance), as shown in Figure 3.4a. Since the currents in the platform have a reduced scale, the voltage differences across a line segment ∆U = I line * Z line is also scaled. To accommodate for this scaling, the impedance used in the equivalent circuits of the lines have to be scaled. Therefore, the values of R and X L in the platform are 100 times their real values.

LV lines at 35-91kHz

Since the PLC signals are on higher frequencies than the 50 Hz power signal, the characteristics of the line are different for these signals. Several studies have been made to have realistic and detailed models of both the Narrowband (including LV-lines) and Broadband power line channels. In [START_REF] Souissi | Bottom-up approach for narrowband powerline channel modeling[END_REF] for instance, a detailed study using a bottom-up approach for Narrowband power line channel modeling resulted in a channel transfer function for single and multi-branch networks in addition to a simulation tool in Matlab. [START_REF] Zimmermann | A multipath model for the powerline channel[END_REF] proposes a multipath model using a top-down strategy considering the channel as a black box but for higher frequencies from 500 kHz which is out of the scope of this work. In the first part of their PhD thesis [START_REF] Ait | Caractérisation du réseau basse tension français dans la bande de fréquence utilisée par les courants porteurs en ligne [9-500kHz] en bande étroite[END_REF], the author presents a deeper understanding of the propagation of the PLC signal in the French LV grid using the bottom-up approach. Their work highlights two models for LV lines characterization with and without inductive and capacitance coupling between the cables. These advanced studies propose elaborate mathematical models which are convenient for theoretical analysis and for approaches based on software simulation. In our case, we needed to implement the model physically by an actual passive circuit, which led us to choose a simpler and more practical model. In addition, more detailed and complex communication infrastructure models are being extensively studied in laboratory by other entities such as LinkyLab as we saw in chapter 2.

The reduced-scale system requires that the series components of the line model must be multiplied by the same scale factor k as the load impedance in order to keep the same voltage attenuation of the original grid. This can be proved mathematically by the equa-

tion V L V S = Z load .k Z load .k + R.k + jX L .k = Z load Z load + R + jX L
(see Figure 3.4a) where a constant factor in the numerator and denominator will have no effect on the signal. For the NB-PLC frequency range, the notion of "load" is different. In this case, the (useful) loads are smart meters themselves. These "high frequency loads" are not scaled so the above equation becomes

V L V S = Z load Z load + R.k + jX L .k
. This is reflected on the PLC communication as a very high attenuation that could lead to the total loss of communication as shown in Figure 3.5.

To resolve this unintended effect, the simple line model design becomes a filter design problem with the goal of simultaneously achieving the correct voltage drops, and allowing PLC signals to pass normally. In other terms, the impedance of the line at 50 Hz must be 100 times amplified if the scaling factor is 100 as we saw in the previous section and the impedance in the CENELEC-A frequency range must be in the same order as the true value in a real network. This can be achieved by adding a bypass branch for every power line segment that has a negligible effect at 50 Hz but allows the higher frequencies to pass. The simplest bypass circuit would be a capacitor that acts as a high-pass filter.

In order to experiment with a variety of attenuation and noise levels, multiple capacitor branches with different values can be used with a switch as shown in Figure 3.6.

The schema of the realized full circuit representing a 3-phase LV line segment (the final product) is shown in Figure 3.7.

CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM

LV customers

The last part of LV smart grids is the customer endpoints which is represented by the houses connected to the grid. A smart grid experimental platform has to consider all variants of flexibility on the customer premises: controllable loads, distributed energy resources such as rooftop solar generators, electric vehicle chargers with a possibility of Vehicle-to-Grid (V2G) connectivity, etc. In addition, the platform should offer two-way end-to-end communication between the customer and the information system, for the purpose of monitoring and/or control via the advanced metering infrastructures. In what follows we will take a deeper look on each of these components and the methodologies of how to represent them in a smart grid platform.

Smart meters

A smart meter is an electronic device that records information such as consumption of electric energy, voltage levels, current, and power factor. Other types of smart meters that measure natural gas, water or heating also exist but the term "Smart Meter" alone usually refers to an electricity meter. Beyond simple automated meter readings, smart meters involve real-time or near real-time sensors, power outage notification, and power quality monitoring. They typically record energy near real-time, and report regularly, short intervals throughout the day. Smart meters enable two-way communication between the meter and the central system. They also communicate the information to the consumer for greater clarity of consumption behavior, and electricity suppliers for system monitoring and customer billing. Smart meters are the heart of the advanced metering infrastructure and they are the main driver of smart low-voltage grids.

Section 3.3.1.2 describes a data concentrator unit and alternative devices that can be used in a smart grid demonstrator setup. Similarly, representing a smart meter in the setup can either be done by using a real smart meter or by using alternative devices. For example, to represent a smart meter with PLC interface, a normal electronic energy meter can be used as the sensor with a controllable circuit breaker and an external PLC modem connected to a micro-controller. The micro-controller connects the modem and the circuit breaker to the meter and contains the meter management software. Meter management includes decoding and replying to meter reading requests, connection and disconnection events, managing logs and handling all events related to network quality monitoring and generating notifications. Figure 3.8 shows example commercial devices that can be used for this purpose. Using a real smart meter is faster and cheaper, and has the advantage of testing the actual hardware that will eventually be deployed in the real network, thus this solution is preferred whenever possible. The other solution requires a lot of work, especially when the objective is to accurately capture the behavior of a real smart meter; and it essentially constitutes a "reinvention of the wheel" -redeveloping something that already exists off-the-shelf. Having said that, there are some cases where the second solution is useful or unavoidable, namely:

1. If getting hold of commercial smart meters is not possible -and it did prove to be a very hard task in our experience, especially for a small quantity of meters for an experimental setup.

2. If the smart meter parameters have to be changed beyond what is configurable by a commercial smart meter and allowed by its internal software.

In our setup, we experimented with two types of real smart meters, the aforementioned Linky meter and the ADD 5 meter from ADDGrup. Both meters use G3-PLC for upstream communication but their local communication interfaces are different. Linky uses the "TéléInformation Client (TIC)" which is a proprietary protocol over serial communication. It requires a dedicated adapter6 to translate to a standardized protocol like USB or Wi-Fi. TIC is a one-way communication interface that allows for reading meter data but does not allow for writing data to the meter. ADD on the other hand comes with a USB interface that exposes its internal DLMS server using High-Level Data Link Control (HDLC) based communication. While no specialized hardware is needed to utilize this interface, a DLMS client with HDLC support is required. Luckily though most DLMS clients support both TCP/UDP-and HDLC-based communication thus a single DLMS client is needed for both PLC and the local interface communications.

Falsified meter readings

Since all loads and generators have reduced power consumption, the smart meters will provide the correct reading of voltage and frequency values, but the currents, powers, and energies values will be scaled. A software-based solution for this issue is to perform data treatment on the measurements from the smart meters before recording them where the quantities in concern can be re-scaled to their true level. Another solution requires a special hardware design of a current amplifier that can be connected to a smart meter as shown in Figure 3.9. The current amplifier is used to supply a low impedance load (the current measurement 66 CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM input on a meter) with a sinusoidal current at 50Hz. The output current is the image of the input current multiplied by a coefficient. In our setup, we use both solutions and we call the current amplifier device a 'current loop'. Figure 3.10a shows the general electric schema of the current loop and Figure 3.10b shows the realized device.

Smart Meter

Electric Loads

In the LV grid, electric loads are the electrical installations of the customers. Customers power consumption varies with time based on several factors such as appliances currently in use, time-of-day, temperature, season, social behavior, etc. The variation of the power consumption of the customer is called consumption profile or load profile or load curve; it is a time series of values of active and reactive power. To represent the loads in a smart grid laboratory setup, two main tools will be needed: the loads profiles and the hardware that will translate the data into a real power consumption. For simulating a low-voltage grid, load profiles have either to be generated using load models or to be acquired from real measurements.

Load profiles

Load profile generators exist to simulate load profiles for use in the development of energy related technologies and by system operators. Based on the the approach of the model, it may be classified as a bottom-up or top-down model [START_REF] Grandjean | A review and an analysis of the residential electric load curve models[END_REF]. Top-down models are developed for modeling the energy consumption of a large number of households at the same time and are primarily used by the DSO for market balancing mechanism and network planning purposes. Bottom-up models are used for the simulation of power flow in low-voltage grids and they are mostly based on statistical or probabilistic processes, measurements and the behavior of the consumer or the weather conditions. There are also various methodologies for creating load profile generators such as the Standard Load Profiles, behavior-based load profiles generators [START_REF] Pflugradt | Analysing low-voltage grids using a behaviour based load profile generator[END_REF], stochastic load profiles using Monte Carlo simulation [START_REF] Du | Monte Carlo simulation of load profiles for low-voltage electricity distribution grid asset planning[END_REF] and others.

Instead of using load profile generators to generate load profiles, a simulation tool can use existing load data. Many data sets of load profiles are made open and accessible for researchers and professionals working in power and energy related areas and requiring data for design, development, test, and validation purposes. For instance, IEEE Power and Energy Society (PES) has the Open Data Sets publicly accessible and permanently available in http://site.ieee.org/pes-iss/data-sets.

Load emulators

An electric load is any device that consumes electric power. A load emulator is an electronic or electromechanical device that can be programmed to mimic an electrical load by presenting the source with electrical characteristics similar to its standard operating load, while dissipating the power output that would normally be consumed by it. Commercial electric load emulators 7 are usually used in laboratory setups of power systems and smart grids. These devices are designed for setups that operate on a real power scale where their rating is usually in the range of a few kilowatts to a few hundreds of kilowatts thus they are not suitable for our setup with the reduced scale power consumption which requires loads that operate in the range of a few watts of power. They also tend to be quite costly, compared with the simple solution that we will present below. Therefore, there is a need to make a reduced-scale load emulator from power electronics components for our setup.

Power consumption can be achieved using passive resistive elements for active power and capacitive & inductive elements for reactive power. Since they have a fixed impedance, simple components can only consume a constant value of power at a certain voltage. For a variable and adjustable power consumption, a variety of technologies with different levels of complexity ranging from the simplest variable resistor (rheostat) to the complex regenerative load can be used. A rheostat is only manually adjustable so this eliminates it from the list of candidates of a load emulator since it cannot be set by a program. A regenerative load on the contrary is quite complex and requires a lot of skills and time; so that, if it does not already exist, it becomes nearly infeasible for such projects. We distinguish then two technologies that can be accomplished by laboratory setup developers and satisfy the requirements of the load emulator device: (i) switched devices using a technology such as PWM with a controllable duty cycle or (ii) load banks made of components with different impedance values that can operate in parallel and selectively toggled to collectively represent the desired equivalent load.

Most modern power electronic devices used in the experimental power system setups employ switch-mode or PWM power converter technologies. These technologies are very electromagnetically noisy -they naturally emit high levels of unintentional electromagnetic disturbances. The disturbances are on higher frequencies that almost have no effect on power system studies but have a big impact on PLC communication. EN 55022 [START_REF] Fsp_Org_Id ; Fsp_Lang_Id | Information technology equipment -Radio disturbance characteristics -Limits and methods of measurement[END_REF] is the standard that is very often referenced in all European EMC standards, defining measurement methods, measurement equipment, limit lines and interpretation of applicability of limit lines, starting from household appliances to medical devices. PWM driven 7 Example commercial load emulator: https://www.chromausa.com/product/ programmable-ac-electronic-load-63800

IMPLEMENTATION

69

devices that are designed to be EN 55022 compatible must have their conducted emission requirements for mains ports and telecommunication ports satisfied in the frequency range 150kHz-30MHz (see Figure 3.11). This means that they may still have disrupting effects on the NB-PLC frequency range that is lower than the 150kHz limit. Therefore, load emulators made using this technology may become unsuitable for a smart grid setup that uses NB-PLC for its AMI communication. Indeed, this is what we observed in our work: early experiments that we carried out using switched loads showed strong disturbances of the PLC communication, and led us to turn to alternative solutions, as explained below. In our experimental setup, we want to create a variable active power load with the electric specifications in Table 3.3.

PWM driven resistive load:

The first approach we tried was using a 480Ω power resistor with a 3.9kHz PWM driver. When tested in the lab, the noise generated by the harmonics of the PWM frequency of just one device connected near the substation was sufficient to obstruct the communication with all the smart meters in the network. The EMC measures of the device are shown in Figure 3.12. The disruption in communication was made even worse when the RL branch of the line model was used without the bypass branch described in Section 3. Resistive load bank: In this second approach, a set of resistors connected in parallel and controlled by binary switches (solid-state relays for example) is used. The design is simple, low cost, reliable and harmonic free. In order to choose the values of the resistors, three specifications must be considered: (i) maximum load power P max , (ii) the power precision P prec and (iii) the tolerance of the load power P tol . The maximum power of the load is determined by its lowest impedance value; this is the value of the equivalent parallel resistance when all the resistors are connected (R all ). The value of the maximum power is then determined by the relation

P max = V 2 /R all .
The precision power of the load is the smallest step in Watts between two power values. It is determined by the resistance of the biggest resistor where

P prec = V 2 /R b .
The tolerance of the load power is the acceptable limit of the difference between the expected value and the closest feasible value by the load, in other terms, the acceptable level of that variation in precision. Therefore, the precision of the power must be chosen such that the relation P prec ≤ P tol is always satisfied. A good resistor bank design should be able to provide all values in the range [0, P max ] with the smallest precision and tolerance possible. To achieve this we propose the following design inspired from the binary numbers (base 2) relation to decimal numbers (base 10):

1. First choose the smallest resistor R s such that R s ≤ V 2 P max /2 2. Specify the tolerance power P tol for your design.

3. Find the resistance value R b of what would be the biggest resistor and that is a power of 2 of R s such that

P prec = V 2 R b = V 2 R 2(N -1) s
≤ P tol where N ∈ N will be the number of resistors needed. Choose the smallest value of N that satisfies the tolerance condition.

4. The resistance values of the other resistors are all powers of 2 of the smallest resistance; for resistor n, R n = R 2 n-1 = R 2n 0 where R 0 = R s and 0 < n < N -1.

For example, for a P max = 100W and P tol = 0.5W load, N = 8 resistors are needed and their values are:

R s = R 0 = 1kΩ, R 1 = 2kΩ, R 2 = 4kΩ, . . . , R b = R 7 =
128kΩ. This will actually yield a P max ≈ 105.4W and P prec ≈ 0.413W at 230V . An informative electric schema of the device realized in the setup is illustrated in Figure 3.13. Figure 3.14 shows the low electromagnetic noise levels of the load bank approach compared to those of the PWM driven device in Figure 3.12.

Reactive power loads:

The design of the load bank used for active power loads can be adapted to model reactive power loads. For reactive power, it is possible to use a fixed inductor in parallel to a controllable capacitor bank to cover the negative and positive ranges. With the proper inductor and capacitors sizes, it is possible to have a variable equivalent reactive power in the negative (capacitive) and positive (inductive

) range [-Q max ≤ Q ≤ Q max ]. The inductance L of the inductor must be chosen such that Q max = V 2 X L = V 2 ωL ⇒ L = V 2 ωQ max
where ω = 2πf and f is the mains frequency. The capacitance values of the capacitor bank are chosen following a similar procedure to that used for the resistor bank design. In this case, the relation between

C and Q is Q = V 2 1/X c = V 2 1/ωC eq = V 2
ωC eq . For a minimal reactive power

-Q max , the biggest capacitance C b value must be chosen such that C b ≥ Q max /2 V 2 ω and the smallest capacitance value C s such that Q prec = V 2 ωC s = V 2 ω C b 2 N -1 ≤ Q tol
where Q tol is the tolerance of reactive power and N is the number of capacitors needed. The other capacitors are computed as follows:

C 0 = C b , C 1 = C 0 2 , C 2 = C 0 4 , . . . , C N -1 = C s = C 0 2 N -1 .
For example, a Q max = 100VAr and a Q tol = 0.5VAr at 230V, 50Hz require that the inductor have an inductance L ≈ 1.68H, and N = 8 capacitors with their capacitance values being C 0 = 3.2µF, C 1 = 1.6µF, . . . , C 7 = 50nF . The schema of the realized reactive power load is shown in Figure 3.15.

Remark 1.

Toggling the switches arbitrarily could cause sudden voltage changes on the terminals of the capacitors which may lead to electric sparks. This can be avoided by only toggling the switches when the voltage is at 0V which can be achieved by using zero-crossing9 switches. Remark 2. Although the real power factor values of low-voltage loads are usually in the range 0.8 ≤ pf ≤ 1, meaning that only a narrow range of reactive powers is sufficient to reproduce real network conditions, choosing a wider range of reactive powers allows scenarios that require more reactive power flexibility to be tested using the setup. One particular example is the voltage regulation by means of reactive power (Q(U )) used by smart PV inverters where U is the local voltage measured at the terminals of the inverter. Remark 3. Because of its non-standard characteristics, the inductance needed may not be found commercially and, in our case, had to be custom-made.

IMPLEMENTATION 75

Electric generators

In traditional low-voltage grids, electric power used to always flow from the secondary substation (the source) to LV residential houses and other energy consumers connected to the grid (the loads). With the increasing number of Distributed Energy Resources (DER) in modern LV systems, this is no longer true. These distributed resources are usually grid-connected renewable energy systems at the end-customer premises such as rooftop PV systems, small wind electric system or even hybrid solar and wind systems. In addition, with the rapid roll-out of electric vehicles, several research groups and grid operators are studying and experimenting with leveraging the EV storage systems and the power conversion system of their chargers to change the role of these vehicles from being energy consumers to being "prosumers". This means that an EV can act as a load (when charging) and as an energy source (when discharging into the grid) in what is known as Vehicle-to-Grid (V2G) technology thus adding even more energy sources to the LV grid. Therefore it only makes sense that any smart LV-grid laboratory setup employs a technology for energy generation in order to represent these technologies.

Generation power profiles

Similarly to electric loads, most energy sources have an inherently-variable power profile. For the renewable energy resources however, it is not the human behavior that affects the dynamics of this profile but natural conditions such as the weather, solar irradiation, temperature, wind speed, etc. Also similarly to the electric load profiles, simulation tools can use power profile generators to generate the "power generation profiles" [START_REF] Sharma | PV generation and load profile data of net zero energy homes in South Australia[END_REF] or they can use data sets available from real world measurements. In addition to power profiles, a more advanced tool can use data of weather conditions that can also be either generated from a model or recorded to generate the power profile. For example, IEEE's Power and Energy Society (PES) Open Data Sets that we saw earlier with the load profiles also provide data for PV generation, wind based generation and weather data 10 . As for the V2G, their consumption power profile are determined by the human behavior namely the driving and parking patterns [START_REF] Zubaryeva | Driving and parking patterns of European car drivers -A mobility survey[END_REF] but also strongly tied to the scheduling model of the intelligence (control) [START_REF] Li | Optimizing the performance of vehicle-to-grid (V2G) enabled battery electric vehicles through a smart charge scheduling model[END_REF] used to determine the charging and discharging behavior of the vehicles. This scheduling model is what also determines their generation power profile.

Power sources emulators

10 PES Open Data Sets: https://site.ieee.org/pes-iss/data-sets

CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM

Power source emulator is a device that mimics the behavior of a power source the same way a load emulator mimics an electric load. A power source emulator is an artificial, controllable and flexible test device which imitates the real energy source, thus provides a platform for researchers, designers and engineers to conduct the research, observe and analyze the operation and control of the real equipment, in a controlled environment without relying on the natural sources. Solar emulators are programmable DC power sources that simulate the output characteristics of a solar panel. A solar emulator is primarily a current source that is capable of quickly simulating the I-V curve (see Figure 3.16) of a solar panel under different conditions. To achieve this, solar emulators are designed with special output characteristics11 that are different from conventional DC power supplies [START_REF] Sanaullah | Design and implementation of a low cost Solar Panel emulator[END_REF][START_REF] Messaoudi | Design and implementation of a solar PV emulator[END_REF]. Wind turbine emulators are mostly electromechanical devices that simulate different speed and torque conditions of a real turbine. For instance, the authors in [START_REF] Akram | Design and Development of a Wind Turbine Emulator for Analyzing the Performance of Stand-alone Wind Energy Conversion System[END_REF] developed a wind turbine emulator for analyzing the performance of wind energy conversion system using a MATLAB/Simulink mathematical model, a DC motor, a DC-DC power converter, current and speed PI controllers and a user interface with real time interaction.

There also some commercial emulators available for the design and validation of the corresponding technologies. For example, the series of modular solar array simulators 12from Keysight Technologies comes in different sizes and because of their modularity can be configured to represent a wide variety of devices. Another example is the wind turbine emulator 13 from ecosense made up of a DC motor coupled with the Induction generator/Permanent Magnet Synchronous Generator, the speed of which is controlled as per the speed reference calculated by solving the mathematical model of wind turbine. An induction generator is also coupled to the DC motor and a bidirectional inverter is connected to the terminals of the generator. The device can execute the mathematical models of a wind turbine and simulate the speed/power profile on hardware environment directly.

Mimicking the dynamic behavior of each device is complex and takes time and resources or requires buying several off-the-shelf equipment for each device type. For applications that only need the static behavior of a power source, meaning a device to generate power regardless of its dynamics, a single generator laboratory equipment could be used to represent all the devices. For our setup we follow this approach and propose a solution using a controllable DC power supply as a PV emulator and a commercial solar inverter, for generic power generation. For the DC power supply, two options are available: (i) either specialized off-the-shelf equipment such as the modular solar emulator from Keysight mentioned above can be used or (ii) a standard DC supply with a controllable driver board that emulates the solar I-V characteristic can be used. As for the inverter, there are also two options available: (i) one traditional string inverter for powers in the scale of a few kilo Watts or (ii) micro-inverters for smaller power ratings.

In our setup, we have a reduced scale generator that can generate up to 150W. It is made of a 48V standard non-controllable DC power supply 14 connected to a custom designed driver board and feeds a grid-connected micro-inverter 15 . The driver circuit regulates the power withdrawn from the power supply according to a given set-point in Watts. The power output to the grid then corresponds to the power supplied to the inverter, minus its efficiency factor. The driver circuit is basically a current limiter that transforms the characteristic of the DC supply from rectangular or autoranging (Figure 3.17) to the solar I-V characteristics. The Maximum Power Point Tracking (MPPT) algorithm of the inverter is responsible for finding the maximum power on the curve and feed it to the AC grid. To control the output AC grid power then it is sufficient to generate another curve with the wanted maximum power then wait for the MPPT to find the new maximum. An 13 https://www.ecosenseworld.com/labs/wind-energy-labs/wind-turbine-emulator 14

Mean

Well RSP-200-48: https://www.meanwell-web.com/en-gb/ ac-dc-single-output-enclosed-power-supply-output-rsp--200--48 15 Enphase micro-inverter: https://www4.enphase.com/fr-fr/produits/micro-onduleurs electric schema of the realized current limiter driver board is illustrated in Figure 3.18.

Four-quadrant functionality

A 4-quadrant device is a power amplifier that has the ability to operate in all the quadrants in the P-Q space shown in Figure 3.19. A 4-Q device offers a bi-directional capability for 3.3. IMPLEMENTATION 79 both active power (P) and reactive power (Q). Such a bipolar device can act as both a power supply and a load depending on the sign of P and Q of the operating point. With the active power load emulator in our setup providing a positive active power range 0 ≤ P ≤ 100W , the reactive power load emulator providing the reactive power range -100 ≤ Q ≤ 100VAr and finally the PV emulator providing the negative active power range up to -150W , the setup now represents a 4-quadrant system that can provide any PQ pair in the limits specified above. All the devices mentioned previously are equipped with an RS-485 Modbus interface making it seamless to set their power values. Modbus supports communication to and from multiple devices connected to the same cable using the "client-server" (formerly master-slave 16 ). The devices use the Modbus-RTU (Remote Terminal Unit) protocol which is used over serial communication and requires a USB-RS485 adapter 17 for use with standard computers. 80 CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM

First prototype: 3-houses single-phase network

Designing a smart grid laboratory setup requires a lot of time and effort and building it is even more tedious. For this reason, we decided to make the building process incremental by first setting in place a small working prototype before building a bigger system. The first prototype represents a small single-phase LV grid with three houses connected to a MV/LV substation. Figure 3.20 shows the different elements of the first prototype. There are a unit representing the substation and three separate units for each house. Each house unit is also connected to an external solar generator (emulator + inverter) to support active power generation. The modular design allows adding more units and changing its configuration as needed. The software that operates on this platform is discussed in the next section and the target use cases are detailed in the next chapter.

THE SOFTWARE PLATFORM

81

The software platform

This section covers the software interface of the laboratory setup. The term "software platform" here refers to the collection of services or frameworks that are represented in the setup using a programming language code. The laboratory setup being built for demonstrating and validating control and monitoring applications in a "smart low-voltage grid" must contain the following elements: electric grid, electric loads and generators, communication network, control framework, user interaction with the "flexibilities". These elements can be either simulated, physically represented in the laboratory or real. Table 3.4 demonstrates the possible states of each element of a smart low-voltage grid tool. The status of our platform in this regard is represented by the colored blocks in the table. In this setup, we strive to build a system as closely as possible to a real smart LV grid. To achieve this, we physically represent the electric network, the electric loads and generators, and the communication network. In its current state, the setup runs in batch mode with predefined scenarios and events. In the future, it may be upgraded to have an interactive interface for demonstration of more "realistic" human behavior. As for the control block, to which extent the control is "real" is debatable -it ranges from testing just the control logic to the actual final binaries. The more realistic and detailed the physical setup becomes, the more it is able to test the final binaries of the control.

Definition

Since the smart grid is physically represented in hardware, no electric network simulator or communication simulator is needed. Therefore the software only contains the elements that are not or could not be physically represented in the hardware setup. These elements can be summarized as:

Hardware drivers: The hardware drivers are the software needed to operate and command the hardware used in the setup including but not limited to the data concentrator, smart meters, loads and generators, measurement devices, breakers, etc.

Simulation run-time environment: This is the part that "prepares" the hardware and "runs" a scenario. We distinguish two roles for the simulation run-time:

1. The run-time is a set of services that are necessary to support the components of the hardware setup and coordinate their operation. It is the part of the software related to preparing and starting the hardware using the hardware drivers, coordinating the distributed system components, managing communication interfaces and data exchange between all the devices, handling operation events, decoding and encoding communication messages, etc. This is similar to but not necessarily the same as the Run-Time Infrastructure (RTI) used by software tools that implement High Level Architecture (HLA) to support federates and coordinate their operations and data exchange during a run-time execution.

2. The setup is used to simulate real scenarios in a laboratory environment which requires a software to create simulation events, execute them and manage simulation time whether it is real clock time, accelerated time, or in an event-based discrete manner. Additionally, the setup in its current state runs scenarios non-interactively, i.e. without any user interaction. Consequently, real world user actions must also be simulated and automated. The software responsible for these roles is also what we refer to as the run-time environment.

Control framework:

The control framework includes all the control mechanisms and "power system flexibilities" in the setup. The control has a single version: the one that would be deployed in the field regardless of it being used in a software simulation, laboratory setup or test field; the control is always part of the software.

Implementation

The software platform is written in Python and consists of three libraries that implement different protocols and Application Programming Interfaces (API) for hardware interaction and the main application that implements the run-time environment and the control framework.

Simulation run-time environment

The software is designed with maximal modularity by using a non-monolithic architecture similar to the microservice architecture used in cloud applications and serverless computing. The software consists of the following services that represent real world entities:

Clients: for the end-customers (LV houses)

Substation: for the MV/LV secondary substation

Controller: for the control framework

The client services manage the end-customers (LV houses). They are responsible for setting and updating the loads, reading the local interfaces of the smart meters and responding to control commands. The substation service is responsible for remotely reading the smart meters of the end-customers and the substation itself. The substation service then sends the smart meters data to the control service which in turn performs some computations that result in control commands that are sent back to the customers' smart meters by the substation service.

Communication between these services is absolutely necessary in a real deployment because these modules would in practice be located in different locations: at a minimum, we must be able to communicate between each of the clients on the one hand, and the substation on the other hand, assuming that the central controller is deployed on a computer 84 CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM located in the substation; and if moreover we decided to implement the controller in Software as a Service (SaaS) mode, by running controllers of several LV grids on the central information system (for example a national level server), then additional communications would be required between the central server and the substation. These communications constitute what we have called "real" communications, as opposed to so-called "artificial" communications which occur between communicating "helper" services set up solely for the purpose of simulations. This architecture is shown in Figure 3.21. In our laboratory setup, the so-called "real communication" used for data exchange between the Clients and the Substation is implemented physically in the platform using the AMI. The Substation Service can use the real data concentrator (or in our case the G3-PLC gateway; see Section 3.3.1.2) to communicate with the real smart meters installed at the Client premises over the LV lines modeled in the setup by passive electronic components (Section 3.3.2) using G3-PLC. Data is encoded in compliance with the DLMS/COSEM protocol used as the application layer of the G3-PLC stack. The other type of "real communication" is the communication internal to the Client Service where the smart meter may exchange information with "flexible" electric installations (a water heater for instance) or between the smart meter and the local energy box installed at the customer premises and between the energy box and the flexible installations. The type of communication between the smart meter and either the energy box or the flexible installation directly depends on the type of smart meter used. For instance, Linky meters use the proprietary TIC protocol [START_REF] Technique | Sorties de télé-information client des appareils de comptage Linky utilisés en généralisation par Enedis[END_REF] with its local communication interface while other meters use different types of communication such as DLMS/COSEM over serial.

Artificial communication channel

Real communication channel

In addition to the aforementioned real services, helper services that are set up for the purpose of simulations also exist in the software platform. These services are:

Configuration Service: It is a central service for reading configuration files and shares with others services their corresponding configurations.

Discovery Service: It is a service which associates the address of each service to a readable service name. It acts like a Domain Name System (DNS) server and is configured once at the start of the simulation and for the entirety of the simulation via a configuration file.

Recorder Service: This service is simply an access point to an SQLite database that serves as the global storage for an entire simulation. This service is designed to be used only with a subset of the services. It records and stores all the measurements, events, control messages, etc. of the simulation.

Logger Service: Logging is also centralized via a hook to the standard Python logging module. This allows all the distributed services to report to a unified logging entity that displays the logs to the user in a single terminal terminal from which you can see all the messages and optionally stores them for later debugging.

Launcher Service: A simple centralized service for starting all simulation processes.

Scheduler Service:

The simulation is event-driven and depending on the simulation mode chosen (asynchronous or synchronous), a central service may be necessary.

The simulation run-time is based on a discrete event simulator linked to a clock which "accelerates" the simulation time if necessary. Each communicating element (service) presented above thus has its own event queue that contains the events added by the element itself. So, for example, the controller's event queue contains the events that trigger flexible power distribution to clients on the network it manages. In addition, different services can send events to other services. In general, three simulation modes are possible: real-time simulation. In the real-time mode, each element of the simulation is launched in an independent process and executes its events from its own clock. accelerated simulation. In accelerated mode, the simulation clock runs at a speed that is a multiple of the real time. The sole goal here is to have faster simulations while maintaining the proportion of time intervals between event executions.

event-driven (discrete) accelerated simulation. In this mode, the simulation is run "as fast as possible". The simulation time is advanced as soon as the current events are done executing. In order to have deterministic simulations, a central "scheduler" is added in this mode. It determines which event should run first and dispatches a token to the element that should run that event. The simulation takes place with a single token which is returned to the "scheduler" after the performance of each event. The concurrency of the different elements is not very important as time is managed by the central scheduler.

In its current state, the simulation runs in an event-driven accelerated mode. This means that the simulation time is controlled by the scheduler that is the source of the simulation clock. The simulation clock in this case is independent of the real time. The scheduler advances time as soon as all current events are done executing. This mode of simulation is the fastest compared to the other two modes as there will be no idle time (see Figure 3.22). Based on our applications and because of the slow hardware response, especially events that include data exchange over PLC, the event-driven mode was chosen as the mode of operation.

Hardware drivers

The software platforms includes three libraries that are used as hardware drivers: (i) a DLMS client; (ii) a G3-PLC network manager; and (iii) what we refer to later as the "hardware library" which is a collection of other drivers for devices that use Modbus (RS485), Serial (RS232) and TéléInformation Client (TIC) of Linky meters.

The DLMS client library:

DLMS/COSEM (IEC 62056, EN13757-1 [START_REF]Communication systems for meters -Part 1: Data exchange[END_REF]) is a set of standards for energy and water smart management, advanced control and innovative metering. It specifies an object-oriented data model, an application layer protocol and media-specific communication profiles.

DLMS/COSEM comprises three key components:

• COSEM: Companion Specification for Energy Metering -the object model capable of describing virtually any application;

• OBIS: Object Identification System, the naming system of the objects; and

• DLMS: Device Language Message Specification -the application layer protocol that turns the information held by the objects into messages.

CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM

DLMS/COSEM uses a client-server paradigm where the end devices, typically meters are the servers and the Head End Systems or concentrators are the clients. The DLMS/COSEM communication profiles specify, for each communication the protocol stack and the binding of the lower protocol layers to the DLMS/COSEM application layer. Communication profiles are available for a variety of communication media, two of which are used in our setup: (i) local ports with HDLC data link layer RS232 / RS485; and (ii) G3-PLC with UDP/IPv6;

The DLMS/COSEM specification is developed and maintained by the DLMS User Association in their Coloured Books following a three-step approach. The first step is the modeling of the Interface Classes (IC) and Object Identification System (OBIS) is specified in the Blue Book which is the basis of IEC 62056-6-1 [START_REF]Electricity metering data exchange -The DLMS/COSEM suite -Part 6-1: Object Identification System (OBIS)[END_REF] and IEC 62056-6-2 [START_REF]Electricity metering data exchange -The DLMS/COSEM suite -Part 6-2: COSEM interface classes[END_REF]. The second and third steps define the communication protocols for data exchange with metering equipment, namely the messaging and transporting services, are specified in the Green Book which is inline with IEC 62056-5-3 [START_REF]Electrcity metering data exchange -The DLMS/COSEM suite -Part 5-3: DLMS/COSEM application layer[END_REF]. The DLMS standard also defines the COSEMpdu ASN.1 specification and Extensible Markup Language (XML) schema [START_REF]COSEM APDU ASN.1 specification and XML schema[END_REF] for the purpose of enabling the transfer of COSEM model content with various means in the form of XML encoded content.

The PLC gateway used in our setup (refer to Section 3. [START_REF]Excerpt DLMS Blue Book:COSEM Interface Classes and OBIS Object Identification System[END_REF]) library provides implementation for several Abstract COSEM Objects (Device ID, Clock, Disconnect Control, Limiter, Security Setup, . . . ) and Electricity Related Objects (Voltage, Current, Apparent/Active/Reactive Power, . . . ) and can be easily extended to include other objects. Reading smart meters measurements or sending control commands to the smart meters can now be done with a simple function call. For example, to generate the XML request to read the voltage using the local port of a smart meter connected to the port "/dev/ttyUSB0" of the computer, it is as simple as doing the following: >>> from ndlms . d e v i c e s . example_meter im por t ExampleMeterRequest >>> r e q u e s t = ExampleMeterRequest ( " / dev / ttyUSB0 " ) >>> r e q u e s t . a s s o c i a t e ( ) . get_rms_voltage ( phase =1) . r e l e a s e ( ) >>> p r i n t ( r e q u e s t . to_xml ( p r e t t y _ p r i n t=True ) ) <?xml v e r s i o n=" 1 . 0 " ?> <ndlms> <T r a n s p o r t L a y e r Address=" / dev / ttyUSB0 " Speed=" 9600 " Type=" s e r i a l "/> <DataLayer C l i e n The G3-PLC network management library:

The PLC gateway way used in the setup implements a web service that exports a G3 API that supports retrieving information executing management operations on the G3-PLC coordinator/PAN; the API is called G3 Service Access Point (G3SAP) Interface. The G3SAP interface can be used for the configuration of the PLC network by providing the following functionalities: The API expects "G3 SAP Messages" encoded in XML. The response is also returned as XML messages. Similarly to the case of the DLMS client in the previous section, there is a need for a library that communicates with the G3SAP API by generating XML encoded requests and parses XML encoded responses. For that, we created the "G3Sap" library. This library abstracts the communication and internal attributes of the G3SAP API and makes it easy for the application code to manage the smart meters in the network. For example, adding a new smart meter to the network can be done using the following syntax:

The hardware library:

This library is used to communicate with the rest of the hardware devices. It makes it easy to interact with hardware by adding a level of abstraction between the low level hardware communication technologies and the high level application interface. This way it is easy to change the type of the communication used or to modify the hardware without affecting the application code. Figure 3.24 illustrates an example of the role of this library.

Most of the devices used in the platform (see Section 3.3) use the Modbus application layer protocol [START_REF]Modbus Application Protocol Specification. V1.1b3[END_REF] with the RTU serial transmission mode. This includes the following devices installed at each house: the active power load, the reactive power load, the PV emulator, the energy meters, the circuit breaker. At the message level, the Modbus protocol applies the client-server principle. The client (a computer in this case) originates a message and expects a response from the device (the server). Modbus bases its data model on a series of tables that have distinguishing characteristics. The four primary tables are shown in Table 3.5. We use the open-source Python library minimalmodbus [START_REF] Berg | The MinimalModbus Developers[END_REF] internally to set up the Modbus client device and read and write Modbus registers. The hardware library then serves as an abstraction layer between the application code and the minimalmodbus hardware communication. For example, lets say we have an active power load that takes inputs as power values between 0 and 100W from the application code. This power value needs to be translated to the canonical value defined by the device protocol and written to the proper Modbus Register. Linky smart meters do not use Modbus, instead they use their own TIC protocol which is a read-only protocol over serial. The open-source Python library pySerial [START_REF] Liechti | The pySerial Developers[END_REF] is used for low level serial communication and the hardware library is responsible for parsing the Linky data as defined in [START_REF] Technique | Sorties de télé-information client des appareils de comptage Linky utilisés en généralisation par Enedis[END_REF].

Control framework

The control framework includes all types of control that could run on the setup. We distinguish three levels of control:

Central control: This is the centralized controller of the network. It is implemented in the setup at the substation level. In reality this control could be implemented Table 3.5: Modbus primary data model tables. (Source: [START_REF]Modbus Application Protocol Specification. V1.1b3[END_REF]) locally to each MV/LV substation or on a wider range, say on the national level, for several LV networks. The main driver of this type of control is the data collected by the smart meters and the ability of the smart meter to receive commands remotely.

Domestic level control:

This is the control that is local to the end-customer. It does not require any communication with the outside world. It is implemented in the customer's so-called "energy box" to manage their consumption and production. A notable domestic level control is "self-consumption" where consumers themselves, who are prosumers in this case, produce the electricity that they use from say renewable resources with a storage system;

Device level control: This control denotes any intelligence that can be implemented in a certain equipment without the need for external information from other devices or other consumers on the network. This means the device only uses locally available data by the device itself or by sensors that can be connected to it. One example is local voltage control by means of reactive power (Q(U )) that could be embedded in smart solar inverters where the inverter increases its reactive power when the local voltage is high and vice versa.

In this section, we saw the types of controls that could be tested using the setup. In the next chapter, we will talk in details about the controls we implemented.

94 CHAPTER 3. THE TECHNICAL ASPECT OF THE PROPOSED PLATFORM

Conclusion

In this chapter we provided an overview of the technical details of our proposed platform and shared our operational experience that we accumulated during its implementation, our design decisions, the many problems we encountered, and the solutions we found. This chapter can be a reference that will hopefully be a huge gain of time, for whoever wants to do the same, to have a list of the technical components involved, implementation options, the foreseeable difficulties and their solutions.

Smart grids are a complex system and designing a smart grid laboratory testbed is no less complex. This complexity is mostly related to the interoperability among the many subsystems of a smart grid such as the power system and the ICT and is translated to challenges in realizing smart grid tools. In addition to its complexity, it may be infeasible for most laboratories to invest in such a platform because of physical, financial and operational constraints. For instance, if the size of the setup is big, which is normally the case with these types of setups, it could be very challenging to provide the space required to host the setup. It is also challenging to provide the energy and power needed by the setup in most cases. Moreover, the more the size of the platform grows, the more it costs and this is another constraint. In this chapter we provided possible solutions for all these problems by illustrating the design and implementation processes of a reduced scale smart grid laboratory setup.

For a low-voltage smart grid based on the AMI, we saw how the elements of the system understudy are represented in the platform. These elements are categorized by physical location into three main categories: the secondary substation, the LV power lines and the end customers. They are also categorized according to their role into: power system components, ICT and operation & control. The main elements discussed here are: the MV/LV transformer, the PLC data concentrator, the model of LV lines and the proposed filter design, smart meters, 4-quadrant loads/generators. We also discussed the software the operates the whole setup. In a platform where the use of physical components was maximized especially the physical representation of the power and communication networks, there are still some software parts that need to be addressed. For instance, the software event-based run-time environment that manages the simulation preparation and scenarios execution through a distributed system, or the many hardware driver that allows the interaction with the several hardware equipment,

Chapter 4

Smart-grid mechanisms for control and monitoring of LV networks

Introduction

In the previous chapter we described the technical aspects of designing and implementing a low-voltage smart grid laboratory setup. The goal of this setup is to represent the cyber-physical nature of a smart LV grid by integrating components of the physical world (power system) and the cyber world (information and communication technologies); the latter made available by the smart meters and their advanced metering infrastructure that provides visibility and connectivity to the historically passive part of the grid. Such tool can then be used to test and validate new technologies that are driven by the changes in the power system -mainly the integration of renewable energy resources, electric vehicles, and flexibility into the LV grid -and enabled by the AMI.

In addition to the AMR role of the smart meters for simple billing and monitoring applications, smart meters provide a two-way communication network that can be used for advanced monitoring and control applications that are new to the low-voltage system. One benefit of the AMI is to help mitigating grid congestion caused by the rise of distributed power generation and improve grid observability. This requires new voltage control technologies based on data available from smart meters to be developed and tested. In this chapter we take a look at some of these technologies that we implemented and tested using the setup, and conclude with the advantages that this setup provides for representing some scenarios that would be rather difficult to capture with pure simulation.

CHAPTER 4. SMART-GRID MECHANISMS

Control design

In order to evaluate the setup, we first need a control that can be applied and tested. For this we consider the case of centralized voltage control in low voltage grids with high photovoltaic penetration.

Problem description

The rise of distributed generation in low voltage grids, namely by the rooftop photovoltaic solar systems, brings new challenges to the system. A high number of these generators in the grid can cause voltage unbalance. For example, high power generation power generation accompanied by low demand, which could occur on sunny summer days at midday, the grid may experience abnormalities. These abnormalities can be seen in the form of current overloads in the MV/LV transformer and the power lines, or in the form of elevated voltage levels violating the standard voltage range on the nodes furthest from the transformer. In what follows we will address the problem of over-voltages caused by high penetration of distributed solar systems.

Related work

The current standard answer of grid operators to these challenges is reinforcing the grid by installing new transformers and/or power lines or by replacing the old ones with bigger capacity elements. This solution is relatively costly and may not always be a viable option which then limits the grid capacity for hosting photovoltaic generators. Consequently, several alternative state-of-the-art solutions are under study by researchers and industry actors. These solutions shift the focus to the active management of the distribution grid rather than relying on the old "fixed-capacity" system.

Three solutions for voltage control of low-voltage grids with high penetration of photovoltaic sources are proposed in [START_REF] Ciocia | Voltage control in low voltage grids: A comparison between the use of distributed photovoltaic converters or centralized devices[END_REF]. The first solution is a distributed control that corresponds to the use of PV inverters to control voltage at their connection points by managing their reactive power. The other solutions are centralized controls performed either by using a Static Var Compensator (SVC) or a transformer with OLTC installed inside the MV/LV substation. A study in [START_REF] Ciocia | Voltage Control in Low-Voltage Grids Using Distributed Photovoltaic Converters and Centralized Devices[END_REF] also investigates the integration of a centralized (using SVC or OLTC) and distributed control (reactive power by PV inverters) and analyzes the benefits of their interaction. The proposed solutions that include centralized control both require some additional elements to be installed which increases their capital cost but may be a cheaper alternative to the total grid reinforcement solution.

In addition to partial grid reinforcement that requires additional hardware, other solutions leverage the ability of some loads and generators to actively modify their power consumption and production respectively. This is an encouraging approach that has the potential to provide cheaper solutions for grid congestion problems since they do not involve capital investment by the DSO. Several solutions have thus been proposed in this field, involving flexible elements (loads, generators or both), control by active or reactive power, and different control topology (centralized or local). An example would be the aforementioned distributed reactive power control by [START_REF] Ciocia | Voltage control in low voltage grids: A comparison between the use of distributed photovoltaic converters or centralized devices[END_REF] in addition to other solutions that involve local reactive power control voltage such as [START_REF] Demirok | Local Reactive Power Control Methods for Overvoltage Prevention of Distributed Solar Inverters in Low-Voltage Grids[END_REF].

The advantages and disadvantages of distributed local control and centralized control in the context of PV generation control is discussed in [START_REF] Turitsyn | Options for Control of Reactive Power by Distributed Photovoltaic Generators[END_REF]. A centralized control strategy benefits from the coordination between the actors and the presence of more information on the state of the system. The drawbacks are mainly related to the communication complexity and the effect of communication speed on results of the centralized controller. For instance consider a relatively slow communication channel, a centralized controller using the channel is limited by its speed and might itself be too slow to be practical for certain applications. In the context of PV generation control in the low-voltage grid, the only communication channel generally available today to gird operators is the channel provided by the AMI. AMI communication channels, particularly those that rely on technologies such as Power-line Communication have limited communication capabilities compared to modern communication technologies.

Three different control strategies for congestion avoidance by active power control are proposed in [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF]: open-loop, feed-back, and feed-forward (see Figure 4.1). Here the AMI capabilities are used at two different levels. First, the proposed control does not assume any knowledge of the details of the underlying electrical system (topology, lines characteristics, etc), but it infers from AMI data the information needed for its purposes. Second, the AMI is viewed as a measurement and communication platform on which a centralized controller is deployed. The optimal level of PV curtailment is then computed by formulating and solving an optimization problem, in which the grid constraints are learnt from historic AMI data, and in which some of the parameters of the optimization problem are obtained from the most recent available AMI measurements. The results show that the feed-forward controller is better compared to open-loop and feed-back controllers in over-voltage avoidance while at the same time operating with minimal energy curtailment. In what follows, we assume a feed-back controller based on active power curtailment adapted from the controller of [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF]. The rationale behind this decision is:

• The control is used as a proof-of-concept to demonstrate the smart grid setup that is based on AMI. Therefore it makes sense that we choose a centralized control for our study;

• As discussed by [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF], there are strong arguments in favor of active power control:

it does not involve additional CAPEX cost contrary to grid reinforcement and OLTC-like technologies;

in a low voltage (LV) network, the effect of active power on voltage is usually several times stronger than the effect of reactive power;

active power curtailment makes it possible to deal with current constraints (overloads), not only with voltage problems -contrary to reactive power control and OLTC-like technologies;

finally, active power curtailment will occur only on the rare occasions where solar irradiance is maximal while local consumption is minimal, so that the loss-of-profit of PV generators will be limited.

• The results provided in [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF] by the AMI based controllers are very promising and the control structure, being built for AMI, is well suited for our setup.

• Although the results of the feed-forward controller were better in terms of overvoltage avoidance, the feed-back controller can be improved while keeping its simplicity. The feed-back controller is also less aggressive in terms of energy curtailment, similar to the feed-forward.

Proposed control

System description

We consider a low-voltage grid connected to a MV/LV transformer feeder. For simplicity, we make the following assumptions. First, the voltage at the point of coupling with the MV grid is assumed to be measurable using dedicated sensors in the substation. Second, the loads are all modelled as constant (complex) power, single-phase loads. Third, we assume that all PV generators are controllable, whereas load is not. Fourth, we only consider over-voltage constraints. These assumptions are technically unnecessary; they are made here for the sole purpose of simplifying the mathematical formulation of the equations that will appear next and thus keeping them more legible.

We will study the grid over a certain period of time. For each load, a load curve is thus defined, as well as a curve of producible power for each PV generator. The curve of producible power is defined as the power that would be produced by the considered generator if no active power control was used. Both types of curves are defined over fixed time steps, e.g. 15 minutes. We assume that the metering infrastructure is capable of sending the central controller regular measurements of active power and voltage for all loads and generators of the grid, and that the controller is able to send back a generation quota (that is to say, an upper bound on the power output) to each PV generator. By definition, the generation quota α g (t) belongs to the interval [0, p max g ] where p max g is the power rating of generator g ∈ G. Said otherwise, vector p max fixes an upper bound on vector α(t) at all times t. The controller gathers measurements and sends back quotas at fixed time intervals, e.g. 15 minutes again.

The goal of the controller is twofold:

• first, the controller should ensure that the over-voltage limits will not (or not too much) be violated;

• second, the controller should strive to maximize the amount of generation quotas (within the limit α(t) ≤ p max ) sent to PV generators, and the amount of PV energy actually produced.

In other terms, there is a trade-off between how much the controller can mitigate voltage violations and how much energy loss will accompany this process. A good controller is the one that results in minimal violations and minimal energy losses. The next subsection will now provide a more formal mathematical model of our system.

Variables and constraints

Let L be the set of loads, and G the set of generators. For l ∈ L and for g ∈ G, we denote by p l > 0 and p g < 0 respectively the active power consumed and produced by the considered customer. The value of p l (t) over the considered time frame is determined by the predefined load curve of customer l. The value of p g (t) over time is determined on one hand by the producible power pg (t), which is determined by the current value of solar irradiance, and on the other hand, by the power quota α g (t) sent by the central controller:

p g (t) = min(p g (t), α g (t)) (4.1)
We also introduce the phase-to-neutral voltage magnitude, which we denote by and u l (l ∈ L) for loads, u g (g ∈ G) for generators. For convenience, we then define the set of all active power outputs p(t) := ((p l (t)) l∈L , (p g (t)) g∈G )

CONTROL DESIGN

103 and the set of all phase-to-neutral voltage magnitudes u(t) := ((u l (t)) l∈L , (u g (t)) g∈G ), as well as the set of power generation quotas α(t) := (α g (t)) g∈G .

Since we are only able to control active power, we consider all other parameters that may influence the voltage value as noise. This includes the value of reactive power consumed or generated by loads (and possibly generators), over which we have no control. It also includes any kind of measurement inaccuracies, etc. Noise is captured in the model by introducing a random process ξ(t).

Then we may write

u(t) = h(p(t), ξ(t)) (4.2)
where function h(•, •) expresses the effect of active power consumption p(t) and the effect of noise ξ(t) on voltage u(t). In the simplest case, where the only source of noise is reactive power and loads active power, Equation 4.2 expresses

• first, that active and reactive power determine complex voltage through the (threephase, unbalanced) load flow equations,

• and second, that the the phase-to-neutral voltage magnitudes may be computed from the complex voltages.

In the laboratory setup with physical power flow, Equation 4.2 expresses the effect of the power flow on the voltages measured by the AMI. Therefore the function h does not have to be implemented rather it will be represented by the physical system. Finally, the last equation that must be taken into account derives from the upper voltage limit:

u(t) ≤ u max , ∀t, (4.3)
where u max is the maximum allowed phase-to-neutral voltage magnitude (e.g. 10% above the nominal value of voltage).

the parameters of the controller is out of the scope of this document. For the sake of experimentation, we assume that the grid model is always known. Indeed, the model is forced by the physical elements of the setup and their configuration. Finally, the control parameters in our system are fine-tuned manually using a trial-and-error approach.

Control applications

As discussed earlier at the beginning of this chapter, the main goal behind the design of the controller is to evaluate the laboratory setup. Evaluation here means that this control can serve as an application that can be tested using the setup to demonstrate its usability. Additionally, the setup focuses on the representation of a smart grid in its cyber-physical nature. It only makes sense in this case to choose the scenarios that accent this property. In effect, testing the theoretical performance of a voltage controller can be done much easier using a software simulation; this however takes us back to the problem of "what is tested is far from what is deployed in reality". The abstraction of other aspects of the system, say the communication channel, could lead to problems in the application under test not being detected. That being said, there are several studies that can be made where the control application is evaluated and the communication aspects are taken into account; (i) the resilience of the control under (partial or total) communication loss; (ii) the effect of a noisy communication channel on the control; (iii) the effect of communication overloads (e.g. large groups of hundreds of smart meters sharing the same NAN, occasionally saturating the channel and causing delays on the control output), to name a few. In what follows we chose two scenarios to study a non-ideal communication channel on the control performance:

first, the effect of loss of communication;

and second, the effect of a noisy communication channel.

All the tests are performed using the setup of Section 3. This setup allows the experimentation with a variety of scenarios. The controllable loads/generators make it possible to represent any consumption/production profile with actual power flow. The smart meters are responsible for regularly reporting measurements and carrying control commands from the central controller to the houses. In addition, deteriorated communication channel conditions can be represented with the following elements: (i) the bypass branch in the lines is used to change the attenuation levels of the PLC communication; (ii) the PLC filter is used to create communication losses by disconnecting parts of the communication network while keeping them connected in terms of power flow; (iii) the noise generator is used to inject noise through the PLC coupler in the network.

The 4-step scenario

In this part, we consider the following scenario:

• the feed-back controller proposed in the previous section is deployed on the owvoltage grid with the intent of mitigating potential over-voltage problems caused by photovoltaic generators;

• but the quality of the PLC communication channel is degraded, with parts of the network suffering from communication cuts.

To demonstrate the performance of the feed-back controller, we run a simulation comprising four steps: first a baseline simulation with no control, second a feed-back control in normal communication conditions, third the same control in poor communication conditions, and last an upgraded feed-back + open-loop control combination for safe operation in degraded communication.

The results in the figures below, show the active power and the voltage values for each smart meter in the network. The measurements are recorded at a 15 minutes time interval and the control is performed directly after the measurements are received by the coordinator; therefore with a 15 minutes control step. In addition to the smart meter measurements, the figures also show the measurements collected locally at every house using an auxiliary meter. These meters can provide finer measurements intervals (shorter time span between readings) because they are not limited by the AMI; and because their data is collected using the "artificial" (Ethernet) communication network, they can also show the state at their connection point in cases where the coordinator cannot receive measurements from the corresponding smart meter due to PLC communication issues. These additional meters may also provide better measurement accuracy, e.g. for voltage readings, than those embedded inside smart meters. Note here that these meters are only placed in the setup for experimentation purposes as they provide a redundancy of measurements. They do not contribute to the operation of the controller that depends only on the AMI for both sensing and communication.

1. In the first step, we run a simulation with no control. This step establishes a baseline for the voltage limits in the grid and shows the eventual voltage violations. The generation power vector (referred to as p g in Section 4. The expected over-voltage can be observed in Figure 4.3 (starting at 9:30). This allows us to evaluate the performance of the controllers implemented in the following steps.

2. In the second step, we implement the feed-back controller defined in the previous section. Here we consider a network with normal communication conditions, i.e. the coordinator is able to read measurements and send power quotas to all smart meters in the network normally. The results depicted in Figure 4.4 show that this controller can mitigate overvoltages in the grid caused by the excess photovoltaic penetration. Note that the voltage readings provided by the AMI give the impression that overvoltages where perfectly mitigated, with the voltage value at House 3 being right on the limit; while the finer-grained voltage readings provided by the additional local meters reveal that minor control imperfections actually remain, even when the communication works properly. The communication conditions being, in reality, not always perfect, we now turn to Step 3. 4. In the fourth step, we change the feed-back controller from the previous steps to account for communication problems that are translated into missing measurements and lost controllability over parts of the grid. The problems encountered in Step 3 can be solved by introducing a "safe mode" when communication errors occur. This can be done by applying an open-loop control (refer to Figure 4.1) to guarantee that the system constraints are respected. Here we apply two types of open-loop control in the degraded communication mode:

• Smart meters that cannot communicate with the coordinator apply a predefined "safe quota" α saf e for the interval where the control signal was missed.

• The central controller decreases the maximum producible power p max to p max saf e when it does not receive all the measurements of the smart meters; with p max saf e < p max . Overall, the four steps above depict the importance of taking communication conditions into account when using a centralized control strategy. The obtained results show that these conditions may have significant effects on the performance of the applied control strategy. Without proper handling of theses poor communication conditions, the safe operation of the grid cannot be always guaranteed. This 4-step scenario demonstrates that control applications may be effective in software simulations or experimental setups where the communication aspects are neglected. However they may not be as effective for application in the real world with all the impurities that accompany it. It also demonstrates that with a laboratory setup, it is easy to test these conditions and test the eventual solutions to the encountered problems.

It is also worth mentioning here the added value of a physical setup over software simulations in providing inherent support for testing the robustness of a scenario against some uncertainties and external interference. Performing these tests in software would require extensive work to add uncertainties in several parts of the system model. It would be rather difficult to account for all the impurities of the real world without extremely complicating the model of the system under study. This is a functionality one gets for free when using a physical system. For instance, in the laboratory setup, the impedance of the lines, the meters measurements, the load powers, . . . would differ from the values used in the simulation due to several factors.

One example of where this difference between software and hardware becomes visible is when tuning the PI control parameters. In the tuning process, parameters that are close to the limits of instability of the control may work in simple software simulation, say normal load flow simulation in this case, but may not in the laboratory setupthus they may not work not in reality. This was the case with the manual tuning of our feedback controller: after running software simulations to pre-tune the parameters of the PI controller before we tried them on the physical setup, we observed that some settings performed well in simulation and very poorly on the setup.

Control vs. noise

In the previous section we studied the effect of communication cuts on the feed-back voltage controller. It was demonstrated that imperfect communications can affect the effectiveness of the control applied and thus may be dangerous to ignore. Communication imperfections can also appear in other forms such as a noisy channel. High levels of noise in the medium may lead to communication delays and loss of communication in some parts of the network. The effect of noise on the control applications is especially important in the case of a PLC communicating AMI. The reason is that the power system and the communication system share the same physical medium; so it is more difficult to isolate the noise sources from the communication channel. The effect of noise is also particularly difficult to model and simulate, which makes a strong case for physical experimentation.

With the current implementation of the software run-time as a discrete event-driven, it is not feasible to demonstrate the effect of communication delays caused by increasing noise levels on the control. It is however possible to study the effect of communication losses caused by external noise on the control performance. The metric used to measure noise levels here is the so-called LQI, simply because it is the metric provided by the PLC coordinator used in the setup; it is thus easy to access in practice. The higher the LQI, the lower the noise level. The results clearly show that the performance of the controller is inversely proportional to communication losses caused by higher noise levels (lower LQI). This is especially clear if we compare the control result represented by the depth of over-voltages to the number of lost packets during a voltage violation period. The plots of the output time series of the simulation results are shown in Appendix B.

Conclusion

In this chapter we introduced a feed-back voltage controller based on active power photovoltaic curtailment. The controller relies on the "flexibility" of the distributed energy resources in the LV smart grid to eliminate the need of grid reinforcement in some scenarios. We also studied the performance of the controller in imperfect grid conditions such as communication faults and noisy communication channels. The studies show that the effect of practical communication conditions on the control applications of a smart grid cannot be ignored. A more advanced control logic based on a combination of feedback and open-loop strategies is proposed to solve the problems posed by the degraded communication conditions. The studies also show that, in some cases, it is easier to test these scenarios with the help of an experimental setup than modelling them with software -especially when capturing the behavior of the communication layer accurately is important.

The observability, connectivity, and controllability of the low-voltage grid made available by the AMI can help providing better operational conditions of the system. These characteristics of the modern low-voltage grid allow for more innovative control and monitoring technologies. Here we saw one possible control application that could be used and saw the testing and validation steps and results. Several other applications can be Chapter 5

Perspectives

Introduction

In the previous chapters we saw the technical aspects of building a laboratory setup for testing and validating smart grid technologies in the low-voltage grid. A working prototype of a small single-phase LV grid was shown. This prototype however is only the first step towards realizing a full smart grid model. We also saw an example on a control application that has been developed and tested using the setup. The setup being generic by design allows for testing more technologies in the fields of control and monitoring of smart grids. It opens the door for a variety of studies that can benefit from the presence of a versatile cyber-physical system. This chapter is dedicated to future technical and research work that could be done on top of this thesis.

Improving the current implementation

While the setup in its current state can be used with some use-cases, as we saw in the previous chapter, it is still limited in what it can do. The hardware build is the result of continuous development and is not yet a commercial-class product. On the other hand, the software is minimal and only a proof-of-concept that is tied to our use-cases. Therefore, improvements can be made in both hardware and software.

Hardware upgrades

As we saw in Section 3.3.4, the currently realized platform is a single-phase LV grid of three houses. In reality, LV grids are three-phase, bigger as they contain more nodes, and experience phenomena such as unbalanced power flow. This means that a small single-phase grid may not be able to capture all the characteristics of the real system. The goal of this thesis is to provide a proof-of-concept implementation of the setup and 120 CHAPTER 5. PERSPECTIVES present a clear path on how make improvements and upgrades. For instance, in chapter 3 we provide a detailed schema of three-phase LV lines (which we also manufactured and tested) that can be used to build the bigger setup. And since the LV grid usually hosts single-phase loads, it should be sufficient to install the three-phase lines and connect more houses to create the full grid.

In addition to creating a larger, 3-phase setup, some additions could be made to allow for more functionality and better user experience. An example is adding a SCADA system so that scenarios running on the platform can be monitored in real-time. Another example is adding the ability to connect "scale 1 equipment" -real world equipment such as a real photovoltaic panel and inverter, electric vehicle charger, a washing machine, etc. The term scale 1 here is meant to distinguish between the elements of the setup with reduced-scale power and the normal scale elements of the real world. In order to achieve this, power amplifiers must be used to match the power scale between the setup and the equipment to connect.

Software upgrades

In addition to possible hardware upgrades, the software interface of the platform has some room for improvement. As we saw in Section 3.4.2.1, the current implementation of the software runs simulations in an event-driven accelerated mode only. It is indeed often desirable to run fast simulations, but it may not be always the case, since this mode of simulation may hide some aspects of the systems. An example is simulations that involve communication delays: such studies should be performed using another simulation mode, namely real-time (or possibly, accelerated time, if one wants to create an "even worst case" scenario).

Further improvements that would be added to the software platform is increasing its modularity. The first step here would be to separate the core functionality of the platform from the specifics of the target applications. In other words, there is a need for a simulation engine that handles all the setup management, events scheduling, and time orchestration. Moreover, abstract Application Programming Interfaces (API) should be added so that different use-cases have a standard way to use the platform. This can be achieved by implementing a multi-agent system, either based on the High Level Architecture (HLA) as we saw in co-simulation platforms in Section 2.3, or a light-weight tool such as [START_REF] Steffen Schütte | Mosaik -Smart grid simulation API: Toward a semantic based standard for interchanging smart grid simulations[END_REF].

Target applications and use-cases

The work done in this thesis can be extended with implementing and testing more smartgrid technologies in the fields of monitoring and control of the distribution system. In this section, we provide a list of candidate studies.

Monitoring applications

Here we differentiate between the normal operation conditions and "abnormal" conditions of the distribution system.

Normal operation

State estimation: Perhaps one of the most important applications of the AMI is state estimation. The measurements made by smart meters may not be precisely accurate and are carried out on major time scales (10 to 15 minutes). However, these measurements provide to the DSO entirely new supervision possibilities of the LV grid. The technique of "state estimation" uses smart meters to send periodically to the concentrator electrical quantities such as voltage, current, and the active and reactive power of LV strategic connection points. The state estimation calculation is then carried out directly at the concentrator. This technique consists of producing, from the data measured by the sensors, a calculation aiming at estimating the state of the grid as completely as possible including the value of quantities not directly measured, such as the power flowing through the lines and in the MV/LV substation from the aggregation of individual measures. This application of the advanced metering infrastructure therefore makes it possible to assess permanently and in near real-time the state of the grid and the remaining "safe" operating margins, including when the quantities concerned are not directly accessible to the measurement, in order to detect possible problems of grid overload and supply quality compliance.

Voltage estimation using data driven model: The measurements of smart meters are collected by the concentrator every 10 to 15 minutes which creates a handy database of the historical state of the system. These historical data could be used to create a data-driven model for estimating the voltage for a given scenario of power change. For example, a maximum voltage rise at each node of the grid could be estimated if node "X" is allowed to generate two more kWh of solar energy. With the system functioning in the same conditions and topology, this method is effective and data used for creating the model are reliable and representative of the system.

Abnormal operation

Detection of LV cuts: Such functions are based on an understanding of the telecommunication data of the smart meters, when they use the PLC technology. Indeed, the communication capabilities of a meter are then strongly related to the state of its electrical connection. In the case of a normally powered network, the communications take place in a certain sequence that defines a normality for the system. Conversely, in the case of power cuts, the meter of the customers concerned can no longer communicate properly and the system will detect a deviation from this normality. Algorithmic processing can therefore be set up in the concentrator, in order to extract telecommunications data from the list of meters supposedly cut; an alert can then be sent to the system operation team localizing the power cut.

Detection of MV cuts:

Smart meters can also contribute to the detection, confirmation and localization of power cuts on the MV grid, without direct measurements of the MV quantities. Such cuts detection function is based on the understanding of the data collected by the smart meters. Using the aforementioned "state estimation" technique, the system state can be learned and a "normal operation range" could be specified. Detecting measurements or estimations outside of this range can help detecting faults on the MV grid. In this case, communication with the meters takes place in the normal sequence, however, it is the measurements themselves that are outside of the normality of the system. This approach could be particularly fruitful for the detection of "weak" MV cuts, such as a 1-phase cut at the end of a long MV line with no short-circuit (e.g. a detached conductor on one phase, hanging from a pole, not touching the ground). While such cuts are particularly difficult to detect, understand and locate using current techniques, they could possibly be better handled by processing the AMI data.

TARGET APPLICATIONS AND USE-CASES

Control applications

In chapter 4 we studied one control application, a centralized feedback control of voltage using active power curtailment of distributed photovoltaic generators. There are other control applications that can be tested even for this same use-case -the control of photovoltaic production.

Photovoltaic control:

In the broad term, the control of photovoltaic production in the LV grid can be any combination of P, Q(U ) controls; on the central level (at the MV/LV transformer), on the domestic level (smart homes), or device level (photovoltaic inverter). This category may contain other notions of control such as self consumption where the consumer (which is also a producer) uses their own electricity. This concept can be applied individually ("individual self-consumption"; each house manages its own consumption based on the energy it produces locally, say from a rooftop PV, with a local storage system), in which case we fall back again into the category of domestic level control; or it may be applied at a wider level such as neighborhood, district, or street level ("collective self-consumption"). The latter concept, which requires sharing resources and data between between multiple consumers, introduces a fourth level of control, on top of the main three abovementioned levels.

Control of electric vehicles:

The control of the charging of electric vehicles is similar in concept to that of PV, with an additional difficulty linked to the need to plan, as much as possible, the actions of controlling the charging of EVs because these have a direct impact on the users. Furthermore, EVs could participate in more complex control scenarios such as Vehicle-to-Grid (V2G). In this case, an EV in addition to being a flexible load is also a storage system.

ICT studies

The idea here is to step up the maturity of the monitoring and control applications above. The monitoring and control functions described in the two previous parts can be implemented in different ways, with a spectrum ranging from "proof-of-concept" to "quasi-industrial prototype". This means that an implementation of a certain scenario can be minimal for a particular use case up to a well defined system with guaranteed genericity, robustness against various imperfections, scaling, ease of parameterization, etc. The two categories above can be regarded in the sense of "proof-of-concept" of pure electrical engineering qualities.

The ICT studies consist essentially in addressing the industrialization issues (i.e. moving towards the "quasi-industrial prototype") of the solutions studied in the first two categories, and this work is more related to information and communication technologies than to electrical engineering. In general, the goal is to study how the performance of a certain application is affected by the degradation in communication. In chapter 4, we already provided two examples in this regard: the effect of communication loss and of noise on the feedback voltage control output. Further studies in this domain have to deal with other aspects of the ICT such as delays. Overall, these studies can be performed with a variation of the following conditions:

• An overloaded PLC channel: by injecting (fake but valid) traffic in the network.

• A noisy channel: by injecting random noise patterns in the target frequency range.

• Communication signals attenuation: using convenient low-pass filters.

Conclusion

In this chapter we broaden the outlook on our work that constructs an essential step in the journey of smart grid development. We provided an overview of technical improvements and upgrades that will increase the maturity of the laboratory setup built in this thesis. We also gave an extensive list of state-of-the-art use cases that may interest any further research in the domain of smart LV grid development.

Chapter 6 Conclusion

To answer the growing environmental and economic concerns, the traditional power system is observing a transition into a cyber-physical system called smart grid. This transition can be represented in terms of the integration of distributed and renewable energy resources, the adoption of electric vehicles and energy storage systems, the introduction of the advanced metering infrastructure, etc. The electric distribution system and especially its low-voltage side is the most affected by this transition as it is undergoing the most changes. In effect, these changes pose new challenges in monitoring and controlling the new system to guarantee its safe and reliable operation.

Historically, researchers and system operators used software and hardware tools to study the power system and the associated application required for its control and supervision. However, with the change in the nature of this system, most of these tools may be obsolete or non-relevant for newly needed studies. This fact was the driver of several research into creating new tools that deal with the development, testing, and validation of smart grid technologies. This thesis provides an overview on some of these tools in the literature. The work in this thesis also contributes to this workflow by developing and implementing a laboratory setup that represents a smart low voltage grid based on the AMI.

The tool focused on capturing the cyber-physical nature of the smart grid. By minimizing, as much as possible, the abstractions in both the power system and the ICT system, the tool can be used in the final steps of validating smart grid technologies. It will move these technologies a step further towards their mature industrial state so that they can be safely and reliably used in real world scenarios.

In addition, we addressed the specific use-case of grid congestion caused by the rise of distributed power generation. In particular, we tackled the problem of over-voltages caused by excess photovoltaic production by controlling the active power of the PV generators. The strategy used is a feed-back controller with a corrector of Proportional-Integral (PI) type. We also performed studies, using the laboratory setup, to test the proposed 125 126 CHAPTER 6. CONCLUSION controller in non-ideal ICT conditions. The studies revealed that a naive controller may not be the best choice in these conditions. Eventually, an upgraded version of the controller was proposed to handle the surfaced issues.

Finally, an overview of further future developments in both the technical and research terms was given. Potential technical improvements and upgrades were mentioned and several use-cases were proposed.

APPENDIX B. TIME SERIES PLOTS OF THE CONTROL AND NOISE STUDY

3. 3 62 3. 8 64 3. 9 4 . 6 1 . 1

 36286494611 Data concentrator unit used in the smart grid platform. . . . . . . . . . . . 3.4 Equivalent circuits of power lines of different lengths. . . . . . . . . . . . . 3.5 Comparison of the frequency response of a reference 50Ω Power-line Communication (PLC) load with a normal and scaled components of a typical short-length line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 LV line bypass circuit for 35-91kHz. . . . . . . . . . . . . . . . . . . . . . . xvii xviii LIST OF FIGURES3.7 Schema of the equivalent circuit of a LV line segment for both 50Hz and 35-91kHz signals used in the smart grid platform. . . . . . . . . . . . . . . Commercial devices used for manufacturing an experimental G3-PLC smart meter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Corrected smart meter measurements setup using a current amplifier. . . . 65 3.10 Current amplifier general electric schema and device. . . . . . . . . . . . . 66 3.11 Standard EN 55022:2010 limit line for conducted emissions on mains ports, Class A equipment. 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.12 Conducted EM emissions of the Pulse Width Modulation (PWM) driven active power load. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.13 Schema of a resistive load model without high-frequency switching. . . . . 72 3.14 Conducted EM emissions of the resistive load bank device. . . . . . . . . . 72 3.15 Schema of the reactive load model. . . . . . . . . . . . . . . . . . . . . . . 74 3.16 I-V curve of a photovoltaic solar panel. . . . . . . . . . . . . . . . . . . . . 76 3.17 Characteristics of standard and autoranging power supplies. . . . . . . . . 78 3.18 Schema of the current limiter used for solar panel emulation. . . . . . . . . 78 3.19 Four-quadrant representation of active/reactive power. . . . . . . . . . . . 79 3.20 A single-phase 3-house LV smart grid laboratory setup. . . . . . . . . . . . 80 3.21 Communication channels used for real and simulation data transfer . . . . 84 3.22 Possible simulation modes that can be run on the platform. . . . . . . . . . 87 3.23 A COSEM interface class and its instances. (Source: [11]) . . . . . . . . . . 89 3.24 A library for abstracting hardware interactions. . . . . . . . . . . . . . . . 92 4.1 Control strategies: Open-loop, Feed-back, and Feed-forward. (Source: [70]) . 100 4.2 A simplified diagram of the connection of the setup of Section 3.3.4. . . . . 107 4.3 Step 1: No control (baseline). The first 2 plots are the smart meters measurements as received by the coordinator. The second 2 plots are the local measurements recorded by the auxiliary energy meters. . . . . . . . . 109 4.4 Step 2: Pure feed-back control, normal communication. The power limit is set by the controller and the voltage returns to normal. . . . . . . . . . . 110 4.5 Step 3: Pure feed-back control, degraded communication. The Advanced Metering Infrastructure (AMI) measurements have missing data but the local measurements show all. . . . . . . . . . . . . . . . . . . . . . . . . . . 112 LIST OF FIGURES xix Step 4: A feed-back and open-loop control combination, degraded communication. Following the safe power limits, the over-voltage is mitigated. . . 4.7 Over-voltages per Link Quality Indicator (LQI). The blue bars show the mean value of over-voltages across all houses and time steps. The vertical black lines show their standard deviations. The filled circles show the number of measurements lost over the course of each simulation (four hours simulation time with 15min time steps) . . . . . . . . . . . . . . . . . . . . B.1 LQI: 130. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2 LQI: 156. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.3 LQI: 160. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.4 LQI: 168. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx Median lifecycle emissions of selected currently available electricity supply technologies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Comparison of PLC and wireless communications for smart meters. . . . . 2.1 General TRL scale as defined by the Horizon 2020 Work Programme. . . . 3.1 Representation of the smart low-voltage grid components in the hardware platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Scale of in-lab electrical quantities to real world values . . . . . . . . . . . 3.3 Electric specifications of the active power load. . . . . . . . . . . . . . . . . 3.4 Choice of elements for smart LV grid development tool . . . . . . . . . . . 3.5 Modbus primary data model tables. (Source: [47]) . . . . . . . . . . . . . .

2 CHAPTER 1 Figure 1 . 1 :

 2111 Figure 1.1: Standard power system structure, voltage levels, and frequencies.

Figure 1 . 2 :

 12 Figure 1.2: New electric cars sales in Europe. (Source: [68])

  The smart grid compared to the existing grid.

I n c r

  e a s i n g C a p a b i l i t i e r t s a t t h e d is t r ib u t io n s id e , e n a b li n g n e w a p p li c a t io n s a n d o p e r a t io n a l e f f ic ie n c ie s

Figure 1 . 3 :

 13 Figure 1.3: Transition towards the smart grid. (Source: [30])

Figure 1 . 4 :

 14 Figure 1.4: Deployment plan of Linky smart meters in mainland France [53].

Figure 1 . 5 :

 15 Figure 1.5: Association of the relays of a Linky meter to equipment as recommended by the CRE in 2016.

Figure 1 . 6 :

 16 Figure 1.6: Typical advanced metering infrastructure.

Figure 1 . 7 :

 17 Figure 1.7: Regulatory frequency map of low-frequency narrowband PLC.

Figure 1 . 8 :

 18 Figure 1.8: Typical G3-PLC communication stacks. (Source: G3-PLC Alliance)

22 CHAPTER 2 Figure 2 . 1 :

 22221 Figure 2.1: Smart grids as a cyber-physical system

Figure 2 . 2 :

 22 Figure 2.2: The V-model of the systems engineering process.

Figure 2 . 3 :

 23 Figure 2.3: Disciplined Agility Process, Basic Model [66].

Figure 2

 2

Figure 2 . 4 :

 24 Figure 2.4: Technology Readiness Level according to NASA.

Figure 2 . 5 .Figure 2 . 5 :

 2525 Figure 2.5: Hybrid Simulator Architecture [32] of INSPIRE

Figure 2 . 7 :

 27 Figure 2.7: Architecture overview of the full MOSAIK environment[START_REF] Steinbrink | CPES Testing with mosaik: Co-Simulation Planning, Execution and Analysis[END_REF]

Figure 2 . 8 :

 28 Figure 2.8: A picture showing clusters of Linky meters at LinkyLab

Figure 2 . 9 :

 29 Figure 2.9: Schematic diagram of the laboratory infrastructure

Figure 2 . 10 :

 210 Figure 2.10: Critical requirement: capturing both power and ICT related phenomena.

Figure 3 . 1 :

 31 Figure 3.1: The smart LV grid axes to be considered in a laboratory setup

Figure 3 . 2 :

 32 Figure 3.2: System under study: smart low-voltage grid

  30 kVA at 0.4kV grid which translates to a voltage reduction factor of λ = U lab 05. The scale reduction in our case is carried out on the current without reducing the voltage scale mainly so that real smart meters and other off-theshelf devices such as solar micro-inverters can be connected. The hardware was designed with scale reduction factor 1 100 ≤ I lab I real ≤ 1 50 in mind. The scaling of currents of loads

  (a) G3-PLC coordinator: the nBox-gateway. (b) Substation energy meter 2 .

Figure 3 . 3 :

 33 Figure 3.3: Data concentrator unit used in the smart grid platform.

  Equivalent circuit of a short-length power line (LV).

  Equivalent circuit of a long-length power line (HV).

Figure 3 . 4 :

 34 Figure 3.4: Equivalent circuits of power lines of different lengths.

Figure 3 . 5 :

 35 Figure 3.5: Comparison of the frequency response of a reference 50Ω PLC load with a normal and scaled components of a typical short-length line.

Figure 3 . 6 :

 36 Figure 3.6: LV line bypass circuit for 35-91kHz.

Figure 3 . 7 :

 37 Figure 3.7: Schema of the equivalent circuit of a LV line segment for both 50Hz and 35-91kHz signals used in the smart grid platform.

  PiZero with Wi-Fi4

Figure 3 . 8 :

 38 Figure 3.8: Commercial devices used for manufacturing an experimental G3-PLC smart meter.

Figure 3 . 9 :

 39 Figure 3.9: Corrected smart meter measurements setup using a current amplifier.

  General electric schema of the realized current amplifier device. (b) Custom-made "current loop" device used in the setup.

Figure 3 . 10 :

 310 Figure 3.10: Current amplifier general electric schema and device.

30 ENFigure 3 . 11 :

 30311 Figure 3.11: Standard EN 55022:2010 limit line for conducted emissions on mains ports, Class A equipment. 8

3 :

 3 3.2.2 making an impedance of a line segment very long for PLC communication due to power scale Electric specifications of the active power load.

Figure 3 . 12 :

 312 Figure 3.12: Conducted EM emissions of the PWM driven active power load.

Figure 3 . 13 :

 313 Figure 3.13: Schema of a resistive load model without high-frequency switching.

Figure 3 . 14 :

 314 Figure 3.14: Conducted EM emissions of the resistive load bank device.

Figure 3 . 15 :

 315 Figure 3.15: Schema of the reactive load model.

Figure 3 .

 3 Figure 3.16: I-V curve of a photovoltaic solar panel.

Figure 3 . 17 :

 317 Figure 3.17: Characteristics of standard and autoranging power supplies.

Figure 3 . 18 :

 318 Figure 3.18: Schema of the current limiter used for solar panel emulation.

Figure 3 .

 3 Figure 3.19: Four-quadrant representation of active/reactive power.

Figure 3 .

 3 Figure 3.20: A single-phase 3-house LV smart grid laboratory setup.

  la ti o n tr a ff ic lo g s , a u x il ia ry d a ta , e tc .

Figure 3 . 21 :

 321 Figure 3.21: Communication channels used for real and simulation data transfer

Figure 3 . 22 :

 322 Figure 3.22: Possible simulation modes that can be run on the platform.

3 . 1 . 2 )Figure 3 .

 3123 Figure 3.23: A COSEM interface class and its instances. (Source: [11])

  t A d d r e s s=" 1 " S e r v e r A d d r e s s=" 1 " S e r v e r P h y s i c a l A d d r e s s=" 32 " Type=" h d l c "/> <A s s o c i a t i o n L a y e r ApplicationContextName="LN" A u t h e n t i c a t i o n L e v e l="LOW_SECURITY" LLS_Password=" * * * * * * * * "/> <Commands> <!--Connect t o t h e meter --> <A s s o c i a t e /> <!--Get I n s t a n t a n e o u s V o l t a g e P h a s e 1 . v a l u e --> <GetRequest> <GetRequestNormal> <I n v o k e I d A n d P r i o r i t y Value=" C1 "/> <A t t r i b u t e D e s c r i p t o r > <C l a s s I d Value=" 0003 "/> <I n s t a n c e I d Value=" 0100200700FF"/> <A t t r i b u t e I d Value=" 02 "/> </ A t t r i b u t e D e s c r i p t o r > </GetRequestNormal> </GetRequest> <!--D i s c o n n e c t from t h e meter --> <R e l e a s e /> </Commands> </ndlms>

•

  Registering / Authenticating devices (smart meters) into the network • Assigning short addresses to the devices; the address identifies a device in the network and is part of the communication requests sent to the device • Managing network security keys • Whitelisting devices for plug-and-play connections; or blacklisting devices that should not be part of the network • Add/remove devices individually • Set/reset the internal data structure related to the connected devices • Read the network status that contains information about the connected devices • Read/write low-level G3-PLC attributes and many other configuration capabilities that could be used to manage the PLC network.

92 CHAPTER 3 .Figure 3 .

 33 Figure 3.24: A library for abstracting hardware interactions.

Figure 4 . 1 :

 41 Figure 4.1: Control strategies: Open-loop, Feed-back, and Feed-forward. (Source: [70])

3 . 4 .

 34 A simplified diagram showing the basic elements used and their connections is shown in Figure 4.2.

Figure 4 . 2 :

 42 Figure 4.2: A simplified diagram of the connection of the setup of Section 3.3.4.

2 . 3 )

 23 is totally determined by the solar irradiance available at every moment as no external local or central control is applied. The results of this simulation are shown in Figure 4.3.

Figure 4 . 3 :

 43 Figure 4.3: Step 1: No control (baseline). The first 2 plots are the smart meters measurements as received by the coordinator. The second 2 plots are the local measurements recorded by the auxiliary energy meters.

Figure 4 .

 4 [START_REF]Electrical equipment for measurement, control and laboratory use -EMC requirements -Part 1: General requirements[END_REF] shows the obtained results.

Figure 4 . 4 :

 44 Figure 4.4: Step 2: Pure feed-back control, normal communication. The power limit is set by the controller and the voltage returns to normal.

3 .

 3 In the third step, we keep the same controller used in Step 2 but block the communication with the smart meter furthest from the substation. The communication cut is done by flipping the switch of Figure4.2 which connects a PLC filter that lets electricity (50 Hz signal) pass normally, but blocks the PLC communication.

Figure 4 . 5 :

 45 Figure 4.5: Step 3: Pure feed-back control, degraded communication. The AMI measurements have missing data but the local measurements show all.

Figure 4 . 6 :

 46 Figure 4.6: Step 4: A feed-back and open-loop control combination, degraded communication. Following the safe power limits, the over-voltage is mitigated.

Figure 4 .

 4 Figure 4.6 shows how the controller effectively changes its maximum power to account for the lost data. The meters that are able to communicate with the coordinator now respond to the control set-points while disconnected meters (such as that

Figure 4 .

 4 [START_REF]Electricity metering data exchange -The DLMS/COSEM suite -Part 6-2: COSEM interface classes[END_REF] shows the result of a study made using the feed-back controller used in Step 2 of the 4-step scenario of the previous section. The study consists of repeating the scenario of Step 2 with different levels of noise in the network. The noise is injected into the network using a laboratory function generator and a PLC coupler (see Figure4.2).

Figure 4 . 7 :

 47 Figure 4.7: Over-voltages per LQI. The blue bars show the mean value of over-voltages across all houses and time steps. The vertical black lines show their standard deviations. The filled circles show the number of measurements lost over the course of each simulation (four hours simulation time with 15min time steps)

Figure B. 1 :

 1 Figure B.1: LQI: 130.

  1.1 Standard power system structure, voltage levels, and frequencies. . . . . . 1.2 New electric cars sales in Europe. (Source: [68]) . . . . . . . . . . . . . . . 1.3 Transition towards the smart grid. (Source: [30]) . . . . . . . . . . . . . . . 1.4 Deployment plan of Linky smart meters in mainland France [53]. . . . . . . 1.5 Association of the relays of a Linky meter to equipment as recommended by the CRE in 2016. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Typical advanced metering infrastructure. . . . . . . . . . . . . . . . . . .

1.7 Regulatory frequency map of low-frequency narrowband PLC. . . . . . . . 1.8 Typical G3-PLC communication stacks. (Source: G3-PLC Alliance) . . . . 2.1 Smart grids as a cyber-physical system . . . . . . . . . . . . . . . . . . . . 2.2 The V-model of the systems engineering process. . . . . . . . . . . . . . . . 2.3 Disciplined Agility Process, Basic Model [66]. . . . . . . . . . . . . . . . . 2.4 Technology Readiness Level according to NASA. . . . . . . . . . . . . . . . 2.5 Hybrid Simulator Architecture [32] of INSPIRE . . . . . . . . . . . . . . . 2.6 Multi-layer platform of complex power system [14] . . . . . . . . . . . . . . 2.7 Architecture overview of the full MOSAIK environment [62] . . . . . . . . 2.8 A picture showing clusters of Linky meters at LinkyLab . . . . . . . . . . . 2.9 Schematic diagram of the laboratory infrastructure . . . . . . . . . . . . . 2.10 Critical requirement: capturing both power and ICT related phenomena. . 3.1 The smart LV grid axes to be considered in a laboratory setup . . . . . . . 3.2 System under study: smart low-voltage grid . . . . . . . . . . . . . . . . .

Table 1 .

 1

	Electricity supply technology median lifecycle emissions (g CO2/kWh)
	Coal	820
	Gas	490
	Biomass	230
	Hydropower	24
	Nuclear	12
	Solar	41-48
	Wind	11

1: Median lifecycle emissions of selected currently available electricity supply technologies.

  1 , smart thermostat, . . . and the smart meter. For these constituents to communicate together, PLC or wireless communications, such as ZigBee, 6LowPAN, Z-wave, and others can be utilized. NAN provides communication links between a number of individual smart meters and a data concentrator situated

in the secondary substation using WiMAX, cellular technologies, or narrow-band power line communication. A number of data concentrators are connected to a central system (the AMI head-end) in the utility side through WAN. Typically, WAN consists of two interconnected networks, i.e., the core networks and back-haul networks. The core networks provide connections to the control center and commonly use fiber optics or cellular networks to guarantee high data rates and low latency. The back-haul networks handle the broadband connections to NANs and monitoring devices. Figure

1

.6 demonstrates a typical AMI structure.

1.2.4.3 Communication technologies for AMI

AMI is driven by a communication network on top of the traditional power grid and metering devices that can leverage those two systems. The choice of the communication technology depends on the part of the network that it covers and on other factors such as the cost of investment. The general structure of the AMI communication network is also depicted in Figure

1

.6. The access network lies between the smart meters and the local data concentrators. It is primarily destined for automated data collection from the smart meters and may employ either wireless or wired transmission. It can be implemented relying either on the existing or on a dedicated communications infrastructure. The majority of pilot and large scale European electricity (and gas) smart meters projects use either exclusively wireless or two-segment PLC/wireless transmission; the advantages and disadvantages of each option are outlined in Table

1

.2.

Table 1 .

 1 2: Comparison of PLC and wireless communications for smart meters.

	CHAPTER 1. INTRODUCTION

Table 2 .

 2 1: General TRL scale as defined by the Horizon 2020 Work Programme.

		Meaning
	TRL 1	basic principles observed
	TRL 2	technology concept formulated
	TRL 3	experimental proof of concept
	TRL 4	technology validated in lab
	TRL 5	technology validated in relevant environment (industrially relevant
		environment in the case of key enabling technologies)
	TRL 6	technology demonstrated in relevant environment (industrially relevant
		environment in the case of key enabling technologies)
	TRL 7	system prototype demonstration in operational environment
	TRL 8	system complete and qualified
	TRL 9	actual system proven in operational environment (competitive
		manufacturing in the case of key enabling technologies; or in space)

• Mature tool • Under active research • Missing tool

	Faithfulness to ICT
		phenomena
		ICT and
	Real	telecommunication laboratories (Linky Lab)		. real power hardware 2. real ICT	• N/A	Legend
	Simulated	ICT and network simulators (nSim, NS3, NetSim, etc.)	Co-simulation of ICT and power networks (MOSAIK, INSPIRE, etc.)
			Standard power
	Ignored	(Void)	grid simulations (Power Factory, MATLAB/Simulink,	(Traditional grid)
			etc.)		Faithfulness to power
					grid phenomena
		Ignored	Simulated	Real

Table 3 .

 3 1 below demonstrates how the different components of a smart LV grid are represented in our platform:

	Component	Representation in the platform
	MV/LV transformer and upstream	LV auto-transformer
	grid
	Data concentrator	Advanced PLC gateway with network config-
		uration capabilities
	Central control and monitoring	in software (via smart meters)
	LV lines (at 50 Hz)	passive R and L elements
	LV lines (35-91 kHz)	passive elements and Electromagnetic Inter-
		ference (EMI) filters
	Smart meters	real smart meters
	Metering communication	G3-PLC communication stack with DLMS/-
		COSEM application protocol
	LV Loads	controllable resistor bank
	Rooftop solar generators	programmable power source and micro-
		inverters
	Smart installation and domestic	in software on Raspberry Pi and Modbus
	level control	communication

Table 3 . 1 :

 31 Representation of the smart low-voltage grid components in the hardware platform

Table 3 .

 3 2: Scale of in-lab electrical quantities to real world values

	3.3. IMPLEMENTATION

Table 3 . 4

 34

: Choice of elements for smart LV grid development tool

https://ec.europa.eu/research/participants/data/ref/h2020/wp/2014_2015/annexes/ h2020-wp1415-annex-g-trl_en.pdf

https://erigrid.eu/

French DSO responsible for 95% of the French mainland territory: https://www.enedis.fr

Grenoble Electrical Engineering Laboratory: https://g2elab.grenoble-inp.fr

Grenoble Computer Science Laboratory: https://www.liglab.fr

https://neuron.swiss/nboxgw.htm

https://fr.rs-online.com/web/p/compteurs-d-energie/8718291/

https://neuron.swiss/ndevice.htm

https://www.raspberrypi.org/products/raspberry-pi-zero-w/

https://addgrup.com/products/product-single-phase-meter-2/

Example TIC-to-USB adapter: https://www.cartelectronic.fr/teleinfo-compteur-enedis/ 17-teleinfo-1-compteur-usb-rail-din-3760313520028.html

Adapted from: http://www.rfemcdevelopment.eu/en/en-55022-2010

https://en.wikipedia.org/wiki/Zero_crossing

https://blogs.keysight.com/blogs/tech/bench.entry.html/2019/09/13/what_is_a_pv_ simulat-YLkI.html

Keysight E4360:https://www.keysight.com/fr/en/products/dc-power-supplies/ dc-power-solutions/e4360-series-modular-solar-array-simulators.html

https://modbus.org/docs/Client-ServerPR-07-2020-final.docx.pdf

https://fr.rs-online.com/web/p/convertisseurs-serie-et-repeteurs/6877834/

and finally the control framework that can be applied on many levels -centrally, in the house, or embedded in smart installation.In the next chapter, we will discuss the types of applications that can be tested and validated using this platform, namely smart LV grid monitoring and control applications; and we will present the actual experiments that we carried out, and their results.

developed and can be tested using our platform. In the next chapter we will see some of these applications that could extend our work.

https://www.landisgyr.fr/product/landisgyr-dc450/

Acknowledgement

CHAPTER 4. SMART-GRID MECHANISMS

Feed-back control

A typical feedback controller for our application would be the following.

• First decide that α(t) will be of the form µ(t)p max , with µ(t) a real number belonging to the interval [0, 1]. Said otherwise, we choose a "fair" controller that will curtail all generators by the same ratio. Other choices would make sense as well; indeed, generally speaking, designing such a controller amounts to finding a compromise between fairness (i.e. sharing the cost of curtailment among producers) and overall economic efficiency (i.e. minimizing the total amount of energy curtailed). We leave this consideration out of the scope of our work, and simply make the choice to work with the "fair" formulation above.

• Continuously measure the "violation of the most violated constraint":

• If ε(t) is positive, we decrease the value of µ at the next time step (with saturation at 0)

• If ε(t) is negative, we increase the value of µ at the next time step (with saturation at 1)

• If ε(t) is positive, we limit µ by the last measured value of p g (t) (µ ≤ max( pg(t) p max )).

The first two items above essentially describe the 'I' (integral) term of a PID controller. We complement it with a 'P' (proportional) term to get a corrector of the PI (proportionalintegral) type; said otherwise, we set µ(t) to the value of

with a saturation at µ = 0 and µ = 1, where σ and τ are the two corrector gains, and where λ(t) is the term that measures the integration of the error over time. In standard control theory, one would simply set λ(t) := s ε(s)ds; but due to the uncommon definition of the desired trajectory in our problem, this definition must be adapted. The integral term λ should only accumulate the error ε as long as λ is non-negative. Indeed, whenever

CONTROL DESIGN

105

λ becomes zero and tends to decrease further, this means that the error ε(t) is negative (which is a good thing: no constraint is violated) and that this negative error does not result from our correction, since the feedback is zero. Said otherwise, in this case the negative value of ε(t) should be interpreted as follows: PV generation is sufficiently low to avoid over-voltages, do not need to curtail PV generation at all, and we do not need to keep accumulating λ (which would otherwise accumulate indefinitely and take potentially extremely large, meaningless values). In discrete time, the feedback mechanism then writes:

The last term where ε > 0 signifies a correction factor that limits voltage overshoots using active power measurements history (note that, in this respect, our corrector deviates from pure feedback control). In plain words, this correction factor simply means that we do not want power generation to go above the value it had when voltage violations were observed for the last time. This is a significant difference from the feed-back controller in [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF] that only uses the voltage measurements of the voltage in the control logic.

Parameters and system model

Note that the feed-back controller proposed above does not assume any knowledge of the details of the underlying electrical system (topology, lines characteristics, etc). The controller however has a feed-back corrector that is of PI type thus it requires some notion of system model for the tuning of its parameters. In consequence, either the grid data and topology are assumed to be known or a data-driven approach to infer the the system model must be used. In practice, unlike high and medium voltage grids, DSOs often lack reliable information about their low-voltage grids. In this case the historical measurements provided by the AMI can be used to infer the system model. Several AMI-based data-driven approaches for distribution system modelling are discussed in the literature; the linear surrogate model implemented in [START_REF] Vinot | Congestion Avoidance in Low-Voltage Networks by using the Advanced Metering Infrastructure[END_REF] and the multiple linear regression model implemented in [START_REF] Vinicius | Automated Determination of Topology and Line Parameters in Low Voltage Systems Using Smart Meters Measurements[END_REF][START_REF] Satya | Identifying Topology of Low Voltage Distribution Networks Based on Smart Meter Data[END_REF] are some primary examples.

Whether one approach or another is used for obtaining a system model and tuning

Appendices

Appendix A

Data concentrator unit A.1 Types of communication

The data concentrator unit for PLC smart meters has two communication modules:

• Downstream communication: This is the PLC communication used to interrogate the smart meters. For example, G1-PLC, G3-PLC, PRIME, etc.

• Upstream communication: This is the communication with the central IS. This communication is carried on long distances where cellular technologies such as GPRS are usually preferred especially for pole mounted transformers. Other types of communication technologies such as Ethernet or Fiber Optics may be also used.

The example devices below show this trend of using PLC for downstream communication and cellular or Ethernet for upstream communication:

Linky data concentrator from CAHORS