Novel Approach to Collect and Process Power Quality Data in Medium-Voltage Distribution Grids

The paper is devoted to the development of the structure of a fast and flexible data collecting system based on the proposed approach to measure power quality indicators in three-phase mediumvoltage distribution grids with an example of a Mikhailovsky mining and processing plant. The approach utilizes the properties of a space vector, obtained from grid currents and voltages with disturbed waveform, to allow faster extraction of the harmonic components compared to traditional approaches, based on the direct Fourier-transform applied to a line or phase values. During the study, the concept of a universal measurement device was introduced, which allows fast estimation of the following values at the grid node: magnitudes and phases of voltage and current harmonic components, active and reactive power of harmonics and fundamental components, positive and negative instantaneous powers. The structure of interconnected measurement and control units for the considered grid node with simultaneous operation of two active variable frequency drives with active rectifiers was proposed in accordance with a concept of the Internet of things. The benefits of the proposed solution are shown by the example of the model of the grid node with two operating draglines and nonlinear load, which was developed in MATLAB/Simulink software. The proposed approach was utilized to produce distributed references for control systems of grid inverters to compensate nonlinear currents, which allowed to significantly improve THDi of the grid


Introduction
The Internet of things (IoT) in the industry and the number of connected devices, and the amount of investment in IoT devices and infrastructure is growing at a tremendous pace [1][2][3]. According to Rostech, the global industrial IoT market will grow at an average annual rate of more than 14%, and by 2023, its volume will amount to US$ 700.38 billion [4]. Transport and industry will be the main drivers of growth. The greatest growth dynamics of the implemented IoT devices are expected in mining and industrial production [5,6]. The main areas of application of IoT in mining are the monitoring of equipment operating parameters, ensuring work safety, end-to-end digitization of production, the creation of a digital twin of production, the introduction of unmanned technologies, the introduction of AI for processing arrays of data from IoT sensors, the reduction of integral production costs [7,8].
Remote monitoring of equipment operating parameters allows to quickly identify work stoppages and make management decisions, which reduces production costs [1,9,10]. Large amounts of data on the operating parameters of a specific piece of equipment and data obtained from the same equipment throughout the world are the basis for the prediction system [5,[11][12][13]. Predictive maintenance allows achieving significant economic benefits and production safety by reducing the number of sudden equipment failures,

•
Neural network, which is widely used to identify characteristic features of signals [18,19]; • Fast algorithms to identify spectra of signals [20,21]; • Adaptive filtering of signals that respond only to characteristic changes in signals [22,23].
These algorithms are widely used in the modern mining industry: from the control of the gas atmosphere in the mine to maintaining the proper operation of draglines [10,24,25]. The provision of mining operations is directly related to the supply of power of the required quality to the final consumers, whether it is mining equipment or heavily rated power units [26]. Special requirements are placed on the operation of powerful equipment since the continuity and safety of the process depend on their work. In order to achieve an uninterruptable technological process, the grid quality must meet local standards [27,28].
The variety of power equipment to provide necessary power quality is commercially available on the market-from passive capacitor banks aimed to reduce inductive currents of the loads to dynamic synchronous compensators of series, shunt, or mixed types [29,30]. The latter devices are able to compensate for current and voltage harmonics introduced by nonlinear loads and voltage imbalance caused by asymmetrical loads [31,32]. The uninterruptable power supply of heavy-rated power equipment also depends on the correct work of relay protection units and power quality monitoring systems [33][34][35].
To provide proper reaction for power quality disturbances, the control systems of relay protection units and compensation devices must be capable of fast and accurate tracking of both voltages and currents parameters in the industrial power grids [36][37][38][39]. To achieve this, well-known algorithms based on space vector and instantaneous power estimation are used [36,40,41]. In the presence of harmonics, the algorithms become more complicated utilizing short-time Fourier transform to estimate fundamental and harmonic components of signals [21,42].
The whole power supply system, therefore, generates large amounts of data, which should be transmitted across numerous control and monitoring systems. According to the Industry 4.0 concept, the interconnection of a variety of devices in a single network with mesh topology allows providing additional scalability to the system [43,44]. However, industrial networks usually consist of mediums with different bandwidth and reliabilityfrom short and medium-range wireless connections for IoT sensors to unstable connections via LTE and power lines [45,46].
In such conditions, the ability of the power supply system to efficiently transmit and distribute power quality data between voltage/current sensors and control systems over different channels becomes its crucial property. In the recent literature, the realtime power quality analysis usually means obtaining voltages and currents spectrum components during one-half to one electrical period [25]. Such analysis has been typically used in power conditioning devices, which are able to mitigate nonlinear and asymmetrical currents flowing in the grid using onboard currents and voltage sensors. While there are recent studies indicating effective real-time transmission of the data in industrial networks via the protocols for time-critical applications [47], there is also a lack of studies that consider the benefits of implementing real-time power quality tracking being used in control systems of the power devices operating in different grid segments.
The paper is devoted to the development of an approach to collect and process power quality data within 1 period of mains voltage and transmit it to the control system of relay protection units and control systems of power conditioning devices. The novelty of the approach lies in the combination of: The benefits of the proposed approach are shown in the example of distributing references for mitigating harmonic currents between two simultaneously operating active frontends of draglines.

Materials and Methods
As a subject of modernization, the monitoring and control system of the mining and processing plant "Mikhailovsky GOK" is considered. The improvements are presented on the example of the grid node with three connected draglines of ES-15.90 type. The structure of the grid node is presented in Figure 1. The plant is supplied by power from a generation and distribution company via 35 kV overhead lines. The grid voltage is distributed from the main step-down substation 35/6 kV. Dragline #1 is connected near the transformer bus, while draglines #2 and #3 are connected to the grid node located 1.5 km from the substation. that consider the benefits of implementing real-time power quality tracking being used in control systems of the power devices operating in different grid segments.
The paper is devoted to the development of an approach to collect and process power quality data within 1 period of mains voltage and transmit it to the control system of relay protection units and control systems of power conditioning devices. The novelty of the approach lies in the combination of: • Cascade short-time Fourier transform used to estimate phase voltage and current spectra from the sensors data; • Estimation of positive and negative voltages and currents components according to the instantaneous symmetrical components theory; • Estimation of average and fluctuating power components; • Transmitting the estimated power data via protocols for time-critical applications on the example of precision time protocol; • Limiting the number of considered harmonics or switching to the transmission of average and oscillating power components depending on the transmission channel bandwidth and type of receiving device.
The benefits of the proposed approach are shown in the example of distributing references for mitigating harmonic currents between two simultaneously operating active frontends of draglines.

Materials and Methods
As a subject of modernization, the monitoring and control system of the mining and processing plant "Mikhailovsky GOK" is considered. The improvements are presented on the example of the grid node with three connected draglines of ES-15.90 type. The structure of the grid node is presented in Figure 1. The plant is supplied by power from a generation and distribution company via 35 kV overhead lines. The grid voltage is distributed from the main step-down substation 35/6 kV. Dragline #1 is connected near the transformer bus, while draglines #2 and #3 are connected to the grid node located 1.5 km from the substation. Dragline contains several electrical motors to implement different operations: torso rotation, boom manipulation, ground movement (walking). All of them are connected to Dragline contains several electrical motors to implement different operations: torso rotation, boom manipulation, ground movement (walking). All of them are connected to the grid drive, which is, in order, connected to the grid via variable frequency drive (VFD) with diode rectifier (dragline #3) or active rectifier (draglines #1 and #2). The diode rectifier (DR), despite its drawbacks, is still the most common rectifier used in VFD due to its low-cost. DR supplies DC-link in a noncontrollable way and consumes non-sinusoidal currents from the grid, introducing harmonics of 5, 7, 11, 13, . . . orders [48,49]. Therefore, DR acts as a nonlinear load for the grid. Its structure is shown in Figure 2. the grid drive, which is, in order, connected to the grid via variable frequency drive (VFD) with diode rectifier (dragline #3) or active rectifier (draglines #1 and #2). The diode rectifier (DR), despite its drawbacks, is still the most common rectifier used in VFD due to its low-cost. DR supplies DC-link in a noncontrollable way and consumes non-sinusoidal currents from the grid, introducing harmonics of 5, 7, 11, 13, … orders [48,49]. Therefore, DR acts as a nonlinear load for the grid. Its structure is shown in Figure 2. Active rectifier, which is also known as active frontend (AFE) as a part of VFD, is a power converter with the ability to operate in four quadrants [50,51]. The power circuit structure of the AFE, which is built according to the three-level neutral point clamped topology, is shown in Figure 3 [52]. AFE is typically used to maintain the following functions:

•
Bidirectional power flow, i.e., during regenerative braking [53,54]; • Correction of power factor at the input [55]; • Controllability of the DC-link voltage [56].  Active rectifier, which is also known as active frontend (AFE) as a part of VFD, is a power converter with the ability to operate in four quadrants [50,51]. The power circuit structure of the AFE, which is built according to the three-level neutral point clamped topology, is shown in Figure 3 [52]. AFE is typically used to maintain the following functions:
with diode rectifier (dragline #3) or active rectifier (draglines #1 and #2). The diode rectifier (DR), despite its drawbacks, is still the most common rectifier used in VFD due to its low-cost. DR supplies DC-link in a noncontrollable way and consumes non-sinusoidal currents from the grid, introducing harmonics of 5, 7, 11, 13, … orders [48,49]. Therefore, DR acts as a nonlinear load for the grid. Its structure is shown in Figure 2. Active rectifier, which is also known as active frontend (AFE) as a part of VFD, is a power converter with the ability to operate in four quadrants [50,51]. The power circuit structure of the AFE, which is built according to the three-level neutral point clamped topology, is shown in Figure 3 [52]. AFE is typically used to maintain the following functions:

•
Bidirectional power flow, i.e., during regenerative braking [53,54]; • Correction of power factor at the input [55]; • Controllability of the DC-link voltage [56].  Draglines operate in a stochastic manner because of the relative randomness of excavation operations. The typical load profile of ES-15.90 draglines is shown in Figure 4, where rapid changes of both active and reactive power can be seen. Considering the remoteness of the dragline #2 and #3 from the transformer bus, the presented load profile will create a significant voltage drop in the cable lines, connecting the grid node with the substation bus, depending on the grid short-circuit impedance at the substation bus [57]. At the same time, dragline #3 will consume harmonic currents with arbitrary magnitude, depending on its load profile, therefore, introducing randomness to currents and voltages spectra at the PCC [38,58,59].
where rapid changes of both active and reactive power can be seen. Considering the remoteness of the dragline #2 and #3 from the transformer bus, the presented load profile will create a significant voltage drop in the cable lines, connecting the grid node with the substation bus, depending on the grid short-circuit impedance at the substation bus [57]. At the same time, dragline #3 will consume harmonic currents with arbitrary magnitude, depending on its load profile, therefore, introducing randomness to currents and voltages spectra at the PCC [38,58,59]. To maintain power quality within the acceptable limits, which are regulated according to GOST (acronym for State Standard or Governmental Standard in Russian) 32144-2013, the dynamic compensators are typical to be installed at the nodes depending on the grid and load configuration. The most common device, used to mitigate harmonic currents and rapid voltage fluctuations, is a STATCOM-four-quadrant power converter with a DC-link, a part of flexible AC transmission systems family [60]. While STATCOM is a standalone device for reducing grid power distortions of various factors, its similarity to AFE increases interest in providing the ability to improve the grid power quality by the use of VFD with AFE, which would reduce capital costs to install and maintain STAT-COMS at the grid nodes.
To maintain such functionality, AFE requires available current reserve, i.e., it should not be fully loaded by the active current flowing to the load [23,61]. The AFE control system also requires the implementation of special algorithms to be able to release available current to improve the grid power quality and at the same time maintain normal operation of the ES-15.90 grid motor. Such control algorithms rely on fast and accurate estimation of current and voltage spectrum at the dragline PCC [62].
Dragline's AFE sensors typically include current and voltage sensors per phase at the grid side and voltage sensors at the DC-link side. Based on information from grid-side sensors, it is possible to estimate current and voltage spectra via short-time Fourier transform (STFT). According to Fourier transform, every non-sinusoidal periodical signal can be represented as a sum of sine and cosine waves: To maintain power quality within the acceptable limits, which are regulated according to GOST (acronym for State Standard or Governmental Standard in Russian) 32144-2013, the dynamic compensators are typical to be installed at the nodes depending on the grid and load configuration. The most common device, used to mitigate harmonic currents and rapid voltage fluctuations, is a STATCOM-four-quadrant power converter with a DC-link, a part of flexible AC transmission systems family [60]. While STATCOM is a standalone device for reducing grid power distortions of various factors, its similarity to AFE increases interest in providing the ability to improve the grid power quality by the use of VFD with AFE, which would reduce capital costs to install and maintain STATCOMS at the grid nodes.
To maintain such functionality, AFE requires available current reserve, i.e., it should not be fully loaded by the active current flowing to the load [23,61]. The AFE control system also requires the implementation of special algorithms to be able to release available current to improve the grid power quality and at the same time maintain normal operation of the ES-15.90 grid motor. Such control algorithms rely on fast and accurate estimation of current and voltage spectrum at the dragline PCC [62].
Dragline's AFE sensors typically include current and voltage sensors per phase at the grid side and voltage sensors at the DC-link side. Based on information from gridside sensors, it is possible to estimate current and voltage spectra via short-time Fourier transform (STFT). According to Fourier transform, every non-sinusoidal periodical signal can be represented as a sum of sine and cosine waves: where x p -instantaneous phase-to-neutral voltage; a 0 -DC Fourier coefficient; a n , b n -sine and cosine Fourier coefficients for n-th harmonic; ω = 2πf-angular frequency of the grid voltage, equals to 100π rad/s for f = 50 Hz. Parameters of each harmonic component relate to a n and b n values as follows: where X x -magnitude and phase shift of n-th harmonic in p-th phase; atan2-2argument arctangent.
According to STFT, it is possible to estimate parameters of each harmonic component by accumulating the signal within some observation period-T f : The obtained coefficients a n and b n are substituted into expression (2) to calculate the magnitude and phase shift for each harmonic of the phase voltages or currents [63]. The latency of the STFT algorithm is determined by the observation period of the signal T f . Moreover, if the period of consideration of the signal T f is not equal and/or is not a multiple of the period of the main signal, then there will be a loss of power of the spectrum and the values of the calculated coefficients a n , b n will be unreliable. Thus, the minimum delay of the algorithm based on the Fourier transform will be determined by the period of one oscillation of the mains voltage T f = 20 ms.
To affect grid power quality in the case of the presence of voltages or currents unbalance, it is also necessary to calculate the positive and negative components of each harmonic, which are required to identify and mitigate voltage and current unbalance between phases. This is achieved according to the instantaneous symmetrical components theory [64].
Instantaneous symmetrical components of each harmonic extracted according to: where j90 0 -quadrature operator, which is typically implemented as a digital delay for 1 4 period of the signal; X +(n) , X −(n) -magnitudes of positive and negative components of harmonic. However, as STFT provides information about the magnitude and phase of each frequency components, it is possible to directly calculate X +(n) and X −(n) . To maintain monitoring of grid power quality and take proper control actions, it is necessary to collect information about power flow. Akagi's theory of instantaneous powers suits the most complicated power calculations, which include harmonics and symmetrical components data. According to the theory, active-p, and reactive-q powers can be determined from the instantaneous projections of voltages and currents space vectors onto αβ plane as follows: However, in the case of harmonic distortions, it is useful to distinguish average-p, q-and oscillatory-p, q-components of powers [65]. Average active power p is used to maintain power flow between generators and loads and, in the ideal case, is the only power that makes actual work and should pass through the grid. It is calculated based on the fundamental components of currents and voltages as follows: Average reactive power is used to estimate reactive power flow between power plants and stabilize voltage by injecting or absorbing the reactive power. It is calculated as follows: In a similar way, average powers may be calculated for specific harmonics. Oscillatory components of powers are represented as high harmonics and should be mitigated by the compensators and filters if possible [23]: α .
Based on the described equations, the concept of a multipurpose measurement unit (MU) can be introduced, which collects enough information about power quality at the grid node and transfers it to control devices, such as control systems of VFDs STATCOMs, RPUs et cetera. The structure of the data packet is shown in Table 1: Table 1. Values in the data packet generated by the measurement unit (MU).

Harmonic
Currents Voltages Active Power

Reactive Power
Instantaneous Similar to the 5th harmonic Each data packet will contain 186 values, which equals 744 bytes of payload if each value is considered as a floating-point of 4 bytes. To use the benefit of developed fast algorithms, such packets should be generated by the MU at least every millisecond, which allows to provide proper reaction for transients, improve grid power quality and prevent emergency situations. The considered amount of data leads to approximately 1 MB/s of data produced by one MU. In the case of a reliable connection with decent bandwidth, such a system will work properly. However, if we consider unreliable channels or channels with unpredictable bandwidth, such as 4G or power line communication, it is necessary to reduce the amount of transmitted data and to shift part of calculations to controllers. Depending on the receiving unit and channel bandwidth, it is possible to choose which data to share between the MU and controller. For example, in the worst-case MU can share only average and oscillatory power components per cycle. Considering each value is a 2-byte integer, this is only 400 bytes per second.
The flowchart of the algorithm to operate the proposed MU is shown in Figure 5. The inputs for the algorithm are sampled instantaneous values, measured from current and voltage sensors and passed through an analog to a digital converter (ADC). A typical performance of ADC converters may vary from a few to hundreds of kHz. While 1 kHz (1 measurement per millisecond) is enough for proper operation of MU, operating on higher ADC frequencies allows adding filtering and predictive algorithms. After this, sampled three-phase voltage and currents (6 measurements per cycle of calculations) are transformed into voltage and currents space vectors according to Clarke transform (4,6).  Based on the calculated magnitude of the voltage space vector, the autocorrelation signal is continuously produced. The time between the two most recent peaks of the autocorrelation function is counted and is used to determine the length of the window for Fourier transform. If two peaks are found lesser than in ¼ of the fundamental period ( = 0.02 s for ( ) = 50 Hz), the time between peaks is rounded to the nearest in the series ( ) , ( ) , ( ) … s, which is required to avoid interference of different harmonic components. Then window length is set to value. Otherwise is set to . When window length is set, the consequent Fourier transform is performed for every odd harmonics to extract sine and cosine Fourier coefficients of each harmonic according to (3). Then magnitude and phase of each component are calculated from coefficients according to (2). These values are then used to estimate positive and negative sequence components according to (4) and corresponding active and reactive instantaneous, average and oscillatory components of power (6)(7)(8). The calculated values are used to build a data packet according to Table 1.
The MU collects requests for transferring data packets to other devices in a network segment, therefore, storing requesting devices' addresses in the memory. The data are transferred via protocols for time-critical applications. One of the good examples of such protocol that may be utilized is a precision time protocol (PTP), which allows to synchronization of clocks between devices in a network segment on a microsecond level. The clock master may be selected automatically via built-in algorithms, i.e., best master clock algorithm, or may be selected manually, and therefore, usually nearest controller unit is chosen to be clock master. The PTP is suitable for any IP compatible network via wired or wireless mediums and allows to ensure precise measurements of power quality indicators.
The effective joint operation of the power converters in the distribution grid segment is determined by the possibility of distributing tasks between them depending on their workload according to the active power consumed by the load (16): Based on the calculated magnitude of the voltage space vector, the autocorrelation signal is continuously produced. The time between the two most recent peaks of the autocorrelation function is counted and is used to determine the length of the window for Fourier transform. If two peaks are found lesser than in 1 4 of the fundamental period T f (T f = 0.02 s for f (1) = 50 Hz), the time between peaks T p is rounded to the nearest in the series 1 f (1) , 1 2 f (1) , 1 3 f (1) . . . s, which is required to avoid interference of different harmonic components. Then window length T SV is set to T p value. Otherwise T SV is set to T f

.
When window length is set, the consequent Fourier transform is performed for every odd harmonics to extract sine and cosine Fourier coefficients of each harmonic according to (3). Then magnitude and phase of each component are calculated from coefficients according to (2). These values are then used to estimate positive and negative sequence components according to (4) and corresponding active and reactive instantaneous, average and oscillatory components of power (6)(7)(8). The calculated values are used to build a data packet according to Table 1.
The MU collects requests for transferring data packets to other devices in a network segment, therefore, storing requesting devices' addresses in the memory. The data are transferred via protocols for time-critical applications. One of the good examples of such protocol that may be utilized is a precision time protocol (PTP), which allows to synchronization of clocks between devices in a network segment on a microsecond level. The clock master may be selected automatically via built-in algorithms, i.e., best master clock algorithm, or may be selected manually, and therefore, usually nearest controller unit is chosen to be clock master. The PTP is suitable for any IP compatible network via wired or wireless mediums and allows to ensure precise measurements of power quality indicators.
The effective joint operation of the power converters in the distribution grid segment is determined by the possibility of distributing tasks between them depending on their workload according to the active power consumed by the load (16): where p * GC , q * GC -references for active and reactive powers for grid converter; v DC -DC-link voltage of the AFE; k PI -proportional/integral function of the v DC regulator, which was designed according to [66].
Let us express the instantaneous total power distortion S * GC (17): The total available instantaneous power of the distortion s * GCmax is determined by the load on the active current: where i max -maximum available current through the IGBT module. It is obvious that during the formation of tasks p * AFE and q * AFE for AFE, the condition s * GC ≤ s * GCmax must be satisfied at each moment of time. In this case, it is effective to decompose the signals p * GC and q * GC into separate harmonics p * (n) GC and q * (n) GC , as well as extract the constant component of the reactive power responsible for maintaining the voltage level of the network. Then: In this case, addition by individual harmonics is performed, while the condition s * GC ≤ s * GCmax is met. Overall, the structure of the AFE control system is shown in Figure 6. where * , * -references for active and reactive powers for grid converter; -DC-link voltage of the AFE; -proportional/integral function of the regulator, which was designed according to [66].
The total available instantaneous power of the distortion * is determined by the load on the active current: where -maximum available current through the IGBT module. It is obvious that during the formation of tasks * and * for AFE, the condition * * must be satisfied at each moment of time. In this case, it is effective to decompose the signals * and * into separate harmonics In this case, addition by individual harmonics is performed, while the condition * * is met. Overall, the structure of the AFE control system is shown in Figure 6.  Local MUs send the processed information packages to the controller units as well as to any unit, which requests the information and is allowed to access it. Controllers are placed in accordance with hierarchy, so local controllers produce control signals for endpoint devices, while the main controller maintains the whole surface mine operation [62]. MU are typically placed at each power or protection device, where MU usually measures the voltage at the device's PCC and current going through the device. Typical examples are transformer buses, compensators, VFD. MU usually provides collected information to the local control unit, which depends on the device. For example, for STATCOM, the control system, which operates switches, obtains information from local measurement units.
Let us consider short-circuit at the arbitrary grid node to illustrate the advantages of gathering information by MUs that might trigger control signals for different power devices: control of RPU, control of VFD, control of compensation device, on the example of STATCOM.
RPUs are essential devices that may break fault circuits include power grid branches and segments as well as faulty loads. The most common use case of RPUs is the isolation of circuits with short circuits. Therefore, using the fast estimation of negative sequence voltage according to (4), MU positioned close to RPU may trigger it to isolate circuit with the delay of 10-20 ms, which is much faster than the traditional use of RPUs.
At the same time, information about the negative sequence is to be used by STATCOM to mitigate the negative effects of short circuits for all loads across the grid. STATCOM in 6-10 kV grids is able to partially compensate unbalanced voltages and currents during several periods without severe DC-link voltage fluctuations by injection of reactive and active currents in each phase. If the STATCOM's DC-link is supplied by a constant voltage source, such as a battery or flywheel, the amount of injected active power gradually increases.
The VFD with AR obtaining information about short circuits may produce two main functions. First of all, the control scheme is triggered to maintain low-field operation at the load side of the converter to increase the voltage sag drive-through ability of the drive. At the same time, the grid-side inverter may be used as a local STATCOM device to mitigate short-circuit consequences for loads located nearby.
If we consider the usual grid operation, the information from MUs is to be used by STATCOM and VFDs to improve grid quality by eliminating harmonic currents and stabilize voltage levels by injection of reactive power to the grid nodes. It is also important that the universalization of MUs allows for the production of compensation currents, which will target the source of harmonic and/or reactive currents, therefore, increasing the effect of compensation devices.
According to the proposed control schemes, the power units achieve autonomous operation, as each device carries the local MU, which is able to produce enough information to maintain fault protection and the ability to increase power quality at the load PCC. This, according to the Internet of things (IoT), is considered as operation at the device level. At the same time, the interconnection of MUs and controllers allows introducing the fog level device-master controller (MC) of the power grid, which provides the following functionality to maintain the effectiveness and safety of the open cast mining technological process:

•
Gathering of information from all MUs; • Monitoring situation at every grid node, which has MU installed as well as monitoring loads status; • Distribution of reference signals for compensation devices to effectively stabilize grid voltages across the whole grid and mitigate harmonic currents; • Prediction of escalating the emergency situations, such as short-circuits and according to the reaction by the generating control signals for loads, compensators and RPUs; • Logging necessary part of gathering information as well as sending the whole information to cloud storage.
While the device level provides individual operability of the power appliances, the for level allows optimizing grid power distribution and maintaining necessary power quality at the main step-down transformer buses. Fog level control also allows transmitting necessary analytical data to display at the operators' workstations via SCADA software or web-interfaces. Therefore, complete monitoring of the grid situation is achieved at the fog level. Fog devices usually store logs for several days to a week to achieve a proper response of grid devices and operators for estimated trends.
The cloud level devices are used to store a massive amount of information collected by the MC, which allows analyzing emergency incidents in detail as well as to further optimize the mining process using statistical processing of gathered logs. Cloud level includes backup and analytics servers that are leased from the cloud hosting providers.
The modern development of communication systems allows a sufficient variety of device interconnection approaches. At the device level, the interconnection of MUs and device controller may be used via twisted pairs, optical links, CAN buses, etc. At the same time, protocols to exchange measurement data are also presented in a wide variety: MODBUS, ProfiBus, ProfiNet, standard TCP/IP stacks. However, as it is important to maintain transmission of information packages, as the data calculated by MUs changes at microseconds level, it is advised to use time-synchronized protocols, such as precision time protocol, time-sensitive protocol.
At the fog level, it is necessary to monitor and maintain interconnection topology and hierarchy as well as to maintain guaranteed collecting of all available signals by the MC. Therefore, the main principles here are providing backup data channels and the application of protocols that utilize grid topology. Data channels for transmitting information from MUs to MC and control signals from MCs to device controllers are direct links where possible (typically twisted pair and optical links) and radio communication. However, in the recent decade, the power line communication concept has been significantly developed and is to be used as a backup data channel across the grid. The MC is connected to cloud servers via the leased primary link and one to several backup data links if possible.

Results
Based on the proposed algorithms and described structural features of the monitoring and communications between power devices, aimed to improve grid power quality as well as to mitigate consequences of emergency operation of the grid, the concept of the signal collecting systems in an open-pit mining grid was developed. Its structure based upon the power scheme of the open-pit mining grid node is shown in Figure 7. All digital devices are divided into two groups-MUs and controllers, which are usually work in pairs. For example, MU at the dragline input first sends data to the dragline controller. That pairs form the domains, interconnected and limited by the industrial switching equipment. Devices are interconnected with the optical fiber data link. In the All digital devices are divided into two groups-MUs and controllers, which are usually work in pairs. For example, MU at the dragline input first sends data to the dragline controller. That pairs form the domains, interconnected and limited by the industrial switching equipment. Devices are interconnected with the optical fiber data link. In the case of damaging the cable, the reserve link is always maintained via PLC, however, with significantly lower bandwidth. While optical fiber between MU and nearest controller is operational, MU sends the full amount of gathered and computed data about the power flows, voltage and current spectra.
In the case of malfunctioning of the optical link between the controller and MU, the reserve channel via PLC becomes uplink. As the bandwidth of the PLC link is significantly lower than that of the optical fiber, the devices measure the average bandwidth of the channel and negotiate about the amount of information processed by MU. The whole topology of the grid can be achieved by the use of standard neighbor discovery protocol (NDP), which is perfectly suitable for enterprise networks [67].
All controllers are numbered in the hierarchy, so the controller with a higher available priority always becomes a master controller in negotiations. For example, the controller at the substation has the highest priority number and becomes the master controller. For all negotiating devices, it becomes the clock master to realize time-sensitive protocol throughout the network. At the same time, the master controller (MC) implements links between the MUs and controllers if it is not overridden in a particular controller. Such a scheme provides scalability and the possibility to make redundant connections to provide whole network functionality in the case of MC failure.
To illustrate some of the benefits of the proposed system for monitoring and gathering digital signals, the Simulink model of grid node of open suite mining was developed. Its structure is shown in Figure 8. The main purpose of the model is to demonstrate modes of operation of draglines' VFDs, which are not available with traditional control and measurement systems. The dragline #3 becomes an unpredictable nonlinear load for the grid, which introduces harmonics inherent for diode rectifiers, with a rapidly changing amount of absorbed active and reactive power. Draglines #1 and #2 are able to operate as active filters for such harmonics as well as to stabilize voltage fluctuations if they have enough current reserve to release it into the grid node. However, as draglines #1 and #2 are located at the different grid nodes, they sense the distortions caused by dragline #3 at the different periods of time, which leads to either mutual compensation or uncontrollable overcompensation. This situation is illustrated in Figure 9, where both draglines try to compensate The dragline #3 becomes an unpredictable nonlinear load for the grid, which introduces harmonics inherent for diode rectifiers, with a rapidly changing amount of absorbed active and reactive power. Draglines #1 and #2 are able to operate as active filters for such harmonics as well as to stabilize voltage fluctuations if they have enough current reserve to release it into the grid node. However, as draglines #1 and #2 are located at the different grid nodes, they sense the distortions caused by dragline #3 at the different periods of time, which leads to either mutual compensation or uncontrollable overcompensation. This situation is illustrated in Figure 9, where both draglines try to compensate fifth harmonics as the most dominant, and their AFEs have not enough current reserve to compensate it completely; instead, they try to react to each other's actions.  Figure 9a,b shows the currents absorbed by the draglines #1 and #2. Summary current, absorbed by the substation, is shown in Figure 9c. The spectrum of absorbed current by the substation is shown in Figure 9d-it can be seen that the 5th harmonic reaches a 15% value, which is quite high for 2 VFDs working in the active filtering mode. That is explained by their remoteness from each other's, which leads to dealing with each other's effects rather than working with the harmonic content.
The simplest solution to improve the situation is to distinguish reference currents for the elimination of specific harmonics between devices. Figure 10 shows the result of such reference distribution. The latency introduced by communications between the MU and AFE controllers is simulated as a discrete delay of 1 ms to every external reference produced for each AFE controller.   Figure 9c. The spectrum of absorbed current by the substation is shown in Figure 9d-it can be seen that the 5th harmonic reaches a 15% value, which is quite high for 2 VFDs working in the active filtering mode. That is explained by their remoteness from each other's, which leads to dealing with each other's effects rather than working with the harmonic content.
The simplest solution to improve the situation is to distinguish reference currents for the elimination of specific harmonics between devices. Figure 10 shows the result of such reference distribution. The latency introduced by communications between the MU and AFE controllers is simulated as a discrete delay of 1 ms to every external reference produced for each AFE controller. While dragline #1 deals with the 5th harmonic in the current, dragline #2 handles the 7th harmonic component, as can be seen from Figure 10a,b. Comparing Figures 9d and  10d, it can be seen that in the case of distinguished references, the 5th harmonic magnitude at the substation bus does not exceed 4% of fundamental, in comparison with 15% in the case of local references setup.

Discussion
It was shown that the simultaneous operation of two VFDs partially loaded by the active current in the filtering mode of nonlinear currents does not effectively reduce the current harmonic distortion at the input of the network node, which is a consequence of the oscillatory process due to the overlapping of currents consumed by both joint ventures and subsequent overcompensation in those parts of the electric period, where the form of the current consumed by the network section is closer to the sinusoid and undercompensation on other sites. The curves of the currents consumed by each of the AFEs, as well as the current curve and its spectrum at the input of the distribution network section, are given to form tasks for compensating all distortions ( Figure 9) and separately for compensating the fifth harmonic for AFE #1 and seventh harmonic for AFE #2 (Figure 10). From the obtained graphs, it can be seen that in the first case, there is under-and over-compensation of currents in the lines, which leads to a value of THDi current at the input of the network section equal to 17.42%. In the case of separate tasks for harmonic compensation While dragline #1 deals with the 5th harmonic in the current, dragline #2 handles the 7th harmonic component, as can be seen from Figure 10a,b. Comparing Figures 9d and 10d, it can be seen that in the case of distinguished references, the 5th harmonic magnitude at the substation bus does not exceed 4% of fundamental, in comparison with 15% in the case of local references setup.

Discussion
It was shown that the simultaneous operation of two VFDs partially loaded by the active current in the filtering mode of nonlinear currents does not effectively reduce the current harmonic distortion at the input of the network node, which is a consequence of the oscillatory process due to the overlapping of currents consumed by both joint ventures and subsequent overcompensation in those parts of the electric period, where the form of the current consumed by the network section is closer to the sinusoid and undercompensation on other sites. The curves of the currents consumed by each of the AFEs, as well as the current curve and its spectrum at the input of the distribution network section, are given to form tasks for compensating all distortions ( Figure 9) and separately for compensating the fifth harmonic for AFE #1 and seventh harmonic for AFE #2 (Figure 10). From the obtained graphs, it can be seen that in the first case, there is under-and over-compensation of currents in the lines, which leads to a value of THDi current at the input of the network section equal to 17.42%. In the case of separate tasks for harmonic compensation for each AFE, such processes are not observed, and the THDi value of the current at the input of the network section decreases to 8.16%.
In the simulation, the reference signals are generated for each AFE with the frequency of one electrical period and delayed by 1 ms, which simulates constant delay of using PTP during the transmission of data packets. However, in real hardware, the AFE controller will obtain measurements with different frequencies but with information accurate to the microseconds when the packet was produced by the MU. This allows us to utilize prediction strategies to further reduce the negative effects of communication over long lines. Adaptive strategies of the measurements are to be used in the case of unreliable and cluttered connections, which is a subject of further research.
The results of the simulation highlight the potential benefits of utilizing the proposed approach to develop more complex control strategies for power conditioning units based on data obtained from MUs placed at different grid nodes. However, extending the approach to large-scale grids is expected to raise issues with communicating over different channels while providing low latencies. The simple master-slave hierarchy used in a considered network is to be improved for large-scale applications. Particular application cases of utilizing approach in complex grids require further investigation.

Conclusions
During the study, the approach to fast and accurately determine power quality factors of the three-phase grid was developed. The approach is based on the introduction of a multipurpose measurement unit, which calculates the following qualities from the input current and voltage sensors: magnitudes of each current and voltage harmonics component; symmetrical components of currents and voltages; instantaneous active and reactive powers, as well as powers of specific harmonics and symmetrical components. The novelty of the approach lies in the combination of measurement unit with time-critical protocols, which allows producing packets with timestamp accurate to microseconds and power quality data only necessary for a particular receiving device, which is suitable in the case of low-bandwidth networks or a significant number of communicating devices.
The proposed approach utilizes a simple master-slave hierarchy, which, however, is to be extended in further studies on large-scale grids. To verify the effectiveness of the proposed solution, a computer model of the grid node with two simultaneously operating VFDs was developed in Simulink. The results of the simulation have shown the potential to develop complex control strategies based on the proposed approach, which in the case of separating references for harmonic currents mitigations for simultaneous operating variable-frequency drives with active rectifiers allowed to significantly reduce harmonic distortions of currents flowing into the grid node. Therefore, the proposed structure of the signaling system introducing the IoT concept to a particular open cast mining suite is a viable and flexible solution, which implementation is cost-effective in terms of technological process continuity given the low costs of its implementation. While simulation proves the proposed approach to collect and process power quality data, such an approach is to be investigated on the real hardware, especially in the case of power line and wireless communications.