1. Introduction
In many developing nations, a reliable power supply is a major concern and maintaining power quality (PQ) is of least priority. Although PQ issues have existed since the end of the 19th century, the severity and frequency of occurrence have increased recently because of the advent of modern power electronic devices in the distribution system. According to Brookings India’s report [
1], the distribution sector in India is the weakest link in the power industry in terms of financial and operational sustainability, and poor PQ is one of the primary reasons for it. The monitoring and regulation of PQ is a big challenge for utility operators. Thus, the PQ is neither measured nor maintained by the utility companies for LV domestic consumers.
Interestingly, nowadays consumers have realized the impact of poor PQ and are willing to pay higher tariff prices for a good quality power supply [
2]. The consequences of poor PQ include fluctuations in the supply voltage, which causes a flicker phenomenon in domestic lights. This flickering causes a sensation of irritation to human eyes. In addition, oscillatory and impulsive transients or surges cause damage to computers and electronic loads [
3]. Voltage sag and swell also degrade the performance of electromechanical devices like fans and motors [
4]. These PQ disturbances not only affect the consumers but also damage utility equipment. For example, modern consumer loads are rich in harmonics, which can cause distribution transformers to get overheated and even saturated in worst-case scenarios due to the DC offset. Harmonics in the consumer load current also cause the overheating of supply cables and shortens their life [
5]. According to a European PQ survey [
6], around 150 billion Euros of financial losses per year have occurred in EU-25 countries because of PQ disturbances. The Asia Power Quality Initiative’s latest report on the PQ regulation policies of India [
7] declared that Indian utilities have a robust system for frequency regulation and reliable supply. However, PQ issues such as voltage variations, transients, and harmonics are not dealt with well. Hence, both the grid and consumers suffer and tolerate the consequences of poor PQ. Therefore, PQ monitoring and regulation are indispensable for utilities in modern smart grids.
The PQ regulation of an entire distribution system can be achieved with an appropriate PQ monitoring infrastructure and the introduction of a PQ-based tariff for LV distribution consumers. There is a need to initiate the penalty or incentive pricing mechanism based on PQ levels. The penalty and incentive price for reactive energy and harmonic pollution can be obtained based on the techno-economic features of poor PQ [
8]. There have been several approaches in the literature to design a tariff based on the PQ level. Countries such as Belgium, Singapore, the USA, the UK, Portugal, Germany, Austria, the Philippines, and Poland have adopted reactive energy tariffs to reduce losses in their distribution systems [
9,
10,
11]. In India, a few state electricity regulatory commissions impose a penalty to industrial consumers for reactive power violations and harmonic distortions, but these penalties have not arrived considering the techno-economic aspects of PQ violations. For instance, in the Tamil Nadu state distribution network, the consumers are liable to pay the penalty for harmonic distortion at 15% of the energy tariff [
7]. Here, the penalty is fixed and is not imposed based on the amount of harmonic distortion caused. This flat penalty scheme shows a lack of consideration of techno-economic consequences of the harmonic injection while imposing the penalty. A tariff scheme is proposed in [
12] based on reactive energy for domestic consumers and presents the utility’s saving for the same. This approach, however, focuses majorly on capital cost recovery, and these cost coefficients are calculated empirically. Few other tariff schemes [
13,
14] give reactive energy incentives based on power factor, active power, or reactive energy, but all the incentive coefficients are determined empirically. The available PQ-based penalty schemes are aimed at 11 kV consumers, and such mechanisms are not in practice for LV domestic consumers.
Implementing a PQ-based penalty/incentive scheme for LV domestic consumers requires a smart meter infrastructure for each consumer. Conventional digital or smart energy meters are specifically designed to measure specific basic parameters like power, energy, and power factor, etc. They cannot be used as such for the implementation of a PQ-based tariff scheme due to hardware and software limitations. The PQ meters should have some additional features like a sampling of voltage and current at higher rates, simultaneous sampling, noise reduction, signal processing, and handling of more data. Commercially available PQ analyzers have these features, and they assess PQ parameters such as voltage RMS, fundamental RMS, total harmonic distortion (THD), power factor, and imbalance. These PQ analyzers are sophisticated and are used mainly by engineers, electricians, and technicians to record and diagnose electrical components or sites [
15]. Unfortunately, they are expensive and unrealistic for a utility company to mount at each domestic consumer’s home for PQ metering directly. Besides, it is not easy for domestic consumers to read such complex meters and interpret the quality of the power they receive. Therefore, it is necessary to develop a user-friendly smart meter with both active energy and PQ metering functionalities. In addition, the meter should be versatile, interface friendly, easy to understand, and affordable.
Recently, a lot of interesting research has been carried out in the field of PQ-based smart meters. A few of those meters are reviewed here to study their limitations and design a better meter that can satisfy all the practical implementation needs. The design considerations and desired features of a PQ-based smart meter are suggested in [
16]. It lays a good foundation for the design of the meter. However, it is a conceptual design with less emphasis on practical design and implementation aspects. Another article, [
17], demonstrates a smart PQ meter for domestic consumers that measures PQ indices and events related to voltage and frequency. However, it does not measure or monitor the consumer current. In addition, it needs an external computer and lacks the integration of energy metering functionality. Therefore, a separate hardware and energy metering device are required to accomplish the required functionalities of PQ and energy metering. Authors in [
18] have proposed an Ethernet-based smart meter for PQ monitoring, which utilizes the LabVIEW software to assess the voltage quality. It includes a load scheduling functionality for PQ improvement in real-time. This meter also requires an external computer to run LabVIEW and does not measure distortions in the consumer current. A stand-alone smart meter proposed in [
19] can detect voltage sag and swell, frequency of the supply, and power factor under linear load conditions only. However, it is suitable neither for measuring the harmonic distortion in both the voltage and current for the power-electronic energized loads nor the displacement power factor (DPF). In [
20], the authors developed a Raspberry-Pi-based smart meter, which cannot measure consumer current distortion. An open-source Raspberry-Pi-based PQ analyzer presented in [
21] measures the voltage parameters only. Moreover, the usage of Raspberry Pi is redundant and expensive and has a relatively higher power consumption.
A multifunctional smart meter in [
22] has both energy and basic PQ metering capabilities and anti-theft features. However, it lacks the consumer current quality assessment functionality. A sophisticated FPGA-based PQ monitoring system proposed in [
23] is complex and needs an external computer running LabVIEW. Another FPGA-based smart energy meter presented in [
24] can be used as a stand-alone device for domestic applications. Nevertheless, this is a very complex system and is not cost-effective for domestic applications. It could be concluded that the FPGA and Raspberry-Pi-based smart meters are not stand-alone and affordable for domestic PQ monitoring applications.
Furthermore, in recent years, there have been a few data privacy concerns raised with smart meters. In some cases, smart meters can gather small pieces of information over short intervals and, therefore, give a detailed picture of which appliances are being used. This breach can lead to identifying specific characteristics that reveal information about a home’s socio-economic status, dwelling, and appliances, posing a significant threat to consumers’ privacy [
25]. Data management becomes central to the development of AMI; therefore, some institutional changes are indispensable [
26].
The aforementioned and a few commercially available smart PQ meters lack the features listed in
Table 1. They are neither compact nor stand-alone. Additionally, they do not communicate to the server in some instances or end up being much too complex and thus expensive. The most important observation is that these meters do not have the required hybrid metering functionalities of energy and PQ metering. Therefore, there is a need to develop an efficient, low-cost PQ-based smart meter that has both energy and load PQ metering functionality.
This paper presents a novel PQ-based tariff scheme based on the techno-economic consequences of consumers’ reactive power and harmonics profiles. It imposes a fair penalty to consumers for their harmonic injection and gives them compensation for harmonic distortion in the grid voltage. The reactive energy penalty/incentive for consumers is defined based on PF limits. We designed and developed a low-cost, stand-alone smart PQ meter to efficiently implement the proposed single-phase tariff scheme. It communicates to the server quickly for data logging and implements the proposed tariff scheme.
2. Methodology
The PQ monitoring at each consumer location and penalizing for violations would help regulate PQ in the active distribution network. The following PQ-based tariff scheme is proposed for LV consumers to meet the objective.
This tariff scheme calculates penalties or incentives based on domestic consumers’ reactive and harmonic energy profiles. This cost would be additional to their active energy cost and would be accumulated for short intervals of 10 min (settling window). The flowchart shown in
Figure 1 illustrates the computation of the total penalty/incentive for a consumer. The first term, ‘
a’, represents the fixed cost component of the tariff, which accounts for the costs related to the smart meter upgradation and operational and maintenance charges of ancillary services. The second term represents a penalty for violating power factor limits of 0.9. This limit is chosen as per the IEEE recommendations [
27]. Here, ‘
b’ is a penalty price for low PF (
$/kVARh), and
WQLPF is the reactive energy consumption at low PF (
kVARh). The third term is the penalty to the consumer according to their harmonic pollution, where ‘
c’ is the harmonic injection price (
$/
kVAh) and
WHckVA is the nonfundamental or harmonic apparent energy (
kVAh) injected by the consumer. The fourth and the last term is an incentive to the consumer due to grid harmonic distortion, where ‘
d’ is the harmonic incentive price (
$/
kVAh) and
WHukVA is the nonfundamental or harmonic apparent energy (
kVAh) absorbed by the consumer due to the grid distortion. The index THD is chosen to verify the harmonic limit violation, and if violated, the penalty is based on the harmonic apparent energy. The THD of voltage and current are set to 5% in this work. However, these limits can be adjusted according to the recommendations of network operators and regulatory commissions. The value of
d is chosen to be equal to the penalty price coefficient
c. Thus, the consumer is penalized for the harmonic injection and given a compensation for distortion because of the grid voltage at the same price. This penalty/incentive tariff promotes good behavior from the consumer and utility and helps improve good practices for PQ regulation. The price coefficients
b,
c, and
d are determined based on the techno-economic consequences of the consumer’s reactive power and harmonic injection to the utility [
28].
3. Hardware Description
To implement the proposed PQ-based tariff, a hardware setup of the smart PQ meter has been developed. The experimental setup of the meter and its PCB schematic are shown in
Figure 2 and
Figure 3, respectively. This meter consists of mainly three sections: measurement, processing, and data relaying. The measurement section comprises voltage and current sensors along with an external ADC MCP3008. In most common circuits, a resistive voltage divider is used to step down and sample the line voltage, but that suffers from power line and stray noise issues. To overcome this, galvanic isolation is necessary between the power and measurement circuitry. Therefore, ZMPT101B is chosen for the voltage sensing because of its onboard potential transformer. This sensor belongs to the high-accuracy measurement class of 0.2, has a 1% linearity, and gives analog voltage output proportional to the line voltage applied across its input terminals. The ADC MCP3008 samples this output voltage, and it streams the digital readings to the dataplane processing unit (DPU) by SPI protocol. The current is measured by an integrated differential Hall-effect (Infineon TLI4970) sensor, which can measure up to 50 A of peak value with a factory calibrated 1% precision range. This current sensor chip consists of an integrated differential Hall sensor on board along with integrated stress and temperature measurement sensors to compensate the readings for chip stress and temperature variations. It utilizes onboard DSP to process and filter the measurements directly. This DSP can be configured to design a filter of the user’s choice to output the processed signal directly via the SPI bus. Both the sensors are synchronized with the help of a real-time operating system (RTOS) to avoid any significant phase angle errors.
The core of the DPU is ESP32, which has a very capable 32-bit dual-core Tensilica Xtensa LX6 microprocessor with a rich number of multiplexed and programmable GPIO pins and communication protocol support like UART, SPI, I2C, I2s, and CAN. The key feature of this module is the integrated Wi-Fi and dual-mode Bluetooth. This Wi-Fi can run in both station and access modes. It can be used to connect to the internet for data upload, and it can also host a local webpage to the users via TCP/IP to display data to the users. The Bluetooth function can also run in both classical Bluetooth and Bluetooth Low Energy (BLE) mode. The Bluetooth module can also be connected to the user’s smartphone to display the PQ measurements. It also has RTOS support, which is maintained by the manufacturer. Overall, this meter runs on a 5 V power supply and consumes significantly less power, typically around 1.5 W. It is very power efficient and can be powered from miniature power supplies like smartphone charging adapters without hassle. The power adapter can be integrated within the meter and powered from the incoming AC lines.
This MCU polls both voltage and current sensors at a high sampling rate of 2048 samples per second and computes 28 parameters from the voltage and current raw data. The parameters include fundamental frequency, actual and gross RMS values of voltage and current, magnitude and phase of voltage and currents, active power and energy, reactive power and energy, THD, DPF, voltage sag and swell, utility distortion volt-ampere, and consumer distortion volt-ampere. Finally, it calculates the penalties/incentives for the consumer based on these extracted parameters.
The meter records the PQ phenomena for monitoring and post analysis and sends all the data to the remote server every minute continuously. The meter uses the HTTP POST protocol to send the data to the specified domain address. This domain has a PHP script running, which captures this data and injects it into the MySQL database. These readings can be accessed and visualized on the webpage for both users and the utility provider. This meter can also log the data via its UART port to a PC for analysis and diagnostic purposes.
4. Algorithm
The smart meter must perform both energy and PQ metering in real time, and hence the RTOS is used to handle all the mission-critical activities. This RTOS divides all the functions into smaller tasks, which have their priority and resources assigned to them. This RTOS supports symmetrical multiprocessing (SMP) in which each core shares resources with the other and has a dedicated scheduler for task scheduling. The scheduler in the RTOS makes sure that each task gets enough computational and hardware resources according to the priority and finishes its execution in the allocated timeline. Nevertheless, this needs careful execution because sharing resources can result in deadlocks, spinlocks, and core panics. Therefore, tools like semaphores and mutexes are used to avoid these issues.
For this meter, the functions are divided into three major tasks: measurement, processing, and data relaying. The measurement task is pinned to core 1 of the CPU and is used to poll the sensors regularly and update the array containing voltage and current samples. This core samples the readings in the current instant by utilizing hardware timer interrupts. This task is very time-critical, meaning that the polling should be symmetrical and synchronous; otherwise, it may compromise the overall meter functionality. The polling task is depicted with s1, s2, s3, etc., as shown in
Figure 4. Since the sampling frequency is 2048 Hz, the readings are taken at an equidistant sampling interval of 1/2048 s. With the selected sampling rate, the meter can measure the harmonics up to 20th order in both voltage and current. The second task of processing is pinned to core 0 of the CPU, processes the voltage and current readings captured in the previous second, and posts the data to the server every minute. This task has a deadline of 1 s, indicating that the readings of the previous second should be processed entirely, and the processor should be idle before the new readings arrive. The timeline of all the tasks and their respective cores are shown in
Figure 4. The final task of data relaying is also pinned to core 0, and this task is executed every 60 s. This task relays both active and reactive power and energy, DPF, distortion VA of the grid and consumer, and the penalties and incentives for the PQ profiles. All the tasks run parallelly in real time, as shown in the timeline, and all the hardware resources and programming variables are shared within the two cores simultaneously.
4.1. Measurment
As the voltage and current waveforms are sampled at 2048 Hz, the interrupt should be generated at every 488.28 μs interval. To do so, an appropriate count is loaded in timer 1 of core 1, and this timer interrupt updates a flag variable in the interrupt service routine (ISR) upon its overflow, indicating to the core that the time has elapsed and the sensors should be polled. The sensors are polled for a complete 1 s interval like this, and the sampled readings are passed to core 0 for the calculation task. After this, polling for the next second begins again, and the process continues forever in a loop. It is a time-bound infinite loop that runs continuously in parallel to all the other tasks. The flow chart of the whole program is shown in
Figure 5.
4.2. Processing
For the implementation of the penalty/incentive scheme, the following listed power, energy, and PQ parameters are measured.
4.2.1. DC Offset, Fundamental Frequency, Magnitude, and Phase Spectrum, and the DPF
A split radix FFT algorithm, a variant of the Cooley–Tukey FFT algorithm that uses a mixture of radices 2 and 4, is used to calculate the DC and fundamental frequency component of a distorted signal. Here, both the sampling frequency and the number of samples are set to 2048, which results in a sharp frequency resolution of 1 Hz. After extraction of the magnitude and phase angles of all required frequency components, the DPF can be calculated from the phase difference of the fundamental voltage
and current
as below.
4.2.2. True RMS Value
Unlike the conventional method, which finds the RMS value from its amplitude, this method computes the true RMS value as given in (3).
4.2.3. Active and Reactive Power
The active (P) and reactive (Q) powers can be computed by using the RMS value of the fundamental voltage and current components and the DPF value as follows.
4.2.4. Active and Reactive Energy
Similarly, the active and reactive energies can be found by multiplying the active and reactive power values with time. In this case, the time set is to 1 s, meaning that at any second, active or reactive energy being utilized is equal to active or reactive power. Here, the term ( corresponds to the phase difference between the fundamental voltage and current.
4.2.5. THD in Voltage and Current
THD, an acronym for total harmonic distortion, is a quantity defined as the ratio of harmonic RMS voltage/current to the fundamental RMS voltage/current. The THD values indicate the amount of distortion with respect to the fundamental component. The THD in voltage and current can be determined using (6), where
V1,
V2,
V3, etc., represent the magnitudes of the fundamental, second, and third harmonic components, respectively.
4.2.6. Consumer and Grid Harmonic Distortion Power in VA
In the case of nonsinusoidal voltage and current signals, the total apparent power can be computed as in (7), per the IEEE standard [
29].
where
V1I1 is the fundamental apparent power,
V1IH is the current harmonic distortion VA,
VHI1 is the voltage harmonic distortion VA,
VHIH is the harmonic distortion apparent power VA. These power values are used to find the harmonic contribution of the consumer and grid, and then the energy values
WHckVA and
WHukVA are derived.
WHckVA corresponds to the harmonic distortion energy injected by the consumer, and it is found by multiplying the current harmonic distortion value, i.e.,
V1IH, with time.
WHukVA is the harmonic distortion energy due to utility, and it is a product of the
VHIH component and time.
4.2.7. Sag and Swell in the Utility Voltage
The percentage of voltage sag and voltage swell are monitored continuously as given in (8) and (9), respectively.
4.2.8. Penalties and Incentives for PQ violations
Finally, after assessing the power, energy, and necessary PQ parameters for a consumer and utility, these values should be checked for violations of the specified limits. If the consumer load profile adheres to the aforementioned harmonic and power factor limits, the consumer is given an incentive and penalized otherwise. In this scheme, the penalties are imposed because of harmonic limit violations and reactive power limit violations, whereas compensation is given to the consumer for grid voltage distortion due to utility. The total penalty/incentive is obtained using (1)–(9), and they are in addition to the active energy consumption charges.
4.3. Data Relaying
After necessary computations and processing, the PQ smart meter communicates all these quantities to a remote server. This information flow is shown in
Figure 6. The meter gets connected to the Wi-Fi access point, sends an HTTP POST request to the website running the PHP script, and waits for acknowledgment. This PHP script captures the meter data, verifies the access credentials, and then transmits the captured data into the SQL database. This database is then later used for visualization by another PHP script on the website to display the data for the user.