The Actual Exactness of a Fast RMS Correction during Abrupt Voltage Change

The requirement of RMS (voltage and current) measurements under a fraction of the AC period has become increasingly attractive in power systems. Some of these power applications are responsible for voltage stabilization in distribution lines when the voltage correction should be made in a short time, no more than one or two periods of the AC signal. Previously developed RMS correction applications must be validated in real-world situations characterized by an abrupt change (discontinuity) in voltage magnitude occurring even during a single AC period. Such circumstances can substantially influence the RMS estimation and, therefore, should be considered. This article suggests a mathematically based approach, validated in the laboratory, that improves the accuracy of a voltage RMS estimation for the appropriate measurement devices. It produces better results in cases where the RMS assessment should be done in a fraction of the AC period.


Introduction
The presence of private generating facilities, such as PV solar stations and individual generators, causes voltage regulation issues in distribution lines. The influence of fastchanging loads such as those widespread today in the electric grid from electrical vehicles, on the one hand, and stochastically generating plants (PV and wind power stations), together with faults occurring from time to time, produce a significant imbalance between consuming and generating power flows. Together with slow-reacting controllers (tapchangers) of transformers, such circumstances cause poor voltage stabilization, forcing grid managers to temporarily disengage some of the private stations. These situations lead to economic losses and should be prevented.
Numerous examples of research efforts have been made, and several technical solutions have been suggested. Among the suggested solutions, some are based on the usage of electrical storage [1][2][3][4], and some of them apply power flow dispatch at generating facilities [5,6]. Other solutions are based on the utilization of reactive power equipment [7][8][9][10][11][12][13][14]. Considering the influence of the high costs of high-voltage storage, reactive power usage as the voltage regulation model may be preferable among other methods. We have described the application of capacitive reactive power in a previous article [15]. A bank of capacitors connected in a special manner to a load during voltage drops can ensure the correction of voltage deviations during a half-hour AC period. However, the voltage adjustment to the standard level requires fast RMS estimation in a time frame of not more than a quarter of each AC period. In a short period of time, multiple methods for RMS assessments have been reported [16][17][18][19][20][21][22][23][24][25][26].
Muciek A. [16] submitted a method of RMS assessment based on the reconstruction technique of the rectified AC voltage average signals. The author claims an increase in the accuracy of the RMS measurement. Nonetheless, the method in principle employs modernized Fourier analysis, which necessitates a significant amount of computational power and is not always useful. Eduardo G. and Ribeiro E.R. [17] suggested a method for RMS summarizes the authenticity of the study and its results. Section 5 presents the conclusions of the article.

Typical Patterns of Abrupt Voltage Alterations in Distribution Lines
Different types of events that cause sudden voltage changes make it difficult to precisely determine the actual RMS voltage amplitude during one or even one half of the AC period. The method presented in [26] is based on a mathematical description of a strict voltage sinusoidal curve and a correction coefficient obtained as per the requirement to assess RMS only in the periodic portion of the AC signal. However, real voltage curves show frequent non-ideality, sometimes distorting significantly from pure sine waves. These situations are generally caused by sudden load surges or fault events. Illustrations of such events are shown in the figures below. The authors recorded several examples of voltage non-ideality through the study of a specific high-voltage distribution line during the years 2019-2021. The summarized frequency of such events lies between 7 and 10% of the time, and this circumstance demonstrates the need for the enhancement of a voltage RMS estimation as submitted in [26]. Typical examples of voltage distortions are presented in Figure 1a-f. Section 3 shows the results of the accuracy of the RMS assessment method. Section 4 summarizes the authenticity of the study and its results. Section 5 presents the conclusions of the article.

Typical Patterns of Abrupt Voltage Alterations in Distribution Lines
Different types of events that cause sudden voltage changes make it difficult to precisely determine the actual RMS voltage amplitude during one or even one half of the AC period. The method presented in [26] is based on a mathematical description of a strict voltage sinusoidal curve and a correction coefficient obtained as per the requirement to assess RMS only in the periodic portion of the AC signal. However, real voltage curves show frequent non-ideality, sometimes distorting significantly from pure sine waves. These situations are generally caused by sudden load surges or fault events. Illustrations of such events are shown in the figures below. The authors recorded several examples of voltage non-ideality through the study of a specific high-voltage distribution line during the years 2019-2021. The summarized frequency of such events lies between 7 and 10% of the time, and this circumstance demonstrates the need for the enhancement of a voltage RMS estimation as submitted in [26]. Typical examples of voltage distortions are presented in Figure 1a-f.  Figure 1) were considered further for the modeling and mathematical developments of an improved measuring algorithm. All types of voltage discontinuities were analyzed for a common representation and verification of the submitted measurement technology. The appropriate modeling of such voltage distortion will be elaborated on in the next section.

Modeling of Abrupt Voltage Distortion
The voltage distortion is modeled in this work as the inclusion of two voltages with the same frequency but with dissimilar amplitudes and RMS values and acting in series. The switch between these voltages occurs in time t1 from the beginning of some AC period. This time can be expressed as an angle β1. As per the requirement to improve the voltage value in the next AC half-period, the first step is RMS magnitude estimation from time t1 to t2, which corresponds to two angles β1 and β2 (see Figure 2). Since the measurements of an instantaneous voltage magnitude should be finished before the end of the current half-  Figure 1) were considered further for the modeling and mathematical developments of an improved measuring algorithm. All types of voltage discontinuities were analyzed for a common representation and verification of the submitted measurement technology. The appropriate modeling of such voltage distortion will be elaborated on in the next section.

Modeling of Abrupt Voltage Distortion
The voltage distortion is modeled in this work as the inclusion of two voltages with the same frequency but with dissimilar amplitudes and RMS values and acting in series. The switch between these voltages occurs in time t 1 from the beginning of some AC period. This time can be expressed as an angle β 1 . As per the requirement to improve the voltage value in the next AC half-period, the first step is RMS magnitude estimation from time t 1 to t 2, which corresponds to two angles β 1 and β 2 (see Figure 2). Since the measurements of an instantaneous voltage magnitude should be finished before the end of the current half-AC period (angle equal to π), the last point of voltage estimation is designated as β 2 < π. The time from the angle β 2 (t 2 ) to the end of a half-period (t 2 ) is required to decide whether to correct the voltage or not. Such a representation of a voltage distortion reflects the real situation of voltage deterioration and will be used to output RMS expressions. AC period (angle equal to π), the last point of voltage estimation is designated as β2 < π. The time from the angle β2 (t2) to the end of a half-period (t2) is required to decide whether to correct the voltage or not. Such a representation of a voltage distortion reflects the real situation of voltage deterioration and will be used to output RMS expressions. To summarize the above discussion, the modeling of abrupt voltage distortion is provided by two sinusoidal signals having different amplitudes, where the first of them is changed by the second one inside the same half-AC period after implementation of a special phase angle. In this case, the RMS measurements should be ensured by mathematical manipulation of voltage magnitudes within the time from the beginning until reaching a phase angle that is less than the half-period of the AC signal.

Valid Technique of the RMS Estimation after Fast Voltage Alteration
Mathematical expressions providing the RMS estimation of this model are represented below. As per the definition, the RMS value of a voltage between two points of time, t1 and t2, is: where t1 and t2 are the times corresponding to phase angles β1 and β2 in accordance with the relation: = .
It should be emphasized that the RMS value obtained in (1) is not exactly equal to the RMS value of the AC signal having amplitude V1m. The voltage magnitude correction (if needed) requires examination of the RMS from (1) vs. the RMS of a sinusoidal curve with amplitude V1m and the generation of a correcting coefficient for equalizing them. To relate two RMS magnitudes, the expression (1) should be modified. The transformation of (1) generates the expression.
The analysis of (2) provides the magnitude of the correcting coefficient KC, relating one RMS value to another Amplitude, V To summarize the above discussion, the modeling of abrupt voltage distortion is provided by two sinusoidal signals having different amplitudes, where the first of them is changed by the second one inside the same half-AC period after implementation of a special phase angle. In this case, the RMS measurements should be ensured by mathematical manipulation of voltage magnitudes within the time from the beginning until reaching a phase angle that is less than the half-period of the AC signal.

Valid Technique of the RMS Estimation after Fast Voltage Alteration
Mathematical expressions providing the RMS estimation of this model are represented below. As per the definition, the RMS value of a voltage between two points of time, t 1 and t 2 , is: where t 1 and t 2 are the times corresponding to phase angles β 1 and β 2 in accordance with the relation: β = ωt. It should be emphasized that the RMS value obtained in (1) is not exactly equal to the RMS value of the AC signal having amplitude V 1m . The voltage magnitude correction (if needed) requires examination of the RMS from (1) vs. the RMS of a sinusoidal curve with amplitude V 1m and the generation of a correcting coefficient for equalizing them. To relate two RMS magnitudes, the expression (1) should be modified. The transformation of (1) generates the expression.
The analysis of (2) provides the magnitude of the correcting coefficient K C, relating one RMS value to another Sensors 2023, 23, 2117

of 12
The value of V * rms can be obtained numerically by summing the squares of the instantaneous voltage values measured with a specific time resolution from t 1 to t 2 . This procedure is the simplest and is sufficiently accurate for use in an RMS control scheme. Below ( Figure 3) are shown graphs plotting K C vs. angle β 1 for two values of angle β 2 equal to 170 • and 175 • .
The value of * can be obtained numerically by summing the squares of the instantaneous voltage values measured with a specific time resolution from t1 to t2. This procedure is the simplest and is sufficiently accurate for use in an RMS control scheme. Below ( Figure 3) are shown graphs plotting KC vs. angle β1 for two values of angle β2 equal to 170° and 175°. The calculation of the RMS voltage after a fast change should be accomplished by the technique for the RMS estimation performed during the entire AC half-period, including the distorted sine curve. In fact, the closeness of angle β1 to a maximum admissible value of β2 increases the correction coefficient KC and decreases the number of instantaneous voltage points for the RMS estimation. Given the statistical errors of both factors, errors in RMS estimation may be significantly magnified, resulting in the loss of stability of a control system responsible for voltage consistency. Therefore, if a fast voltage change occurs close to the end of the AC half-period, it should change the RMS estimation. This circumstance necessitates an evaluation over the entire half-period rather than just the points measured after the voltage discontinuity.

The RMS Estimation When Fast Voltage Alterations Are Present in a Half-Period of an AC Signal
The formal RMS definition when two different sinusoidal signals are changing relative to one another inside an AC signal after angle α can be presented as follows: After transformation The calculation of the RMS voltage after a fast change should be accomplished by the technique for the RMS estimation performed during the entire AC half-period, including the distorted sine curve. In fact, the closeness of angle β 1 to a maximum admissible value of β 2 increases the correction coefficient K C and decreases the number of instantaneous voltage points for the RMS estimation. Given the statistical errors of both factors, errors in RMS estimation may be significantly magnified, resulting in the loss of stability of a control system responsible for voltage consistency. Therefore, if a fast voltage change occurs close to the end of the AC half-period, it should change the RMS estimation. This circumstance necessitates an evaluation over the entire half-period rather than just the points measured after the voltage discontinuity.

The RMS Estimation When Fast Voltage Alterations Are Present in a Half-Period of an AC Signal
The formal RMS definition when two different sinusoidal signals are changing relative to one another inside an AC signal after angle α can be presented as follows: After transformation where 2 . The graph of the relative voltage RMS because of the angle due to the voltage discontinuity is presented in Figure 4.
The graph of the relative voltage RMS because of the angle due to the voltage discontinuity is presented in Figure 4. In Figure 4, we can see that the closer the switching angle α is to zero, the more influence voltage V2 has on the determination of the entire RMS value. However, this is not a linear relationship, and the influence of voltage V2 grows faster at the beginning of a switching angle than when it is close to the angle π.

Analysis of the Accuracy for the RMS Assessment Method
The accuracy of the RMS assessment plays a significant role in a control system responsible for AC voltage stability. A significant error in the fast estimation of RMS during a half-period can diminish the stability of a control system and lead to an inappropriate oscillation of correcting control signals and a total loss of functionality. The accuracy of the RMS assessment for the complex signal including a minimum of two sinusoids with different amplitudes (see Figure 2) strongly depends on the range between angles β1 and β2. The closer β1 is to β2 the less the number of measured instantaneous voltage points. Additionally, the assessment of a signal's RMS after a voltage discontinuity and, therefore, in the period following this event is dependent on the correction coefficient KC. The RMS is calculated based on the summed squared magnitudes multiplied by KC, whose value is increasing when β1 is close to β2 achieving values of 4-6 and above. Thus, taking into consideration the stochastic nature of voltage measurement errors, the dependence of the RMS deviation from its exact value should be estimated. In principle, a significant error in the RMS assessment can lead to the application of the procedure in Section 2.4 instead of that suggested in Section 2.3.
The accuracy is investigated under the assumption that voltage measurement errors are distributed according to the gamma function. The choice of gamma distribution law was determined for several reasons. First, it is always a positive function, and only positive magnitudes can be obtained in the voltage measurements. Second, it is close to the Gaussian function and is responsible for the description of most stochastic processes, including measurements of electrical parameters. Besides, the gamma function is closer to the Gaussian curve as the dispersion of a group statistic becomes smaller. This situation In Figure 4, we can see that the closer the switching angle α is to zero, the more influence voltage V 2 has on the determination of the entire RMS value. However, this is not a linear relationship, and the influence of voltage V 2 grows faster at the beginning of a switching angle than when it is close to the angle π.

Analysis of the Accuracy for the RMS Assessment Method
The accuracy of the RMS assessment plays a significant role in a control system responsible for AC voltage stability. A significant error in the fast estimation of RMS during a half-period can diminish the stability of a control system and lead to an inappropriate oscillation of correcting control signals and a total loss of functionality. The accuracy of the RMS assessment for the complex signal including a minimum of two sinusoids with different amplitudes (see Figure 2) strongly depends on the range between angles β 1 and β 2 . The closer β 1 is to β 2 the less the number of measured instantaneous voltage points. Additionally, the assessment of a signal's RMS after a voltage discontinuity and, therefore, in the period following this event is dependent on the correction coefficient K C . The RMS is calculated based on the summed squared magnitudes multiplied by K C, whose value is increasing when β 1 is close to β 2 achieving values of 4-6 and above. Thus, taking into consideration the stochastic nature of voltage measurement errors, the dependence of the RMS deviation from its exact value should be estimated. In principle, a significant error in the RMS assessment can lead to the application of the procedure in Section 2.4 instead of that suggested in Section 2.3.
The accuracy is investigated under the assumption that voltage measurement errors are distributed according to the gamma function. The choice of gamma distribution law was determined for several reasons. First, it is always a positive function, and only positive magnitudes can be obtained in the voltage measurements. Second, it is close to the Gaussian function and is responsible for the description of most stochastic processes, including measurements of electrical parameters. Besides, the gamma function is closer to the Gaussian curve as the dispersion of a group statistic becomes smaller. This situation is usually correct and typical for measurements performed by modern devices. The gamma distribution function [27] of any variable x is defined by two parameters, the k-shape parameter (k > 0), and θ-scale parameter (θ > 0), and is represented as follows: where Γ(x) is a gamma-function: Γ(k) = ∞ 0 t k−1 e −t dt. The average value of variable x is determined by x av = kθ, and variance σ x = kθ 2 . Define the time resolution of one instantaneous voltage measurement as ∆t. The typical ∆t-value achievable for high voltage is approximately~10 µs. The total number Sensors 2023, 23, 2117 7 of 12 of points for the 50 Hz signal in the half-period is equal to N max = T 2∆t = 1000. As angle β 1 (the angle of sudden voltage change) increases, the total number of points for RMS estimation decreases. Define σ v as the standard deviation (STD) in each measurement. The STD in an assembly of N-points is However, this STD should be multiplied by the correction coefficient since real voltage assessment is done using the same multiplication. This correction coefficient can be calculated as per (3), and it grows as β 1 approaches angle β 2 . Moreover, during the approach from β 1 to β 2, the summed STD value increases as N decreases. Ultimately, this causes an increase in measurement error and should be avoided. If this error is too great, the RMS assessment should be done according to (2.4).
As an example, the situation with σ v = 10%, ∆t = 10 µs, and β 2 = 175 • was analyzed, and the graph of a relative STD error is shown below. It is worth noting that the angle β 2 = 175 • signifies the 0.5 ms time for the solution if a correction of the RMS of a voltage is done.
A brief analysis of the graph Figure 5 shows evidence of low accuracy after angle β 1 crosses 150 • . Therefore, the acquisition of voltage magnitudes for the RMS estimation when the typical STD of measurement errors is close to 10% can be carried out only until 150 • . The average value of variable x is determined by xav = kθ, and variance σx = kθ 2 . Define the time resolution of one instantaneous voltage measurement as Δt. The typical Δt-value achievable for high voltage is approximately ~10 μs. The total number of points for the 50 Hz signal in the half-period is equal to = ∆ = 1000. As angle β1 (the angle of sudden voltage change) increases, the total number of points for RMS estimation decreases. Define σv as the standard deviation (STD) in each measurement. The STD in an assembly of N-points is However, this STD should be multiplied by the correction coefficient since real voltage assessment is done using the same multiplication. This correction coefficient can be calculated as per (3), and it grows as β1 approaches angle β2. Moreover, during the approach from β1 to β2, the summed STD value increases as N decreases. Ultimately, this causes an increase in measurement error and should be avoided. If this error is too great, the RMS assessment should be done according to (2.4).
As an example, the situation with σv = 10%, Δt = 10 μs, and β2 = 175° was analyzed, and the graph of a relative STD error is shown below. It is worth noting that the angle β2 = 175° signifies the 0.5 ms time for the solution if a correction of the RMS of a voltage is done.
A brief analysis of the graph Figure 5 shows evidence of low accuracy after angle β1 crosses 150°. Therefore, the acquisition of voltage magnitudes for the RMS estimation when the typical STD of measurement errors is close to 10% can be carried out only until 150°.

Simulation of Abrupt Voltage Alterations in PSIM
The improvements to a method for RMS assessment should be initially verified in simulation. This is done by PSIM [28] software, and the appropriate simulating circuit is shown in Figure 6.

Simulation of Abrupt Voltage Alterations in PSIM
The improvements to a method for RMS assessment should be initially verified in simulation. This is done by PSIM [28] software, and the appropriate simulating circuit is shown in Figure 6. The PSIM software can help verify the usefulness of the method. Typical curves of voltage discontinuity inside an AC period are shown in Figure 7. It is worth reminding everyone that the laboratory verification of the method was carried out with a space be-  The PSIM software can help verify the usefulness of the method. Typical curves of voltage discontinuity inside an AC period are shown in Figure 7. It is worth reminding everyone that the laboratory verification of the method was carried out with a space between 220 and 230 V. In this case, the PSIM simulation matched the laboratory tests. In contrast, the simulated voltage distortions were comparable to those observed in real distribution lines. The PSIM software can help verify the usefulness of the method. Typical curves of voltage discontinuity inside an AC period are shown in Figure 7. It is worth reminding everyone that the laboratory verification of the method was carried out with a space between 220 and 230 V. In this case, the PSIM simulation matched the laboratory tests. In contrast, the simulated voltage distortions were comparable to those observed in real distribution lines. PSIM software was successfully used for the simulation of a control system activation for voltage stabilization with a pure sinusoidal signal as well as a signal with voltage discontinuities.

Results
The results of theoretical RMS predictions were verified in laboratory tests. These tests were carried out on special equipment, including a control system for voltage stabilization (Figure 8), which can quickly recognize voltage RMS, a controllable AC power source, and additional devices simulating the functionality of real high-voltage distribution lines and consumer loads (Figure 9). PSIM software was successfully used for the simulation of a control system activation for voltage stabilization with a pure sinusoidal signal as well as a signal with voltage discontinuities.

Results
The results of theoretical RMS predictions were verified in laboratory tests. These tests were carried out on special equipment, including a control system for voltage stabilization (Figure 8), which can quickly recognize voltage RMS, a controllable AC power source, and additional devices simulating the functionality of real high-voltage distribution lines and consumer loads (Figure 9). During experiments, the situations that caused voltage discontinuities to occur inside an AC period were simulated by the special controllable power supply DRTS33 [31]. The control system recognized the RMS magnitude of a signal based on the proposed algorithm, and the results of the estimation were compared with the RMS of a sinusoid in the following AC periods. This comparison provided an indicator of the efficacy of the method. an AC period were simulated by the special controllable power supply DRTS33 [31]. The control system recognized the RMS magnitude of a signal based on the proposed algorithm, and the results of the estimation were compared with the RMS of a sinusoid in the following AC periods. This comparison provided an indicator of the efficacy of the method.
Typical samples of voltage discontinuities that were simulated are shown in Figure  10a-d.  During experiments, the situations that caused voltage discontinuities to occur inside an AC period were simulated by the special controllable power supply DRTS33 [31]. The control system recognized the RMS magnitude of a signal based on the proposed algorithm, and the results of the estimation were compared with the RMS of a sinusoid in the following AC periods. This comparison provided an indicator of the efficacy of the method.

Control system with RMS estimation
Typical samples of voltage discontinuities that were simulated are shown in Figure 10a-d.  Results of RMS accuracy vs. the angle β1 are presented in Table 1 and Figure 11. The accuracy of RMS estimation vs the angle of voltage discontinuity Results of RMS accuracy vs. the angle β 1 are presented in Table 1 and Figure 11. Results of RMS accuracy vs. the angle β1 are presented in Table 1 and Figure 11.  The result of accuracy estimation enabled the development of the algorithm for rapid (during a half of the AC period) RMS assessment in the presence of voltage discontinuities. The algorithm is presented in Figure 12 below. The result of accuracy estimation enabled the development of the algorithm for rapid (during a half of the AC period) RMS assessment in the presence of voltage discontinuities. The algorithm is presented in Figure 12 below.

Discussion
The rigorous requirements for rapid voltage level stabilization in distribution lines motivated the development of appropriate methods capable of providing an accurate estimation of RMS magnitude during a half-AC period. Existing methods that function satisfactorily for a pure sinusoidal signal give less accurate results for signals containing voltage distortions. The authors modified their original model based on voltage discontinuities. The method proposes two segments for describing a distorted instantaneous voltage signal, each of which acts as a different voltage sinusoid. This approach provides the possibility of defining the RMS of the entire signal during half of the AC period only and developing a strict mathematical expression connecting the RMS value with the magnitudes of the voltages in each segment. The improved RMS estimation approach ensures better accuracy and, as a result, takes less time for the voltage level to stabilize. The esti-β critical

Discussion
The rigorous requirements for rapid voltage level stabilization in distribution lines motivated the development of appropriate methods capable of providing an accurate estimation of RMS magnitude during a half-AC period. Existing methods that function satisfactorily for a pure sinusoidal signal give less accurate results for signals containing voltage distortions. The authors modified their original model based on voltage discontinuities. The method proposes two segments for describing a distorted instantaneous voltage signal, each of which acts as a different voltage sinusoid. This approach provides the possibility of defining the RMS of the entire signal during half of the AC period only and developing a strict mathematical expression connecting the RMS value with the magnitudes of the voltages in each segment. The improved RMS estimation approach ensures better accuracy and, as a result, takes less time for the voltage level to stabilize. The estimation error depends on the angle of a voltage discontinuity inside an AC period. When this angle becomes close to~150 • and even greater, the RMS calculation should be modified. The article also suggests methods for RMS assessment in this more extreme situation. However, the accuracy in this case is reduced. When the accuracy of the estimation is insufficient, the correction of the voltage should be delayed until the following half period. Ignoring a correction of low accuracy can cause the loss of control stability and undesirable oscillations of a control signal, which should be avoided. The algorithm for RMS estimation is presented in this work.
The authors intend to continue the improvement of the proposed method to improve its accuracy when the error doesn't exceed 0.5% for a wider range of angles characterized by the presence of voltage discontinuities.

Conclusions
As a result of the presented work, a modified method of fast RMS estimation was proposed and demonstrated. The method was developed on the basis of a strict mathematical procedure that included the modeling of a distorted instantaneous voltage, a description of the RMS of the complex signal having some segments with different sinusoidal amplitudes, and a representation of the algorithm ensuring RMS calculation in the presence of voltage discontinuities.