08-23-2021 03:45 PM
I'm setting up a cRIO to monitor our building's incoming power, but to be honest, I'm not an expert at AC power. Can someone help me decipher what this chart is telling me? The chart is only graphing L1 at a time rate of 8ms. The analog card I'm using is an NI 9244.
First thing I was surprised about was the positive and negative values. Yes, I know AC current alternates between positive and negative 60 times a second here in the USA. But I'm used to using multimeters where it displays a consistent, "positive" value. So I'm guessing this analog card gives me ALL the literal raw data, and then I have to get the Vrms myself with my code?
According to the NI 9244 datasheet, each input gives me the voltage from line to neutral. I'm surprised to see it peaking to +/-400. Normally a multimeter shows 277VAC. Why is that? I don't think this is a NI cRIO question, but just an AC power question in general.
It also seems to be quite the coincidence that my data is showing the voltage going all the way to +/- 400VAC and the datasheet states that it is 400 Vrms L-N. And so now I'm wondering is some of my data getting cut off? Even though it should only be 277? I'm definitely confused on this part.
08-23-2021 04:11 PM - edited 08-23-2021 04:15 PM
Yes the analog value measured is an instantaneous measurement not some RMS. And the RMS value of an AC signal is sqrt(2) = 1.41 times smaller than the sine peak value.
And the pattern you see is because you are basically measuring at almost (only) double the frequency than the signals own frequency. 60 Hz = 16.6666 ms period time, so you get a so called aliasing. You measure at 8ms interval so you measure a little more than 2 samples per sine period. According to Nyquist your sample frequency is enough (> double the signal frequency) but you can not really do reliable RMS measurement that way.Since the analog input is not an average rectified RMS amplifier you should really sample with higher frequency (>=1kHz) and then you can do the RMS calculation in software. LabVIEW has functions for that where you feed in the time domain signal and get the RMS value back.
08-23-2021 04:16 PM
@rolfk wrote:
Yes the analog value measured is an instantaneous measurement not some RMS.
And the pattern you see is because you are basically measuring at almost (only) double the frequency than the signals own frequency. 60 Hz = 16.6666 ms period time, so you get a so called aliasing. You measure at 8ms interval so you measure a little more than 2 samples per sine period. According to Nyquist your sample frequency is enough (> double the signal frequency) but you can not really do reliable RMS measurement that way.Since the analog input is not an average rectified RMS amplifier you should really sample with higher frequency (>=1kHz) and then you can do the RMS calculation in software. LabVIEW has functions for that where you feed in the time domain signal and get the RMS value back.
Dang, I thought because I was sampling at least double the frequency of the signal I would be getting the true waveform 😞
If I have to sample at more than a thousand times a second, that means I have to buy the FPGA module. All I have is the real time. Welp. Time to send in a request for money lol
08-23-2021 04:29 PM
Actually you might also consider trying to exchange the cRIO chassis for a cDAQ chassis instead. That way you could use DAQmx on your PC to acquire the data (with higher frequency than 1 kHz if you want to).
The FPGA is only really needed if you want to do high speed processing somehow.
08-23-2021 04:32 PM
Unfortunately I don't have access to a cDAQ. We've been using cRIO's exclusively because of the deploy-ability. Need to log data for long periods sometimes and I need my laptop for other things XD
08-24-2021 04:12 AM - edited 08-24-2021 04:13 AM
@David99999 wrote:
Unfortunately I don't have access to a cDAQ. We've been using cRIO's exclusively because of the deploy-ability. Need to log data for long periods sometimes and I need my laptop for other things XD
Ahhh, always those constraints. I haven't played with it so far (I do have the whole LabVIEW software suite available and usually do need the extra capabilities of FPGA processing) but NI did improve DAQmx functionality on the NI Linux RT platform significantly somewhere around 2017/2018 or so. It may be possible to go higher than the 1kHz without having to resort to FPGA programming. The 1kHz limit is when you use the Scan Engine mode, but I'm not sure if there is something in between Scan Engine mode and full FPGA programming, where DAQmx allows more direct control of the C modules, without having to do FPGA yourself.
08-24-2021 12:07 PM
@rolfk wrote:
Actually you might also consider trying to exchange the cRIO chassis for a cDAQ chassis instead. That way you could use DAQmx on your PC to acquire the data (with higher frequency than 1 kHz if you want to).
There are currently 19 cRIO models that support DAQmx. Select "NI-DAQmx" in the Programming Method column to see the list. This is a truly glorious feature. Thank you, NI (and NI Linux Real-Time).