11-14-2019 01:51 PM
Hi,
I am using an NI 9219 (mounted on cDAQ-9188) to read voltage output (+/-10V) from a Lion Precision Capacitive sensor (connected to terminals 4& 5 on the NI 9219 connector for voltage measurement). And I am running into issues reading the signals correctly using LabVIEW. I am also reading the position using another sensor-encoder for comparison. Please see below
Test 1: Noise characteristics (no Voice coil effort, time axis in seconds- Sampling rate- 100Hz for all 3 signals)
I tested the sensor readings using NI MAX and those readings did not have any delay. I also checked the sensor readings using an Oscilloscope to verify if the sensor has gone bad but the oscilloscope readings were fine (did not have any delay, were matched to +/-10V).
Test 2: Stepping in position (roughly 7-7.5um steps, 2s wait @ each step, 100 Hz sampling for all signals)
Again, testing with NI MAX I was able to register all these steps.
So, there are two problems I am trying to find the answers to-
1. Why and how does +/-10 V differential signal from the cap sensor translate to +/-30V range when reading with the NI 9219 (both NI MAX and the VI)
2. How to read these cap sensor readings in the VI more accurately (similar to NI max) ?
I have attached some documentation about cap sensor and the VI that I am using.
Any help would be appreciated.
Thanks,
11-25-2019 03:03 PM
Here are the two readings from the sensor (differential) using an oscilloscope (validation that the sensor is working fine):
Each step in both signals is 1.14 V for motion steps of size 6.3 microns.
11-25-2019 03:36 PM
1.a- Your delay issue is indeed a coding problem. You set up your Read task as continuous with a 1 kHz sample rate, but you're only reading one sample at a time. Look in the Example Finder for better information on how to do continuous tasks. I would suggest you remove the Wait until next ms multiple function and only rely on your DAQmx Read function to do your timing for you. Basically, your Read task is filling a buffer at 1000 Hz, and you're removing one every 25 ms (40 Hz). Eventually you'll get a buffer overflow error.
1.b- The sequence structure isn't doing anything for you. I'd recommend you clean up your diagram and "think dataflow" to get your program laid out more cleanly.
2.a- Your sample rate is too high for this card; its conversion time is 10 ms for all channels, thus the max sample rate is 100 Hz. Your discretization is probably coming from reading the same sample multiple times, not an actual issue with the sensor resolution. I'm surprised this didn't throw an error to be honest. With a delta-sigma converter, I don't know how it'll respond when trying to oversample.
2.c- A +/-10V differential signal has a range of +/-20 V total. In other words, with leg A at +10 V and leg B at -10 V, your measurement is 20 V. With leg A at -10 V and leg B at +10 V, your measurement is -20 V. This is where your higher signal measurement is probably coming from.