09-20-2021 03:00 PM
Hello!
I have a problem with my accelerometer data acquisition, I use an ADXL203EB 2 axis accelerometer, when connecting it to myDAQ, I used the one simple (on demand) acquisition mode, and I wonder how to control the acquisition rate with this method. I tried continuous samples with the sampling rate that I wanted 100Hz but the results comes too odd!
Thank you for your help in advance!
Ali
09-20-2021 04:03 PM
Please share the VI in LV 2016 format.
A quick search revealed that ADXL203 is a 2-axis analog output accelerometer, this makes things quite simple in terms of interfacing with DAQ. You have not mentioned the DAQ you're using and how you've wired things up.
I would recommend connecting the Y and Z axis to Analog Input channels of DAQ and use either Voltage - Continuous Input or Finite Input example
The important configuration is to specify both the analog input channels as comma-separated in "Physical Channel" control.
09-20-2021 05:00 PM
Thank you very much for your help, the DAQ that I'm using is a NI myDAQ, about the connection, it's well connected to analogue input channel ai0, the interface that I have for Labview v2020 isn't quite similar for your interface, as a choice, I have 4 choices for acquisition mode: 1 sample(on demand), 1 sample(HW timed), N samples, and continuous samples. when using the 1 sample on demand, it gives me a good result but I want to increase the sampling, where it comes to my question above.
Please find attached the file in 2016 Labview version
Cordially
Ali
09-20-2021 06:01 PM
I would advise against using DAQ assistant and go with DAQmx drivers instead
Please use the example shown below from Help > Find Examples...
DAQ Assistant is like training wheels on a bicycle, it allows you to ride the bicycle and not do high-performance manoeuvres. Whereas DAQmx driver is the bicycle itself, once you learn it, it is up to you to decide how you want to use the instrument.
DAQ Assistant is easy to get started but won't take you far enough if the requirement quickly escalates. This is a great article to understand DAQmx for beginners - https://www.ni.com/en-us/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-ha...
09-20-2021 08:27 PM
I hope you are not a student taking a class where you are exposed to (and expected to learn) LabVIEW. However, you have access to a myDAQ, which I presume you purchased (for a course) or were provided by your school.
Here is the first Rule in learning how to acquire data from almost any device using LabVIEW -- plug it into your PC, start up MAX (the Measurement and Automation EXplorer). In the left-hand pane, click on Devices and Interfaces, find your Device (your myDAQ), expand it, and find the sub-system you want to "explore" (such as A/D 0). [I don't have a myDAQ currently connected, so I can't tell you exactly how the input is named].
Now look over at the right pane, and click on Test Panels. This will let you set up the Input (or "reading") channel or Output (or "writing") channel you have chosen.
At this point, you need to know something about the system you are measuring. In your case, you have a 2-axis Accelerometer that is designed to run off a 5V supply (which I believe the myDAQ can supply) and measure (relatively static) accelerations in the range of ±1g (it will actually go to 1.7g, but it is designed to record static tilt in a 1g gravitational field, similar to what you find in your classroom more or less at the Earth's surface.
In most (>95%) of the cases where you take measurements, you take multiple measurements, as you are (usually) interested in how whatever you are measuring changes as a function of time. In the case of your 2-axis accelerometer, if you read the specification for the chip, you'll know that when it is flat on the table, the X and Y outputs will be near 0. Now suppose you hold it in the palm of your hand, and tilt your hand right and left 10°. Depending on how you have the X and Y axes oriented with respect to your arm, the X or Y voltage should show a "wiggle". If you now raise and lower your arm (tilting the perpendicular axis), the other voltage should vary.
So what do you learn if you take a single sample? You learn the position of the Accelerometer at an "isolated" instance in time. What do you learn if, for example, you sample continuously (and display the data) at 50 Hz? You not only see the position, but can see how it changes as a function of time.
To get this more "interesting" view, set your Sampling to 50 Hz, continuous samples, and take, say, 100 points at a time. If you set MAX up to do this and start the Test Panel, you should see two (possibly time-varying) voltages displayed. Pick up the sensor, put it in your palm, rotate your wrist, end your elbow, see the X and Y axes change.
Now do a Web Search for "Learn 10 Functions in N-DAQmx and Handle 80 Percent of your Data Acquisition Applications". Ignore the early section that talks about the Dreaded DAQ Assistant -- Do Not Use the DAQ Assistant! Learn how to use LabVIEW, instead.
Bob Schor
09-20-2021 09:25 PM
Thank you very much for all the time that you took to help, it's very appreciated, and thanks for the advice I will take it and try if it will work!!
Best regards,
Ali
09-20-2021 09:35 PM
Thanks for your time and all the explanation, in fact, yes I am a student, and I am not ashamed of asking questions, it's like that how we learn. As a resume, I know all the information that you told, thanks very much, and I had even got good results for my Y axis displacement, the problem is that I am not satisfied with the result, I want more sampling with the used 1 sample (on demand) option of data acquisition of the myDAQ, because it gave me a good approximate result. And like I said before, I tried continuous sampling with a sampling frequency of 100 Hz but it didn't give me good results at all!
Thank you more time for your help!
Best regards,
Ali
09-21-2021 03:10 AM
Hi Ali,
@awadaali wrote:
I want more sampling with the used 1 sample (on demand) option of data acquisition of the myDAQ, because it gave me a good approximate result.
I tried continuous sampling with a sampling frequency of 100 Hz but it didn't give me good results at all!
Some thoughts on your sentences:
09-21-2021 03:59 AM
@santo_13 wrote:
DAQ Assistant is like training wheels on a bicycle, it allows you to ride the bicycle and not do high-performance manoeuvres. Whereas DAQmx driver is the bicycle itself, once you learn it, it is up to you to decide how you want to use the instrument.
++ for that
09-21-2021 04:27 AM
These MEMS sensors output some sort of PWM and have a RC lowpass at the output IIRC...
I strongly recommend to sample with 10kSPS , look at it and do a FFT on the signal. You might find some 'funny' peaks.
Followed by the most important part in signal processing: apply a (software) low pass filter 😄
(If one processing is superior to another, it's because of a higher time constant in the low pass filter 😉 )
If one channel behave wiered .. can you try another MEMS board? And inspect the board with a lens .. solder drops , cracks , broken cable ....