Loading ...
Sorry, an error occurred while loading the content.
 

Power-Meter

Expand Messages
  • ehydra
    I built a power-meter for mains and try to calibrate the whole thing via the sound-card. Is it possible to make a script for a realtime power-meter? That is:
    Message 1 of 14 , Nov 5, 2011
      I built a power-meter for mains and try to calibrate the whole thing via
      the sound-card.
      Is it possible to make a script for a realtime power-meter?
      That is:
      1. signed multiply channel L and R
      2. integrate for one or multiple unit of line frequency (e.g. 20ms for
      50Hz). In discrete time steps or better continuous.
      3. dump result into FFT window

      I'm not sure which way to go and looking for help there.

      regards -
      Henry


      --
      ehydra.dyndns.info
    • wolf_dl4yhf
      Hello Henry, The script can control the signal analysis functions, but it s impossible to run the stream of audio samples. There are multipliers which can be
      Message 2 of 14 , Nov 6, 2011
        Hello Henry,

        The script can control the signal analysis functions, but it's impossible to run the stream of audio samples. There are multipliers which can be switched into the signal, but one of the multiplier's input is always a numerically controlled oscillator. For a wattmeter, we'd need a multiplier which takes the inputs from both branches of the signal-processing chain.
        I will implement such a multiplier as part of the 'DSP blackbox' for the next version.

        To measure the DC component in the output one could use a simple lowpass filter with sufficient rejection at the mains frequency.

        Main problem: You will still need some way to calibrate this setup, at least with a digital voltmeter to adjust the soundcard's input volume controls.

        Best greetings,
           Wolf .

        Am 05.11.2011 22:59, schrieb ehydra:
         

        I built a power-meter for mains and try to calibrate the whole thing via
        the sound-card.
        Is it possible to make a script for a realtime power-meter?
        That is:
        1. signed multiply channel L and R
        2. integrate for one or multiple unit of line frequency (e.g. 20ms for
        50Hz). In discrete time steps or better continuous.
        3. dump result into FFT window

        I'm not sure which way to go and looking for help there.

        regards -
        Henry

        --
        ehydra.dyndns.info


      • ehydra
        Fine Wolf. Calibration is not a problem with a Scope and a resitive load like a bulb. - Henry ... -- ehydra.dyndns.info
        Message 3 of 14 , Nov 7, 2011
          Fine Wolf. Calibration is not a problem with a Scope and a resitive load
          like a bulb.

          - Henry


          wolf_dl4yhf schrieb:
          > I will implement such a multiplier as part of the 'DSP blackbox' for the
          > next version.
          >
          > To measure the DC component in the output one could use a simple lowpass
          > filter with sufficient rejection at the mains frequency.
          >
          > Main problem: You will still need some way to calibrate this setup, at
          > least with a digital voltmeter to adjust the soundcard's input volume
          > controls.


          --
          ehydra.dyndns.info
        • wolf_dl4yhf
          The multiplication of two input channels is already working now. Still missing is a way to retrieve the DC component of the product, but I think I will abuse
          Message 4 of 14 , Nov 7, 2011
            The multiplication of two input channels is already working now. Still
            missing is a way to retrieve the DC component of the product, but I
            think I will abuse the 'DC removal' filter for this purpose - it already
            detects the DC component, all that is missing is a function for the
            interpreter to read this value.

            Ok about the light bulb - if you measure the voltage and current
            simultaneously, there's no problem. But due to the temperature dependent
            resistance of the filament, you can't imply the current from the
            measured voltage (or vice versa). If the filament is very thin (as in
            240 Volt bulbs), there may even be a slight phase shift between voltage
            and current caused by this effect.

            New version (beta) will be available in a few days.

            Cheers,
            Wolf .
          • David Fields
            The multiplication of two input channels is already working now. Still missing is a way to retrieve the DC component of the product, but I think I will abuse
            Message 5 of 14 , Nov 7, 2011


              The multiplication of two input channels is already working now. Still
              missing is a way to retrieve the DC component of the product, but I
              think I will abuse the 'DC removal' filter for this purpose - it already
              detects the DC component, all that is missing is a function for the
              interpreter to read this value.
              Wolf,
              Is it possible to take the inputs to the two sounds channels (A and B) and display the freuency spectrum of  (A+iB) and (A-iB) where the i is a 90 degree phase shift? I want to tell more than just if A and B are 90 degrees out of phase -- I want to tell which direction (which of A or B, leads the other). I am doing radio astronomy and I think that there is useful information that can be extracted from comparing two signals that I think will be already in quadrature.

              Thanks,
              David
              N4HBO


              -----Original Message-----
              From: wolf_dl4yhf <dl4yhf@...>
              To: SpectrumLabUsers <SpectrumLabUsers@yahoogroups.com>
              Sent: Mon, Nov 7, 2011 4:30 pm
              Subject: Re: [SpectrumLabUsers] Power-Meter

               
              The multiplication of two input channels is already working now. Still
              missing is a way to retrieve the DC component of the product, but I
              think I will abuse the 'DC removal' filter for this purpose - it already
              detects the DC component, all that is missing is a function for the
              interpreter to read this value.

              Ok about the light bulb - if you measure the voltage and current
              simultaneously, there's no problem. But due to the temperature dependent
              resistance of the filament, you can't imply the current from the
              measured voltage (or vice versa). If the filament is very thin (as in
              240 Volt bulbs), there may even be a slight phase shift between voltage
              and current caused by this effect.

              New version (beta) will be available in a few days.

              Cheers,
              Wolf .
            • ehydra
              ... Why not go over FFT to extract power? A FFT will always remove DC. A FFT will show the instantaneous power budget too. The harmonics are heavily depend on
              Message 6 of 14 , Nov 7, 2011
                wolf_dl4yhf schrieb:
                > The multiplication of two input channels is already working now. Still
                > missing is a way to retrieve the DC component of the product, but I
                > think I will abuse the 'DC removal' filter for this purpose - it already
                > detects the DC component, all that is missing is a function for the
                > interpreter to read this value.
                >

                Why not go over FFT to extract power? A FFT will always remove DC. A FFT
                will show the instantaneous power budget too. The harmonics are heavily
                depend on current phase value of the input signal!!! So one can choose
                integration time by defining the FFT time window.

                Hm. I think we need a LP filter/FIR to integrate after the FFT.


                > Ok about the light bulb - if you measure the voltage and current
                > simultaneously, there's no problem. But due to the temperature dependent
                > resistance of the filament, you can't imply the current from the
                > measured voltage (or vice versa). If the filament is very thin (as in
                > 240 Volt bulbs), there may even be a slight phase shift between voltage
                > and current caused by this effect.

                Yes. I know this. The factor is approx. 5-10 times. Posting was late in
                day time for me ;-)

                A power resistor is the way to go.

                BTW: Even <cheap> resistors are considerable momentary voltage dependent!


                >
                > New version (beta) will be available in a few days.

                Thank you. It doesn't hurt.

                - Henry


                --
                ehydra.dyndns.info
              • wolf_dl4yhf
                Hello David, ... Not sure if this would give almost the same result as the RDF spectrum . It delivers the amplitude (as colour intensity) and the phase
                Message 7 of 14 , Nov 8, 2011
                  Hello David,


                  You asked:
                  Is it possible to take the inputs to the two sounds channels (A and B) and display the freuency spectrum of  (A+iB) and (A-iB) where the i is a 90 degree phase shift?

                  Not sure if this would give almost the same result as the "RDF spectrum". It delivers the amplitude (as colour intensity) and the phase difference (as colour hue). That's much more than only telling if A and B are 90 degrees out of phase. If you really try it, you will see that A leading B, or A lagging B in phase makes a big difference (in the colour hue, and also in the displayed angle when hovering the mouse across the RDF-spectrogram.


                  If input B really was to be shifted by 90 degrees before entering the FFT, it would cause a large CPU load.


                  All the best,
                     Wolf .



                  I want to tell more than just if A and B are 90 degrees out of phase -- I want to tell which direction (which of A or B, leads the other). I am doing radio astronomy and I think that there is useful information that can be extracted from comparing two signals that I think will be already in quadrature.

                  Thanks,
                  David
                  N4HBO


                  -----Original Message-----
                  From: wolf_dl4yhf <dl4yhf@...>
                  To: SpectrumLabUsers <SpectrumLabUsers@yahoogroups.com>
                  Sent: Mon, Nov 7, 2011 4:30 pm
                  Subject: Re: [SpectrumLabUsers] Power-Meter

                   
                  The multiplication of two input channels is already working now. Still
                  missing is a way to retrieve the DC component of the product, but I
                  think I will abuse the 'DC removal' filter for this purpose - it already
                  detects the DC component, all that is missing is a function for the
                  interpreter to read this value.

                  Ok about the light bulb - if you measure the voltage and current
                  simultaneously, there's no problem. But due to the temperature dependent
                  resistance of the filament, you can't imply the current from the
                  measured voltage (or vice versa). If the filament is very thin (as in
                  240 Volt bulbs), there may even be a slight phase shift between voltage
                  and current caused by this effect.

                  New version (beta) will be available in a few days.

                  Cheers,
                  Wolf .

                • David Fields
                  Is it possible to take the inputs to the two sounds channels (A and B) and display the freuency spectrum of (A+iB) and
                  Message 8 of 14 , Nov 8, 2011

                    Is it possible to take the inputs to the two sounds channels (A and B) and display the freuency spectrum of  (A+iB) and (A-iB) where the i is a 90 degree phase shift?

                    Not sure if this would give almost the same result as the "RDF spectrum". It delivers the amplitude (as colour intensity) and the phase difference (as colour hue). That's much more than only telling if A and B are 90 degrees out of phase. If you really try it, you will see that A leading B, or A lagging B in phase makes a big difference (in the colour hue, and also in the displayed angle when hovering the mouse across the RDF-spectrogram.
                    Thanks, Wolf.
                    I was hung up on trying to get something numerical -- I'll see how this works!

                    73,
                    David, N4HBO

                    -----Original Message-----
                    From: wolf_dl4yhf <dl4yhf@...>
                    To: SpectrumLabUsers <SpectrumLabUsers@yahoogroups.com>
                    Sent: Tue, Nov 8, 2011 12:16 pm
                    Subject: Re: [SpectrumLabUsers] Power-Meter for quadrature signals

                     
                    Hello David,


                    You asked:
                    Is it possible to take the inputs to the two sounds channels (A and B) and display the freuency spectrum of  (A+iB) and (A-iB) where the i is a 90 degree phase shift?

                    Not sure if this would give almost the same result as the "RDF spectrum". It delivers the amplitude (as colour intensity) and the phase difference (as colour hue). That's much more than only telling if A and B are 90 degrees out of phase. If you really try it, you will see that A leading B, or A lagging B in phase makes a big difference (in the colour hue, and also in the displayed angle when hovering the mouse across the RDF-spectrogram.


                    If input B really was to be shifted by 90 degrees before entering the FFT, it would cause a large CPU load.


                    All the best,
                       Wolf .



                    I want to tell more than just if A and B are 90 degrees out of phase -- I want to tell which direction (which of A or B, leads the other). I am doing radio astronomy and I think that there is useful information that can be extracted from comparing two signals that I think will be already in quadrature.

                    Thanks,
                    David
                    N4HBO


                    -----Original Message-----
                    From: wolf_dl4yhf <dl4yhf@...>
                    To: SpectrumLabUsers <SpectrumLabUsers@yahoogroups.com>
                    Sent: Mon, Nov 7, 2011 4:30 pm
                    Subject: Re: [SpectrumLabUsers] Power-Meter

                     
                    The multiplication of two input channels is already working now. Still
                    missing is a way to retrieve the DC component of the product, but I
                    think I will abuse the 'DC removal' filter for this purpose - it already
                    detects the DC component, all that is missing is a function for the
                    interpreter to read this value.

                    Ok about the light bulb - if you measure the voltage and current
                    simultaneously, there's no problem. But due to the temperature dependent
                    resistance of the filament, you can't imply the current from the
                    measured voltage (or vice versa). If the filament is very thin (as in
                    240 Volt bulbs), there may even be a slight phase shift between voltage
                    and current caused by this effect.

                    New version (beta) will be available in a few days.

                    Cheers,
                    Wolf .

                  • wolf_dl4yhf
                    New version with the two-channel-multiplier uploaded to the website (non-beta). Documentation of the multiplier:
                    Message 9 of 14 , Nov 8, 2011
                      New version with the two-channel-multiplier uploaded to the website (non-beta).

                      Documentation of the multiplier:

                      http://www.qsl.net/dl4yhf/speclab/circuits.htm#adder_or_multiplier

                      To measure the DC part in the product, use this function:

                      http://www.qsl.net/dl4yhf/speclab/circuits.htm#DC_reject

                      Henry wrote:
                      > Why not go over FFT to extract power? A FFT will always remove
                      DC.

                      Overkill. And no, the FFT does never remove DC - why should it ? The DC component is in the first 'frequency bin' of the real FFT.

                      To measure the power (Wirkleistung) when measuring current and voltage, an FFT isn't necessary.
                      Also the harmonics contribute to it, in fact to measure the total (effective) power, you MUST take the harmonics into consideration.


                      The harmonics are heavily depend on current phase value of the input signal!!!

                      Maybe, it really doesn't matter. The bulb (or resistor) doesn't care. If 100 Volts * 1 Ampere are floating through it, *IN PHASE*, it will dissipate 100 Watts regardless of the frequency (oh well, the filament will emit a bit of light..).



                      So one can choose integration time by defining the FFT time window.

                      Integration time, why ? All you need to make sure is that the lowpass (which retrieves the DC component in the product) has a corner frequency lower than 50 Hz (or your mains frequency). The edge frequency of the 'DC' voltage measurement mentioned above has a corner frequency of approximately 0.1 Hz, which should be ok.

                      All the best,
                         Wolf .

                    • ehydra
                      ... Thanks! I will look on it. ... OK. Is it still possible to direct the multiplied signal then to the FFT window? ... Yes. I want to see all harmonics too.
                      Message 10 of 14 , Nov 8, 2011
                        wolf_dl4yhf schrieb:
                        > New version with the two-channel-multiplier uploaded to the website
                        > (non-beta).
                        >
                        > Documentation of the multiplier:
                        >
                        > http://www.qsl.net/dl4yhf/speclab/circuits.htm#adder_or_multiplier
                        >
                        > To measure the DC part in the product, use this function:
                        >
                        > http://www.qsl.net/dl4yhf/speclab/circuits.htm#DC_reject
                        >

                        Thanks! I will look on it.


                        > Henry wrote:
                        > > Why not go over FFT to extract power? A FFT will always remove DC.
                        >
                        > Overkill. And no, the FFT does never remove DC - why should it ? The DC
                        > component is in the first 'frequency bin' of the real FFT.
                        >

                        OK.
                        Is it still possible to direct the multiplied signal then to the FFT window?


                        > To measure the power (Wirkleistung) when measuring current and voltage,
                        > an FFT isn't necessary.
                        > Also the harmonics contribute to it, in fact to measure the total
                        > (effective) power, you MUST take the harmonics into consideration.
                        >

                        Yes. I want to see all harmonics too. And want to configure the LP
                        corner frequency for integration myself.


                        >
                        >> The harmonics are heavily depend on current phase value of the input
                        >> signal!!!
                        >>
                        > Maybe, it really doesn't matter. The bulb (or resistor) doesn't care. If
                        > 100 Volts * 1 Ampere are floating through it, *IN PHASE*, it will
                        > dissipate 100 Watts regardless of the frequency (oh well, the filament
                        > will emit a bit of light..).
                        >

                        No, misunderstood, sorry. I mean Phasenwinkel!
                        Read: The harmonics depend on the time point in the voltage waveform. If
                        a dimmer switches on, this time point will emit a harmonics burst, all
                        other point of one period will be smoother.


                        >
                        >
                        >> So one can choose integration time by defining the FFT time window.
                        >>
                        > Integration time, why ? All you need to make sure is that the lowpass
                        > (which retrieves the DC component in the product) has a corner frequency
                        > lower than 50 Hz (or your mains frequency). The edge frequency of the
                        > 'DC' voltage measurement mentioned above has a corner frequency of
                        > approximately 0.1 Hz, which should be ok.
                        >

                        As already noted, one can measure power on different time scales.

                        - Henry


                        --
                        ehydra.dyndns.info
                      • wolf_dl4yhf
                        Hello Henry and group, ... Yes, and that s part of the fun: To test it, I fed the multiplier with a 1 kHz sinewave, and checked the squared output on the
                        Message 11 of 14 , Nov 9, 2011
                          Hello Henry and group,


                          you wrote:


                          Is it still possible to direct the multiplied signal then to the FFT window?

                          Yes, and that's part of the fun: To test it, I fed the multiplier with a 1 kHz sinewave, and checked the squared output on the spectrogram. Result:  One "peak" at 0 Hz (=the DC component), and another one at 2 kHz (which doesn't contribute to the power measurement).


                          Yes. I want to see all harmonics too. And want to configure the LP
                          corner frequency for integration myself.

                          In that case, you could use the FFT-based filter in the center of the circuit window to apply any low-pass filtering you like. I didn't try this, but it should work.


                          So much for now, good luck,
                             Wolf .

                        • ehydra
                          I will try this out. Thank you again - Henry ... -- ehydra.dyndns.info
                          Message 12 of 14 , Nov 9, 2011
                            I will try this out.

                            Thank you again -
                            Henry


                            wolf_dl4yhf schrieb:
                            > you wrote:
                            >>
                            >>
                            >> Is it still possible to direct the multiplied signal then to the FFT
                            >> window?
                            >>
                            > Yes, and that's part of the fun: To test it, I fed the multiplier with a
                            > 1 kHz sinewave, and checked the squared output on the spectrogram.
                            > Result: One "peak" at 0 Hz (=the DC component), and another one at 2
                            > kHz (which doesn't contribute to the power measurement).
                            >
                            >>
                            >> Yes. I want to see all harmonics too. And want to configure the LP
                            >> corner frequency for integration myself.
                            >>
                            > In that case, you could use the FFT-based filter in the center of the
                            > circuit window to apply any low-pass filtering you like. I didn't try
                            > this, but it should work.

                            --
                            ehydra.dyndns.info
                          • wolf_dl4yhf
                            I added one little feature for the DC reject / DC measurement function: This time constant is now adjustable (formerly fixed to approx. 10 seconds). So you can
                            Message 13 of 14 , Nov 9, 2011
                              I added one little feature for the DC reject / DC measurement function:
                              This time constant is now adjustable (formerly fixed to approx. 10 seconds).
                              So you can adjust the 'speed' of the measurement, and make the power
                              measurement as slow as necessary (to defeat impulsive noise or
                              similar). You can now measure the DC component *without* removing it,
                              if necessary.

                              It's in the context menu of the "DSP Blackbox", and so far hasn't been
                              documented in the manual.

                              Regards,
                              Wolf .
                            • Hwbgn Hxggo
                              Dear Wolf, a publication with spectrumlab http://www.mdpi.com/2076-3263/1/1/3/ thanks, Cristiano
                              Message 14 of 14 , Dec 9, 2011
                                Dear Wolf,
                                a publication with spectrumlab
                                thanks,
                                Cristiano
                              Your message has been successfully submitted and would be delivered to recipients shortly.