1. Introduction
The current policy of the European Union in terms of energy efficiency is described in the European Directive (EU) 2023/1791, which imposes a series of measures, including the most accurate assessment of consumption in the context of the use of sustainable sources of electricity production and considering the presence of consumers that can alter the quality of electricity. However, in order to keep the costs low, the use of high-performance equipment is not feasible, due to the very large number of consumers. Considering the above aspects, in the present article, a method of reducing the measurement errors of digital measuring equipment (power meters) and an evaluation of the performance of the proposed algorithm are reported. The method consists in determining the values of voltage and current at the same moment. In most cases, a multiplexer is used at the input of a data acquisition device, introducing an offset between the acquired quantities. The estimation of intermediate values is the objective of this article. In specialized literature, such a method is not currently described, although it is largely used. Different approaches are possible, but in this article, the most intuitive and clear method is presented [
1,
2].
Critical real-time data acquisition and control is an important issue in data acquisition systems. Applications that require real-time control are better suited to external systems than to systems based on plug-in PC boards. For example, a PC system with the MS Windows operating system and an old model computer was used, and considering that case, the subject of this article can be more easily followed. Although Microsoft Windows has become the standard operating system for PC applications, it is an indeterminate operating system in terms of the time required in measurement and control applications [
3].
A “plug-in” board and the LabVIEW programming environment were used in this study. LabVIEW stands out from the usual programming languages thanks to its graphical programming language environment (“G” programming), with all the necessary tools for data acquisition, signal analysis and their presentation. The board used, AT-MIO-16, is a National Instruments manufacturing board (1992), hardware- as well as software-configurable, which has as the main characteristics of 16 analog inputs, two 12-bit DACs with analog voltage outputs, 8 lines TTL-compatible digital signal I/O, and three 16-bit counter/clock channels, provided with RTSI bus (Real-Time System Integration), a system that allows for the synchronization of multiple measurements acquired by means of other AT-type acquisition boards linked on the same highway. This board was chosen to highlight the errors that affect the process of converting analog quantities and use them to determine other quantities [
3,
4,
5].
2. Materials and Methods
Like video adapters, modems, and other types of expansion cards, such as plug-in data acquisition cards, were designed to fit into the computer motherboard slots connected directly to the computer buses. Viewed as a category, plug-in boards offer a wealth of test functions, a high number of channels, high speed, and adequate sensitivity to measure low-level signals, at a relatively low cost.
The implemented data acquisition system was originally a self-powered system that exchanged information with a computer through a standard interface. As an in-house alternative to plug-in boards, this type of system usually offers more I/O channels, a quieter electrical environment, greater flexibility, and speed adapted to different applications.
If high performance is required, the purchase price and installation of the employed system are high; but, for the measurement system presented, both the acquisition board used and the operating system in which it was integrated have a modest price. The choice of the acquisition board first of all involves the choice of the sampling speed of the analog-to-digital converter, which is mainly the one that dictates the price of the acquisition board. Although the board used did not have a high sampling rate, it being only 100 kS/s, this was sufficient to carry out the experiments in compliance with Shannon’s theorem, remembering that the frequency of the network is 50 Hz in Europe. Thus, the distance between two successive samples was small enough to allow for considering a practically linear evolution between two successive moments of the same size. The experimental results indicated a small difference between the direct and the corrected results. The importance of this correction appeared at high powers or when using a sampling frequency lower than the desired maximum frequency by at least 10–20 times [
5,
6,
7].
Due to the fact that the acquisition takes place in different moments on each channel, the determination of the active power, as an average of the instantaneous power values, can be affected by errors. Thus, although the multiplication of the voltage vector by the current vector is performed at the same index, in reality, they are related to different moments in time, offset by a sampling step [
8,
9].
2.1. Equipment Design
The measuring circuit consists of a series of specific elements, some of which allow for comparisons and the avoidance of a dangerous regime for the acquisition board, while others, such as adaptation–attenuation circuits, while others bring the voltage and current from the network to a level acceptable by the acquisition board,
Figure 1.
The currents’ voltages are transformed into acceptable voltages by the board by means of current transformers and resistors connected in the secondary coil. To adapt the voltage levels, resistive dividers were introduced, which provide an unaltered waveform, without additional phase shift, but have the disadvantage of not providing galvanic isolation of the acquisition board from the three-phase network. Rigorous identity between the components on each phase is not required, as a software calibration of the entire assembly can be performed in the first phase. The calibration consists in finding weighting coefficients for each size, so that the displayed value corresponds to the measured value [
9,
10,
11,
12,
13].
2.2. Measurement, Processing, and Display Application
For the application, developed in NI LabVIEW, the connection diagram uses a vector- type processing object, shown in
Figure 2. Data are arranged in six columns. The signals received by the acquisition board are 3 voltages (u1, u2, u3) and 3 currents (i1, i2, i3) in alternate sequence, as shown in
Figure 3 (current moment of sampling is mark by vertical dotted line and voltages and currents are represented grouped, not interleaved). The data sequence that is repeated is u1, i1, u2, i2, u3, i3. To select each column, for digital processing, must use index between 0 and 5. Next step is to scale data, to reach the real value. The data are subsequently processed with or without correction, resulting in a series of quantities (active power, apparent power, reactive power, power factor, cosine of the phase shift). When imposing the frequency of the samples and the number of samples, it must be taken into account that they must be a multiple of 6, to consider a whole number of samples, the same for each size. Since, as shown in
Figure 3, on each channel, the acquisition takes place in different moments, the determination of the active power, as an average of the instantaneous power, can be affected by errors. In order to determine the parameters of interest, it is necessary to carry out some mathematical operations. Some parameters such as powers, phase shifts, different coefficients are determined by mathematical operations. Even if, mathematically, the system is simple to operate, there is the possibility of an impediment caused by physical phenomena [
8]. The voltage sample and the current sample on each line are measured in different moments; however, for a correct evaluation of the instantaneous power, they must be measured at the same time. If a simultaneous sampling data acquisition card is used, the problem is solved, but the commonly used cards (chosen because of their lower cost) allow for sequential sampling [
14,
15].
Because a reasonable sampling frequency was used, the evolution of voltage and current on the same line was considered to proceed according to a linear gradient. This hypothesis was considered reasonable because the samples on the same line were considered to be adjacent [
16].
Of course, other sequences of the quantities of interest can be used, but in order to have close voltage and current on each phase, this arrangement was preferred [
17].
2.3. Algorithm Proposed
In order to make the necessary correction, it is here proposed to use some mathematical evaluations and determine the value corresponding to the considered moment in time.
Figure 3 reveals that between u1 and i1 there was a gap corresponding to one sampling step, but the next value was found after 5 sampling steps. Due to the fact that the acquisition was performed in different moments on each channel, as shown in
Figure 3, the determination of the active power, as an average of the instantaneous power values, could be affected by errors. Thus, although the multiplication of the voltage vector by the current vector was performed at the same index, in reality they were related to different moments in time, offset by a sampling step.
Figure 4 summarizes this sequence.
The order of the samples was as follows: u1 (instantaneous voltage on line 1), i1 (instantaneous current on line 1), u2 (instantaneous voltage on line 2), i2 (instantaneous current on line 2), u3 (instantaneous voltage on line 3), i3 (instantaneous current on line 3).
To determine the equations, a methodology to calculate the intermediate values (a linear variation was approximated over the considered interval) is presented, as shown in
Figure 5. Any method to approximate the signal variation between two successive samples could be used (polynomial, logarithmic, etc.), but due to the small distance between the samples and the ease of calculation, the linear approximation was chosen [
9,
10,
11].
Considering that the signal variations were linear between two successive moments, it is proposed to determine the studied values at the same moment in time by interpolation/extrapolation, obtaining intermediate values, with the necessary changes at the ends of the acquired value vectors.
We could apply the correction even on voltages or currents. We used the following mathematical approach.
Equations (1)–(5) are the voltage correction equations, with variants for interpolation and extrapolation, i.e., Equations (6)–(8) and (9)–(11), respectively.
A and
B are constants, and
tk is the moment in time at step
k.
The order of the samples being u1k, i1k, u2k, i2k, u3k, i3k, if the correction is made for the voltage values, the first n/6-1 values will be corrected by interpolation, and the last value will be determined by extrapolation. If the current correction is performed, the first value is calculated by extrapolation and the rest by interpolation. Since extrapolation involves a less predictable evaluation of the values, it is recommended to use interpolation to determine the required values.
3. Results
The front panel of the application consists in indicators and controls, representing no correction condition [
18,
19,
20], as shown in
Figure 6. Even if the difference with respect to the value of the active power without applying a correction was around 1 W (for the considered load), on a large scale, this component had an influence, becoming significant.
The experimental results were for different sampling frequencies. The reported errors were calculated by relating the uncorrected values to the corrected ones. The quantities for which they were calculated were the sampling frequency, the active power, the apparent power, and the reactive power. The measurements were made for different loads of 1.5, 2, 2.5, and 3 amperes. The load used was of the R-L type (resistance–inductance). There was an inductive phase shift in the circuit of approximately 11–12 degrees (a coiled resistor was used).
Figure 7 and
Figure 8 show the case of errors (vs. sampling frequency, fs) affecting the active power measurement. The errors were computed according to Equation (12). Pmeas is the measured active power, and Pcorr is the corrected active power. Similarly, the apparent power and reactive power errors are outlined. For stability reasons, the measurements were made using the average of ten values for each power.
The small error differences in the case of active power (P) were due to the use of an appropriate sampling frequency. But even when the sampling frequency was adequate, a sampling error existed. A special behavior of the active power was observed at low sampling frequencies. Low sampling frequencies allowed the acquisition board to be more effective (error decrease) in terms of synchronization. The samples were better synchronized, and the acquisition process was more stable than at high sampling frequencies.
The apparent power S had a different shape at all loads (1.5, 2, 2.5, and 3 A) and showed the same behavior. For the apparent power, the errors were practically the same because the RMS values were the same, theoretically, regardless of the sampling frequency. The differences that appeared between the values with or without correction were due to changes in the amplitude of the signals due to the applied interpolation/extrapolation. The error increased significantly at low sampling frequencies, as shown in
Figure 9 and
Figure 10. Without using this correction, the errors became significant in some conditions.
The errors increased with a decrease in the current, because at low currents, non-linearity errors of the measuring chain components also appeared.
We must remember that the acquisition board was chosen with low performance specifically to highlight this error. It is obvious that for acquisition boards with higher performance (higher sampling frequency or lower number of channels), the sampling error is lower.
The last power analyzed was the reactive power, Q, at the same loads (resistive–inductive), as shown in
Figure 11 and
Figure 12. Because of the load applied, with a small reactive component consisting of a shift phase of around 10 degrees, the error was much higher than those previously determined for the other electric power types (active and apparent). The results are very close (seems to be identical, but they are slightly different). If the load had a strong reactive character, the errors would have been inversely proportional, i.e., higher for the active power and lower for the reactive power.
Another important problem was that if there was no correlation between the number of points acquired by the board and the sampling frequency, the first value would be fixed, and the second value would be continuously variable, between 300 and 18,000 Hz. If a certain constant ratio of the two values is not respected, this can be another source of additional errors.
An aspect to point out is the differentiation of the phase shift values, depending on the sampling frequency and the load. The “arccos” trigonometric function was used for the determination of the P/S ratio. The “arcsine” formula could be used to determine the Q/S ratio, but the errors accumulated, the result being affected by larger errors than in the first situation. It is remarkable that after a certain sampling frequency, corresponding to 4000 Hz, the corrected results for voltage and current were overlapping, as shown in
Figure 13 (2 A load) and
Figure 14 (3 A load).
A remark is that the results (phase shift) were affected by the load, changing the slope at each point on the current graph.
4. Discussion
Many types of architecture for systems for data acquisition and control are available, which offers various possibilities of operation, changing the number of channels, the speed, the resolution, the accuracy, and the costs.
Plug-in data acquisition boards are an important category. Like display adapters, modems, and other types of expansion cards, plug-in data acquisition cards are designed to fit into computer motherboard slots.
Viewed as a category, plug-in boards offer a wealth of test functions, a high number of channels, high speed, and adequate sensitivity to measure low-level signals, at a relatively low cost.
External data acquisition systems represent another category of data acquisition systems.
For economic reasons, a common “plug-in” acquisition board was chosen in this work. The first step in the design of such a system was the choice of the acquisition board, depending on its performance and its use. Since the quantities to be measured were known, a plate at an optimal price was chosen. If high performance is required, the purchase and installation price of the employed system is high; however, for the measurement system presented and the performance required, both the acquisition board used and the operating system in which it was integrated were purchased at a modest price. The choice of the acquisition board should be based, first of all, on the sampling speed of the analog-to-digital converter, which is the main factor that dictates the price of the acquisition board. Although the board used did not have a high sampling rate, which was only of 100 kS/s, it was sufficient for the chosen system, where the network frequency was 50 Hz. The maximum order of harmonics that can be visualized is 30–40, respecting Shannon’s theorem. Another problem is the number of input channels available, and their reference mode. The chosen board had 16 input channels for analog signals with a reference, much more than the required 6 channels + a ground channel.
The solution implemented for the acquisition of some quantities from the three-phase system, started from the assumption of a sampling frequency that respected Shannon’s theorem being sufficiently high. Thus, the distance between two successive samples was small enough to be able to consider a practically linear evolution between two successive moments of the same size. The experimental results indicated a small difference between the direct and the corrected results. The importance of this correction appeared at high powers or when using a sampling frequency lower than the desired maximum frequency by a minimum of 10–20 times.
Due to the different moments in time, on each channel, in which the acquisition took place, the determination of the active power, as an average of the instantaneous power values, could be affected by errors. Thus, although the multiplication of the voltage vector by the current vector was performed at the same index, in reality they were related to different moments in time, offset by a sampling step.
To make the necessary correction, a mathematical evaluation was carried out to determine the value corresponding to the considered moment in time. Considering that the signal variations between two successive moments were linear, interpolation/extrapolation to find the intermediate values was proposed as a solution for determining the values at the same moment in time, with a modification.
It was observed, in the case of the active power, that the errors increased with a decrease in the sampling frequency, as shown in
Figure 7 and
Figure 8. It was also found that the errors, when considering the current correction, were larger, due to the fact that the first calculated value was obtained by extrapolation, and the subsequent values depended on it. So, it is recommended to initially determine the values by interpolation and not by extrapolation. In that case, the current correction method to apply would be the one indicated. The errors increased with the decrease in the current, because at low currents, non-linearity errors of the measuring chain components also became visible. The differences that appeared between the values with or without correction were due to changes in the amplitude of the signals due to the applied interpolation/extrapolation.
When representing the active power sampling error, because a predominantly resistive load was used, the effect of reducing the error was observed. With a reactive load, this would be seen in the reactive power. This would be the effect of a better synchronization at lower frequencies and of the use of an integer multiple of the sampling frequency with the number of channels used (six).
5. Conclusions
This article presents a software method by which, using low-cost data acquisition boards, superior performance can be obtained regarding the accuracy of measurements with systems that require the measurement of several quantities and the determination of others based on them. The paper topic is innovative, and the method can be used in various applications. This paper is an original work, completely based on individual research.
For example, by determining voltage and current, the power was calculated (active, apparent, and reactive). If the fact that the reading of the data was not performed at the same time for the two quantities was not taken into account, the result would not be correct. The proposed method is very efficient, the approximation used being applicable, especially, for high sampling frequencies, when a linear variation of the input quantities (voltage, current) can be approximated. Even if the power measurement error and, implicitly, the energy consumed, do not seem great, for a large number of consumers they can lead to significant costs. For example, if on a bill of EUR 20–30, a measurement error causes a calculation error of EUR 0.5, if you take into account the number of electricity meters in a city, it is easy to estimate the difference in costs between those in the invoice and the expenses of the electricity distributor. New rules providing consumers with more accurate and transparent energy bills are coming into force across the EU today. The most important new provisions relate to obligations to present a more accurate and frequent metering of the energy consumed, as well as more transparent billing and access to relevant information.
It is possible to develop research about this topic, comparing the results obtained using the above-described method from different data acquisition boards. Another research topic could focus on substituting the linear interpolation with a non-linear one (a polynomial interpolation, for example) and comparing the results. A third research direction could be to use simultaneously a sampling data acquisition board and classical data acquisition boards and compare the results obtained using the described correction method.