TheCyrus
Newbie level 2
Hello Guys, this is my first post here. I tried searching around the web and on the forum but I couldn't find a definite answer to my problem.
I'm designing an electricity meter from scratch. I'm already measuring with great accuracy the active energy but I'm facing some problems with the reactive energy (RE).
In order to make the calculation of RE I need to shift the voltage signal by 90 degrees. I succesfully did it using a second-order low-pass digital filter of the following form:
\[volt_{45deg} = (1-\alpha)volt_{45deg}[i-1] + (\alpha)volt\]
\[volt_{90deg} = (1-\alpha)volt_{90deg}[i-1] + (\alpha)volt_{45deg}\]
This works good for 60Hz (My nominal frequency). But as a requirement I need to be able to measure with accuracy the RE from 50Hz to 70Hz. Since the filter is frequency-dependent I had to create a way to calculate the signal frequency (or period) and recalculate the filter alpha based on it.
I'm fiding the signal period with good accuracy (1/256 of the sample interval) using interpolation by succesive approximation. I found the value of alpha experimentally for 50 to 70hz and then used excel regression tool to find a 2nd-order polynomial approximation of the alpha formula. The problem is that this equation can lead up to 9% of error in the alpha, and the RE calculation is very sensitive to this.
Another problem I'm facing is that, even when I find the correct alpha for a given frequency, the new 90 degree shifted signal has different amplitudes for different frequencies. This is, the 50Hz 90deg shifted signal and the 60Hz 90deg shifted signal have different maximum values. The filter has different amplitude response for the same phase shift, on different frequencies. Because of this I'll have also to create a way to compute on-the-fly my reactive energy amplitude constant.
What I'd like to know from you, more experienced dsp engineers, is if I'm going on the right direction here, or should I try something different to shift the voltage signal? A different filter topology maybe? Really, any hints are welcome. On the internet I have found about the Hilbert Transform, but it sounded expensive to compute. (I'm using a low-end 16-bit microcontroller). Please let me know if there's any more information I can give you to help me with this. Thanks!!
I'm designing an electricity meter from scratch. I'm already measuring with great accuracy the active energy but I'm facing some problems with the reactive energy (RE).
In order to make the calculation of RE I need to shift the voltage signal by 90 degrees. I succesfully did it using a second-order low-pass digital filter of the following form:
\[volt_{45deg} = (1-\alpha)volt_{45deg}[i-1] + (\alpha)volt\]
\[volt_{90deg} = (1-\alpha)volt_{90deg}[i-1] + (\alpha)volt_{45deg}\]
This works good for 60Hz (My nominal frequency). But as a requirement I need to be able to measure with accuracy the RE from 50Hz to 70Hz. Since the filter is frequency-dependent I had to create a way to calculate the signal frequency (or period) and recalculate the filter alpha based on it.
I'm fiding the signal period with good accuracy (1/256 of the sample interval) using interpolation by succesive approximation. I found the value of alpha experimentally for 50 to 70hz and then used excel regression tool to find a 2nd-order polynomial approximation of the alpha formula. The problem is that this equation can lead up to 9% of error in the alpha, and the RE calculation is very sensitive to this.
Another problem I'm facing is that, even when I find the correct alpha for a given frequency, the new 90 degree shifted signal has different amplitudes for different frequencies. This is, the 50Hz 90deg shifted signal and the 60Hz 90deg shifted signal have different maximum values. The filter has different amplitude response for the same phase shift, on different frequencies. Because of this I'll have also to create a way to compute on-the-fly my reactive energy amplitude constant.
What I'd like to know from you, more experienced dsp engineers, is if I'm going on the right direction here, or should I try something different to shift the voltage signal? A different filter topology maybe? Really, any hints are welcome. On the internet I have found about the Hilbert Transform, but it sounded expensive to compute. (I'm using a low-end 16-bit microcontroller). Please let me know if there's any more information I can give you to help me with this. Thanks!!