1 Introduction

One of the basic types of disturbances that occur in the power grid are voltage fluctuations. This is common problem resulting in incorrect operation of loads supplied from the same circuit as the source of the disturbance. If these loads are lighting sources, then voltage fluctuations can cause the obnoxious flicker affecting the psychophysical state of an observer. Although voltage fluctuations are common and dangerous, they are not clearly consistently defined in the literature. An examples of different definitions of voltage fluctuations are given in [1,2,3,4,5,6]. For the purposes of the article, voltage fluctuations were assumed as fast changes of the rms values of voltage with the boundary speed equal to 1% UN/s [7], where UN is the nominal voltage value in the power grid.

For practical measurement of voltage fluctuations in the power grid, the following indicators are used [7]:

  • Maximum and minimum rms value of voltage U(t),

  • Voltage fluctuation indices: the amplitude δU and rate f of voltage fluctuations,

  • Short-term Pst and long-term Plt indicators of flicker,

  • Indicator ΔV10 (eastern countries, e.g., Japan).

However, the existing indicators do not allow: unequivocal identification of the source of disturbance; and the assessment of its character, considering the psychophysical state of the observer of the obnoxious flicker and the operation of loads supplied from the same circuit as the source of the disturbance. The presented problem can be solved by recording the voltage signal and using: wavelet transform [8, 9], Wigner-Ville transform [10], Hilbert transform [11, 12], genetic algorithms [13], or the Kalman Filter [14]. However, at present these methods cannot be used in practical implementations due to the need to store a significant amount of data to implement these algorithms during continuous monitoring of the power grid. In addition, these methods require modification of measuring and recording devices currently used in practice.

The article presents a proposal to solve this problem by recreating the voltage envelope using basic indicators, which in practice are recorded at power grid measuring points. Assuming that voltage fluctuations can be uniquely identified with amplitude modulation without an attenuated carrier, which is correct for a stiff power grid, recreating the voltage envelope is synonymous with recreating voltage variation. The proposed method does not contribute the recreation of the carrier signal, in which information on voltage distortion (higher harmonics) is stored. However, higher harmonics do not cause voltage variation. Hence, to research on the phenomenon of voltage fluctuations, the proposed method is sufficient.

Six novel algorithms have been proposed to recreation the voltage envelope, considering the random operation of the source of disturbance, which differs them from current literature solutions [15,16,17,18,19]. The proposed approach to recreating voltage variation allows:

  • No modification of currently used measuring and recording devices in practice;

  • Implementation of the currently proposed signal analysis algorithms [8,9,10,11,12,13] for the recreated voltage envelope;

  • Automatic identification of voltage fluctuation sources in the power grid using the kernel density estimation [20];

  • Research on the impact of recreated voltage variation on the state of power loads supplied from the same grid as a disturbing load;

  • Verification of connection requirements for new power loads;

  • Conversion of voltage fluctuation indices to short-term flicker indicator Pst or ΔV10 indicator [16,17,18];

  • Post-factum assessment of the obnoxious flicker by different light sources, e.g., incandescent light sources or light-emitting diodes [7];

  • Obtaining information about the operation of a disturbing load, e.g., about the frequency of changes in the state of the disturbance source [16].

2 Basic Parameters Describing Voltage Fluctuations

Basic parameters describing voltage fluctuations are determined for the period of discrimination at the power grid measurement points.

As a standard, the average aggregated rms value of the voltage UAVG, as well as the maximum UMAX and the minimum UMIN rms value are determined for the period of discrimination. On the basis of these values, it is possible to pre-classify disturbances and in some cases it is also possible to recreate the voltage envelope [7].

The next parameters, which are measured in power grid are voltage fluctuation indices, i.e., the amplitude δU and the rate f of voltage fluctuations. The amplitude of voltage fluctuation δU is the maximum or second maximum voltage change δV in the period of discrimination. The rate of fluctuation f is the number of voltage change δV in the period of discrimination. To increase the diagnostic possibilities of these indices, the rate of fluctuation f in selected δU sub-ranges is examined. The increase in subranges allows a more accurate analysis of the phenomenon, however, it also leads to an increase in the memory in which data for the period will be stored. Therefore, in practice, the following δU sub-ranges are used: [1.0, 0.9], (0.9, 0.8], (0.8, 0.7], (0.7, 0.5], (0.5, 0.3], (0.3, 0.1], (0.1, 0), which will be later referred to as: f1.0–0.9, f0.9–0.8, f0.8–0.7, f0.7–0.5, f0.5–0.3, f0.3–0.1, f0.1–0.0 [21]. On the basis of these indices, it is also possible to assess the flicker based on the rate-magnitude characteristics δU = f(f). An exemplary rate-magnitude characteristic δU = f(f) for an incandescent light source is presented in Fig. 1 [15] with a critical curve applied. All points (f, δU) above the curve cause the obnoxious flicker. Unfortunately, in the case of these indices, the presented selection of sub-ranges causes loss of information about the features of disturbing loads in the event that in the next recorded time interval a voltage fluctuation source causing significant voltage changes δV appears in relation to the preceding interval.

Fig. 1
figure 1

An exemplary rate-magnitude characteristic δU = f(f) with a fluctuation boundary [15]

In most countries of the world, the indicators of short-term Pst and long-term Plt flicker, to which relevant normative documents refer, are used to assess voltage fluctuations. Flickermeters are used to measure these indicators, which according to [22] are supposed to reflect the processes taking place on the path: the source of light—the eye—the brain of the flicker observer. Thus, these indicators allows assessing only the psychophysical effects of the flicker observer, omitting the features of the disturbing loads and the their impact on other loads in the power grid. Furthermore, the admissible thresholds Pst and Plt were based on a statistical research for a 60 W incandescent light source  [23] and inform about the occurrence of negative effects in half of the survey people’s, so exceeding the threshold does not necessarily mean that the flicker observer would feel discomfort.

3 Algorithms for Voltage Fluctuation Recreation

All the algorithms presented in the article were based on voltage fluctuation indices (δUf), and measures of voltage rms changes: UMIN, UMAX, UAVG. Although the voltage fluctuation indices (δU, f) give information on the number of occurrences of changes in the rms value and its maximum change in the period of discrimination, they do not provide information about the moment of occurrence of changes, so the voltage fluctuation indices alone do not allow accurate recreation the voltage envelope. Moreover, according to the definition [7], fluctuations do not include slow voltage changes, i.e., the determined voltage fluctuation indices (δUf) include voltage changes with speed above 1% UN/s.

The proposed algorithms have been marked as A1, A2, A3, A4, A5, A6. Input data for individual algorithms, for the studied period of 5 min, are: UMIN, UMAX, UAVG, δU = δVMAX, f1.0–0.9, f0.9–0.8, f0.8–0.7, f0.7–0.5, f0.5–0.3, f0.3–0.1, f0.1–0.0. The adopted amplitudes of changes in individual intervals are presented in Table 1.

Table 1 List of adopted voltage change values for individual δU sub-ranges

All algorithms introduce successive voltage changes in such a way that they oscillate around the average UAVG value and that the sequence of subsequent changes does not exceed the range of UMIN and UMAX changes. In turn, differences in the operation of individual algorithms are given below.

  1. (A1)

    A table has been created in which all changes were accepted in accordance with the assumptions presented in Table 1. Step changes of the rms value (amplitude modulation with a rectangular signal) and even distribution of changes in time were accepted. Then, the change, the index of which in the table is randomly selected in accordance with the uniform distribution, is entered with such a sign that the mean value at the time of change introduction is as close as possible to the measured value UAVG. The only exception is when the change would cause going beyond the scope of [UMIN, UMAX], then the change is made so as not to leave the accepted range of changes.

  2. (A2)

    Two tables were created. In one table there are changes from the interval (0.1,0.0)δU, considered as “background” (minor fluctuations). In turn, the second table contains the remaining voltage fluctuation. Step changes of the rms value (amplitude modulation with a rectangular signal) and even distribution of changes in time were accepted. Due to the fact that the number of changes (0.1,0.0)δU is often much larger than changes from the remaining range, it was assumed that subsequent changes will be introduced in the cycle: one change from the table [1.0, 0.1]δU, k changes from the Table (0.1, 0.0)δU, where k is the rounding down the number of changes (0.1, 0.0)δU divided by the number of changes [1.0, 0.1]δU. When k is zero or is undefined, changes are introduced alternately from both tables. In addition, changes are introduced in three phases: in the first phase changes are introduced as positive, in order to reach the nearest UMAX value, in the second one the changes are introduced as negative to reach the nearest UMIN value, and in the last phase changes are introduced in the same way as in A1. In contrast to A1, the changes are not randomly selected, but are selected (by searching the table) in such a way that the assumptions of each phase are met (comparing successively introduced changes in voltage with the absolute value of the UMAX difference and the final value of the reconstructed envelope and with the analogous absolute value in relation to UMIN).

  3. (A3)

    Voltage changes are introduced analogously to A1. However, trapezoidal changes in the rms value of voltage have been assumed, and the introduced changes take place with different time steps (see Fig. 2) using the first-degree Lagrange polynomial interpolation. The time step dt1(i) is determined assuming a constant speed of voltage changes SR = 300% UN/s, where UN is the nominal voltage value in the power grid. In turn, the time step dt2 is determined as the difference between the period of discrimination (5 min) and the sum of time steps dt1(i) for all registered changes, divided by the number of changes.

    Fig. 2
    figure 2

    An example of a fragment of the envelope obtained using the algorithm A3

  4. (A4)

    The introduction of voltage changes takes place as in A2. Trapezoid voltage changes and a variable time step were assumed in the same way as in A3.

  5. (A5)

    The introduction of voltage changes takes place as in A1. Trapezoid voltage changes and a variable time step were assumed in the same way as in A3, with the difference that dt1(i) is determined based on the variable speed of voltage changes SR. Different values of the rate of change in voltage are randomly selected from the gamma distribution with a shape parameter equal to 300/0.7 and a scale parameter equal to 0.7. The distribution was chosen because of the support, explicit equation of the mean, mode and variance, and the shape of the distribution.

  6. (A6)

    The introduction of voltage changes takes place as in A2. Trapezoid voltage changes and a variable time step were assumed in the same way as in A5.

In addition, the quality of voltage variation recreation by the proposed algorithms was compared with actually the best literature solution [15,16,17,18,19], which has been marked as AR [15]. Description of the algorithm AR operation is given below.

  1. AR

    The algorithm use the fluctuations alternately when it comes to amplitude: first all of the fluctuations of f0.1–0.0 rate are used, then the fluctuations of f1.0–0.9 rate, and subsequently f0.3–0.1, f0.9–0.8, f0.5–0.3, f0.8–0.7 and f0.7–0.5 in that order. The values of voltage changes were adopted as the upper limits of individual sub-ranges. It has been assumed that the rms value should oscillate around the rated value of voltage. For this purpose, the subsequent changes of voltage are introduced in a way which directs the resulting rms value of modulated signal to the rated value—if it is currently greater than the rated rms value, the next change will be introduced with minus sign; if its smaller than the rated value, the next change will be introduced with plus sign. This algorithm introduces subsequent changes evenly in the whole registration period—despite the amplitude the subsequent changes of voltage are added with the same time span. The span is the result of division of total number of seconds in registration period by the total number of fluctuations detected within the registration period [15].

4 The Exemplary Results of Voltage Variation Recreation

The same criteria as in [15] were selected to assess the quality of algorithm operation. As test signals were selected deterministic sinusoidal signals (carrier signal) with rectangular amplitude modulation (without an attenuated carrier), which are described by equation:

$$u(t) = u_{c} (t) \cdot \left[ {1 + u_{\bmod } (t)} \right],$$
(1)

where uc(t) is the carrier signal described by equation:

$$u_{c} (t) = \sqrt 2 U\sin \left( {2\pi f_{c} t} \right),$$
(2)

and umod(t) is the modulating signal described by equation:

$$u_{\bmod } (t) = \frac{1}{2}\frac{\Delta U}{U}\frac{1}{100}\text{sgn} \left[ {\sin \left( {2\pi f_{m} t} \right)} \right].$$
(3)

Based on Eqs. (1)–(3), the modulation depth (ΔU/U) is determined by equation:

$$\frac{\Delta U}{U} = \left( {\hbox{max} \left[ {u_{\bmod } (t)} \right] - \hbox{min} \left[ {u_{\bmod } (t)} \right]} \right) \cdot 100\% .$$
(4)

In the real power grid, the voltage may be distorted, so the carrier signal can be non-sinusoidal. However, in this case, higher harmonics are occurred that do not cause voltage variation. Also, the modulating signal can be non-rectangular signal. However, the rectangular modulating signal causes the most “obnoxious” flicker [24], so it was chosen for research (as in [15]).

For the generated signals, the basic indicators presented in Sect. 2 were measured. The Pst indicator and the instantaneous flicker Pinst were selected as the reference value, which allow assessing the correctness of the operation of individual algorithms. In the research were adopted the same test series as in [15], allowing comparison the presented algorithms with existing literature solutions. Thus; the first measurement series was created using amplitude modulation with constant modulation depth, i.e., (ΔU/U) it was equal to: 0.827% (Fig. 3), 1.405% (Fig. 4), 2.756% (Fig. 5), 8% (Fig. 6). In the second series, the modulation depth was changed, so that for each modulation frequency fm the constant Pst indicator was obtained, which was equal to: 0.8 (Fig. 7); 1.2 (Fig. 8); 3 (Fig. 9); 5 (Fig. 10). In the third measurement series, the modulation depth was changed while maintaining a constant value of fm equal to 0.2 Hz (Fig. 11), 10 Hz (Fig. 12), 20 Hz (Fig. 13). The analysed frequency of modulating signal fm include range of the obnoxious flicker. For each case, the Pstc and Pinstc were determined by supplying the AM modulated voltage with using recreated voltage envelope by the considered algorithms to the IEC flickermeter. Using Pstc, the characteristics for normalized value of the indicator Pstc/Pst were determined, which should always be equal to 1 in the case of the ideal operation of the algorithm. Using Pinstc, the characteristics of the average instantaneous flicker recovery error δPinst were determined according to the dependence:

$$\delta P_{\text{inst}} = \frac{1}{N}\sum\limits_{n = 1}^{N} {\frac{{\left| {P_{\text{inst}} (n) - P_{\text{instc}} (n)} \right|}}{{P_{\text{inst}} (n)}} \cdot 100\% } ,$$
(5)

where N is the number of samples in the measurement interval. The error δPinst should always be equal to 0 in the case of the ideal operation of the algorithm. Because the graphs partially overlap, the line of individual waveforms cannot be observed.

Fig. 3
figure 3

Pstc/Pst = f(fm) (top) and δPinst = f(fm) (bottom) characteristic for (ΔU/U) = 0.827% = const

Fig. 4
figure 4

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for (ΔU/U) = 1.405%  =  const

Fig. 5
figure 5

Pstc/Pst = f (fm) (top) and δPinst =  f(fm) (bottom) characteristic for (ΔU/U) = 2.756%  =  const

Fig. 6
figure 6

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for (ΔU/U) = 8% =  const

Fig. 7
figure 7

Pstc/Pst= = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for Pst = 0.8 =  const

Fig. 8
figure 8

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for Pst = 1.2 =  const

Fig. 9
figure 9

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for Pst = 3 = const

Fig. 10
figure 10

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic for Pst =  5 = const

Fig. 11
figure 11

Pstc/Pst = f(Pst) (top) and δPinst = f(Pst) (bottom) characteristic for fm= 0.2 Hz  =  const

Fig. 12
figure 12

Pstc/Pst =  f(Pst) (top) and δPinst =  f(Pst) (bottom) characteristic for fm = 10 Hz  =  const

Fig. 13
figure 13

Pstc/Pst = f (Pst) (top) and δPinst =  f(Pst) (bottom) characteristic for fm = 20 Hz  =  const

Additionally, the correctness of the simulation was verified by laboratory studies, which were carried out for several selected points. These studies were carried out using: Picoscope 5444D generator/oscilloscope, CHROMA 61502 generator/amplifier, PQ BOX 100 power quality analyser. The block diagram of the measuring system is shown in Fig. 14. The results of experimental studies also were normalized to the Pstc/Pst and δPinst, and were marked with “dots” on the individual characteristics.

In the considered cases, the characteristics have been limited to a modulation signal frequency fm equal to 20 Hz, because the accurate of the algorithms for higher fm rapidly decreases, as shown in Fig. 15. This phenomenon results from the voltage indices calculating based on the rms value of voltage, determined every half-period, so some information for high-frequency modulation is lost [25]. However, the most disturbing loads change their operating state with a frequency less than 20 Hz, except chaotic loads (e.g., arc furnaces) and power electronic devices.

Fig. 14
figure 14

The block diagram of the measuring system

Fig. 15
figure 15

Pstc/Pst = f(fm) (top) and δPinst =  f(fm) (bottom) characteristic, which shows a rapid increase error value for fm greater than 20 Hz

Based on the characteristics shown in Figs. 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 13, when the frequency of the modulating signal fm is less than 20 Hz, then the algorithms A1 and A2 allow the best recreation of the voltage envelope, because for the pre-set signal and recreated signal was obtained a comparable short-term flicker indicator Pst. In the worst research conditions, the error of recreation for these methods is no more than 5%, and in the range of typical voltage changes is no more than 0.01% (based on the characteristics of Pstc/Pst= f(fm)). The algorithms A1 and A2 allow more accurate recreation of the voltage envelope, compared to other literature solutions [15,16,17,18,19], including the algorithm AR.

Significantly worse results were obtained with other algorithms, i.e., A3, A4, A5, A6. In the case of these solutions, an increase in the modulation depth is resulted in a decrease in the accuracy of the obtained result. With a constant modulation depth, along with the increase of the frequency fm, the accuracy of the obtained result increases up to a certain limit frequency, the exceeding of which causes a rapid decrease in the quality of the recreation of the voltage envelope. In addition, the obtained Pstc values for these algorithms were always smaller than the measured Pst values. The error tendency of voltage variation recreation results from the adopted assumptions, because the increase in the depth of modulation or frequency fm results in the change of the shape of recreated voltage envelope from the trapezoidal to the triangular. In turn, it results from [24] that the voltage modulated by a triangular signal causes the significant lower “obnoxious” flicker than modulation of the rectangular or trapezoidal signal. Therefore, to enable correct operation of these algorithms, it is important to measure the real speed of voltage changes. Furthermore, for the algorithms A4 and A6, it is also important to determination the standard deviation of the measured speed of voltage changes SR. The idea of these algorithms is based on real cases in which the change of the rms value of voltage is not always step change, e.g., when large motors are equipped with a softstart system. Considering the results of the simulation, it can be concluded that the quality of solutions obtained using the algorithms A3, A4, A5, A6 generates smaller errors than the existing literature solutions (error less than 5%), but only for small values of modulation depth in the narrow range of the modulation signal frequency fm.

Because the research aims to solve a practical problem, the quality of the presented algorithms was also verified based on real measurements from the sewage pumping station power circuit, where voltage fluctuations and data required to implement presented algorithms were monitored over a week. For the algorithms used, the error is usually no greater than 5%. The smallest error was achieved using the probabilistic algorithm A5, which considering: the random operation of voltage fluctuations sources, and different speeds of voltage changes SR. The recreation of the voltage envelope based on voltage fluctuation indices allow estimation: the time interval in which the disturbing load operated; the level of disturbances it generates; and the frequency of its operation [26, 27]. The exemplary results obtained for the 5-h interval are shown in Fig. 16.

Fig. 16
figure 16

Exemplary Pstc/Pst = f(t) characteristic obtained for the tested supply circuit of sewage pumping stations

5 Conclusion

In the article, the innovative algorithms allowing recreation of voltage variation (the voltage envelope) using parameters measured in the power grid have been presented. The correctness of the operation of individual algorithms has been verified based on the indicator of short-term flicker Pst obtained from measurements.

The simulation studies show that the algorithms A1 and A2 have the best properties. Both of them achieved much better accuracy than other algorithms available in the literature, because the error was not greater than 5% (based on the characteristics of Pstc/Pst= f(fm)). The remaining algorithms achieved satisfactory accuracy only at a low modulation depth in the narrow range of the modulation signal frequency. The inaccuracy of these algorithms is the result of the lack of information about the real average speed of voltage changes and its standard deviation, which is resulted in distortion of changes shape in the rms value of voltage at time. Obtaining information on the speed of voltage changes SR in the real power grid would make the algorithms A3, A4, A5, A6 more useful.

In the case of real circuit analysis, the recreation error for all algorithms was not greater than 5% usually, and the smallest error values were obtained for the probabilistic algorithm A5. The inaccuracy for considered algorithms is resulted from the accepted limit value of the speed of voltage changes SR, for which voltage changes are classified as voltage fluctuations, because the voltage fluctuation indices used to recreation the voltage envelope do not include slow voltage changes, which can cause obnoxious flicker. However, an example of the application of individual algorithms on the real object, which is the supply circuit of sewage pumping stations, confirms the usability and accuracy of the proposed algorithms.

It is worth noting, that in laboratory studies (A1, A2) the best accuracy was obtained using a different algorithm than in the practical situation (A5). In practice, the speed of voltage changes SR is not constant. In addition, voltage changes are caused by random operation of the source of disturbances, which does not always have to result in rapid changes in the rms value of voltage in the power grid. Probabilistic operation of the algorithm A5 considers these situations. Hence, algorithm A5 has obtained better accuracy in a real case. The recreating of these conditions in laboratory studies is a difficult task. Therefore in practice, modelled voltage fluctuations in laboratory studies were deterministic signals with constant speed of voltage changes SR. Therefore, the smallest errors in laboratory studies were obtained for the algorithms A1 and A2 with a constant speed of voltage change SR.

For recreated voltage envelopes using the proposed algorithms, higher errors were occurred with the estimation of instantaneous flicker Pinst than with the estimation of Pst, because the coding of voltage variation to voltage fluctuation indices is lossy coding. During coding, information about the shape and time of occurrence of voltage changes in the discrimination period is lost.

Although the accuracy of algorithms recreating voltage changes in relation to other algorithms available in the literature has been improved, it is still limited to voltage fluctuations whose source does not change its operating state with a frequency greater than 20 Hz. Improvement of individual algorithms that would allow the research on all sources of voltage fluctuations is further studies of the authors, e.g., creation of a new method for estimating a modulating signal with a higher frequency than the carrier [28]; or creating a wireless measuring and recording device enabling measurement of the average value and standard deviation of the speed of voltage changes [29]. It is expected that the obtained results would allow for automatic identification and analysis of voltage fluctuation sources in the power grid with radial topology, to remove the disturbance that they emit [30].