09-29-2021 03:52 PM
HI,
I am using a NI cDAQ 9189 with labview Electrical power toolkit.
I am trying to program a VI in Labview that read a 3 ph Voltage signals and 3 ph current signals, then calculate the active, reactive and apparant power and store the data into a text file.
The difficulty that i face right now is:
1- I need to have the power measurements for all point of raw data (1 power measurements for 1 voltage and current reaw value).
I tought of a moving average to have the best precision, something like a half cycle period of time of 60Hz signal (8ms).
I am not sure how to implement that in labview.
Please help me find a way to implement that kind of logic
Thanks
09-30-2021 02:02 AM
Hi Dahu,
@DAHU8801 wrote:
The difficulty that i face right now is:
1- I need to have the power measurements for all point of raw data (1 power measurements for 1 voltage and current reaw value).
From what I see you already solved that in your consumer loop…
What exactly is the problem?
@DAHU8801 wrote:
I tought of a moving average to have the best precision, something like a half cycle period of time of 60Hz signal (8ms).
How is "60Hz" related to "8ms"???
Having an error of 4% in the duration calculation will definitely not give "best precision"! 😄
09-30-2021 10:06 AM
HI GerdW
Lets make an exemple to figure my problem,
If we read data at 10 kHz with the DAQ with a 1000 samples buffer and we are recording a signal og volatage at 60Hz, that means you have about 6 cycles in the buffer at the cusumer loop witch caluculate power ,so the power calculation is made every 6 cycles.
What i want is to make a power measurement every half cycle (2 measurement per cycle), and use a moving average for more accurate results.
I am not sure how to implement that into the consumer loop ?
09-30-2021 11:13 AM
Hi DAHU,
@DAHU8801 wrote:
If we read data at 10 kHz with the DAQ with a 1000 samples buffer and we are recording a signal og volatage at 60Hz, that means you have about 6 cycles in the buffer at the cusumer loop witch caluculate power ,so the power calculation is made every 6 cycles.
What i want is to make a power measurement every half cycle (2 measurement per cycle),
Using the very same calculation:
You measure at 10kS/s and want to calculate powers 120 times per second: then you need to read 10k/120 = 83.3 samples instead of 1000! I suggest to increase the samplerate to 12kS/s and read 100 samples…
09-30-2021 11:43 AM - edited 09-30-2021 11:55 AM
Why in the world would you want to do a sliding average over 1/2 cycle?!? You're just gonna get a sine wave of reduced amplitude.
If you want to update your average at a rate equal to 1/2 cycle worth of time, that's a subtly different problem that can be solved other ways. Example: a moving average that accounts for, say, 6 full cycles but which you "slide along" to produce a moving average every ~8 msec.
There's also a DAQmx technique that lets you retrieve your data in a non-contiguous way. Then you can request 6 cycles worth of data every 8 msec and do a simple average, knowing that consecutive averages will be based on data with 5.5 cycles worth of overlap. Here's how you do it (extracted from one of my old posts😞
-Kevin P
09-30-2021 04:25 PM
Hi Kevin
Exactly this is what i want to achive, an updated average at a rate equal to 1/2 cycle worth of time. In other words i want 2 power measurements into 1 cycle of 60Hz.
That is why a moving average that accounts for, say, 6 full cycles but which you "slide along" to produce a moving average every ~8 msec seems to me a good idea.
I am not sure how to implement this into my consumer loop, since the power block in labview need at least 1 cycle to have an accurate measure.