LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to measure RMS power from V and A

Solved!
Go to solution

I am measuring grid voltage and current from NI module using CRIO 9074 and I want to calculate the RMS power of the grid but getting different values in program as per the actual. 

 

I tried as per the image attached here to get the grid power.

 

Thanks

meharda_92_0-1640149293841.png

 

0 Kudos
Message 1 of 10
(1,740 Views)

Hi meharda,

 


@meharda_92 wrote:

I am measuring grid voltage and current from NI module using CRIO 9074 and I want to calculate the RMS power of the grid but getting different values in program as per the actual.


Do you really think you measure fast enough (aka "sufficient samplerate" according to Nyquist and Shannon) using the ScanEngine?

 


@meharda_92 wrote:

I tried as per the image attached here to get the grid power.


LabVIEW cannot run/edit/debug images, so I wonder how you "tried this" using that image…

Why don't you attach real code?

 

On that image:

  • Why are there charts in the cRIO VI? The cRIO9074 does NOT support any displays so charts are useless…
  • Why do you collect data in unlimited arrays? This is a real NO-GO on a realtime target!
  • Where do those light-blue icons/subVIs come from? Which toolkit do you use?
  • Why are there so many coercion dots visible in your image?
  • Which measurement modules do you use?
  • Why don't you use the FPGA?
Best regards,
GerdW


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

I am using using cRIO9074 with NI module NI 9225 for voltage measurement and NI 9227 for current measurement, how to calculate the power and without delay.

I am attaching sample program for reference.

 

 

 

0 Kudos
Message 3 of 10
(1,679 Views)
Solution
Accepted by topic author meharda_92

Hi!

 

  • For a correct measurement, the sample rate must be choosen correctly. For a 50Hz power grid, I'd take at least 500 samples per second.
    If your current has steps or spikes, a higher sample rate might be necessary to record it correctly.
  • To calculate RMS power, you need samples of exactly one period (0,2s at 50Hz) or multiples of it, otherwise the value is not correct. If your sample time is much bigger than the period time, the error becomes neglible.
  • If the load is a resistor, you can calculate RMS of voltage, RMS of current, and then multiply both values to get active power.
  • If the load is NOT a resistor, multiply each voltage sample with its corresponding current sample, and calculate the average. This is the active power.
  • Are voltage and current samples taken at the same time?

 

 

0 Kudos
Message 4 of 10
(1,631 Views)

RMS power is a useless quantity.  You most likely want average power.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 10
(1,623 Views)

@paul_cardinale wrote:

RMS power is a useless quantity.  You most likely want average power.


I have been trying to come up with a nice way to say that power in AC circuits is not simply Vrms * Irms.

 

Unless of course your load is purely resistive, which is very unlikely... 

 

Maybe this tutorial will help? Power in AC Circuits

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 10
(1,616 Views)

@RTSLVU wrote:

@paul_cardinale wrote:

RMS power is a useless quantity.  You most likely want average power.


I have been trying to come up with a nice way to say that power in AC circuits is not simply Vrms * Irms.

 

Unless of course your load is purely resistive, which is very unlikely... 

 

Maybe this tutorial will help? Power in AC Circuits

 


In AC circuits, power = Vrms * Irms * PowerFactor.  Where PowerFactor = cos(phase_difference_between_V_and-I).

Or if you want to use complex math: power is the cross product of Vcomplex and Icomplex.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 10
(1,607 Views)

@paul_cardinale wrote:

@RTSLVU wrote:

@paul_cardinale wrote:

RMS power is a useless quantity.  You most likely want average power.


I have been trying to come up with a nice way to say that power in AC circuits is not simply Vrms * Irms.

 

Unless of course your load is purely resistive, which is very unlikely... 

 

Maybe this tutorial will help? Power in AC Circuits

 


In AC circuits, power = Vrms * Irms * PowerFactor.  Where PowerFactor = cos(phase_difference_between_V_and-I).

Or if you want to use complex math: power is the cross product of Vcomplex and Icomplex.


Oops.  That should be DOT product of course.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 10
(1,600 Views)

 Thanks for suggestions and the load is resistive (purely resistive load providing through load emulator) and different sampling rate tried between 100ms to 1000ms and still there is error in calculating power and if I change the load parameters then it does not update immediately ( load will reach to that value by step by step, like if i change load from 200W to 300W then it shows in front panel changing as 201,203,205......230,..300 like that).

 

0 Kudos
Message 9 of 10
(1,578 Views)
Solution
Accepted by topic author meharda_92

Hi!

 


@meharda_92 wrote:

... and different sampling rate tried between 100ms to 1000ms...


You wrote something about grid power. That is, the voltage you are measuring looks like  50-60 sine waves per second!!! If you measure the voltage once per second, you'll get a "random" value. You need a sample rate which gives you many measurements per sine wave. Something like 1ms

 


@meharda_92 wrote:

... if I change the load parameters then it does not update immediately

 


You are attaching each measured value to an array, and all calculations are done on this entire data set. So, the result is always kind of average since the VI was started. As I wrote, do the calculation over a dataset which coveres several sine waves. For example, if you take a sample every 1ms, just keep the last 1000 values in the array, which corresponds to one second. This way, the calculated values will always show the correct value within one second.

0 Kudos
Message 10 of 10
(1,574 Views)