LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Basic DC/RMS VI

Hey everyone,

 

Currently, I am able to acquire 4-channels through a NI-9215, writing the DAQ counts to a binary file. This binary file is then processed using MATLAB. My problem comes with a DC offset that is present. You can see it in the "from daq" picture I've posted.

 

What's the best way to remove this DC offset as it sample? (In our project, the dc offset changes throughout time, so this DC offset being subtracted from the waveform needs to be dynamic as well.)

 

I've attached a portion of my block diagram also.

 

Thanks in advance!

 

 

- Y

 

 

Download All
0 Kudos
Message 1 of 5
(3,069 Views)

Some clarification:

 

For the 'from daq' picture, 32768 is equivalent to 0 for a 16 bit ADC. So ideally, the data should be centered around 32768.

0 Kudos
Message 2 of 5
(3,054 Views)

Hey this is Paul with Applications Engineering at NI.

 

I don't know if I can fully help you without understanding more about your system and your code.

 

First off, National Instruments recommends that you routinely perform a complete calibration at least once every year (https://www.ni.com/docs/en-US/bundle/ni-9215-cal-pro/resource/372026b.pdf).  For usage within that year, your offset should be no more than +/- 1.5mV at a 0V reading, per pages 9 and 10.

 

If you need more info about your current calibration, you can can select your device in Measurement and Automation Explorer, and then on the bottom of the ride side of the screen, click the 'Calibration' tab.  An important piece of info is the current temperature compared to the temperature from the last calibration.  If these are far apart, then this would explain why you are experiencing so much offset as explained below.

 

If you want to understand more about the accuracy and errors of our DAQ devices, then read on.  Our DAQ devices do have some offset errors which can be accounted for, and with any AI device, there is going to be some level of error in the reading.  We can calculate a maximum expected error from your readings based on your voltage range, and we can calculate your offset error with the change in temperature since your last reading.  These 2 values paired with the data found in the specifications for your NI 9215 manual (https://www.ni.com/docs/en-US/bundle/ni-9215-getting-started/page/overview.html) will allow you to calculate your errors.

 

To find out more about calculting error, you first need to understand how it affects you:  http://www.ni.com/advisor/accuracy/acc_support.htm  .  And then we need to calculate it:  https://www.ni.com/en/support/documentation/supplemental/18/calculating-absolute-accuracy-or-system-...

 

If you believe calibration is a concern for this error, then you can do it yourself per the Calbration Manual from above, or through National Instruments (https://www.ni.com/en/shop/services/hardware/calibration-services.html) or other services.

 

If you believe error and calibration is not at fault, then I would like to have a closer look at your code.  Something a little strange seems to be going on, and if we could probe it and look around, then we may be able to identify the problem.  Would you mind posting it here?

 

 

  

Paul Davidson
National Instruments
Product Owner - ni.com Chat
Message 3 of 5
(3,031 Views)

Hi Paul,

 

Thanks for your reply. Here is my .vi that I am using to acquire my data. I then process the binary files using MATLAB.

 

 

0 Kudos
Message 4 of 5
(3,018 Views)

Your code looks good to me.  I was concerned about the math and manipulations you were doing to the data before storing it, but everything looks good now.  Besides using my previous recommendations to identify your error, you can use the Averaged DC-RMS function detailed in the following KB to eliminate your offset.  http://digital.ni.com/public.nsf/allkb/C1F39233BD94F2F08625736B00593E22  .  Let me know if you have any further questions.

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 5 of 5
(2,997 Views)