LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview_power_logging

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 

0 Kudos
Message 1 of 6
(1,415 Views)

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"! 😄

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,380 Views)

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 ?

0 Kudos
Message 3 of 6
(1,351 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,343 Views)

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😞

 

Config AI to read recent.png

 

 

 

 

 

 

 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(1,338 Views)

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. 

 

0 Kudos
Message 6 of 6
(1,315 Views)