From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acceleration to displacement using labview

Hi, 

 

I'm new in labview , i need to get displacement from acceleration signal and doing two integrations to get the displacement, i'am using ADXL335 Accelerometer, when i begin the first integration to get velocity the signal drifts ,is that have something with DC compenont or DC offsets? if so is there a solution to remove it?

Thank you  

0 Kudos
Message 1 of 14
(4,944 Views)

You will normally do a calibration on your accelerometer.  This would include an offset value that you would measure when there is no load (everything is stationary).  Then it is just a simple subtraction to remove the offset.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(4,910 Views)

Thanks for your replay, actually i did calibration and removed the mean offset (noise of the signal) but the drifting persists , may be there is another cause.

I'm using integral x(t) PtByPt Vi to do integration.

I will be greateful for Any suggestions .

 

Thanks.

0 Kudos
Message 3 of 14
(4,902 Views)

Do you happen to have Sound and Vibration toolkit? It has built in integration function along with other useful tools. If you must use the "integral x(t) PtByPt Vi", I would double check your integral computations using known waveform. i.e. Insert sin(x) as an input waveform and you should get output waveform as -cos(x)+c.

0 Kudos
Message 4 of 14
(4,887 Views)

Thanks for your answer. I did what you said with a noisy sin waveform and it's drifting at the same way. Actually , i have a noisy acceleration signal (I filtred but some noises still).

unfortunately ,  i haven't using this toolkit  ''Sound and Vibration toolkit'' before. I will try to upload it and try it.Smiley Wink

Thank you.

 

0 Kudos
Message 5 of 14
(4,874 Views)

Think of Integration as a Sum over Time.  Assume whatever you are summing has a mean value that is no exactly 0, and that your sum operation is accurate.  Do you know what the integral of a (small) constant looks like?  It's a straight line with a slope equal to the (small) constant, so "drift" is unavoidable in most integration schemes.

 

What you do is to try, as well as possible, to calibrate your instrument so that the offset is as close to zero as practical.  Then if you want to get really fancy, you estimate the slope and basically subtract it out.  Or you can high-pass filter (a fancy name for what I just said ...).

 

Incidentally, did you notice that the Manufacturer says that 0g = 1.5v ± 0.15v?  That is, there's a 10% (wow, ten percent!) "error" (or "variability") in the 0g offset.  Fortunately, the percent error in the Gain coefficient is ... also 10%.  So Calibration of this gadget isn't a "luxury", it's a necessity.

 

A very interesting exercise, one that will definitely teach you about accelerometers, calibrations, and funky non-linear algorithms, is to dream up a calibration procedures that can be done in 15 seconds (with LabVIEW connected to the accelerometer) for all three axes using nothing more than a steady hand (I recommend using the hand to hold the accelerometer against a tabletop).  It requires making six measurements and doing some hairy math ...

 

Bob Schor

Message 6 of 14
(4,856 Views)

Thanks 

0 Kudos
Message 7 of 14
(4,831 Views)

Here's an easy "crude" "semi-calibration" you can do.

  • Assumption -- you are restricting yourself to 2-D motions, i.e. you are sliding the accelerometer smoothly on a planar surface (e.g. a tabletop).
  • Assumption -- when plopped down on the table, the Z axis is up, and X and Y are out the "sides".  Let's say, for this discussion, that X is along the dimension where the connecting wires emerge, and Y is at right angles to it.
  • Fact -- if the Accelerometer is stationary, the net acceleration is 0.
  • Procedure --
    • Hold Accelerometer stationary on, say, the right edge, so the Y axis "sees" either +1g or -1g.  Record the voltage.
    • Repeat, but with left edge down.  Record the voltage.
    • The mean of these voltages is the 0g offset for Y.  "For free", you can use half the difference to get the Voltage corresponding to 1g for Y.
    • Repeat these steps holding the Accelerometer "Nose Up" and "Nose Down" for the two X axis readings.

Crude, but if you (a) hold the accelerometer steady (so net acceleration remains 0), and (b) you are reasonably close to orienting the X and Y axes vertically, your readings should be a big improvement over "uncalibrated" values.

 

Bob Schor

Message 8 of 14
(4,807 Views)

Thank you again for your replay, your suggestion was good to do, of course for my work i want to measure the displacement on the Z axis between two points (depth). i did the calibration above and unfortunently it doesn't work as i suppose to,i don't really know how to solve this, i can't remove this drifting.Smiley Sad

Any other suggestions ...

Thanks.

0 Kudos
Message 9 of 14
(4,786 Views)

I am assuming this how you have your DAQ channel configured?

0 Kudos
Message 10 of 14
(4,776 Views)