Implementation of a decentralized real-time management system for electrical distribution networks using the internet of things in smart grids

Received Mar 31, 2020 Revised Jun 16, 2020 Accepted Apr 24, 2021 Intelligent management of the electrical network is the implementation of an integrated system based on a reliable and secure communication architecture for transmitting end-to-end information between the equipment and the management system. The main objective of this work is to develop an intelligent telecontrol solution for the electrical distribution network combining communication techniques and an intelligent reconfiguration strategy. The solution is based on a graphic model and a secure communication architecture using the internet of things to ensure flexibility in terms of management of the intelligent network. This intelligent multicriteria solution uses a secure communication architecture and the MQTT protocol to ensure system interoperability and security. The tests were carried out on the IEEE 33 bus network and consequently, an optimization of the losses and a clear improvement in the nodal voltage were recorded despite the variation of the electric charge.


INTRODUCTION -
Challenges and motivations Modern society has faced several problems related to the availability of sustainable and clean energy due to the high demand from industry and the dependence of communication systems and data processing on electric power. In addition, electrical networks, these days, are more and more under the operating constraint and are subject to the phenomenon of degradation. Intelligent control of distribution networks keeps the equipment in normal condition and prolonged its service life, which improves the overall reliability of the system, also reducing power losses, notably created by the voltage variation during the distribution process. These issues prompted energy stakeholders to engage in in-depth discussions on power grids, which identified typical grid problems. Today's electricity networks have to cope with high energy consumption by increasing CO2 emissions [1].
A typical solution to the different challenges of the networks remains complicated especially in the current conditions with the competition between the utilities, the manufacturers and the technologies. The implementation of digitization techniques has rapidly transformed customer requirements and has squeezed the gains of stakeholders in the energy sector. Intelligent power grids are therefore a solution to face the

THE ADVANCED CONTROL SOLUTIONS ADAPTED TO SMART GRIDS ISSUES
The smart grid is characterized by the following elements [10]: self-healing, usability, cybersecurity, the ability to optimize energy costs, respectful of nature, the use of robust two-way communications, advanced sensors that are fundamental and widely distributed on the various points of the electrical network to provide a lot of crucial information about the network in real time [11], reliability and security of energy supply and use. These elements require a complex system including digital field equipment, robust routers/gateways, secure communication protocols, intelligent and evolutionary control and management software, and finally a reliable decision-making strategy.
Controlling the SG network in terms of secure and reliable operations involves designing a complex infrastructure [12]. The electrical energy management system includes algorithms for performing various operations, such as defining the operating point of elements of the electrical network [13], controlling the electrical energy and finally regulating the voltage in all bus of the networks [14]. The management of electrical distribution networks is therefore a problem of multicriteria decision-making based on the availability of real-time information of all types of equipment [15]. The complexity of this problem is related to the tree architecture of the network, the unpredictability of faults, the load consumed and the limitation of algorithms to process information and make decisions in real time. So the driving and energy management system must have algorithms that work in parallel for intelligent network management [16].
The reliable application of electrical and communication parameter detection techniques imposes intelligent control and network management strategies. Several types of control strategies have been developed for flexible and intelligent management of distribution networks [17]: centralized [18] and decentralized. In this work decentralized strategie is develloped to manage the ditribution networks in reel time.

PROBLEM FORMULATION OF DECENTRALIZED RECONFIGURATION OF DISTRIBUTION NETWORKS
To perform a decentralized electrical network reconfiguration solution, the problem of controlling the architecture of the electrical network is divided locally into several independent zones, see Figure 1. We used the graph to model the link between the network area and the consumption point, which will allow us to elaborate a matimatical equation to evaluate power flow, voltage, and electrical architecture.

The mathematical model of the decentralized control of smart grids
G is the graph that represents the radial electrical distribution network composed of N bus and L branches. We take the voltage at the source as a reference during this study. The adjacent matrix A of the network is defined as follows: aij=1 if there is a link between the point i and j aij=0 if not The Figure 2 shows a single line diagram of an electrical distribution line.
is the electric current absorbed by the load in point of consumption i and Iij the current which passes on the branch i. Z is the diagonal matrix of branch impedances: The relation between the current and the voltage is determined using the Kirchhoff laws which allows to formalize the voltage by the following formula [19][20]: The equation = * . . * . expresses the relation between the consumed current, the line current, the branch voltage and the nodal voltage in order to calculate the voltage at each bus, the joule losses during the energy distribution and the electrical flux [21]. Where A* is the transitive closure of the graph G [22]. The voltages of each node after each configuration are calculated iteratively as follows [
The calculations are repeated up to | +1 − | < Where is the condition of convergence.

The network model after the installation of the switches
The location of switches in the distribution network must be taken into account by our mathematical model and will be coded as follows: The vector B is defined as being the indicator of location of the breaking devices in an electrical distribution network. This vector plays a very important role in the remote control of the network, it allows the system to calculate and make the decision to detect the points of the electric network which can be modified to change the topology. The parameter s reflects the state of the switch organs:

Formulation of the optimization problem
The goals of the smart grid include reducing the power losses, control and voltage regulation in the various consumption points [24], improving reliability and ultimately minimizing operating and maintenance costs. Achieving these goals means the ability of the network's management and monitoring system to generate orders respecting the operating constraints. These orders will be sent remotely via a communication system to the switches which allow conducting the power distribution network. The criteria of choice and accurate decision are detailed as follows: Minimizing the power loss: = Power loss = The electric current that transits between i and j = The resistance between i and j = The number of connections

Minimize the number of switching operations (NSW):
In this article, we propose the NSW function that represents the sum of state change number of switches installed in the power grid.

Balancing the nodal voltage:
During the energy distribution process, customer consumption is generally unpredictable; the telecontrol system must generate at every moment the topology and change orders to stabilize the voltage value close to 1 pu.

Constraints:
In the searching process of optimal solution in various optimization problems, many constraints are included. In smart grids, the constraints of operations minimize the decisions made by the operators. Generally, these constraints are related to the nodal voltage and the radial architecture. Each of these constraints are mathematically formalized in the form of the following equations: where N: the number of buses in electrical networks and the L the number of branches.

Reconfiguration method
An algorithm has been proposed in this paper to generate the opening/closing orders of switches see the Figure 3. This algorithm takes into account the number of customers, the electrical parameters, the consumed power and the connection between production and consumption and this in order to respect the requirements of network operation (minimize losses and improve the voltage profile).

Multicriteria decision analysis based on the TOPSIS method
In order to determine the best scenario, we will need a decision analysis method supporting many criteria, with the ability to classify the real electrical network scenarios. The TOPSIS is a simple and good decision analysis method and widely used in optimization problems [25]. It is a powerful decision-making method based on the concept of distance between the scenario and the two positive ideal points (the ideal positive solution, and the ideal negative solution). The motivation to use this technique is that it is simple to program and does not require a lot of calculation, which exactly meets our main objective of manipulating several objectives with the minimum calculation time. The specific steps of TOPSIS method used in this work are detaid in [25] and [23].
Step 1: Establishment of a decision matrix in order to classify all the scenarios. This matrix contains N scenarios and L decision criteria.
Step 2: In order to have the same dimension of the criteria, a normalization technique is used at this stage by the calculations matrix also called normalized decision matrix.
Step 3: Calculation of the normalized weighted matrix by multiplying the columns of the normalized decision matrix by the associated weights, the sum of the weights must be 1.
Step 4: Determination of the PIS positive ideal solution and the NIS negative ideal solution.
Step 5: Calculation of the distances of each scenario from the positive ideal solution PIS and the negative ideal solution NIS and classification of all the scenarios.

THE ARCHITECTURE OF THE PROPOSED SOLUTION
To design an intelligent IoT-based smart grid control and management solution, the proposed architecture must be able to support real-time Internet-based measurement [26] and control capabilities [27] by offering features such as real-time RTU management, intelligent electronic devices (IEDs) configuration, 1147 a simple and ergonomic human machine application [28], fault management and voltage control, which facilitates the adoption of cloud technologies already available for the management of distribution networks [29] and makes use of the latest data processing and predictive analysis techniques. The Figure 4 illustrates the architecture of the the proposed solution. The architecture consists of 4 essential parts: a. The first part is the equipment layer, it is the field part that uses many types of equipment to operate electrical networks efficiently. Composed of smart communicating sensors and able to measure the different values of the electrical distribution system, these sensors are connected to the control system by RTU (remote terminal unit). The RTU offers the necessary signal processing capability to be able to identify information from the power grid and adapt it to the communication medium set up to automate and control the power grid [30]. This layer makes it possible to collect and transmit the digital data of the active and reactive powers, the values of the electrical voltage, the current, the presence of fault, the state of the equipment and the electrical networks. b. The second layer is the communication layer: gathers the gateways, VPN (virtual private network) routers and modems needed to access the communication network used by the power grid management company [31]. c. The third layer is the communication protocol part used to route information between RTU and the SCADA system. The protocol must be secure and interoperable adapted to the needs of connected objects including bandwidth and energy consumption. In this work, we use the MQTT to route information between RTU and the control system. d. The fourth layer is the most important part of the solution, it is the application layer that manages all equipment in real time. It includes many decision-making tools and the human machine interface to schematize the state of the electrical network. Our reconfiguration program is implemented in this part. The proposed communication support, see Figure 5, is based on the public internet ensuring security and interoperability. The communication architecture is decentralized. Data exchange is done via the Internet using the MQTT protocol as a lightweight protocol for publish/subscribe messaging transport based on TCP/IP [32]. The sensors used in this solution are the capacitive voltage capacitors used to give the value of the high-voltage, the current sensor that gives the current value on the electrical line and a Raspberry Pi 3 to store information and to emulate the IEEE 33 BUS. The VPN router gives us the possibility of establishing a secure link using a virtual private protocol tunnel powered by OpenVPN. The OpenVPN application is installed in a remote server ubuntu 18.04.

SECURITY
The communication between the SCADA system and the field devices is an encrypted connection according to IEC62351 standard requiring the following points [23]; a) Confidentiality: the confidentiality of communication is implemented by one of the cryptographic techniques allowing to transmit the end-to-end information in the form of encrypted requests and requiring a very important calculation time to be able to decrypt them. These algorithms need to be constantly improved to be on standby and ensure the security of the system; b) Integrity: the information must be protected against modifications; c) Availability: during a request from the SCADA system or the user, the device must be available; d) Authentication: the device must have access permission and the source must be known; e) Non-repudiation: the user does not have the right to refuse to respond to the exchange of information.

IMPLEMENTATION OF THE PROPOSED SOLUTION UNDER PYTHON
To develop the multicriteria application of control, monitoring and decision, a code under python is produced in this article. The code contains the libraries needed to manipulate the matrix and execute the reference method. These are the essential parts of our solution code; a) To model the electrical network, specific phyton libraries were used to create the graphical interface, see Figure 6. This interface displays information on the electrical network in the form of a block diagram; b) The state of the switches is modeled by red (closed)/green (open) colors; c) Power lines are represented by single-phase lines; d) Specific areas are used to display the electrical values and curves to represent the trend in real time.

TEST AND RESULTS
The network used in this work is the IEEE 33 bus, the standard information is itemized in Table 1. In order to test the solution, several scenarios were created by modifying the consumed power. The change of this power varies the electrical parameters which will create power losses and generate voltage drops. The solution seeks, at each power change, to determine the optimal adapted configuration. The test conditions are represented in Table 2. After performing this test, the solution developed in this paper finds the optimal network configuration. In addition, we plot the voltage profile for all the tests, and we find that our algorithm can find a new configuration that respect the voltage constraints, improves the voltage profile and reduces P Losses. After analyzing Figures 7 and 8, we notice that the nodal voltage is automatically improved just by changing the toplogy of the electrical network. A solution also obtained by this method stabilizes the voltage during the electrical energy distribution process.

TEST3
In this test, we increase the power on buses 9, 10, 17 and 18 simultaneously with a decrease in the active power P absorbed on buses 7,8 ,23, 24 and 25.
We increase the values of Q on buses 9, 10, 17 and 18 simultaneously with a decrease in the reactive power absorbed on buses 7,8,23, 24 and 25.

TEST4 and TEST5
We randomly generate the values of P; this value is between 0.7 and 1.5 of the power consumed.
We randomly generate the values of Q; this value is between 0.7 and 1.5 of the power consumed. All the obtained solutions fully respect the constraints especially the voltage limit. We can say that the reconfiguration of distribution networks is a very powerful tool for managing the electricity distribution networks and the remote implementation of this solution makes them more flexible.
In Figure 9, a comparison based on the power losses is exposed. We can point out that in the all the tests, the reconfiguration helps to reduce the losses. A reduction of 44,45% is obtained in power losses just by operating this solution. Also, it can be noted that there is a strong link between the branch current which means the power losses and the reliability of the electrical networks. Reducing losses contributes to improving the reliability of electrical networks [33].
All the tests, especially tests 4 and 5 that generate the value randomly, demonstrate the performance of the solution proposed in this work. In the next section, the test will be carried out in real time and validation will be performed using an IEEE33 bus network simulator.

SOLUTION IMPLEMENTATION AND TEST
To test the capacity of this solution to control an electrical network in real time, we realized a network emulator using raspberry PI to simulate the operation of the IEEE 33 bus network. The switches are concretized by relays, see Figure 10. We have changed the voltage and the system generates orders to automatically change the topology. Figure 10. IEEE 33 bus EMULATOR to test the solution

CONCLUSION
The the reconfiguration of the intelligent electrical distribution networks is converted into multi-criteria optimization problem with real operating constraints to generate the different orders and satisfy the objectives of reliability, safety and cost of electrical energy.
A resolution method is developed to give the system the capacity as well as the intelligence necessary for decision making. thereafter and by exploiting the progress in communication system based on the IoT, the decisions will be sent remotely which will actually contribute to the optimization of intelligent electrical distribution networks. In addition to the improvement of the profile of tension, the load, the most important advantage is the future benifices which can recorded in term of reliability and energy efficiency in particular that the limitation of the current electric networks .
Energy management companies must accelerate the transformation into digital companies by applying powerful software tools to analyze customer needs and meet their requirements. Implement intelligent energy management systems with the capacity to taking the necessary decisions in real time, and the deployment of the IoT in a secure manner to facilitate the interaction between equipment and communication between the management system and customers in order to promote the decentralization of energy production.