1. Introduction
Nowadays, DC networks are greatly increasing their presence and relevance due to the intense deployment of distributed generation (generally associated with renewable energies) as well as the operation of electronic appliances in microgrids integrating storage devices or bidirectional vehicle-to-grid (V2G) chargers.
However, standardization of Power Quality (PQ) assessment for DC systems is still an ongoing process. Up to now, very few, timid attempts have been developed in this sense, like a recently published technical report [
1], which collected some previous experience in order to make recommendations for standardization of LV DC systems.
On one hand, some efforts have been made to define and measure PQ indices suited for specific purposes such as DC railway systems [
2]. On the other hand, several PQ parameters, adapted from AC PQ definitions, have been proposed to characterize DC systems, such as voltage fluctuations, voltage dips and interruptions, and rapid voltage changes and ripple [
3,
4].
The EMPIR (European Metrology Programme for Innovation and Research) project ‘20NRM03 DC grids’ aimed to contribute to this knowledge by providing additional insights from the analysis of simulations and measurements, as well as test benches for calibration and validation among different partners.
For this purpose, as a first step, some real LV DC grids were monitored to gather a significant amount of data [
5]. As a result of the project, several considerations have been made regarding measuring strategies, and also related PQ parameters have been defined, specifically to be used in such networks that differ from traditional AC power grids [
6].
The obtained results of those measurements have been analysed covering different DC network topologies, such as an experimental smart grid integrating several technologies [
7], a configurable urban microgrid with photovoltaic (PV) generation and LED lights [
8], some joints of electrical vehicles (EVs) and charging stations [
9], and an open parking garage combining PV generation, EV charging stations, and LED lamps [
10].
In all those articles, the initially selected sampling frequency remained fixed for the whole analysis, and no studies were realized in order to evaluate its convenience for the specific desired purpose. Specifically, the contribution of this article is to deal with this important issue due to its impact on the selection of measurement devices and sensors, as well as the size of the required processor and memory needs.
In addition to experimental measurements, some theoretical tests have been carried out, generating laboratory signals that were sampled at 6.4 kHz [
3,
11] or using Wavelets at eight sampling frequencies over synthetic signals with three levels of white Gaussian noise [
12]. In this last case, the analysed frequencies range from 3.2 to 30 kHz.
For a whole period of two weeks, in the monitored DC microgrid firstly voltage signal was continuously recorded at a sampling rate of 200 kHz. Later, this highest frequency was subsampled, with an anti-aliasing filter, into eight additional frequencies: 100, 50, 25, 10, 5, 4, 2, and 1 kHz. The finally obtained database (507 Gb compressed) constitutes the input of the analysed algorithms in
Section 4 and
Section 5.
The remainder of this paper is as follows:
Section 2 defines the DC PQ parameters subsequently used;
Section 3 describes the monitored DC microgrid and data acquisition arrangement;
Section 4 presents initial results for mean and RMS voltage values, after applying DTW analysis; and
Section 5 strengthens these outcomes by their application to voltage event detection.
2. DC PQ Parameter Definition
When evaluating PQ in a DC grid, the first parameter to be assessed should be the value of voltage magnitude. For its calculation, two alternative formulas can be used:
where
represents the voltage sampling values and
N is the number of computed sampling values, which depends on the sampling frequency and the period of calculation or measurement window.
In accordance with the prescription of IEC 61000-4-30 [
13] regarding AC measurements for 50 Hz systems, the time window for these calculations should be established as 20 ms (for event detection), being refreshed every 10 ms (if class A requirements are applied). Later, aggregation periods will be applied over 200 ms (10 times 20 ms windows), 3 s (15 times 200 ms windows) and 10 min (in coincidence with every UTC re-synchronization).
Theoretically, in an ideal DC grid, both results (mean and RMS values) might be identical, but, in the real world, their difference may be used to calculate the value of voltage ripple [
1,
14], which represents a measurement of the deviation of the voltage signal from the average:
In an analogous way, it is possible to define current ripple, and this index was also studied in [
8,
10].
Regarding frequency analysis, analogously to (inter-)harmonic calculation in AC grids, the Fast Fourier Transform (FFT) algorithm at a resolution of 5 Hz (using 200 ms measurement windows) might be suggested for frequencies up to 2 kHz, changing to 200 Hz for higher frequencies up to 150 kHz ([
13,
15]). Some results of applying this analysis in a DC grid were already presented in previously referenced articles [
8,
10].
As a guide, a correspondence list among DC and AC PQ parameters is presented in
Table 1.
4. DTW Analysis
Dynamic Time Warping (DTW) is an algorithm for measuring the similarity between two time series, even if they are not synchronized [
24]. In this work, this tool has been used to compare differences in temporal sequences with different sampling frequencies from the higher (reference) sampling rate in order to have a metric of similarity. Thereby, these results are used to find the effect of downsampling in PQ parameter computation.
In general, DTW is a method that calculates an optimal match between two given sequences, according to the following rules:
Boundary condition: The first index from the first sequence must be matched with the first index from the other sequence, and the last index from the first sequence must be matched with the last index from the other sequence.
Monotonicity condition: The mapping of the indices from both sequences must be monotonically increasing.
Step condition: Every index from the one sequence must be matched with one or more indices from the other sequence, but in this case steps are limited to avoid long jumps (shifts in time) in the path.
The optimal match is denoted by the outcome that satisfies all above conditions and provides the minimum sum value of absolute differences between both sequences. The algorithm gives as a result an optimal warping path.
In this work, the
dtw-python package [
25,
26] was used. The parameter to compute the best match was the warp area, i.e., the area between the warping function and the diagonal (no-warping) path: the lower the warp area the more compatible the compared sequences.
The warp area has been computed using the temporal sequences of mean values and RMS computed in windows of 20 ms every 10 ms, as described in
Section 2. These sequences have been calculated with different sampling frequencies (from 1 to 100 kHz) to see how the warp area behaves when that frequency is decreased.
The sequence introduced to the DTW algorithm was formed by taking one of these values per second in order to have a sequence of 3600 values in an hour. This was performed to reduce the computation time of each DTW invocation, given the very high computational complexity of the algorithm (, where N is the sequence size).
It has to be noted that response times of the effects observed in the events of the microgrid (see
Section 5) are of the order of seconds. For this reason, a time series with values every second is considered representative enough to for the DTW algorithm to be able to reconstruct the temporal sequence without losing information.
To illustrate this technique, two examples of DTW results are presented for 1 kHz (‘query index’) against 200 kHz (‘reference index’) at two different hours that present quite different trends. In
Figure 2, obtained at 7 am UTC, DTW analysis shows a very good correspondence between frequencies; meanwhile in
Figure 3, obtained at 12 pm UTC, DTW analysis shows a clearly worse correspondence between the two.
Consequently, the resulting warp area in
Figure 2 is smaller than the area in
Figure 3. These two different intervals were selected taking into account the temporal grid behaviour described in
Appendix A.
Numerical results of applying DTW algorithm on the mean and RMS voltage are available to be consulted in
Appendix C. The same analysis was also tried for voltage ripple, but the obtained results applying this technique were not significant enough to draw conclusions. A lower variation in this PQ parameter throughout the day made the use of this algorithm more difficult.
The following graphs show the warp area for mean voltage values from sequences at different sampling rates that are computed against the reference frequency of 200 kHz, split in two ranges of sampling frequency: from 1 to 5 kHz (
Figure 4) and from 10 to 100 kHz (
Figure 5).
In a similar way, the warp area on RMS voltage values from sequences at different sampling rates computed against the reference frequency of 200 kHz are presented in two different graphs, spanning the same intervals: from 1 to 5 kHz (
Figure 6) and from 10 to 100 kHz (
Figure 7).
Analysing all previous results, it can be concluded that the DTW correlation among frequencies presents a more scattered behaviour at night than during daylight hours (approx. from 6 am to 6 pm UTC), both for mean and RMS voltage values.
This may be explained under the assumption of white noise presence during the period in which solar panels and DC/AC inverters do not work due to the lack of PV generation. Conversely, the DC bus presents features when the PV generation starts and stops that help the DTW algorithm to find the optimum path.
In addition to this, lower sampling frequencies (around 1 kHz) are clearly insufficient for a proper calculation of these values; intermediate sampling frequencies (5–10 kHz) offer a similar performance, but only higher frequencies (25–100 kHz) guarantee more accurate results.
In
Figure 8, a detail view of mean voltage values at higher frequencies (10–100 kHz) is included just for sunlight hours (6–18 UTC), which are the ones in which the whole set of PV sources and inverters will actually be operating.
Similarly to the mean value case, in
Figure 9 a detailed view of RMS voltage values at higher frequencies (10–100 kHz) is included just for hours considered as real ‘working hours’ due to the coincidence of solar generation and inverter operation (6–18 UTC).
It can be finally concluded that using a sampling frequency of 25 kHz proves to be a very advisable choice when evaluating mean or RMS voltage values, achieving an adequate accuracy without increasing the computing rate unnecessarily.
5. Voltage Event Detection
Voltage events are unpredictable phenomena that may appear due to changes in the balance between generation and consumption or, sporadically, be caused by faults in the electric grid.
Reference international standards address how to evaluate them in AC systems ([
27,
28]) by means of two parameters: duration (difference between starting and ending times) and the maximum or minimum RMS voltage reached during their occurrence.
If the RMS voltage goes over a multiplying factor of the reference value (generally, rated voltage), then the event is called ‘swell’; if the RMS voltage is below a percentage of that reference value, then the event is referred to as ‘dip’ or ‘sag’.
However, dips deeper than a 5–10 % are considered as ‘interruptions’. A hysteresis interval is generally used to avoid counting more than one event when voltage is oscillating close to the corresponding threshold.
The duration of these events may range from just 10 ms to several seconds or even minutes. Anyway, the IEEE standard [
29] renames them, if longer than 1 min (but shorter than 10 min), as ‘undervoltages’ and ‘overvoltages’, instead of dips/sags and swells, respectively.
Considering the usual values presented in [
13] for the analysed DC microgrid, the limits indicated in
Table 2 were set (in this case, the rated voltage is 48 V). These limits are also aligned with the previously mentioned technical report [
1], and were used for another DC grid evaluation in [
30]. However, for its application on the analysed DC microgrid, the mean voltage was used instead of the RMS value.
As it was already said in
Section 4, and previously mentioned in
Section 2, the time window for mean voltage calculations was established as 20 ms and refreshed every 10 ms.
Initially, no dips were detected for a threshold of 90 %, so a threshold of 95 %, which means 45.6 V, was tried later, but again no dips were detected. In contrast, three swells were detected using the referenced threshold.
These results make sense, since during the measurement period mean voltage data ranges from 47.340 V (minimum) to 53.059 V (maximum), presenting an average of 49.439 V and a standard deviation of 1.524 V.
The pseudo-codes for these calculations are presented in Algorithms 1 and 2.
Algorithm 1 Voltage swell evaluation |
function Voltage_swell if then return while do if then end if end while end if end function
|
Algorithm 2 Voltage dip evaluation |
function
Voltage_dip if then return while do if then end if end while end if end function
|
In summary, three voltage events (swells) were captured, as shown in
Table 3.
The profiles of those events are represented in
Figure 10,
Figure 11 and
Figure 12, showing mean values calculated with sampling frequencies of 1 kHz, 2 kHz, and 200 kHz against swell threshold and hysteresis level. As will be noted in the next paragraphs, their different performances explain the observed differences in recorded event characterization.
Characterization of the two different recorded events on Friday 4th of August of 2023, for each selected sampling rate, can be seen in
Table 4 and
Table 5.
In addition, another voltage event was recorded on Monday 14th of August of 2023, whose characteristics can be seen in
Table 6 for each selected sampling rate.
Analysing all above tables, and assuming as ‘conventionally true values’ those obtained for the reference frequency of 200 kHz, the existence of a correlation between resulting errors (both in maximum voltage and duration) and considered sampling rates is definitely clear.
Maximum voltage errors and duration errors in event 1 are presented in
Table 7 and
Table 8, respectively.
Clearly, the maximum errors (absolute differences of voltage and duration) in event 1 are obtained at 1 kHz, reaching 115 mV and 0.3 s. However, at 25 kHz, these errors are drastically reduced to just 2 mV and around 0, respectively.
Analogously, maximum voltage errors and duration errors in event 2 are presented in
Table 9 and
Table 10.
In the case of event 2, the maximum errors at 1 kHz are even higher than those obtained in event 1, resulting in 83 mV and 5.47 s. This clear inconsistency, especially in duration, is caused by the specific profile of this swell, in which there is a rapid recovery curve described by an asymptote bordering the hysteresis level.
This can be observed in
Figure 11, showing the effect of sampling frequency on the event detection due to the use of fewer points to calculate the value of mean voltage, increasing in this way the statistical fluctuation and exceeding the hysteresis level, which causes a significant reduction in the obtained event duration.
Anyway, at 25 kHz, resulting errors are again quite contained: 2 mV in maximum voltage and 20 ms in duration.
Finally, maximum voltage errors and duration errors in event 3 are presented in
Table 11 and
Table 12.
Again, the maximum errors in event 3 are obtained at 1 kHz, reaching 165 mV and 1.12 s. However, at 25 kHz, these errors constitute only 1 mV in maximum voltage and around 0 in duration.
So, in general, the same conclusion obtained in
Section 4 may be reached here: a sampling frequency of 25 kHz is a very advisable option for a proper combination of accuracy and computing rate. Indeed, using 25 kHz instead of 200 kHz may lead to errors far below AC standard [
13] requirements for class A analysers, which are 0.2 % of the rated voltage (96 mV) and 20 ms in duration, as can be confirmed in all recorded events.
6. Conclusions and Future Work
According to the analysis presented in this paper, for a proper assessment of at least PQ voltage parameters regarding RMS or mean values and event detection in the monitored DC microgrid, sampling frequency might be set at 25 kHz as a minimum rate, which represents a proper combination of accuracy and computing rate.
Anyway, it must be noted that the selected sampling frequency may also directly impact the maximum rate of harmonic distortion to be captured. As the Nyquist theorem states, if sampling the signal at a rate of 25 kHz, the maximum frequency to be digitized without aliasing error shall be 12.5 kHz. This should be taken into account if significant spectral components are expected to be present at this frequency and there is a need to evaluate them.
In any case, the same approach presented in this paper might be applied to other measured data in real LV DC grids in order to check the validity and extension of this advice as a general rule for any different topology and condition. Moreover, in addition to RMS or mean voltage values and event detection, other parameters (ripple, transients, voltage fluctuations… and, of course, harmonic distortion) should be also analysed for an appropriate comprehensive processing of PQ phenomena in DC networks.
As future work, the behaviour of the PQ parameters as a function of the temporal window width could be explored. Additionally, a parallel frequency analysis could be carried out in order to better understand and justify the results.