Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

90 Degrees Shift of Digital Signal

Status
Not open for further replies.

TheCyrus

Newbie level 2
Joined
Apr 28, 2016
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
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!!
 

Not really my area, but a hilbert transform on a periodically sampled signal should help getting a 90 degree component.

But if I was going after real and reactive power, I would:

Real power- Multiply samples of V and I taken as close as possible to the same sample time, then put the result through an IIR low pass filter.

Reactive Power- Find the RMS of voltage and the RMS of current and multiply them together.
 

Not really my area, but a hilbert transform on a periodically sampled signal should help getting a 90 degree component.

But if I was going after real and reactive power, I would:

Real power- Multiply samples of V and I taken as close as possible to the same sample time, then put the result through an IIR low pass filter.

Reactive Power- Find the RMS of voltage and the RMS of current and multiply them together.

Hello ionp, thanks for the reply.
What I do for active energy is similar to what you said, but since I don't need the active power I simply accumulate the instantaneous power to obtain the active energy.
I'm not sure I understood your reactive power calculation method. Vrms*Irms would lead to apparent power (S). You mean I should get the reactive power from the relation S = sqrt(P^2 + Q^2)?
That'd be one kind of solution, though I'm not really interested in knowing the powers (P, Q ,S) and rms values. I'd have to try this to see if I can get accurate metering from it.

I'm also reading about the hilbert-transform in the internet, trying to find a more practical guide, since I know only the basics of DSP.

If someone knows: if I implement an hilbert-transform using IIR filters, the phase shift will be 90 degrees from the original frequency for all frequencies? (My requirement is from 50 to 70Hz). The amplitude response will also be the same? (I mean the maximum value will be the same for different frequencies?).
 

Hello ionp, thanks for the reply.
What I do for active energy is similar to what you said, but since I don't need the active power I simply accumulate the instantaneous power to obtain the active energy.
I'm not sure I understood your reactive power calculation method. Vrms*Irms would lead to apparent power (S). You mean I should get the reactive power from the relation S = sqrt(P^2 + Q^2)?
That'd be one kind of solution, though I'm not really interested in knowing the powers (P, Q ,S) and rms values. I'd have to try this to see if I can get accurate metering from it.

I'm also reading about the hilbert-transform in the internet, trying to find a more practical guide, since I know only the basics of DSP.

If someone knows: if I implement an hilbert-transform using IIR filters, the phase shift will be 90 degrees from the original frequency for all frequencies? (My requirement is from 50 to 70Hz). The amplitude response will also be the same? (I mean the maximum value will be the same for different frequencies?).

You are correct about calculating the reactive power.

I have not done a Hilbert transform myself, so perhaps someone else can help you with its implementation.

You can also get magnitude and phase info as a starting point with an FFT at numerous frequencies with spacing dependent on your number of samples and sample rate.

Or you can compute at individual frequencies of interest with a streaming algorithm such as the Goertzel algorithm.
 

Hilbert transform is a theoretical solution. For a restricted frequency range, it can be implemented as FIR with not so many taps.

Alternatively you can implement a differential phase shift between two signals by using multiple (IIR) all-pass filters. That's how wide band quadrature phase shift has been traditionally performed in analog electronics.

Another option is to tune a digital filter or delay line by a PLL locked to the input frequency.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top