LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternate Current RMS Calculation

Hi everybody,
i have a big problem with RMS calculation.

I have to calculate the RMS of a alternate current with both amplitude
and frequency variable.
Furthermore i'd like to have 500 RMS values per second.

The vi Cicle RMS gives the most accurate calculation for a variable
alternate current. The problems are that it needs a package of input
values (Samples to read) greater than the period of the wave and that
it gives only one RMS value per each input package.

For exemple if current frequency is 10 Hz and i'm acquiring with a 1000
Hz frequency, i need minimum 100 "samples to read" to have my Cicle RMS
calculation done:
one period of wave is 0,1 seconds,
i have one acquisition per 0,001 seconds,
0,1/0,001=100 samples.
In this way, with 100 samples to read and an acquisition rate of 1000
Hz i would have 10 RMS values per second.

My current can change its frequency from 1 Hz up to 200 Hz, so i should
set DAQ Assistant with 1000 Hz and 1000 samples to read and i'd have
only 1 RMS value per second also if frequency rises, losing information
about current's changes...

However i don't think it is impossible to do what i want... maybe using
shift register to have a quite large sample package updating one value
each time with First In First Out method, and calculating RMS each
time.

I hope somebody can help me and i apologize for my bad english...
Best wishes.
Francesco.

0 Kudos
Message 1 of 5
(2,884 Views)

hi there

do you know the PointByPoint analysis vis? (see attachment).

i think this is exactly what you need. don't forget to initialize the vi's databuffer when neccessary.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 5
(2,881 Views)
Thinks about what you want! A RMS with 500Hz update for a 10Hz to 200Hz signal Smiley Surprised
 
With the point by point vis you can get a sliding RMS of your last n samples with an update rate of your sample rate witch should be higher for 200Hz!
 
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 5
(2,864 Views)
Thank you for your advise, i tried using PointByPoint RMS but there are
two problems yet:

1) i don't know when to inizialize it to make it answer well to a
variable signal.
for a static signal its answer is very accurate but as soon as it
changes the vi is very slow to answer.

2) also using it my program write a file with a number of RMS values
per second that is acquisition frequency divided for the number of
samples to read.
exemple: acquisition frequency 1000Hz, samples to read 100, RMS values
per second 10.

Can somebody help me please?
Thank you.
Best regards.
Francesco.

0 Kudos
Message 4 of 5
(2,856 Views)
Francesco,

As Henrik said, you need to think about what it is that you want to measure.

Mathematically RMS can be defined on any number of samples: square root(mean(squares(data))). However, when used to measure the energy in a periodic waveform RMS is only meaningful if calculated over integral periods of the waveform. Many instruments average over a time long compared to the expected period of the waveform so that the error introduced by not being exactly synchronous with the waveform is small.

To get more RMS readings than you have cycles of the input waveform is mathematically feasible and the Point by Point VI will do just that. Our question is whether the results have any meaning?

Do you have any information about when the frequency or amplitude will change (other than the measurement itself)? Do they change abruptly or gradually? Is the signal phase coherent at the changes?

What is the use or purpose for the RMS measurements?

With more information, perhaps someone can offer suggestions which may help you get the results you need, but perhaps via a different method.

For example if your waveform is always sinusoidal, measuring the peak value is just as useful as RMS and much faster.

Lynn
0 Kudos
Message 5 of 5
(2,849 Views)