LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage RMS half cycle

Solved!
Go to solution

Hello
I need to know how to get the RMS value of half a cycle.

half cycle means that the rms value is updated every half cycle.

 

for example a signal of 50Hz want to have an rms value every 10ms.

 

Any suggestions?

 

tnkx

0 Kudos
Message 1 of 12
(17,484 Views)

The RMS value of a sine wave is its peak to peak amplitude divided by the square root of 2 (I think?).  For half a cycle, the peak to peak amplitude is cut in half.  So the RMS value would be the peak amplitude (one half of peak to peak) divided by square root of 2.  Somebody correct me if I'm wrong.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 12
(17,480 Views)
tbob gave the correct answer for the wrong reason. For a sine wave, the RMS value is equal to the peak value divided by sqrt(2). If you recall your trig, you know that sin^2(x) is expressable in terms of cos(2x), so the periodicity for RMS purposes is twice the original signal frequency and the RMS value for half a period is the same as for a full period. If you picture sin^2(x) you can easily see this as well.

I am stuck on my iPhone so I am not much help now (insert joke here). I need a few more details, I know you want to update the rms value every 10 msec, do you want it to be the rms value for the past 20 msec (full period)? Then you just need to split your data into 10 msec chunks and feed the last two chunks to the rms VI.
0 Kudos
Message 3 of 12
(17,466 Views)

 Hi,

 

I try explain my case on the picture above, i need to update my 1 cycle(20ms) rms value every half cycle(10ms ) for a sampled signal like a sliding window.

.

 

 

Example.jpg

 

This info help???

 

tnkx

0 Kudos
Message 4 of 12
(17,439 Views)

If you have the complete array a .. g as shown in your image, start at "a" and take a subset of length 20 ms. Then change the start point to "b" while keeping the length = 20 ms.  You can easily do this in a loop.

 

If you are trying to do this while acquiring the data the process is similar except that you need to accumulate the points and do some bookkeeping to track which points have been analyzed.

 

Lynn 

0 Kudos
Message 5 of 12
(17,427 Views)

YES, i want adquiring the data in real time!!!

 

can you explain bether the secundoption whith adquiring data or give me an example???

 

Tnkx a lot...

0 Kudos
Message 6 of 12
(17,420 Views)
Solution
Accepted by topic author EVO-silva324

See the picture below.  The random number generator is just to simulate some data.  The data is continuously being gathered.  The lower loop processes the data.  First, don't start until there are at least 20mS worth of data.  I used the number 20, but you will have to calculate how many data points will be in 20mS, depends upon your frequency.  So when there are at least 20 points, extract 20 points and do the math to get RMS value.  The loop then continues.  Notice that the shift register is now bumped up by 20, so the next starting index will be 20 instead of 0.  Again wait until 20 more elements have been added, in this case the array size needs to be 40.  Then remove elements 20 - 39 and process them.  The shift register is again bumped up by 20.  This continues until stop is pressed.  The false case in the bottom loop just has a straight through wire for the shift register.  Nothing is changed until the 20 mark is reached.  Adapt this architecture into your code.

 

Process Array_BD.png

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 12
(17,391 Views)

Tbob,

 

Thanks. I did not have a chance yesterday to put together a demo.

 

I think the OP wants to process 20 ms of data every 10 ms.  If so the process gets a bit more complicated because you need to keep the data around to allow for the overlap.  I was planning to keep the entire data set and increment an index by 10 ms and extract a subset 20 ms long.

 

Lynn 

0 Kudos
Message 8 of 12
(17,370 Views)

johnsold wrote:

Tbob,

 

Thanks. I did not have a chance yesterday to put together a demo.

 

I think the OP wants to process 20 ms of data every 10 ms.  If so the process gets a bit more complicated because you need to keep the data around to allow for the overlap.  I was planning to keep the entire data set and increment an index by 10 ms and extract a subset 20 ms long.

 

Lynn 


 

I did exactly what you said, unless I am mistaken.  I used the Array Subset function and increased the index by 20.  Of course that number will be different in the actual application.  But the entire dataset is held in the Data array.  None of it is ever deleted.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 12
(17,358 Views)

Tnkx a lot...

 

I forget say that i need work on the FPGA of a cRIO, whith high sample frequency like 10kS/s or 20kS/s and i need reed a 50Hz signal.

 

i need obtain a value of rms every 10ms.

 

for first time i need read 20ms and calculate firste value of RMS, but after i will do the next rms(20ms) with the last 10ms sampled used on first rms and the new 10ms samples..........

 

 

For example, if i get 100samples every 10ms, see pic bellow:

 2010-06-18 00.17.19.jpg

 

Tankx a lot for help...

0 Kudos
Message 10 of 12
(17,342 Views)